@usesigil/kit 0.13.0 → 0.16.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/dist/advanced-analytics.d.ts +3 -1
- package/dist/advanced-analytics.d.ts.map +1 -1
- package/dist/advanced-analytics.js +4 -6
- package/dist/advanced-analytics.js.map +1 -1
- package/dist/agent-bootstrap.d.ts +118 -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 +3 -3
- package/dist/agent-errors.d.ts.map +1 -1
- package/dist/agent-errors.js +230 -206
- package/dist/agent-errors.js.map +1 -1
- 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/constraints/index.d.ts +23 -0
- package/dist/constraints/index.d.ts.map +1 -0
- package/dist/constraints/index.js +24 -0
- package/dist/constraints/index.js.map +1 -0
- package/dist/create-vault.d.ts +10 -2
- package/dist/create-vault.d.ts.map +1 -1
- package/dist/create-vault.js +10 -3
- package/dist/create-vault.js.map +1 -1
- package/dist/dashboard/constraint-builders.d.ts +82 -0
- package/dist/dashboard/constraint-builders.d.ts.map +1 -0
- package/dist/dashboard/constraint-builders.js +204 -0
- package/dist/dashboard/constraint-builders.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 +76 -0
- 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 -5
- package/dist/dashboard/from-json.js.map +1 -1
- package/dist/dashboard/index.d.ts +31 -10
- package/dist/dashboard/index.d.ts.map +1 -1
- package/dist/dashboard/index.js +40 -10
- package/dist/dashboard/index.js.map +1 -1
- package/dist/dashboard/mutations.d.ts +60 -3
- package/dist/dashboard/mutations.d.ts.map +1 -1
- package/dist/dashboard/mutations.js +129 -32
- 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 +191 -0
- package/dist/dashboard/post-assertion-validation.js.map +1 -0
- package/dist/dashboard/reads.d.ts +93 -1
- package/dist/dashboard/reads.d.ts.map +1 -1
- package/dist/dashboard/reads.js +244 -40
- package/dist/dashboard/reads.js.map +1 -1
- package/dist/dashboard/types.d.ts +149 -21
- package/dist/dashboard/types.d.ts.map +1 -1
- package/dist/errors/codes.js +1 -1
- package/dist/event-analytics.d.ts +1 -3
- package/dist/event-analytics.d.ts.map +1 -1
- package/dist/event-analytics.js +4 -9
- package/dist/event-analytics.js.map +1 -1
- package/dist/events.js +2 -2
- package/dist/events.js.map +1 -1
- package/dist/generated/accounts/agentVault.d.ts +0 -20
- package/dist/generated/accounts/agentVault.d.ts.map +1 -1
- package/dist/generated/accounts/agentVault.js +0 -2
- package/dist/generated/accounts/agentVault.js.map +1 -1
- package/dist/generated/accounts/pendingAgentPermissionsUpdate.d.ts +12 -0
- package/dist/generated/accounts/pendingAgentPermissionsUpdate.d.ts.map +1 -1
- package/dist/generated/accounts/pendingAgentPermissionsUpdate.js +3 -1
- package/dist/generated/accounts/pendingAgentPermissionsUpdate.js.map +1 -1
- package/dist/generated/accounts/pendingCloseConstraints.d.ts +12 -0
- package/dist/generated/accounts/pendingCloseConstraints.d.ts.map +1 -1
- package/dist/generated/accounts/pendingCloseConstraints.js +4 -2
- package/dist/generated/accounts/pendingCloseConstraints.js.map +1 -1
- package/dist/generated/accounts/pendingConstraintsUpdate.d.ts +14 -0
- package/dist/generated/accounts/pendingConstraintsUpdate.d.ts.map +1 -1
- package/dist/generated/accounts/pendingConstraintsUpdate.js +4 -2
- package/dist/generated/accounts/pendingConstraintsUpdate.js.map +1 -1
- package/dist/generated/accounts/pendingPolicyUpdate.d.ts +24 -8
- package/dist/generated/accounts/pendingPolicyUpdate.d.ts.map +1 -1
- package/dist/generated/accounts/pendingPolicyUpdate.js +6 -8
- package/dist/generated/accounts/pendingPolicyUpdate.js.map +1 -1
- package/dist/generated/accounts/policyConfig.d.ts +28 -18
- package/dist/generated/accounts/policyConfig.d.ts.map +1 -1
- package/dist/generated/accounts/policyConfig.js +4 -8
- package/dist/generated/accounts/policyConfig.js.map +1 -1
- package/dist/generated/accounts/sessionAuthority.d.ts +18 -8
- package/dist/generated/accounts/sessionAuthority.d.ts.map +1 -1
- package/dist/generated/accounts/sessionAuthority.js +4 -6
- package/dist/generated/accounts/sessionAuthority.js.map +1 -1
- package/dist/generated/errors/sigil.d.ts +95 -89
- package/dist/generated/errors/sigil.d.ts.map +1 -1
- package/dist/generated/errors/sigil.js +107 -98
- package/dist/generated/errors/sigil.js.map +1 -1
- package/dist/generated/event-discriminators.js +1 -1
- package/dist/generated/event-discriminators.js.map +1 -1
- package/dist/generated/instructions/cleanupOrphanConstraintsPda.d.ts +67 -0
- package/dist/generated/instructions/cleanupOrphanConstraintsPda.d.ts.map +1 -0
- package/dist/generated/instructions/cleanupOrphanConstraintsPda.js +120 -0
- package/dist/generated/instructions/cleanupOrphanConstraintsPda.js.map +1 -0
- package/dist/generated/instructions/freezeVault.d.ts +8 -5
- package/dist/generated/instructions/freezeVault.d.ts.map +1 -1
- package/dist/generated/instructions/freezeVault.js +14 -3
- package/dist/generated/instructions/freezeVault.js.map +1 -1
- package/dist/generated/instructions/index.d.ts +1 -1
- package/dist/generated/instructions/index.d.ts.map +1 -1
- package/dist/generated/instructions/index.js +1 -1
- package/dist/generated/instructions/index.js.map +1 -1
- package/dist/generated/instructions/initializeVault.d.ts +0 -8
- package/dist/generated/instructions/initializeVault.d.ts.map +1 -1
- package/dist/generated/instructions/initializeVault.js +0 -4
- package/dist/generated/instructions/initializeVault.js.map +1 -1
- package/dist/generated/instructions/queuePolicyUpdate.d.ts +8 -16
- package/dist/generated/instructions/queuePolicyUpdate.d.ts.map +1 -1
- package/dist/generated/instructions/queuePolicyUpdate.js +4 -8
- package/dist/generated/instructions/queuePolicyUpdate.js.map +1 -1
- package/dist/generated/programs/sigil.d.ts +26 -26
- package/dist/generated/programs/sigil.d.ts.map +1 -1
- package/dist/generated/programs/sigil.js +34 -34
- package/dist/generated/programs/sigil.js.map +1 -1
- package/dist/generated/types/accountConstraint.d.ts +16 -1
- package/dist/generated/types/accountConstraint.d.ts.map +1 -1
- package/dist/generated/types/accountConstraint.js +2 -0
- package/dist/generated/types/accountConstraint.js.map +1 -1
- package/dist/generated/types/accountConstraintZC.d.ts +7 -0
- package/dist/generated/types/accountConstraintZC.d.ts.map +1 -1
- package/dist/generated/types/accountConstraintZC.js +4 -2
- package/dist/generated/types/accountConstraintZC.js.map +1 -1
- package/dist/generated/types/constraintEntry.d.ts +0 -8
- package/dist/generated/types/constraintEntry.d.ts.map +1 -1
- package/dist/generated/types/constraintEntry.js +1 -5
- package/dist/generated/types/constraintEntry.js.map +1 -1
- package/dist/generated/types/constraintEntryZC.d.ts +22 -27
- package/dist/generated/types/constraintEntryZC.d.ts.map +1 -1
- package/dist/generated/types/constraintEntryZC.js +4 -6
- package/dist/generated/types/constraintEntryZC.js.map +1 -1
- package/dist/generated/types/index.d.ts +1 -1
- package/dist/generated/types/index.d.ts.map +1 -1
- package/dist/generated/types/index.js +1 -1
- package/dist/generated/types/index.js.map +1 -1
- package/dist/generated/types/orphanConstraintsPdaCleaned.d.ts +22 -0
- package/dist/generated/types/orphanConstraintsPdaCleaned.d.ts.map +1 -0
- package/dist/generated/types/{positionsSynced.js → orphanConstraintsPdaCleaned.js} +8 -10
- package/dist/generated/types/orphanConstraintsPdaCleaned.js.map +1 -0
- 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 +1 -3
- package/dist/generated/types/sessionFinalized.js.map +1 -1
- package/dist/generated/types/vaultFrozen.d.ts +12 -0
- package/dist/generated/types/vaultFrozen.d.ts.map +1 -1
- package/dist/generated/types/vaultFrozen.js +3 -1
- package/dist/generated/types/vaultFrozen.js.map +1 -1
- package/dist/index.d.ts +13 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +23 -2
- package/dist/index.js.map +1 -1
- package/dist/inscribe.d.ts +0 -8
- package/dist/inscribe.d.ts.map +1 -1
- package/dist/inscribe.js +0 -2
- package/dist/inscribe.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/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/post-assertions/cross-field-lte.d.ts +134 -0
- package/dist/post-assertions/cross-field-lte.d.ts.map +1 -0
- package/dist/post-assertions/cross-field-lte.js +129 -0
- package/dist/post-assertions/cross-field-lte.js.map +1 -0
- package/dist/post-assertions/index.d.ts +28 -0
- package/dist/post-assertions/index.d.ts.map +1 -0
- package/dist/post-assertions/index.js +28 -0
- package/dist/post-assertions/index.js.map +1 -0
- package/dist/post-assertions/presets/flash-trade.d.ts +139 -0
- package/dist/post-assertions/presets/flash-trade.d.ts.map +1 -0
- package/dist/post-assertions/presets/flash-trade.js +154 -0
- package/dist/post-assertions/presets/flash-trade.js.map +1 -0
- package/dist/presets.d.ts +1 -13
- package/dist/presets.d.ts.map +1 -1
- package/dist/presets.js +0 -10
- 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 +477 -0
- package/dist/preview-create-vault.js.map +1 -0
- package/dist/protocol-registry/annotations/drift.json +7 -0
- package/dist/protocol-registry/annotations/flash-trade.json +7 -0
- package/dist/protocol-registry/annotations/jupiter-borrow.json +7 -0
- package/dist/protocol-registry/annotations/jupiter-earn.json +7 -0
- package/dist/protocol-registry/annotations/jupiter-lend.json +7 -0
- package/dist/protocol-registry/annotations/jupiter.json +7 -0
- package/dist/protocol-registry/annotations/kamino.json +7 -0
- package/dist/protocol-registry/index.d.ts +45 -0
- package/dist/protocol-registry/index.d.ts.map +1 -0
- package/dist/protocol-registry/index.js +76 -0
- package/dist/protocol-registry/index.js.map +1 -0
- package/dist/protocol-tier.d.ts +157 -0
- package/dist/protocol-tier.d.ts.map +1 -0
- package/dist/protocol-tier.js +104 -0
- package/dist/protocol-tier.js.map +1 -0
- package/dist/seal.d.ts.map +1 -1
- package/dist/seal.js +30 -12
- package/dist/seal.js.map +1 -1
- package/dist/sigil.d.ts +0 -8
- package/dist/sigil.d.ts.map +1 -1
- package/dist/simulation.d.ts.map +1 -1
- package/dist/simulation.js +131 -82
- package/dist/simulation.js.map +1 -1
- package/dist/testing/devnet.d.ts.map +1 -1
- package/dist/testing/devnet.js +0 -2
- 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 +188 -0
- package/dist/testing/errors/names.generated.d.ts.map +1 -0
- package/dist/testing/errors/names.generated.js +183 -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 +8 -0
- package/dist/testing/mock-rpc.d.ts.map +1 -1
- package/dist/testing/mock-rpc.js +14 -0
- package/dist/testing/mock-rpc.js.map +1 -1
- package/dist/testing/mock-state.d.ts +0 -2
- package/dist/testing/mock-state.d.ts.map +1 -1
- package/dist/testing/mock-state.js +2 -5
- package/dist/testing/mock-state.js.map +1 -1
- package/dist/types.d.ts +1 -3
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +5 -9
- package/dist/types.js.map +1 -1
- package/dist/vault-analytics.d.ts +0 -1
- package/dist/vault-analytics.d.ts.map +1 -1
- package/dist/vault-analytics.js +0 -1
- package/dist/vault-analytics.js.map +1 -1
- package/package.json +15 -3
- package/dist/generated/instructions/syncPositions.d.ts +0 -44
- package/dist/generated/instructions/syncPositions.d.ts.map +0 -1
- package/dist/generated/instructions/syncPositions.js +0 -72
- package/dist/generated/instructions/syncPositions.js.map +0 -1
- package/dist/generated/types/positionsSynced.d.ts +0 -24
- package/dist/generated/types/positionsSynced.d.ts.map +0 -1
- package/dist/generated/types/positionsSynced.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,7 +5,7 @@
|
|
|
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
|
|
8
|
+
* Maps all 88 on-chain error codes (6000-6087) plus 34 SDK
|
|
9
9
|
* error codes (7000-7033) to AgentError with machine-readable metadata.
|
|
10
10
|
*
|
|
11
11
|
* Zero dependency on @solana/web3.js or @coral-xyz/anchor.
|
|
@@ -130,49 +130,6 @@ export const ON_CHAIN_ERROR_MAP = {
|
|
|
130
130
|
],
|
|
131
131
|
},
|
|
132
132
|
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
|
-
name: "TooManyPositions",
|
|
151
|
-
message: "Maximum concurrent open positions reached",
|
|
152
|
-
category: "RESOURCE_NOT_FOUND",
|
|
153
|
-
retryable: false,
|
|
154
|
-
recovery_actions: [
|
|
155
|
-
{
|
|
156
|
-
action: "close_position",
|
|
157
|
-
description: "Close an existing position before opening a new one",
|
|
158
|
-
tool: "sigil_close_position",
|
|
159
|
-
},
|
|
160
|
-
],
|
|
161
|
-
},
|
|
162
|
-
6009: {
|
|
163
|
-
name: "PositionOpeningDisallowed",
|
|
164
|
-
message: "Vault policy does not allow opening new positions",
|
|
165
|
-
category: "POLICY_VIOLATION",
|
|
166
|
-
retryable: false,
|
|
167
|
-
recovery_actions: [
|
|
168
|
-
{
|
|
169
|
-
action: "check_policy",
|
|
170
|
-
description: "Verify canOpenPositions is enabled in vault policy",
|
|
171
|
-
tool: "sigil_check_vault",
|
|
172
|
-
},
|
|
173
|
-
],
|
|
174
|
-
},
|
|
175
|
-
6010: {
|
|
176
133
|
name: "SessionNotAuthorized",
|
|
177
134
|
message: "Session authority not authorized for this action",
|
|
178
135
|
category: "PERMISSION",
|
|
@@ -184,7 +141,7 @@ export const ON_CHAIN_ERROR_MAP = {
|
|
|
184
141
|
},
|
|
185
142
|
],
|
|
186
143
|
},
|
|
187
|
-
|
|
144
|
+
6008: {
|
|
188
145
|
name: "InvalidSession",
|
|
189
146
|
message: "Session does not belong to this vault or is invalid",
|
|
190
147
|
category: "PERMISSION",
|
|
@@ -196,20 +153,7 @@ export const ON_CHAIN_ERROR_MAP = {
|
|
|
196
153
|
},
|
|
197
154
|
],
|
|
198
155
|
},
|
|
199
|
-
|
|
200
|
-
name: "OpenPositionsExist",
|
|
201
|
-
message: "Vault has open positions and cannot be closed",
|
|
202
|
-
category: "RESOURCE_NOT_FOUND",
|
|
203
|
-
retryable: false,
|
|
204
|
-
recovery_actions: [
|
|
205
|
-
{
|
|
206
|
-
action: "close_positions",
|
|
207
|
-
description: "Close all open positions before closing the vault",
|
|
208
|
-
tool: "sigil_close_position",
|
|
209
|
-
},
|
|
210
|
-
],
|
|
211
|
-
},
|
|
212
|
-
6013: {
|
|
156
|
+
6009: {
|
|
213
157
|
name: "TooManyAllowedProtocols",
|
|
214
158
|
message: "Policy configuration has too many allowed protocols (max 10)",
|
|
215
159
|
category: "INPUT_VALIDATION",
|
|
@@ -221,7 +165,7 @@ export const ON_CHAIN_ERROR_MAP = {
|
|
|
221
165
|
},
|
|
222
166
|
],
|
|
223
167
|
},
|
|
224
|
-
|
|
168
|
+
6010: {
|
|
225
169
|
name: "AgentAlreadyRegistered",
|
|
226
170
|
message: "Agent is already registered on this vault",
|
|
227
171
|
category: "INPUT_VALIDATION",
|
|
@@ -234,7 +178,7 @@ export const ON_CHAIN_ERROR_MAP = {
|
|
|
234
178
|
},
|
|
235
179
|
],
|
|
236
180
|
},
|
|
237
|
-
|
|
181
|
+
6011: {
|
|
238
182
|
name: "NoAgentRegistered",
|
|
239
183
|
message: "No agent registered on this vault",
|
|
240
184
|
category: "RESOURCE_NOT_FOUND",
|
|
@@ -247,7 +191,7 @@ export const ON_CHAIN_ERROR_MAP = {
|
|
|
247
191
|
},
|
|
248
192
|
],
|
|
249
193
|
},
|
|
250
|
-
|
|
194
|
+
6012: {
|
|
251
195
|
name: "VaultNotFrozen",
|
|
252
196
|
message: "Vault is not frozen (expected frozen for reactivation)",
|
|
253
197
|
category: "INPUT_VALIDATION",
|
|
@@ -260,7 +204,7 @@ export const ON_CHAIN_ERROR_MAP = {
|
|
|
260
204
|
},
|
|
261
205
|
],
|
|
262
206
|
},
|
|
263
|
-
|
|
207
|
+
6013: {
|
|
264
208
|
name: "VaultAlreadyClosed",
|
|
265
209
|
message: "Vault is permanently closed",
|
|
266
210
|
category: "INPUT_VALIDATION",
|
|
@@ -273,7 +217,7 @@ export const ON_CHAIN_ERROR_MAP = {
|
|
|
273
217
|
},
|
|
274
218
|
],
|
|
275
219
|
},
|
|
276
|
-
|
|
220
|
+
6014: {
|
|
277
221
|
name: "InsufficientBalance",
|
|
278
222
|
message: "Insufficient vault balance for this operation",
|
|
279
223
|
category: "SPENDING_CAP",
|
|
@@ -294,7 +238,7 @@ export const ON_CHAIN_ERROR_MAP = {
|
|
|
294
238
|
},
|
|
295
239
|
],
|
|
296
240
|
},
|
|
297
|
-
|
|
241
|
+
6015: {
|
|
298
242
|
name: "DeveloperFeeTooHigh",
|
|
299
243
|
message: "Developer fee rate exceeds maximum (500 / 1,000,000 = 5 BPS)",
|
|
300
244
|
category: "INPUT_VALIDATION",
|
|
@@ -306,7 +250,7 @@ export const ON_CHAIN_ERROR_MAP = {
|
|
|
306
250
|
},
|
|
307
251
|
],
|
|
308
252
|
},
|
|
309
|
-
|
|
253
|
+
6016: {
|
|
310
254
|
name: "InvalidFeeDestination",
|
|
311
255
|
message: "Fee destination account is invalid",
|
|
312
256
|
category: "INPUT_VALIDATION",
|
|
@@ -318,7 +262,7 @@ export const ON_CHAIN_ERROR_MAP = {
|
|
|
318
262
|
},
|
|
319
263
|
],
|
|
320
264
|
},
|
|
321
|
-
|
|
265
|
+
6017: {
|
|
322
266
|
name: "InvalidProtocolTreasury",
|
|
323
267
|
message: "Protocol treasury account does not match expected address",
|
|
324
268
|
category: "INPUT_VALIDATION",
|
|
@@ -330,7 +274,7 @@ export const ON_CHAIN_ERROR_MAP = {
|
|
|
330
274
|
},
|
|
331
275
|
],
|
|
332
276
|
},
|
|
333
|
-
|
|
277
|
+
6018: {
|
|
334
278
|
name: "InvalidAgentKey",
|
|
335
279
|
message: "Agent cannot be the zero address",
|
|
336
280
|
category: "INPUT_VALIDATION",
|
|
@@ -342,7 +286,7 @@ export const ON_CHAIN_ERROR_MAP = {
|
|
|
342
286
|
},
|
|
343
287
|
],
|
|
344
288
|
},
|
|
345
|
-
|
|
289
|
+
6019: {
|
|
346
290
|
name: "AgentIsOwner",
|
|
347
291
|
message: "Agent cannot be the vault owner",
|
|
348
292
|
category: "INPUT_VALIDATION",
|
|
@@ -354,7 +298,7 @@ export const ON_CHAIN_ERROR_MAP = {
|
|
|
354
298
|
},
|
|
355
299
|
],
|
|
356
300
|
},
|
|
357
|
-
|
|
301
|
+
6020: {
|
|
358
302
|
name: "Overflow",
|
|
359
303
|
message: "Arithmetic overflow in on-chain computation",
|
|
360
304
|
category: "FATAL",
|
|
@@ -366,7 +310,7 @@ export const ON_CHAIN_ERROR_MAP = {
|
|
|
366
310
|
},
|
|
367
311
|
],
|
|
368
312
|
},
|
|
369
|
-
|
|
313
|
+
6021: {
|
|
370
314
|
name: "InvalidTokenAccount",
|
|
371
315
|
message: "Token account does not belong to vault or has wrong mint",
|
|
372
316
|
category: "INPUT_VALIDATION",
|
|
@@ -379,7 +323,7 @@ export const ON_CHAIN_ERROR_MAP = {
|
|
|
379
323
|
],
|
|
380
324
|
},
|
|
381
325
|
// --- Timelock + Destination errors ---
|
|
382
|
-
|
|
326
|
+
6022: {
|
|
383
327
|
name: "TimelockNotExpired",
|
|
384
328
|
message: "Timelock period has not expired yet",
|
|
385
329
|
category: "POLICY_VIOLATION",
|
|
@@ -392,7 +336,7 @@ export const ON_CHAIN_ERROR_MAP = {
|
|
|
392
336
|
},
|
|
393
337
|
],
|
|
394
338
|
},
|
|
395
|
-
|
|
339
|
+
6023: {
|
|
396
340
|
name: "NoTimelockConfigured",
|
|
397
341
|
message: "No timelock configured on this vault",
|
|
398
342
|
category: "INPUT_VALIDATION",
|
|
@@ -404,7 +348,7 @@ export const ON_CHAIN_ERROR_MAP = {
|
|
|
404
348
|
},
|
|
405
349
|
],
|
|
406
350
|
},
|
|
407
|
-
|
|
351
|
+
6024: {
|
|
408
352
|
name: "DestinationNotAllowed",
|
|
409
353
|
message: "Destination address not in vault's allowed destinations list",
|
|
410
354
|
category: "POLICY_VIOLATION",
|
|
@@ -421,7 +365,7 @@ export const ON_CHAIN_ERROR_MAP = {
|
|
|
421
365
|
},
|
|
422
366
|
],
|
|
423
367
|
},
|
|
424
|
-
|
|
368
|
+
6025: {
|
|
425
369
|
name: "TooManyDestinations",
|
|
426
370
|
message: "Too many destinations in allowlist (max 10)",
|
|
427
371
|
category: "INPUT_VALIDATION",
|
|
@@ -433,7 +377,7 @@ export const ON_CHAIN_ERROR_MAP = {
|
|
|
433
377
|
},
|
|
434
378
|
],
|
|
435
379
|
},
|
|
436
|
-
|
|
380
|
+
6026: {
|
|
437
381
|
name: "InvalidProtocolMode",
|
|
438
382
|
message: "Invalid protocol mode (must be 0=all, 1=allowlist, or 2=denylist)",
|
|
439
383
|
category: "INPUT_VALIDATION",
|
|
@@ -446,32 +390,7 @@ export const ON_CHAIN_ERROR_MAP = {
|
|
|
446
390
|
],
|
|
447
391
|
},
|
|
448
392
|
// --- Flash Trade expansion errors ---
|
|
449
|
-
|
|
450
|
-
name: "InvalidNonSpendingAmount",
|
|
451
|
-
message: "Non-spending action must have amount = 0",
|
|
452
|
-
category: "INPUT_VALIDATION",
|
|
453
|
-
retryable: false,
|
|
454
|
-
recovery_actions: [
|
|
455
|
-
{
|
|
456
|
-
action: "set_zero_amount",
|
|
457
|
-
description: "Set amount to 0 for non-spending actions (close, cancel, etc.)",
|
|
458
|
-
},
|
|
459
|
-
],
|
|
460
|
-
},
|
|
461
|
-
6032: {
|
|
462
|
-
name: "NoPositionsToClose",
|
|
463
|
-
message: "No open positions to close or cancel",
|
|
464
|
-
category: "RESOURCE_NOT_FOUND",
|
|
465
|
-
retryable: false,
|
|
466
|
-
recovery_actions: [
|
|
467
|
-
{
|
|
468
|
-
action: "check_positions",
|
|
469
|
-
description: "Verify you have open positions before closing",
|
|
470
|
-
tool: "sigil_check_vault",
|
|
471
|
-
},
|
|
472
|
-
],
|
|
473
|
-
},
|
|
474
|
-
6033: {
|
|
393
|
+
6027: {
|
|
475
394
|
name: "CpiCallNotAllowed",
|
|
476
395
|
message: "Instruction must be top-level (CPI calls not allowed for validate/finalize)",
|
|
477
396
|
category: "FATAL",
|
|
@@ -483,7 +402,7 @@ export const ON_CHAIN_ERROR_MAP = {
|
|
|
483
402
|
},
|
|
484
403
|
],
|
|
485
404
|
},
|
|
486
|
-
|
|
405
|
+
6028: {
|
|
487
406
|
name: "MissingFinalizeInstruction",
|
|
488
407
|
message: "Transaction must include finalize_session after validate_and_authorize",
|
|
489
408
|
category: "INPUT_VALIDATION",
|
|
@@ -496,7 +415,7 @@ export const ON_CHAIN_ERROR_MAP = {
|
|
|
496
415
|
],
|
|
497
416
|
},
|
|
498
417
|
// --- Stablecoin-only enforcement errors ---
|
|
499
|
-
|
|
418
|
+
6029: {
|
|
500
419
|
name: "NonTrackedSwapMustReturnStablecoin",
|
|
501
420
|
message: "Non-stablecoin swap must return stablecoin (vault stablecoin balance did not increase)",
|
|
502
421
|
category: "INPUT_VALIDATION",
|
|
@@ -508,7 +427,7 @@ export const ON_CHAIN_ERROR_MAP = {
|
|
|
508
427
|
},
|
|
509
428
|
],
|
|
510
429
|
},
|
|
511
|
-
|
|
430
|
+
6030: {
|
|
512
431
|
name: "SwapSlippageExceeded",
|
|
513
432
|
message: "Swap slippage exceeds policy max_slippage_bps or quoted output is zero",
|
|
514
433
|
category: "POLICY_VIOLATION",
|
|
@@ -525,7 +444,7 @@ export const ON_CHAIN_ERROR_MAP = {
|
|
|
525
444
|
},
|
|
526
445
|
],
|
|
527
446
|
},
|
|
528
|
-
|
|
447
|
+
6031: {
|
|
529
448
|
name: "InvalidJupiterInstruction",
|
|
530
449
|
message: "Cannot parse Jupiter swap instruction data",
|
|
531
450
|
category: "INPUT_VALIDATION",
|
|
@@ -537,7 +456,7 @@ export const ON_CHAIN_ERROR_MAP = {
|
|
|
537
456
|
},
|
|
538
457
|
],
|
|
539
458
|
},
|
|
540
|
-
|
|
459
|
+
6032: {
|
|
541
460
|
name: "UnauthorizedTokenTransfer",
|
|
542
461
|
message: "Top-level SPL Token transfer not allowed between validate and finalize",
|
|
543
462
|
category: "POLICY_VIOLATION",
|
|
@@ -549,7 +468,7 @@ export const ON_CHAIN_ERROR_MAP = {
|
|
|
549
468
|
},
|
|
550
469
|
],
|
|
551
470
|
},
|
|
552
|
-
|
|
471
|
+
6033: {
|
|
553
472
|
name: "SlippageBpsTooHigh",
|
|
554
473
|
message: "Slippage BPS exceeds maximum allowed (5000 = 50%)",
|
|
555
474
|
category: "INPUT_VALIDATION",
|
|
@@ -561,7 +480,7 @@ export const ON_CHAIN_ERROR_MAP = {
|
|
|
561
480
|
},
|
|
562
481
|
],
|
|
563
482
|
},
|
|
564
|
-
|
|
483
|
+
6034: {
|
|
565
484
|
name: "ProtocolMismatch",
|
|
566
485
|
message: "DeFi instruction program does not match the declared target_protocol",
|
|
567
486
|
category: "INPUT_VALIDATION",
|
|
@@ -573,7 +492,7 @@ export const ON_CHAIN_ERROR_MAP = {
|
|
|
573
492
|
},
|
|
574
493
|
],
|
|
575
494
|
},
|
|
576
|
-
|
|
495
|
+
6035: {
|
|
577
496
|
name: "TooManyDeFiInstructions",
|
|
578
497
|
message: "Non-stablecoin swap allows exactly one DeFi instruction",
|
|
579
498
|
category: "INPUT_VALIDATION",
|
|
@@ -586,7 +505,7 @@ export const ON_CHAIN_ERROR_MAP = {
|
|
|
586
505
|
],
|
|
587
506
|
},
|
|
588
507
|
// --- Multi-Agent errors ---
|
|
589
|
-
|
|
508
|
+
6036: {
|
|
590
509
|
name: "MaxAgentsReached",
|
|
591
510
|
message: "Maximum agents per vault reached (limit: 10)",
|
|
592
511
|
category: "INPUT_VALIDATION",
|
|
@@ -599,7 +518,7 @@ export const ON_CHAIN_ERROR_MAP = {
|
|
|
599
518
|
},
|
|
600
519
|
],
|
|
601
520
|
},
|
|
602
|
-
|
|
521
|
+
6037: {
|
|
603
522
|
name: "InsufficientPermissions",
|
|
604
523
|
message: "Agent lacks permission for this action type",
|
|
605
524
|
category: "PERMISSION",
|
|
@@ -616,7 +535,7 @@ export const ON_CHAIN_ERROR_MAP = {
|
|
|
616
535
|
},
|
|
617
536
|
],
|
|
618
537
|
},
|
|
619
|
-
|
|
538
|
+
6038: {
|
|
620
539
|
name: "InvalidPermissions",
|
|
621
540
|
message: "Capability exceeds the on-chain maximum (valid values: 0 = Disabled, 1 = Observer, 2 = Operator)",
|
|
622
541
|
category: "INPUT_VALIDATION",
|
|
@@ -629,7 +548,7 @@ export const ON_CHAIN_ERROR_MAP = {
|
|
|
629
548
|
],
|
|
630
549
|
},
|
|
631
550
|
// --- Escrow errors ---
|
|
632
|
-
|
|
551
|
+
6039: {
|
|
633
552
|
name: "EscrowNotActive",
|
|
634
553
|
message: "Escrow is not in Active status",
|
|
635
554
|
category: "RESOURCE_NOT_FOUND",
|
|
@@ -641,7 +560,7 @@ export const ON_CHAIN_ERROR_MAP = {
|
|
|
641
560
|
},
|
|
642
561
|
],
|
|
643
562
|
},
|
|
644
|
-
|
|
563
|
+
6040: {
|
|
645
564
|
name: "EscrowExpired",
|
|
646
565
|
message: "Escrow has expired — can only be refunded now",
|
|
647
566
|
category: "RESOURCE_NOT_FOUND",
|
|
@@ -654,7 +573,7 @@ export const ON_CHAIN_ERROR_MAP = {
|
|
|
654
573
|
},
|
|
655
574
|
],
|
|
656
575
|
},
|
|
657
|
-
|
|
576
|
+
6041: {
|
|
658
577
|
name: "EscrowNotExpired",
|
|
659
578
|
message: "Escrow has not expired yet — cannot refund before expiry",
|
|
660
579
|
category: "INPUT_VALIDATION",
|
|
@@ -671,7 +590,7 @@ export const ON_CHAIN_ERROR_MAP = {
|
|
|
671
590
|
},
|
|
672
591
|
],
|
|
673
592
|
},
|
|
674
|
-
|
|
593
|
+
6042: {
|
|
675
594
|
name: "InvalidEscrowVault",
|
|
676
595
|
message: "Invalid escrow vault — source or destination vault mismatch",
|
|
677
596
|
category: "INPUT_VALIDATION",
|
|
@@ -683,7 +602,7 @@ export const ON_CHAIN_ERROR_MAP = {
|
|
|
683
602
|
},
|
|
684
603
|
],
|
|
685
604
|
},
|
|
686
|
-
|
|
605
|
+
6043: {
|
|
687
606
|
name: "EscrowConditionsNotMet",
|
|
688
607
|
message: "Escrow settlement conditions not met (SHA-256 proof invalid)",
|
|
689
608
|
category: "INPUT_VALIDATION",
|
|
@@ -695,7 +614,7 @@ export const ON_CHAIN_ERROR_MAP = {
|
|
|
695
614
|
},
|
|
696
615
|
],
|
|
697
616
|
},
|
|
698
|
-
|
|
617
|
+
6044: {
|
|
699
618
|
name: "EscrowDurationExceeded",
|
|
700
619
|
message: "Escrow duration exceeds maximum (30 days)",
|
|
701
620
|
category: "INPUT_VALIDATION",
|
|
@@ -708,7 +627,7 @@ export const ON_CHAIN_ERROR_MAP = {
|
|
|
708
627
|
],
|
|
709
628
|
},
|
|
710
629
|
// --- Instruction constraints errors ---
|
|
711
|
-
|
|
630
|
+
6045: {
|
|
712
631
|
name: "InvalidConstraintConfig",
|
|
713
632
|
message: "Invalid constraint configuration: bounds exceeded",
|
|
714
633
|
category: "INPUT_VALIDATION",
|
|
@@ -720,7 +639,7 @@ export const ON_CHAIN_ERROR_MAP = {
|
|
|
720
639
|
},
|
|
721
640
|
],
|
|
722
641
|
},
|
|
723
|
-
|
|
642
|
+
6046: {
|
|
724
643
|
name: "ConstraintViolated",
|
|
725
644
|
message: "Instruction violated a configured constraint",
|
|
726
645
|
category: "POLICY_VIOLATION",
|
|
@@ -737,7 +656,7 @@ export const ON_CHAIN_ERROR_MAP = {
|
|
|
737
656
|
},
|
|
738
657
|
],
|
|
739
658
|
},
|
|
740
|
-
|
|
659
|
+
6047: {
|
|
741
660
|
name: "InvalidConstraintsPda",
|
|
742
661
|
message: "Invalid constraints PDA: wrong owner or vault",
|
|
743
662
|
category: "INPUT_VALIDATION",
|
|
@@ -749,7 +668,7 @@ export const ON_CHAIN_ERROR_MAP = {
|
|
|
749
668
|
},
|
|
750
669
|
],
|
|
751
670
|
},
|
|
752
|
-
|
|
671
|
+
6048: {
|
|
753
672
|
name: "InvalidPendingConstraintsPda",
|
|
754
673
|
message: "Invalid pending constraints PDA: wrong owner or vault",
|
|
755
674
|
category: "INPUT_VALIDATION",
|
|
@@ -762,7 +681,7 @@ export const ON_CHAIN_ERROR_MAP = {
|
|
|
762
681
|
],
|
|
763
682
|
},
|
|
764
683
|
// --- Per-agent spend limit errors ---
|
|
765
|
-
|
|
684
|
+
6049: {
|
|
766
685
|
name: "AgentSpendLimitExceeded",
|
|
767
686
|
message: "Agent's rolling 24h spend exceeds their individual spending limit",
|
|
768
687
|
category: "SPENDING_CAP",
|
|
@@ -784,7 +703,7 @@ export const ON_CHAIN_ERROR_MAP = {
|
|
|
784
703
|
},
|
|
785
704
|
],
|
|
786
705
|
},
|
|
787
|
-
|
|
706
|
+
6050: {
|
|
788
707
|
name: "OverlaySlotExhausted",
|
|
789
708
|
message: "Per-agent overlay is full — cannot register agent with spending limit",
|
|
790
709
|
category: "INPUT_VALIDATION",
|
|
@@ -797,7 +716,7 @@ export const ON_CHAIN_ERROR_MAP = {
|
|
|
797
716
|
},
|
|
798
717
|
],
|
|
799
718
|
},
|
|
800
|
-
|
|
719
|
+
6051: {
|
|
801
720
|
name: "AgentSlotNotFound",
|
|
802
721
|
message: "Agent has per-agent spending limit but no overlay tracking slot",
|
|
803
722
|
category: "RESOURCE_NOT_FOUND",
|
|
@@ -809,7 +728,7 @@ export const ON_CHAIN_ERROR_MAP = {
|
|
|
809
728
|
},
|
|
810
729
|
],
|
|
811
730
|
},
|
|
812
|
-
|
|
731
|
+
6052: {
|
|
813
732
|
name: "UnauthorizedTokenApproval",
|
|
814
733
|
message: "Unauthorized SPL Token Approve detected between validate and finalize",
|
|
815
734
|
category: "POLICY_VIOLATION",
|
|
@@ -821,7 +740,7 @@ export const ON_CHAIN_ERROR_MAP = {
|
|
|
821
740
|
},
|
|
822
741
|
],
|
|
823
742
|
},
|
|
824
|
-
|
|
743
|
+
6053: {
|
|
825
744
|
name: "InvalidSessionExpiry",
|
|
826
745
|
message: "Session expiry slots out of range (10-450)",
|
|
827
746
|
category: "INPUT_VALIDATION",
|
|
@@ -833,7 +752,7 @@ export const ON_CHAIN_ERROR_MAP = {
|
|
|
833
752
|
},
|
|
834
753
|
],
|
|
835
754
|
},
|
|
836
|
-
|
|
755
|
+
6054: {
|
|
837
756
|
name: "UnconstrainedProgramBlocked",
|
|
838
757
|
message: "Program has no constraint entry and strict mode is enabled",
|
|
839
758
|
category: "POLICY_VIOLATION",
|
|
@@ -851,7 +770,7 @@ export const ON_CHAIN_ERROR_MAP = {
|
|
|
851
770
|
],
|
|
852
771
|
},
|
|
853
772
|
// --- Per-protocol spend cap errors ---
|
|
854
|
-
|
|
773
|
+
6055: {
|
|
855
774
|
name: "ProtocolCapExceeded",
|
|
856
775
|
message: "Per-protocol rolling 24h spending cap would be exceeded",
|
|
857
776
|
category: "SPENDING_CAP",
|
|
@@ -872,7 +791,7 @@ export const ON_CHAIN_ERROR_MAP = {
|
|
|
872
791
|
},
|
|
873
792
|
],
|
|
874
793
|
},
|
|
875
|
-
|
|
794
|
+
6056: {
|
|
876
795
|
name: "ProtocolCapsMismatch",
|
|
877
796
|
message: "protocol_caps length must match protocols length when has_protocol_caps is true",
|
|
878
797
|
category: "INPUT_VALIDATION",
|
|
@@ -885,7 +804,7 @@ export const ON_CHAIN_ERROR_MAP = {
|
|
|
885
804
|
],
|
|
886
805
|
},
|
|
887
806
|
// --- Vault closure guard errors ---
|
|
888
|
-
|
|
807
|
+
6057: {
|
|
889
808
|
name: "ActiveEscrowsExist",
|
|
890
809
|
message: "Active escrow deposits exist — close them before closing vault",
|
|
891
810
|
category: "RESOURCE_NOT_FOUND",
|
|
@@ -897,7 +816,7 @@ export const ON_CHAIN_ERROR_MAP = {
|
|
|
897
816
|
},
|
|
898
817
|
],
|
|
899
818
|
},
|
|
900
|
-
|
|
819
|
+
6058: {
|
|
901
820
|
name: "ConstraintsNotClosed",
|
|
902
821
|
message: "Instruction constraints PDA still exists — close it before closing vault",
|
|
903
822
|
category: "RESOURCE_NOT_FOUND",
|
|
@@ -909,7 +828,7 @@ export const ON_CHAIN_ERROR_MAP = {
|
|
|
909
828
|
},
|
|
910
829
|
],
|
|
911
830
|
},
|
|
912
|
-
|
|
831
|
+
6059: {
|
|
913
832
|
name: "PendingPolicyExists",
|
|
914
833
|
message: "A pending policy update exists — apply or cancel it before closing vault",
|
|
915
834
|
category: "RESOURCE_NOT_FOUND",
|
|
@@ -922,7 +841,7 @@ export const ON_CHAIN_ERROR_MAP = {
|
|
|
922
841
|
],
|
|
923
842
|
},
|
|
924
843
|
// --- Agent pause errors ---
|
|
925
|
-
|
|
844
|
+
6060: {
|
|
926
845
|
name: "AgentPaused",
|
|
927
846
|
message: "Agent is paused — unpause before executing actions",
|
|
928
847
|
category: "PERMISSION",
|
|
@@ -934,7 +853,7 @@ export const ON_CHAIN_ERROR_MAP = {
|
|
|
934
853
|
},
|
|
935
854
|
],
|
|
936
855
|
},
|
|
937
|
-
|
|
856
|
+
6061: {
|
|
938
857
|
name: "AgentAlreadyPaused",
|
|
939
858
|
message: "Agent is already paused",
|
|
940
859
|
category: "INPUT_VALIDATION",
|
|
@@ -946,7 +865,7 @@ export const ON_CHAIN_ERROR_MAP = {
|
|
|
946
865
|
},
|
|
947
866
|
],
|
|
948
867
|
},
|
|
949
|
-
|
|
868
|
+
6062: {
|
|
950
869
|
name: "AgentNotPaused",
|
|
951
870
|
message: "Agent is not paused — cannot unpause",
|
|
952
871
|
category: "INPUT_VALIDATION",
|
|
@@ -958,7 +877,7 @@ export const ON_CHAIN_ERROR_MAP = {
|
|
|
958
877
|
},
|
|
959
878
|
],
|
|
960
879
|
},
|
|
961
|
-
|
|
880
|
+
6063: {
|
|
962
881
|
name: "UnauthorizedPostFinalizeInstruction",
|
|
963
882
|
message: "Instructions after finalize_session must be ComputeBudget or SystemProgram only",
|
|
964
883
|
category: "POLICY_VIOLATION",
|
|
@@ -970,7 +889,7 @@ export const ON_CHAIN_ERROR_MAP = {
|
|
|
970
889
|
},
|
|
971
890
|
],
|
|
972
891
|
},
|
|
973
|
-
|
|
892
|
+
6064: {
|
|
974
893
|
name: "UnexpectedBalanceDecrease",
|
|
975
894
|
message: "Vault stablecoin balance decreased more than the session authorized amount. " +
|
|
976
895
|
"This indicates a compromised DeFi program attempted to drain vault tokens via CPI.",
|
|
@@ -990,7 +909,7 @@ export const ON_CHAIN_ERROR_MAP = {
|
|
|
990
909
|
],
|
|
991
910
|
},
|
|
992
911
|
// --- TOCTOU + timelock hardening errors ---
|
|
993
|
-
|
|
912
|
+
6065: {
|
|
994
913
|
name: "TimelockTooShort",
|
|
995
914
|
message: "Timelock duration is below the minimum (1800 seconds / 30 minutes).",
|
|
996
915
|
category: "INPUT_VALIDATION",
|
|
@@ -1002,7 +921,7 @@ export const ON_CHAIN_ERROR_MAP = {
|
|
|
1002
921
|
},
|
|
1003
922
|
],
|
|
1004
923
|
},
|
|
1005
|
-
|
|
924
|
+
6066: {
|
|
1006
925
|
name: "PolicyVersionMismatch",
|
|
1007
926
|
message: "Policy version changed since agent's last RPC read. Re-resolve vault state and retry.",
|
|
1008
927
|
category: "TRANSIENT",
|
|
@@ -1015,31 +934,7 @@ export const ON_CHAIN_ERROR_MAP = {
|
|
|
1015
934
|
},
|
|
1016
935
|
],
|
|
1017
936
|
},
|
|
1018
|
-
|
|
1019
|
-
name: "PendingAgentPermsExists",
|
|
1020
|
-
message: "A pending agent permissions update already exists for this agent.",
|
|
1021
|
-
category: "RESOURCE_NOT_FOUND",
|
|
1022
|
-
retryable: false,
|
|
1023
|
-
recovery_actions: [
|
|
1024
|
-
{
|
|
1025
|
-
action: "apply_or_cancel_pending",
|
|
1026
|
-
description: "Apply or cancel the existing pending update before queuing a new one.",
|
|
1027
|
-
},
|
|
1028
|
-
],
|
|
1029
|
-
},
|
|
1030
|
-
6074: {
|
|
1031
|
-
name: "PendingCloseConstraintsExists",
|
|
1032
|
-
message: "A pending close constraints operation already exists for this vault.",
|
|
1033
|
-
category: "RESOURCE_NOT_FOUND",
|
|
1034
|
-
retryable: false,
|
|
1035
|
-
recovery_actions: [
|
|
1036
|
-
{
|
|
1037
|
-
action: "apply_or_cancel_pending",
|
|
1038
|
-
description: "Apply or cancel the existing pending close constraints before queuing a new one.",
|
|
1039
|
-
},
|
|
1040
|
-
],
|
|
1041
|
-
},
|
|
1042
|
-
6075: {
|
|
937
|
+
6067: {
|
|
1043
938
|
name: "ActiveSessionsExist",
|
|
1044
939
|
message: "Cannot close vault with active sessions. Finalize all pending sessions first.",
|
|
1045
940
|
category: "POLICY_VIOLATION",
|
|
@@ -1053,7 +948,7 @@ export const ON_CHAIN_ERROR_MAP = {
|
|
|
1053
948
|
],
|
|
1054
949
|
},
|
|
1055
950
|
// --- Post-execution assertions (Phase B scaffolding) ---
|
|
1056
|
-
|
|
951
|
+
6068: {
|
|
1057
952
|
name: "PostAssertionFailed",
|
|
1058
953
|
message: "Post-execution assertion failed: account state did not satisfy constraint.",
|
|
1059
954
|
category: "POLICY_VIOLATION",
|
|
@@ -1065,7 +960,7 @@ export const ON_CHAIN_ERROR_MAP = {
|
|
|
1065
960
|
},
|
|
1066
961
|
],
|
|
1067
962
|
},
|
|
1068
|
-
|
|
963
|
+
6069: {
|
|
1069
964
|
name: "InvalidPostAssertionIndex",
|
|
1070
965
|
message: "Post-assertion references an invalid instruction index.",
|
|
1071
966
|
category: "INPUT_VALIDATION",
|
|
@@ -1077,7 +972,7 @@ export const ON_CHAIN_ERROR_MAP = {
|
|
|
1077
972
|
},
|
|
1078
973
|
],
|
|
1079
974
|
},
|
|
1080
|
-
|
|
975
|
+
6070: {
|
|
1081
976
|
name: "UnauthorizedPreValidateInstruction",
|
|
1082
977
|
message: "Non-infrastructure instruction detected before validate_and_authorize.",
|
|
1083
978
|
category: "PERMISSION",
|
|
@@ -1089,7 +984,7 @@ export const ON_CHAIN_ERROR_MAP = {
|
|
|
1089
984
|
},
|
|
1090
985
|
],
|
|
1091
986
|
},
|
|
1092
|
-
|
|
987
|
+
6071: {
|
|
1093
988
|
name: "SnapshotNotCaptured",
|
|
1094
989
|
message: "Delta assertion snapshot was not captured in validate_and_authorize.",
|
|
1095
990
|
category: "INPUT_VALIDATION",
|
|
@@ -1101,63 +996,201 @@ export const ON_CHAIN_ERROR_MAP = {
|
|
|
1101
996
|
},
|
|
1102
997
|
],
|
|
1103
998
|
},
|
|
1104
|
-
|
|
1105
|
-
name: "
|
|
1106
|
-
message: "Constraint
|
|
999
|
+
6072: {
|
|
1000
|
+
name: "InvalidConstraintOperator",
|
|
1001
|
+
message: "Constraint operator value is not a valid ConstraintOperator discriminant.",
|
|
1107
1002
|
category: "INPUT_VALIDATION",
|
|
1108
1003
|
retryable: false,
|
|
1109
1004
|
recovery_actions: [
|
|
1110
1005
|
{
|
|
1111
1006
|
action: "fix_constraints",
|
|
1112
|
-
description: "Ensure constraint
|
|
1007
|
+
description: "Ensure constraint operators are valid (0-6).",
|
|
1113
1008
|
},
|
|
1114
1009
|
],
|
|
1115
1010
|
},
|
|
1116
|
-
|
|
1117
|
-
name: "
|
|
1118
|
-
message: "
|
|
1011
|
+
6073: {
|
|
1012
|
+
name: "ConstraintsVaultMismatch",
|
|
1013
|
+
message: "Zero-copy constraints account has wrong vault.",
|
|
1014
|
+
category: "INPUT_VALIDATION",
|
|
1015
|
+
retryable: false,
|
|
1016
|
+
recovery_actions: [
|
|
1017
|
+
{
|
|
1018
|
+
action: "verify_pda",
|
|
1019
|
+
description: "The constraints PDA does not belong to this vault.",
|
|
1020
|
+
},
|
|
1021
|
+
],
|
|
1022
|
+
},
|
|
1023
|
+
6074: {
|
|
1024
|
+
name: "BlockedSplOpcode",
|
|
1025
|
+
message: "SPL opcode is blocked at runtime and cannot be used in constraints.",
|
|
1119
1026
|
category: "INPUT_VALIDATION",
|
|
1120
1027
|
retryable: false,
|
|
1121
1028
|
recovery_actions: [
|
|
1122
1029
|
{
|
|
1123
1030
|
action: "fix_constraints",
|
|
1124
|
-
description: "
|
|
1031
|
+
description: "Remove blocked SPL opcode from the constraint entry — use allowlisted opcodes only.",
|
|
1125
1032
|
},
|
|
1126
1033
|
],
|
|
1127
1034
|
},
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1035
|
+
// F-10 audit fix: durable-nonce pre-signing defense
|
|
1036
|
+
6075: {
|
|
1037
|
+
name: "QueuedUpdateExpired",
|
|
1038
|
+
message: "Queued update is too old (>MAX_APPLY_AGE_SLOTS) — re-queue to apply. Defends against durable-nonce pre-signing.",
|
|
1039
|
+
category: "POLICY_VIOLATION",
|
|
1040
|
+
retryable: false,
|
|
1041
|
+
recovery_actions: [
|
|
1042
|
+
{
|
|
1043
|
+
action: "requeue",
|
|
1044
|
+
description: "Re-queue the update via queue_policy_update / queue_constraints_update / queue_close_constraints / queue_agent_permissions_update — the original queued update is past the freshness window.",
|
|
1045
|
+
},
|
|
1046
|
+
],
|
|
1047
|
+
},
|
|
1048
|
+
6076: {
|
|
1049
|
+
name: "AccountWritabilityMismatch",
|
|
1050
|
+
message: "Account writability flag does not match the constraint requirement (read-only vs writable).",
|
|
1051
|
+
category: "INPUT_VALIDATION",
|
|
1052
|
+
retryable: false,
|
|
1053
|
+
recovery_actions: [
|
|
1054
|
+
{
|
|
1055
|
+
action: "fix_constraints",
|
|
1056
|
+
description: "Match the writability flag (read-only or writable) of the account passed to the instruction with the constraint's is_writable_required value.",
|
|
1057
|
+
},
|
|
1058
|
+
],
|
|
1059
|
+
},
|
|
1060
|
+
// M11 SIMD-0296 pad-attack DoS guard
|
|
1061
|
+
6077: {
|
|
1062
|
+
name: "SysvarScanBoundExceeded",
|
|
1063
|
+
message: "Sysvar instruction scan exceeded the per-tx safety bound (MAX_SYSVAR_SCAN_ITERATIONS=64).",
|
|
1064
|
+
category: "INPUT_VALIDATION",
|
|
1065
|
+
retryable: false,
|
|
1066
|
+
recovery_actions: [
|
|
1067
|
+
{
|
|
1068
|
+
action: "fix_transaction_shape",
|
|
1069
|
+
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.",
|
|
1070
|
+
},
|
|
1071
|
+
],
|
|
1072
|
+
},
|
|
1073
|
+
// C4 audit fix: async-fulfillment program deny
|
|
1074
|
+
6078: {
|
|
1075
|
+
name: "AsyncFulfillmentNotPermitted",
|
|
1076
|
+
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.",
|
|
1077
|
+
category: "POLICY_VIOLATION",
|
|
1078
|
+
retryable: false,
|
|
1079
|
+
recovery_actions: [
|
|
1080
|
+
{
|
|
1081
|
+
action: "use_supported_protocol",
|
|
1082
|
+
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.",
|
|
1083
|
+
},
|
|
1084
|
+
],
|
|
1085
|
+
},
|
|
1086
|
+
// Orphan constraints PDA cleanup (F3-H1 audit fix)
|
|
1087
|
+
6079: {
|
|
1088
|
+
name: "ConstraintsAlreadyPopulated",
|
|
1089
|
+
message: "Cannot clean an active constraints PDA via cleanup_orphan_constraints_pda — use queue_close_constraints + apply_close_constraints instead.",
|
|
1090
|
+
category: "INPUT_VALIDATION",
|
|
1091
|
+
retryable: false,
|
|
1092
|
+
recovery_actions: [
|
|
1093
|
+
{
|
|
1094
|
+
action: "use_close_path",
|
|
1095
|
+
description: "Route through the timelocked close-constraints path; the orphan-cleanup instruction only operates on never-populated PDAs (partial allocate+extend chain).",
|
|
1096
|
+
},
|
|
1097
|
+
],
|
|
1098
|
+
},
|
|
1099
|
+
6080: {
|
|
1100
|
+
name: "OrphanPdaWrongOwner",
|
|
1101
|
+
message: "PDA at the constraints seeds is not owned by the Sigil program.",
|
|
1131
1102
|
category: "INPUT_VALIDATION",
|
|
1132
1103
|
retryable: false,
|
|
1133
1104
|
recovery_actions: [
|
|
1134
1105
|
{
|
|
1135
1106
|
action: "verify_pda",
|
|
1136
|
-
description: "
|
|
1107
|
+
description: "Verify the PDA derivation: it must be owned by the Sigil program and match seeds (vault, constraints).",
|
|
1137
1108
|
},
|
|
1138
1109
|
],
|
|
1139
1110
|
},
|
|
1140
|
-
|
|
1141
|
-
name: "
|
|
1142
|
-
message: "
|
|
1111
|
+
6081: {
|
|
1112
|
+
name: "OrphanPdaPopulated",
|
|
1113
|
+
message: "PDA is fully populated (carries the Anchor discriminator) — not an orphan; cannot be cleaned.",
|
|
1143
1114
|
category: "INPUT_VALIDATION",
|
|
1144
1115
|
retryable: false,
|
|
1145
1116
|
recovery_actions: [
|
|
1146
1117
|
{
|
|
1147
|
-
action: "
|
|
1148
|
-
description: "
|
|
1118
|
+
action: "use_close_path",
|
|
1119
|
+
description: "Route fully-populated constraints PDAs through queue_close_constraints + apply_close_constraints.",
|
|
1120
|
+
},
|
|
1121
|
+
],
|
|
1122
|
+
},
|
|
1123
|
+
// PR 7: Token-2022 opcode blocks (M3 + Pentester HIGH/MED + third-pass audit)
|
|
1124
|
+
6082: {
|
|
1125
|
+
name: "ConfidentialTransferBlocked",
|
|
1126
|
+
message: "Token-2022 ConfidentialTransfer is not permitted between validate_and_authorize and finalize_session.",
|
|
1127
|
+
category: "POLICY_VIOLATION",
|
|
1128
|
+
retryable: false,
|
|
1129
|
+
recovery_actions: [
|
|
1130
|
+
{
|
|
1131
|
+
action: "use_supported_protocol",
|
|
1132
|
+
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.",
|
|
1133
|
+
},
|
|
1134
|
+
],
|
|
1135
|
+
},
|
|
1136
|
+
6083: {
|
|
1137
|
+
name: "PermanentDelegateBlocked",
|
|
1138
|
+
message: "Token-2022 PermanentDelegate is not permitted between validate_and_authorize and finalize_session.",
|
|
1139
|
+
category: "POLICY_VIOLATION",
|
|
1140
|
+
retryable: false,
|
|
1141
|
+
recovery_actions: [
|
|
1142
|
+
{
|
|
1143
|
+
action: "use_supported_protocol",
|
|
1144
|
+
description: "Token-2022 PermanentDelegate (opcode 35) installs a session-bound delegate that survives finalize. Reject up-front; use a per-tx Approve instead.",
|
|
1149
1145
|
},
|
|
1150
1146
|
],
|
|
1151
1147
|
},
|
|
1152
1148
|
6084: {
|
|
1153
|
-
name: "
|
|
1154
|
-
message: "
|
|
1149
|
+
name: "TransferHookBlocked",
|
|
1150
|
+
message: "Token-2022 TransferHook is not permitted between validate_and_authorize and finalize_session.",
|
|
1151
|
+
category: "POLICY_VIOLATION",
|
|
1152
|
+
retryable: false,
|
|
1153
|
+
recovery_actions: [
|
|
1154
|
+
{
|
|
1155
|
+
action: "use_supported_protocol",
|
|
1156
|
+
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.",
|
|
1157
|
+
},
|
|
1158
|
+
],
|
|
1159
|
+
},
|
|
1160
|
+
6085: {
|
|
1161
|
+
name: "LamportDrainBlocked",
|
|
1162
|
+
message: "Token-2022 destructive-balance instruction (opcode 38/45/46) is not permitted between validate_and_authorize and finalize_session.",
|
|
1163
|
+
category: "POLICY_VIOLATION",
|
|
1164
|
+
retryable: false,
|
|
1165
|
+
recovery_actions: [
|
|
1166
|
+
{
|
|
1167
|
+
action: "use_supported_protocol",
|
|
1168
|
+
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.",
|
|
1169
|
+
},
|
|
1170
|
+
],
|
|
1171
|
+
},
|
|
1172
|
+
6086: {
|
|
1173
|
+
name: "BatchInstructionBlocked",
|
|
1174
|
+
message: "Token-2022 Batch instruction (opcode 255) is blocked outright — wraps inner instructions and bypasses the byte-0 blocklist.",
|
|
1175
|
+
category: "POLICY_VIOLATION",
|
|
1176
|
+
retryable: false,
|
|
1177
|
+
recovery_actions: [
|
|
1178
|
+
{
|
|
1179
|
+
action: "use_supported_protocol",
|
|
1180
|
+
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.",
|
|
1181
|
+
},
|
|
1182
|
+
],
|
|
1183
|
+
},
|
|
1184
|
+
// F-4 audit fix: explicit destination_mode (default Restricted closes default-allow drain)
|
|
1185
|
+
6087: {
|
|
1186
|
+
name: "InvalidDestinationMode",
|
|
1187
|
+
message: "Invalid destination mode (must be 0 = Restricted or 1 = OpenWithCap).",
|
|
1155
1188
|
category: "INPUT_VALIDATION",
|
|
1156
1189
|
retryable: false,
|
|
1157
1190
|
recovery_actions: [
|
|
1158
1191
|
{
|
|
1159
|
-
action: "
|
|
1160
|
-
description: "
|
|
1192
|
+
action: "fix_policy",
|
|
1193
|
+
description: "Pass destination_mode = 0 (Restricted, default) or 1 (OpenWithCap, explicit opt-in to drain blast radius).",
|
|
1161
1194
|
},
|
|
1162
1195
|
],
|
|
1163
1196
|
},
|
|
@@ -1661,7 +1694,7 @@ const SDK_ERRORS = {
|
|
|
1661
1694
|
* Convert any error into a structured AgentError.
|
|
1662
1695
|
*
|
|
1663
1696
|
* Handles:
|
|
1664
|
-
* - On-chain Anchor errors (code 6000-
|
|
1697
|
+
* - On-chain Anchor errors (code 6000-6087)
|
|
1665
1698
|
* - SDK errors (code 7000-7033)
|
|
1666
1699
|
* - Network/RPC errors (from message patterns)
|
|
1667
1700
|
* - Unknown errors (wrapped as FATAL)
|
|
@@ -1963,7 +1996,7 @@ function extractErrorCode(error) {
|
|
|
1963
1996
|
return null;
|
|
1964
1997
|
const e = error;
|
|
1965
1998
|
// Direct code property
|
|
1966
|
-
if (typeof e.code === "number" && e.code >= 6000 && e.code <=
|
|
1999
|
+
if (typeof e.code === "number" && e.code >= 6000 && e.code <= 6087)
|
|
1967
2000
|
return e.code;
|
|
1968
2001
|
// Anchor error structure
|
|
1969
2002
|
if (e.error && typeof e.error === "object") {
|
|
@@ -1979,7 +2012,7 @@ function extractErrorCode(error) {
|
|
|
1979
2012
|
const match = e.message.match(/custom program error: 0x([0-9a-fA-F]+)/);
|
|
1980
2013
|
if (match) {
|
|
1981
2014
|
const code = parseInt(match[1], 16);
|
|
1982
|
-
if (code >= 6000 && code <=
|
|
2015
|
+
if (code >= 6000 && code <= 6087)
|
|
1983
2016
|
return code;
|
|
1984
2017
|
}
|
|
1985
2018
|
}
|
|
@@ -2101,17 +2134,8 @@ const SDK_ERROR_PATTERNS = [
|
|
|
2101
2134
|
},
|
|
2102
2135
|
],
|
|
2103
2136
|
},
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
category: "POLICY_VIOLATION",
|
|
2107
|
-
retryable: true,
|
|
2108
|
-
recovery_actions: [
|
|
2109
|
-
{
|
|
2110
|
-
action: "close_position",
|
|
2111
|
-
description: "Close an existing position before opening a new one.",
|
|
2112
|
-
},
|
|
2113
|
-
],
|
|
2114
|
-
},
|
|
2137
|
+
// "Position limit reached" pattern DELETED — position counter system removed
|
|
2138
|
+
// per council decision (9-1 vote, 2026-04-19).
|
|
2115
2139
|
{
|
|
2116
2140
|
pattern: /Spending action .+ requires amount > 0/,
|
|
2117
2141
|
category: "INPUT_VALIDATION",
|
|
@@ -2205,7 +2229,7 @@ export class SigilSdkError extends Error {
|
|
|
2205
2229
|
* Returns a SigilSdkError (extends Error) so instanceof Error checks still work.
|
|
2206
2230
|
*
|
|
2207
2231
|
* Processing order:
|
|
2208
|
-
* 1. Try on-chain error extraction via toAgentError() (numeric codes 6000-
|
|
2232
|
+
* 1. Try on-chain error extraction via toAgentError() (numeric codes 6000-6087)
|
|
2209
2233
|
* 2. Pattern-match SDK error messages (11 patterns from seal.ts throw sites)
|
|
2210
2234
|
* 3. Fallback to UNKNOWN/FATAL
|
|
2211
2235
|
*/
|