PixelBridge Core
  • What is PixelBridge Core?
  • ⚪PRODUCT
    • How does PixelBridge Core work?
      • Fees
      • Messaging protocols
      • PixelBridge Core contracts
      • Token value
      • Liquidity provision
    • PixelBridge Core guide
    • How to provide liquidity?
    • How to bridge with PixelBridge Core via mobile TronLink
    • Security audit
  • ⚪PixelBridge CORE SDK
    • Get started
    • Guides
      • General
        • Token info
        • Send
        • Swap
        • Paying fees with stables
      • EVM
        • Transfer
        • Allowance and approve
      • Solana
        • Transfer
        • Swap
      • Stellar
        • Transfer
      • Utilities
        • Amount and fee calculations
        • Transfer time
        • Extra gas limits
  • ⚪SOCIAL LINKS
    • Twtter
    • Telegram
    • Medium
  • ⚪PixelBridge ECOSYSTEM
    • PixelBridge Classic
    • PixelBridge BaaS
Powered by GitBook
On this page
  1. ⚪PixelBridge CORE SDK
  2. Guides
  3. General

Token info

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

Copy

import { PixelBridgeCoreSdk, nodeRpcUrlsDefault } from "@PixelBridge/bridge-core-sdk";

const sdk = new PixelBridgeCoreSdk(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) => t
PreviousGeneralNextSend

Last updated 12 months ago