Skip to content

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 uses
    • address: Token contract address

Example

const symphony = new Symphony();
const tokens = symphony.getTokenList();
 
// Example output:
{
  "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48": {
    symbol: "USDC",
    name: "USD Coin",
    decimals: 6,
    address: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"
  },
  "0x0": { // Native token
    symbol: "SEI",
    name: "SEI",
    decimals: 18,
    address: "0x0"
  }
  // ... other tokens
}