getTokenList
The getTokenList
method returns a list of all available tokens on the current chain that can be used for swaps. Mostly used internally. If you need to check if Symphony supports a token take a look at isTokenListed
.
Signature
getTokenList(): Record<string, TokenInfo>
Returns
Returns an object where:
- Keys are token addresses
- Values are
TokenInfo
objects containing:symbol
: Token symbol (e.g., "USDC")name
: Token name (e.g., "USD Coin")decimals
: Number of decimals the token usesaddress
: Token contract address
Example
const symphony = new Symphony();
const tokens = symphony.getTokenList();
// Example output:
{
"0x0": {
id: "sei_native_sei",
attributes: {
address: "0x0",
name: "SEI",
symbol: "SEI",
decimals: 18,
logoUrl:"https://token-logo-url.com",
},
},
"0xe30fedd158a2e3b13e9badaeabafc5516e95e8c7": {
id: "sei_0xe30fedd158a2e3b13e9badaeabafc5516e95e8c7",
attributes: {
address: "0xe30fedd158a2e3b13e9badaeabafc5516e95e8c7",
name: "Wrapped Sei",
symbol: "WSEI",
decimals: 18,
logoUrl:"https://token-logo-url.com",
},
},
// ... other tokens
}