NativeCurrency
NativeCurrency represents the currency of the chain on which it resides (i.e. the currency which is used to pay for gas on a particular chain). The NativeCurrency class ensures the equivalence of any native currency for the purposes of trades or queries.
GitHub File: nativeCurrency.ts
Extends
Properties
Public
Property | Type | Modifier | Description |
---|---|---|---|
chainId | readonly | The chain ID on which this currency resides. See supported chains. | |
chainType | readonly | The virtual machine environment. Currently supports EVM only. | |
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. |
Constructor
Parameters
Params | Type | Description |
---|---|---|
chainId | number | The chain ID on which this currency resides. See supported chains. |
decimals | number | Number of decimals for the currency. |
symbol | string | The currency symbol. Optional. |
name | string | The currency name. Optional. |
Methods
wrapped() - get
get
Returns the ERC20 wrapped version of the native currency. Note that the token information for the nativeCurrency are stored in weth.ts
.
Returns
Type | Description |
---|---|
Token | The wrapped ERC20 token of the nativeCurrency. |
equals()
Returns whether the currency passed in the argument is functionally equivalent to the native currency (i.e. the currency is tagged as a nativeCurrency and the chainIds are the same).
Parameters
Params | Type | Description |
---|---|---|
other | The currency to check against. |
Returns
Type | Description |
---|---|
boolean | Indicates whether the currency passed in the argument is functionally equivalent to the native currency. |
Last updated