transfer(contract, sender, currency, receiver, amount)

Feature
Returns raw operation to transfer given amount of token to receiver.

Parameters

string contract address, string sender, string currency ID, string receiver, string | int amount

Return Value

object transfer token operation

example

const contractAddress = "0x41EFb6902ADcb1214a7123b01af66b1D13b89864fca";
const sender = "0x4874C17C354c498cf44D2946612DBe47fBcE7E87fca";
const currencyID = "MCC"
const reciever = "0x07469989b2562afF5E5C3B116CD3AA5Ef814e5a1fca";
const amount = 100;

const Operation = mitum.token.transfer(contractAddress, sender, currencyID, reciever, amount);
console.log(Operation);

// output
Operation {
  id: 'mitum',
  fact: TransferFact {
    hint: Hint { s: 'mitum-token-transfer-operation-fact' },
    token: Token { s: '2024-05-20 08:41:08.053 +0000 UTC' },
    _hash: <Buffer 6b 7e e4 1d db 73 42 ca f5 04 86 c3 6c 2b 6b e3 82 e1 be ed 34 1b 32 33 bd a2 4f e4 d0 c0 88 28>,
    sender: Address {
      s: '0x4874C17C354c498cf44D2946612DBe47fBcE7E87fca',
      type: 'mitum'
    },
    contract: Address {
      s: '0x41EFb6902ADcb1214a7123b01af66b1D13b89864fca',
      type: 'mitum'
    },
    currency: CurrencyID { s: 'MCC' },
    receiver: Address {
      s: '0x07469989b2562afF5E5C3B116CD3AA5Ef814e5a1fca',
      type: 'mitum'
    },
    amount: Big { big: 100n }
  },
  hint: Hint { s: 'mitum-token-transfer-operation' },
  _factSigns: [],
  _hash: <Buffer >
}

Last updated