Skip to main content

Portfolio reads

Version: V2
View Markdown

API for @0xintuition/sdk@4.1.0. Compatibility · Source.

Import from @0xintuition/sdk/actions.

Signatures show the exact accepted inputs and return types. Named input/output structures and dependency-injection types are listed below; viem and protocol types come from their respective packages. Preparation and quote functions can perform RPC reads. Envelope builders on the action-envelope pages use caller-supplied read context and perform no RPC reads or signing. feeProxyExecutePlan sends transactions; the other SDK actions on these pages prepare transactions or read data.

portfolioGetIntuitionPositionsSnapshot​

Read balances and vault state for the explicitly supplied account and term/curve positions. This does not discover every position held by an account.

Source

function portfolioGetIntuitionPositionsSnapshot(
configs: {
multiVault: ReadConfig;
trustBonding: ReadConfig;
},
inputs: {
account: Address;
positions: PortfolioPositionInput[];
includeUtilization?: boolean;
nowTimestamp?: bigint;
},
deps?: PortfolioDeps,
): Promise<PortfolioIntuitionPositionsSnapshot>;

Defaults: deps = defaultPortfolioDeps. Dependency arguments are optional test/customization hooks; normal consumers use the built-in dependencies.

portfolioGetActionableState​

Combine position snapshots with TrustBonding claim state so an application can decide which actions to offer.

Source

function portfolioGetActionableState(
configs: {
multiVault: ReadConfig;
trustBonding: ReadConfig;
wrappedTrust?: ReadConfig;
},
inputs: {
account: Address;
positions: PortfolioPositionInput[];
nowTimestamp?: bigint;
recipient?: string | null;
expectedWrappedTrustSpend?: bigint;
},
deps?: PortfolioDeps,
): Promise<PortfolioActionableState>;

Defaults: deps = defaultPortfolioDeps. Dependency arguments are optional test/customization hooks; normal consumers use the built-in dependencies.

Imported type provenance​

Public import locations and the definitions used by these signatures and helper types. Value imports appear where a dependency hook uses typeof.

Name in this modulePublic importDefinition
ReadConfigimport type { ReadConfig } from '@0xintuition/protocol'Source definition
wrappedTrustAllowanceimport { wrappedTrustAllowance } from '@0xintuition/protocol'Source definition
Addressimport type { Address } from 'viem'Owned by the external package.
Heximport type { Hex } from 'viem'Owned by the external package.
MultiVaultUserPositionSnapshotimport type { MultiVaultUserPositionSnapshot } from '@0xintuition/sdk/actions'MultiVaultUserPositionSnapshot
multivaultGetUserPositionSnapshotimport { multivaultGetUserPositionSnapshot } from '@0xintuition/sdk/actions'Source definition
TrustBondingClaimActionStateimport type { TrustBondingClaimActionState } from '@0xintuition/sdk/actions'TrustBondingClaimActionState
TrustBondingLockStateSummaryimport type { TrustBondingLockStateSummary } from '@0xintuition/sdk/actions'TrustBondingLockStateSummary
TrustBondingRewardsDashboardimport type { TrustBondingRewardsDashboard } from '@0xintuition/sdk/actions'TrustBondingRewardsDashboard
trustBondingGetClaimActionStateimport { trustBondingGetClaimActionState } from '@0xintuition/sdk/actions'Source definition
trustBondingGetLockStateSummaryimport { trustBondingGetLockStateSummary } from '@0xintuition/sdk/actions'Source definition
trustBondingGetRewardsDashboardimport { trustBondingGetRewardsDashboard } from '@0xintuition/sdk/actions'Source definition

Input and result types​

Exported declarations are public imports from the SDK subpath above. Module-local helper aliases describe accepted shapes but are not public exports.

PortfolioPositionInput​

Public export.

export type PortfolioPositionInput = {
termId: Hex;
curveId: bigint;
};

PortfolioIntuitionPositionsSnapshot​

Public export.

export type PortfolioIntuitionPositionsSnapshot = {
account: Address;
positions: MultiVaultUserPositionSnapshot[];
trustBonding: {
dashboard: TrustBondingRewardsDashboard;
lockState: TrustBondingLockStateSummary;
};
totals: {
totalShares: bigint;
totalEstimatedAssets: bigint;
totalEstimatedRedeemableAssets: bigint;
};
};

PortfolioActionableState​

Public export.

export type PortfolioActionableState = {
account: Address;
claim: TrustBondingClaimActionState;
lock: TrustBondingLockStateSummary;
redeemablePositions: Array<{
termId: Hex;
curveId: bigint;
maxRedeemShares: bigint;
estimatedAssetsForMaxRedeem: bigint;
canRedeem: boolean;
}>;
approval: {
checked: boolean;
currentAllowance: bigint | null;
requiredAllowance: bigint;
required: boolean;
};
prioritizedCtas: string[];
};

PortfolioDeps​

Module-local helper; not a public export.

type PortfolioDeps = {
getUserPositionSnapshot: typeof multivaultGetUserPositionSnapshot;
getRewardsDashboard: typeof trustBondingGetRewardsDashboard;
getLockStateSummary: typeof trustBondingGetLockStateSummary;
getClaimActionState: typeof trustBondingGetClaimActionState;
getWrappedTrustAllowance: typeof wrappedTrustAllowance;
};

Applies to V2 · @0xintuition/sdk 4.1.0