Token
is a class which can represent any ERC20-compatible token on any given network, and is a data class.Token
instances for all tokens supported by the Synapse Protocol on all supported networks in the Tokens
namespace, which is easily imported like so:Token
manually, and using a manually instantiated Token
with various functions in the SDK will likely cause undefined behavior, as all compatible bridge tokens are pre-instantiated. constructor
.name
(string
) - The "official" name of the token. Example: "USD Circle" (for USDC)symbol
(string
) - Symbol the token is known by both on and off-chain. Examples: "USDT" (Tether's USD stablecoin), "DOGE" (for Dogecoin)addresses
({ [chainId: number] => string }
) - This field is similarly shaped to decimals
, in that it is a mapping with shape chain id => address for chain (string)
, containing the on-chain addresses of this token for respective Chain ID values.address
chainId: number
- Chain ID of the chain for which you want this token's on-chain address.string
network
, or null
if the token is not supported by the Synapse Protocol on the given network.decimals
chainId: number
- Chain ID of the chain for which you want this token's on-chain decimals.number
network
, or null
if the token is not supported by the Synapse Protocol on the given network.