Interface

ItemSignableBurnParams

ItemSignableBurnParams

Properties:
Name Type Description
quantizedAmount string

The quantized amount of tokens to be transferred

  • If token type is NFT (ERC721, MINTABLE_ERC721), quantizedAmount should always be 1
  • If token type is ETH / ERC20 (ERC20, MINTABLE_ERC20)
  • 1 - Converter for Quantized Amount: It is calculated based on standard rule: (amount * 10^18) / 10 ^ 10
  • 2 - The calculate rule is convert the pure amount of token to WEI (10^10), then devide it by 10^10 (QUANTUM number defined in platform)
tokenType TokenType

Type of token (ETH / ERC20 / MINTABLE_ERC20 / ERC721 / MINTABLE_ERC721)

tokenData TokenDataSignTransfer

Data of token include (contract_address / tokenId)

View Source types/TransactionTypes.ts, line 136

Example

Example of the converter

  function convertAmountToQuantizedAmount(amount: number | string): number {
    const wei = convertNormalAmountToWei(String(amount));
    const QUANTUM = '10000000000'; // 10^10
    return BigNumber.from(wei).div(BigNumber.from(QUANTUM)).toNumber();
  }

  function convertNormalAmountToWei(amount: string): string {
    return ethers.utils.parseEther(String(amount)).toString();
  }