@usesigil/kit 0.16.0 → 0.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +56 -0
- package/dist/advanced-analytics.d.ts +3 -2
- package/dist/advanced-analytics.d.ts.map +1 -1
- package/dist/advanced-analytics.js +9 -42
- package/dist/advanced-analytics.js.map +1 -1
- package/dist/agent-bootstrap.d.ts +1 -2
- package/dist/agent-bootstrap.d.ts.map +1 -1
- package/dist/agent-bootstrap.js.map +1 -1
- package/dist/agent-errors.d.ts +20 -4
- package/dist/agent-errors.d.ts.map +1 -1
- package/dist/agent-errors.js +864 -367
- package/dist/agent-errors.js.map +1 -1
- package/dist/audit-log.d.ts +101 -0
- package/dist/audit-log.d.ts.map +1 -0
- package/dist/audit-log.js +145 -0
- package/dist/audit-log.js.map +1 -0
- package/dist/caip2-network.d.ts +171 -0
- package/dist/caip2-network.d.ts.map +1 -0
- package/dist/caip2-network.js +202 -0
- package/dist/caip2-network.js.map +1 -0
- package/dist/canonical-encode.d.ts +59 -0
- package/dist/canonical-encode.d.ts.map +1 -0
- package/dist/canonical-encode.js +141 -0
- package/dist/canonical-encode.js.map +1 -0
- package/dist/cosign-helper.d.ts +264 -0
- package/dist/cosign-helper.d.ts.map +1 -0
- package/dist/cosign-helper.js +147 -0
- package/dist/cosign-helper.js.map +1 -0
- package/dist/create-vault.d.ts +92 -0
- package/dist/create-vault.d.ts.map +1 -1
- package/dist/create-vault.js +108 -7
- package/dist/create-vault.js.map +1 -1
- package/dist/dashboard/close-vault.d.ts +110 -0
- package/dist/dashboard/close-vault.d.ts.map +1 -0
- package/dist/dashboard/close-vault.js +165 -0
- package/dist/dashboard/close-vault.js.map +1 -0
- package/dist/dashboard/errors.d.ts +2 -2
- package/dist/dashboard/errors.d.ts.map +1 -1
- package/dist/dashboard/errors.js +11 -7
- package/dist/dashboard/errors.js.map +1 -1
- package/dist/dashboard/index.d.ts +190 -34
- package/dist/dashboard/index.d.ts.map +1 -1
- package/dist/dashboard/index.js +282 -52
- package/dist/dashboard/index.js.map +1 -1
- package/dist/dashboard/mutations.d.ts +153 -24
- package/dist/dashboard/mutations.d.ts.map +1 -1
- package/dist/dashboard/mutations.js +680 -114
- package/dist/dashboard/mutations.js.map +1 -1
- package/dist/dashboard/post-assertion-validation.d.ts +1 -1
- package/dist/dashboard/post-assertion-validation.d.ts.map +1 -1
- package/dist/dashboard/post-assertion-validation.js +169 -48
- package/dist/dashboard/post-assertion-validation.js.map +1 -1
- package/dist/dashboard/reads.d.ts +3 -4
- package/dist/dashboard/reads.d.ts.map +1 -1
- package/dist/dashboard/reads.js +11 -22
- package/dist/dashboard/reads.js.map +1 -1
- package/dist/dashboard/types.d.ts +56 -19
- package/dist/dashboard/types.d.ts.map +1 -1
- package/dist/errors/agent-errors.generated.d.ts +21 -0
- package/dist/errors/agent-errors.generated.d.ts.map +1 -0
- package/dist/errors/agent-errors.generated.js +134 -0
- package/dist/errors/agent-errors.generated.js.map +1 -0
- package/dist/errors/codes.d.ts +21 -2
- package/dist/errors/codes.d.ts.map +1 -1
- package/dist/errors/codes.js +19 -0
- package/dist/errors/codes.js.map +1 -1
- package/dist/errors/context.d.ts +9 -1
- package/dist/errors/context.d.ts.map +1 -1
- package/dist/event-analytics.d.ts +1 -3
- package/dist/event-analytics.d.ts.map +1 -1
- package/dist/event-analytics.js +28 -81
- package/dist/event-analytics.js.map +1 -1
- package/dist/events.d.ts.map +1 -1
- package/dist/events.js +23 -14
- package/dist/events.js.map +1 -1
- package/dist/generated/accounts/agentSpendOverlay.d.ts +60 -0
- package/dist/generated/accounts/agentSpendOverlay.d.ts.map +1 -1
- package/dist/generated/accounts/agentSpendOverlay.js +6 -2
- package/dist/generated/accounts/agentSpendOverlay.js.map +1 -1
- package/dist/generated/accounts/agentVault.d.ts +168 -4
- package/dist/generated/accounts/agentVault.d.ts.map +1 -1
- package/dist/generated/accounts/agentVault.js +11 -3
- package/dist/generated/accounts/agentVault.js.map +1 -1
- package/dist/generated/accounts/auditLogRejected.d.ts +66 -0
- package/dist/generated/accounts/auditLogRejected.d.ts.map +1 -0
- package/dist/generated/accounts/auditLogRejected.js +68 -0
- package/dist/generated/accounts/auditLogRejected.js.map +1 -0
- package/dist/generated/accounts/auditLogSuccess.d.ts +78 -0
- package/dist/generated/accounts/auditLogSuccess.d.ts.map +1 -0
- package/dist/generated/accounts/auditLogSuccess.js +68 -0
- package/dist/generated/accounts/auditLogSuccess.js.map +1 -0
- package/dist/generated/accounts/index.d.ts +4 -4
- package/dist/generated/accounts/index.d.ts.map +1 -1
- package/dist/generated/accounts/index.js +4 -4
- package/dist/generated/accounts/index.js.map +1 -1
- package/dist/generated/accounts/pendingAgentGrant.d.ts +199 -0
- package/dist/generated/accounts/pendingAgentGrant.d.ts.map +1 -0
- package/dist/generated/accounts/pendingAgentGrant.js +75 -0
- package/dist/generated/accounts/pendingAgentGrant.js.map +1 -0
- package/dist/generated/accounts/pendingAgentPermissionsUpdate.d.ts +64 -0
- package/dist/generated/accounts/pendingAgentPermissionsUpdate.d.ts.map +1 -1
- package/dist/generated/accounts/pendingAgentPermissionsUpdate.js +7 -1
- package/dist/generated/accounts/pendingAgentPermissionsUpdate.js.map +1 -1
- package/dist/generated/accounts/pendingOwnershipTransfer.d.ts +131 -0
- package/dist/generated/accounts/pendingOwnershipTransfer.d.ts.map +1 -0
- package/dist/generated/accounts/pendingOwnershipTransfer.js +76 -0
- package/dist/generated/accounts/pendingOwnershipTransfer.js.map +1 -0
- package/dist/generated/accounts/pendingPolicyUpdate.d.ts +200 -4
- package/dist/generated/accounts/pendingPolicyUpdate.d.ts.map +1 -1
- package/dist/generated/accounts/pendingPolicyUpdate.js +19 -1
- package/dist/generated/accounts/pendingPolicyUpdate.js.map +1 -1
- package/dist/generated/accounts/policyConfig.d.ts +479 -36
- package/dist/generated/accounts/policyConfig.d.ts.map +1 -1
- package/dist/generated/accounts/policyConfig.js +30 -3
- package/dist/generated/accounts/policyConfig.js.map +1 -1
- package/dist/generated/accounts/postExecutionAssertions.d.ts +2 -2
- package/dist/generated/accounts/postExecutionAssertions.d.ts.map +1 -1
- package/dist/generated/accounts/postExecutionAssertions.js +3 -3
- package/dist/generated/accounts/sessionAuthority.d.ts +140 -12
- package/dist/generated/accounts/sessionAuthority.d.ts.map +1 -1
- package/dist/generated/accounts/sessionAuthority.js +9 -7
- package/dist/generated/accounts/sessionAuthority.js.map +1 -1
- package/dist/generated/accounts/spendTracker.d.ts +83 -3
- package/dist/generated/accounts/spendTracker.d.ts.map +1 -1
- package/dist/generated/accounts/spendTracker.js +14 -2
- package/dist/generated/accounts/spendTracker.js.map +1 -1
- package/dist/generated/errors/sigil.d.ts +131 -83
- package/dist/generated/errors/sigil.d.ts.map +1 -1
- package/dist/generated/errors/sigil.js +178 -106
- package/dist/generated/errors/sigil.js.map +1 -1
- package/dist/generated/event-discriminators.d.ts.map +1 -1
- package/dist/generated/event-discriminators.js +11 -14
- package/dist/generated/event-discriminators.js.map +1 -1
- package/dist/generated/instructions/acceptOwnershipTransfer.d.ts +142 -0
- package/dist/generated/instructions/acceptOwnershipTransfer.d.ts.map +1 -0
- package/dist/generated/instructions/acceptOwnershipTransfer.js +171 -0
- package/dist/generated/instructions/acceptOwnershipTransfer.js.map +1 -0
- package/dist/generated/instructions/acceptOwnershipTransferMultisig.d.ts +85 -0
- package/dist/generated/instructions/acceptOwnershipTransferMultisig.d.ts.map +1 -0
- package/dist/generated/instructions/acceptOwnershipTransferMultisig.js +171 -0
- package/dist/generated/instructions/acceptOwnershipTransferMultisig.js.map +1 -0
- package/dist/generated/instructions/applyAgentGrant.d.ts +100 -0
- package/dist/generated/instructions/applyAgentGrant.d.ts.map +1 -0
- package/dist/generated/instructions/{applyConstraintsUpdate.js → applyAgentGrant.js} +66 -42
- package/dist/generated/instructions/applyAgentGrant.js.map +1 -0
- package/dist/generated/instructions/applyAgentPermissionsUpdate.d.ts +31 -8
- package/dist/generated/instructions/applyAgentPermissionsUpdate.d.ts.map +1 -1
- package/dist/generated/instructions/applyAgentPermissionsUpdate.js +38 -2
- package/dist/generated/instructions/applyAgentPermissionsUpdate.js.map +1 -1
- package/dist/generated/instructions/applyPendingPolicy.d.ts +18 -7
- package/dist/generated/instructions/applyPendingPolicy.d.ts.map +1 -1
- package/dist/generated/instructions/applyPendingPolicy.js +38 -2
- package/dist/generated/instructions/applyPendingPolicy.js.map +1 -1
- package/dist/generated/instructions/cancelAgentGrant.d.ts +106 -0
- package/dist/generated/instructions/cancelAgentGrant.d.ts.map +1 -0
- package/dist/generated/instructions/{allocatePendingConstraintsPda.js → cancelAgentGrant.js} +54 -42
- package/dist/generated/instructions/cancelAgentGrant.js.map +1 -0
- package/dist/generated/instructions/cancelOwnershipTransfer.d.ts +121 -0
- package/dist/generated/instructions/cancelOwnershipTransfer.d.ts.map +1 -0
- package/dist/generated/instructions/{queueCloseConstraints.js → cancelOwnershipTransfer.js} +58 -44
- package/dist/generated/instructions/cancelOwnershipTransfer.js.map +1 -0
- package/dist/generated/instructions/closePostAssertions.d.ts +6 -1
- package/dist/generated/instructions/closePostAssertions.d.ts.map +1 -1
- package/dist/generated/instructions/closePostAssertions.js +11 -3
- package/dist/generated/instructions/closePostAssertions.js.map +1 -1
- package/dist/generated/instructions/closeVault.d.ts +40 -8
- package/dist/generated/instructions/closeVault.d.ts.map +1 -1
- package/dist/generated/instructions/closeVault.js +40 -2
- package/dist/generated/instructions/closeVault.js.map +1 -1
- package/dist/generated/instructions/createPostAssertions.d.ts +4 -0
- package/dist/generated/instructions/createPostAssertions.d.ts.map +1 -1
- package/dist/generated/instructions/createPostAssertions.js +2 -0
- package/dist/generated/instructions/createPostAssertions.js.map +1 -1
- package/dist/generated/instructions/depositFunds.d.ts +21 -10
- package/dist/generated/instructions/depositFunds.d.ts.map +1 -1
- package/dist/generated/instructions/depositFunds.js +37 -2
- package/dist/generated/instructions/depositFunds.js.map +1 -1
- package/dist/generated/instructions/finalizeSession.d.ts +49 -7
- package/dist/generated/instructions/finalizeSession.d.ts.map +1 -1
- package/dist/generated/instructions/finalizeSession.js +59 -2
- package/dist/generated/instructions/finalizeSession.js.map +1 -1
- package/dist/generated/instructions/freezeVault.d.ts +36 -5
- package/dist/generated/instructions/freezeVault.d.ts.map +1 -1
- package/dist/generated/instructions/freezeVault.js +65 -4
- package/dist/generated/instructions/freezeVault.js.map +1 -1
- package/dist/generated/instructions/index.d.ts +10 -15
- package/dist/generated/instructions/index.d.ts.map +1 -1
- package/dist/generated/instructions/index.js +10 -15
- package/dist/generated/instructions/index.js.map +1 -1
- package/dist/generated/instructions/initializeVault.d.ts +79 -9
- package/dist/generated/instructions/initializeVault.d.ts.map +1 -1
- package/dist/generated/instructions/initializeVault.js +57 -3
- package/dist/generated/instructions/initializeVault.js.map +1 -1
- package/dist/generated/instructions/initiateOwnershipTransfer.d.ts +106 -0
- package/dist/generated/instructions/initiateOwnershipTransfer.d.ts.map +1 -0
- package/dist/generated/instructions/initiateOwnershipTransfer.js +181 -0
- package/dist/generated/instructions/initiateOwnershipTransfer.js.map +1 -0
- package/dist/generated/instructions/pauseAgent.d.ts +49 -5
- package/dist/generated/instructions/pauseAgent.d.ts.map +1 -1
- package/dist/generated/instructions/pauseAgent.js +80 -5
- package/dist/generated/instructions/pauseAgent.js.map +1 -1
- package/dist/generated/instructions/promoteGraylistDestination.d.ts +56 -0
- package/dist/generated/instructions/promoteGraylistDestination.d.ts.map +1 -0
- package/dist/generated/instructions/{createInstructionConstraints.js → promoteGraylistDestination.js} +23 -40
- package/dist/generated/instructions/promoteGraylistDestination.js.map +1 -0
- package/dist/generated/instructions/queueAgentGrant.d.ts +113 -0
- package/dist/generated/instructions/queueAgentGrant.d.ts.map +1 -0
- package/dist/generated/instructions/queueAgentGrant.js +181 -0
- package/dist/generated/instructions/queueAgentGrant.js.map +1 -0
- package/dist/generated/instructions/queueAgentPermissionsUpdate.d.ts +8 -0
- package/dist/generated/instructions/queueAgentPermissionsUpdate.d.ts.map +1 -1
- package/dist/generated/instructions/queueAgentPermissionsUpdate.js +4 -0
- package/dist/generated/instructions/queueAgentPermissionsUpdate.js.map +1 -1
- package/dist/generated/instructions/queuePolicyUpdate.d.ts +32 -0
- package/dist/generated/instructions/queuePolicyUpdate.d.ts.map +1 -1
- package/dist/generated/instructions/queuePolicyUpdate.js +17 -1
- package/dist/generated/instructions/queuePolicyUpdate.js.map +1 -1
- package/dist/generated/instructions/reactivateVault.d.ts +71 -5
- package/dist/generated/instructions/reactivateVault.d.ts.map +1 -1
- package/dist/generated/instructions/reactivateVault.js +80 -5
- package/dist/generated/instructions/reactivateVault.js.map +1 -1
- package/dist/generated/instructions/recordAgentViolation.d.ts +89 -0
- package/dist/generated/instructions/recordAgentViolation.d.ts.map +1 -0
- package/dist/generated/instructions/recordAgentViolation.js +152 -0
- package/dist/generated/instructions/recordAgentViolation.js.map +1 -0
- package/dist/generated/instructions/registerAgent.d.ts +84 -6
- package/dist/generated/instructions/registerAgent.d.ts.map +1 -1
- package/dist/generated/instructions/registerAgent.js +81 -4
- package/dist/generated/instructions/registerAgent.js.map +1 -1
- package/dist/generated/instructions/revokeAgent.d.ts +49 -6
- package/dist/generated/instructions/revokeAgent.d.ts.map +1 -1
- package/dist/generated/instructions/revokeAgent.js +81 -4
- package/dist/generated/instructions/revokeAgent.js.map +1 -1
- package/dist/generated/instructions/setObserveOnly.d.ts +56 -0
- package/dist/generated/instructions/setObserveOnly.d.ts.map +1 -0
- package/dist/generated/instructions/setObserveOnly.js +111 -0
- package/dist/generated/instructions/setObserveOnly.js.map +1 -0
- package/dist/generated/instructions/unpauseAgent.d.ts +46 -5
- package/dist/generated/instructions/unpauseAgent.d.ts.map +1 -1
- package/dist/generated/instructions/unpauseAgent.js +80 -5
- package/dist/generated/instructions/unpauseAgent.js.map +1 -1
- package/dist/generated/instructions/validateAndAuthorize.d.ts +29 -0
- package/dist/generated/instructions/validateAndAuthorize.d.ts.map +1 -1
- package/dist/generated/instructions/validateAndAuthorize.js +4 -0
- package/dist/generated/instructions/validateAndAuthorize.js.map +1 -1
- package/dist/generated/instructions/withdrawFunds.d.ts +53 -11
- package/dist/generated/instructions/withdrawFunds.d.ts.map +1 -1
- package/dist/generated/instructions/withdrawFunds.js +51 -2
- package/dist/generated/instructions/withdrawFunds.js.map +1 -1
- package/dist/generated/programs/sigil.d.ts +79 -99
- package/dist/generated/programs/sigil.d.ts.map +1 -1
- package/dist/generated/programs/sigil.js +139 -199
- package/dist/generated/programs/sigil.js.map +1 -1
- package/dist/generated/types/actionAuthorized.d.ts +0 -2
- package/dist/generated/types/actionAuthorized.d.ts.map +1 -1
- package/dist/generated/types/actionAuthorized.js +0 -2
- package/dist/generated/types/actionAuthorized.js.map +1 -1
- package/dist/generated/types/agentAutoRevoked.d.ts +31 -0
- package/dist/generated/types/agentAutoRevoked.d.ts.map +1 -0
- package/dist/generated/types/{orphanConstraintsPdaCleaned.js → agentAutoRevoked.js} +12 -8
- package/dist/generated/types/agentAutoRevoked.js.map +1 -0
- package/dist/generated/types/agentEntry.d.ts +48 -0
- package/dist/generated/types/agentEntry.d.ts.map +1 -1
- package/dist/generated/types/agentEntry.js +4 -2
- package/dist/generated/types/agentEntry.js.map +1 -1
- package/dist/generated/types/agentGrantApplied.d.ts +38 -0
- package/dist/generated/types/agentGrantApplied.d.ts.map +1 -0
- package/dist/generated/types/agentGrantApplied.js +34 -0
- package/dist/generated/types/agentGrantApplied.js.map +1 -0
- package/dist/generated/types/agentGrantCancelled.d.ts +33 -0
- package/dist/generated/types/agentGrantCancelled.d.ts.map +1 -0
- package/dist/generated/types/agentGrantCancelled.js +28 -0
- package/dist/generated/types/agentGrantCancelled.js.map +1 -0
- package/dist/generated/types/agentGrantQueued.d.ts +38 -0
- package/dist/generated/types/agentGrantQueued.d.ts.map +1 -0
- package/dist/generated/types/agentGrantQueued.js +32 -0
- package/dist/generated/types/agentGrantQueued.js.map +1 -0
- package/dist/generated/types/auditEntry.d.ts +120 -0
- package/dist/generated/types/auditEntry.d.ts.map +1 -0
- package/dist/generated/types/auditEntry.js +34 -0
- package/dist/generated/types/auditEntry.js.map +1 -0
- package/dist/generated/types/destinationGraylistEntry.d.ts +32 -0
- package/dist/generated/types/destinationGraylistEntry.d.ts.map +1 -0
- package/dist/generated/types/destinationGraylistEntry.js +24 -0
- package/dist/generated/types/destinationGraylistEntry.js.map +1 -0
- package/dist/generated/types/graylistEntered.d.ts +31 -0
- package/dist/generated/types/graylistEntered.d.ts.map +1 -0
- package/dist/generated/types/graylistEntered.js +30 -0
- package/dist/generated/types/graylistEntered.js.map +1 -0
- package/dist/generated/types/graylistPromoted.d.ts +29 -0
- package/dist/generated/types/graylistPromoted.d.ts.map +1 -0
- package/dist/generated/types/graylistPromoted.js +28 -0
- package/dist/generated/types/graylistPromoted.js.map +1 -0
- package/dist/generated/types/index.d.ts +13 -22
- package/dist/generated/types/index.d.ts.map +1 -1
- package/dist/generated/types/index.js +13 -22
- package/dist/generated/types/index.js.map +1 -1
- package/dist/generated/types/observeOnlyChanged.d.ts +33 -0
- package/dist/generated/types/observeOnlyChanged.d.ts.map +1 -0
- package/dist/generated/types/observeOnlyChanged.js +32 -0
- package/dist/generated/types/observeOnlyChanged.js.map +1 -0
- package/dist/generated/types/ownershipTransferAccepted.d.ts +32 -0
- package/dist/generated/types/ownershipTransferAccepted.d.ts.map +1 -0
- package/dist/generated/types/ownershipTransferAccepted.js +30 -0
- package/dist/generated/types/ownershipTransferAccepted.js.map +1 -0
- package/dist/generated/types/ownershipTransferCancelled.d.ts +29 -0
- package/dist/generated/types/ownershipTransferCancelled.d.ts.map +1 -0
- package/dist/generated/types/ownershipTransferCancelled.js +28 -0
- package/dist/generated/types/ownershipTransferCancelled.js.map +1 -0
- package/dist/generated/types/ownershipTransferInitiated.d.ts +33 -0
- package/dist/generated/types/ownershipTransferInitiated.d.ts.map +1 -0
- package/dist/generated/types/ownershipTransferInitiated.js +30 -0
- package/dist/generated/types/ownershipTransferInitiated.js.map +1 -0
- package/dist/generated/types/perRecipientCounter.d.ts +61 -0
- package/dist/generated/types/perRecipientCounter.d.ts.map +1 -0
- package/dist/generated/types/perRecipientCounter.js +26 -0
- package/dist/generated/types/perRecipientCounter.js.map +1 -0
- package/dist/generated/types/postAssertionEntry.d.ts +14 -7
- package/dist/generated/types/postAssertionEntry.d.ts.map +1 -1
- package/dist/generated/types/postAssertionEntry.js +5 -7
- package/dist/generated/types/postAssertionEntry.js.map +1 -1
- package/dist/generated/types/postAssertionEntryZC.d.ts +53 -22
- package/dist/generated/types/postAssertionEntryZC.d.ts.map +1 -1
- package/dist/generated/types/postAssertionEntryZC.js +4 -6
- package/dist/generated/types/postAssertionEntryZC.js.map +1 -1
- package/dist/generated/types/sessionFinalized.d.ts +0 -4
- package/dist/generated/types/sessionFinalized.d.ts.map +1 -1
- package/dist/generated/types/sessionFinalized.js +0 -2
- package/dist/generated/types/sessionFinalized.js.map +1 -1
- package/dist/generated/types/vaultFrozen.d.ts +14 -0
- package/dist/generated/types/vaultFrozen.d.ts.map +1 -1
- package/dist/generated/types/vaultFrozen.js +2 -0
- package/dist/generated/types/vaultFrozen.js.map +1 -1
- package/dist/index.d.ts +31 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +67 -11
- package/dist/index.js.map +1 -1
- package/dist/inspector.d.ts +0 -23
- package/dist/inspector.d.ts.map +1 -1
- package/dist/inspector.js +0 -52
- package/dist/inspector.js.map +1 -1
- package/dist/kit-adapter.d.ts +1 -1
- package/dist/kit-adapter.d.ts.map +1 -1
- package/dist/kit-adapter.js +1 -1
- package/dist/kit-adapter.js.map +1 -1
- package/dist/multisig-detection.d.ts +83 -0
- package/dist/multisig-detection.d.ts.map +1 -0
- package/dist/multisig-detection.js +128 -0
- package/dist/multisig-detection.js.map +1 -0
- package/dist/ownership-transfer.d.ts +79 -0
- package/dist/ownership-transfer.d.ts.map +1 -0
- package/dist/ownership-transfer.js +66 -0
- package/dist/ownership-transfer.js.map +1 -0
- package/dist/policy/compute-agent-perms-cosign-digest.d.ts +51 -0
- package/dist/policy/compute-agent-perms-cosign-digest.d.ts.map +1 -0
- package/dist/policy/compute-agent-perms-cosign-digest.js +55 -0
- package/dist/policy/compute-agent-perms-cosign-digest.js.map +1 -0
- package/dist/policy/compute-cosign-digest.d.ts +193 -0
- package/dist/policy/compute-cosign-digest.d.ts.map +1 -0
- package/dist/policy/compute-cosign-digest.js +318 -0
- package/dist/policy/compute-cosign-digest.js.map +1 -0
- package/dist/policy/compute-policy-preview-digest.d.ts +279 -0
- package/dist/policy/compute-policy-preview-digest.d.ts.map +1 -0
- package/dist/policy/compute-policy-preview-digest.js +373 -0
- package/dist/policy/compute-policy-preview-digest.js.map +1 -0
- package/dist/policy-attestation.d.ts +51 -0
- package/dist/policy-attestation.d.ts.map +1 -0
- package/dist/policy-attestation.js +43 -0
- package/dist/policy-attestation.js.map +1 -0
- package/dist/preview-create-vault.d.ts.map +1 -1
- package/dist/preview-create-vault.js +37 -16
- package/dist/preview-create-vault.js.map +1 -1
- package/dist/resolve-accounts.d.ts +75 -10
- package/dist/resolve-accounts.d.ts.map +1 -1
- package/dist/resolve-accounts.js +68 -32
- package/dist/resolve-accounts.js.map +1 -1
- package/dist/rpc-helpers.d.ts +29 -3
- package/dist/rpc-helpers.d.ts.map +1 -1
- package/dist/rpc-helpers.js +51 -12
- package/dist/rpc-helpers.js.map +1 -1
- package/dist/seal/intent-digest.d.ts +195 -0
- package/dist/seal/intent-digest.d.ts.map +1 -0
- package/dist/seal/intent-digest.js +372 -0
- package/dist/seal/intent-digest.js.map +1 -0
- package/dist/seal.d.ts +166 -3
- package/dist/seal.d.ts.map +1 -1
- package/dist/seal.js +428 -32
- package/dist/seal.js.map +1 -1
- package/dist/security-analytics.d.ts +3 -3
- package/dist/security-analytics.d.ts.map +1 -1
- package/dist/security-analytics.js +13 -128
- package/dist/security-analytics.js.map +1 -1
- package/dist/session-mint.d.ts +72 -0
- package/dist/session-mint.d.ts.map +1 -0
- package/dist/session-mint.js +59 -0
- package/dist/session-mint.js.map +1 -0
- package/dist/simulation.d.ts +19 -0
- package/dist/simulation.d.ts.map +1 -1
- package/dist/simulation.js +187 -95
- package/dist/simulation.js.map +1 -1
- package/dist/squads-detection.d.ts +135 -0
- package/dist/squads-detection.d.ts.map +1 -0
- package/dist/squads-detection.js +124 -0
- package/dist/squads-detection.js.map +1 -0
- package/dist/state-resolver.d.ts +0 -16
- package/dist/state-resolver.d.ts.map +1 -1
- package/dist/state-resolver.js +162 -97
- package/dist/state-resolver.js.map +1 -1
- package/dist/testing/devnet.d.ts +40 -1
- package/dist/testing/devnet.d.ts.map +1 -1
- package/dist/testing/devnet.js +333 -44
- package/dist/testing/devnet.js.map +1 -1
- package/dist/testing/errors/expect.d.ts +1 -1
- package/dist/testing/errors/expect.js +1 -1
- package/dist/testing/errors/names.generated.d.ts +82 -58
- package/dist/testing/errors/names.generated.d.ts.map +1 -1
- package/dist/testing/errors/names.generated.js +83 -59
- package/dist/testing/errors/names.generated.js.map +1 -1
- package/dist/testing/mock-rpc.d.ts +8 -0
- package/dist/testing/mock-rpc.d.ts.map +1 -1
- package/dist/testing/mock-rpc.js +13 -0
- package/dist/testing/mock-rpc.js.map +1 -1
- package/dist/testing/mock-state.d.ts +2 -0
- package/dist/testing/mock-state.d.ts.map +1 -1
- package/dist/testing/mock-state.js +43 -4
- package/dist/testing/mock-state.js.map +1 -1
- package/dist/types.d.ts +5 -15
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +11 -69
- package/dist/types.js.map +1 -1
- package/dist/vault-analytics.d.ts +0 -2
- package/dist/vault-analytics.d.ts.map +1 -1
- package/dist/vault-analytics.js +1 -9
- package/dist/vault-analytics.js.map +1 -1
- package/package.json +7 -12
- package/dist/constraints/index.d.ts +0 -23
- package/dist/constraints/index.d.ts.map +0 -1
- package/dist/constraints/index.js +0 -24
- package/dist/constraints/index.js.map +0 -1
- package/dist/dashboard/constraint-builders.d.ts +0 -82
- package/dist/dashboard/constraint-builders.d.ts.map +0 -1
- package/dist/dashboard/constraint-builders.js +0 -204
- package/dist/dashboard/constraint-builders.js.map +0 -1
- package/dist/dashboard/constraint-reads.d.ts +0 -50
- package/dist/dashboard/constraint-reads.d.ts.map +0 -1
- package/dist/dashboard/constraint-reads.js +0 -119
- package/dist/dashboard/constraint-reads.js.map +0 -1
- package/dist/generated/accounts/escrowDeposit.d.ts +0 -50
- package/dist/generated/accounts/escrowDeposit.d.ts.map +0 -1
- package/dist/generated/accounts/escrowDeposit.js +0 -76
- package/dist/generated/accounts/escrowDeposit.js.map +0 -1
- package/dist/generated/accounts/instructionConstraints.d.ts +0 -46
- package/dist/generated/accounts/instructionConstraints.d.ts.map +0 -1
- package/dist/generated/accounts/instructionConstraints.js +0 -73
- package/dist/generated/accounts/instructionConstraints.js.map +0 -1
- package/dist/generated/accounts/pendingCloseConstraints.d.ts +0 -49
- package/dist/generated/accounts/pendingCloseConstraints.d.ts.map +0 -1
- package/dist/generated/accounts/pendingCloseConstraints.js +0 -68
- package/dist/generated/accounts/pendingCloseConstraints.js.map +0 -1
- package/dist/generated/accounts/pendingConstraintsUpdate.d.ts +0 -76
- package/dist/generated/accounts/pendingConstraintsUpdate.d.ts.map +0 -1
- package/dist/generated/accounts/pendingConstraintsUpdate.js +0 -77
- package/dist/generated/accounts/pendingConstraintsUpdate.js.map +0 -1
- package/dist/generated/instructions/allocateConstraintsPda.d.ts +0 -62
- package/dist/generated/instructions/allocateConstraintsPda.d.ts.map +0 -1
- package/dist/generated/instructions/allocateConstraintsPda.js +0 -134
- package/dist/generated/instructions/allocateConstraintsPda.js.map +0 -1
- package/dist/generated/instructions/allocatePendingConstraintsPda.d.ts +0 -66
- package/dist/generated/instructions/allocatePendingConstraintsPda.d.ts.map +0 -1
- package/dist/generated/instructions/allocatePendingConstraintsPda.js.map +0 -1
- package/dist/generated/instructions/applyCloseConstraints.d.ts +0 -59
- package/dist/generated/instructions/applyCloseConstraints.d.ts.map +0 -1
- package/dist/generated/instructions/applyCloseConstraints.js +0 -143
- package/dist/generated/instructions/applyCloseConstraints.js.map +0 -1
- package/dist/generated/instructions/applyConstraintsUpdate.d.ts +0 -62
- package/dist/generated/instructions/applyConstraintsUpdate.d.ts.map +0 -1
- package/dist/generated/instructions/applyConstraintsUpdate.js.map +0 -1
- package/dist/generated/instructions/cancelCloseConstraints.d.ts +0 -51
- package/dist/generated/instructions/cancelCloseConstraints.d.ts.map +0 -1
- package/dist/generated/instructions/cancelCloseConstraints.js +0 -115
- package/dist/generated/instructions/cancelCloseConstraints.js.map +0 -1
- package/dist/generated/instructions/cancelConstraintsUpdate.d.ts +0 -51
- package/dist/generated/instructions/cancelConstraintsUpdate.d.ts.map +0 -1
- package/dist/generated/instructions/cancelConstraintsUpdate.js +0 -115
- package/dist/generated/instructions/cancelConstraintsUpdate.js.map +0 -1
- package/dist/generated/instructions/cleanupOrphanConstraintsPda.d.ts +0 -67
- package/dist/generated/instructions/cleanupOrphanConstraintsPda.d.ts.map +0 -1
- package/dist/generated/instructions/cleanupOrphanConstraintsPda.js +0 -120
- package/dist/generated/instructions/cleanupOrphanConstraintsPda.js.map +0 -1
- package/dist/generated/instructions/closeSettledEscrow.d.ts +0 -72
- package/dist/generated/instructions/closeSettledEscrow.d.ts.map +0 -1
- package/dist/generated/instructions/closeSettledEscrow.js +0 -127
- package/dist/generated/instructions/closeSettledEscrow.js.map +0 -1
- package/dist/generated/instructions/createEscrow.d.ts +0 -131
- package/dist/generated/instructions/createEscrow.d.ts.map +0 -1
- package/dist/generated/instructions/createEscrow.js +0 -272
- package/dist/generated/instructions/createEscrow.js.map +0 -1
- package/dist/generated/instructions/createInstructionConstraints.d.ts +0 -68
- package/dist/generated/instructions/createInstructionConstraints.d.ts.map +0 -1
- package/dist/generated/instructions/createInstructionConstraints.js.map +0 -1
- package/dist/generated/instructions/extendPda.d.ts +0 -52
- package/dist/generated/instructions/extendPda.d.ts.map +0 -1
- package/dist/generated/instructions/extendPda.js +0 -86
- package/dist/generated/instructions/extendPda.js.map +0 -1
- package/dist/generated/instructions/queueCloseConstraints.d.ts +0 -66
- package/dist/generated/instructions/queueCloseConstraints.d.ts.map +0 -1
- package/dist/generated/instructions/queueCloseConstraints.js.map +0 -1
- package/dist/generated/instructions/queueConstraintsUpdate.d.ts +0 -75
- package/dist/generated/instructions/queueConstraintsUpdate.d.ts.map +0 -1
- package/dist/generated/instructions/queueConstraintsUpdate.js +0 -154
- package/dist/generated/instructions/queueConstraintsUpdate.js.map +0 -1
- package/dist/generated/instructions/refundEscrow.d.ts +0 -74
- package/dist/generated/instructions/refundEscrow.d.ts.map +0 -1
- package/dist/generated/instructions/refundEscrow.js +0 -142
- package/dist/generated/instructions/refundEscrow.js.map +0 -1
- package/dist/generated/instructions/settleEscrow.d.ts +0 -80
- package/dist/generated/instructions/settleEscrow.d.ts.map +0 -1
- package/dist/generated/instructions/settleEscrow.js +0 -173
- package/dist/generated/instructions/settleEscrow.js.map +0 -1
- package/dist/generated/types/accountConstraint.d.ts +0 -33
- package/dist/generated/types/accountConstraint.d.ts.map +0 -1
- package/dist/generated/types/accountConstraint.js +0 -26
- package/dist/generated/types/accountConstraint.js.map +0 -1
- package/dist/generated/types/accountConstraintZC.d.ts +0 -25
- package/dist/generated/types/accountConstraintZC.d.ts.map +0 -1
- package/dist/generated/types/accountConstraintZC.js +0 -28
- package/dist/generated/types/accountConstraintZC.js.map +0 -1
- package/dist/generated/types/closeConstraintsApplied.d.ts +0 -20
- package/dist/generated/types/closeConstraintsApplied.d.ts.map +0 -1
- package/dist/generated/types/closeConstraintsApplied.js +0 -24
- package/dist/generated/types/closeConstraintsApplied.js.map +0 -1
- package/dist/generated/types/closeConstraintsCancelled.d.ts +0 -16
- package/dist/generated/types/closeConstraintsCancelled.d.ts.map +0 -1
- package/dist/generated/types/closeConstraintsCancelled.js +0 -18
- package/dist/generated/types/closeConstraintsCancelled.js.map +0 -1
- package/dist/generated/types/closeConstraintsQueued.d.ts +0 -20
- package/dist/generated/types/closeConstraintsQueued.d.ts.map +0 -1
- package/dist/generated/types/closeConstraintsQueued.js +0 -24
- package/dist/generated/types/closeConstraintsQueued.js.map +0 -1
- package/dist/generated/types/constraintEntry.d.ts +0 -35
- package/dist/generated/types/constraintEntry.d.ts.map +0 -1
- package/dist/generated/types/constraintEntry.js +0 -29
- package/dist/generated/types/constraintEntry.js.map +0 -1
- package/dist/generated/types/constraintEntryZC.d.ts +0 -73
- package/dist/generated/types/constraintEntryZC.d.ts.map +0 -1
- package/dist/generated/types/constraintEntryZC.js +0 -49
- package/dist/generated/types/constraintEntryZC.js.map +0 -1
- package/dist/generated/types/constraintOperator.d.ts +0 -22
- package/dist/generated/types/constraintOperator.d.ts.map +0 -1
- package/dist/generated/types/constraintOperator.js +0 -28
- package/dist/generated/types/constraintOperator.js.map +0 -1
- package/dist/generated/types/constraintsChangeApplied.d.ts +0 -30
- package/dist/generated/types/constraintsChangeApplied.d.ts.map +0 -1
- package/dist/generated/types/constraintsChangeApplied.js +0 -32
- package/dist/generated/types/constraintsChangeApplied.js.map +0 -1
- package/dist/generated/types/constraintsChangeCancelled.d.ts +0 -16
- package/dist/generated/types/constraintsChangeCancelled.d.ts.map +0 -1
- package/dist/generated/types/constraintsChangeCancelled.js +0 -18
- package/dist/generated/types/constraintsChangeCancelled.js.map +0 -1
- package/dist/generated/types/constraintsChangeQueued.d.ts +0 -30
- package/dist/generated/types/constraintsChangeQueued.d.ts.map +0 -1
- package/dist/generated/types/constraintsChangeQueued.js +0 -32
- package/dist/generated/types/constraintsChangeQueued.js.map +0 -1
- package/dist/generated/types/dataConstraint.d.ts +0 -23
- package/dist/generated/types/dataConstraint.d.ts.map +0 -1
- package/dist/generated/types/dataConstraint.js +0 -27
- package/dist/generated/types/dataConstraint.js.map +0 -1
- package/dist/generated/types/dataConstraintZC.d.ts +0 -20
- package/dist/generated/types/dataConstraintZC.d.ts.map +0 -1
- package/dist/generated/types/dataConstraintZC.js +0 -30
- package/dist/generated/types/dataConstraintZC.js.map +0 -1
- package/dist/generated/types/discriminatorFormat.d.ts +0 -25
- package/dist/generated/types/discriminatorFormat.d.ts.map +0 -1
- package/dist/generated/types/discriminatorFormat.js +0 -31
- package/dist/generated/types/discriminatorFormat.js.map +0 -1
- package/dist/generated/types/escrowCreated.d.ts +0 -30
- package/dist/generated/types/escrowCreated.d.ts.map +0 -1
- package/dist/generated/types/escrowCreated.js +0 -34
- package/dist/generated/types/escrowCreated.js.map +0 -1
- package/dist/generated/types/escrowRefunded.d.ts +0 -26
- package/dist/generated/types/escrowRefunded.d.ts.map +0 -1
- package/dist/generated/types/escrowRefunded.js +0 -30
- package/dist/generated/types/escrowRefunded.js.map +0 -1
- package/dist/generated/types/escrowSettled.d.ts +0 -26
- package/dist/generated/types/escrowSettled.d.ts.map +0 -1
- package/dist/generated/types/escrowSettled.js +0 -30
- package/dist/generated/types/escrowSettled.js.map +0 -1
- package/dist/generated/types/escrowStatus.d.ts +0 -18
- package/dist/generated/types/escrowStatus.d.ts.map +0 -1
- package/dist/generated/types/escrowStatus.js +0 -24
- package/dist/generated/types/escrowStatus.js.map +0 -1
- package/dist/generated/types/instructionConstraintsCreated.d.ts +0 -34
- package/dist/generated/types/instructionConstraintsCreated.d.ts.map +0 -1
- package/dist/generated/types/instructionConstraintsCreated.js +0 -36
- package/dist/generated/types/instructionConstraintsCreated.js.map +0 -1
- package/dist/generated/types/orphanConstraintsPdaCleaned.d.ts +0 -22
- package/dist/generated/types/orphanConstraintsPdaCleaned.d.ts.map +0 -1
- package/dist/generated/types/orphanConstraintsPdaCleaned.js.map +0 -1
- package/dist/generated/types/pdaAllocated.d.ts +0 -24
- package/dist/generated/types/pdaAllocated.d.ts.map +0 -1
- package/dist/generated/types/pdaAllocated.js +0 -28
- package/dist/generated/types/pdaAllocated.js.map +0 -1
- package/dist/generated/types/pdaExtended.d.ts +0 -24
- package/dist/generated/types/pdaExtended.d.ts.map +0 -1
- package/dist/generated/types/pdaExtended.js +0 -28
- package/dist/generated/types/pdaExtended.js.map +0 -1
- package/dist/post-assertions/cross-field-lte.d.ts +0 -134
- package/dist/post-assertions/cross-field-lte.d.ts.map +0 -1
- package/dist/post-assertions/cross-field-lte.js +0 -129
- package/dist/post-assertions/cross-field-lte.js.map +0 -1
- package/dist/post-assertions/index.d.ts +0 -28
- package/dist/post-assertions/index.d.ts.map +0 -1
- package/dist/post-assertions/index.js +0 -28
- package/dist/post-assertions/index.js.map +0 -1
- package/dist/post-assertions/presets/flash-trade.d.ts +0 -139
- package/dist/post-assertions/presets/flash-trade.d.ts.map +0 -1
- package/dist/post-assertions/presets/flash-trade.js +0 -154
- package/dist/post-assertions/presets/flash-trade.js.map +0 -1
- package/dist/protocol-registry/annotations/drift.json +0 -7
- package/dist/protocol-registry/annotations/flash-trade.json +0 -7
- package/dist/protocol-registry/annotations/jupiter-borrow.json +0 -7
- package/dist/protocol-registry/annotations/jupiter-earn.json +0 -7
- package/dist/protocol-registry/annotations/jupiter-lend.json +0 -7
- package/dist/protocol-registry/annotations/jupiter.json +0 -7
- package/dist/protocol-registry/annotations/kamino.json +0 -7
- package/dist/protocol-registry/index.d.ts +0 -45
- package/dist/protocol-registry/index.d.ts.map +0 -1
- package/dist/protocol-registry/index.js +0 -76
- package/dist/protocol-registry/index.js.map +0 -1
- package/dist/protocol-tier.d.ts +0 -157
- package/dist/protocol-tier.d.ts.map +0 -1
- package/dist/protocol-tier.js +0 -104
- package/dist/protocol-tier.js.map +0 -1
package/dist/agent-errors.js
CHANGED
|
@@ -5,12 +5,43 @@
|
|
|
5
5
|
* Every error includes a category, retryability flag, and
|
|
6
6
|
* recovery actions that tell the agent exactly what to do next.
|
|
7
7
|
*
|
|
8
|
-
* Maps all
|
|
9
|
-
*
|
|
8
|
+
* Maps all 105 on-chain error codes (6000-6104) — post M1-04 constraints-engine
|
|
9
|
+
* teardown, which removed 10 dead constraint-only variants and renumbered the
|
|
10
|
+
* enum (positional). The IDL (`target/idl/sigil.json`) is the authoritative
|
|
11
|
+
* code↔name source; `error-map-drift.test.ts` enforces this map agrees with it.
|
|
12
|
+
* Plus 34 SDK error codes (7000-7033), all to AgentError with machine-readable
|
|
13
|
+
* metadata.
|
|
10
14
|
*
|
|
11
15
|
* Zero dependency on @solana/web3.js or @coral-xyz/anchor.
|
|
12
16
|
* Uses bigint instead of BN for context values.
|
|
13
17
|
*/
|
|
18
|
+
// ---------------------------------------------------------------------------
|
|
19
|
+
// On-chain error code range constants — single source of truth.
|
|
20
|
+
//
|
|
21
|
+
// `dashboard/errors.ts` re-imports these for the FE→BE category mapping.
|
|
22
|
+
// `tests/dashboard/errors-categorize.test.ts` iterates every generated
|
|
23
|
+
// `SIGIL_ERROR__*` constant and asserts it falls within this range, so
|
|
24
|
+
// drift between MAX and the highest variant breaks CI immediately.
|
|
25
|
+
//
|
|
26
|
+
// MAINTENANCE — when `programs/sigil/src/errors.rs` adds a new variant:
|
|
27
|
+
// 1. Bump SIGIL_ON_CHAIN_ERROR_MAX below to the new highest code.
|
|
28
|
+
// 2. Add an entry to ON_CHAIN_ERRORS for that code (or a TODO with
|
|
29
|
+
// explicit deferral rationale).
|
|
30
|
+
// 3. Regenerate the IDL + SDK with `pnpm codama` so generated/errors
|
|
31
|
+
// stays in lockstep.
|
|
32
|
+
// ---------------------------------------------------------------------------
|
|
33
|
+
/** Lowest Anchor-error code Sigil emits. */
|
|
34
|
+
export const SIGIL_ON_CHAIN_ERROR_MIN = 6000;
|
|
35
|
+
/**
|
|
36
|
+
* Highest Anchor-error code currently in use. Bump when errors.rs grows.
|
|
37
|
+
*
|
|
38
|
+
* The enum tops out at 6106 (107 codes). The drift gate at
|
|
39
|
+
* `tests/error-map-drift.test.ts` derives the expected count from
|
|
40
|
+
* `target/idl/sigil.json` (the authoritative code↔name source) and asserts
|
|
41
|
+
* this map agrees with it by code AND name — so adding or renumbering an
|
|
42
|
+
* on-chain error without updating this map fails at test time.
|
|
43
|
+
*/
|
|
44
|
+
export const SIGIL_ON_CHAIN_ERROR_MAX = 6111;
|
|
14
45
|
export const ON_CHAIN_ERROR_MAP = {
|
|
15
46
|
// --- Vault state errors ---
|
|
16
47
|
6000: {
|
|
@@ -428,35 +459,6 @@ export const ON_CHAIN_ERROR_MAP = {
|
|
|
428
459
|
],
|
|
429
460
|
},
|
|
430
461
|
6030: {
|
|
431
|
-
name: "SwapSlippageExceeded",
|
|
432
|
-
message: "Swap slippage exceeds policy max_slippage_bps or quoted output is zero",
|
|
433
|
-
category: "POLICY_VIOLATION",
|
|
434
|
-
retryable: false,
|
|
435
|
-
recovery_actions: [
|
|
436
|
-
{
|
|
437
|
-
action: "reduce_slippage",
|
|
438
|
-
description: "Use a lower slippageBps value within the vault's maxSlippageBps",
|
|
439
|
-
},
|
|
440
|
-
{
|
|
441
|
-
action: "check_policy",
|
|
442
|
-
description: "Check the vault's maxSlippageBps setting",
|
|
443
|
-
tool: "sigil_check_vault",
|
|
444
|
-
},
|
|
445
|
-
],
|
|
446
|
-
},
|
|
447
|
-
6031: {
|
|
448
|
-
name: "InvalidJupiterInstruction",
|
|
449
|
-
message: "Cannot parse Jupiter swap instruction data",
|
|
450
|
-
category: "INPUT_VALIDATION",
|
|
451
|
-
retryable: false,
|
|
452
|
-
recovery_actions: [
|
|
453
|
-
{
|
|
454
|
-
action: "use_sdk",
|
|
455
|
-
description: "Use the SDK's composeJupiterSwap — manual instruction building is error-prone",
|
|
456
|
-
},
|
|
457
|
-
],
|
|
458
|
-
},
|
|
459
|
-
6032: {
|
|
460
462
|
name: "UnauthorizedTokenTransfer",
|
|
461
463
|
message: "Top-level SPL Token transfer not allowed between validate and finalize",
|
|
462
464
|
category: "POLICY_VIOLATION",
|
|
@@ -468,7 +470,7 @@ export const ON_CHAIN_ERROR_MAP = {
|
|
|
468
470
|
},
|
|
469
471
|
],
|
|
470
472
|
},
|
|
471
|
-
|
|
473
|
+
6031: {
|
|
472
474
|
name: "SlippageBpsTooHigh",
|
|
473
475
|
message: "Slippage BPS exceeds maximum allowed (5000 = 50%)",
|
|
474
476
|
category: "INPUT_VALIDATION",
|
|
@@ -480,7 +482,7 @@ export const ON_CHAIN_ERROR_MAP = {
|
|
|
480
482
|
},
|
|
481
483
|
],
|
|
482
484
|
},
|
|
483
|
-
|
|
485
|
+
6032: {
|
|
484
486
|
name: "ProtocolMismatch",
|
|
485
487
|
message: "DeFi instruction program does not match the declared target_protocol",
|
|
486
488
|
category: "INPUT_VALIDATION",
|
|
@@ -492,7 +494,7 @@ export const ON_CHAIN_ERROR_MAP = {
|
|
|
492
494
|
},
|
|
493
495
|
],
|
|
494
496
|
},
|
|
495
|
-
|
|
497
|
+
6033: {
|
|
496
498
|
name: "TooManyDeFiInstructions",
|
|
497
499
|
message: "Non-stablecoin swap allows exactly one DeFi instruction",
|
|
498
500
|
category: "INPUT_VALIDATION",
|
|
@@ -505,7 +507,7 @@ export const ON_CHAIN_ERROR_MAP = {
|
|
|
505
507
|
],
|
|
506
508
|
},
|
|
507
509
|
// --- Multi-Agent errors ---
|
|
508
|
-
|
|
510
|
+
6034: {
|
|
509
511
|
name: "MaxAgentsReached",
|
|
510
512
|
message: "Maximum agents per vault reached (limit: 10)",
|
|
511
513
|
category: "INPUT_VALIDATION",
|
|
@@ -518,7 +520,7 @@ export const ON_CHAIN_ERROR_MAP = {
|
|
|
518
520
|
},
|
|
519
521
|
],
|
|
520
522
|
},
|
|
521
|
-
|
|
523
|
+
6035: {
|
|
522
524
|
name: "InsufficientPermissions",
|
|
523
525
|
message: "Agent lacks permission for this action type",
|
|
524
526
|
category: "PERMISSION",
|
|
@@ -535,7 +537,7 @@ export const ON_CHAIN_ERROR_MAP = {
|
|
|
535
537
|
},
|
|
536
538
|
],
|
|
537
539
|
},
|
|
538
|
-
|
|
540
|
+
6036: {
|
|
539
541
|
name: "InvalidPermissions",
|
|
540
542
|
message: "Capability exceeds the on-chain maximum (valid values: 0 = Disabled, 1 = Observer, 2 = Operator)",
|
|
541
543
|
category: "INPUT_VALIDATION",
|
|
@@ -547,650 +549,1127 @@ export const ON_CHAIN_ERROR_MAP = {
|
|
|
547
549
|
},
|
|
548
550
|
],
|
|
549
551
|
},
|
|
550
|
-
// ---
|
|
552
|
+
// --- Post-execution assertion config error ---
|
|
553
|
+
6037: {
|
|
554
|
+
name: "InvalidConstraintConfig",
|
|
555
|
+
message: "Invalid constraint configuration: bounds exceeded",
|
|
556
|
+
category: "INPUT_VALIDATION",
|
|
557
|
+
retryable: false,
|
|
558
|
+
recovery_actions: [
|
|
559
|
+
{
|
|
560
|
+
action: "fix_constraints",
|
|
561
|
+
description: "Ensure constraint entries are within bounds (max 64 entries, 8 data constraints each)",
|
|
562
|
+
},
|
|
563
|
+
],
|
|
564
|
+
},
|
|
565
|
+
// --- Per-agent spend limit errors ---
|
|
566
|
+
6038: {
|
|
567
|
+
name: "AgentSpendLimitExceeded",
|
|
568
|
+
message: "Agent's rolling 24h spend exceeds their individual spending limit",
|
|
569
|
+
category: "SPENDING_CAP",
|
|
570
|
+
retryable: true,
|
|
571
|
+
retry_after_ms: 3_600_000,
|
|
572
|
+
recovery_actions: [
|
|
573
|
+
{
|
|
574
|
+
action: "reduce_amount",
|
|
575
|
+
description: "Reduce the amount to fit within the agent's remaining limit",
|
|
576
|
+
},
|
|
577
|
+
{
|
|
578
|
+
action: "check_spending",
|
|
579
|
+
description: "Check the agent's current spend against their limit",
|
|
580
|
+
tool: "sigil_check_spending",
|
|
581
|
+
},
|
|
582
|
+
{
|
|
583
|
+
action: "wait",
|
|
584
|
+
description: "Wait for the 24h rolling window to release spent capacity",
|
|
585
|
+
},
|
|
586
|
+
],
|
|
587
|
+
},
|
|
551
588
|
6039: {
|
|
552
|
-
name: "
|
|
553
|
-
message: "
|
|
554
|
-
category: "
|
|
589
|
+
name: "OverlaySlotExhausted",
|
|
590
|
+
message: "Per-agent overlay is full — cannot register agent with spending limit",
|
|
591
|
+
category: "INPUT_VALIDATION",
|
|
555
592
|
retryable: false,
|
|
556
593
|
recovery_actions: [
|
|
557
594
|
{
|
|
558
|
-
action: "
|
|
559
|
-
description: "
|
|
595
|
+
action: "revoke_agent",
|
|
596
|
+
description: "Revoke an unused agent to free an overlay slot",
|
|
597
|
+
tool: "sigil_revoke_agent",
|
|
560
598
|
},
|
|
561
599
|
],
|
|
562
600
|
},
|
|
563
601
|
6040: {
|
|
564
|
-
name: "
|
|
565
|
-
message: "
|
|
602
|
+
name: "AgentSlotNotFound",
|
|
603
|
+
message: "Agent has per-agent spending limit but no overlay tracking slot",
|
|
566
604
|
category: "RESOURCE_NOT_FOUND",
|
|
567
605
|
retryable: false,
|
|
568
606
|
recovery_actions: [
|
|
569
607
|
{
|
|
570
|
-
action: "
|
|
571
|
-
description: "
|
|
572
|
-
tool: "sigil_refund_escrow",
|
|
608
|
+
action: "contact_support",
|
|
609
|
+
description: "This is an internal consistency error — the overlay may need reinitialization",
|
|
573
610
|
},
|
|
574
611
|
],
|
|
575
612
|
},
|
|
576
613
|
6041: {
|
|
577
|
-
name: "
|
|
578
|
-
message: "
|
|
614
|
+
name: "UnauthorizedTokenApproval",
|
|
615
|
+
message: "Unauthorized SPL Token Approve detected between validate and finalize",
|
|
616
|
+
category: "POLICY_VIOLATION",
|
|
617
|
+
retryable: false,
|
|
618
|
+
recovery_actions: [
|
|
619
|
+
{
|
|
620
|
+
action: "use_sdk",
|
|
621
|
+
description: "Use the SDK's compose functions — do not insert raw SPL Approve in the sandwich",
|
|
622
|
+
},
|
|
623
|
+
],
|
|
624
|
+
},
|
|
625
|
+
6042: {
|
|
626
|
+
name: "InvalidSessionExpiry",
|
|
627
|
+
message: "Session expiry slots out of range (10-450)",
|
|
579
628
|
category: "INPUT_VALIDATION",
|
|
580
629
|
retryable: false,
|
|
630
|
+
recovery_actions: [
|
|
631
|
+
{
|
|
632
|
+
action: "fix_expiry",
|
|
633
|
+
description: "Set session expiry between 10 and 450 slots",
|
|
634
|
+
},
|
|
635
|
+
],
|
|
636
|
+
},
|
|
637
|
+
// --- Per-protocol spend cap errors ---
|
|
638
|
+
// Phase 5 §RP-1 V5: 6047 semantics flipped. The "rolling 24h per-protocol
|
|
639
|
+
// cap exceeded" semantic moved to 6095 (ErrDailyCapExceeded). 6047 now
|
|
640
|
+
// only emits from `state/tracker.rs:313` when the fixed-size per-protocol
|
|
641
|
+
// counter slot allocation (max 10 protocols tracked) is exhausted —
|
|
642
|
+
// i.e. an 11th distinct protocol attempted within the rolling window.
|
|
643
|
+
6043: {
|
|
644
|
+
name: "ProtocolCapExceeded",
|
|
645
|
+
message: "Per-protocol counter slot allocation exhausted (max 10 protocols tracked)",
|
|
646
|
+
category: "SPENDING_CAP",
|
|
647
|
+
retryable: true,
|
|
648
|
+
retry_after_ms: 3_600_000,
|
|
581
649
|
recovery_actions: [
|
|
582
650
|
{
|
|
583
651
|
action: "wait",
|
|
584
|
-
description: "Wait for
|
|
652
|
+
description: "Wait for an existing protocol slot's 24h rolling window to elapse before invoking a new protocol",
|
|
585
653
|
},
|
|
586
654
|
{
|
|
587
|
-
action: "
|
|
588
|
-
description: "
|
|
589
|
-
tool: "sigil_settle_escrow",
|
|
655
|
+
action: "use_existing_protocol",
|
|
656
|
+
description: "Reuse one of the protocols already tracked in the rolling window rather than invoking an 11th distinct protocol",
|
|
590
657
|
},
|
|
591
658
|
],
|
|
592
659
|
},
|
|
593
|
-
|
|
594
|
-
name: "
|
|
595
|
-
message: "
|
|
660
|
+
6044: {
|
|
661
|
+
name: "ProtocolCapsMismatch",
|
|
662
|
+
message: "protocol_caps length must match protocols length when has_protocol_caps is true",
|
|
596
663
|
category: "INPUT_VALIDATION",
|
|
597
664
|
retryable: false,
|
|
598
665
|
recovery_actions: [
|
|
599
666
|
{
|
|
600
|
-
action: "
|
|
601
|
-
description: "Ensure
|
|
667
|
+
action: "fix_config",
|
|
668
|
+
description: "Ensure protocol_caps array length matches the protocols array length",
|
|
602
669
|
},
|
|
603
670
|
],
|
|
604
671
|
},
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
672
|
+
// --- Vault closure guard errors ---
|
|
673
|
+
6045: {
|
|
674
|
+
name: "PendingPolicyExists",
|
|
675
|
+
message: "A pending policy update exists — apply or cancel it before closing vault",
|
|
676
|
+
category: "RESOURCE_NOT_FOUND",
|
|
677
|
+
retryable: false,
|
|
678
|
+
recovery_actions: [
|
|
679
|
+
{
|
|
680
|
+
action: "resolve_pending_policy",
|
|
681
|
+
description: "Apply or cancel the pending policy update before closing the vault",
|
|
682
|
+
},
|
|
683
|
+
],
|
|
684
|
+
},
|
|
685
|
+
// --- Agent pause errors ---
|
|
686
|
+
6046: {
|
|
687
|
+
name: "AgentPaused",
|
|
688
|
+
message: "Agent is paused — unpause before executing actions",
|
|
689
|
+
category: "PERMISSION",
|
|
690
|
+
retryable: false,
|
|
691
|
+
recovery_actions: [
|
|
692
|
+
{
|
|
693
|
+
action: "unpause_agent",
|
|
694
|
+
description: "Ask the vault owner to unpause this agent",
|
|
695
|
+
},
|
|
696
|
+
],
|
|
697
|
+
},
|
|
698
|
+
6047: {
|
|
699
|
+
name: "AgentAlreadyPaused",
|
|
700
|
+
message: "Agent is already paused",
|
|
608
701
|
category: "INPUT_VALIDATION",
|
|
609
702
|
retryable: false,
|
|
610
703
|
recovery_actions: [
|
|
611
704
|
{
|
|
612
|
-
action: "
|
|
613
|
-
description: "
|
|
705
|
+
action: "check_agent_status",
|
|
706
|
+
description: "Agent is already paused — no action needed",
|
|
614
707
|
},
|
|
615
708
|
],
|
|
616
709
|
},
|
|
617
|
-
|
|
618
|
-
name: "
|
|
619
|
-
message: "
|
|
710
|
+
6048: {
|
|
711
|
+
name: "AgentNotPaused",
|
|
712
|
+
message: "Agent is not paused — cannot unpause",
|
|
620
713
|
category: "INPUT_VALIDATION",
|
|
621
714
|
retryable: false,
|
|
622
715
|
recovery_actions: [
|
|
623
716
|
{
|
|
624
|
-
action: "
|
|
625
|
-
description: "
|
|
717
|
+
action: "check_agent_status",
|
|
718
|
+
description: "Agent is not paused — no action needed",
|
|
626
719
|
},
|
|
627
720
|
],
|
|
628
721
|
},
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
722
|
+
6049: {
|
|
723
|
+
name: "UnauthorizedPostFinalizeInstruction",
|
|
724
|
+
message: "Instructions after finalize_session must be ComputeBudget or SystemProgram only",
|
|
725
|
+
category: "POLICY_VIOLATION",
|
|
726
|
+
retryable: false,
|
|
727
|
+
recovery_actions: [
|
|
728
|
+
{
|
|
729
|
+
action: "remove_post_finalize_instructions",
|
|
730
|
+
description: "Remove any instructions placed after finalize_session in the transaction. Only ComputeBudget and SystemProgram instructions are allowed after finalize.",
|
|
731
|
+
},
|
|
732
|
+
],
|
|
733
|
+
},
|
|
734
|
+
6050: {
|
|
735
|
+
name: "UnexpectedBalanceDecrease",
|
|
736
|
+
message: "Vault stablecoin balance decreased more than the session authorized amount. " +
|
|
737
|
+
"This indicates a compromised DeFi program attempted to drain vault tokens via CPI.",
|
|
738
|
+
category: "FATAL",
|
|
739
|
+
retryable: false,
|
|
740
|
+
recovery_actions: [
|
|
741
|
+
{
|
|
742
|
+
action: "investigate_defi_program",
|
|
743
|
+
description: "The whitelisted DeFi program may be compromised. The actual vault balance decrease " +
|
|
744
|
+
"exceeded the authorized delegation amount (fees + DeFi spend). Freeze the vault, " +
|
|
745
|
+
"investigate the DeFi program, and consider removing it from the protocol allowlist.",
|
|
746
|
+
},
|
|
747
|
+
{
|
|
748
|
+
action: "freeze_vault",
|
|
749
|
+
description: "Immediately freeze the vault to prevent further transactions until the cause is identified.",
|
|
750
|
+
},
|
|
751
|
+
],
|
|
752
|
+
},
|
|
753
|
+
// --- TOCTOU + timelock hardening errors ---
|
|
754
|
+
6051: {
|
|
755
|
+
name: "TimelockTooShort",
|
|
756
|
+
message: "Timelock duration is below the minimum (1800 seconds / 30 minutes).",
|
|
633
757
|
category: "INPUT_VALIDATION",
|
|
634
758
|
retryable: false,
|
|
635
759
|
recovery_actions: [
|
|
636
760
|
{
|
|
637
|
-
action: "
|
|
638
|
-
description: "
|
|
761
|
+
action: "increase_timelock",
|
|
762
|
+
description: "Set timelock_duration to at least 1800 seconds (30 minutes).",
|
|
639
763
|
},
|
|
640
764
|
],
|
|
641
765
|
},
|
|
642
|
-
|
|
643
|
-
name: "
|
|
644
|
-
message: "
|
|
766
|
+
6052: {
|
|
767
|
+
name: "PolicyVersionMismatch",
|
|
768
|
+
message: "Policy version changed since agent's last RPC read. Re-resolve vault state and retry.",
|
|
769
|
+
category: "TRANSIENT",
|
|
770
|
+
retryable: true,
|
|
771
|
+
retry_after_ms: 1000,
|
|
772
|
+
recovery_actions: [
|
|
773
|
+
{
|
|
774
|
+
action: "re_resolve_state",
|
|
775
|
+
description: "Re-fetch vault state via resolveVaultState() to get current policy version, then retry.",
|
|
776
|
+
},
|
|
777
|
+
],
|
|
778
|
+
},
|
|
779
|
+
6053: {
|
|
780
|
+
name: "ActiveSessionsExist",
|
|
781
|
+
message: "Cannot close vault with active sessions. Finalize all pending sessions first.",
|
|
782
|
+
category: "POLICY_VIOLATION",
|
|
783
|
+
retryable: true,
|
|
784
|
+
retry_after_ms: 10000,
|
|
785
|
+
recovery_actions: [
|
|
786
|
+
{
|
|
787
|
+
action: "finalize_sessions",
|
|
788
|
+
description: "Wait for active sessions to finalize or expire, then retry close_vault.",
|
|
789
|
+
},
|
|
790
|
+
],
|
|
791
|
+
},
|
|
792
|
+
// --- Post-execution assertions (Phase B scaffolding) ---
|
|
793
|
+
6054: {
|
|
794
|
+
name: "PostAssertionFailed",
|
|
795
|
+
message: "Post-execution assertion failed: account state did not satisfy constraint.",
|
|
645
796
|
category: "POLICY_VIOLATION",
|
|
646
797
|
retryable: false,
|
|
647
798
|
recovery_actions: [
|
|
648
799
|
{
|
|
649
|
-
action: "
|
|
650
|
-
description: "Review the vault's
|
|
651
|
-
tool: "sigil_check_vault",
|
|
800
|
+
action: "review_assertions",
|
|
801
|
+
description: "Review the vault's post-execution assertions. The trade's resulting account state violated a configured assertion.",
|
|
652
802
|
},
|
|
803
|
+
],
|
|
804
|
+
},
|
|
805
|
+
6055: {
|
|
806
|
+
name: "InvalidPostAssertionIndex",
|
|
807
|
+
message: "Post-assertion references an invalid instruction index.",
|
|
808
|
+
category: "INPUT_VALIDATION",
|
|
809
|
+
retryable: false,
|
|
810
|
+
recovery_actions: [
|
|
653
811
|
{
|
|
654
|
-
action: "
|
|
655
|
-
description: "
|
|
812
|
+
action: "fix_assertions",
|
|
813
|
+
description: "Review and update the vault's post-assertion configuration.",
|
|
656
814
|
},
|
|
657
815
|
],
|
|
658
816
|
},
|
|
659
|
-
|
|
660
|
-
name: "
|
|
661
|
-
message: "
|
|
817
|
+
6056: {
|
|
818
|
+
name: "UnauthorizedPreValidateInstruction",
|
|
819
|
+
message: "Non-infrastructure instruction detected before validate_and_authorize.",
|
|
820
|
+
category: "PERMISSION",
|
|
821
|
+
retryable: false,
|
|
822
|
+
recovery_actions: [
|
|
823
|
+
{
|
|
824
|
+
action: "fix_instruction_order",
|
|
825
|
+
description: "Place validate_and_authorize before any DeFi or program instruction.",
|
|
826
|
+
},
|
|
827
|
+
],
|
|
828
|
+
},
|
|
829
|
+
6057: {
|
|
830
|
+
name: "SnapshotNotCaptured",
|
|
831
|
+
message: "Delta assertion snapshot was not captured in validate_and_authorize.",
|
|
662
832
|
category: "INPUT_VALIDATION",
|
|
663
833
|
retryable: false,
|
|
664
834
|
recovery_actions: [
|
|
665
835
|
{
|
|
666
|
-
action: "
|
|
667
|
-
description: "
|
|
836
|
+
action: "fix_assertions",
|
|
837
|
+
description: "Ensure validate_and_authorize captures a snapshot before finalize delta check.",
|
|
668
838
|
},
|
|
669
839
|
],
|
|
670
840
|
},
|
|
671
|
-
|
|
672
|
-
name: "
|
|
673
|
-
message: "
|
|
841
|
+
6058: {
|
|
842
|
+
name: "InvalidConstraintOperator",
|
|
843
|
+
message: "Constraint operator value is not a valid ConstraintOperator discriminant.",
|
|
674
844
|
category: "INPUT_VALIDATION",
|
|
675
845
|
retryable: false,
|
|
676
846
|
recovery_actions: [
|
|
677
847
|
{
|
|
678
|
-
action: "
|
|
679
|
-
description: "
|
|
848
|
+
action: "fix_constraints",
|
|
849
|
+
description: "Ensure constraint operators are valid (0-6).",
|
|
680
850
|
},
|
|
681
851
|
],
|
|
682
852
|
},
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
retryable: true,
|
|
689
|
-
retry_after_ms: 3_600_000,
|
|
853
|
+
6059: {
|
|
854
|
+
name: "ZeroCopyVaultMismatch",
|
|
855
|
+
message: "Zero-copy constraints account has wrong vault.",
|
|
856
|
+
category: "INPUT_VALIDATION",
|
|
857
|
+
retryable: false,
|
|
690
858
|
recovery_actions: [
|
|
691
859
|
{
|
|
692
|
-
action: "
|
|
693
|
-
description: "
|
|
860
|
+
action: "verify_pda",
|
|
861
|
+
description: "The constraints PDA does not belong to this vault.",
|
|
694
862
|
},
|
|
863
|
+
],
|
|
864
|
+
},
|
|
865
|
+
// F-10 audit fix: durable-nonce pre-signing defense (extended Bucket-3
|
|
866
|
+
// 2026-05-23 to cover the 2 timelocked-admin PDAs via the wider
|
|
867
|
+
// MAX_APPLY_AGE_SLOTS_TIMELOCKED_ADMIN ceiling)
|
|
868
|
+
6060: {
|
|
869
|
+
name: "QueuedUpdateExpired",
|
|
870
|
+
message: "Queued update is too old (>MAX_APPLY_AGE_SLOTS / >MAX_APPLY_AGE_SLOTS_TIMELOCKED_ADMIN) — re-queue to apply. Defends against durable-nonce pre-signing.",
|
|
871
|
+
category: "POLICY_VIOLATION",
|
|
872
|
+
retryable: false,
|
|
873
|
+
recovery_actions: [
|
|
695
874
|
{
|
|
696
|
-
action: "
|
|
697
|
-
description: "
|
|
698
|
-
tool: "sigil_check_spending",
|
|
875
|
+
action: "requeue",
|
|
876
|
+
description: "Re-queue the update via the matching ix for your flow: queue_policy_update / queue_constraints_update / queue_close_constraints / queue_agent_permissions_update / queue_agent_grant / initiate_ownership_transfer — the original queued update is past the freshness window.",
|
|
699
877
|
},
|
|
878
|
+
],
|
|
879
|
+
},
|
|
880
|
+
6061: {
|
|
881
|
+
name: "AccountWritabilityMismatch",
|
|
882
|
+
message: "Account writability flag does not match the constraint requirement (read-only vs writable).",
|
|
883
|
+
category: "INPUT_VALIDATION",
|
|
884
|
+
retryable: false,
|
|
885
|
+
recovery_actions: [
|
|
700
886
|
{
|
|
701
|
-
action: "
|
|
702
|
-
description: "
|
|
887
|
+
action: "fix_constraints",
|
|
888
|
+
description: "Match the writability flag (read-only or writable) of the account passed to the instruction with the constraint's is_writable_required value.",
|
|
703
889
|
},
|
|
704
890
|
],
|
|
705
891
|
},
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
892
|
+
// M11 SIMD-0296 pad-attack DoS guard
|
|
893
|
+
6062: {
|
|
894
|
+
name: "SysvarScanBoundExceeded",
|
|
895
|
+
message: "Sysvar instruction scan exceeded the per-tx safety bound (MAX_SYSVAR_SCAN_ITERATIONS=64).",
|
|
709
896
|
category: "INPUT_VALIDATION",
|
|
710
897
|
retryable: false,
|
|
711
898
|
recovery_actions: [
|
|
712
899
|
{
|
|
713
|
-
action: "
|
|
714
|
-
description: "
|
|
715
|
-
tool: "sigil_revoke_agent",
|
|
900
|
+
action: "fix_transaction_shape",
|
|
901
|
+
description: "Reduce the number of instructions in the transaction. The on-chain sysvar walk is bounded at 64 ix to defend against pad-attack DoS (M11 / SIMD-0296). Legitimate flows fit well under this cap.",
|
|
716
902
|
},
|
|
717
903
|
],
|
|
718
904
|
},
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
905
|
+
// C4 audit fix: async-fulfillment program deny
|
|
906
|
+
6063: {
|
|
907
|
+
name: "AsyncFulfillmentNotPermitted",
|
|
908
|
+
message: "Async-fulfillment programs (Jupiter Perps, Drift v2, Drift JIT) are not permitted in V1 — keeper-driven settlement happens after finalize_session returns and cannot be measured against the spending cap.",
|
|
909
|
+
category: "POLICY_VIOLATION",
|
|
723
910
|
retryable: false,
|
|
724
911
|
recovery_actions: [
|
|
725
912
|
{
|
|
726
|
-
action: "
|
|
727
|
-
description: "
|
|
913
|
+
action: "use_supported_protocol",
|
|
914
|
+
description: "Use a synchronous protocol (Jupiter swap, Jupiter Lend, etc.). V1.1 will add a sanctioned async-friendly path with settlement-tracked counters or post-execution attestation.",
|
|
728
915
|
},
|
|
729
916
|
],
|
|
730
917
|
},
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
918
|
+
// PR 7: Token-2022 opcode blocks (M3 + Pentester HIGH/MED + third-pass audit)
|
|
919
|
+
6064: {
|
|
920
|
+
name: "ConfidentialTransferBlocked",
|
|
921
|
+
message: "Token-2022 ConfidentialTransfer is not permitted between validate_and_authorize and finalize_session.",
|
|
734
922
|
category: "POLICY_VIOLATION",
|
|
735
923
|
retryable: false,
|
|
736
924
|
recovery_actions: [
|
|
737
925
|
{
|
|
738
|
-
action: "
|
|
739
|
-
description: "
|
|
926
|
+
action: "use_supported_protocol",
|
|
927
|
+
description: "Token-2022 ConfidentialTransfer (opcode 27/42) hides spending amounts from sysvar accounting and cannot be tracked. Use the standard SPL Token transfer or Jupiter swap path instead.",
|
|
740
928
|
},
|
|
741
929
|
],
|
|
742
930
|
},
|
|
743
|
-
|
|
744
|
-
name: "
|
|
745
|
-
message: "
|
|
931
|
+
6065: {
|
|
932
|
+
name: "PermanentDelegateBlocked",
|
|
933
|
+
message: "Token-2022 PermanentDelegate is not permitted between validate_and_authorize and finalize_session.",
|
|
934
|
+
category: "POLICY_VIOLATION",
|
|
935
|
+
retryable: false,
|
|
936
|
+
recovery_actions: [
|
|
937
|
+
{
|
|
938
|
+
action: "use_supported_protocol",
|
|
939
|
+
description: "Token-2022 PermanentDelegate (opcode 35) installs a session-bound delegate that survives finalize. Reject up-front; use a per-tx Approve instead.",
|
|
940
|
+
},
|
|
941
|
+
],
|
|
942
|
+
},
|
|
943
|
+
6066: {
|
|
944
|
+
name: "TransferHookBlocked",
|
|
945
|
+
message: "Token-2022 TransferHook is not permitted between validate_and_authorize and finalize_session.",
|
|
946
|
+
category: "POLICY_VIOLATION",
|
|
947
|
+
retryable: false,
|
|
948
|
+
recovery_actions: [
|
|
949
|
+
{
|
|
950
|
+
action: "use_supported_protocol",
|
|
951
|
+
description: "Token-2022 TransferHook (opcode 36) routes mid-tx control to attacker-chosen code. Use a non-hook mint or whitelist the hook program in V1.1.",
|
|
952
|
+
},
|
|
953
|
+
],
|
|
954
|
+
},
|
|
955
|
+
6067: {
|
|
956
|
+
name: "LamportDrainBlocked",
|
|
957
|
+
message: "Token-2022 destructive-balance instruction (opcode 38/45/46) is not permitted between validate_and_authorize and finalize_session.",
|
|
958
|
+
category: "POLICY_VIOLATION",
|
|
959
|
+
retryable: false,
|
|
960
|
+
recovery_actions: [
|
|
961
|
+
{
|
|
962
|
+
action: "use_supported_protocol",
|
|
963
|
+
description: "WithdrawExcessLamports/UnwrapLamports/PermissionedBurnExtension drain SOL or balances outside the spending-cap path. Block at the gate; V1.1 may add an owner-allowlist for legitimate uses.",
|
|
964
|
+
},
|
|
965
|
+
],
|
|
966
|
+
},
|
|
967
|
+
6068: {
|
|
968
|
+
name: "BatchInstructionBlocked",
|
|
969
|
+
message: "Token-2022 Batch instruction (opcode 255) is blocked outright — wraps inner instructions and bypasses the byte-0 blocklist.",
|
|
970
|
+
category: "POLICY_VIOLATION",
|
|
971
|
+
retryable: false,
|
|
972
|
+
recovery_actions: [
|
|
973
|
+
{
|
|
974
|
+
action: "use_supported_protocol",
|
|
975
|
+
description: "Token-2022 Batch (opcode 255) wraps inner TokenInstructions; the byte-0 blocklist cannot see them. Submit each inner ix as its own top-level instruction so guards can inspect each.",
|
|
976
|
+
},
|
|
977
|
+
],
|
|
978
|
+
},
|
|
979
|
+
// F-4 audit fix: explicit destination_mode. Phase 2 Option A tightens to
|
|
980
|
+
// 0 = RESTRICTED only — OPEN_WITH_CAP path deleted.
|
|
981
|
+
6069: {
|
|
982
|
+
name: "InvalidDestinationMode",
|
|
983
|
+
message: "Invalid destination mode (must be 0 = RESTRICTED).",
|
|
746
984
|
category: "INPUT_VALIDATION",
|
|
747
985
|
retryable: false,
|
|
748
986
|
recovery_actions: [
|
|
749
987
|
{
|
|
750
|
-
action: "
|
|
751
|
-
description: "
|
|
988
|
+
action: "fix_policy",
|
|
989
|
+
description: "Pass destination_mode = 0 (RESTRICTED). Phase 2 deleted the permissive OPEN_WITH_CAP path.",
|
|
752
990
|
},
|
|
753
991
|
],
|
|
754
992
|
},
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
993
|
+
// Phase 2 TA-04: reserved AgentEntry.capability values 3..=255 reject.
|
|
994
|
+
6070: {
|
|
995
|
+
name: "InvalidCapability",
|
|
996
|
+
message: "Invalid agent capability value (must be 0 = Disabled, 1 = Observer, or 2 = Operator).",
|
|
997
|
+
category: "INPUT_VALIDATION",
|
|
998
|
+
retryable: false,
|
|
999
|
+
recovery_actions: [
|
|
1000
|
+
{
|
|
1001
|
+
action: "fix_policy",
|
|
1002
|
+
description: "Pass capability = 0, 1, or 2. Reserved values 3..=255 are explicitly rejected by register_agent / queue_agent_permissions_update / apply_agent_permissions_update.",
|
|
1003
|
+
},
|
|
1004
|
+
],
|
|
1005
|
+
},
|
|
1006
|
+
// Phase 2 TA-19: policy_preview_digest mismatch — owner blind-sign defense.
|
|
1007
|
+
6071: {
|
|
1008
|
+
name: "PolicyPreviewMismatch",
|
|
1009
|
+
message: "Policy preview digest mismatch — caller's signed digest differs from recomputed canonical digest.",
|
|
1010
|
+
category: "INPUT_VALIDATION",
|
|
1011
|
+
retryable: false,
|
|
1012
|
+
recovery_actions: [
|
|
1013
|
+
{
|
|
1014
|
+
action: "recompute_digest",
|
|
1015
|
+
description: "Recompute the policy preview digest via computePolicyPreviewDigest() against the actual policy fields and resubmit. Likely cause: owner signed a digest produced from stale fields, or a pending PDA was tampered with between queue and apply.",
|
|
1016
|
+
},
|
|
1017
|
+
],
|
|
1018
|
+
},
|
|
1019
|
+
// Phase 2 TA-19: observe_only mode rejects all validate_and_authorize calls.
|
|
1020
|
+
6072: {
|
|
1021
|
+
name: "ObserveOnlyModeBlocksExecute",
|
|
1022
|
+
message: "Vault is in observe_only mode — validate_and_authorize is blocked.",
|
|
758
1023
|
category: "POLICY_VIOLATION",
|
|
759
1024
|
retryable: false,
|
|
760
1025
|
recovery_actions: [
|
|
761
1026
|
{
|
|
762
|
-
action: "
|
|
763
|
-
description: "
|
|
1027
|
+
action: "switch_vault_mode",
|
|
1028
|
+
description: "Owner must queue + apply a policy update to flip observe_only off (or create a separate vault without observe_only set).",
|
|
764
1029
|
},
|
|
1030
|
+
],
|
|
1031
|
+
},
|
|
1032
|
+
// Phase 2 F-11: active vault (observe_only=false) requires at least one
|
|
1033
|
+
// entry on the protocol allowlist OR destination allowlist. An empty
|
|
1034
|
+
// allowlist would leave the vault silently inert.
|
|
1035
|
+
6073: {
|
|
1036
|
+
name: "ActiveVaultRequiresAllowlist",
|
|
1037
|
+
message: "Active vault (observe_only=false) requires at least one protocol or destination on its allowlist.",
|
|
1038
|
+
category: "INPUT_VALIDATION",
|
|
1039
|
+
retryable: false,
|
|
1040
|
+
recovery_actions: [
|
|
765
1041
|
{
|
|
766
|
-
action: "
|
|
767
|
-
description: "
|
|
768
|
-
tool: "sigil_check_vault",
|
|
1042
|
+
action: "add_allowlist_entry",
|
|
1043
|
+
description: "Either add at least one program to `protocols`, at least one wallet to `allowed_destinations`, or pass `observe_only=true` (intentional inert vault).",
|
|
769
1044
|
},
|
|
770
1045
|
],
|
|
771
1046
|
},
|
|
772
|
-
//
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
1047
|
+
// ─── Phase 3 pre-execution guards (TA-03/05/06/07/08/09/17) ───────────────
|
|
1048
|
+
// 6083-6090 codes added by Phase 3 — each is an on-chain policy-violation
|
|
1049
|
+
// surface that the SDK surfaces to dashboard / agent consumers.
|
|
1050
|
+
6074: {
|
|
1051
|
+
name: "ErrMintNotPinned",
|
|
1052
|
+
message: "Deposit mint is not on the build-time stablecoin allowlist (USDC + USDT). Reject prevents exotic / typosquatted mints from being parked in the vault.",
|
|
1053
|
+
category: "INPUT_VALIDATION",
|
|
1054
|
+
retryable: false,
|
|
1055
|
+
recovery_actions: [
|
|
1056
|
+
{
|
|
1057
|
+
action: "use_pinned_stablecoin",
|
|
1058
|
+
description: "Re-issue the deposit using the USDC or USDT mint. Other tokens are not accepted by the vault.",
|
|
1059
|
+
},
|
|
1060
|
+
],
|
|
1061
|
+
},
|
|
1062
|
+
6075: {
|
|
1063
|
+
name: "ErrOutsideOperatingHours",
|
|
1064
|
+
message: "Current UTC hour is outside the policy's operating_hours bitmask. The vault is configured to spend only during specific UTC hours.",
|
|
1065
|
+
category: "POLICY_VIOLATION",
|
|
1066
|
+
retryable: true,
|
|
1067
|
+
recovery_actions: [
|
|
1068
|
+
{
|
|
1069
|
+
action: "retry_in_window",
|
|
1070
|
+
description: "Wait until a UTC hour permitted by the policy's operating_hours bitmask, or have the owner widen the mask via queue_policy_update.",
|
|
1071
|
+
},
|
|
1072
|
+
],
|
|
1073
|
+
},
|
|
1074
|
+
6076: {
|
|
1075
|
+
name: "ErrCooldownActive",
|
|
1076
|
+
message: "Agent cooldown has not elapsed since the last successful action. Per-agent cooldown is configured by the owner.",
|
|
1077
|
+
category: "POLICY_VIOLATION",
|
|
777
1078
|
retryable: true,
|
|
778
|
-
retry_after_ms: 3_600_000,
|
|
779
1079
|
recovery_actions: [
|
|
780
1080
|
{
|
|
781
|
-
action: "
|
|
782
|
-
description: "
|
|
783
|
-
},
|
|
784
|
-
{
|
|
785
|
-
action: "use_different_protocol",
|
|
786
|
-
description: "Use a different protocol that has remaining capacity",
|
|
1081
|
+
action: "wait_cooldown",
|
|
1082
|
+
description: "Wait until the per-agent cooldown (in seconds) has elapsed since the agent's last successful action.",
|
|
787
1083
|
},
|
|
1084
|
+
],
|
|
1085
|
+
},
|
|
1086
|
+
6077: {
|
|
1087
|
+
name: "ErrGraylistFriction",
|
|
1088
|
+
message: "Destination is on the graylist — a 24h friction window applied to newly-added allowlist destinations. Promote via promote_graylist_destination or wait for unlock.",
|
|
1089
|
+
category: "POLICY_VIOLATION",
|
|
1090
|
+
retryable: true,
|
|
1091
|
+
recovery_actions: [
|
|
788
1092
|
{
|
|
789
|
-
action: "
|
|
790
|
-
description: "
|
|
1093
|
+
action: "wait_or_promote",
|
|
1094
|
+
description: "Owner can promote the destination to active via promote_graylist_destination, or wait the remaining time until automatic unlock.",
|
|
791
1095
|
},
|
|
792
1096
|
],
|
|
793
1097
|
},
|
|
794
|
-
|
|
795
|
-
name: "
|
|
796
|
-
message: "
|
|
1098
|
+
6078: {
|
|
1099
|
+
name: "ErrGraylistFull",
|
|
1100
|
+
message: "Graylist bound exceeded (max 10 entries). Wait for an existing entry to unlock or promote.",
|
|
797
1101
|
category: "INPUT_VALIDATION",
|
|
798
1102
|
retryable: false,
|
|
799
1103
|
recovery_actions: [
|
|
800
1104
|
{
|
|
801
|
-
action: "
|
|
802
|
-
description: "
|
|
1105
|
+
action: "promote_or_wait",
|
|
1106
|
+
description: "Promote at least one graylist entry to active or wait for unlock. Then re-issue the destination-allowlist add.",
|
|
803
1107
|
},
|
|
804
1108
|
],
|
|
805
1109
|
},
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
category: "RESOURCE_NOT_FOUND",
|
|
1110
|
+
6079: {
|
|
1111
|
+
name: "ErrToken2022ExtensionForbidden",
|
|
1112
|
+
message: "Token-2022 mint has a forbidden extension. Only MemoTransfer and MetadataPointer extensions are permitted at deposit.",
|
|
1113
|
+
category: "INPUT_VALIDATION",
|
|
811
1114
|
retryable: false,
|
|
812
1115
|
recovery_actions: [
|
|
813
1116
|
{
|
|
814
|
-
action: "
|
|
815
|
-
description: "
|
|
1117
|
+
action: "use_supported_mint",
|
|
1118
|
+
description: "Use a Token-2022 mint with no extensions, or one limited to MemoTransfer/MetadataPointer.",
|
|
816
1119
|
},
|
|
817
1120
|
],
|
|
818
1121
|
},
|
|
819
|
-
|
|
820
|
-
name: "
|
|
821
|
-
|
|
822
|
-
|
|
1122
|
+
6080: {
|
|
1123
|
+
name: "ErrCosignRequired",
|
|
1124
|
+
// §RP-2 M-NEW-3 (audit 2026-05-19): after P0.1 + H-NEW-1, 6089
|
|
1125
|
+
// fires from four sites — queue_policy_update (original elevated
|
|
1126
|
+
// mutation path), register_agent, set_observe_only(false→true),
|
|
1127
|
+
// and unpause_agent. The message + recovery now reflect that the
|
|
1128
|
+
// common axis is "cosign-opted-in vault + owner action lacking a
|
|
1129
|
+
// non-owner co-signer", not just queue_policy_update specifically.
|
|
1130
|
+
message: "Cosign-opted-in vault requires a non-owner signer for this owner-action. Original sites: queue_policy_update (elevated), register_agent, set_observe_only(false→true), unpause_agent.",
|
|
1131
|
+
category: "PERMISSION",
|
|
823
1132
|
retryable: false,
|
|
824
1133
|
recovery_actions: [
|
|
825
1134
|
{
|
|
826
|
-
action: "
|
|
827
|
-
description: "
|
|
1135
|
+
action: "supply_cosigner",
|
|
1136
|
+
description: "Supply the cosign session pubkey as a signer in remaining_accounts. For queue_policy_update, also pass cosign_session as an arg. The cosign session must not be the owner's own key.",
|
|
828
1137
|
},
|
|
829
1138
|
],
|
|
830
1139
|
},
|
|
831
|
-
|
|
832
|
-
name: "
|
|
833
|
-
message: "
|
|
834
|
-
category: "
|
|
1140
|
+
6081: {
|
|
1141
|
+
name: "ErrAutoRevoked",
|
|
1142
|
+
message: "Agent capability was auto-revoked after consecutive policy-violation failures. Owner must re-enable via queue_agent_permissions_update.",
|
|
1143
|
+
category: "PERMISSION",
|
|
835
1144
|
retryable: false,
|
|
836
1145
|
recovery_actions: [
|
|
837
1146
|
{
|
|
838
|
-
action: "
|
|
839
|
-
description: "
|
|
1147
|
+
action: "owner_reenable",
|
|
1148
|
+
description: "Owner queues a fresh queue_agent_permissions_update setting the agent's capability back to Observer or Operator.",
|
|
840
1149
|
},
|
|
841
1150
|
],
|
|
842
1151
|
},
|
|
843
|
-
//
|
|
844
|
-
|
|
845
|
-
name: "
|
|
846
|
-
message: "
|
|
847
|
-
category: "
|
|
1152
|
+
// Phase 4 — Bundle integrity (TA-10 + TA-11 + AC-10)
|
|
1153
|
+
6082: {
|
|
1154
|
+
name: "ErrSandwichIntegrity",
|
|
1155
|
+
message: "Bundle integrity violation: multiple validate_and_authorize instructions for the same (vault, agent, mint) tuple in one transaction. At most one is permitted (TA-10 hardening).",
|
|
1156
|
+
category: "POLICY_VIOLATION",
|
|
848
1157
|
retryable: false,
|
|
849
1158
|
recovery_actions: [
|
|
850
1159
|
{
|
|
851
|
-
action: "
|
|
852
|
-
description: "
|
|
1160
|
+
action: "rebuild_bundle",
|
|
1161
|
+
description: "Rebuild the transaction with exactly one validate_and_authorize per (vault, agent, mint) tuple. ComputeBudget and SystemProgram instructions may be interleaved.",
|
|
853
1162
|
},
|
|
854
1163
|
],
|
|
855
1164
|
},
|
|
856
|
-
|
|
857
|
-
name: "
|
|
858
|
-
message: "
|
|
859
|
-
category: "
|
|
1165
|
+
6083: {
|
|
1166
|
+
name: "ErrProtectedWritable",
|
|
1167
|
+
message: "A Sigil-owned PDA was passed as writable to a foreign instruction between validate and finalize (TA-11). Protected PDAs include vault, policy, tracker, session, post_assertions, audit, constraints, and overlay accounts.",
|
|
1168
|
+
category: "POLICY_VIOLATION",
|
|
860
1169
|
retryable: false,
|
|
861
1170
|
recovery_actions: [
|
|
862
1171
|
{
|
|
863
|
-
action: "
|
|
864
|
-
description: "
|
|
1172
|
+
action: "remove_protected_pda_writable",
|
|
1173
|
+
description: "Remove the writable flag on any Sigil PDA passed to the DeFi instruction, or remove the PDA from that instruction's account metas entirely. Sigil PDAs may still be read by foreign instructions (writable=false is allowed).",
|
|
865
1174
|
},
|
|
866
1175
|
],
|
|
867
1176
|
},
|
|
868
|
-
|
|
869
|
-
name: "
|
|
870
|
-
message: "
|
|
1177
|
+
6084: {
|
|
1178
|
+
name: "ErrSessionNonceMismatch",
|
|
1179
|
+
message: "Session nonce mismatch (AC-10 durable-nonce replay defense). The caller's expected_nonce does not match the session's stored nonce. For a fresh session, pass expected_nonce = 0.",
|
|
871
1180
|
category: "INPUT_VALIDATION",
|
|
872
1181
|
retryable: false,
|
|
873
1182
|
recovery_actions: [
|
|
874
1183
|
{
|
|
875
|
-
action: "
|
|
876
|
-
description: "
|
|
1184
|
+
action: "fresh_session_nonce",
|
|
1185
|
+
description: "Pass expected_nonce = 0 for a fresh validate_and_authorize. A non-zero value is only valid in Phase 8 ownership-transfer flow (M-5).",
|
|
877
1186
|
},
|
|
878
1187
|
],
|
|
879
1188
|
},
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
1189
|
+
// ─── Phase 5: post-execution invariants (TA-12 + TA-13 + TA-14) ───
|
|
1190
|
+
// §RP-1 V5: added Phase 5 mappings missing from the SDK error table.
|
|
1191
|
+
// Source of truth: programs/sigil/src/errors.rs:407-451 + IDL.
|
|
1192
|
+
/** 6085 — TA-12: combined USDC+USDT vault balance dropped below the
|
|
1193
|
+
* owner-configured `policy.stable_balance_floor`. The HARD reserve —
|
|
1194
|
+
* no combination of attacks (CPI drain, per-protocol cap bypass, fee
|
|
1195
|
+
* inflation) may drain the vault below this line. Asserted in both
|
|
1196
|
+
* `finalize_session` and `agent_transfer` after the CPI completes.
|
|
1197
|
+
*/
|
|
1198
|
+
6085: {
|
|
1199
|
+
name: "ErrStableFloorViolation",
|
|
1200
|
+
message: "Stable balance floor violated — combined USDC+USDT balance dropped below policy.stable_balance_floor",
|
|
883
1201
|
category: "POLICY_VIOLATION",
|
|
884
1202
|
retryable: false,
|
|
885
1203
|
recovery_actions: [
|
|
886
1204
|
{
|
|
887
|
-
action: "
|
|
888
|
-
description: "
|
|
1205
|
+
action: "reduce_amount",
|
|
1206
|
+
description: "Reduce the transfer amount so the post-execution combined USDC+USDT vault balance stays at or above policy.stable_balance_floor",
|
|
1207
|
+
},
|
|
1208
|
+
{
|
|
1209
|
+
action: "deposit_more",
|
|
1210
|
+
description: "Owner can deposit additional USDC or USDT to raise the combined balance above the floor before the agent retries",
|
|
1211
|
+
},
|
|
1212
|
+
{
|
|
1213
|
+
action: "lower_floor",
|
|
1214
|
+
description: "Owner can queue a policy update to lower stable_balance_floor (timelock-gated, owner-only)",
|
|
889
1215
|
},
|
|
890
1216
|
],
|
|
891
1217
|
},
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
1218
|
+
/** 6095 — TA-13: per-protocol daily cap exceeded. The owner-configured
|
|
1219
|
+
* `policy.protocol_caps[i]` rolling-24h cap for the protocol the agent
|
|
1220
|
+
* is invoking would be exceeded by this transaction. Distinct from
|
|
1221
|
+
* 6047 (ProtocolCapExceeded), which now signals slot-allocation
|
|
1222
|
+
* exhaustion only — see §RP-1 V5 disposition.
|
|
1223
|
+
*/
|
|
1224
|
+
6086: {
|
|
1225
|
+
name: "ErrDailyCapExceeded",
|
|
1226
|
+
message: "Per-protocol daily spending cap would be exceeded (rolling 24h)",
|
|
1227
|
+
category: "SPENDING_CAP",
|
|
1228
|
+
retryable: true,
|
|
1229
|
+
retry_after_ms: 3_600_000,
|
|
898
1230
|
recovery_actions: [
|
|
899
1231
|
{
|
|
900
|
-
action: "
|
|
901
|
-
description: "
|
|
902
|
-
"exceeded the authorized delegation amount (fees + DeFi spend). Freeze the vault, " +
|
|
903
|
-
"investigate the DeFi program, and consider removing it from the protocol allowlist.",
|
|
1232
|
+
action: "reduce_amount",
|
|
1233
|
+
description: "Reduce the amount to fit within this protocol's remaining 24h rolling-window cap",
|
|
904
1234
|
},
|
|
905
1235
|
{
|
|
906
|
-
action: "
|
|
907
|
-
description: "
|
|
1236
|
+
action: "use_different_protocol",
|
|
1237
|
+
description: "Route through a different allowlisted protocol that has remaining 24h capacity",
|
|
1238
|
+
},
|
|
1239
|
+
{
|
|
1240
|
+
action: "wait",
|
|
1241
|
+
description: "Wait for the 24h rolling window to release spent capacity for this protocol",
|
|
1242
|
+
},
|
|
1243
|
+
],
|
|
1244
|
+
},
|
|
1245
|
+
/** 6096 — TA-14: per-recipient daily cap exceeded. The recipient's
|
|
1246
|
+
* rolling-24h outflow would breach `policy.per_recipient_daily_cap_usd`.
|
|
1247
|
+
* Resolved via SPL TokenAccount.owner (the WALLET that holds the
|
|
1248
|
+
* destination ATA), NOT the meta pubkey. Eviction is age-based, never
|
|
1249
|
+
* LRU — array-full with no expired slot returns this code too,
|
|
1250
|
+
* preventing churn-eviction bypass.
|
|
1251
|
+
*
|
|
1252
|
+
* **H-10 (pre-redeploy audit 2026-05-21) — TRIPLE-CAUSE DISAMBIGUATION:**
|
|
1253
|
+
* The same code (6096) fires from THREE distinct branches inside
|
|
1254
|
+
* `programs/sigil/src/instructions/finalize_session.rs`:
|
|
1255
|
+
*
|
|
1256
|
+
* 1. **Cap exceeded** (`finalize_session.rs:654`): cumulative 24h
|
|
1257
|
+
* recipient outflow + this transfer > policy cap. Recovery: shrink
|
|
1258
|
+
* the amount, route via a different allowed recipient with cap
|
|
1259
|
+
* headroom, or wait for the rolling window to release capacity.
|
|
1260
|
+
* 2. **Multiple distinct recipients in one tx** (`finalize_session.rs:638`):
|
|
1261
|
+
* V1 enforces single-recipient-per-tx for per-recipient cap
|
|
1262
|
+
* attribution sanity. Recovery: SPLIT the bundle so each finalize
|
|
1263
|
+
* touches at most one allowlisted recipient
|
|
1264
|
+
* (`split_into_separate_transactions`).
|
|
1265
|
+
* 3. **`per_recipient` array full with no expired slot**
|
|
1266
|
+
* (`finalize_session.rs:658` via `tracker.record_recipient_spend`):
|
|
1267
|
+
* the fixed-size 10-slot tracker has no entry eligible for
|
|
1268
|
+
* age-based eviction. Recovery: wait for an entry to age out
|
|
1269
|
+
* (same `wait` action as cause 1).
|
|
1270
|
+
*
|
|
1271
|
+
* UX-side: callers cannot distinguish the three branches from the
|
|
1272
|
+
* error code alone — the recovery list below covers all three.
|
|
1273
|
+
*/
|
|
1274
|
+
6087: {
|
|
1275
|
+
name: "ErrRecipientCapExceeded",
|
|
1276
|
+
message: "Per-recipient cap blocked — three possible causes: (a) recipient outflow would breach policy.per_recipient_daily_cap_usd within rolling 24h window; (b) bundle touches multiple distinct allowlisted recipients in one finalize (V1 single-recipient-per-tx rule); (c) per_recipient tracker array full with no expired slot to evict",
|
|
1277
|
+
category: "SPENDING_CAP",
|
|
1278
|
+
retryable: true,
|
|
1279
|
+
retry_after_ms: 3_600_000,
|
|
1280
|
+
recovery_actions: [
|
|
1281
|
+
{
|
|
1282
|
+
action: "reduce_amount",
|
|
1283
|
+
description: "Reduce the transfer amount so the recipient's 24h rolling outflow stays under policy.per_recipient_daily_cap_usd",
|
|
1284
|
+
},
|
|
1285
|
+
{
|
|
1286
|
+
action: "split_into_separate_transactions",
|
|
1287
|
+
description: "If the bundle touches multiple distinct allowlisted recipients in one finalize, split it so each transaction touches at most one recipient. V1 enforces single-recipient-per-tx for per-recipient cap attribution.",
|
|
1288
|
+
},
|
|
1289
|
+
{
|
|
1290
|
+
action: "use_different_recipient",
|
|
1291
|
+
description: "Route the transfer to a different allowed destination that has remaining 24h cap headroom",
|
|
1292
|
+
},
|
|
1293
|
+
{
|
|
1294
|
+
action: "wait",
|
|
1295
|
+
description: "Wait for the recipient's rolling 24h window to release spent capacity (also remediates the array-full / no-evictable-slot case)",
|
|
1296
|
+
},
|
|
1297
|
+
],
|
|
1298
|
+
},
|
|
1299
|
+
// ─── Phase 6: Maestro borrows R-1/R-2/R-3/R-4 (TA-13 absorption) ───
|
|
1300
|
+
// §RP-2 H-NEW-2: added Phase 6 mappings (R-1..R-4) — the predicate already
|
|
1301
|
+
// routes them as "Sigil error" via the >= 6000 && <= SIGIL_ON_CHAIN_ERROR_MAX
|
|
1302
|
+
// bound, but ON_CHAIN_ERROR_MAP had no entries, so users got "Unknown
|
|
1303
|
+
// on-chain error code N" with category FATAL + empty recovery.
|
|
1304
|
+
// Source of truth: programs/sigil/src/errors.rs + IDL.
|
|
1305
|
+
/** 6097 — R-1 MintDeltaCap (attack signal): combined balance of
|
|
1306
|
+
* vault-owned ATAs for the configured mint dropped by more than
|
|
1307
|
+
* `max_net_decrease` between `validate_and_authorize` (pre-snap sum)
|
|
1308
|
+
* and `finalize_session` (post sum). Two enforcement shapes:
|
|
1309
|
+
* scope=0 (vault-wide multi-ATA sum) and scope=1 (single target_account).
|
|
1310
|
+
* Pairs with R-2 (6099) per F-18 to close close-and-recreate evasion.
|
|
1311
|
+
*/
|
|
1312
|
+
6088: {
|
|
1313
|
+
name: "ErrMintDeltaCapExceeded",
|
|
1314
|
+
message: "Mint delta cap exceeded — net outflow of [mint] from vault exceeded policy.mint_delta_cap[mint] within the post-execution check window.",
|
|
1315
|
+
category: "POLICY_VIOLATION",
|
|
1316
|
+
retryable: false,
|
|
1317
|
+
recovery_actions: [
|
|
1318
|
+
{
|
|
1319
|
+
action: "verify_post_assertions",
|
|
1320
|
+
description: "Verify the policy.post_assertions configuration for the affected mint. Reduce transaction outflow or raise the per-mint cap via queue_policy_update (timelock-gated).",
|
|
908
1321
|
},
|
|
909
1322
|
],
|
|
910
1323
|
},
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
1324
|
+
/** 6098 — R-1 MintDeltaCap (caller-bug signal): entry's accounts
|
|
1325
|
+
* couldn't be resolved at validate time. Common shapes:
|
|
1326
|
+
* - scope=1 and target_account not present in remaining_accounts
|
|
1327
|
+
* - target_account's mint field doesn't match the configured mint
|
|
1328
|
+
* - target_account isn't owned by the vault
|
|
1329
|
+
* - scope=0 with no derived ATAs supplied in remaining_accounts
|
|
1330
|
+
* Distinct from ErrMintDeltaCapExceeded because this is a
|
|
1331
|
+
* configuration or caller-side bug (recoverable by fixing the caller),
|
|
1332
|
+
* not an attack signal (which fires 6097 at finalize).
|
|
1333
|
+
*/
|
|
1334
|
+
6089: {
|
|
1335
|
+
name: "MintDeltaCapMisconfigured",
|
|
1336
|
+
message: "Mint delta cap entry misconfigured — invalid scope value, zero max_net_decrease, or required derived ATA missing from remaining_accounts.",
|
|
1337
|
+
category: "FATAL",
|
|
916
1338
|
retryable: false,
|
|
917
1339
|
recovery_actions: [
|
|
918
1340
|
{
|
|
919
|
-
action: "
|
|
920
|
-
description: "
|
|
1341
|
+
action: "inspect_entry_config",
|
|
1342
|
+
description: "Inspect the failed entry's scope value (0 or 1 only), max_net_decrease (must be non-zero for scope=0), and remaining_accounts (must include every derived ATA for scope=0).",
|
|
921
1343
|
},
|
|
922
1344
|
],
|
|
923
1345
|
},
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
1346
|
+
/** 6099 — R-2 AtaAuthorityPin (attack signal): a vault-owned token
|
|
1347
|
+
* account had its authority changed during the sandwich, or was
|
|
1348
|
+
* closed and not reinstated as a vault-owned account before finalize.
|
|
1349
|
+
* Detected by reading bytes 32..64 of the post-CPI token account data
|
|
1350
|
+
* and comparing to `vault.key().to_bytes()`. Also fires when the
|
|
1351
|
+
* account is closed (data length < 64) or its owner program is no
|
|
1352
|
+
* longer SPL Token or Token-2022. Pairs with 6097 to close F-18
|
|
1353
|
+
* close+drain+recreate.
|
|
1354
|
+
*/
|
|
1355
|
+
6090: {
|
|
1356
|
+
name: "ErrAtaAuthorityChanged",
|
|
1357
|
+
message: "Vault ATA authority changed mid-transaction — a CPI altered the SPL TokenAccount owner field, defeating the vault's custody.",
|
|
1358
|
+
category: "POLICY_VIOLATION",
|
|
1359
|
+
retryable: false,
|
|
930
1360
|
recovery_actions: [
|
|
931
1361
|
{
|
|
932
|
-
action: "
|
|
933
|
-
description: "
|
|
1362
|
+
action: "audit_ix_for_set_authority",
|
|
1363
|
+
description: "Verify the DeFi instruction in the bundle does not call setAuthority on any vault-owned ATA. Refuse the bundle and audit the agent's request.",
|
|
934
1364
|
},
|
|
935
1365
|
],
|
|
936
1366
|
},
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
1367
|
+
/** 6100 — R-3 OutputBalanceFloor (attack signal): a token account
|
|
1368
|
+
* that was supposed to receive at least `min_increase` units of its
|
|
1369
|
+
* mint during the sandwich did not. Snapshot at
|
|
1370
|
+
* `validate_and_authorize` against `target_account.amount` (u64 LE at
|
|
1371
|
+
* bytes 64..72), finalize requires (post - pre) >= aux_value.
|
|
1372
|
+
* Counter to "dust-fill" attacks where the agent obtains delegation
|
|
1373
|
+
* authority then runs a swap that returns 1 lamport.
|
|
1374
|
+
*/
|
|
1375
|
+
6091: {
|
|
1376
|
+
name: "ErrOutputBelowFloor",
|
|
1377
|
+
message: "Output balance floor violated — the vault's target ATA gained less than policy.min_increase_usd after the post-execution check.",
|
|
940
1378
|
category: "POLICY_VIOLATION",
|
|
941
|
-
retryable:
|
|
942
|
-
retry_after_ms: 10000,
|
|
1379
|
+
retryable: false,
|
|
943
1380
|
recovery_actions: [
|
|
944
1381
|
{
|
|
945
|
-
action: "
|
|
946
|
-
description: "
|
|
1382
|
+
action: "audit_output_value",
|
|
1383
|
+
description: "Verify the DeFi instruction's output. Common causes: dust-fill swap, partial fill, wrong destination meta. Audit the agent's slippage settings.",
|
|
947
1384
|
},
|
|
948
1385
|
],
|
|
949
1386
|
},
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
1387
|
+
/** 6101 — R-4 DeclarationConsistency (attack signal): the
|
|
1388
|
+
* (recipient, mint) pair declared on a post-assertion entry doesn't
|
|
1389
|
+
* match the SPL token account at the configured CPI account-meta
|
|
1390
|
+
* index. Closes the "declaration dishonesty" attack: agent declares
|
|
1391
|
+
* "recipient: alice" to satisfy a destination-allowlist check, then
|
|
1392
|
+
* inserts attacker_ata into the CPI metas. The recipient who would
|
|
1393
|
+
* receive funds (attacker_ata.owner) ≠ alice, so R-4 rejects.
|
|
1394
|
+
*/
|
|
1395
|
+
6092: {
|
|
1396
|
+
name: "ErrDeclarationInconsistent",
|
|
1397
|
+
message: "Declaration consistency check failed — the CPI account meta at the declared index is not a token account matching the agent's declared recipient + mint.",
|
|
954
1398
|
category: "POLICY_VIOLATION",
|
|
955
1399
|
retryable: false,
|
|
956
1400
|
recovery_actions: [
|
|
957
1401
|
{
|
|
958
|
-
action: "
|
|
959
|
-
description: "
|
|
1402
|
+
action: "verify_declaration_matches_ix",
|
|
1403
|
+
description: "Verify the agent's authorized_token + output_mint declaration matches the actual SPL TokenAccount at the declared meta index in the DeFi instruction. Reject the bundle if the agent supplied inconsistent declaration.",
|
|
960
1404
|
},
|
|
961
1405
|
],
|
|
962
1406
|
},
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
1407
|
+
// ─── Audit 2026-05-19 (P1 HIGH fixes) ───
|
|
1408
|
+
// §RP-2 H-NEW-2: H-1 hard-reject mapping for the destination-check
|
|
1409
|
+
// meta budget. Previously the helper silently take()-truncated at 16;
|
|
1410
|
+
// 1f569eb made it a hard-reject (POLICY_VIOLATION).
|
|
1411
|
+
/** 6102 — H-1 hard-reject (audit 2026-05-19): the foreign DeFi
|
|
1412
|
+
* instruction passed more account metas than
|
|
1413
|
+
* `MAX_DESTINATION_CHECK_METAS_PER_IX` (16). Previously the helper
|
|
1414
|
+
* silently `take()`-truncated at the bound, leaving slots 17+
|
|
1415
|
+
* uninspected; an attacker hiding a hostile destination at slot 17+
|
|
1416
|
+
* would bypass the allowlist check. Hard-reject closes the
|
|
1417
|
+
* silent-drop. Expansion to 32 metas is v1.1 backlog (~+4K CU).
|
|
1418
|
+
*/
|
|
1419
|
+
6093: {
|
|
1420
|
+
name: "IxMetaCountExceeded",
|
|
1421
|
+
message: "Foreign instruction exceeded the account-meta processing budget (destination check: max 24 writable metas / 64 total; agent_transfer floor-walk: 16). The bundle is rejected rather than partially inspected.",
|
|
1422
|
+
category: "POLICY_VIOLATION",
|
|
967
1423
|
retryable: false,
|
|
968
1424
|
recovery_actions: [
|
|
969
1425
|
{
|
|
970
|
-
action: "
|
|
971
|
-
description: "
|
|
1426
|
+
action: "use_a_shorter_route",
|
|
1427
|
+
description: "The route references more writable accounts than the guard can inspect in one pass. Use a shorter Jupiter route; Sigil never reshapes the route itself — an unguardable route atomically reverts.",
|
|
972
1428
|
},
|
|
973
1429
|
],
|
|
974
1430
|
},
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
1431
|
+
// --- Phase 8 (ownership transfer + freeze hardening) ---
|
|
1432
|
+
// Phase 8 ownership-transfer + freeze-hardening codes (now 6094-6099 post M1-04).
|
|
1433
|
+
6094: {
|
|
1434
|
+
name: "ErrPendingOwnershipExists",
|
|
1435
|
+
message: "An ownership transfer is already pending for this vault. Cancel the existing transfer before queueing a new target.",
|
|
1436
|
+
category: "POLICY_VIOLATION",
|
|
979
1437
|
retryable: false,
|
|
980
1438
|
recovery_actions: [
|
|
981
1439
|
{
|
|
982
|
-
action: "
|
|
983
|
-
description: "
|
|
1440
|
+
action: "cancel_ownership_transfer",
|
|
1441
|
+
description: "Call cancel_ownership_transfer to release the pending PDA before queueing a new transfer.",
|
|
984
1442
|
},
|
|
985
1443
|
],
|
|
986
1444
|
},
|
|
987
|
-
|
|
988
|
-
name: "
|
|
989
|
-
message: "
|
|
990
|
-
category: "
|
|
991
|
-
retryable:
|
|
1445
|
+
6095: {
|
|
1446
|
+
name: "ErrPendingOwnershipNotReady",
|
|
1447
|
+
message: "Ownership transfer timelock has not elapsed yet (default 48h). The new owner cannot accept until the window passes.",
|
|
1448
|
+
category: "TRANSIENT",
|
|
1449
|
+
retryable: true,
|
|
992
1450
|
recovery_actions: [
|
|
993
1451
|
{
|
|
994
|
-
action: "
|
|
995
|
-
description: "
|
|
1452
|
+
action: "wait_timelock",
|
|
1453
|
+
description: "Wait for the timelock window to elapse. The owner can cancel during this window to abort the transfer.",
|
|
996
1454
|
},
|
|
997
1455
|
],
|
|
998
1456
|
},
|
|
999
|
-
|
|
1000
|
-
name: "
|
|
1001
|
-
message: "
|
|
1457
|
+
6096: {
|
|
1458
|
+
name: "ErrInvalidFreezeReason",
|
|
1459
|
+
message: "Invalid freeze_reason byte (must be 0=Manual, 1=AutoRevoke, or 2=EmergencyBoard).",
|
|
1002
1460
|
category: "INPUT_VALIDATION",
|
|
1003
1461
|
retryable: false,
|
|
1004
1462
|
recovery_actions: [
|
|
1005
1463
|
{
|
|
1006
|
-
action: "
|
|
1007
|
-
description: "
|
|
1464
|
+
action: "fix_freeze_reason",
|
|
1465
|
+
description: "Re-call freeze_vault with a valid FreezeReason discriminant.",
|
|
1008
1466
|
},
|
|
1009
1467
|
],
|
|
1010
1468
|
},
|
|
1011
|
-
|
|
1012
|
-
name: "
|
|
1013
|
-
message: "
|
|
1014
|
-
category: "
|
|
1015
|
-
retryable:
|
|
1469
|
+
6097: {
|
|
1470
|
+
name: "ErrReactivateCooldownActive",
|
|
1471
|
+
message: "Reactivate requires a 5-minute observation cooldown after the vault was frozen. Try again after the cooldown elapses.",
|
|
1472
|
+
category: "TRANSIENT",
|
|
1473
|
+
retryable: true,
|
|
1474
|
+
retry_after_ms: 300_000,
|
|
1016
1475
|
recovery_actions: [
|
|
1017
1476
|
{
|
|
1018
|
-
action: "
|
|
1019
|
-
description: "
|
|
1477
|
+
action: "wait_cooldown",
|
|
1478
|
+
description: "Wait for the 5-minute observation window to elapse before reactivating.",
|
|
1020
1479
|
},
|
|
1021
1480
|
],
|
|
1022
1481
|
},
|
|
1023
|
-
|
|
1024
|
-
name: "
|
|
1025
|
-
message: "
|
|
1482
|
+
6098: {
|
|
1483
|
+
name: "ErrInvalidOwnershipTarget",
|
|
1484
|
+
message: "new_owner cannot be a system/program/sysvar address (would permanently brick the vault).",
|
|
1026
1485
|
category: "INPUT_VALIDATION",
|
|
1027
1486
|
retryable: false,
|
|
1028
1487
|
recovery_actions: [
|
|
1029
1488
|
{
|
|
1030
|
-
action: "
|
|
1031
|
-
description: "
|
|
1489
|
+
action: "use_signer_pubkey",
|
|
1490
|
+
description: "Pass an EOA pubkey or Squads V4 vault PDA as new_owner — not SystemProgram, the program ID, or a sysvar.",
|
|
1032
1491
|
},
|
|
1033
1492
|
],
|
|
1034
1493
|
},
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
category: "POLICY_VIOLATION",
|
|
1494
|
+
6099: {
|
|
1495
|
+
name: "ErrTooManyRevokePairs",
|
|
1496
|
+
message: "freeze_internal received more than MAX_REVOKE_PAIRS (10) session/token pairs in remaining_accounts.",
|
|
1497
|
+
category: "INPUT_VALIDATION",
|
|
1040
1498
|
retryable: false,
|
|
1041
1499
|
recovery_actions: [
|
|
1042
1500
|
{
|
|
1043
|
-
action: "
|
|
1044
|
-
description: "
|
|
1501
|
+
action: "split_revoke_batch",
|
|
1502
|
+
description: "Split the (session_pda, token_account) pairs across multiple freeze_internal calls.",
|
|
1045
1503
|
},
|
|
1046
1504
|
],
|
|
1047
1505
|
},
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1506
|
+
// H-3 close (pre-redeploy audit 2026-05-21): close_vault rejects if
|
|
1507
|
+
// policy.has_post_assertions != 0 because the 672-byte PostExecutionAssertions
|
|
1508
|
+
// zero-copy PDA must be drained via close_post_assertions first; otherwise it
|
|
1509
|
+
// would be orphaned on close.
|
|
1510
|
+
6100: {
|
|
1511
|
+
name: "ErrPostAssertionsNotClosed",
|
|
1512
|
+
message: "PostExecutionAssertions PDA still active — call close_post_assertions before close_vault.",
|
|
1513
|
+
category: "RESOURCE_NOT_FOUND",
|
|
1052
1514
|
retryable: false,
|
|
1053
1515
|
recovery_actions: [
|
|
1054
1516
|
{
|
|
1055
|
-
action: "
|
|
1056
|
-
description: "
|
|
1517
|
+
action: "close_post_assertions",
|
|
1518
|
+
description: "Invoke the close_post_assertions instruction to drain the 672-byte PostExecutionAssertions PDA, then retry close_vault.",
|
|
1057
1519
|
},
|
|
1058
1520
|
],
|
|
1059
1521
|
},
|
|
1060
|
-
//
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1522
|
+
// H-4 close (pre-redeploy audit 2026-05-21, Bucket 1): queue_policy_update
|
|
1523
|
+
// rejects if any allowed_destinations entry is the address of a Sigil-owned
|
|
1524
|
+
// protected PDA for this vault. Closes the owner-self-foot-gun where a
|
|
1525
|
+
// phished owner allowlists a Sigil PDA, enabling an agent to lock funds
|
|
1526
|
+
// at the PDA via a token transfer.
|
|
1527
|
+
6101: {
|
|
1528
|
+
name: "ErrDestinationIsProtectedPda",
|
|
1529
|
+
message: "allowed_destinations entry is a Sigil-protected PDA — owner attempted to allowlist a vault/policy/pending_* PDA.",
|
|
1064
1530
|
category: "INPUT_VALIDATION",
|
|
1065
1531
|
retryable: false,
|
|
1066
1532
|
recovery_actions: [
|
|
1067
1533
|
{
|
|
1068
|
-
action: "
|
|
1069
|
-
description: "
|
|
1534
|
+
action: "remove_protected_pda_from_destinations",
|
|
1535
|
+
description: "Remove any pubkey from allowed_destinations that matches a Sigil-protected PDA for this vault. Use a plain EOA or external program owner instead.",
|
|
1070
1536
|
},
|
|
1071
1537
|
],
|
|
1072
1538
|
},
|
|
1073
|
-
//
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1539
|
+
// D-1 + D-6 close (Bucket 2 audit 2026-05-21): AL3 on-chain scalar intent-
|
|
1540
|
+
// digest mismatch. The wallet's preview-time digest doesn't match the
|
|
1541
|
+
// digest the on-chain verifier recomputed from validate_and_authorize's
|
|
1542
|
+
// args. Most likely: man-in-the-middle (compromised agent / browser ext)
|
|
1543
|
+
// swapped one of the scalar fields (mint, amount, target_protocol)
|
|
1544
|
+
// between preview and submit. Less likely: cross-network replay
|
|
1545
|
+
// (mainnet digest sent through a devnet program).
|
|
1546
|
+
6102: {
|
|
1547
|
+
name: "ErrIntentDigestMismatch",
|
|
1548
|
+
message: "AL3 intent-digest mismatch — wallet preview digest does not match the executed bundle's scalars.",
|
|
1077
1549
|
category: "POLICY_VIOLATION",
|
|
1078
1550
|
retryable: false,
|
|
1079
1551
|
recovery_actions: [
|
|
1080
1552
|
{
|
|
1081
|
-
action: "
|
|
1082
|
-
description: "
|
|
1553
|
+
action: "rebuild_seal_from_fresh_preview",
|
|
1554
|
+
description: "Re-run the wallet preview to refresh the intent digest, then resubmit. If the mismatch persists after a fresh preview, suspect a compromised middleware/agent — pause the agent and investigate.",
|
|
1083
1555
|
},
|
|
1084
1556
|
],
|
|
1085
1557
|
},
|
|
1086
|
-
//
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1558
|
+
// M-5 close (Bucket 2 audit 2026-05-21, PEN-CROSS-3): apply_agent_grant
|
|
1559
|
+
// rejected because the recomputed digest of PendingAgentGrant content
|
|
1560
|
+
// doesn't match the queue-time digest. Same digest-binding defense class
|
|
1561
|
+
// as the policy/ownership pending-update digest checks.
|
|
1562
|
+
6103: {
|
|
1563
|
+
name: "ErrPendingAgentGrantDigestMismatch",
|
|
1564
|
+
message: "PendingAgentGrant content tampered between queue and apply — digest mismatch.",
|
|
1565
|
+
category: "POLICY_VIOLATION",
|
|
1091
1566
|
retryable: false,
|
|
1092
1567
|
recovery_actions: [
|
|
1093
1568
|
{
|
|
1094
|
-
action: "
|
|
1095
|
-
description: "
|
|
1569
|
+
action: "cancel_and_requeue_agent_grant",
|
|
1570
|
+
description: "Cancel the pending grant via cancel_agent_grant, then queue a fresh grant with the intended agent + capability.",
|
|
1096
1571
|
},
|
|
1097
1572
|
],
|
|
1098
1573
|
},
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1574
|
+
// D-5 close (Bucket 2 audit 2026-05-21, F-RP3-1): reactivate_vault
|
|
1575
|
+
// rejected a FULL_CAPABILITY agent graft because no non-owner signer was
|
|
1576
|
+
// present. Defaults-on safety (NH-1): any FULL_CAPABILITY grant on
|
|
1577
|
+
// reactivate requires a second signer, regardless of whether
|
|
1578
|
+
// policy.cosign_session_pubkey was pre-configured. Closes the phished-
|
|
1579
|
+
// owner freeze→reactivate(attacker, FULL) single-signature foot-gun.
|
|
1580
|
+
6104: {
|
|
1581
|
+
name: "ErrReactivateCosignRequiredForFullCapability",
|
|
1582
|
+
message: "Reactivate with a FULL_CAPABILITY new agent requires a non-owner cosigner.",
|
|
1583
|
+
category: "ESCALATION_REQUIRED",
|
|
1103
1584
|
retryable: false,
|
|
1104
1585
|
recovery_actions: [
|
|
1105
1586
|
{
|
|
1106
|
-
action: "
|
|
1107
|
-
description: "
|
|
1587
|
+
action: "include_second_signer_in_remaining_accounts",
|
|
1588
|
+
description: "Re-sign the reactivate transaction with a second non-owner signer in remaining_accounts. If policy.cosign_session_pubkey is set, the signer must match it.",
|
|
1108
1589
|
},
|
|
1109
1590
|
],
|
|
1110
1591
|
},
|
|
1111
|
-
|
|
1112
|
-
name: "
|
|
1113
|
-
message: "
|
|
1114
|
-
category: "
|
|
1592
|
+
6105: {
|
|
1593
|
+
name: "DestinationAccountUnresolvable",
|
|
1594
|
+
message: "A writable account of the DeFi instruction could not be resolved in validate's remaining_accounts, so the guard cannot classify it (F-Q1a destination completeness — rejected fail-closed rather than silently skipped).",
|
|
1595
|
+
category: "POLICY_VIOLATION",
|
|
1115
1596
|
retryable: false,
|
|
1116
1597
|
recovery_actions: [
|
|
1117
1598
|
{
|
|
1118
|
-
action: "
|
|
1119
|
-
description: "
|
|
1599
|
+
action: "use_seal_to_populate_remaining_accounts",
|
|
1600
|
+
description: "Build the bundle with seal(), which auto-populates validate's (and finalize's) remaining_accounts with every writable account of the DeFi instruction (the fee-payer agent included). Hand-built bundles must mirror this.",
|
|
1120
1601
|
},
|
|
1121
1602
|
],
|
|
1122
1603
|
},
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
message: "Token-2022 ConfidentialTransfer is not permitted between validate_and_authorize and finalize_session.",
|
|
1604
|
+
6106: {
|
|
1605
|
+
name: "ErrToken2022OutputMintUnresolvable",
|
|
1606
|
+
message: "A vault-owned Token-2022 token account's mint could not be resolved in validate's remaining_accounts (or the supplied account is not Token-2022-owned), so the guard cannot vet its extensions (F-Q4 — rejected fail-closed). A PermanentDelegate / TransferHook / ConfidentialTransfer mint must be vetted before the vault may acquire the token.",
|
|
1127
1607
|
category: "POLICY_VIOLATION",
|
|
1128
1608
|
retryable: false,
|
|
1129
1609
|
recovery_actions: [
|
|
1130
1610
|
{
|
|
1131
|
-
action: "
|
|
1132
|
-
description: "Token-2022
|
|
1611
|
+
action: "use_seal_to_populate_remaining_accounts",
|
|
1612
|
+
description: "Build the bundle with seal(), which auto-resolves vault-owned Token-2022 output mints (reading each writable account's mint on-chain) and feeds them into validate's remaining_accounts. Hand-built bundles must include the mint account of every vault-owned Token-2022 token account the swap writes.",
|
|
1133
1613
|
},
|
|
1134
1614
|
],
|
|
1135
1615
|
},
|
|
1136
|
-
|
|
1137
|
-
name: "
|
|
1138
|
-
message: "
|
|
1616
|
+
6107: {
|
|
1617
|
+
name: "ErrOperatorGrantRequiresTimelock",
|
|
1618
|
+
message: "An OPERATOR-class agent grant cannot be seated instantly on this vault (single-key, cosign-required-but-unbound, or any vault with a configured operator_grant_delay_seconds > 0). It must route through the timelocked queue_agent_grant → apply_agent_grant path — the time-delay substitutes for the missing 2nd authorization factor (F-Q6).",
|
|
1139
1619
|
category: "POLICY_VIOLATION",
|
|
1140
1620
|
retryable: false,
|
|
1141
1621
|
recovery_actions: [
|
|
1142
1622
|
{
|
|
1143
|
-
action: "
|
|
1144
|
-
description: "
|
|
1623
|
+
action: "use_queue_agent_grant",
|
|
1624
|
+
description: "Seat the OPERATOR via queue_agent_grant, wait the effective delay (>=10 min for a single-key vault, else the configured operator_grant_delay_seconds), then apply_agent_grant. A cosign-bound vault at zero delay can seat instantly by including the bound cosigner's signature in register_agent.",
|
|
1145
1625
|
},
|
|
1146
1626
|
],
|
|
1147
1627
|
},
|
|
1148
|
-
|
|
1149
|
-
name: "
|
|
1150
|
-
message: "
|
|
1628
|
+
6108: {
|
|
1629
|
+
name: "ErrOperatorGrantDelayTooLong",
|
|
1630
|
+
message: "operator_grant_delay_seconds exceeds the maximum (48h / 172800s). A larger delay could exceed the apply-time freshness ceiling and leave a queued OPERATOR grant permanently unapplyable, so it is rejected at configuration time (F-Q6).",
|
|
1151
1631
|
category: "POLICY_VIOLATION",
|
|
1152
1632
|
retryable: false,
|
|
1153
1633
|
recovery_actions: [
|
|
1154
1634
|
{
|
|
1155
|
-
action: "
|
|
1156
|
-
description: "
|
|
1635
|
+
action: "lower_operator_grant_delay",
|
|
1636
|
+
description: "Set operator_grant_delay_seconds to at most 172800 (48h) in the queue_policy_update call.",
|
|
1157
1637
|
},
|
|
1158
1638
|
],
|
|
1159
1639
|
},
|
|
1160
|
-
|
|
1161
|
-
name: "
|
|
1162
|
-
message: "
|
|
1640
|
+
6109: {
|
|
1641
|
+
name: "InvalidOwnerType",
|
|
1642
|
+
message: "vault.owner_type held a value outside the recognized discriminants (0 = EOA, 1 = multisig) at an OPERATOR-grant read site. Only reachable via on-chain state corruption (the field is program-set to {0,1}); the operation is rejected rather than acting on corrupted authority state (F-Q6).",
|
|
1163
1643
|
category: "POLICY_VIOLATION",
|
|
1164
1644
|
retryable: false,
|
|
1165
1645
|
recovery_actions: [
|
|
1166
1646
|
{
|
|
1167
|
-
action: "
|
|
1168
|
-
description: "
|
|
1647
|
+
action: "report_state_corruption",
|
|
1648
|
+
description: "vault.owner_type is program-set to 0 (EOA) or 1 (multisig); an out-of-range value indicates on-chain state corruption and should be unreachable in normal operation. OPERATOR-grant paths are blocked until the vault state is valid — report this.",
|
|
1169
1649
|
},
|
|
1170
1650
|
],
|
|
1171
1651
|
},
|
|
1172
|
-
|
|
1173
|
-
name: "
|
|
1174
|
-
message: "
|
|
1652
|
+
6110: {
|
|
1653
|
+
name: "SpendAccountingUnderflow",
|
|
1654
|
+
message: "finalize_session detected collected fees exceeding the realized stablecoin outflow (fees_collected > total_decrease) — an accounting impossibility, since fees are CPI'd out before the DeFi leg. The transaction is rejected fail-closed rather than under-counting the spend against the caps (F-Q9).",
|
|
1175
1655
|
category: "POLICY_VIOLATION",
|
|
1176
1656
|
retryable: false,
|
|
1177
1657
|
recovery_actions: [
|
|
1178
1658
|
{
|
|
1179
|
-
action: "
|
|
1180
|
-
description: "
|
|
1659
|
+
action: "review_swap_construction",
|
|
1660
|
+
description: "This fires when a stablecoin-input action net-returned stablecoin so the measured outflow was smaller than the protocol+developer fees. Verify the DeFi instruction actually spends the declared stablecoin input; a net-return on the stablecoin-input path is anomalous and is rejected.",
|
|
1181
1661
|
},
|
|
1182
1662
|
],
|
|
1183
1663
|
},
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
category: "INPUT_VALIDATION",
|
|
1664
|
+
6111: {
|
|
1665
|
+
name: "ErrMultisigCustodyUnsupported",
|
|
1666
|
+
message: "Squads multisig ownership custody is disabled in V1. Sigil's top-level-only (reject_cpi!) model is architecturally incompatible with a Squads multisig owner — a multisig acts on external programs only by CPI from vault_transaction_execute, but every Sigil owner instruction rejects CPI, so a multisig owner could neither accept ownership nor operate the vault afterward (and the prior path could brick the vault by setting an unsignable owner). initiate_ownership_transfer rejects is_multisig_target = true; accept_ownership_transfer_multisig rejects unconditionally (H-1, audit 2026-06-11).",
|
|
1667
|
+
category: "POLICY_VIOLATION",
|
|
1189
1668
|
retryable: false,
|
|
1190
1669
|
recovery_actions: [
|
|
1191
1670
|
{
|
|
1192
|
-
action: "
|
|
1193
|
-
description: "
|
|
1671
|
+
action: "use_eoa_owner",
|
|
1672
|
+
description: "Use a standard EOA (single-key) owner for the vault. Multisig custody is deferred to a future release (CPI-aware or Sigil-native M-of-N) pending re-audit.",
|
|
1194
1673
|
},
|
|
1195
1674
|
],
|
|
1196
1675
|
},
|
|
@@ -1694,7 +2173,7 @@ const SDK_ERRORS = {
|
|
|
1694
2173
|
* Convert any error into a structured AgentError.
|
|
1695
2174
|
*
|
|
1696
2175
|
* Handles:
|
|
1697
|
-
* - On-chain Anchor errors (code 6000-
|
|
2176
|
+
* - On-chain Anchor errors (code 6000-6102)
|
|
1698
2177
|
* - SDK errors (code 7000-7033)
|
|
1699
2178
|
* - Network/RPC errors (from message patterns)
|
|
1700
2179
|
* - Unknown errors (wrapped as FATAL)
|
|
@@ -1995,8 +2474,11 @@ function extractErrorCode(error) {
|
|
|
1995
2474
|
if (!error || typeof error !== "object")
|
|
1996
2475
|
return null;
|
|
1997
2476
|
const e = error;
|
|
1998
|
-
// Direct code property
|
|
1999
|
-
|
|
2477
|
+
// Direct code property — uses SIGIL_ON_CHAIN_ERROR_{MIN,MAX} constants
|
|
2478
|
+
// defined at top of file as single source of truth.
|
|
2479
|
+
if (typeof e.code === "number" &&
|
|
2480
|
+
e.code >= SIGIL_ON_CHAIN_ERROR_MIN &&
|
|
2481
|
+
e.code <= SIGIL_ON_CHAIN_ERROR_MAX)
|
|
2000
2482
|
return e.code;
|
|
2001
2483
|
// Anchor error structure
|
|
2002
2484
|
if (e.error && typeof e.error === "object") {
|
|
@@ -2012,7 +2494,7 @@ function extractErrorCode(error) {
|
|
|
2012
2494
|
const match = e.message.match(/custom program error: 0x([0-9a-fA-F]+)/);
|
|
2013
2495
|
if (match) {
|
|
2014
2496
|
const code = parseInt(match[1], 16);
|
|
2015
|
-
if (code >=
|
|
2497
|
+
if (code >= SIGIL_ON_CHAIN_ERROR_MIN && code <= SIGIL_ON_CHAIN_ERROR_MAX)
|
|
2016
2498
|
return code;
|
|
2017
2499
|
}
|
|
2018
2500
|
}
|
|
@@ -2169,17 +2651,6 @@ const SDK_ERROR_PATTERNS = [
|
|
|
2169
2651
|
},
|
|
2170
2652
|
],
|
|
2171
2653
|
},
|
|
2172
|
-
{
|
|
2173
|
-
pattern: /Escrow action/,
|
|
2174
|
-
category: "INPUT_VALIDATION",
|
|
2175
|
-
retryable: false,
|
|
2176
|
-
recovery_actions: [
|
|
2177
|
-
{
|
|
2178
|
-
action: "use_escrow_api",
|
|
2179
|
-
description: "Use createEscrow/settleEscrow/refundEscrow instead of wrap().",
|
|
2180
|
-
},
|
|
2181
|
-
],
|
|
2182
|
-
},
|
|
2183
2654
|
];
|
|
2184
2655
|
// ─── SigilSdkError ──────────────────────────────────────────────────────────
|
|
2185
2656
|
/**
|
|
@@ -2229,11 +2700,37 @@ export class SigilSdkError extends Error {
|
|
|
2229
2700
|
* Returns a SigilSdkError (extends Error) so instanceof Error checks still work.
|
|
2230
2701
|
*
|
|
2231
2702
|
* Processing order:
|
|
2232
|
-
* 1. Try on-chain error extraction via toAgentError() (numeric codes 6000-
|
|
2703
|
+
* 1. Try on-chain error extraction via toAgentError() (numeric codes 6000-6102)
|
|
2233
2704
|
* 2. Pattern-match SDK error messages (11 patterns from seal.ts throw sites)
|
|
2234
2705
|
* 3. Fallback to UNKNOWN/FATAL
|
|
2235
2706
|
*/
|
|
2236
2707
|
export function toSigilAgentError(err) {
|
|
2708
|
+
// Phase 9 Batch M §RP CRIT-1 fix: preserve SigilSdkDomainError and
|
|
2709
|
+
// SigilRpcError instances unmodified. These are the canonical
|
|
2710
|
+
// SDK-domain-typed errors carrying their own `.code`, structured
|
|
2711
|
+
// `.context`, and rich `.message`. Funneling them through the
|
|
2712
|
+
// pattern-matcher + UNKNOWN/FATAL fallback below silently strips
|
|
2713
|
+
// the context the throw site built (vault address, docs URL,
|
|
2714
|
+
// opt-in/opt-out snippets, network identifier, etc.).
|
|
2715
|
+
//
|
|
2716
|
+
// Wrap the domain error in a SigilSdkError that mirrors its code
|
|
2717
|
+
// + context so downstream consumers narrowing on either
|
|
2718
|
+
// `err instanceof SigilSdkDomainError` (the original throw) OR
|
|
2719
|
+
// `err.code === SIGIL_ERROR__SDK__MAINNET_CONFIRMATION_REQUIRED`
|
|
2720
|
+
// (the SigilSdkError surface) both work.
|
|
2721
|
+
if (err instanceof Error &&
|
|
2722
|
+
typeof err.code === "string" &&
|
|
2723
|
+
err.code.startsWith("SIGIL_ERROR__")) {
|
|
2724
|
+
const sigilErr = err;
|
|
2725
|
+
return new SigilSdkError({
|
|
2726
|
+
code: sigilErr.code,
|
|
2727
|
+
message: sigilErr.message,
|
|
2728
|
+
category: "FATAL",
|
|
2729
|
+
retryable: false,
|
|
2730
|
+
recovery_actions: [],
|
|
2731
|
+
context: sigilErr.context ?? {},
|
|
2732
|
+
});
|
|
2733
|
+
}
|
|
2237
2734
|
// Try on-chain error extraction first
|
|
2238
2735
|
const onChain = toAgentError(err);
|
|
2239
2736
|
if (onChain.code !== "UNKNOWN")
|