Portfolio reads
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.
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.
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 module | Public import | Definition |
|---|---|---|
ReadConfig | import type { ReadConfig } from '@0xintuition/protocol' | Source definition |
wrappedTrustAllowance | import { wrappedTrustAllowance } from '@0xintuition/protocol' | Source definition |
Address | import type { Address } from 'viem' | Owned by the external package. |
Hex | import type { Hex } from 'viem' | Owned by the external package. |
MultiVaultUserPositionSnapshot | import type { MultiVaultUserPositionSnapshot } from '@0xintuition/sdk/actions' | MultiVaultUserPositionSnapshot |
multivaultGetUserPositionSnapshot | import { multivaultGetUserPositionSnapshot } from '@0xintuition/sdk/actions' | Source definition |
TrustBondingClaimActionState | import type { TrustBondingClaimActionState } from '@0xintuition/sdk/actions' | TrustBondingClaimActionState |
TrustBondingLockStateSummary | import type { TrustBondingLockStateSummary } from '@0xintuition/sdk/actions' | TrustBondingLockStateSummary |
TrustBondingRewardsDashboard | import type { TrustBondingRewardsDashboard } from '@0xintuition/sdk/actions' | TrustBondingRewardsDashboard |
trustBondingGetClaimActionState | import { trustBondingGetClaimActionState } from '@0xintuition/sdk/actions' | Source definition |
trustBondingGetLockStateSummary | import { trustBondingGetLockStateSummary } from '@0xintuition/sdk/actions' | Source definition |
trustBondingGetRewardsDashboard | import { 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