Token info is a helper class which abstracts
away handling different versions of a Token
represented on Injective.
Ex: USDC token
For a peggy denom -> decimals 6, address: ERC20 contract address, symbol: USDC
For a factory/cw20Denom: (both 6 decimals)
-> if coming from Ethereum through Wormhole take USDCet as the cw20 addresses will match,
-> if coming from Solana through Wormhole take USDCso as the cw20 addresses will match,
Ex: SOL token
For the native token on Solana -> decimals 9
For the cw20 version of the native SOL token on Injective through wormhole -> decimals 8
Ex: CHZ token
For the peggy denom -> decimals 18
For a factory/cw20Denom:
-> For CHZ coming through Wormhole from Ethereum -> decimals 8
When we have multiple cw20 entries (versions) of a token
on Injective we need to match the denom's address with a
cw20 entry and get the decimals for that version
Returns any
decimals
get decimals(): any
Decimals can vary between different versions of a token
so we need to get the decimal places of the token based on the
denom (from which we can derive the source of the token)
Returns any
erc20Decimals
get erc20Decimals(): number
Returns number
isCanonical
get isCanonical(): boolean
Returns boolean
logo
get logo(): string
Returns string
name
get name(): string
Returns string
splDecimals
get splDecimals(): number
Returns number
symbol
get symbol(): any
When we have multiple cw20 entries (versions) of a token
on Injective we need to match the denom's address with a
cw20 entry and get the symbol for that version
Token info is a helper class which abstracts away handling different versions of a Token represented on Injective.
Ex: USDC token
Ex: SOL token
Ex: CHZ token