Skip to main content
VaultTransactionBuilder prepares an ordered execution plan from vault actions. It resolves policies, supported position setup, protocol refreshes, same-transaction price updates, and lookup table addresses. Import it from @exponent-labs/exponent-sdk.

Build a plan

Each addActions(actions, options?) call creates a separate step with its own policy match. Supported Kamino Vault withdrawals can produce several ordered reserve-specific sets. An action array must fit one supported execution; the builder does not split arbitrary oversized arrays. Keep slippage-checked actions in separate steps. See the integration guides for supported combinations and preparation. addLoopscaleResponse(response, { label? }) adds an ordered Loopscale response. It preserves the response’s compute settings and co-signing requirements.

Configuration

addActions accepts { label, computeUnitLimit, heapFrameBytes, priorityFee } overrides. priorityFee is in micro-lamports per CU. Raw Loopscale steps accept only label.

Build result

build() returns Promise<VaultTransactionBuildResult>; it submits nothing. Empty builders and unsupported or oversized steps reject. Keep generated signers and addresses from the relevant set before sending. If you submit sets yourself, preserve their order, refresh scheduling, and co-signing requirements. A build-time state snapshot does not predict arbitrary external changes between transactions.

Inspect and send

Send options and result

The result contains signatures, ephemeralAlt ({ address, authority } or null), assertion reports, and a simulation report or null. Retain an ephemeral table’s address and authority for its later cleanup. builder.send(options) builds and sends in one call. It additionally accepts beforeAttempt, retry: { maxAttempts, decide, onRetry? }, and timeouts: { buildMs?, sendMs? }. There is no automatic retry unless configured. Timeouts do not cancel an underlying send; inspect chain state before retrying. decide returns false or { delayMs?, reason? }. Inspect completedSignatures before retrying; rebuilding must not replay a completed allocation. For caller-managed instruction bundles, see Sync helpers. For a complete script, see Allocate and exit.