readPolicyObject
readPolicy(client, policyId) returns a flatter PolicySnapshot (single budget asset) with agentId, perTxCap, perDayCap, spentToday, allowedPackages, expiresAtMs, revoked, paused, version.
vaultBalances
[] if the vault has no assets.
readAuditLog
AllowedAction, WithdrawalAttested, PolicyRevoked, PolicyUpdated events emitted by corePkg, in descending order.
decodePolicyAbort
MoveAbort from a thrown error or a devInspect failure status, and maps the abort code to a stable reason. Only aborts raised by the policy module are decoded; returns null for any other failure (so you can tell a policy denial apart from a liquidity or gas failure).
| Code | reason_code |
|---|---|
| 1 | policy_revoked |
| 2 | policy_expired |
| 3 | agent_paused |
| 4 | over_per_tx_cap |
| 5 | over_per_day_cap |
| 6 | package_not_allowed |
| 7 | wrong_policy |
| 8 | action_not_allowed |
| 9 | action_config_missing |
| 10 | asset_not_allowed |
guardedSubmit
Dry-run, record a denial without spending gas, and submit only when allowed.