Skip to content

getPortfolio ​

Storage-independent, note-free portfolio including pending-only assets and recovery ownership.

Import ​

ts
import { getPortfolio } from "@0xcurvy/curvy-sdk/actions";

Usage ​

ts
const result = await getPortfolio({ config });

Signature ​

ts
function getPortfolio(parameters?: GetPortfolioParameters): Promise<PortfolioSnapshot>

Returns ​

Promise<PortfolioSnapshot>

The action resolves or returns the value shown in the signature.

Parameters ​

accountId ​

  • Type: string
  • Required: no

The account whose portfolio is built. Defaults to the active account.

ts
const result = await getPortfolio({
  accountId, 
});

inputFinalityPolicy ​

  • Type: InputFinalityPolicy
  • Required: no

Which balance buckets count as spendable.

ts
const result = await getPortfolio({
  inputFinalityPolicy: "finalized", 
});

signal ​

  • Type: AbortSignal
  • Required: no

Aborts the read.

ts
const result = await getPortfolio({
  signal, 
});

priceMaxAgeMs ​

  • Type: number
  • Required: no

Host freshness policy; defaults to five minutes.

ts
const result = await getPortfolio({
  priceMaxAgeMs, 
});

balanceMaxAgeMs ​

  • Type: number
  • Required: no

How old balance data may be before it is refreshed.

ts
const result = await getPortfolio({
  balanceMaxAgeMs, 
});

metadataMaxAgeMs ​

  • Type: number
  • Required: no

Registry metadata freshness policy; defaults to thirty minutes.

ts
const result = await getPortfolio({
  metadataMaxAgeMs, 
});

config ​

  • Type: CurvyConfig
  • Required: no

Curvy config to use. Defaults to the ambient config.

ts
const result = await getPortfolio({
  config, 
});

Errors ​

Errors from config resolution and the underlying SDK operation are propagated to the caller.

Source ​

packages/@0xcurvy/sdk/src/actions/views/getPortfolio.ts