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
chain(required)The ID of the chainChain

Example

import { Chains } from "@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,
    "minimumSwapAmount": "1000000000000000", // 0.001 ETH
    "maximumSwapAmount": null,
  },
  ...,
  {
    "id": "USDC",
    "chain": "Ethereum",
    "contractAddress": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
    "decimals": 6,
    "name": "USDC Stablecoin",
    "symbol": "USDC",
    "isMainnet": true,
    "minimumSwapAmount": "1000000", // 1 USDC
    "maximumSwapAmount": "10000000000", // 10000 USDC
  }
;