> ## Documentation Index
> Fetch the complete documentation index at: https://developers.paxoslabs.com/llms.txt
> Use this file to discover all available pages before exploring further.

# fetchSupportedAssets

> Retrieve the list of supported deposit assets for a yield strategy

Retrieves the list of tokens supported for deposits into a specific yield strategy.

## Import

```ts theme={null}
import { fetchSupportedAssets } from "@paxoslabs/amplify-sdk";
```

## Usage

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

## Parameters

| Parameter   | Type        | Required | Description                                             |
| ----------- | ----------- | -------- | ------------------------------------------------------- |
| `yieldType` | `YieldType` | Yes      | Yield strategy type (`CORE`, `TREASURY`, or `FRONTIER`) |
| `chainId`   | `number`    | No       | Blockchain network ID (defaults to 1 for mainnet)       |

```ts theme={null}
interface FetchSupportedAssetsParams {
  /** Yield strategy type */
  yieldType: YieldType;
  /** Blockchain network ID (optional, defaults to mainnet) */
  chainId?: number;
}
```

## Return Type

<Tabs>
  <Tab title="Type Definition">
    ```ts theme={null}
    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[];
    ```
  </Tab>

  <Tab title="Example Response">
    ```ts theme={null}
    [
      {
        address: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
        symbol: "USDC",
        decimals: 6,
        supportsPermit: true,
      },
      {
        address: "0xdAC17F958D2ee523a2206206994597C13D831ec7",
        symbol: "USDT",
        decimals: 6,
        supportsPermit: false,
      },
    ]
    ```
  </Tab>
</Tabs>

## Examples

<Tabs>
  <Tab title="Basic">
    ```ts theme={null}
    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}`);
    });
    ```
  </Tab>

  <Tab title="With React Query">
    ```tsx theme={null}
    import { useQuery } from "@tanstack/react-query";
    import { fetchSupportedAssets, YieldType } from "@paxoslabs/amplify-sdk";

    function useAssets(yieldType: YieldType) {
      return useQuery({
        queryKey: ["assets", yieldType],
        queryFn: () => fetchSupportedAssets({ yieldType }),
        staleTime: 5 * 60 * 1000, // 5 minutes
      });
    }

    // In component
    const { data: assets, isLoading } = useAssets(YieldType.CORE);
    ```
  </Tab>

  <Tab title="Asset Selector">
    ```tsx theme={null}
    import { useState } from "react";
    import { useQuery } from "@tanstack/react-query";
    import { fetchSupportedAssets, YieldType } from "@paxoslabs/amplify-sdk";

    function AssetSelector({ onSelect }: { onSelect: (address: string) => void }) {
      const { data: assets } = useQuery({
        queryKey: ["assets", YieldType.CORE],
        queryFn: () => fetchSupportedAssets({ yieldType: YieldType.CORE }),
      });

      return (
        <select onChange={(e) => onSelect(e.target.value)}>
          <option value="">Select asset</option>
          {assets?.map((asset) => (
            <option key={asset.address} value={asset.address}>
              {asset.symbol}
            </option>
          ))}
        </select>
      );
    }
    ```
  </Tab>
</Tabs>

## Checking Permit Support

Use the `supportsPermit` field to determine the optimal deposit flow:

```ts theme={null}
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 Code            | Description         | Resolution                                      |
| --------------------- | ------------------- | ----------------------------------------------- |
| `SDK_NOT_INITIALIZED` | SDK not initialized | Call `initAmplifySDK()` first                   |
| `INVALID_YIELD_TYPE`  | Unknown yield type  | Use `YieldType.CORE`, `TREASURY`, or `FRONTIER` |
| `NETWORK_ERROR`       | API request failed  | Check network connection, retry                 |

```ts theme={null}
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}`);
  }
}
```

## Related

* [YieldType](/v0.3.0/intro/products/earn/developers/types/YieldType) - Yield strategy types
* [Deposit Workflow](/v0.3.0/intro/products/earn/developers/api/deposit-workflow) - Using assets for deposits
* [Deposits Guide](/v0.3.0/intro/products/earn/developers/guides/deposits) - Complete deposit examples
