Allbridge Core
LAUNCH APP
  • What is Allbridge Core?
  • ⚪Product
    • How does Allbridge Core work?
      • Fees
      • Messaging protocols
      • Allbridge Core contracts
      • Token value
      • Liquidity provision
    • FAQ
      • How to bridge with Allbridge Core via mobile TronLink
      • Allbridge Core guide
      • How to provide liquidity?
      • What is an Approve Transaction?
    • Security audits
    • Ecosystem reports
    • Leaderboard
  • ⚪Allbridge Core SDK
    • Get started
    • Guides
      • General
        • Token info
        • Send
        • Swap
        • Paying fees with stables
      • EVM
        • Transfer
        • Allowance and approve
      • Solana
        • Transfer
        • Swap
      • Tron
      • Stellar
        • Transfer
      • Utilities
        • Amount and fee calculations
        • Transfer time
        • Extra gas limits
    • Technical reference
    • Referral program
    • Allbridge Core REST API
  • ⚪official support
    • Telegram
    • Discord
  • ⚪Social links
    • Twitter
    • Discord
    • Telegram announcements
    • Telegram group
    • Medium
    • Reddit
  • ⚪Allbridge ecosystem
    • Allbridge Classic
    • Allbridge BaaS
Powered by GitBook
On this page

Was this helpful?

  1. Allbridge Core SDK
  2. Guides
  3. General

Token info

PreviousGeneralNextSend

Last updated 1 year ago

Was this helpful?

To get token info you just have to call a method. It returns a map with keys as a chain symbol, and values as . It has a field named "tokens" that is a map of . You should use this object to identify a token.

import { AllbridgeCoreSdk, nodeRpcUrlsDefault } from "@allbridge/bridge-core-sdk";

const sdk = new AllbridgeCoreSdk(nodeRpcUrlsDefault);

const chains = await sdk.chainDetailsMap();
console.log("Chain details map =", JSON.stringify(chains, null, 2));

const tokens = await sdk.tokens();
console.log("Tokens =", JSON.stringify(tokens, null, 2));

// selecting tokens
const sourceChain = chains[ChainSymbol.SOL];
const sourceTokenInfo = sourceChain.tokens.find((tokenInfo) => tokenInfo.symbol === "USDC");

const destinationChain = chains[ChainSymbol.POL];
const destinationTokenInfo = destinationChain.tokens.find((tokenInfo) => tokenInfo.symbol === "USDC");
⚪
chainDetailsMap
ChainDetailsWithTokens
TokenWithChainDetails