burn(contract, sender, currency, amount)

Feature

Returns raw operation to burn token of sender. Note : Now only token owner can execute.

Parameters

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

Return Value

object burn token operation

example

const contractAddress = "0x41EFb6902ADcb1214a7123b01af66b1D13b89864fca";
const sender = "0x4874C17C354c498cf44D2946612DBe47fBcE7E87fca";
const currencyID = "MCC"
const amount = 40;

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

// output
Operation {
  id: 'mitum',
  fact: BurnFact {
    hint: Hint { s: 'mitum-token-burn-operation-fact' },
    token: Token { s: '2024-06-27 06:40:12.568 +0000 UTC' },
    _hash: <Buffer 92 d9 a0 f0 1b 03 34 96 bf 64 c3 7a a0 1c 99 45 b4 26 43 f4 9a a1 1f 7c b7 71 83 24 76 e2 33 b2>,
    sender: Address {
      s: '0x4874C17C354c498cf44D2946612DBe47fBcE7E87fca',
      type: 'mitum'
    },
    contract: Address {
      s: '0x41EFb6902ADcb1214a7123b01af66b1D13b89864fca',
      type: 'mitum'
    },
    currency: CurrencyID { s: 'MCC' },
    target: Address {
      s: '0x4874C17C354c498cf44D2946612DBe47fBcE7E87fca',
      type: 'mitum'
    },
    amount: Big { big: 40n }
  },
  hint: Hint { s: 'mitum-token-burn-operation' },
  _factSigns: [],
  _hash: <Buffer >
}

Last updated