Tokens

Tokens

Get list of tokens

  • Typescript Core SDK

📚SDK REFERENCE

  • listTokens

Get a list of tokens ordered by contract_address:

Request

const getListTokens = async (
  orderBy: 'contract_address' | 'name' | 'symbol'
) => {
  const response = await client.listTokens({
    orderBy,
  });
  return response;
};
getListTokens('contract_address')
  .then((result) => {
    console.log(result);
  })
  .catch((e) => {
    console.log(e);
  });

Example response

{
  result: [
    {
      name: 'Gods Unchained', // Full name of the token (e.g. Ether)
      image_url: 'https://design-system.XpansionChain.com/hosted-for-ds/currency-icons/currency--gods.svg', // Url for the icon of the token
      token_address: '0x5c9f1680bb6a4b4fc698e0cf702e0cc34aed91b7', // Address of the ERC721 contract
      symbol: 'GODS', // Ticker symbol for token (e.g. ETH/USDC/IMX)
      decimals: '18', // Number of decimals for token
      quantum: '100000000'  // Quantum for token
    },
    // Other tokens returned
    ...
  ],
  cursor: 'eyJuYW1lIjoiRXRoZXJldW0iLCJzeW1ib2wiOiJFVEgifQ'
}

  • Kotlin (JVM) Core SDK

📚SDK REFERENCE

  • listTokens

  • Swift Core SDK

📚SDK REFERENCE

  • listTokens

  • Golang Core SDK

📚SDK REFERENCE

  • ListTokens

  • C# Core SDK

📚SDK REFERENCE

  • ListTokens

Get details about a token

  • Typescript Core SDK

📚SDK REFERENCE

  • getToken

Request

Get details about the token with address 0x1facdd0165489f373255a90304650e15481b2c85:

const getToken = async (address: string) => {
  const response = await client.getToken({
    address,
  });
  return response;
};
getToken('0x1facdd0165489f373255a90304650e15481b2c85')
  .then((result) => {
    console.log(result);
  })
  .catch((e) => {
    console.log(e);
  });

Example response

{
    name: 'XpansionChain Token',  // Full name of the token (e.g. Ether)
    image_url: 'https://design-system.XpansionChain.com/hosted-for-ds/currency-icons/currency--imx.svg', // Url for the icon of the token
    token_address: '0x1facdd0165489f373255a90304650e15481b2c85', // Address of the ERC721 contract
    symbol: 'IMX', // Ticker symbol for token (e.g. ETH/USDC/IMX)
    decimals: '18', // Number of decimals for token
    quantum: '100000000' // Quantum for token
}

  • Kotlin (JVM) Core SDK

📚SDK REFERENCE

  • getToken

  • Swift Core SDK

📚SDK REFERENCE

  • getToken

  • Golang Core SDK

📚SDK REFERENCE

  • GetToken

  • C# Core SDK

📚SDK REFERENCE

  • GetToken

Last updated