Comment on page
Token
Token represents an ERC20 token with a unique address and additional data on whether the token is a native currency. The Token class ensures Token equivalence when executing functions.
Property | Type | Modifier | Description |
---|---|---|---|
address | string | readonly | The token contract address. |
chainId | readonly | ||
chainType | readonly | ||
decimals | number | readonly | Number of decimals for the currency. |
symbol | string | readonly | The currency symbol. Optional. |
name | string | readonly | The currency name. Optional. |
isNative | boolean | readonly | Whether the currency is native to the chain and must be wrapped. |
isToken | boolean | readonly | Whether the currency meets the ERC20 standard and if not, needs to be wrapped. |
Note that the
mint
property was previously used to manage Solana tokens but support for Solana on KyberSwap has since been deprecated.Params | Type | Description |
---|---|---|
chainId | number | |
address | string | The token contract address. |
decimals | number | Number of decimals for the currency. |
symbol | string | The currency symbol. Optional. |
name | string | The currency name. Optional. |
Returns whether the token passed in the argument is functionally equivalent to the token implementing this class (i.e. same contract address on the same chain).
Params | Type | Description |
---|---|---|
other | Token | The token to check against. |
Type | Description |
---|---|
boolean | Indicates whether the token passed in the argument is functionally equivalent to the token implementing this class. |
Returns true if the token's contract address sorts before the input token contract address. Also checks if the tokens are equivalent else throws an error (i.e. same contract address and chain).
Params | Type | Description |
---|---|---|
other | Token | The currency to check against. |
Type | Description |
---|---|
boolean | true = Token's contract address sorts before input token address.
false = Token's contract address sorts after input token address. |
Accessor that returns this ERC20 token.
Type | Description |
---|---|
Token | The token implementing this class. |
Last modified 2mo ago