Depositing NEO or GAS

NEP5 tokens are deposited by invoking the exchange contract using the deposit operation and specifying the assetID of NEO or GAS, as well as the quantity of the token to deposit.

Deposit NEO

The following example provides a depositNEO function for depositing NEO using the common setup code.

const neoToDeposit = 50;

async function depositNEO(quantity, gasFee=0) {
  executeContractTransaction('deposit',
    [
      u.reverseHex('c56f33fc6ecfcd0c225c4ab356fee59390af8560be0e930faebe74a6daff7c9b'),
      u.num2fixed8(quantity),
    ], 
    neoToDeposit, 0, gasFee);
}

// Call the function to deposit 50 NEO with a .001 gas transaction fee.
depositNEO(
    50, // quantity
    .001 // (optional gas transaction fee)
)

Deposit GAS

The following example provides a depositGAS function for depositing GAS using the common setup code.

const gasToDeposit = 150.05;

async function depositGAS(quantity, gasFee=0) {
executeContractTransaction('deposit',
  [
    u.reverseHex('602c79718b16e442de58778e148d0b1084e3b2dffd5de6b7b16cee7969282de7'),
    u.num2fixed8(gasToDeposit),
  ], 
  0, gasToDeposit, gasFee);
}

// Call the function to deposit 150.05 GAS with no gas transaction fee.
depositGas(
    150.05, // quantity
)