@mysten/sui Transaction you sign and submit yourself (with an Executor, dapp-kit, or guardedSubmit). AltheiaSui wraps them; reach for the builders when you want to inspect, dry-run, or compose a PTB before submitting.
All agent-action builders take a SuiRefs (from agentRefs).
Agent actions
| Builder | Move call | Notes |
|---|---|---|
buildSwap(refs, amount) | deepbook_adapter::execute_swap_quote_for_base | Buy: spend the capped quote, receive base into the vault. |
buildSellSwap(refs, amount) | deepbook_adapter::execute_swap_base_for_quote | Sell: unwind a base position back to quote. |
buildPlaceLimit(refs, params) | trading_account::place_limit_order | Needs tradingAccount + balanceManager refs. |
buildCancelAll(refs) | trading_account::cancel_all | Needs tradingAccount + balanceManager refs. |
LimitParams
Owner lifecycle
Signed with the owner key; refs must carryownerCap.
| Builder | Move call | Notes |
|---|---|---|
buildRevoke(refs) | vault::admin_revoke_policy | Terminal. |
buildPause(refs) | vault::admin_pause_policy | Freeze without revoking. |
buildUnpause(refs) | vault::admin_unpause_policy | Resume a paused agent. |
buildSetActions(refs, actionIds) | vault::admin_set_actions | Replace the allowed-action set. |
buildSetValueGuard(refs, maxSlippageBps, baseScalar) | vault::admin_set_value_guard | Global swap price-band. |
buildKillDrain(refs, ownerAddr, coinTypes?) | revoke + drain | Revoke and sweep the vault to the owner. |
buildKillDrain drains the held coin types. Pass coinTypes from vaultBalances to drain exactly what the vault holds — draining a type with no balance aborts.
Provisioning
provisionAgentMulti(exec, params) composes the whole agent in one owner signature: vault, deposit, policy, asset cap, value-guard, agent cap, and an agent gas top-up. It returns { vault, ownerCap, policy, cap }. The dashboard does this for you; the builder is for programmatic provisioning.
SuiPolicyConfig
| Field | Type | Notes |
|---|---|---|
agentId | string | Label, becomes agent_id on chain. |
perDayCap | bigint | Required. Max cumulative spend per rolling 24h, base units. |
perTxCap | bigint? | Per-tx ceiling. 0 disables the per-tx check. |
allowedPackages | string[] | Protocol scope (package/pool ids). |
allowedActions | SuiActionId[] | Capability allowlist, default-deny. |
expiresAtMs | bigint | Absolute expiry. |
swapMinRate | bigint? | Min output per input unit ×1e9. Required if deepbookSwap is allowed. |
SUI_ACTIONS
Chain reads
Read the live policy, vault balances, and the audit log straight from chain.