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

Feature

Generate an transfer operation for transferring certain currency from the deposit to a receiver.

Parameters

string contract address, string sender,

string receiver, string | number amount, //The amount to transfer string currency ID

Return Value

object update-account-setting operation

example

const contract = "0x675b7c22dd188Af248985C64278081cC64Dc9bD2fca";
const sender = "0xc12004613aC5e031f642BD79740307E0e91768e4fca";
const receiver = "0xc12004613aC5e031f642BD79740307E0e91768e4fca";
const amount = 20;
const currencyID = "MCC";

const op = mitum.payment.transfer(contract, sender, receiver, amount, currencyID);
console.log(op);

// output
Operation {
  id: 'mitum',
  fact: TransferFact {
    hint: Hint { s: 'mitum-payment-transfer-operation-fact' },
    token: Token { s: '2025-02-06 06:58:11.282 +0000 UTC' },
    _hash: <Buffer fb 71 61 d5 20 74 54 83 1c 6a 63 b0 ea 37 dd c3 5e dd 14 6f d9 19 b4 ae fe c7 bc 60 0c 04 47 cf>,
    sender: Address {
      s: '0xc12004613aC5e031f642BD79740307E0e91768e4fca',
      type: 'mitum'
    },
    contract: Address {
      s: '0x675b7c22dd188Af248985C64278081cC64Dc9bD2fca',
      type: 'mitum'
    },
    currency: CurrencyID { s: 'MCC' },
    amount: Big { big: 20n },
    receiver: Address {
      s: '0xc12004613aC5e031f642BD79740307E0e91768e4fca',
      type: 'mitum'
    }
  },
  hint: Hint { s: 'mitum-payment-transfer-operation' },
  _factSigns: [],
  _hash: <Buffer >
}

Last updated