Integration
Swapping and Aggregation
Javascript SDK
Get Assets

Get Assets

getAssets

Fetches the list of available assets for the given chain.

getAssets(chain: Chain): Promise<AssetData[]>
ParamDescriptionData type
chainThe ID of the chain the returned assetsstring

Example

import { Chains } from "@chainflip-io/chainflip-sdk/swap";
 
console.log(await swapSDK.getAssets(Chains.Ethereum));

Sample Response

[
  {
    "id": "ETH",
    "chain": "Ethereum",
    "contractAddress": undefined,
    "decimals": 18,
    "name": "Ether",
    "symbol": "ETH",
    "isMainnet": true,
    "minimumDepositAmount": "0",
    "minimumSwapAmount": "1000000000000000", // 0.001 ETH
  },
  ...,
  {
    "id": "USDC",
    "chain": "Ethereum",
    "contractAddress": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
    "decimals": 6,
    "name": "USDC Stablecoin",
    "symbol": "USDC",
    "isMainnet": true,
    "minimumDepositAmount": "0",
    "minimumSwapAmount": "1000000", // 1 USDC
  }
;