import type { ActivityOptions, GauntletApi, TokenRef, UserActivity } from './client'; export type ActivityFlowKind = 'deposit' | 'withdraw' | 'transfer_in' | 'transfer_out'; export type ActivityFlowStatus = 'settled' | 'pending' | 'refunded'; /** A signed token amount as reported by the API, with base-unit conversion when possible. */ export interface AssetAmount { /** Human-unit decimal string exactly as the API emits it, e.g. `"1250.5"`. */ decimal: string; /** Base-unit integer (`decimal × 10^token.decimals`); null when the token's decimals are unknown. */ raw: bigint | null; token: TokenRef | null; } /** * One user action against a vault, stitched from the activity log's immutable * rows. Sync flows (Morpho, secondary-market transfers) come from a single * row; Aera async flows pair a `*_pending` request row with its terminal * settle/refund row via `request_hash`. */ export interface ActivityFlow { kind: ActivityFlowKind; status: ActivityFlowStatus; /** CAIP-10 vault id (`"{chainId}:{address}"`). */ vaultId: string; /** Aera async correlation hash; null for sync flows and transfers. */ requestHash: string | null; /** When the request row landed. Null when the flow's pending row is outside the fetched window. */ requestedAt: Date | null; /** When the terminal (settle/refund) row landed. Null while pending. */ settledAt: Date | null; /** Magnitude of the flow's asset movement (requested amount for refunded flows). */ assets: AssetAmount; /** Magnitude of the flow's share movement in 18-decimal base units. */ shares: bigint; /** Transaction hashes in row order (request first, then settlement, when both are known). */ txHashes: string[]; } /** * Pure stitcher: folds raw activity rows into `ActivityFlow`s. Rows may be in * any order and may span multiple vaults; async lifecycles are paired by * `request_hash`. Flows are returned newest-first (by the flow's latest row). */ export declare function stitchActivityFlows(rows: UserActivity[]): ActivityFlow[]; export interface ActivityFlowsOptions extends Pick { /** Stop paginating once this many rows have been fetched. Defaults to 1000. */ maxRows?: number; } /** * Fetches the wallet's activity log and stitches it into lifecycle-aware * flows — the replacement for scanning vault event logs over RPC. * * ```ts * const flows = await getActivityFlows(client.api, wallet); * const open = flows.filter((f) => f.status === 'pending'); * ``` */ export declare function getActivityFlows(api: GauntletApi, walletAddress: string, options?: ActivityFlowsOptions): Promise; export interface WaitForSettlementOptions { /** CAIP-10 vault id — narrows polling to one vault's activity. */ vaultId?: string; /** Polling interval. Defaults to 5s. */ pollIntervalMs?: number; /** Overall deadline. Defaults to 10 minutes. Throws `SettlementTimeoutError` on expiry. */ timeoutMs?: number; } /** * Polls the activity log until the Aera async request identified by * `requestHash` reaches a terminal state, and returns the settled or refunded * flow. Use after submitting a `requestDeposit` / `requestRedeem` transaction. */ export declare function waitForRequestSettlement(api: GauntletApi, walletAddress: string, requestHash: string, options?: WaitForSettlementOptions): Promise; //# sourceMappingURL=activity.d.ts.map