> For the complete documentation index, see [llms.txt](https://docs.kpk.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.kpk.io/funds/integration/list-approved-assets.md).

# List approved assets

Different funds accept different assets, and some support several. Query the shares contract to discover what a fund accepts:

```solidity
function getApprovedAssets() external view returns (address[] memory);
function getApprovedAsset(address asset) external view returns (ApprovedAsset memory);
function isApprovedAsset(address asset) external view returns (bool);
function assetDecimals(address asset) external view returns (uint8);

struct ApprovedAsset {
    address asset;
    string  symbol;
    uint8   decimals;
    bool    isFeeModuleAsset;
    bool    canDeposit;   // accepted for subscriptions
    bool    canRedeem;    // accepted for redemptions
}
```

`isApprovedAsset` returns `true` if the asset is approved for deposits **or** redemptions; check the `canDeposit` / `canRedeem` flags from `getApprovedAsset` to know which.

{% tabs %}
{% tab title="viem" %}

```typescript
import { createPublicClient, http, parseAbi } from "viem";
import { mainnet } from "viem/chains";

const SHARES = "0x...";
const abi = parseAbi([
  "function getApprovedAssets() view returns (address[])",
  "function getApprovedAsset(address asset) view returns ((address asset, string symbol, uint8 decimals, bool isFeeModuleAsset, bool canDeposit, bool canRedeem))",
  "function isApprovedAsset(address asset) view returns (bool)",
]);

const client = createPublicClient({ chain: mainnet, transport: http() });

const assets = await client.readContract({ address: SHARES, abi, functionName: "getApprovedAssets" });
// e.g. ["0xA0b8...eB48", "0xdAC1...1ec7"]

for (const a of assets) {
  const info = await client.readContract({ address: SHARES, abi, functionName: "getApprovedAsset", args: [a] });
  console.log(info.symbol, { canDeposit: info.canDeposit, canRedeem: info.canRedeem });
  // "USDC" { canDeposit: true, canRedeem: true }
}
```

{% endtab %}

{% tab title="ethers.js" %}

```typescript
import { ethers } from "ethers";

const SHARES = "0x...";
const abi = [
  "function getApprovedAssets() view returns (address[])",
  "function getApprovedAsset(address asset) view returns (tuple(address asset, string symbol, uint8 decimals, bool isFeeModuleAsset, bool canDeposit, bool canRedeem))",
  "function isApprovedAsset(address asset) view returns (bool)",
];

const provider = new ethers.JsonRpcProvider("https://eth.llamarpc.com");
const shares = new ethers.Contract(SHARES, abi, provider);

const assets = await shares.getApprovedAssets();
for (const a of assets) {
  const info = await shares.getApprovedAsset(a);
  console.log(info.symbol, { canDeposit: info.canDeposit, canRedeem: info.canRedeem });
}
```

{% endtab %}

{% tab title="Python" %}

```python
from web3 import Web3

SHARES = "0x..."
abi = [
    {"name": "getApprovedAssets", "type": "function", "stateMutability": "view",
     "inputs": [], "outputs": [{"type": "address[]"}]},
    {"name": "getApprovedAsset", "type": "function", "stateMutability": "view",
     "inputs": [{"name": "asset", "type": "address"}],
     "outputs": [{"type": "tuple", "components": [
        {"name": "asset", "type": "address"}, {"name": "symbol", "type": "string"},
        {"name": "decimals", "type": "uint8"}, {"name": "isFeeModuleAsset", "type": "bool"},
        {"name": "canDeposit", "type": "bool"}, {"name": "canRedeem", "type": "bool"}]}]},
    {"name": "isApprovedAsset", "type": "function", "stateMutability": "view",
     "inputs": [{"name": "asset", "type": "address"}], "outputs": [{"type": "bool"}]},
]

w3 = Web3(Web3.HTTPProvider("https://eth.llamarpc.com"))
shares = w3.eth.contract(address=SHARES, abi=abi)

for a in shares.functions.getApprovedAssets().call():
    info = shares.functions.getApprovedAsset(a).call()
    print(info[1], {"canDeposit": info[4], "canRedeem": info[5]})  # symbol, flags
```

{% endtab %}
{% endtabs %}

<figure><picture><source srcset="/files/fgttZo98gjl3WwwWhJaB" media="(prefers-color-scheme: dark)"><img src="/files/JBAUxBo0AI5vCYDmeEol" alt=""></picture><figcaption></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.kpk.io/funds/integration/list-approved-assets.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
