approve(contract, sender, currency, approved, amount)

Feature

Returns raw operation to approve certain amount of point to approved account. Note: If you want to cancel the approve operation, execute approve function again with amount : 0.

Parameters

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

Return Value

object approve point operation

example

const contractAddress = "0x41EFb6902ADcb1214a7123b01af66b1D13b89864fca";
const sender = "0x4874C17C354c498cf44D2946612DBe47fBcE7E87fca";
const currencyID = "MCC"
const approved = "0x07469989b2562afF5E5C3B116CD3AA5Ef814e5a1fca";
const amount = 100000;

const Operation = mitum.point.approve(contractAddress, sender, currencyID, approved, amount);
console.log(Operation);

// output
BaseOperation {
  id: 'mitum',
  fact: ApproveFact {
    hint: Hint { s: 'mitum-point-approve-operation-fact' },
    token: Token { s: '2026-02-19 03:26:20.007 +0000 UTC' },
    _hash: <Buffer 61 67 4e e3 9c fb f8 1c ad 34 7e 85 5c 3a c1 bb fc 21 af e9 18 9e f1 b6 fc 3a 42 11 74 fe 46 e5>,
    sender: Address {
      s: '0x4874C17C354c498cf44D2946612DBe47fBcE7E87fca',
      type: 'mitum'
    },
    items: [ [ApproveItem] ]
  },
  hint: Hint { s: 'mitum-point-approve-operation' },
  _factSigns: [],
  _hash: <Buffer >
}

Last updated