redeem(contract, sender, tokenHolder, partition, amount, currency)

Feature

Returns raw operation that redeem token from token holder. Currently redeem is the same as burn. Note : Only contract’s owner (or operator) and authorized STO operator can execute the function. contract’s owner (or operator) can redeem other people's tokens, and STO operators can redeem their own tokens.

Parameters

string contract address, string sender, string tokenHolder, string partition, integer amount, string currency

Return Value

object redeemOperation

example

const contractAddress = "0x41EFb6902ADcb1214a7123b01af66b1D13b89864fca";
const sender = "0x4874C17C354c498cf44D2946612DBe47fBcE7E87fca";
const tokenHolder = "0x07469989b2562afF5E5C3B116CD3AA5Ef814e5a1fca";
const partition = "ABCD";
const amount = 20000;
const currencyID = "MCC";

const redeemOperation = mitum.sto.redeem(contractAddress, sender, tokenHolder, partition, amount, currencyID);
console.log(redeemOperation);

//output
Operation {
  id: 'mitum',
  fact: RedeemTokenFact {
    hint: Hint { s: 'mitum-sto-redeem-operation-fact' },
    token: Token { s: '2023-11-23 05:07:24.035 +0000 UTC' },
    _hash: <Buffer 32 b6 eb f0 45 75 82 9f f3 ae 6a 28 39 61 24 79 0d 93 14 c5 e0 3f 6b 37 de 0b de b7 7e 0e 73 54>,
    sender: Address {
      s: '0x4874C17C354c498cf44D2946612DBe47fBcE7E87fca',
      type: 'mitum'
    },
    items: [ [RedeemTokenItem] ]
  },
  hint: Hint { s: 'mitum-sto-redeem-operation' },
  _factSigns: [],
  _hash: <Buffer >
}

Last updated