Get Assets
getAssets
Fetches the list of available assets for the given chain
.
getAssets(chain: Chain): Promise<AssetData[]>
Param | Description | Data type |
---|---|---|
chain (required) | The ID of the chain | Chain |
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
}