@usesigil/kit 0.15.0 → 0.17.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 +117 -0
- package/dist/agent-bootstrap.d.ts.map +1 -0
- package/dist/agent-bootstrap.js +211 -0
- package/dist/agent-bootstrap.js.map +1 -0
- package/dist/agent-errors.d.ts +20 -4
- package/dist/agent-errors.d.ts.map +1 -1
- package/dist/agent-errors.js +947 -377
- 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/build-unsigned.d.ts +152 -0
- package/dist/build-unsigned.d.ts.map +1 -0
- package/dist/build-unsigned.js +152 -0
- package/dist/build-unsigned.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 +102 -1
- package/dist/create-vault.d.ts.map +1 -1
- package/dist/create-vault.js +108 -9
- 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 +37 -0
- package/dist/dashboard/errors.d.ts.map +1 -1
- package/dist/dashboard/errors.js +81 -1
- package/dist/dashboard/errors.js.map +1 -1
- package/dist/dashboard/from-json.d.ts.map +1 -1
- package/dist/dashboard/from-json.js +1 -2
- package/dist/dashboard/from-json.js.map +1 -1
- package/dist/dashboard/index.d.ts +204 -31
- package/dist/dashboard/index.d.ts.map +1 -1
- package/dist/dashboard/index.js +290 -49
- package/dist/dashboard/index.js.map +1 -1
- package/dist/dashboard/mutations.d.ts +160 -10
- package/dist/dashboard/mutations.d.ts.map +1 -1
- package/dist/dashboard/mutations.js +584 -66
- package/dist/dashboard/mutations.js.map +1 -1
- package/dist/dashboard/post-assertion-validation.d.ts +88 -0
- package/dist/dashboard/post-assertion-validation.d.ts.map +1 -0
- package/dist/dashboard/post-assertion-validation.js +312 -0
- package/dist/dashboard/post-assertion-validation.js.map +1 -0
- package/dist/dashboard/reads.d.ts +92 -1
- package/dist/dashboard/reads.d.ts.map +1 -1
- package/dist/dashboard/reads.js +244 -26
- package/dist/dashboard/reads.js.map +1 -1
- package/dist/dashboard/types.d.ts +172 -21
- 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 +133 -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 +20 -1
- 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 -13
- 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 +76 -0
- package/dist/generated/accounts/pendingAgentPermissionsUpdate.d.ts.map +1 -1
- package/dist/generated/accounts/pendingAgentPermissionsUpdate.js +9 -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 +220 -4
- package/dist/generated/accounts/pendingPolicyUpdate.d.ts.map +1 -1
- package/dist/generated/accounts/pendingPolicyUpdate.js +25 -5
- package/dist/generated/accounts/pendingPolicyUpdate.js.map +1 -1
- package/dist/generated/accounts/policyConfig.d.ts +495 -34
- package/dist/generated/accounts/policyConfig.d.ts.map +1 -1
- package/dist/generated/accounts/policyConfig.js +34 -7
- 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 +154 -12
- package/dist/generated/accounts/sessionAuthority.d.ts.map +1 -1
- package/dist/generated/accounts/sessionAuthority.js +12 -10
- 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 +160 -100
- package/dist/generated/errors/sigil.d.ts.map +1 -1
- package/dist/generated/errors/sigil.js +214 -124
- 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 -13
- 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 +142 -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 +39 -5
- package/dist/generated/instructions/freezeVault.d.ts.map +1 -1
- package/dist/generated/instructions/freezeVault.js +77 -5
- package/dist/generated/instructions/freezeVault.js.map +1 -1
- package/dist/generated/instructions/index.d.ts +10 -14
- package/dist/generated/instructions/index.d.ts.map +1 -1
- package/dist/generated/instructions/index.js +10 -14
- package/dist/generated/instructions/index.js.map +1 -1
- package/dist/generated/instructions/initializeVault.d.ts +79 -13
- package/dist/generated/instructions/initializeVault.d.ts.map +1 -1
- package/dist/generated/instructions/initializeVault.js +57 -5
- 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 +40 -8
- package/dist/generated/instructions/queuePolicyUpdate.d.ts.map +1 -1
- package/dist/generated/instructions/queuePolicyUpdate.js +21 -5
- 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 -95
- package/dist/generated/programs/sigil.d.ts.map +1 -1
- package/dist/generated/programs/sigil.js +139 -187
- 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/{pdaAllocated.js → agentAutoRevoked.js} +12 -10
- 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 -21
- package/dist/generated/types/index.d.ts.map +1 -1
- package/dist/generated/types/index.js +13 -21
- 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 +26 -0
- package/dist/generated/types/vaultFrozen.d.ts.map +1 -1
- package/dist/generated/types/vaultFrozen.js +5 -1
- package/dist/generated/types/vaultFrozen.js.map +1 -1
- package/dist/index.d.ts +35 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +81 -7
- package/dist/index.js.map +1 -1
- package/dist/inscribe.d.ts +0 -4
- package/dist/inscribe.d.ts.map +1 -1
- package/dist/inscribe.js +0 -1
- package/dist/inscribe.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/logger.d.ts +48 -0
- package/dist/logger.d.ts.map +1 -1
- package/dist/logger.js +36 -0
- package/dist/logger.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/owner-transaction.d.ts +8 -0
- package/dist/owner-transaction.d.ts.map +1 -1
- package/dist/owner-transaction.js +1 -0
- package/dist/owner-transaction.js.map +1 -1
- 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-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 +258 -0
- package/dist/policy/compute-policy-preview-digest.d.ts.map +1 -0
- package/dist/policy/compute-policy-preview-digest.js +351 -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/presets.d.ts +1 -7
- package/dist/presets.d.ts.map +1 -1
- package/dist/presets.js +0 -5
- package/dist/presets.js.map +1 -1
- package/dist/preview-create-vault.d.ts +280 -0
- package/dist/preview-create-vault.d.ts.map +1 -0
- package/dist/preview-create-vault.js +498 -0
- package/dist/preview-create-vault.js.map +1 -0
- 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 -8
- 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/sigil.d.ts +0 -4
- package/dist/sigil.d.ts.map +1 -1
- package/dist/simulation.d.ts +19 -0
- package/dist/simulation.d.ts.map +1 -1
- package/dist/simulation.js +211 -138
- 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 -45
- package/dist/testing/devnet.js.map +1 -1
- package/dist/testing/errors/expect.d.ts +137 -0
- package/dist/testing/errors/expect.d.ts.map +1 -0
- package/dist/testing/errors/expect.js +372 -0
- package/dist/testing/errors/expect.js.map +1 -0
- package/dist/testing/errors/index.d.ts +3 -0
- package/dist/testing/errors/index.d.ts.map +1 -0
- package/dist/testing/errors/index.js +8 -0
- package/dist/testing/errors/index.js.map +1 -0
- package/dist/testing/errors/names.generated.d.ts +211 -0
- package/dist/testing/errors/names.generated.d.ts.map +1 -0
- package/dist/testing/errors/names.generated.js +206 -0
- package/dist/testing/errors/names.generated.js.map +1 -0
- package/dist/testing/index.d.ts +1 -0
- package/dist/testing/index.d.ts.map +1 -1
- package/dist/testing/index.js +8 -0
- package/dist/testing/index.js.map +1 -1
- package/dist/testing/mock-rpc.d.ts +16 -0
- package/dist/testing/mock-rpc.d.ts.map +1 -1
- package/dist/testing/mock-rpc.js +27 -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 +45 -6
- 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 +12 -5
- 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 -37
- package/dist/generated/accounts/pendingCloseConstraints.d.ts.map +0 -1
- package/dist/generated/accounts/pendingCloseConstraints.js +0 -66
- package/dist/generated/accounts/pendingCloseConstraints.js.map +0 -1
- package/dist/generated/accounts/pendingConstraintsUpdate.d.ts +0 -62
- package/dist/generated/accounts/pendingConstraintsUpdate.d.ts.map +0 -1
- package/dist/generated/accounts/pendingConstraintsUpdate.js +0 -75
- 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/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 -18
- package/dist/generated/types/accountConstraint.d.ts.map +0 -1
- package/dist/generated/types/accountConstraint.js +0 -24
- package/dist/generated/types/accountConstraint.js.map +0 -1
- package/dist/generated/types/accountConstraintZC.d.ts +0 -18
- package/dist/generated/types/accountConstraintZC.d.ts.map +0 -1
- package/dist/generated/types/accountConstraintZC.js +0 -26
- 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 -39
- package/dist/generated/types/constraintEntry.d.ts.map +0 -1
- package/dist/generated/types/constraintEntry.js +0 -31
- package/dist/generated/types/constraintEntry.js.map +0 -1
- package/dist/generated/types/constraintEntryZC.d.ts +0 -68
- 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/pdaAllocated.d.ts +0 -24
- package/dist/generated/types/pdaAllocated.d.ts.map +0 -1
- 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/integrations/protocol-handler.d.ts +0 -59
- package/dist/integrations/protocol-handler.d.ts.map +0 -1
- package/dist/integrations/protocol-handler.js +0 -9
- package/dist/integrations/protocol-handler.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 = 6110;
|
|
14
45
|
export const ON_CHAIN_ERROR_MAP = {
|
|
15
46
|
// --- Vault state errors ---
|
|
16
47
|
6000: {
|
|
@@ -130,23 +161,6 @@ export const ON_CHAIN_ERROR_MAP = {
|
|
|
130
161
|
],
|
|
131
162
|
},
|
|
132
163
|
6007: {
|
|
133
|
-
name: "LeverageTooHigh",
|
|
134
|
-
message: "Leverage exceeds maximum allowed by policy",
|
|
135
|
-
category: "POLICY_VIOLATION",
|
|
136
|
-
retryable: false,
|
|
137
|
-
recovery_actions: [
|
|
138
|
-
{
|
|
139
|
-
action: "reduce_leverage",
|
|
140
|
-
description: "Reduce leverage to within maxLeverageBps",
|
|
141
|
-
},
|
|
142
|
-
{
|
|
143
|
-
action: "check_limits",
|
|
144
|
-
description: "Check the vault's maxLeverageBps policy",
|
|
145
|
-
tool: "sigil_check_vault",
|
|
146
|
-
},
|
|
147
|
-
],
|
|
148
|
-
},
|
|
149
|
-
6008: {
|
|
150
164
|
name: "SessionNotAuthorized",
|
|
151
165
|
message: "Session authority not authorized for this action",
|
|
152
166
|
category: "PERMISSION",
|
|
@@ -158,7 +172,7 @@ export const ON_CHAIN_ERROR_MAP = {
|
|
|
158
172
|
},
|
|
159
173
|
],
|
|
160
174
|
},
|
|
161
|
-
|
|
175
|
+
6008: {
|
|
162
176
|
name: "InvalidSession",
|
|
163
177
|
message: "Session does not belong to this vault or is invalid",
|
|
164
178
|
category: "PERMISSION",
|
|
@@ -170,7 +184,7 @@ export const ON_CHAIN_ERROR_MAP = {
|
|
|
170
184
|
},
|
|
171
185
|
],
|
|
172
186
|
},
|
|
173
|
-
|
|
187
|
+
6009: {
|
|
174
188
|
name: "TooManyAllowedProtocols",
|
|
175
189
|
message: "Policy configuration has too many allowed protocols (max 10)",
|
|
176
190
|
category: "INPUT_VALIDATION",
|
|
@@ -182,7 +196,7 @@ export const ON_CHAIN_ERROR_MAP = {
|
|
|
182
196
|
},
|
|
183
197
|
],
|
|
184
198
|
},
|
|
185
|
-
|
|
199
|
+
6010: {
|
|
186
200
|
name: "AgentAlreadyRegistered",
|
|
187
201
|
message: "Agent is already registered on this vault",
|
|
188
202
|
category: "INPUT_VALIDATION",
|
|
@@ -195,7 +209,7 @@ export const ON_CHAIN_ERROR_MAP = {
|
|
|
195
209
|
},
|
|
196
210
|
],
|
|
197
211
|
},
|
|
198
|
-
|
|
212
|
+
6011: {
|
|
199
213
|
name: "NoAgentRegistered",
|
|
200
214
|
message: "No agent registered on this vault",
|
|
201
215
|
category: "RESOURCE_NOT_FOUND",
|
|
@@ -208,7 +222,7 @@ export const ON_CHAIN_ERROR_MAP = {
|
|
|
208
222
|
},
|
|
209
223
|
],
|
|
210
224
|
},
|
|
211
|
-
|
|
225
|
+
6012: {
|
|
212
226
|
name: "VaultNotFrozen",
|
|
213
227
|
message: "Vault is not frozen (expected frozen for reactivation)",
|
|
214
228
|
category: "INPUT_VALIDATION",
|
|
@@ -221,7 +235,7 @@ export const ON_CHAIN_ERROR_MAP = {
|
|
|
221
235
|
},
|
|
222
236
|
],
|
|
223
237
|
},
|
|
224
|
-
|
|
238
|
+
6013: {
|
|
225
239
|
name: "VaultAlreadyClosed",
|
|
226
240
|
message: "Vault is permanently closed",
|
|
227
241
|
category: "INPUT_VALIDATION",
|
|
@@ -234,7 +248,7 @@ export const ON_CHAIN_ERROR_MAP = {
|
|
|
234
248
|
},
|
|
235
249
|
],
|
|
236
250
|
},
|
|
237
|
-
|
|
251
|
+
6014: {
|
|
238
252
|
name: "InsufficientBalance",
|
|
239
253
|
message: "Insufficient vault balance for this operation",
|
|
240
254
|
category: "SPENDING_CAP",
|
|
@@ -255,7 +269,7 @@ export const ON_CHAIN_ERROR_MAP = {
|
|
|
255
269
|
},
|
|
256
270
|
],
|
|
257
271
|
},
|
|
258
|
-
|
|
272
|
+
6015: {
|
|
259
273
|
name: "DeveloperFeeTooHigh",
|
|
260
274
|
message: "Developer fee rate exceeds maximum (500 / 1,000,000 = 5 BPS)",
|
|
261
275
|
category: "INPUT_VALIDATION",
|
|
@@ -267,7 +281,7 @@ export const ON_CHAIN_ERROR_MAP = {
|
|
|
267
281
|
},
|
|
268
282
|
],
|
|
269
283
|
},
|
|
270
|
-
|
|
284
|
+
6016: {
|
|
271
285
|
name: "InvalidFeeDestination",
|
|
272
286
|
message: "Fee destination account is invalid",
|
|
273
287
|
category: "INPUT_VALIDATION",
|
|
@@ -279,7 +293,7 @@ export const ON_CHAIN_ERROR_MAP = {
|
|
|
279
293
|
},
|
|
280
294
|
],
|
|
281
295
|
},
|
|
282
|
-
|
|
296
|
+
6017: {
|
|
283
297
|
name: "InvalidProtocolTreasury",
|
|
284
298
|
message: "Protocol treasury account does not match expected address",
|
|
285
299
|
category: "INPUT_VALIDATION",
|
|
@@ -291,7 +305,7 @@ export const ON_CHAIN_ERROR_MAP = {
|
|
|
291
305
|
},
|
|
292
306
|
],
|
|
293
307
|
},
|
|
294
|
-
|
|
308
|
+
6018: {
|
|
295
309
|
name: "InvalidAgentKey",
|
|
296
310
|
message: "Agent cannot be the zero address",
|
|
297
311
|
category: "INPUT_VALIDATION",
|
|
@@ -303,7 +317,7 @@ export const ON_CHAIN_ERROR_MAP = {
|
|
|
303
317
|
},
|
|
304
318
|
],
|
|
305
319
|
},
|
|
306
|
-
|
|
320
|
+
6019: {
|
|
307
321
|
name: "AgentIsOwner",
|
|
308
322
|
message: "Agent cannot be the vault owner",
|
|
309
323
|
category: "INPUT_VALIDATION",
|
|
@@ -315,7 +329,7 @@ export const ON_CHAIN_ERROR_MAP = {
|
|
|
315
329
|
},
|
|
316
330
|
],
|
|
317
331
|
},
|
|
318
|
-
|
|
332
|
+
6020: {
|
|
319
333
|
name: "Overflow",
|
|
320
334
|
message: "Arithmetic overflow in on-chain computation",
|
|
321
335
|
category: "FATAL",
|
|
@@ -327,7 +341,7 @@ export const ON_CHAIN_ERROR_MAP = {
|
|
|
327
341
|
},
|
|
328
342
|
],
|
|
329
343
|
},
|
|
330
|
-
|
|
344
|
+
6021: {
|
|
331
345
|
name: "InvalidTokenAccount",
|
|
332
346
|
message: "Token account does not belong to vault or has wrong mint",
|
|
333
347
|
category: "INPUT_VALIDATION",
|
|
@@ -340,7 +354,7 @@ export const ON_CHAIN_ERROR_MAP = {
|
|
|
340
354
|
],
|
|
341
355
|
},
|
|
342
356
|
// --- Timelock + Destination errors ---
|
|
343
|
-
|
|
357
|
+
6022: {
|
|
344
358
|
name: "TimelockNotExpired",
|
|
345
359
|
message: "Timelock period has not expired yet",
|
|
346
360
|
category: "POLICY_VIOLATION",
|
|
@@ -353,7 +367,7 @@ export const ON_CHAIN_ERROR_MAP = {
|
|
|
353
367
|
},
|
|
354
368
|
],
|
|
355
369
|
},
|
|
356
|
-
|
|
370
|
+
6023: {
|
|
357
371
|
name: "NoTimelockConfigured",
|
|
358
372
|
message: "No timelock configured on this vault",
|
|
359
373
|
category: "INPUT_VALIDATION",
|
|
@@ -365,7 +379,7 @@ export const ON_CHAIN_ERROR_MAP = {
|
|
|
365
379
|
},
|
|
366
380
|
],
|
|
367
381
|
},
|
|
368
|
-
|
|
382
|
+
6024: {
|
|
369
383
|
name: "DestinationNotAllowed",
|
|
370
384
|
message: "Destination address not in vault's allowed destinations list",
|
|
371
385
|
category: "POLICY_VIOLATION",
|
|
@@ -382,7 +396,7 @@ export const ON_CHAIN_ERROR_MAP = {
|
|
|
382
396
|
},
|
|
383
397
|
],
|
|
384
398
|
},
|
|
385
|
-
|
|
399
|
+
6025: {
|
|
386
400
|
name: "TooManyDestinations",
|
|
387
401
|
message: "Too many destinations in allowlist (max 10)",
|
|
388
402
|
category: "INPUT_VALIDATION",
|
|
@@ -394,7 +408,7 @@ export const ON_CHAIN_ERROR_MAP = {
|
|
|
394
408
|
},
|
|
395
409
|
],
|
|
396
410
|
},
|
|
397
|
-
|
|
411
|
+
6026: {
|
|
398
412
|
name: "InvalidProtocolMode",
|
|
399
413
|
message: "Invalid protocol mode (must be 0=all, 1=allowlist, or 2=denylist)",
|
|
400
414
|
category: "INPUT_VALIDATION",
|
|
@@ -407,19 +421,7 @@ export const ON_CHAIN_ERROR_MAP = {
|
|
|
407
421
|
],
|
|
408
422
|
},
|
|
409
423
|
// --- Flash Trade expansion errors ---
|
|
410
|
-
|
|
411
|
-
name: "InvalidNonSpendingAmount",
|
|
412
|
-
message: "Non-spending action must have amount = 0",
|
|
413
|
-
category: "INPUT_VALIDATION",
|
|
414
|
-
retryable: false,
|
|
415
|
-
recovery_actions: [
|
|
416
|
-
{
|
|
417
|
-
action: "set_zero_amount",
|
|
418
|
-
description: "Set amount to 0 for non-spending actions (close, cancel, etc.)",
|
|
419
|
-
},
|
|
420
|
-
],
|
|
421
|
-
},
|
|
422
|
-
6029: {
|
|
424
|
+
6027: {
|
|
423
425
|
name: "CpiCallNotAllowed",
|
|
424
426
|
message: "Instruction must be top-level (CPI calls not allowed for validate/finalize)",
|
|
425
427
|
category: "FATAL",
|
|
@@ -431,7 +433,7 @@ export const ON_CHAIN_ERROR_MAP = {
|
|
|
431
433
|
},
|
|
432
434
|
],
|
|
433
435
|
},
|
|
434
|
-
|
|
436
|
+
6028: {
|
|
435
437
|
name: "MissingFinalizeInstruction",
|
|
436
438
|
message: "Transaction must include finalize_session after validate_and_authorize",
|
|
437
439
|
category: "INPUT_VALIDATION",
|
|
@@ -444,7 +446,7 @@ export const ON_CHAIN_ERROR_MAP = {
|
|
|
444
446
|
],
|
|
445
447
|
},
|
|
446
448
|
// --- Stablecoin-only enforcement errors ---
|
|
447
|
-
|
|
449
|
+
6029: {
|
|
448
450
|
name: "NonTrackedSwapMustReturnStablecoin",
|
|
449
451
|
message: "Non-stablecoin swap must return stablecoin (vault stablecoin balance did not increase)",
|
|
450
452
|
category: "INPUT_VALIDATION",
|
|
@@ -456,36 +458,7 @@ export const ON_CHAIN_ERROR_MAP = {
|
|
|
456
458
|
},
|
|
457
459
|
],
|
|
458
460
|
},
|
|
459
|
-
|
|
460
|
-
name: "SwapSlippageExceeded",
|
|
461
|
-
message: "Swap slippage exceeds policy max_slippage_bps or quoted output is zero",
|
|
462
|
-
category: "POLICY_VIOLATION",
|
|
463
|
-
retryable: false,
|
|
464
|
-
recovery_actions: [
|
|
465
|
-
{
|
|
466
|
-
action: "reduce_slippage",
|
|
467
|
-
description: "Use a lower slippageBps value within the vault's maxSlippageBps",
|
|
468
|
-
},
|
|
469
|
-
{
|
|
470
|
-
action: "check_policy",
|
|
471
|
-
description: "Check the vault's maxSlippageBps setting",
|
|
472
|
-
tool: "sigil_check_vault",
|
|
473
|
-
},
|
|
474
|
-
],
|
|
475
|
-
},
|
|
476
|
-
6033: {
|
|
477
|
-
name: "InvalidJupiterInstruction",
|
|
478
|
-
message: "Cannot parse Jupiter swap instruction data",
|
|
479
|
-
category: "INPUT_VALIDATION",
|
|
480
|
-
retryable: false,
|
|
481
|
-
recovery_actions: [
|
|
482
|
-
{
|
|
483
|
-
action: "use_sdk",
|
|
484
|
-
description: "Use the SDK's composeJupiterSwap — manual instruction building is error-prone",
|
|
485
|
-
},
|
|
486
|
-
],
|
|
487
|
-
},
|
|
488
|
-
6034: {
|
|
461
|
+
6030: {
|
|
489
462
|
name: "UnauthorizedTokenTransfer",
|
|
490
463
|
message: "Top-level SPL Token transfer not allowed between validate and finalize",
|
|
491
464
|
category: "POLICY_VIOLATION",
|
|
@@ -497,7 +470,7 @@ export const ON_CHAIN_ERROR_MAP = {
|
|
|
497
470
|
},
|
|
498
471
|
],
|
|
499
472
|
},
|
|
500
|
-
|
|
473
|
+
6031: {
|
|
501
474
|
name: "SlippageBpsTooHigh",
|
|
502
475
|
message: "Slippage BPS exceeds maximum allowed (5000 = 50%)",
|
|
503
476
|
category: "INPUT_VALIDATION",
|
|
@@ -509,7 +482,7 @@ export const ON_CHAIN_ERROR_MAP = {
|
|
|
509
482
|
},
|
|
510
483
|
],
|
|
511
484
|
},
|
|
512
|
-
|
|
485
|
+
6032: {
|
|
513
486
|
name: "ProtocolMismatch",
|
|
514
487
|
message: "DeFi instruction program does not match the declared target_protocol",
|
|
515
488
|
category: "INPUT_VALIDATION",
|
|
@@ -521,7 +494,7 @@ export const ON_CHAIN_ERROR_MAP = {
|
|
|
521
494
|
},
|
|
522
495
|
],
|
|
523
496
|
},
|
|
524
|
-
|
|
497
|
+
6033: {
|
|
525
498
|
name: "TooManyDeFiInstructions",
|
|
526
499
|
message: "Non-stablecoin swap allows exactly one DeFi instruction",
|
|
527
500
|
category: "INPUT_VALIDATION",
|
|
@@ -534,7 +507,7 @@ export const ON_CHAIN_ERROR_MAP = {
|
|
|
534
507
|
],
|
|
535
508
|
},
|
|
536
509
|
// --- Multi-Agent errors ---
|
|
537
|
-
|
|
510
|
+
6034: {
|
|
538
511
|
name: "MaxAgentsReached",
|
|
539
512
|
message: "Maximum agents per vault reached (limit: 10)",
|
|
540
513
|
category: "INPUT_VALIDATION",
|
|
@@ -547,7 +520,7 @@ export const ON_CHAIN_ERROR_MAP = {
|
|
|
547
520
|
},
|
|
548
521
|
],
|
|
549
522
|
},
|
|
550
|
-
|
|
523
|
+
6035: {
|
|
551
524
|
name: "InsufficientPermissions",
|
|
552
525
|
message: "Agent lacks permission for this action type",
|
|
553
526
|
category: "PERMISSION",
|
|
@@ -564,7 +537,7 @@ export const ON_CHAIN_ERROR_MAP = {
|
|
|
564
537
|
},
|
|
565
538
|
],
|
|
566
539
|
},
|
|
567
|
-
|
|
540
|
+
6036: {
|
|
568
541
|
name: "InvalidPermissions",
|
|
569
542
|
message: "Capability exceeds the on-chain maximum (valid values: 0 = Disabled, 1 = Observer, 2 = Operator)",
|
|
570
543
|
category: "INPUT_VALIDATION",
|
|
@@ -576,536 +549,1115 @@ export const ON_CHAIN_ERROR_MAP = {
|
|
|
576
549
|
},
|
|
577
550
|
],
|
|
578
551
|
},
|
|
579
|
-
// ---
|
|
580
|
-
|
|
581
|
-
name: "
|
|
582
|
-
message: "
|
|
583
|
-
category: "
|
|
552
|
+
// --- Post-execution assertion config error ---
|
|
553
|
+
6037: {
|
|
554
|
+
name: "InvalidConstraintConfig",
|
|
555
|
+
message: "Invalid constraint configuration: bounds exceeded",
|
|
556
|
+
category: "INPUT_VALIDATION",
|
|
584
557
|
retryable: false,
|
|
585
558
|
recovery_actions: [
|
|
586
559
|
{
|
|
587
|
-
action: "
|
|
588
|
-
description: "
|
|
560
|
+
action: "fix_constraints",
|
|
561
|
+
description: "Ensure constraint entries are within bounds (max 64 entries, 8 data constraints each)",
|
|
589
562
|
},
|
|
590
563
|
],
|
|
591
564
|
},
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
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
|
+
},
|
|
588
|
+
6039: {
|
|
589
|
+
name: "OverlaySlotExhausted",
|
|
590
|
+
message: "Per-agent overlay is full — cannot register agent with spending limit",
|
|
591
|
+
category: "INPUT_VALIDATION",
|
|
592
|
+
retryable: false,
|
|
593
|
+
recovery_actions: [
|
|
594
|
+
{
|
|
595
|
+
action: "revoke_agent",
|
|
596
|
+
description: "Revoke an unused agent to free an overlay slot",
|
|
597
|
+
tool: "sigil_revoke_agent",
|
|
598
|
+
},
|
|
599
|
+
],
|
|
600
|
+
},
|
|
601
|
+
6040: {
|
|
602
|
+
name: "AgentSlotNotFound",
|
|
603
|
+
message: "Agent has per-agent spending limit but no overlay tracking slot",
|
|
595
604
|
category: "RESOURCE_NOT_FOUND",
|
|
596
605
|
retryable: false,
|
|
597
606
|
recovery_actions: [
|
|
598
607
|
{
|
|
599
|
-
action: "
|
|
600
|
-
description: "
|
|
601
|
-
|
|
608
|
+
action: "contact_support",
|
|
609
|
+
description: "This is an internal consistency error — the overlay may need reinitialization",
|
|
610
|
+
},
|
|
611
|
+
],
|
|
612
|
+
},
|
|
613
|
+
6041: {
|
|
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",
|
|
602
622
|
},
|
|
603
623
|
],
|
|
604
624
|
},
|
|
605
|
-
|
|
606
|
-
name: "
|
|
607
|
-
message: "
|
|
625
|
+
6042: {
|
|
626
|
+
name: "InvalidSessionExpiry",
|
|
627
|
+
message: "Session expiry slots out of range (10-450)",
|
|
608
628
|
category: "INPUT_VALIDATION",
|
|
609
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,
|
|
610
649
|
recovery_actions: [
|
|
611
650
|
{
|
|
612
651
|
action: "wait",
|
|
613
|
-
description: "Wait for
|
|
652
|
+
description: "Wait for an existing protocol slot's 24h rolling window to elapse before invoking a new protocol",
|
|
614
653
|
},
|
|
615
654
|
{
|
|
616
|
-
action: "
|
|
617
|
-
description: "
|
|
618
|
-
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",
|
|
619
657
|
},
|
|
620
658
|
],
|
|
621
659
|
},
|
|
622
660
|
6044: {
|
|
623
|
-
name: "
|
|
624
|
-
message: "
|
|
661
|
+
name: "ProtocolCapsMismatch",
|
|
662
|
+
message: "protocol_caps length must match protocols length when has_protocol_caps is true",
|
|
625
663
|
category: "INPUT_VALIDATION",
|
|
626
664
|
retryable: false,
|
|
627
665
|
recovery_actions: [
|
|
628
666
|
{
|
|
629
|
-
action: "
|
|
630
|
-
description: "Ensure
|
|
667
|
+
action: "fix_config",
|
|
668
|
+
description: "Ensure protocol_caps array length matches the protocols array length",
|
|
631
669
|
},
|
|
632
670
|
],
|
|
633
671
|
},
|
|
672
|
+
// --- Vault closure guard errors ---
|
|
634
673
|
6045: {
|
|
635
|
-
name: "
|
|
636
|
-
message: "
|
|
637
|
-
category: "
|
|
674
|
+
name: "PendingPolicyExists",
|
|
675
|
+
message: "A pending policy update exists — apply or cancel it before closing vault",
|
|
676
|
+
category: "RESOURCE_NOT_FOUND",
|
|
638
677
|
retryable: false,
|
|
639
678
|
recovery_actions: [
|
|
640
679
|
{
|
|
641
|
-
action: "
|
|
642
|
-
description: "
|
|
680
|
+
action: "resolve_pending_policy",
|
|
681
|
+
description: "Apply or cancel the pending policy update before closing the vault",
|
|
643
682
|
},
|
|
644
683
|
],
|
|
645
684
|
},
|
|
685
|
+
// --- Agent pause errors ---
|
|
646
686
|
6046: {
|
|
647
|
-
name: "
|
|
648
|
-
message: "
|
|
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",
|
|
701
|
+
category: "INPUT_VALIDATION",
|
|
702
|
+
retryable: false,
|
|
703
|
+
recovery_actions: [
|
|
704
|
+
{
|
|
705
|
+
action: "check_agent_status",
|
|
706
|
+
description: "Agent is already paused — no action needed",
|
|
707
|
+
},
|
|
708
|
+
],
|
|
709
|
+
},
|
|
710
|
+
6048: {
|
|
711
|
+
name: "AgentNotPaused",
|
|
712
|
+
message: "Agent is not paused — cannot unpause",
|
|
713
|
+
category: "INPUT_VALIDATION",
|
|
714
|
+
retryable: false,
|
|
715
|
+
recovery_actions: [
|
|
716
|
+
{
|
|
717
|
+
action: "check_agent_status",
|
|
718
|
+
description: "Agent is not paused — no action needed",
|
|
719
|
+
},
|
|
720
|
+
],
|
|
721
|
+
},
|
|
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).",
|
|
757
|
+
category: "INPUT_VALIDATION",
|
|
758
|
+
retryable: false,
|
|
759
|
+
recovery_actions: [
|
|
760
|
+
{
|
|
761
|
+
action: "increase_timelock",
|
|
762
|
+
description: "Set timelock_duration to at least 1800 seconds (30 minutes).",
|
|
763
|
+
},
|
|
764
|
+
],
|
|
765
|
+
},
|
|
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.",
|
|
796
|
+
category: "POLICY_VIOLATION",
|
|
797
|
+
retryable: false,
|
|
798
|
+
recovery_actions: [
|
|
799
|
+
{
|
|
800
|
+
action: "review_assertions",
|
|
801
|
+
description: "Review the vault's post-execution assertions. The trade's resulting account state violated a configured assertion.",
|
|
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: [
|
|
811
|
+
{
|
|
812
|
+
action: "fix_assertions",
|
|
813
|
+
description: "Review and update the vault's post-assertion configuration.",
|
|
814
|
+
},
|
|
815
|
+
],
|
|
816
|
+
},
|
|
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.",
|
|
832
|
+
category: "INPUT_VALIDATION",
|
|
833
|
+
retryable: false,
|
|
834
|
+
recovery_actions: [
|
|
835
|
+
{
|
|
836
|
+
action: "fix_assertions",
|
|
837
|
+
description: "Ensure validate_and_authorize captures a snapshot before finalize delta check.",
|
|
838
|
+
},
|
|
839
|
+
],
|
|
840
|
+
},
|
|
841
|
+
6058: {
|
|
842
|
+
name: "InvalidConstraintOperator",
|
|
843
|
+
message: "Constraint operator value is not a valid ConstraintOperator discriminant.",
|
|
649
844
|
category: "INPUT_VALIDATION",
|
|
650
845
|
retryable: false,
|
|
651
846
|
recovery_actions: [
|
|
652
847
|
{
|
|
653
|
-
action: "
|
|
654
|
-
description: "
|
|
848
|
+
action: "fix_constraints",
|
|
849
|
+
description: "Ensure constraint operators are valid (0-6).",
|
|
850
|
+
},
|
|
851
|
+
],
|
|
852
|
+
},
|
|
853
|
+
6059: {
|
|
854
|
+
name: "ZeroCopyVaultMismatch",
|
|
855
|
+
message: "Zero-copy constraints account has wrong vault.",
|
|
856
|
+
category: "INPUT_VALIDATION",
|
|
857
|
+
retryable: false,
|
|
858
|
+
recovery_actions: [
|
|
859
|
+
{
|
|
860
|
+
action: "verify_pda",
|
|
861
|
+
description: "The constraints PDA does not belong to this vault.",
|
|
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: [
|
|
874
|
+
{
|
|
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.",
|
|
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: [
|
|
886
|
+
{
|
|
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.",
|
|
889
|
+
},
|
|
890
|
+
],
|
|
891
|
+
},
|
|
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).",
|
|
896
|
+
category: "INPUT_VALIDATION",
|
|
897
|
+
retryable: false,
|
|
898
|
+
recovery_actions: [
|
|
899
|
+
{
|
|
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.",
|
|
902
|
+
},
|
|
903
|
+
],
|
|
904
|
+
},
|
|
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",
|
|
910
|
+
retryable: false,
|
|
911
|
+
recovery_actions: [
|
|
912
|
+
{
|
|
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.",
|
|
915
|
+
},
|
|
916
|
+
],
|
|
917
|
+
},
|
|
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.",
|
|
922
|
+
category: "POLICY_VIOLATION",
|
|
923
|
+
retryable: false,
|
|
924
|
+
recovery_actions: [
|
|
925
|
+
{
|
|
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.",
|
|
928
|
+
},
|
|
929
|
+
],
|
|
930
|
+
},
|
|
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).",
|
|
984
|
+
category: "INPUT_VALIDATION",
|
|
985
|
+
retryable: false,
|
|
986
|
+
recovery_actions: [
|
|
987
|
+
{
|
|
988
|
+
action: "fix_policy",
|
|
989
|
+
description: "Pass destination_mode = 0 (RESTRICTED). Phase 2 deleted the permissive OPEN_WITH_CAP path.",
|
|
990
|
+
},
|
|
991
|
+
],
|
|
992
|
+
},
|
|
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.",
|
|
1023
|
+
category: "POLICY_VIOLATION",
|
|
1024
|
+
retryable: false,
|
|
1025
|
+
recovery_actions: [
|
|
1026
|
+
{
|
|
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).",
|
|
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: [
|
|
1041
|
+
{
|
|
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).",
|
|
1044
|
+
},
|
|
1045
|
+
],
|
|
1046
|
+
},
|
|
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.",
|
|
655
1071
|
},
|
|
656
1072
|
],
|
|
657
1073
|
},
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
retryable: false,
|
|
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",
|
|
1078
|
+
retryable: true,
|
|
664
1079
|
recovery_actions: [
|
|
665
1080
|
{
|
|
666
|
-
action: "
|
|
667
|
-
description: "
|
|
1081
|
+
action: "wait_cooldown",
|
|
1082
|
+
description: "Wait until the per-agent cooldown (in seconds) has elapsed since the agent's last successful action.",
|
|
668
1083
|
},
|
|
669
1084
|
],
|
|
670
1085
|
},
|
|
671
|
-
|
|
672
|
-
name: "
|
|
673
|
-
message: "
|
|
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.",
|
|
674
1089
|
category: "POLICY_VIOLATION",
|
|
675
|
-
retryable:
|
|
1090
|
+
retryable: true,
|
|
676
1091
|
recovery_actions: [
|
|
677
1092
|
{
|
|
678
|
-
action: "
|
|
679
|
-
description: "
|
|
680
|
-
tool: "sigil_check_vault",
|
|
681
|
-
},
|
|
682
|
-
{
|
|
683
|
-
action: "modify_instruction",
|
|
684
|
-
description: "Modify the instruction parameters to satisfy the constraints",
|
|
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.",
|
|
685
1095
|
},
|
|
686
1096
|
],
|
|
687
1097
|
},
|
|
688
|
-
|
|
689
|
-
name: "
|
|
690
|
-
message: "
|
|
1098
|
+
6078: {
|
|
1099
|
+
name: "ErrGraylistFull",
|
|
1100
|
+
message: "Graylist bound exceeded (max 10 entries). Wait for an existing entry to unlock or promote.",
|
|
691
1101
|
category: "INPUT_VALIDATION",
|
|
692
1102
|
retryable: false,
|
|
693
1103
|
recovery_actions: [
|
|
694
1104
|
{
|
|
695
|
-
action: "
|
|
696
|
-
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.",
|
|
697
1107
|
},
|
|
698
1108
|
],
|
|
699
1109
|
},
|
|
700
|
-
|
|
701
|
-
name: "
|
|
702
|
-
message: "
|
|
1110
|
+
6079: {
|
|
1111
|
+
name: "ErrToken2022ExtensionForbidden",
|
|
1112
|
+
message: "Token-2022 mint has a forbidden extension. Only MemoTransfer and MetadataPointer extensions are permitted at deposit.",
|
|
703
1113
|
category: "INPUT_VALIDATION",
|
|
704
1114
|
retryable: false,
|
|
705
1115
|
recovery_actions: [
|
|
706
1116
|
{
|
|
707
|
-
action: "
|
|
708
|
-
description: "Use
|
|
1117
|
+
action: "use_supported_mint",
|
|
1118
|
+
description: "Use a Token-2022 mint with no extensions, or one limited to MemoTransfer/MetadataPointer.",
|
|
709
1119
|
},
|
|
710
1120
|
],
|
|
711
1121
|
},
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
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",
|
|
1132
|
+
retryable: false,
|
|
719
1133
|
recovery_actions: [
|
|
720
1134
|
{
|
|
721
|
-
action: "
|
|
722
|
-
description: "
|
|
723
|
-
},
|
|
724
|
-
{
|
|
725
|
-
action: "check_spending",
|
|
726
|
-
description: "Check the agent's current spend against their limit",
|
|
727
|
-
tool: "sigil_check_spending",
|
|
728
|
-
},
|
|
729
|
-
{
|
|
730
|
-
action: "wait",
|
|
731
|
-
description: "Wait for the 24h rolling window to release spent capacity",
|
|
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.",
|
|
732
1137
|
},
|
|
733
1138
|
],
|
|
734
1139
|
},
|
|
735
|
-
|
|
736
|
-
name: "
|
|
737
|
-
message: "
|
|
738
|
-
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",
|
|
739
1144
|
retryable: false,
|
|
740
1145
|
recovery_actions: [
|
|
741
1146
|
{
|
|
742
|
-
action: "
|
|
743
|
-
description: "
|
|
744
|
-
tool: "sigil_revoke_agent",
|
|
1147
|
+
action: "owner_reenable",
|
|
1148
|
+
description: "Owner queues a fresh queue_agent_permissions_update setting the agent's capability back to Observer or Operator.",
|
|
745
1149
|
},
|
|
746
1150
|
],
|
|
747
1151
|
},
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
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",
|
|
752
1157
|
retryable: false,
|
|
753
1158
|
recovery_actions: [
|
|
754
1159
|
{
|
|
755
|
-
action: "
|
|
756
|
-
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.",
|
|
757
1162
|
},
|
|
758
1163
|
],
|
|
759
1164
|
},
|
|
760
|
-
|
|
761
|
-
name: "
|
|
762
|
-
message: "
|
|
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.",
|
|
763
1168
|
category: "POLICY_VIOLATION",
|
|
764
1169
|
retryable: false,
|
|
765
1170
|
recovery_actions: [
|
|
766
1171
|
{
|
|
767
|
-
action: "
|
|
768
|
-
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).",
|
|
769
1174
|
},
|
|
770
1175
|
],
|
|
771
1176
|
},
|
|
772
|
-
|
|
773
|
-
name: "
|
|
774
|
-
message: "Session
|
|
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.",
|
|
775
1180
|
category: "INPUT_VALIDATION",
|
|
776
1181
|
retryable: false,
|
|
777
1182
|
recovery_actions: [
|
|
778
1183
|
{
|
|
779
|
-
action: "
|
|
780
|
-
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).",
|
|
781
1186
|
},
|
|
782
1187
|
],
|
|
783
1188
|
},
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
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",
|
|
787
1201
|
category: "POLICY_VIOLATION",
|
|
788
1202
|
retryable: false,
|
|
789
1203
|
recovery_actions: [
|
|
790
1204
|
{
|
|
791
|
-
action: "
|
|
792
|
-
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",
|
|
793
1207
|
},
|
|
794
1208
|
{
|
|
795
|
-
action: "
|
|
796
|
-
description: "
|
|
797
|
-
|
|
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)",
|
|
798
1215
|
},
|
|
799
1216
|
],
|
|
800
1217
|
},
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
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)",
|
|
805
1227
|
category: "SPENDING_CAP",
|
|
806
1228
|
retryable: true,
|
|
807
1229
|
retry_after_ms: 3_600_000,
|
|
808
1230
|
recovery_actions: [
|
|
809
1231
|
{
|
|
810
1232
|
action: "reduce_amount",
|
|
811
|
-
description: "Reduce the amount to fit within
|
|
1233
|
+
description: "Reduce the amount to fit within this protocol's remaining 24h rolling-window cap",
|
|
812
1234
|
},
|
|
813
1235
|
{
|
|
814
1236
|
action: "use_different_protocol",
|
|
815
|
-
description: "
|
|
1237
|
+
description: "Route through a different allowlisted protocol that has remaining 24h capacity",
|
|
816
1238
|
},
|
|
817
1239
|
{
|
|
818
1240
|
action: "wait",
|
|
819
|
-
description: "Wait for the 24h rolling window to release spent capacity",
|
|
820
|
-
},
|
|
821
|
-
],
|
|
822
|
-
},
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
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,
|
|
828
1280
|
recovery_actions: [
|
|
829
1281
|
{
|
|
830
|
-
action: "
|
|
831
|
-
description: "
|
|
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",
|
|
832
1284
|
},
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
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",
|
|
840
1316
|
retryable: false,
|
|
841
1317
|
recovery_actions: [
|
|
842
1318
|
{
|
|
843
|
-
action: "
|
|
844
|
-
description: "
|
|
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).",
|
|
845
1321
|
},
|
|
846
1322
|
],
|
|
847
1323
|
},
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
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",
|
|
852
1338
|
retryable: false,
|
|
853
1339
|
recovery_actions: [
|
|
854
1340
|
{
|
|
855
|
-
action: "
|
|
856
|
-
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).",
|
|
857
1343
|
},
|
|
858
1344
|
],
|
|
859
1345
|
},
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
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",
|
|
864
1359
|
retryable: false,
|
|
865
1360
|
recovery_actions: [
|
|
866
1361
|
{
|
|
867
|
-
action: "
|
|
868
|
-
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.",
|
|
869
1364
|
},
|
|
870
1365
|
],
|
|
871
1366
|
},
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
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.",
|
|
1378
|
+
category: "POLICY_VIOLATION",
|
|
877
1379
|
retryable: false,
|
|
878
1380
|
recovery_actions: [
|
|
879
1381
|
{
|
|
880
|
-
action: "
|
|
881
|
-
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.",
|
|
882
1384
|
},
|
|
883
1385
|
],
|
|
884
1386
|
},
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
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.",
|
|
1398
|
+
category: "POLICY_VIOLATION",
|
|
889
1399
|
retryable: false,
|
|
890
1400
|
recovery_actions: [
|
|
891
1401
|
{
|
|
892
|
-
action: "
|
|
893
|
-
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.",
|
|
894
1404
|
},
|
|
895
1405
|
],
|
|
896
1406
|
},
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
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",
|
|
901
1423
|
retryable: false,
|
|
902
1424
|
recovery_actions: [
|
|
903
1425
|
{
|
|
904
|
-
action: "
|
|
905
|
-
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.",
|
|
906
1428
|
},
|
|
907
1429
|
],
|
|
908
1430
|
},
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
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.",
|
|
912
1436
|
category: "POLICY_VIOLATION",
|
|
913
1437
|
retryable: false,
|
|
914
1438
|
recovery_actions: [
|
|
915
1439
|
{
|
|
916
|
-
action: "
|
|
917
|
-
description: "
|
|
1440
|
+
action: "cancel_ownership_transfer",
|
|
1441
|
+
description: "Call cancel_ownership_transfer to release the pending PDA before queueing a new transfer.",
|
|
918
1442
|
},
|
|
919
1443
|
],
|
|
920
1444
|
},
|
|
921
|
-
|
|
922
|
-
name: "
|
|
923
|
-
message: "
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
retryable: false,
|
|
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,
|
|
927
1450
|
recovery_actions: [
|
|
928
1451
|
{
|
|
929
|
-
action: "
|
|
930
|
-
description: "
|
|
931
|
-
"exceeded the authorized delegation amount (fees + DeFi spend). Freeze the vault, " +
|
|
932
|
-
"investigate the DeFi program, and consider removing it from the protocol allowlist.",
|
|
933
|
-
},
|
|
934
|
-
{
|
|
935
|
-
action: "freeze_vault",
|
|
936
|
-
description: "Immediately freeze the vault to prevent further transactions until the cause is identified.",
|
|
1452
|
+
action: "wait_timelock",
|
|
1453
|
+
description: "Wait for the timelock window to elapse. The owner can cancel during this window to abort the transfer.",
|
|
937
1454
|
},
|
|
938
1455
|
],
|
|
939
1456
|
},
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
message: "Timelock duration is below the minimum (1800 seconds / 30 minutes).",
|
|
1457
|
+
6096: {
|
|
1458
|
+
name: "ErrInvalidFreezeReason",
|
|
1459
|
+
message: "Invalid freeze_reason byte (must be 0=Manual, 1=AutoRevoke, or 2=EmergencyBoard).",
|
|
944
1460
|
category: "INPUT_VALIDATION",
|
|
945
1461
|
retryable: false,
|
|
946
1462
|
recovery_actions: [
|
|
947
1463
|
{
|
|
948
|
-
action: "
|
|
949
|
-
description: "
|
|
1464
|
+
action: "fix_freeze_reason",
|
|
1465
|
+
description: "Re-call freeze_vault with a valid FreezeReason discriminant.",
|
|
950
1466
|
},
|
|
951
1467
|
],
|
|
952
1468
|
},
|
|
953
|
-
|
|
954
|
-
name: "
|
|
955
|
-
message: "
|
|
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.",
|
|
956
1472
|
category: "TRANSIENT",
|
|
957
1473
|
retryable: true,
|
|
958
|
-
retry_after_ms:
|
|
1474
|
+
retry_after_ms: 300_000,
|
|
959
1475
|
recovery_actions: [
|
|
960
1476
|
{
|
|
961
|
-
action: "
|
|
962
|
-
description: "
|
|
1477
|
+
action: "wait_cooldown",
|
|
1478
|
+
description: "Wait for the 5-minute observation window to elapse before reactivating.",
|
|
963
1479
|
},
|
|
964
1480
|
],
|
|
965
1481
|
},
|
|
966
|
-
|
|
967
|
-
name: "
|
|
968
|
-
message: "
|
|
969
|
-
category: "
|
|
1482
|
+
6098: {
|
|
1483
|
+
name: "ErrInvalidOwnershipTarget",
|
|
1484
|
+
message: "new_owner cannot be a system/program/sysvar address (would permanently brick the vault).",
|
|
1485
|
+
category: "INPUT_VALIDATION",
|
|
970
1486
|
retryable: false,
|
|
971
1487
|
recovery_actions: [
|
|
972
1488
|
{
|
|
973
|
-
action: "
|
|
974
|
-
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.",
|
|
975
1491
|
},
|
|
976
1492
|
],
|
|
977
1493
|
},
|
|
978
|
-
|
|
979
|
-
name: "
|
|
980
|
-
message: "
|
|
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",
|
|
1498
|
+
retryable: false,
|
|
1499
|
+
recovery_actions: [
|
|
1500
|
+
{
|
|
1501
|
+
action: "split_revoke_batch",
|
|
1502
|
+
description: "Split the (session_pda, token_account) pairs across multiple freeze_internal calls.",
|
|
1503
|
+
},
|
|
1504
|
+
],
|
|
1505
|
+
},
|
|
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.",
|
|
981
1513
|
category: "RESOURCE_NOT_FOUND",
|
|
982
1514
|
retryable: false,
|
|
983
1515
|
recovery_actions: [
|
|
984
1516
|
{
|
|
985
|
-
action: "
|
|
986
|
-
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.",
|
|
987
1519
|
},
|
|
988
1520
|
],
|
|
989
1521
|
},
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
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.",
|
|
1530
|
+
category: "INPUT_VALIDATION",
|
|
1531
|
+
retryable: false,
|
|
996
1532
|
recovery_actions: [
|
|
997
1533
|
{
|
|
998
|
-
action: "
|
|
999
|
-
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.",
|
|
1000
1536
|
},
|
|
1001
1537
|
],
|
|
1002
1538
|
},
|
|
1003
|
-
//
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
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.",
|
|
1007
1549
|
category: "POLICY_VIOLATION",
|
|
1008
1550
|
retryable: false,
|
|
1009
1551
|
recovery_actions: [
|
|
1010
1552
|
{
|
|
1011
|
-
action: "
|
|
1012
|
-
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.",
|
|
1013
1555
|
},
|
|
1014
1556
|
],
|
|
1015
1557
|
},
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
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",
|
|
1020
1566
|
retryable: false,
|
|
1021
1567
|
recovery_actions: [
|
|
1022
1568
|
{
|
|
1023
|
-
action: "
|
|
1024
|
-
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.",
|
|
1025
1571
|
},
|
|
1026
1572
|
],
|
|
1027
1573
|
},
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
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",
|
|
1032
1584
|
retryable: false,
|
|
1033
1585
|
recovery_actions: [
|
|
1034
1586
|
{
|
|
1035
|
-
action: "
|
|
1036
|
-
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.",
|
|
1037
1589
|
},
|
|
1038
1590
|
],
|
|
1039
1591
|
},
|
|
1040
|
-
|
|
1041
|
-
name: "
|
|
1042
|
-
message: "
|
|
1043
|
-
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",
|
|
1044
1596
|
retryable: false,
|
|
1045
1597
|
recovery_actions: [
|
|
1046
1598
|
{
|
|
1047
|
-
action: "
|
|
1048
|
-
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.",
|
|
1049
1601
|
},
|
|
1050
1602
|
],
|
|
1051
1603
|
},
|
|
1052
|
-
|
|
1053
|
-
name: "
|
|
1054
|
-
message: "
|
|
1055
|
-
category: "
|
|
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.",
|
|
1607
|
+
category: "POLICY_VIOLATION",
|
|
1056
1608
|
retryable: false,
|
|
1057
1609
|
recovery_actions: [
|
|
1058
1610
|
{
|
|
1059
|
-
action: "
|
|
1060
|
-
description: "
|
|
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.",
|
|
1061
1613
|
},
|
|
1062
1614
|
],
|
|
1063
1615
|
},
|
|
1064
|
-
|
|
1065
|
-
name: "
|
|
1066
|
-
message: "
|
|
1067
|
-
category: "
|
|
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).",
|
|
1619
|
+
category: "POLICY_VIOLATION",
|
|
1068
1620
|
retryable: false,
|
|
1069
1621
|
recovery_actions: [
|
|
1070
1622
|
{
|
|
1071
|
-
action: "
|
|
1072
|
-
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.",
|
|
1073
1625
|
},
|
|
1074
1626
|
],
|
|
1075
1627
|
},
|
|
1076
|
-
|
|
1077
|
-
name: "
|
|
1078
|
-
message: "
|
|
1079
|
-
category: "
|
|
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).",
|
|
1631
|
+
category: "POLICY_VIOLATION",
|
|
1080
1632
|
retryable: false,
|
|
1081
1633
|
recovery_actions: [
|
|
1082
1634
|
{
|
|
1083
|
-
action: "
|
|
1084
|
-
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.",
|
|
1085
1637
|
},
|
|
1086
1638
|
],
|
|
1087
1639
|
},
|
|
1088
|
-
|
|
1089
|
-
name: "
|
|
1090
|
-
message: "
|
|
1091
|
-
category: "
|
|
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).",
|
|
1643
|
+
category: "POLICY_VIOLATION",
|
|
1092
1644
|
retryable: false,
|
|
1093
1645
|
recovery_actions: [
|
|
1094
1646
|
{
|
|
1095
|
-
action: "
|
|
1096
|
-
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.",
|
|
1097
1649
|
},
|
|
1098
1650
|
],
|
|
1099
1651
|
},
|
|
1100
|
-
|
|
1101
|
-
name: "
|
|
1102
|
-
message: "
|
|
1103
|
-
category: "
|
|
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).",
|
|
1655
|
+
category: "POLICY_VIOLATION",
|
|
1104
1656
|
retryable: false,
|
|
1105
1657
|
recovery_actions: [
|
|
1106
1658
|
{
|
|
1107
|
-
action: "
|
|
1108
|
-
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.",
|
|
1109
1661
|
},
|
|
1110
1662
|
],
|
|
1111
1663
|
},
|
|
@@ -1609,7 +2161,7 @@ const SDK_ERRORS = {
|
|
|
1609
2161
|
* Convert any error into a structured AgentError.
|
|
1610
2162
|
*
|
|
1611
2163
|
* Handles:
|
|
1612
|
-
* - On-chain Anchor errors (code 6000-
|
|
2164
|
+
* - On-chain Anchor errors (code 6000-6102)
|
|
1613
2165
|
* - SDK errors (code 7000-7033)
|
|
1614
2166
|
* - Network/RPC errors (from message patterns)
|
|
1615
2167
|
* - Unknown errors (wrapped as FATAL)
|
|
@@ -1910,8 +2462,11 @@ function extractErrorCode(error) {
|
|
|
1910
2462
|
if (!error || typeof error !== "object")
|
|
1911
2463
|
return null;
|
|
1912
2464
|
const e = error;
|
|
1913
|
-
// Direct code property
|
|
1914
|
-
|
|
2465
|
+
// Direct code property — uses SIGIL_ON_CHAIN_ERROR_{MIN,MAX} constants
|
|
2466
|
+
// defined at top of file as single source of truth.
|
|
2467
|
+
if (typeof e.code === "number" &&
|
|
2468
|
+
e.code >= SIGIL_ON_CHAIN_ERROR_MIN &&
|
|
2469
|
+
e.code <= SIGIL_ON_CHAIN_ERROR_MAX)
|
|
1915
2470
|
return e.code;
|
|
1916
2471
|
// Anchor error structure
|
|
1917
2472
|
if (e.error && typeof e.error === "object") {
|
|
@@ -1927,7 +2482,7 @@ function extractErrorCode(error) {
|
|
|
1927
2482
|
const match = e.message.match(/custom program error: 0x([0-9a-fA-F]+)/);
|
|
1928
2483
|
if (match) {
|
|
1929
2484
|
const code = parseInt(match[1], 16);
|
|
1930
|
-
if (code >=
|
|
2485
|
+
if (code >= SIGIL_ON_CHAIN_ERROR_MIN && code <= SIGIL_ON_CHAIN_ERROR_MAX)
|
|
1931
2486
|
return code;
|
|
1932
2487
|
}
|
|
1933
2488
|
}
|
|
@@ -2084,17 +2639,6 @@ const SDK_ERROR_PATTERNS = [
|
|
|
2084
2639
|
},
|
|
2085
2640
|
],
|
|
2086
2641
|
},
|
|
2087
|
-
{
|
|
2088
|
-
pattern: /Escrow action/,
|
|
2089
|
-
category: "INPUT_VALIDATION",
|
|
2090
|
-
retryable: false,
|
|
2091
|
-
recovery_actions: [
|
|
2092
|
-
{
|
|
2093
|
-
action: "use_escrow_api",
|
|
2094
|
-
description: "Use createEscrow/settleEscrow/refundEscrow instead of wrap().",
|
|
2095
|
-
},
|
|
2096
|
-
],
|
|
2097
|
-
},
|
|
2098
2642
|
];
|
|
2099
2643
|
// ─── SigilSdkError ──────────────────────────────────────────────────────────
|
|
2100
2644
|
/**
|
|
@@ -2144,11 +2688,37 @@ export class SigilSdkError extends Error {
|
|
|
2144
2688
|
* Returns a SigilSdkError (extends Error) so instanceof Error checks still work.
|
|
2145
2689
|
*
|
|
2146
2690
|
* Processing order:
|
|
2147
|
-
* 1. Try on-chain error extraction via toAgentError() (numeric codes 6000-
|
|
2691
|
+
* 1. Try on-chain error extraction via toAgentError() (numeric codes 6000-6102)
|
|
2148
2692
|
* 2. Pattern-match SDK error messages (11 patterns from seal.ts throw sites)
|
|
2149
2693
|
* 3. Fallback to UNKNOWN/FATAL
|
|
2150
2694
|
*/
|
|
2151
2695
|
export function toSigilAgentError(err) {
|
|
2696
|
+
// Phase 9 Batch M §RP CRIT-1 fix: preserve SigilSdkDomainError and
|
|
2697
|
+
// SigilRpcError instances unmodified. These are the canonical
|
|
2698
|
+
// SDK-domain-typed errors carrying their own `.code`, structured
|
|
2699
|
+
// `.context`, and rich `.message`. Funneling them through the
|
|
2700
|
+
// pattern-matcher + UNKNOWN/FATAL fallback below silently strips
|
|
2701
|
+
// the context the throw site built (vault address, docs URL,
|
|
2702
|
+
// opt-in/opt-out snippets, network identifier, etc.).
|
|
2703
|
+
//
|
|
2704
|
+
// Wrap the domain error in a SigilSdkError that mirrors its code
|
|
2705
|
+
// + context so downstream consumers narrowing on either
|
|
2706
|
+
// `err instanceof SigilSdkDomainError` (the original throw) OR
|
|
2707
|
+
// `err.code === SIGIL_ERROR__SDK__MAINNET_CONFIRMATION_REQUIRED`
|
|
2708
|
+
// (the SigilSdkError surface) both work.
|
|
2709
|
+
if (err instanceof Error &&
|
|
2710
|
+
typeof err.code === "string" &&
|
|
2711
|
+
err.code.startsWith("SIGIL_ERROR__")) {
|
|
2712
|
+
const sigilErr = err;
|
|
2713
|
+
return new SigilSdkError({
|
|
2714
|
+
code: sigilErr.code,
|
|
2715
|
+
message: sigilErr.message,
|
|
2716
|
+
category: "FATAL",
|
|
2717
|
+
retryable: false,
|
|
2718
|
+
recovery_actions: [],
|
|
2719
|
+
context: sigilErr.context ?? {},
|
|
2720
|
+
});
|
|
2721
|
+
}
|
|
2152
2722
|
// Try on-chain error extraction first
|
|
2153
2723
|
const onChain = toAgentError(err);
|
|
2154
2724
|
if (onChain.code !== "UNKNOWN")
|