API ReferenceVaults, collateral, and riskFunction
getCollateralTokens()
function getCollateralTokens( ctx, params?, subgraphUrl, options?): Promise<CollectionPage<CollateralToken>>;Lists the ERC-20 tokens the CollateralVault knows as collateral, from the subgraph, with each
token’s enabled flag and indexed name/symbol/decimals. Paginated via cursor/limit; each call
performs a fresh read.
Parameters
| Parameter | Type | Description |
|---|---|---|
ctx | SDKContext | The SDK context. |
params | GetCollateralTokensParams | The request-specific parameters to filter the returned results. |
subgraphUrl | string | The URL of the subgraph endpoint. |
options | ReadExecutionOptions | Cancellation controls kept separate from collection filters. |
Returns
Promise<CollectionPage<CollateralToken>>
The collateral tokens that match the specified request parameters.
Example
// Every token the CollateralVault currently accepts, across all pages.const tokens: CollateralToken[] = [];let cursor: string | undefined;do { const page = await sdk.loc.getCollateralTokens({ enabled: true, cursor, }); tokens.push(...page.items); cursor = page.nextCursor ?? undefined;} while (cursor);