Swapping
Integrations
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(optional)The ID of the chainChain

Example

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

Sample Response

[
  {
    "asset": "ETH",
    "chain": "Ethereum",
    "chainflipId": "Eth",
    "contractAddress": null,
    "decimals": 18,
    "isMainnet": true,
    "maximumSwapAmount": null,
    "minimumSwapAmount": "1000000000000000", // 0.001 ETH
    "name": "Ether",
    "symbol": "ETH"
  },
  ...,
  {
    "asset": "USDC",
    "chain": "Arbitrum",
    "chainflipId": "ArbUsdc",
    "contractAddress": "0xCf7Ed3AccA5a467e9e704C703E8D87F634fB0Fc9",
    "decimals": 6,
    "isMainnet": true,
    "maximumSwapAmount": "10000000000", // 10000 USDC
    "minimumSwapAmount": "1000000", // 1 USDC
    "name": "Arbitrum USDC",
    "symbol": "USDC"
  }
]