getAssetOptions
Full current-environment registry for pickers, retaining zero balances and unavailable choices.
Import
import { getAssetOptions } from "@0xcurvy/curvy-sdk/actions";Usage
const result = await getAssetOptions({ config });Signature
function getAssetOptions(parameters?: GetAssetOptionsParameters): Promise<AssetOptionsSnapshot>Returns
Promise<AssetOptionsSnapshot>
The action resolves or returns the value shown in the signature.
Parameters
accountId
- Type:
string - Required: no
The account whose balances decide which options are selectable. Defaults to the active account.
const result = await getAssetOptions({
accountId,
});purpose
- Type:
AssetOptionsSnapshot["purpose"] - Required: no
What the picker selects: "private-input", "public-input" or "public-output". Decides which reasons make an option unavailable.
const result = await getAssetOptions({
purpose,
});networkSlug
- Type:
string - Required: no
Only return options on this network.
const result = await getAssetOptions({
networkSlug,
});query
- Type:
string - Required: no
A free-text filter on asset names and symbols.
const result = await getAssetOptions({
query,
});signal
- Type:
AbortSignal - Required: no
Aborts the read.
const result = await getAssetOptions({
signal,
});inputFinalityPolicy
- Type:
GetPortfolioParameters["inputFinalityPolicy"] - Required: no
Which balance buckets count as spendable when evaluating private inputs.
const result = await getAssetOptions({
inputFinalityPolicy: "finalized",
});priceMaxAgeMs
- Type:
number - Required: no
How old prices may be before they are refreshed. Defaults to five minutes.
const result = await getAssetOptions({
priceMaxAgeMs,
});metadataMaxAgeMs
- Type:
number - Required: no
How old registry metadata may be before it is refreshed. Defaults to thirty minutes.
const result = await getAssetOptions({
metadataMaxAgeMs,
});config
- Type:
CurvyConfig - Required: no
Curvy config to use. Defaults to the ambient config.
const result = await getAssetOptions({
config,
});Errors
Errors from config resolution and the underlying SDK operation are propagated to the caller.