withdraw(sender, target, currency, amount)

Feature

Return raw operation to withdraw from contract account. Only owner of the contract account can execute the operation.

Parameters

string sender address, string target contract address, string currency ID, int amount to withdraw

Return Value

object withdraw operation

example

const sender = "0x517ffA55D06AaEc6Fa9d27B54e21ebfeb58Ff692fca";
const target = "0x626410F061e62d79294f82603b872Db7d1711Bf7fca";
const currencyID = "MCC";
const amount = 1000;

const rawOperation = mitum.currency.withdraw(sender, target, currencyID, amount);
console.log(rawOperation);

// output
Operation {
  id: 'mitum',
  fact: WithdrawFact {
    hint: Hint { s: 'mitum-extension-withdraw-operation-fact' },
    token: Token { s: '2024-06-25 04:30:16.987 +0000 UTC' },
    _hash: <Buffer d2 06 81 29 23 eb 2a 24 e4 ec 57 ac 9c 3f 9b 12 0e 2b 8a e3 b6 7e c8 d0 1a 97 b6 29 98 1b 5c 74>,
    sender: Address {
      s: '0x517ffA55D06AaEc6Fa9d27B54e21ebfeb58Ff692fca',
      type: 'mitum'
    },
    items: [ [WithdrawItem] ]
  },
  hint: Hint { s: 'mitum-extension-withdraw-operation' },
  _factSigns: [],
  _hash: <Buffer >
}

Last updated