Skip to main content
Retrieves the list of tokens supported for deposits into a specific yield strategy.

Import

import { fetchSupportedAssets } from "@paxoslabs/amplify-sdk";

Usage

const assets = await fetchSupportedAssets({
  yieldType: YieldType.CORE,
  chainId: 1, // optional, defaults to mainnet
});

Parameters

ParameterTypeRequiredDescription
yieldTypeYieldTypeYesYield strategy type (CORE, TREASURY, or FRONTIER)
chainIdnumberNoBlockchain network ID (defaults to 1 for mainnet)
interface FetchSupportedAssetsParams {
  /** Yield strategy type */
  yieldType: YieldType;
  /** Blockchain network ID (optional, defaults to mainnet) */
  chainId?: number;
}

Return Type

interface SupportedAsset {
  /** Token contract address */
  address: `0x${string}`;
  /** Token symbol (e.g., "USDC") */
  symbol: string;
  /** Token decimals (e.g., 6 for USDC) */
  decimals: number;
  /** Whether token supports EIP-2612 permit */
  supportsPermit: boolean;
}

type FetchSupportedAssetsResult = SupportedAsset[];

Examples

import { fetchSupportedAssets, YieldType } from "@paxoslabs/amplify-sdk";

// Fetch assets for Core yield strategy
const coreAssets = await fetchSupportedAssets({
  yieldType: YieldType.CORE,
});

console.log(`Found ${coreAssets.length} supported assets`);
coreAssets.forEach(asset => {
  console.log(`${asset.symbol}: ${asset.address}`);
});

Checking Permit Support

Use the supportsPermit field to determine the optimal deposit flow:
const assets = await fetchSupportedAssets({ yieldType: YieldType.CORE });

const asset = assets.find(a => a.symbol === "USDC");
if (asset?.supportsPermit) {
  // Can use gasless permit flow
  console.log("USDC supports permit signatures");
} else {
  // Must use approval flow
  console.log("USDC requires standard approval");
}

Error Handling

Error CodeDescriptionResolution
SDK_NOT_INITIALIZEDSDK not initializedCall initAmplifySDK() first
INVALID_YIELD_TYPEUnknown yield typeUse YieldType.CORE, TREASURY, or FRONTIER
NETWORK_ERRORAPI request failedCheck network connection, retry
import { fetchSupportedAssets, YieldType, APIError } from "@paxoslabs/amplify-sdk";

try {
  const assets = await fetchSupportedAssets({ yieldType: YieldType.CORE });
} catch (error) {
  if (error instanceof APIError) {
    console.error(`API Error: ${error.code} - ${error.message}`);
  }
}