@armada/sdk / index / PoolConfig
Interface: PoolConfig
Defined in: src/index.ts:9
Properties
chainId
readonlychainId:number
Defined in: src/index.ts:10
poolAddress
readonlypoolAddress:`0x${string}`
Defined in: src/index.ts:11
deployBlock
readonlydeployBlock:number
Defined in: src/index.ts:12
usdcAddress
readonlyusdcAddress:`0x${string}`
Defined in: src/index.ts:13
wrappers?
readonlyoptionalwrappers?:object
Defined in: src/index.ts:19
Wrapper contracts. yieldAdapter classifies yield ops (history categories; preflight tells a yield call apart from a cross-chain unshield). gaslessShield is not read by the SDK yet — the gasless builders take the wrapper address as an argument (see #115).
gaslessShield?
optionalgaslessShield?:`0x${string}`
yieldAdapter?
optionalyieldAdapter?:`0x${string}`
cctp?
readonlyoptionalcctp?:object
Defined in: src/index.ts:24
CCTP config. messenger drives preflight's cross-chain liveness check. domain is not read by the SDK yet (the Phase 4 cross-chain lifecycle will use it).
domain
domain:
number
messenger
messenger:
`0x${string}`
finalityThreshold?
readonlyoptionalfinalityThreshold?:number
Defined in: src/index.ts:31
Confirmations a commitment needs before it counts as spendable rather than pending in balances() (default 0 = count immediately). Set it to the pool's finality depth to give recent shields/transfers a reorg buffer in the balance view. (Spend-path gating and a checkpoint reorg margin are tracked separately — they need reorg-aware tree truncation.)
confirmationDepth?
readonlyoptionalconfirmationDepth?:number
Defined in: src/index.ts:42
Blocks to stay behind chain head when scanning (SPEC §4.4 reorg safety, default 0 = scan to head). The SDK only persists commitments up to head − confirmationDepth, so a reorg of that depth or shallower can't remove an already-scanned leaf (the append-only tree can't un-append it). Set it to a small value on a fast-finality hub (a few blocks) or the finality depth for zero reorg exposure; the cost is that notes in the last confirmationDepth blocks aren't visible/spendable until they're deeper. A deeper reorg is detected by the checkpoint's block hash and recovered by a rescan. Sync verification reads pool state at the scanned block, so keep this within the RPC node's recent-state window (~128 blocks on a non-archive node).
supportedShapes?
readonlyoptionalsupportedShapes?: readonlystring[]
Defined in: src/index.ts:50
Circuit shapes (<nullifiers>x<commitments>, e.g. "2x3") the deployment has artifacts for. When set, wallet.planTransfer lands every plan on a listed shape — splitting a fragmented single-recipient transfer across several plans when one proof's shape isn't listed — and rejects a spend it can't fit up front with UnsupportedCircuitShapeError (or TooFragmentedError) instead of failing late at artifact resolution / on-chain. Omit to skip the check (and never split).
sweepNoteThreshold?
readonlyoptionalsweepNoteThreshold?:number
Defined in: src/index.ts:58
Keeps wallets from fragmenting (issue #108): when a token has at least this many spendable notes, a single-proof spend also spends that tree's smallest notes as extra inputs — up to the largest listed shape — merging them into its change at no extra fee. The fee, the amount, and whether a spend can be made never change; the proof gets larger, which is why a wallet below the threshold is left alone. Needs supportedShapes. Default 5; 0 turns it off.
pendingSpendTtlMs?
readonlyoptionalpendingSpendTtlMs?:number
Defined in: src/index.ts:67
How long (ms) an optimistic in-flight spend hold survives before it's auto-released (issue #55). When a spend's transaction is submitted, wallet.markSpendPending holds its input notes out of selection so a rapid follow-up spend can't reselect them before the on-chain Nullified event is scanned. A confirmed spend clears its hold automatically; this TTL is the safety net so a dropped/never-mined (or app-crash-before-clearSpendPending) submission can't lock its inputs forever, including across a reload. Set it comfortably above the submit→confirm→scan latency (default 300000 = 5 min).
autoSyncIntervalMs?
readonlyoptionalautoSyncIntervalMs?:number
Defined in: src/index.ts:73
Default interval (ms) for wallet.watch() auto-sync (issue #59). watch() runs sync() on this cadence so a wallet stays current without the consumer writing a poll loop; a per-call intervalMs overrides it. Default 10000 (10s), matching the stock railgun engine's polling cadence.