Properties:
Name | Type | Description |
---|---|---|
quantizedAmount |
string
|
The quantized amount of tokens to be transferred
|
tokenType |
TokenType
|
Type of token (ETH / ERC20 / MINTABLE_ERC20 / ERC721 / MINTABLE_ERC721) |
tokenData |
TokenDataSignTransfer
|
Data of token include (contract_address / tokenId) |
Example
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();
}