@agent-shield/sdk 0.3.1 → 0.5.1

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.
Files changed (58) hide show
  1. package/LICENSE +191 -0
  2. package/README.md +14 -22
  3. package/dist/idl-json.d.ts +3 -3
  4. package/dist/idl-json.d.ts.map +1 -1
  5. package/dist/idl-json.js +2020 -2942
  6. package/dist/idl-json.js.map +1 -1
  7. package/dist/idl.d.ts +1403 -2057
  8. package/dist/idl.d.ts.map +1 -1
  9. package/dist/index.d.ts +5 -0
  10. package/dist/index.d.ts.map +1 -1
  11. package/dist/index.js +46 -2
  12. package/dist/index.js.map +1 -1
  13. package/dist/instructions.d.ts +893 -893
  14. package/dist/types.d.ts +2 -2
  15. package/dist/types.d.ts.map +1 -1
  16. package/dist/types.js +2 -2
  17. package/dist/types.js.map +1 -1
  18. package/dist/wrapper/engine.d.ts +17 -0
  19. package/dist/wrapper/engine.d.ts.map +1 -0
  20. package/dist/wrapper/engine.js +45 -0
  21. package/dist/wrapper/engine.js.map +1 -0
  22. package/dist/wrapper/errors.d.ts +10 -0
  23. package/dist/wrapper/errors.d.ts.map +1 -0
  24. package/dist/wrapper/errors.js +20 -0
  25. package/dist/wrapper/errors.js.map +1 -0
  26. package/dist/wrapper/harden.d.ts +119 -0
  27. package/dist/wrapper/harden.d.ts.map +1 -0
  28. package/dist/wrapper/harden.js +399 -0
  29. package/dist/wrapper/harden.js.map +1 -0
  30. package/dist/wrapper/index.d.ts +17 -0
  31. package/dist/wrapper/index.d.ts.map +1 -0
  32. package/dist/wrapper/index.js +60 -0
  33. package/dist/wrapper/index.js.map +1 -0
  34. package/dist/wrapper/inspector.d.ts +22 -0
  35. package/dist/wrapper/inspector.d.ts.map +1 -0
  36. package/dist/wrapper/inspector.js +175 -0
  37. package/dist/wrapper/inspector.js.map +1 -0
  38. package/dist/wrapper/policies.d.ts +78 -0
  39. package/dist/wrapper/policies.d.ts.map +1 -0
  40. package/dist/wrapper/policies.js +108 -0
  41. package/dist/wrapper/policies.js.map +1 -0
  42. package/dist/wrapper/registry.d.ts +24 -0
  43. package/dist/wrapper/registry.d.ts.map +1 -0
  44. package/dist/wrapper/registry.js +43 -0
  45. package/dist/wrapper/registry.js.map +1 -0
  46. package/dist/wrapper/shield.d.ts +86 -0
  47. package/dist/wrapper/shield.d.ts.map +1 -0
  48. package/dist/wrapper/shield.js +226 -0
  49. package/dist/wrapper/shield.js.map +1 -0
  50. package/dist/wrapper/state.d.ts +3 -0
  51. package/dist/wrapper/state.d.ts.map +1 -0
  52. package/dist/wrapper/state.js +6 -0
  53. package/dist/wrapper/state.js.map +1 -0
  54. package/dist/wrapper/x402.d.ts +151 -0
  55. package/dist/wrapper/x402.d.ts.map +1 -0
  56. package/dist/wrapper/x402.js +326 -0
  57. package/dist/wrapper/x402.js.map +1 -0
  58. package/package.json +15 -11
package/dist/idl.d.ts CHANGED
@@ -5,268 +5,195 @@
5
5
  * IDL can be found at `target/idl/agent_shield.json`.
6
6
  */
7
7
  export type AgentShield = {
8
- "address": "4ZeVCqnjUgUtFrHHPG7jELUxvJeoVGHhGNgPrhBPwrHL";
9
- "metadata": {
10
- "name": "agentShield";
11
- "version": "0.1.0";
12
- "spec": "0.1.0";
13
- "description": "AI Agent Financial Middleware for Solana - Permission controls, spending limits, and audit infrastructure for autonomous agents";
8
+ address: "4ZeVCqnjUgUtFrHHPG7jELUxvJeoVGHhGNgPrhBPwrHL";
9
+ metadata: {
10
+ name: "agentShield";
11
+ version: "0.1.0";
12
+ spec: "0.1.0";
13
+ description: "On-chain guardrails for AI agents on Solana - Permission controls, spending limits, and audit infrastructure for autonomous agents";
14
14
  };
15
- "instructions": [
15
+ instructions: [
16
16
  {
17
- "name": "agentTransfer";
18
- "docs": [
17
+ name: "agentTransfer";
18
+ docs: [
19
19
  "Transfer tokens from the vault to an allowed destination.",
20
20
  "Only the agent can call this. Respects destination allowlist,",
21
21
  "spending caps, and per-token limits."
22
22
  ];
23
- "discriminator": [
24
- 199,
25
- 111,
26
- 151,
27
- 49,
28
- 124,
29
- 13,
30
- 150,
31
- 44
32
- ];
33
- "accounts": [
23
+ discriminator: [199, 111, 151, 49, 124, 13, 150, 44];
24
+ accounts: [
34
25
  {
35
- "name": "agent";
36
- "writable": true;
37
- "signer": true;
26
+ name: "agent";
27
+ writable: true;
28
+ signer: true;
38
29
  },
39
30
  {
40
- "name": "vault";
41
- "writable": true;
42
- "pda": {
43
- "seeds": [
31
+ name: "vault";
32
+ writable: true;
33
+ pda: {
34
+ seeds: [
44
35
  {
45
- "kind": "const";
46
- "value": [
47
- 118,
48
- 97,
49
- 117,
50
- 108,
51
- 116
52
- ];
36
+ kind: "const";
37
+ value: [118, 97, 117, 108, 116];
53
38
  },
54
39
  {
55
- "kind": "account";
56
- "path": "vault.owner";
57
- "account": "agentVault";
40
+ kind: "account";
41
+ path: "vault.owner";
42
+ account: "agentVault";
58
43
  },
59
44
  {
60
- "kind": "account";
61
- "path": "vault.vault_id";
62
- "account": "agentVault";
45
+ kind: "account";
46
+ path: "vault.vault_id";
47
+ account: "agentVault";
63
48
  }
64
49
  ];
65
50
  };
66
- "relations": [
67
- "policy",
68
- "tracker"
69
- ];
51
+ relations: ["policy", "tracker"];
70
52
  },
71
53
  {
72
- "name": "policy";
73
- "pda": {
74
- "seeds": [
54
+ name: "policy";
55
+ pda: {
56
+ seeds: [
75
57
  {
76
- "kind": "const";
77
- "value": [
78
- 112,
79
- 111,
80
- 108,
81
- 105,
82
- 99,
83
- 121
84
- ];
58
+ kind: "const";
59
+ value: [112, 111, 108, 105, 99, 121];
85
60
  },
86
61
  {
87
- "kind": "account";
88
- "path": "vault";
62
+ kind: "account";
63
+ path: "vault";
89
64
  }
90
65
  ];
91
66
  };
92
67
  },
93
68
  {
94
- "name": "tracker";
95
- "writable": true;
96
- "pda": {
97
- "seeds": [
69
+ name: "tracker";
70
+ writable: true;
71
+ pda: {
72
+ seeds: [
98
73
  {
99
- "kind": "const";
100
- "value": [
101
- 116,
102
- 114,
103
- 97,
104
- 99,
105
- 107,
106
- 101,
107
- 114
108
- ];
74
+ kind: "const";
75
+ value: [116, 114, 97, 99, 107, 101, 114];
109
76
  },
110
77
  {
111
- "kind": "account";
112
- "path": "vault";
78
+ kind: "account";
79
+ path: "vault";
113
80
  }
114
81
  ];
115
82
  };
116
83
  },
117
84
  {
118
- "name": "vaultTokenAccount";
119
- "docs": [
120
- "Vault's PDA-owned token account (source)"
121
- ];
122
- "writable": true;
85
+ name: "vaultTokenAccount";
86
+ docs: ["Vault's PDA-owned token account (source)"];
87
+ writable: true;
123
88
  },
124
89
  {
125
- "name": "destinationTokenAccount";
126
- "docs": [
90
+ name: "destinationTokenAccount";
91
+ docs: [
127
92
  "Destination token account (must be in allowed destinations if configured)"
128
93
  ];
129
- "writable": true;
94
+ writable: true;
130
95
  },
131
96
  {
132
- "name": "feeDestinationTokenAccount";
133
- "docs": [
97
+ name: "feeDestinationTokenAccount";
98
+ docs: [
134
99
  "Developer fee destination token account — must match vault.fee_destination"
135
100
  ];
136
- "writable": true;
137
- "optional": true;
101
+ writable: true;
102
+ optional: true;
138
103
  },
139
104
  {
140
- "name": "protocolTreasuryTokenAccount";
141
- "docs": [
142
- "Protocol treasury token account"
143
- ];
144
- "writable": true;
145
- "optional": true;
105
+ name: "protocolTreasuryTokenAccount";
106
+ docs: ["Protocol treasury token account"];
107
+ writable: true;
108
+ optional: true;
146
109
  },
147
110
  {
148
- "name": "tokenProgram";
149
- "address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
111
+ name: "tokenProgram";
112
+ address: "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
150
113
  }
151
114
  ];
152
- "args": [
115
+ args: [
153
116
  {
154
- "name": "amount";
155
- "type": "u64";
117
+ name: "amount";
118
+ type: "u64";
156
119
  }
157
120
  ];
158
121
  },
159
122
  {
160
- "name": "applyPendingPolicy";
161
- "docs": [
123
+ name: "applyPendingPolicy";
124
+ docs: [
162
125
  "Apply a queued policy update after the timelock period has expired.",
163
126
  "Closes the PendingPolicyUpdate PDA and returns rent to the owner."
164
127
  ];
165
- "discriminator": [
166
- 114,
167
- 212,
168
- 19,
169
- 227,
170
- 89,
171
- 199,
172
- 74,
173
- 62
174
- ];
175
- "accounts": [
128
+ discriminator: [114, 212, 19, 227, 89, 199, 74, 62];
129
+ accounts: [
176
130
  {
177
- "name": "owner";
178
- "writable": true;
179
- "signer": true;
180
- "relations": [
181
- "vault"
182
- ];
131
+ name: "owner";
132
+ writable: true;
133
+ signer: true;
134
+ relations: ["vault"];
183
135
  },
184
136
  {
185
- "name": "vault";
186
- "pda": {
187
- "seeds": [
137
+ name: "vault";
138
+ pda: {
139
+ seeds: [
188
140
  {
189
- "kind": "const";
190
- "value": [
191
- 118,
192
- 97,
193
- 117,
194
- 108,
195
- 116
196
- ];
141
+ kind: "const";
142
+ value: [118, 97, 117, 108, 116];
197
143
  },
198
144
  {
199
- "kind": "account";
200
- "path": "owner";
145
+ kind: "account";
146
+ path: "owner";
201
147
  },
202
148
  {
203
- "kind": "account";
204
- "path": "vault.vault_id";
205
- "account": "agentVault";
149
+ kind: "account";
150
+ path: "vault.vault_id";
151
+ account: "agentVault";
206
152
  }
207
153
  ];
208
154
  };
209
- "relations": [
210
- "policy",
211
- "tracker",
212
- "pendingPolicy"
213
- ];
155
+ relations: ["policy", "tracker", "pendingPolicy"];
214
156
  },
215
157
  {
216
- "name": "policy";
217
- "writable": true;
218
- "pda": {
219
- "seeds": [
158
+ name: "policy";
159
+ writable: true;
160
+ pda: {
161
+ seeds: [
220
162
  {
221
- "kind": "const";
222
- "value": [
223
- 112,
224
- 111,
225
- 108,
226
- 105,
227
- 99,
228
- 121
229
- ];
163
+ kind: "const";
164
+ value: [112, 111, 108, 105, 99, 121];
230
165
  },
231
166
  {
232
- "kind": "account";
233
- "path": "vault";
167
+ kind: "account";
168
+ path: "vault";
234
169
  }
235
170
  ];
236
171
  };
237
172
  },
238
173
  {
239
- "name": "tracker";
240
- "writable": true;
241
- "pda": {
242
- "seeds": [
174
+ name: "tracker";
175
+ writable: true;
176
+ pda: {
177
+ seeds: [
243
178
  {
244
- "kind": "const";
245
- "value": [
246
- 116,
247
- 114,
248
- 97,
249
- 99,
250
- 107,
251
- 101,
252
- 114
253
- ];
179
+ kind: "const";
180
+ value: [116, 114, 97, 99, 107, 101, 114];
254
181
  },
255
182
  {
256
- "kind": "account";
257
- "path": "vault";
183
+ kind: "account";
184
+ path: "vault";
258
185
  }
259
186
  ];
260
187
  };
261
188
  },
262
189
  {
263
- "name": "pendingPolicy";
264
- "writable": true;
265
- "pda": {
266
- "seeds": [
190
+ name: "pendingPolicy";
191
+ writable: true;
192
+ pda: {
193
+ seeds: [
267
194
  {
268
- "kind": "const";
269
- "value": [
195
+ kind: "const";
196
+ value: [
270
197
  112,
271
198
  101,
272
199
  110,
@@ -284,77 +211,58 @@ export type AgentShield = {
284
211
  ];
285
212
  },
286
213
  {
287
- "kind": "account";
288
- "path": "vault";
214
+ kind: "account";
215
+ path: "vault";
289
216
  }
290
217
  ];
291
218
  };
292
219
  }
293
220
  ];
294
- "args": [];
221
+ args: [];
295
222
  },
296
223
  {
297
- "name": "cancelPendingPolicy";
298
- "docs": [
224
+ name: "cancelPendingPolicy";
225
+ docs: [
299
226
  "Cancel a queued policy update. Closes the PendingPolicyUpdate PDA",
300
227
  "and returns rent to the owner."
301
228
  ];
302
- "discriminator": [
303
- 153,
304
- 36,
305
- 104,
306
- 200,
307
- 50,
308
- 94,
309
- 207,
310
- 33
311
- ];
312
- "accounts": [
229
+ discriminator: [153, 36, 104, 200, 50, 94, 207, 33];
230
+ accounts: [
313
231
  {
314
- "name": "owner";
315
- "writable": true;
316
- "signer": true;
317
- "relations": [
318
- "vault"
319
- ];
232
+ name: "owner";
233
+ writable: true;
234
+ signer: true;
235
+ relations: ["vault"];
320
236
  },
321
237
  {
322
- "name": "vault";
323
- "pda": {
324
- "seeds": [
238
+ name: "vault";
239
+ pda: {
240
+ seeds: [
325
241
  {
326
- "kind": "const";
327
- "value": [
328
- 118,
329
- 97,
330
- 117,
331
- 108,
332
- 116
333
- ];
242
+ kind: "const";
243
+ value: [118, 97, 117, 108, 116];
334
244
  },
335
245
  {
336
- "kind": "account";
337
- "path": "owner";
246
+ kind: "account";
247
+ path: "owner";
338
248
  },
339
249
  {
340
- "kind": "account";
341
- "path": "vault.vault_id";
342
- "account": "agentVault";
250
+ kind: "account";
251
+ path: "vault.vault_id";
252
+ account: "agentVault";
343
253
  }
344
254
  ];
345
255
  };
346
- "relations": [
347
- "pendingPolicy"
348
- ];
256
+ relations: ["pendingPolicy"];
349
257
  },
350
258
  {
351
- "name": "pendingPolicy";
352
- "writable": true;
353
- "pda": {
354
- "seeds": [
259
+ name: "pendingPolicy";
260
+ writable: true;
261
+ pda: {
262
+ seeds: [
355
263
  {
356
- "kind": "const";
357
- "value": [
264
+ kind: "const";
265
+ value: [
358
266
  112,
359
267
  101,
360
268
  110,
@@ -372,194 +280,140 @@ export type AgentShield = {
372
280
  ];
373
281
  },
374
282
  {
375
- "kind": "account";
376
- "path": "vault";
283
+ kind: "account";
284
+ path: "vault";
377
285
  }
378
286
  ];
379
287
  };
380
288
  }
381
289
  ];
382
- "args": [];
290
+ args: [];
383
291
  },
384
292
  {
385
- "name": "closeVault";
386
- "docs": [
293
+ name: "closeVault";
294
+ docs: [
387
295
  "Close the vault entirely. Withdraws all remaining funds and closes all PDAs.",
388
296
  "Reclaims rent. Vault must have no open positions. Only the owner can call this."
389
297
  ];
390
- "discriminator": [
391
- 141,
392
- 103,
393
- 17,
394
- 126,
395
- 72,
396
- 75,
397
- 29,
398
- 29
399
- ];
400
- "accounts": [
298
+ discriminator: [141, 103, 17, 126, 72, 75, 29, 29];
299
+ accounts: [
401
300
  {
402
- "name": "owner";
403
- "writable": true;
404
- "signer": true;
405
- "relations": [
406
- "vault"
407
- ];
301
+ name: "owner";
302
+ writable: true;
303
+ signer: true;
304
+ relations: ["vault"];
408
305
  },
409
306
  {
410
- "name": "vault";
411
- "writable": true;
412
- "pda": {
413
- "seeds": [
307
+ name: "vault";
308
+ writable: true;
309
+ pda: {
310
+ seeds: [
414
311
  {
415
- "kind": "const";
416
- "value": [
417
- 118,
418
- 97,
419
- 117,
420
- 108,
421
- 116
422
- ];
312
+ kind: "const";
313
+ value: [118, 97, 117, 108, 116];
423
314
  },
424
315
  {
425
- "kind": "account";
426
- "path": "owner";
316
+ kind: "account";
317
+ path: "owner";
427
318
  },
428
319
  {
429
- "kind": "account";
430
- "path": "vault.vault_id";
431
- "account": "agentVault";
320
+ kind: "account";
321
+ path: "vault.vault_id";
322
+ account: "agentVault";
432
323
  }
433
324
  ];
434
325
  };
435
- "relations": [
436
- "policy",
437
- "tracker"
438
- ];
326
+ relations: ["policy", "tracker"];
439
327
  },
440
328
  {
441
- "name": "policy";
442
- "writable": true;
443
- "pda": {
444
- "seeds": [
329
+ name: "policy";
330
+ writable: true;
331
+ pda: {
332
+ seeds: [
445
333
  {
446
- "kind": "const";
447
- "value": [
448
- 112,
449
- 111,
450
- 108,
451
- 105,
452
- 99,
453
- 121
454
- ];
334
+ kind: "const";
335
+ value: [112, 111, 108, 105, 99, 121];
455
336
  },
456
337
  {
457
- "kind": "account";
458
- "path": "vault";
338
+ kind: "account";
339
+ path: "vault";
459
340
  }
460
341
  ];
461
342
  };
462
343
  },
463
344
  {
464
- "name": "tracker";
465
- "writable": true;
466
- "pda": {
467
- "seeds": [
345
+ name: "tracker";
346
+ writable: true;
347
+ pda: {
348
+ seeds: [
468
349
  {
469
- "kind": "const";
470
- "value": [
471
- 116,
472
- 114,
473
- 97,
474
- 99,
475
- 107,
476
- 101,
477
- 114
478
- ];
350
+ kind: "const";
351
+ value: [116, 114, 97, 99, 107, 101, 114];
479
352
  },
480
353
  {
481
- "kind": "account";
482
- "path": "vault";
354
+ kind: "account";
355
+ path: "vault";
483
356
  }
484
357
  ];
485
358
  };
486
359
  },
487
360
  {
488
- "name": "systemProgram";
489
- "address": "11111111111111111111111111111111";
361
+ name: "systemProgram";
362
+ address: "11111111111111111111111111111111";
490
363
  }
491
364
  ];
492
- "args": [];
365
+ args: [];
493
366
  },
494
367
  {
495
- "name": "depositFunds";
496
- "docs": [
368
+ name: "depositFunds";
369
+ docs: [
497
370
  "Deposit SPL tokens into the vault's PDA-controlled token account.",
498
371
  "Only the owner can call this."
499
372
  ];
500
- "discriminator": [
501
- 202,
502
- 39,
503
- 52,
504
- 211,
505
- 53,
506
- 20,
507
- 250,
508
- 88
509
- ];
510
- "accounts": [
373
+ discriminator: [202, 39, 52, 211, 53, 20, 250, 88];
374
+ accounts: [
511
375
  {
512
- "name": "owner";
513
- "writable": true;
514
- "signer": true;
515
- "relations": [
516
- "vault"
517
- ];
376
+ name: "owner";
377
+ writable: true;
378
+ signer: true;
379
+ relations: ["vault"];
518
380
  },
519
381
  {
520
- "name": "vault";
521
- "pda": {
522
- "seeds": [
382
+ name: "vault";
383
+ pda: {
384
+ seeds: [
523
385
  {
524
- "kind": "const";
525
- "value": [
526
- 118,
527
- 97,
528
- 117,
529
- 108,
530
- 116
531
- ];
386
+ kind: "const";
387
+ value: [118, 97, 117, 108, 116];
532
388
  },
533
389
  {
534
- "kind": "account";
535
- "path": "owner";
390
+ kind: "account";
391
+ path: "owner";
536
392
  },
537
393
  {
538
- "kind": "account";
539
- "path": "vault.vault_id";
540
- "account": "agentVault";
394
+ kind: "account";
395
+ path: "vault.vault_id";
396
+ account: "agentVault";
541
397
  }
542
398
  ];
543
399
  };
544
400
  },
545
401
  {
546
- "name": "mint";
402
+ name: "mint";
547
403
  },
548
404
  {
549
- "name": "ownerTokenAccount";
550
- "docs": [
551
- "Owner's token account to transfer from"
552
- ];
553
- "writable": true;
554
- "pda": {
555
- "seeds": [
405
+ name: "ownerTokenAccount";
406
+ docs: ["Owner's token account to transfer from"];
407
+ writable: true;
408
+ pda: {
409
+ seeds: [
556
410
  {
557
- "kind": "account";
558
- "path": "owner";
411
+ kind: "account";
412
+ path: "owner";
559
413
  },
560
414
  {
561
- "kind": "const";
562
- "value": [
415
+ kind: "const";
416
+ value: [
563
417
  6,
564
418
  221,
565
419
  246,
@@ -595,13 +449,13 @@ export type AgentShield = {
595
449
  ];
596
450
  },
597
451
  {
598
- "kind": "account";
599
- "path": "mint";
452
+ kind: "account";
453
+ path: "mint";
600
454
  }
601
455
  ];
602
- "program": {
603
- "kind": "const";
604
- "value": [
456
+ program: {
457
+ kind: "const";
458
+ value: [
605
459
  140,
606
460
  151,
607
461
  37,
@@ -639,20 +493,18 @@ export type AgentShield = {
639
493
  };
640
494
  },
641
495
  {
642
- "name": "vaultTokenAccount";
643
- "docs": [
644
- "Vault's PDA-controlled token account"
645
- ];
646
- "writable": true;
647
- "pda": {
648
- "seeds": [
496
+ name: "vaultTokenAccount";
497
+ docs: ["Vault's PDA-controlled token account"];
498
+ writable: true;
499
+ pda: {
500
+ seeds: [
649
501
  {
650
- "kind": "account";
651
- "path": "vault";
502
+ kind: "account";
503
+ path: "vault";
652
504
  },
653
505
  {
654
- "kind": "const";
655
- "value": [
506
+ kind: "const";
507
+ value: [
656
508
  6,
657
509
  221,
658
510
  246,
@@ -688,13 +540,13 @@ export type AgentShield = {
688
540
  ];
689
541
  },
690
542
  {
691
- "kind": "account";
692
- "path": "mint";
543
+ kind: "account";
544
+ path: "mint";
693
545
  }
694
546
  ];
695
- "program": {
696
- "kind": "const";
697
- "value": [
547
+ program: {
548
+ kind: "const";
549
+ value: [
698
550
  140,
699
551
  151,
700
552
  37,
@@ -732,463 +584,361 @@ export type AgentShield = {
732
584
  };
733
585
  },
734
586
  {
735
- "name": "tokenProgram";
736
- "address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
587
+ name: "tokenProgram";
588
+ address: "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
737
589
  },
738
590
  {
739
- "name": "associatedTokenProgram";
740
- "address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL";
591
+ name: "associatedTokenProgram";
592
+ address: "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL";
741
593
  },
742
594
  {
743
- "name": "systemProgram";
744
- "address": "11111111111111111111111111111111";
595
+ name: "systemProgram";
596
+ address: "11111111111111111111111111111111";
745
597
  }
746
598
  ];
747
- "args": [
599
+ args: [
748
600
  {
749
- "name": "amount";
750
- "type": "u64";
601
+ name: "amount";
602
+ type: "u64";
751
603
  }
752
604
  ];
753
605
  },
754
606
  {
755
- "name": "finalizeSession";
756
- "docs": [
607
+ name: "finalizeSession";
608
+ docs: [
757
609
  "Finalize a session after the DeFi action completes.",
758
610
  "Revokes token delegation, collects fees, closes the SessionAuthority PDA,",
759
611
  "and records the transaction in the audit log.",
760
612
  "Can be called by the agent or permissionlessly (for cleanup of expired sessions)."
761
613
  ];
762
- "discriminator": [
763
- 34,
764
- 148,
765
- 144,
766
- 47,
767
- 37,
768
- 130,
769
- 206,
770
- 161
771
- ];
772
- "accounts": [
614
+ discriminator: [34, 148, 144, 47, 37, 130, 206, 161];
615
+ accounts: [
773
616
  {
774
- "name": "payer";
775
- "writable": true;
776
- "signer": true;
617
+ name: "payer";
618
+ writable: true;
619
+ signer: true;
777
620
  },
778
621
  {
779
- "name": "vault";
780
- "writable": true;
781
- "pda": {
782
- "seeds": [
622
+ name: "vault";
623
+ writable: true;
624
+ pda: {
625
+ seeds: [
783
626
  {
784
- "kind": "const";
785
- "value": [
786
- 118,
787
- 97,
788
- 117,
789
- 108,
790
- 116
791
- ];
627
+ kind: "const";
628
+ value: [118, 97, 117, 108, 116];
792
629
  },
793
630
  {
794
- "kind": "account";
795
- "path": "vault.owner";
796
- "account": "agentVault";
631
+ kind: "account";
632
+ path: "vault.owner";
633
+ account: "agentVault";
797
634
  },
798
635
  {
799
- "kind": "account";
800
- "path": "vault.vault_id";
801
- "account": "agentVault";
636
+ kind: "account";
637
+ path: "vault.vault_id";
638
+ account: "agentVault";
802
639
  }
803
640
  ];
804
641
  };
805
- "relations": [
806
- "policy",
807
- "tracker",
808
- "session"
809
- ];
642
+ relations: ["policy", "tracker", "session"];
810
643
  },
811
644
  {
812
- "name": "policy";
813
- "pda": {
814
- "seeds": [
645
+ name: "policy";
646
+ pda: {
647
+ seeds: [
815
648
  {
816
- "kind": "const";
817
- "value": [
818
- 112,
819
- 111,
820
- 108,
821
- 105,
822
- 99,
823
- 121
824
- ];
649
+ kind: "const";
650
+ value: [112, 111, 108, 105, 99, 121];
825
651
  },
826
652
  {
827
- "kind": "account";
828
- "path": "vault";
653
+ kind: "account";
654
+ path: "vault";
829
655
  }
830
656
  ];
831
657
  };
832
658
  },
833
659
  {
834
- "name": "tracker";
835
- "writable": true;
836
- "pda": {
837
- "seeds": [
660
+ name: "tracker";
661
+ writable: true;
662
+ pda: {
663
+ seeds: [
838
664
  {
839
- "kind": "const";
840
- "value": [
841
- 116,
842
- 114,
843
- 97,
844
- 99,
845
- 107,
846
- 101,
847
- 114
848
- ];
665
+ kind: "const";
666
+ value: [116, 114, 97, 99, 107, 101, 114];
849
667
  },
850
668
  {
851
- "kind": "account";
852
- "path": "vault";
669
+ kind: "account";
670
+ path: "vault";
853
671
  }
854
672
  ];
855
673
  };
856
674
  },
857
675
  {
858
- "name": "session";
859
- "docs": [
676
+ name: "session";
677
+ docs: [
860
678
  "Session rent is returned to the session's agent (who paid for it),",
861
679
  "not the arbitrary payer, to prevent rent theft.",
862
680
  "Seeds include token_mint for per-token concurrent sessions."
863
681
  ];
864
- "writable": true;
865
- "pda": {
866
- "seeds": [
682
+ writable: true;
683
+ pda: {
684
+ seeds: [
867
685
  {
868
- "kind": "const";
869
- "value": [
870
- 115,
871
- 101,
872
- 115,
873
- 115,
874
- 105,
875
- 111,
876
- 110
877
- ];
686
+ kind: "const";
687
+ value: [115, 101, 115, 115, 105, 111, 110];
878
688
  },
879
689
  {
880
- "kind": "account";
881
- "path": "vault";
690
+ kind: "account";
691
+ path: "vault";
882
692
  },
883
693
  {
884
- "kind": "account";
885
- "path": "session.agent";
886
- "account": "sessionAuthority";
694
+ kind: "account";
695
+ path: "session.agent";
696
+ account: "sessionAuthority";
887
697
  },
888
698
  {
889
- "kind": "account";
890
- "path": "session.authorized_token";
891
- "account": "sessionAuthority";
699
+ kind: "account";
700
+ path: "session.authorized_token";
701
+ account: "sessionAuthority";
892
702
  }
893
703
  ];
894
704
  };
895
705
  },
896
706
  {
897
- "name": "sessionRentRecipient";
898
- "docs": [
899
- "Validated in handler to equal session.agent."
900
- ];
901
- "writable": true;
707
+ name: "sessionRentRecipient";
708
+ docs: ["Validated in handler to equal session.agent."];
709
+ writable: true;
902
710
  },
903
711
  {
904
- "name": "vaultTokenAccount";
905
- "docs": [
712
+ name: "vaultTokenAccount";
713
+ docs: [
906
714
  "Vault's PDA token account for the session's token (fee source + delegation revocation)"
907
715
  ];
908
- "writable": true;
909
- "optional": true;
716
+ writable: true;
717
+ optional: true;
910
718
  },
911
719
  {
912
- "name": "feeDestinationTokenAccount";
913
- "docs": [
720
+ name: "feeDestinationTokenAccount";
721
+ docs: [
914
722
  "Developer fee destination token account — must match vault.fee_destination"
915
723
  ];
916
- "writable": true;
917
- "optional": true;
724
+ writable: true;
725
+ optional: true;
918
726
  },
919
727
  {
920
- "name": "protocolTreasuryTokenAccount";
921
- "docs": [
728
+ name: "protocolTreasuryTokenAccount";
729
+ docs: [
922
730
  "Protocol treasury token account — must be owned by PROTOCOL_TREASURY"
923
731
  ];
924
- "writable": true;
925
- "optional": true;
732
+ writable: true;
733
+ optional: true;
926
734
  },
927
735
  {
928
- "name": "tokenProgram";
929
- "address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
736
+ name: "tokenProgram";
737
+ address: "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
930
738
  },
931
739
  {
932
- "name": "systemProgram";
933
- "address": "11111111111111111111111111111111";
740
+ name: "systemProgram";
741
+ address: "11111111111111111111111111111111";
934
742
  }
935
743
  ];
936
- "args": [
744
+ args: [
937
745
  {
938
- "name": "success";
939
- "type": "bool";
746
+ name: "success";
747
+ type: "bool";
940
748
  }
941
749
  ];
942
750
  },
943
751
  {
944
- "name": "initializeVault";
945
- "docs": [
752
+ name: "initializeVault";
753
+ docs: [
946
754
  "Initialize a new agent vault with policy configuration.",
947
755
  "Only the owner can call this. Creates vault PDA, policy PDA, and spend tracker PDA.",
948
756
  "`tracker_tier`: 0 = Standard (200 entries), 1 = Pro (500), 2 = Max (1000)."
949
757
  ];
950
- "discriminator": [
951
- 48,
952
- 191,
953
- 163,
954
- 44,
955
- 71,
956
- 129,
957
- 63,
958
- 164
959
- ];
960
- "accounts": [
758
+ discriminator: [48, 191, 163, 44, 71, 129, 63, 164];
759
+ accounts: [
961
760
  {
962
- "name": "owner";
963
- "writable": true;
964
- "signer": true;
761
+ name: "owner";
762
+ writable: true;
763
+ signer: true;
965
764
  },
966
765
  {
967
- "name": "vault";
968
- "writable": true;
969
- "pda": {
970
- "seeds": [
766
+ name: "vault";
767
+ writable: true;
768
+ pda: {
769
+ seeds: [
971
770
  {
972
- "kind": "const";
973
- "value": [
974
- 118,
975
- 97,
976
- 117,
977
- 108,
978
- 116
979
- ];
771
+ kind: "const";
772
+ value: [118, 97, 117, 108, 116];
980
773
  },
981
774
  {
982
- "kind": "account";
983
- "path": "owner";
775
+ kind: "account";
776
+ path: "owner";
984
777
  },
985
778
  {
986
- "kind": "arg";
987
- "path": "vaultId";
779
+ kind: "arg";
780
+ path: "vaultId";
988
781
  }
989
782
  ];
990
783
  };
991
784
  },
992
785
  {
993
- "name": "policy";
994
- "writable": true;
995
- "pda": {
996
- "seeds": [
786
+ name: "policy";
787
+ writable: true;
788
+ pda: {
789
+ seeds: [
997
790
  {
998
- "kind": "const";
999
- "value": [
1000
- 112,
1001
- 111,
1002
- 108,
1003
- 105,
1004
- 99,
1005
- 121
1006
- ];
791
+ kind: "const";
792
+ value: [112, 111, 108, 105, 99, 121];
1007
793
  },
1008
794
  {
1009
- "kind": "account";
1010
- "path": "vault";
795
+ kind: "account";
796
+ path: "vault";
1011
797
  }
1012
798
  ];
1013
799
  };
1014
800
  },
1015
801
  {
1016
- "name": "tracker";
1017
- "writable": true;
1018
- "pda": {
1019
- "seeds": [
802
+ name: "tracker";
803
+ writable: true;
804
+ pda: {
805
+ seeds: [
1020
806
  {
1021
- "kind": "const";
1022
- "value": [
1023
- 116,
1024
- 114,
1025
- 97,
1026
- 99,
1027
- 107,
1028
- 101,
1029
- 114
1030
- ];
807
+ kind: "const";
808
+ value: [116, 114, 97, 99, 107, 101, 114];
1031
809
  },
1032
810
  {
1033
- "kind": "account";
1034
- "path": "vault";
811
+ kind: "account";
812
+ path: "vault";
1035
813
  }
1036
814
  ];
1037
815
  };
1038
816
  },
1039
817
  {
1040
- "name": "feeDestination";
1041
- "docs": [
1042
- "The protocol treasury that receives fees"
1043
- ];
818
+ name: "feeDestination";
819
+ docs: ["The protocol treasury that receives fees"];
1044
820
  },
1045
821
  {
1046
- "name": "systemProgram";
1047
- "address": "11111111111111111111111111111111";
822
+ name: "systemProgram";
823
+ address: "11111111111111111111111111111111";
1048
824
  }
1049
825
  ];
1050
- "args": [
826
+ args: [
1051
827
  {
1052
- "name": "vaultId";
1053
- "type": "u64";
828
+ name: "vaultId";
829
+ type: "u64";
1054
830
  },
1055
831
  {
1056
- "name": "dailySpendingCapUsd";
1057
- "type": "u64";
832
+ name: "dailySpendingCapUsd";
833
+ type: "u64";
1058
834
  },
1059
835
  {
1060
- "name": "maxTransactionSizeUsd";
1061
- "type": "u64";
836
+ name: "maxTransactionSizeUsd";
837
+ type: "u64";
1062
838
  },
1063
839
  {
1064
- "name": "allowedTokens";
1065
- "type": {
1066
- "vec": {
1067
- "defined": {
1068
- "name": "allowedToken";
840
+ name: "allowedTokens";
841
+ type: {
842
+ vec: {
843
+ defined: {
844
+ name: "allowedToken";
1069
845
  };
1070
846
  };
1071
847
  };
1072
848
  },
1073
849
  {
1074
- "name": "allowedProtocols";
1075
- "type": {
1076
- "vec": "pubkey";
850
+ name: "allowedProtocols";
851
+ type: {
852
+ vec: "pubkey";
1077
853
  };
1078
854
  },
1079
855
  {
1080
- "name": "maxLeverageBps";
1081
- "type": "u16";
856
+ name: "maxLeverageBps";
857
+ type: "u16";
1082
858
  },
1083
859
  {
1084
- "name": "maxConcurrentPositions";
1085
- "type": "u8";
860
+ name: "maxConcurrentPositions";
861
+ type: "u8";
1086
862
  },
1087
863
  {
1088
- "name": "developerFeeRate";
1089
- "type": "u16";
864
+ name: "developerFeeRate";
865
+ type: "u16";
1090
866
  },
1091
867
  {
1092
- "name": "timelockDuration";
1093
- "type": "u64";
868
+ name: "timelockDuration";
869
+ type: "u64";
1094
870
  },
1095
871
  {
1096
- "name": "allowedDestinations";
1097
- "type": {
1098
- "vec": "pubkey";
872
+ name: "allowedDestinations";
873
+ type: {
874
+ vec: "pubkey";
1099
875
  };
1100
876
  },
1101
877
  {
1102
- "name": "trackerTier";
1103
- "type": "u8";
878
+ name: "trackerTier";
879
+ type: "u8";
1104
880
  }
1105
881
  ];
1106
882
  },
1107
883
  {
1108
- "name": "queuePolicyUpdate";
1109
- "docs": [
884
+ name: "queuePolicyUpdate";
885
+ docs: [
1110
886
  "Queue a policy update when timelock is active.",
1111
887
  "Creates a PendingPolicyUpdate PDA that becomes executable after",
1112
888
  "the timelock period expires."
1113
889
  ];
1114
- "discriminator": [
1115
- 149,
1116
- 18,
1117
- 76,
1118
- 197,
1119
- 179,
1120
- 193,
1121
- 91,
1122
- 77
1123
- ];
1124
- "accounts": [
890
+ discriminator: [149, 18, 76, 197, 179, 193, 91, 77];
891
+ accounts: [
1125
892
  {
1126
- "name": "owner";
1127
- "writable": true;
1128
- "signer": true;
1129
- "relations": [
1130
- "vault"
1131
- ];
893
+ name: "owner";
894
+ writable: true;
895
+ signer: true;
896
+ relations: ["vault"];
1132
897
  },
1133
898
  {
1134
- "name": "vault";
1135
- "pda": {
1136
- "seeds": [
899
+ name: "vault";
900
+ pda: {
901
+ seeds: [
1137
902
  {
1138
- "kind": "const";
1139
- "value": [
1140
- 118,
1141
- 97,
1142
- 117,
1143
- 108,
1144
- 116
1145
- ];
903
+ kind: "const";
904
+ value: [118, 97, 117, 108, 116];
1146
905
  },
1147
906
  {
1148
- "kind": "account";
1149
- "path": "owner";
907
+ kind: "account";
908
+ path: "owner";
1150
909
  },
1151
910
  {
1152
- "kind": "account";
1153
- "path": "vault.vault_id";
1154
- "account": "agentVault";
911
+ kind: "account";
912
+ path: "vault.vault_id";
913
+ account: "agentVault";
1155
914
  }
1156
915
  ];
1157
916
  };
1158
- "relations": [
1159
- "policy"
1160
- ];
917
+ relations: ["policy"];
1161
918
  },
1162
919
  {
1163
- "name": "policy";
1164
- "pda": {
1165
- "seeds": [
920
+ name: "policy";
921
+ pda: {
922
+ seeds: [
1166
923
  {
1167
- "kind": "const";
1168
- "value": [
1169
- 112,
1170
- 111,
1171
- 108,
1172
- 105,
1173
- 99,
1174
- 121
1175
- ];
924
+ kind: "const";
925
+ value: [112, 111, 108, 105, 99, 121];
1176
926
  },
1177
927
  {
1178
- "kind": "account";
1179
- "path": "vault";
928
+ kind: "account";
929
+ path: "vault";
1180
930
  }
1181
931
  ];
1182
932
  };
1183
933
  },
1184
934
  {
1185
- "name": "pendingPolicy";
1186
- "writable": true;
1187
- "pda": {
1188
- "seeds": [
935
+ name: "pendingPolicy";
936
+ writable: true;
937
+ pda: {
938
+ seeds: [
1189
939
  {
1190
- "kind": "const";
1191
- "value": [
940
+ kind: "const";
941
+ value: [
1192
942
  112,
1193
943
  101,
1194
944
  110,
@@ -1206,699 +956,551 @@ export type AgentShield = {
1206
956
  ];
1207
957
  },
1208
958
  {
1209
- "kind": "account";
1210
- "path": "vault";
959
+ kind: "account";
960
+ path: "vault";
1211
961
  }
1212
962
  ];
1213
963
  };
1214
964
  },
1215
965
  {
1216
- "name": "systemProgram";
1217
- "address": "11111111111111111111111111111111";
966
+ name: "systemProgram";
967
+ address: "11111111111111111111111111111111";
1218
968
  }
1219
969
  ];
1220
- "args": [
970
+ args: [
1221
971
  {
1222
- "name": "dailySpendingCapUsd";
1223
- "type": {
1224
- "option": "u64";
972
+ name: "dailySpendingCapUsd";
973
+ type: {
974
+ option: "u64";
1225
975
  };
1226
976
  },
1227
977
  {
1228
- "name": "maxTransactionAmountUsd";
1229
- "type": {
1230
- "option": "u64";
978
+ name: "maxTransactionAmountUsd";
979
+ type: {
980
+ option: "u64";
1231
981
  };
1232
982
  },
1233
983
  {
1234
- "name": "allowedTokens";
1235
- "type": {
1236
- "option": {
1237
- "vec": {
1238
- "defined": {
1239
- "name": "allowedToken";
984
+ name: "allowedTokens";
985
+ type: {
986
+ option: {
987
+ vec: {
988
+ defined: {
989
+ name: "allowedToken";
1240
990
  };
1241
991
  };
1242
992
  };
1243
993
  };
1244
994
  },
1245
995
  {
1246
- "name": "allowedProtocols";
1247
- "type": {
1248
- "option": {
1249
- "vec": "pubkey";
996
+ name: "allowedProtocols";
997
+ type: {
998
+ option: {
999
+ vec: "pubkey";
1250
1000
  };
1251
1001
  };
1252
1002
  },
1253
1003
  {
1254
- "name": "maxLeverageBps";
1255
- "type": {
1256
- "option": "u16";
1004
+ name: "maxLeverageBps";
1005
+ type: {
1006
+ option: "u16";
1257
1007
  };
1258
1008
  },
1259
1009
  {
1260
- "name": "canOpenPositions";
1261
- "type": {
1262
- "option": "bool";
1010
+ name: "canOpenPositions";
1011
+ type: {
1012
+ option: "bool";
1263
1013
  };
1264
1014
  },
1265
1015
  {
1266
- "name": "maxConcurrentPositions";
1267
- "type": {
1268
- "option": "u8";
1016
+ name: "maxConcurrentPositions";
1017
+ type: {
1018
+ option: "u8";
1269
1019
  };
1270
1020
  },
1271
1021
  {
1272
- "name": "developerFeeRate";
1273
- "type": {
1274
- "option": "u16";
1022
+ name: "developerFeeRate";
1023
+ type: {
1024
+ option: "u16";
1275
1025
  };
1276
1026
  },
1277
1027
  {
1278
- "name": "timelockDuration";
1279
- "type": {
1280
- "option": "u64";
1028
+ name: "timelockDuration";
1029
+ type: {
1030
+ option: "u64";
1281
1031
  };
1282
1032
  },
1283
1033
  {
1284
- "name": "allowedDestinations";
1285
- "type": {
1286
- "option": {
1287
- "vec": "pubkey";
1034
+ name: "allowedDestinations";
1035
+ type: {
1036
+ option: {
1037
+ vec: "pubkey";
1288
1038
  };
1289
1039
  };
1290
1040
  }
1291
1041
  ];
1292
1042
  },
1293
1043
  {
1294
- "name": "reactivateVault";
1295
- "docs": [
1044
+ name: "reactivateVault";
1045
+ docs: [
1296
1046
  "Reactivate a frozen vault. Optionally rotate the agent key.",
1297
1047
  "Only the owner can call this."
1298
1048
  ];
1299
- "discriminator": [
1300
- 245,
1301
- 50,
1302
- 143,
1303
- 70,
1304
- 114,
1305
- 220,
1306
- 25,
1307
- 251
1308
- ];
1309
- "accounts": [
1049
+ discriminator: [245, 50, 143, 70, 114, 220, 25, 251];
1050
+ accounts: [
1310
1051
  {
1311
- "name": "owner";
1312
- "signer": true;
1313
- "relations": [
1314
- "vault"
1315
- ];
1052
+ name: "owner";
1053
+ signer: true;
1054
+ relations: ["vault"];
1316
1055
  },
1317
1056
  {
1318
- "name": "vault";
1319
- "writable": true;
1320
- "pda": {
1321
- "seeds": [
1057
+ name: "vault";
1058
+ writable: true;
1059
+ pda: {
1060
+ seeds: [
1322
1061
  {
1323
- "kind": "const";
1324
- "value": [
1325
- 118,
1326
- 97,
1327
- 117,
1328
- 108,
1329
- 116
1330
- ];
1062
+ kind: "const";
1063
+ value: [118, 97, 117, 108, 116];
1331
1064
  },
1332
1065
  {
1333
- "kind": "account";
1334
- "path": "owner";
1066
+ kind: "account";
1067
+ path: "owner";
1335
1068
  },
1336
1069
  {
1337
- "kind": "account";
1338
- "path": "vault.vault_id";
1339
- "account": "agentVault";
1070
+ kind: "account";
1071
+ path: "vault.vault_id";
1072
+ account: "agentVault";
1340
1073
  }
1341
1074
  ];
1342
1075
  };
1343
1076
  }
1344
1077
  ];
1345
- "args": [
1078
+ args: [
1346
1079
  {
1347
- "name": "newAgent";
1348
- "type": {
1349
- "option": "pubkey";
1080
+ name: "newAgent";
1081
+ type: {
1082
+ option: "pubkey";
1350
1083
  };
1351
1084
  }
1352
1085
  ];
1353
1086
  },
1354
1087
  {
1355
- "name": "registerAgent";
1356
- "docs": [
1088
+ name: "registerAgent";
1089
+ docs: [
1357
1090
  "Register an agent's signing key to this vault.",
1358
1091
  "Only the owner can call this. One agent per vault."
1359
1092
  ];
1360
- "discriminator": [
1361
- 135,
1362
- 157,
1363
- 66,
1364
- 195,
1365
- 2,
1366
- 113,
1367
- 175,
1368
- 30
1369
- ];
1370
- "accounts": [
1093
+ discriminator: [135, 157, 66, 195, 2, 113, 175, 30];
1094
+ accounts: [
1371
1095
  {
1372
- "name": "owner";
1373
- "signer": true;
1374
- "relations": [
1375
- "vault"
1376
- ];
1096
+ name: "owner";
1097
+ signer: true;
1098
+ relations: ["vault"];
1377
1099
  },
1378
1100
  {
1379
- "name": "vault";
1380
- "writable": true;
1381
- "pda": {
1382
- "seeds": [
1101
+ name: "vault";
1102
+ writable: true;
1103
+ pda: {
1104
+ seeds: [
1383
1105
  {
1384
- "kind": "const";
1385
- "value": [
1386
- 118,
1387
- 97,
1388
- 117,
1389
- 108,
1390
- 116
1391
- ];
1106
+ kind: "const";
1107
+ value: [118, 97, 117, 108, 116];
1392
1108
  },
1393
1109
  {
1394
- "kind": "account";
1395
- "path": "owner";
1110
+ kind: "account";
1111
+ path: "owner";
1396
1112
  },
1397
1113
  {
1398
- "kind": "account";
1399
- "path": "vault.vault_id";
1400
- "account": "agentVault";
1114
+ kind: "account";
1115
+ path: "vault.vault_id";
1116
+ account: "agentVault";
1401
1117
  }
1402
1118
  ];
1403
1119
  };
1404
1120
  }
1405
1121
  ];
1406
- "args": [
1122
+ args: [
1407
1123
  {
1408
- "name": "agent";
1409
- "type": "pubkey";
1124
+ name: "agent";
1125
+ type: "pubkey";
1410
1126
  }
1411
1127
  ];
1412
1128
  },
1413
1129
  {
1414
- "name": "revokeAgent";
1415
- "docs": [
1130
+ name: "revokeAgent";
1131
+ docs: [
1416
1132
  "Kill switch. Immediately freezes the vault, preventing all agent actions.",
1417
1133
  "Only the owner can call this. Funds can still be withdrawn by the owner."
1418
1134
  ];
1419
- "discriminator": [
1420
- 227,
1421
- 60,
1422
- 209,
1423
- 125,
1424
- 240,
1425
- 117,
1426
- 163,
1427
- 73
1428
- ];
1429
- "accounts": [
1135
+ discriminator: [227, 60, 209, 125, 240, 117, 163, 73];
1136
+ accounts: [
1430
1137
  {
1431
- "name": "owner";
1432
- "signer": true;
1433
- "relations": [
1434
- "vault"
1435
- ];
1138
+ name: "owner";
1139
+ signer: true;
1140
+ relations: ["vault"];
1436
1141
  },
1437
1142
  {
1438
- "name": "vault";
1439
- "writable": true;
1440
- "pda": {
1441
- "seeds": [
1143
+ name: "vault";
1144
+ writable: true;
1145
+ pda: {
1146
+ seeds: [
1442
1147
  {
1443
- "kind": "const";
1444
- "value": [
1445
- 118,
1446
- 97,
1447
- 117,
1448
- 108,
1449
- 116
1450
- ];
1148
+ kind: "const";
1149
+ value: [118, 97, 117, 108, 116];
1451
1150
  },
1452
1151
  {
1453
- "kind": "account";
1454
- "path": "owner";
1152
+ kind: "account";
1153
+ path: "owner";
1455
1154
  },
1456
1155
  {
1457
- "kind": "account";
1458
- "path": "vault.vault_id";
1459
- "account": "agentVault";
1156
+ kind: "account";
1157
+ path: "vault.vault_id";
1158
+ account: "agentVault";
1460
1159
  }
1461
1160
  ];
1462
1161
  };
1463
1162
  }
1464
1163
  ];
1465
- "args": [];
1164
+ args: [];
1466
1165
  },
1467
1166
  {
1468
- "name": "updatePolicy";
1469
- "docs": [
1167
+ name: "updatePolicy";
1168
+ docs: [
1470
1169
  "Update the policy configuration for a vault.",
1471
1170
  "Only the owner can call this. Cannot be called by the agent.",
1472
1171
  "Blocked when timelock_duration > 0 — use queue_policy_update instead."
1473
1172
  ];
1474
- "discriminator": [
1475
- 212,
1476
- 245,
1477
- 246,
1478
- 7,
1479
- 163,
1480
- 151,
1481
- 18,
1482
- 57
1483
- ];
1484
- "accounts": [
1173
+ discriminator: [212, 245, 246, 7, 163, 151, 18, 57];
1174
+ accounts: [
1485
1175
  {
1486
- "name": "owner";
1487
- "signer": true;
1488
- "relations": [
1489
- "vault"
1490
- ];
1176
+ name: "owner";
1177
+ signer: true;
1178
+ relations: ["vault"];
1491
1179
  },
1492
1180
  {
1493
- "name": "vault";
1494
- "pda": {
1495
- "seeds": [
1181
+ name: "vault";
1182
+ pda: {
1183
+ seeds: [
1496
1184
  {
1497
- "kind": "const";
1498
- "value": [
1499
- 118,
1500
- 97,
1501
- 117,
1502
- 108,
1503
- 116
1504
- ];
1185
+ kind: "const";
1186
+ value: [118, 97, 117, 108, 116];
1505
1187
  },
1506
1188
  {
1507
- "kind": "account";
1508
- "path": "owner";
1189
+ kind: "account";
1190
+ path: "owner";
1509
1191
  },
1510
1192
  {
1511
- "kind": "account";
1512
- "path": "vault.vault_id";
1513
- "account": "agentVault";
1193
+ kind: "account";
1194
+ path: "vault.vault_id";
1195
+ account: "agentVault";
1514
1196
  }
1515
1197
  ];
1516
1198
  };
1517
- "relations": [
1518
- "policy",
1519
- "tracker"
1520
- ];
1199
+ relations: ["policy", "tracker"];
1521
1200
  },
1522
1201
  {
1523
- "name": "policy";
1524
- "writable": true;
1525
- "pda": {
1526
- "seeds": [
1202
+ name: "policy";
1203
+ writable: true;
1204
+ pda: {
1205
+ seeds: [
1527
1206
  {
1528
- "kind": "const";
1529
- "value": [
1530
- 112,
1531
- 111,
1532
- 108,
1533
- 105,
1534
- 99,
1535
- 121
1536
- ];
1207
+ kind: "const";
1208
+ value: [112, 111, 108, 105, 99, 121];
1537
1209
  },
1538
1210
  {
1539
- "kind": "account";
1540
- "path": "vault";
1211
+ kind: "account";
1212
+ path: "vault";
1541
1213
  }
1542
1214
  ];
1543
1215
  };
1544
1216
  },
1545
1217
  {
1546
- "name": "tracker";
1547
- "writable": true;
1548
- "pda": {
1549
- "seeds": [
1218
+ name: "tracker";
1219
+ writable: true;
1220
+ pda: {
1221
+ seeds: [
1550
1222
  {
1551
- "kind": "const";
1552
- "value": [
1553
- 116,
1554
- 114,
1555
- 97,
1556
- 99,
1557
- 107,
1558
- 101,
1559
- 114
1560
- ];
1223
+ kind: "const";
1224
+ value: [116, 114, 97, 99, 107, 101, 114];
1561
1225
  },
1562
1226
  {
1563
- "kind": "account";
1564
- "path": "vault";
1227
+ kind: "account";
1228
+ path: "vault";
1565
1229
  }
1566
1230
  ];
1567
1231
  };
1568
1232
  }
1569
1233
  ];
1570
- "args": [
1234
+ args: [
1571
1235
  {
1572
- "name": "dailySpendingCapUsd";
1573
- "type": {
1574
- "option": "u64";
1236
+ name: "dailySpendingCapUsd";
1237
+ type: {
1238
+ option: "u64";
1575
1239
  };
1576
1240
  },
1577
1241
  {
1578
- "name": "maxTransactionSizeUsd";
1579
- "type": {
1580
- "option": "u64";
1242
+ name: "maxTransactionSizeUsd";
1243
+ type: {
1244
+ option: "u64";
1581
1245
  };
1582
1246
  },
1583
1247
  {
1584
- "name": "allowedTokens";
1585
- "type": {
1586
- "option": {
1587
- "vec": {
1588
- "defined": {
1589
- "name": "allowedToken";
1248
+ name: "allowedTokens";
1249
+ type: {
1250
+ option: {
1251
+ vec: {
1252
+ defined: {
1253
+ name: "allowedToken";
1590
1254
  };
1591
1255
  };
1592
1256
  };
1593
1257
  };
1594
1258
  },
1595
1259
  {
1596
- "name": "allowedProtocols";
1597
- "type": {
1598
- "option": {
1599
- "vec": "pubkey";
1260
+ name: "allowedProtocols";
1261
+ type: {
1262
+ option: {
1263
+ vec: "pubkey";
1600
1264
  };
1601
1265
  };
1602
1266
  },
1603
1267
  {
1604
- "name": "maxLeverageBps";
1605
- "type": {
1606
- "option": "u16";
1268
+ name: "maxLeverageBps";
1269
+ type: {
1270
+ option: "u16";
1607
1271
  };
1608
1272
  },
1609
1273
  {
1610
- "name": "canOpenPositions";
1611
- "type": {
1612
- "option": "bool";
1274
+ name: "canOpenPositions";
1275
+ type: {
1276
+ option: "bool";
1613
1277
  };
1614
1278
  },
1615
1279
  {
1616
- "name": "maxConcurrentPositions";
1617
- "type": {
1618
- "option": "u8";
1280
+ name: "maxConcurrentPositions";
1281
+ type: {
1282
+ option: "u8";
1619
1283
  };
1620
1284
  },
1621
1285
  {
1622
- "name": "developerFeeRate";
1623
- "type": {
1624
- "option": "u16";
1286
+ name: "developerFeeRate";
1287
+ type: {
1288
+ option: "u16";
1625
1289
  };
1626
1290
  },
1627
1291
  {
1628
- "name": "timelockDuration";
1629
- "type": {
1630
- "option": "u64";
1292
+ name: "timelockDuration";
1293
+ type: {
1294
+ option: "u64";
1631
1295
  };
1632
1296
  },
1633
1297
  {
1634
- "name": "allowedDestinations";
1635
- "type": {
1636
- "option": {
1637
- "vec": "pubkey";
1298
+ name: "allowedDestinations";
1299
+ type: {
1300
+ option: {
1301
+ vec: "pubkey";
1638
1302
  };
1639
1303
  };
1640
1304
  }
1641
1305
  ];
1642
1306
  },
1643
1307
  {
1644
- "name": "validateAndAuthorize";
1645
- "docs": [
1308
+ name: "validateAndAuthorize";
1309
+ docs: [
1646
1310
  "Core permission check. Called by the agent before a DeFi action.",
1647
1311
  "Validates the action against all policy constraints (USD caps, per-token caps).",
1648
1312
  "If approved, creates a SessionAuthority PDA, delegates tokens to agent,",
1649
1313
  "and updates spend tracking.",
1650
1314
  "If denied, reverts the entire transaction (including subsequent DeFi instructions)."
1651
1315
  ];
1652
- "discriminator": [
1653
- 22,
1654
- 183,
1655
- 48,
1656
- 222,
1657
- 218,
1658
- 11,
1659
- 197,
1660
- 152
1661
- ];
1662
- "accounts": [
1316
+ discriminator: [22, 183, 48, 222, 218, 11, 197, 152];
1317
+ accounts: [
1663
1318
  {
1664
- "name": "agent";
1665
- "writable": true;
1666
- "signer": true;
1319
+ name: "agent";
1320
+ writable: true;
1321
+ signer: true;
1667
1322
  },
1668
1323
  {
1669
- "name": "vault";
1670
- "writable": true;
1671
- "pda": {
1672
- "seeds": [
1324
+ name: "vault";
1325
+ writable: true;
1326
+ pda: {
1327
+ seeds: [
1673
1328
  {
1674
- "kind": "const";
1675
- "value": [
1676
- 118,
1677
- 97,
1678
- 117,
1679
- 108,
1680
- 116
1681
- ];
1329
+ kind: "const";
1330
+ value: [118, 97, 117, 108, 116];
1682
1331
  },
1683
1332
  {
1684
- "kind": "account";
1685
- "path": "vault.owner";
1686
- "account": "agentVault";
1333
+ kind: "account";
1334
+ path: "vault.owner";
1335
+ account: "agentVault";
1687
1336
  },
1688
1337
  {
1689
- "kind": "account";
1690
- "path": "vault.vault_id";
1691
- "account": "agentVault";
1338
+ kind: "account";
1339
+ path: "vault.vault_id";
1340
+ account: "agentVault";
1692
1341
  }
1693
1342
  ];
1694
1343
  };
1695
- "relations": [
1696
- "policy",
1697
- "tracker"
1698
- ];
1344
+ relations: ["policy", "tracker"];
1699
1345
  },
1700
1346
  {
1701
- "name": "policy";
1702
- "pda": {
1703
- "seeds": [
1347
+ name: "policy";
1348
+ pda: {
1349
+ seeds: [
1704
1350
  {
1705
- "kind": "const";
1706
- "value": [
1707
- 112,
1708
- 111,
1709
- 108,
1710
- 105,
1711
- 99,
1712
- 121
1713
- ];
1351
+ kind: "const";
1352
+ value: [112, 111, 108, 105, 99, 121];
1714
1353
  },
1715
1354
  {
1716
- "kind": "account";
1717
- "path": "vault";
1355
+ kind: "account";
1356
+ path: "vault";
1718
1357
  }
1719
1358
  ];
1720
1359
  };
1721
1360
  },
1722
1361
  {
1723
- "name": "tracker";
1724
- "writable": true;
1725
- "pda": {
1726
- "seeds": [
1362
+ name: "tracker";
1363
+ writable: true;
1364
+ pda: {
1365
+ seeds: [
1727
1366
  {
1728
- "kind": "const";
1729
- "value": [
1730
- 116,
1731
- 114,
1732
- 97,
1733
- 99,
1734
- 107,
1735
- 101,
1736
- 114
1737
- ];
1367
+ kind: "const";
1368
+ value: [116, 114, 97, 99, 107, 101, 114];
1738
1369
  },
1739
1370
  {
1740
- "kind": "account";
1741
- "path": "vault";
1371
+ kind: "account";
1372
+ path: "vault";
1742
1373
  }
1743
1374
  ];
1744
1375
  };
1745
1376
  },
1746
1377
  {
1747
- "name": "session";
1748
- "docs": [
1378
+ name: "session";
1379
+ docs: [
1749
1380
  "Ephemeral session PDA — `init` ensures no double-authorization.",
1750
1381
  "Seeds include token_mint for per-token concurrent sessions."
1751
1382
  ];
1752
- "writable": true;
1753
- "pda": {
1754
- "seeds": [
1383
+ writable: true;
1384
+ pda: {
1385
+ seeds: [
1755
1386
  {
1756
- "kind": "const";
1757
- "value": [
1758
- 115,
1759
- 101,
1760
- 115,
1761
- 115,
1762
- 105,
1763
- 111,
1764
- 110
1765
- ];
1387
+ kind: "const";
1388
+ value: [115, 101, 115, 115, 105, 111, 110];
1766
1389
  },
1767
1390
  {
1768
- "kind": "account";
1769
- "path": "vault";
1391
+ kind: "account";
1392
+ path: "vault";
1770
1393
  },
1771
1394
  {
1772
- "kind": "account";
1773
- "path": "agent";
1395
+ kind: "account";
1396
+ path: "agent";
1774
1397
  },
1775
1398
  {
1776
- "kind": "arg";
1777
- "path": "tokenMint";
1399
+ kind: "arg";
1400
+ path: "tokenMint";
1778
1401
  }
1779
1402
  ];
1780
1403
  };
1781
1404
  },
1782
1405
  {
1783
- "name": "vaultTokenAccount";
1784
- "docs": [
1406
+ name: "vaultTokenAccount";
1407
+ docs: [
1785
1408
  "Vault's PDA-owned token account for the spend token (delegation source)"
1786
1409
  ];
1787
- "writable": true;
1410
+ writable: true;
1788
1411
  },
1789
1412
  {
1790
- "name": "tokenMintAccount";
1791
- "docs": [
1792
- "The token mint being spent"
1793
- ];
1413
+ name: "tokenMintAccount";
1414
+ docs: ["The token mint being spent"];
1794
1415
  },
1795
1416
  {
1796
- "name": "tokenProgram";
1797
- "address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
1417
+ name: "tokenProgram";
1418
+ address: "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
1798
1419
  },
1799
1420
  {
1800
- "name": "systemProgram";
1801
- "address": "11111111111111111111111111111111";
1421
+ name: "systemProgram";
1422
+ address: "11111111111111111111111111111111";
1802
1423
  }
1803
1424
  ];
1804
- "args": [
1425
+ args: [
1805
1426
  {
1806
- "name": "actionType";
1807
- "type": {
1808
- "defined": {
1809
- "name": "actionType";
1427
+ name: "actionType";
1428
+ type: {
1429
+ defined: {
1430
+ name: "actionType";
1810
1431
  };
1811
1432
  };
1812
1433
  },
1813
1434
  {
1814
- "name": "tokenMint";
1815
- "type": "pubkey";
1435
+ name: "tokenMint";
1436
+ type: "pubkey";
1816
1437
  },
1817
1438
  {
1818
- "name": "amount";
1819
- "type": "u64";
1439
+ name: "amount";
1440
+ type: "u64";
1820
1441
  },
1821
1442
  {
1822
- "name": "targetProtocol";
1823
- "type": "pubkey";
1443
+ name: "targetProtocol";
1444
+ type: "pubkey";
1824
1445
  },
1825
1446
  {
1826
- "name": "leverageBps";
1827
- "type": {
1828
- "option": "u16";
1447
+ name: "leverageBps";
1448
+ type: {
1449
+ option: "u16";
1829
1450
  };
1830
1451
  }
1831
1452
  ];
1832
1453
  },
1833
1454
  {
1834
- "name": "withdrawFunds";
1835
- "docs": [
1455
+ name: "withdrawFunds";
1456
+ docs: [
1836
1457
  "Withdraw tokens from the vault back to the owner.",
1837
1458
  "Works in any vault status (Active or Frozen). Only the owner can call this."
1838
1459
  ];
1839
- "discriminator": [
1840
- 241,
1841
- 36,
1842
- 29,
1843
- 111,
1844
- 208,
1845
- 31,
1846
- 104,
1847
- 217
1848
- ];
1849
- "accounts": [
1460
+ discriminator: [241, 36, 29, 111, 208, 31, 104, 217];
1461
+ accounts: [
1850
1462
  {
1851
- "name": "owner";
1852
- "writable": true;
1853
- "signer": true;
1854
- "relations": [
1855
- "vault"
1856
- ];
1463
+ name: "owner";
1464
+ writable: true;
1465
+ signer: true;
1466
+ relations: ["vault"];
1857
1467
  },
1858
1468
  {
1859
- "name": "vault";
1860
- "pda": {
1861
- "seeds": [
1469
+ name: "vault";
1470
+ pda: {
1471
+ seeds: [
1862
1472
  {
1863
- "kind": "const";
1864
- "value": [
1865
- 118,
1866
- 97,
1867
- 117,
1868
- 108,
1869
- 116
1870
- ];
1473
+ kind: "const";
1474
+ value: [118, 97, 117, 108, 116];
1871
1475
  },
1872
1476
  {
1873
- "kind": "account";
1874
- "path": "owner";
1477
+ kind: "account";
1478
+ path: "owner";
1875
1479
  },
1876
1480
  {
1877
- "kind": "account";
1878
- "path": "vault.vault_id";
1879
- "account": "agentVault";
1481
+ kind: "account";
1482
+ path: "vault.vault_id";
1483
+ account: "agentVault";
1880
1484
  }
1881
1485
  ];
1882
1486
  };
1883
1487
  },
1884
1488
  {
1885
- "name": "mint";
1489
+ name: "mint";
1886
1490
  },
1887
1491
  {
1888
- "name": "vaultTokenAccount";
1889
- "docs": [
1890
- "Vault's PDA-controlled token account"
1891
- ];
1892
- "writable": true;
1893
- "pda": {
1894
- "seeds": [
1492
+ name: "vaultTokenAccount";
1493
+ docs: ["Vault's PDA-controlled token account"];
1494
+ writable: true;
1495
+ pda: {
1496
+ seeds: [
1895
1497
  {
1896
- "kind": "account";
1897
- "path": "vault";
1498
+ kind: "account";
1499
+ path: "vault";
1898
1500
  },
1899
1501
  {
1900
- "kind": "const";
1901
- "value": [
1502
+ kind: "const";
1503
+ value: [
1902
1504
  6,
1903
1505
  221,
1904
1506
  246,
@@ -1934,13 +1536,13 @@ export type AgentShield = {
1934
1536
  ];
1935
1537
  },
1936
1538
  {
1937
- "kind": "account";
1938
- "path": "mint";
1539
+ kind: "account";
1540
+ path: "mint";
1939
1541
  }
1940
1542
  ];
1941
- "program": {
1942
- "kind": "const";
1943
- "value": [
1543
+ program: {
1544
+ kind: "const";
1545
+ value: [
1944
1546
  140,
1945
1547
  151,
1946
1548
  37,
@@ -1978,20 +1580,18 @@ export type AgentShield = {
1978
1580
  };
1979
1581
  },
1980
1582
  {
1981
- "name": "ownerTokenAccount";
1982
- "docs": [
1983
- "Owner's token account to receive funds"
1984
- ];
1985
- "writable": true;
1986
- "pda": {
1987
- "seeds": [
1583
+ name: "ownerTokenAccount";
1584
+ docs: ["Owner's token account to receive funds"];
1585
+ writable: true;
1586
+ pda: {
1587
+ seeds: [
1988
1588
  {
1989
- "kind": "account";
1990
- "path": "owner";
1589
+ kind: "account";
1590
+ path: "owner";
1991
1591
  },
1992
1592
  {
1993
- "kind": "const";
1994
- "value": [
1593
+ kind: "const";
1594
+ value: [
1995
1595
  6,
1996
1596
  221,
1997
1597
  246,
@@ -2027,13 +1627,13 @@ export type AgentShield = {
2027
1627
  ];
2028
1628
  },
2029
1629
  {
2030
- "kind": "account";
2031
- "path": "mint";
1630
+ kind: "account";
1631
+ path: "mint";
2032
1632
  }
2033
1633
  ];
2034
- "program": {
2035
- "kind": "const";
2036
- "value": [
1634
+ program: {
1635
+ kind: "const";
1636
+ value: [
2037
1637
  140,
2038
1638
  151,
2039
1639
  37,
@@ -2071,830 +1671,616 @@ export type AgentShield = {
2071
1671
  };
2072
1672
  },
2073
1673
  {
2074
- "name": "tokenProgram";
2075
- "address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
1674
+ name: "tokenProgram";
1675
+ address: "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
2076
1676
  }
2077
1677
  ];
2078
- "args": [
1678
+ args: [
2079
1679
  {
2080
- "name": "amount";
2081
- "type": "u64";
1680
+ name: "amount";
1681
+ type: "u64";
2082
1682
  }
2083
1683
  ];
2084
1684
  }
2085
1685
  ];
2086
- "accounts": [
2087
- {
2088
- "name": "agentVault";
2089
- "discriminator": [
2090
- 232,
2091
- 220,
2092
- 237,
2093
- 164,
2094
- 157,
2095
- 9,
2096
- 215,
2097
- 194
2098
- ];
1686
+ accounts: [
1687
+ {
1688
+ name: "agentVault";
1689
+ discriminator: [232, 220, 237, 164, 157, 9, 215, 194];
2099
1690
  },
2100
1691
  {
2101
- "name": "pendingPolicyUpdate";
2102
- "discriminator": [
2103
- 77,
2104
- 255,
2105
- 2,
2106
- 51,
2107
- 79,
2108
- 237,
2109
- 183,
2110
- 239
2111
- ];
1692
+ name: "pendingPolicyUpdate";
1693
+ discriminator: [77, 255, 2, 51, 79, 237, 183, 239];
2112
1694
  },
2113
1695
  {
2114
- "name": "policyConfig";
2115
- "discriminator": [
2116
- 219,
2117
- 7,
2118
- 79,
2119
- 84,
2120
- 175,
2121
- 51,
2122
- 148,
2123
- 146
2124
- ];
1696
+ name: "policyConfig";
1697
+ discriminator: [219, 7, 79, 84, 175, 51, 148, 146];
2125
1698
  },
2126
1699
  {
2127
- "name": "sessionAuthority";
2128
- "discriminator": [
2129
- 48,
2130
- 9,
2131
- 30,
2132
- 120,
2133
- 134,
2134
- 35,
2135
- 172,
2136
- 170
2137
- ];
1700
+ name: "sessionAuthority";
1701
+ discriminator: [48, 9, 30, 120, 134, 35, 172, 170];
2138
1702
  },
2139
1703
  {
2140
- "name": "spendTracker";
2141
- "discriminator": [
2142
- 180,
2143
- 17,
2144
- 195,
2145
- 180,
2146
- 162,
2147
- 207,
2148
- 239,
2149
- 205
2150
- ];
1704
+ name: "spendTracker";
1705
+ discriminator: [180, 17, 195, 180, 162, 207, 239, 205];
2151
1706
  }
2152
1707
  ];
2153
- "events": [
2154
- {
2155
- "name": "actionAuthorized";
2156
- "discriminator": [
2157
- 85,
2158
- 90,
2159
- 59,
2160
- 218,
2161
- 126,
2162
- 8,
2163
- 179,
2164
- 63
2165
- ];
1708
+ events: [
1709
+ {
1710
+ name: "actionAuthorized";
1711
+ discriminator: [85, 90, 59, 218, 126, 8, 179, 63];
2166
1712
  },
2167
1713
  {
2168
- "name": "actionDenied";
2169
- "discriminator": [
2170
- 243,
2171
- 239,
2172
- 240,
2173
- 51,
2174
- 151,
2175
- 100,
2176
- 10,
2177
- 100
2178
- ];
1714
+ name: "actionDenied";
1715
+ discriminator: [243, 239, 240, 51, 151, 100, 10, 100];
2179
1716
  },
2180
1717
  {
2181
- "name": "agentRegistered";
2182
- "discriminator": [
2183
- 191,
2184
- 78,
2185
- 217,
2186
- 54,
2187
- 232,
2188
- 100,
2189
- 189,
2190
- 85
2191
- ];
1718
+ name: "agentRegistered";
1719
+ discriminator: [191, 78, 217, 54, 232, 100, 189, 85];
2192
1720
  },
2193
1721
  {
2194
- "name": "agentRevoked";
2195
- "discriminator": [
2196
- 12,
2197
- 251,
2198
- 249,
2199
- 166,
2200
- 122,
2201
- 83,
2202
- 162,
2203
- 116
2204
- ];
1722
+ name: "agentRevoked";
1723
+ discriminator: [12, 251, 249, 166, 122, 83, 162, 116];
2205
1724
  },
2206
1725
  {
2207
- "name": "agentTransferExecuted";
2208
- "discriminator": [
2209
- 88,
2210
- 52,
2211
- 117,
2212
- 69,
2213
- 112,
2214
- 152,
2215
- 167,
2216
- 40
2217
- ];
1726
+ name: "agentTransferExecuted";
1727
+ discriminator: [88, 52, 117, 69, 112, 152, 167, 40];
2218
1728
  },
2219
1729
  {
2220
- "name": "delegationRevoked";
2221
- "discriminator": [
2222
- 59,
2223
- 158,
2224
- 142,
2225
- 49,
2226
- 164,
2227
- 116,
2228
- 220,
2229
- 8
2230
- ];
1730
+ name: "delegationRevoked";
1731
+ discriminator: [59, 158, 142, 49, 164, 116, 220, 8];
2231
1732
  },
2232
1733
  {
2233
- "name": "feesCollected";
2234
- "discriminator": [
2235
- 233,
2236
- 23,
2237
- 117,
2238
- 225,
2239
- 107,
2240
- 178,
2241
- 254,
2242
- 8
2243
- ];
1734
+ name: "feesCollected";
1735
+ discriminator: [233, 23, 117, 225, 107, 178, 254, 8];
2244
1736
  },
2245
1737
  {
2246
- "name": "fundsDeposited";
2247
- "discriminator": [
2248
- 157,
2249
- 209,
2250
- 100,
2251
- 95,
2252
- 59,
2253
- 100,
2254
- 3,
2255
- 68
2256
- ];
1738
+ name: "fundsDeposited";
1739
+ discriminator: [157, 209, 100, 95, 59, 100, 3, 68];
2257
1740
  },
2258
1741
  {
2259
- "name": "fundsWithdrawn";
2260
- "discriminator": [
2261
- 56,
2262
- 130,
2263
- 230,
2264
- 154,
2265
- 35,
2266
- 92,
2267
- 11,
2268
- 118
2269
- ];
1742
+ name: "fundsWithdrawn";
1743
+ discriminator: [56, 130, 230, 154, 35, 92, 11, 118];
2270
1744
  },
2271
1745
  {
2272
- "name": "policyChangeApplied";
2273
- "discriminator": [
2274
- 104,
2275
- 89,
2276
- 5,
2277
- 100,
2278
- 180,
2279
- 202,
2280
- 52,
2281
- 73
2282
- ];
1746
+ name: "policyChangeApplied";
1747
+ discriminator: [104, 89, 5, 100, 180, 202, 52, 73];
2283
1748
  },
2284
1749
  {
2285
- "name": "policyChangeCancelled";
2286
- "discriminator": [
2287
- 200,
2288
- 158,
2289
- 226,
2290
- 255,
2291
- 25,
2292
- 211,
2293
- 30,
2294
- 151
2295
- ];
1750
+ name: "policyChangeCancelled";
1751
+ discriminator: [200, 158, 226, 255, 25, 211, 30, 151];
2296
1752
  },
2297
1753
  {
2298
- "name": "policyChangeQueued";
2299
- "discriminator": [
2300
- 73,
2301
- 231,
2302
- 182,
2303
- 136,
2304
- 141,
2305
- 120,
2306
- 32,
2307
- 79
2308
- ];
1754
+ name: "policyChangeQueued";
1755
+ discriminator: [73, 231, 182, 136, 141, 120, 32, 79];
2309
1756
  },
2310
1757
  {
2311
- "name": "policyUpdated";
2312
- "discriminator": [
2313
- 225,
2314
- 112,
2315
- 112,
2316
- 67,
2317
- 95,
2318
- 236,
2319
- 245,
2320
- 161
2321
- ];
1758
+ name: "policyUpdated";
1759
+ discriminator: [225, 112, 112, 67, 95, 236, 245, 161];
2322
1760
  },
2323
1761
  {
2324
- "name": "sessionFinalized";
2325
- "discriminator": [
2326
- 33,
2327
- 12,
2328
- 242,
2329
- 91,
2330
- 206,
2331
- 42,
2332
- 163,
2333
- 235
2334
- ];
1762
+ name: "sessionFinalized";
1763
+ discriminator: [33, 12, 242, 91, 206, 42, 163, 235];
2335
1764
  },
2336
1765
  {
2337
- "name": "vaultClosed";
2338
- "discriminator": [
2339
- 238,
2340
- 129,
2341
- 38,
2342
- 228,
2343
- 227,
2344
- 118,
2345
- 249,
2346
- 215
2347
- ];
1766
+ name: "vaultClosed";
1767
+ discriminator: [238, 129, 38, 228, 227, 118, 249, 215];
2348
1768
  },
2349
1769
  {
2350
- "name": "vaultCreated";
2351
- "discriminator": [
2352
- 117,
2353
- 25,
2354
- 120,
2355
- 254,
2356
- 75,
2357
- 236,
2358
- 78,
2359
- 115
2360
- ];
1770
+ name: "vaultCreated";
1771
+ discriminator: [117, 25, 120, 254, 75, 236, 78, 115];
2361
1772
  },
2362
1773
  {
2363
- "name": "vaultReactivated";
2364
- "discriminator": [
2365
- 197,
2366
- 52,
2367
- 160,
2368
- 147,
2369
- 159,
2370
- 89,
2371
- 90,
2372
- 28
2373
- ];
1774
+ name: "vaultReactivated";
1775
+ discriminator: [197, 52, 160, 147, 159, 89, 90, 28];
2374
1776
  }
2375
1777
  ];
2376
- "errors": [
1778
+ errors: [
2377
1779
  {
2378
- "code": 6000;
2379
- "name": "vaultNotActive";
2380
- "msg": "Vault is not active";
1780
+ code: 6000;
1781
+ name: "vaultNotActive";
1782
+ msg: "Vault is not active";
2381
1783
  },
2382
1784
  {
2383
- "code": 6001;
2384
- "name": "unauthorizedAgent";
2385
- "msg": "Unauthorized: signer is not the registered agent";
1785
+ code: 6001;
1786
+ name: "unauthorizedAgent";
1787
+ msg: "Unauthorized: signer is not the registered agent";
2386
1788
  },
2387
1789
  {
2388
- "code": 6002;
2389
- "name": "unauthorizedOwner";
2390
- "msg": "Unauthorized: signer is not the vault owner";
1790
+ code: 6002;
1791
+ name: "unauthorizedOwner";
1792
+ msg: "Unauthorized: signer is not the vault owner";
2391
1793
  },
2392
1794
  {
2393
- "code": 6003;
2394
- "name": "tokenNotAllowed";
2395
- "msg": "Token not in allowed list";
1795
+ code: 6003;
1796
+ name: "tokenNotAllowed";
1797
+ msg: "Token not in allowed list";
2396
1798
  },
2397
1799
  {
2398
- "code": 6004;
2399
- "name": "protocolNotAllowed";
2400
- "msg": "Protocol not in allowed list";
1800
+ code: 6004;
1801
+ name: "protocolNotAllowed";
1802
+ msg: "Protocol not in allowed list";
2401
1803
  },
2402
1804
  {
2403
- "code": 6005;
2404
- "name": "transactionTooLarge";
2405
- "msg": "Transaction exceeds maximum single transaction size";
1805
+ code: 6005;
1806
+ name: "transactionTooLarge";
1807
+ msg: "Transaction exceeds maximum single transaction size";
2406
1808
  },
2407
1809
  {
2408
- "code": 6006;
2409
- "name": "dailyCapExceeded";
2410
- "msg": "Daily spending cap would be exceeded";
1810
+ code: 6006;
1811
+ name: "dailyCapExceeded";
1812
+ msg: "Daily spending cap would be exceeded";
2411
1813
  },
2412
1814
  {
2413
- "code": 6007;
2414
- "name": "leverageTooHigh";
2415
- "msg": "Leverage exceeds maximum allowed";
1815
+ code: 6007;
1816
+ name: "leverageTooHigh";
1817
+ msg: "Leverage exceeds maximum allowed";
2416
1818
  },
2417
1819
  {
2418
- "code": 6008;
2419
- "name": "tooManyPositions";
2420
- "msg": "Maximum concurrent open positions reached";
1820
+ code: 6008;
1821
+ name: "tooManyPositions";
1822
+ msg: "Maximum concurrent open positions reached";
2421
1823
  },
2422
1824
  {
2423
- "code": 6009;
2424
- "name": "positionOpeningDisallowed";
2425
- "msg": "Cannot open new positions (policy disallows)";
1825
+ code: 6009;
1826
+ name: "positionOpeningDisallowed";
1827
+ msg: "Cannot open new positions (policy disallows)";
2426
1828
  },
2427
1829
  {
2428
- "code": 6010;
2429
- "name": "sessionExpired";
2430
- "msg": "Session has expired";
1830
+ code: 6010;
1831
+ name: "sessionExpired";
1832
+ msg: "Session has expired";
2431
1833
  },
2432
1834
  {
2433
- "code": 6011;
2434
- "name": "sessionNotAuthorized";
2435
- "msg": "Session not authorized";
1835
+ code: 6011;
1836
+ name: "sessionNotAuthorized";
1837
+ msg: "Session not authorized";
2436
1838
  },
2437
1839
  {
2438
- "code": 6012;
2439
- "name": "invalidSession";
2440
- "msg": "Invalid session: does not belong to this vault";
1840
+ code: 6012;
1841
+ name: "invalidSession";
1842
+ msg: "Invalid session: does not belong to this vault";
2441
1843
  },
2442
1844
  {
2443
- "code": 6013;
2444
- "name": "openPositionsExist";
2445
- "msg": "Vault has open positions, cannot close";
1845
+ code: 6013;
1846
+ name: "openPositionsExist";
1847
+ msg: "Vault has open positions, cannot close";
2446
1848
  },
2447
1849
  {
2448
- "code": 6014;
2449
- "name": "tooManyAllowedTokens";
2450
- "msg": "Policy configuration invalid: too many allowed tokens";
1850
+ code: 6014;
1851
+ name: "tooManyAllowedTokens";
1852
+ msg: "Policy configuration invalid: too many allowed tokens";
2451
1853
  },
2452
1854
  {
2453
- "code": 6015;
2454
- "name": "tooManyAllowedProtocols";
2455
- "msg": "Policy configuration invalid: too many allowed protocols";
1855
+ code: 6015;
1856
+ name: "tooManyAllowedProtocols";
1857
+ msg: "Policy configuration invalid: too many allowed protocols";
2456
1858
  },
2457
1859
  {
2458
- "code": 6016;
2459
- "name": "agentAlreadyRegistered";
2460
- "msg": "Agent already registered for this vault";
1860
+ code: 6016;
1861
+ name: "agentAlreadyRegistered";
1862
+ msg: "Agent already registered for this vault";
2461
1863
  },
2462
1864
  {
2463
- "code": 6017;
2464
- "name": "noAgentRegistered";
2465
- "msg": "No agent registered for this vault";
1865
+ code: 6017;
1866
+ name: "noAgentRegistered";
1867
+ msg: "No agent registered for this vault";
2466
1868
  },
2467
1869
  {
2468
- "code": 6018;
2469
- "name": "vaultNotFrozen";
2470
- "msg": "Vault is not frozen (expected frozen for reactivation)";
1870
+ code: 6018;
1871
+ name: "vaultNotFrozen";
1872
+ msg: "Vault is not frozen (expected frozen for reactivation)";
2471
1873
  },
2472
1874
  {
2473
- "code": 6019;
2474
- "name": "vaultAlreadyClosed";
2475
- "msg": "Vault is already closed";
1875
+ code: 6019;
1876
+ name: "vaultAlreadyClosed";
1877
+ msg: "Vault is already closed";
2476
1878
  },
2477
1879
  {
2478
- "code": 6020;
2479
- "name": "insufficientBalance";
2480
- "msg": "Insufficient vault balance for withdrawal";
1880
+ code: 6020;
1881
+ name: "insufficientBalance";
1882
+ msg: "Insufficient vault balance for withdrawal";
2481
1883
  },
2482
1884
  {
2483
- "code": 6021;
2484
- "name": "developerFeeTooHigh";
2485
- "msg": "Developer fee rate exceeds maximum (50 / 1,000,000 = 0.5 BPS)";
1885
+ code: 6021;
1886
+ name: "developerFeeTooHigh";
1887
+ msg: "Developer fee rate exceeds maximum (500 / 1,000,000 = 5 BPS)";
2486
1888
  },
2487
1889
  {
2488
- "code": 6022;
2489
- "name": "invalidFeeDestination";
2490
- "msg": "Fee destination account invalid";
1890
+ code: 6022;
1891
+ name: "invalidFeeDestination";
1892
+ msg: "Fee destination account invalid";
2491
1893
  },
2492
1894
  {
2493
- "code": 6023;
2494
- "name": "invalidProtocolTreasury";
2495
- "msg": "Protocol treasury account does not match expected address";
1895
+ code: 6023;
1896
+ name: "invalidProtocolTreasury";
1897
+ msg: "Protocol treasury account does not match expected address";
2496
1898
  },
2497
1899
  {
2498
- "code": 6024;
2499
- "name": "tooManySpendEntries";
2500
- "msg": "Spend entry limit reached (too many active entries in rolling window)";
1900
+ code: 6024;
1901
+ name: "tooManySpendEntries";
1902
+ msg: "Spend entry limit reached (too many active entries in rolling window)";
2501
1903
  },
2502
1904
  {
2503
- "code": 6025;
2504
- "name": "invalidAgentKey";
2505
- "msg": "Invalid agent: cannot be the zero address";
1905
+ code: 6025;
1906
+ name: "invalidAgentKey";
1907
+ msg: "Invalid agent: cannot be the zero address";
2506
1908
  },
2507
1909
  {
2508
- "code": 6026;
2509
- "name": "agentIsOwner";
2510
- "msg": "Invalid agent: agent cannot be the vault owner";
1910
+ code: 6026;
1911
+ name: "agentIsOwner";
1912
+ msg: "Invalid agent: agent cannot be the vault owner";
2511
1913
  },
2512
1914
  {
2513
- "code": 6027;
2514
- "name": "overflow";
2515
- "msg": "Arithmetic overflow";
1915
+ code: 6027;
1916
+ name: "overflow";
1917
+ msg: "Arithmetic overflow";
2516
1918
  },
2517
1919
  {
2518
- "code": 6028;
2519
- "name": "delegationFailed";
2520
- "msg": "Token delegation approval failed";
1920
+ code: 6028;
1921
+ name: "delegationFailed";
1922
+ msg: "Token delegation approval failed";
2521
1923
  },
2522
1924
  {
2523
- "code": 6029;
2524
- "name": "revocationFailed";
2525
- "msg": "Token delegation revocation failed";
1925
+ code: 6029;
1926
+ name: "revocationFailed";
1927
+ msg: "Token delegation revocation failed";
2526
1928
  },
2527
1929
  {
2528
- "code": 6030;
2529
- "name": "oracleFeedStale";
2530
- "msg": "Oracle feed value is too stale";
1930
+ code: 6030;
1931
+ name: "oracleFeedStale";
1932
+ msg: "Oracle feed value is too stale";
2531
1933
  },
2532
1934
  {
2533
- "code": 6031;
2534
- "name": "oracleFeedInvalid";
2535
- "msg": "Cannot parse oracle feed data";
1935
+ code: 6031;
1936
+ name: "oracleFeedInvalid";
1937
+ msg: "Cannot parse oracle feed data";
2536
1938
  },
2537
1939
  {
2538
- "code": 6032;
2539
- "name": "tokenSpendBlocked";
2540
- "msg": "Unpriced token cannot be spent (receive-only)";
1940
+ code: 6032;
1941
+ name: "tokenSpendBlocked";
1942
+ msg: "Unpriced token cannot be spent (receive-only)";
2541
1943
  },
2542
1944
  {
2543
- "code": 6033;
2544
- "name": "invalidTokenAccount";
2545
- "msg": "Token account does not belong to vault or has wrong mint";
1945
+ code: 6033;
1946
+ name: "invalidTokenAccount";
1947
+ msg: "Token account does not belong to vault or has wrong mint";
2546
1948
  },
2547
1949
  {
2548
- "code": 6034;
2549
- "name": "oracleAccountMissing";
2550
- "msg": "Oracle-priced token requires feed account in remaining_accounts";
1950
+ code: 6034;
1951
+ name: "oracleAccountMissing";
1952
+ msg: "Oracle-priced token requires feed account in remaining_accounts";
2551
1953
  },
2552
1954
  {
2553
- "code": 6035;
2554
- "name": "perTokenCapExceeded";
2555
- "msg": "Per-token daily spending cap would be exceeded";
1955
+ code: 6035;
1956
+ name: "perTokenCapExceeded";
1957
+ msg: "Per-token daily spending cap would be exceeded";
2556
1958
  },
2557
1959
  {
2558
- "code": 6036;
2559
- "name": "perTokenTxLimitExceeded";
2560
- "msg": "Per-token single transaction limit exceeded";
1960
+ code: 6036;
1961
+ name: "perTokenTxLimitExceeded";
1962
+ msg: "Per-token single transaction limit exceeded";
2561
1963
  },
2562
1964
  {
2563
- "code": 6037;
2564
- "name": "oracleConfidenceTooWide";
2565
- "msg": "Oracle price confidence interval too wide";
1965
+ code: 6037;
1966
+ name: "oracleConfidenceTooWide";
1967
+ msg: "Oracle price confidence interval too wide";
2566
1968
  },
2567
1969
  {
2568
- "code": 6038;
2569
- "name": "oracleUnsupportedType";
2570
- "msg": "Oracle account owner is not a recognized oracle program";
1970
+ code: 6038;
1971
+ name: "oracleUnsupportedType";
1972
+ msg: "Oracle account owner is not a recognized oracle program";
2571
1973
  },
2572
1974
  {
2573
- "code": 6039;
2574
- "name": "oracleNotVerified";
2575
- "msg": "Pyth price update not fully verified by Wormhole";
1975
+ code: 6039;
1976
+ name: "oracleNotVerified";
1977
+ msg: "Pyth price update not fully verified by Wormhole";
2576
1978
  },
2577
1979
  {
2578
- "code": 6040;
2579
- "name": "timelockNotExpired";
2580
- "msg": "Timelock period has not expired yet";
1980
+ code: 6040;
1981
+ name: "timelockNotExpired";
1982
+ msg: "Timelock period has not expired yet";
2581
1983
  },
2582
1984
  {
2583
- "code": 6041;
2584
- "name": "timelockActive";
2585
- "msg": "Vault has timelock active — use queue_policy_update instead";
1985
+ code: 6041;
1986
+ name: "timelockActive";
1987
+ msg: "Vault has timelock active — use queue_policy_update instead";
2586
1988
  },
2587
1989
  {
2588
- "code": 6042;
2589
- "name": "noTimelockConfigured";
2590
- "msg": "No timelock configured on this vault";
1990
+ code: 6042;
1991
+ name: "noTimelockConfigured";
1992
+ msg: "No timelock configured on this vault";
2591
1993
  },
2592
1994
  {
2593
- "code": 6043;
2594
- "name": "destinationNotAllowed";
2595
- "msg": "Destination not in allowed list";
1995
+ code: 6043;
1996
+ name: "destinationNotAllowed";
1997
+ msg: "Destination not in allowed list";
2596
1998
  },
2597
1999
  {
2598
- "code": 6044;
2599
- "name": "tooManyDestinations";
2600
- "msg": "Too many destinations (max 10)";
2000
+ code: 6044;
2001
+ name: "tooManyDestinations";
2002
+ msg: "Too many destinations (max 10)";
2601
2003
  },
2602
2004
  {
2603
- "code": 6045;
2604
- "name": "invalidTrackerTier";
2605
- "msg": "Invalid tracker tier (must be 0, 1, or 2)";
2005
+ code: 6045;
2006
+ name: "invalidTrackerTier";
2007
+ msg: "Invalid tracker tier (must be 0, 1, or 2)";
2606
2008
  }
2607
2009
  ];
2608
- "types": [
2010
+ types: [
2609
2011
  {
2610
- "name": "actionAuthorized";
2611
- "type": {
2612
- "kind": "struct";
2613
- "fields": [
2012
+ name: "actionAuthorized";
2013
+ type: {
2014
+ kind: "struct";
2015
+ fields: [
2614
2016
  {
2615
- "name": "vault";
2616
- "type": "pubkey";
2017
+ name: "vault";
2018
+ type: "pubkey";
2617
2019
  },
2618
2020
  {
2619
- "name": "agent";
2620
- "type": "pubkey";
2021
+ name: "agent";
2022
+ type: "pubkey";
2621
2023
  },
2622
2024
  {
2623
- "name": "actionType";
2624
- "type": {
2625
- "defined": {
2626
- "name": "actionType";
2025
+ name: "actionType";
2026
+ type: {
2027
+ defined: {
2028
+ name: "actionType";
2627
2029
  };
2628
2030
  };
2629
2031
  },
2630
2032
  {
2631
- "name": "tokenMint";
2632
- "type": "pubkey";
2033
+ name: "tokenMint";
2034
+ type: "pubkey";
2633
2035
  },
2634
2036
  {
2635
- "name": "amount";
2636
- "type": "u64";
2037
+ name: "amount";
2038
+ type: "u64";
2637
2039
  },
2638
2040
  {
2639
- "name": "usdAmount";
2640
- "type": "u64";
2041
+ name: "usdAmount";
2042
+ type: "u64";
2641
2043
  },
2642
2044
  {
2643
- "name": "protocol";
2644
- "type": "pubkey";
2045
+ name: "protocol";
2046
+ type: "pubkey";
2645
2047
  },
2646
2048
  {
2647
- "name": "rollingSpendUsdAfter";
2648
- "type": "u64";
2049
+ name: "rollingSpendUsdAfter";
2050
+ type: "u64";
2649
2051
  },
2650
2052
  {
2651
- "name": "dailyCapUsd";
2652
- "type": "u64";
2053
+ name: "dailyCapUsd";
2054
+ type: "u64";
2653
2055
  },
2654
2056
  {
2655
- "name": "delegated";
2656
- "type": "bool";
2057
+ name: "delegated";
2058
+ type: "bool";
2657
2059
  },
2658
2060
  {
2659
- "name": "oraclePrice";
2660
- "type": {
2661
- "option": "i128";
2061
+ name: "oraclePrice";
2062
+ type: {
2063
+ option: "i128";
2662
2064
  };
2663
2065
  },
2664
2066
  {
2665
- "name": "oracleSource";
2666
- "type": {
2667
- "option": "u8";
2067
+ name: "oracleSource";
2068
+ type: {
2069
+ option: "u8";
2668
2070
  };
2669
2071
  },
2670
2072
  {
2671
- "name": "timestamp";
2672
- "type": "i64";
2073
+ name: "timestamp";
2074
+ type: "i64";
2673
2075
  }
2674
2076
  ];
2675
2077
  };
2676
2078
  },
2677
2079
  {
2678
- "name": "actionDenied";
2679
- "type": {
2680
- "kind": "struct";
2681
- "fields": [
2080
+ name: "actionDenied";
2081
+ type: {
2082
+ kind: "struct";
2083
+ fields: [
2682
2084
  {
2683
- "name": "vault";
2684
- "type": "pubkey";
2085
+ name: "vault";
2086
+ type: "pubkey";
2685
2087
  },
2686
2088
  {
2687
- "name": "agent";
2688
- "type": "pubkey";
2089
+ name: "agent";
2090
+ type: "pubkey";
2689
2091
  },
2690
2092
  {
2691
- "name": "reason";
2692
- "type": "string";
2093
+ name: "reason";
2094
+ type: "string";
2693
2095
  },
2694
2096
  {
2695
- "name": "timestamp";
2696
- "type": "i64";
2097
+ name: "timestamp";
2098
+ type: "i64";
2697
2099
  }
2698
2100
  ];
2699
2101
  };
2700
2102
  },
2701
2103
  {
2702
- "name": "actionType";
2703
- "docs": [
2704
- "Action types that agents can request"
2705
- ];
2706
- "type": {
2707
- "kind": "enum";
2708
- "variants": [
2104
+ name: "actionType";
2105
+ docs: ["Action types that agents can request"];
2106
+ type: {
2107
+ kind: "enum";
2108
+ variants: [
2709
2109
  {
2710
- "name": "swap";
2110
+ name: "swap";
2711
2111
  },
2712
2112
  {
2713
- "name": "openPosition";
2113
+ name: "openPosition";
2714
2114
  },
2715
2115
  {
2716
- "name": "closePosition";
2116
+ name: "closePosition";
2717
2117
  },
2718
2118
  {
2719
- "name": "increasePosition";
2119
+ name: "increasePosition";
2720
2120
  },
2721
2121
  {
2722
- "name": "decreasePosition";
2122
+ name: "decreasePosition";
2723
2123
  },
2724
2124
  {
2725
- "name": "deposit";
2125
+ name: "deposit";
2726
2126
  },
2727
2127
  {
2728
- "name": "withdraw";
2128
+ name: "withdraw";
2729
2129
  },
2730
2130
  {
2731
- "name": "transfer";
2131
+ name: "transfer";
2732
2132
  }
2733
2133
  ];
2734
2134
  };
2735
2135
  },
2736
2136
  {
2737
- "name": "agentRegistered";
2738
- "type": {
2739
- "kind": "struct";
2740
- "fields": [
2137
+ name: "agentRegistered";
2138
+ type: {
2139
+ kind: "struct";
2140
+ fields: [
2741
2141
  {
2742
- "name": "vault";
2743
- "type": "pubkey";
2142
+ name: "vault";
2143
+ type: "pubkey";
2744
2144
  },
2745
2145
  {
2746
- "name": "agent";
2747
- "type": "pubkey";
2146
+ name: "agent";
2147
+ type: "pubkey";
2748
2148
  },
2749
2149
  {
2750
- "name": "timestamp";
2751
- "type": "i64";
2150
+ name: "timestamp";
2151
+ type: "i64";
2752
2152
  }
2753
2153
  ];
2754
2154
  };
2755
2155
  },
2756
2156
  {
2757
- "name": "agentRevoked";
2758
- "type": {
2759
- "kind": "struct";
2760
- "fields": [
2157
+ name: "agentRevoked";
2158
+ type: {
2159
+ kind: "struct";
2160
+ fields: [
2761
2161
  {
2762
- "name": "vault";
2763
- "type": "pubkey";
2162
+ name: "vault";
2163
+ type: "pubkey";
2764
2164
  },
2765
2165
  {
2766
- "name": "agent";
2767
- "type": "pubkey";
2166
+ name: "agent";
2167
+ type: "pubkey";
2768
2168
  },
2769
2169
  {
2770
- "name": "timestamp";
2771
- "type": "i64";
2170
+ name: "timestamp";
2171
+ type: "i64";
2772
2172
  }
2773
2173
  ];
2774
2174
  };
2775
2175
  },
2776
2176
  {
2777
- "name": "agentTransferExecuted";
2778
- "type": {
2779
- "kind": "struct";
2780
- "fields": [
2177
+ name: "agentTransferExecuted";
2178
+ type: {
2179
+ kind: "struct";
2180
+ fields: [
2781
2181
  {
2782
- "name": "vault";
2783
- "type": "pubkey";
2182
+ name: "vault";
2183
+ type: "pubkey";
2784
2184
  },
2785
2185
  {
2786
- "name": "destination";
2787
- "type": "pubkey";
2186
+ name: "destination";
2187
+ type: "pubkey";
2788
2188
  },
2789
2189
  {
2790
- "name": "amount";
2791
- "type": "u64";
2190
+ name: "amount";
2191
+ type: "u64";
2792
2192
  },
2793
2193
  {
2794
- "name": "mint";
2795
- "type": "pubkey";
2194
+ name: "mint";
2195
+ type: "pubkey";
2796
2196
  }
2797
2197
  ];
2798
2198
  };
2799
2199
  },
2800
2200
  {
2801
- "name": "agentVault";
2802
- "type": {
2803
- "kind": "struct";
2804
- "fields": [
2201
+ name: "agentVault";
2202
+ type: {
2203
+ kind: "struct";
2204
+ fields: [
2805
2205
  {
2806
- "name": "owner";
2807
- "docs": [
2808
- "The owner who created this vault (has full authority)"
2809
- ];
2810
- "type": "pubkey";
2206
+ name: "owner";
2207
+ docs: ["The owner who created this vault (has full authority)"];
2208
+ type: "pubkey";
2811
2209
  },
2812
2210
  {
2813
- "name": "agent";
2814
- "docs": [
2211
+ name: "agent";
2212
+ docs: [
2815
2213
  "The registered agent's signing key (Pubkey::default() if not yet registered)"
2816
2214
  ];
2817
- "type": "pubkey";
2215
+ type: "pubkey";
2818
2216
  },
2819
2217
  {
2820
- "name": "feeDestination";
2821
- "docs": [
2218
+ name: "feeDestination";
2219
+ docs: [
2822
2220
  "Developer fee destination — the wallet that receives developer fees",
2823
2221
  "on every finalized transaction. IMMUTABLE after initialization — only",
2824
2222
  "`initialize_vault` writes this field. This prevents a compromised owner",
2825
2223
  "key from redirecting fees. Protocol fees go to PROTOCOL_TREASURY separately."
2826
2224
  ];
2827
- "type": "pubkey";
2225
+ type: "pubkey";
2828
2226
  },
2829
2227
  {
2830
- "name": "vaultId";
2831
- "docs": [
2228
+ name: "vaultId";
2229
+ docs: [
2832
2230
  "Unique vault identifier (allows one owner to have multiple vaults)"
2833
2231
  ];
2834
- "type": "u64";
2232
+ type: "u64";
2835
2233
  },
2836
2234
  {
2837
- "name": "status";
2838
- "docs": [
2839
- "Vault status: Active, Frozen, or Closed"
2840
- ];
2841
- "type": {
2842
- "defined": {
2843
- "name": "vaultStatus";
2235
+ name: "status";
2236
+ docs: ["Vault status: Active, Frozen, or Closed"];
2237
+ type: {
2238
+ defined: {
2239
+ name: "vaultStatus";
2844
2240
  };
2845
2241
  };
2846
2242
  },
2847
2243
  {
2848
- "name": "bump";
2849
- "docs": [
2850
- "Bump seed for PDA derivation"
2851
- ];
2852
- "type": "u8";
2244
+ name: "bump";
2245
+ docs: ["Bump seed for PDA derivation"];
2246
+ type: "u8";
2853
2247
  },
2854
2248
  {
2855
- "name": "createdAt";
2856
- "docs": [
2857
- "Unix timestamp of vault creation"
2858
- ];
2859
- "type": "i64";
2249
+ name: "createdAt";
2250
+ docs: ["Unix timestamp of vault creation"];
2251
+ type: "i64";
2860
2252
  },
2861
2253
  {
2862
- "name": "totalTransactions";
2863
- "docs": [
2254
+ name: "totalTransactions";
2255
+ docs: [
2864
2256
  "Total number of agent transactions executed through this vault"
2865
2257
  ];
2866
- "type": "u64";
2258
+ type: "u64";
2867
2259
  },
2868
2260
  {
2869
- "name": "totalVolume";
2870
- "docs": [
2871
- "Total volume processed in token base units"
2872
- ];
2873
- "type": "u64";
2261
+ name: "totalVolume";
2262
+ docs: ["Total volume processed in token base units"];
2263
+ type: "u64";
2874
2264
  },
2875
2265
  {
2876
- "name": "openPositions";
2877
- "docs": [
2878
- "Number of currently open positions (for perps tracking)"
2879
- ];
2880
- "type": "u8";
2266
+ name: "openPositions";
2267
+ docs: ["Number of currently open positions (for perps tracking)"];
2268
+ type: "u8";
2881
2269
  },
2882
2270
  {
2883
- "name": "totalFeesCollected";
2884
- "docs": [
2271
+ name: "totalFeesCollected";
2272
+ docs: [
2885
2273
  "Cumulative developer fees collected from this vault (token base units).",
2886
2274
  "Protocol fees are tracked separately via events."
2887
2275
  ];
2888
- "type": "u64";
2276
+ type: "u64";
2889
2277
  },
2890
2278
  {
2891
- "name": "trackerTier";
2892
- "docs": [
2893
- "Tracker capacity tier chosen at vault creation"
2894
- ];
2895
- "type": {
2896
- "defined": {
2897
- "name": "trackerTier";
2279
+ name: "trackerTier";
2280
+ docs: ["Tracker capacity tier chosen at vault creation"];
2281
+ type: {
2282
+ defined: {
2283
+ name: "trackerTier";
2898
2284
  };
2899
2285
  };
2900
2286
  }
@@ -2902,8 +2288,8 @@ export type AgentShield = {
2902
2288
  };
2903
2289
  },
2904
2290
  {
2905
- "name": "allowedToken";
2906
- "docs": [
2291
+ name: "allowedToken";
2292
+ docs: [
2907
2293
  "Per-token configuration including oracle feed and per-token caps.",
2908
2294
  "Replaces the old `Vec<Pubkey>` allowed_tokens with richer metadata.",
2909
2295
  "",
@@ -2912,843 +2298,803 @@ export type AgentShield = {
2912
2298
  "- `UNPRICED_SENTINEL` ([0xFF; 32]) = unpriced token (receive-only)",
2913
2299
  "- Any other pubkey = Oracle feed account (Pyth PriceUpdateV2 or Switchboard PullFeed)"
2914
2300
  ];
2915
- "type": {
2916
- "kind": "struct";
2917
- "fields": [
2301
+ type: {
2302
+ kind: "struct";
2303
+ fields: [
2918
2304
  {
2919
- "name": "mint";
2920
- "docs": [
2921
- "Token mint address"
2922
- ];
2923
- "type": "pubkey";
2305
+ name: "mint";
2306
+ docs: ["Token mint address"];
2307
+ type: "pubkey";
2924
2308
  },
2925
2309
  {
2926
- "name": "oracleFeed";
2927
- "docs": [
2310
+ name: "oracleFeed";
2311
+ docs: [
2928
2312
  "Oracle feed account (Pyth PriceUpdateV2 or Switchboard PullFeed) for USD pricing.",
2929
2313
  "`Pubkey::default()` = stablecoin (1:1 USD).",
2930
2314
  "`UNPRICED_SENTINEL` = unpriced (receive-only, cannot be spent)."
2931
2315
  ];
2932
- "type": "pubkey";
2316
+ type: "pubkey";
2933
2317
  },
2934
2318
  {
2935
- "name": "decimals";
2936
- "docs": [
2937
- "Token decimals (e.g., 6 for USDC, 9 for SOL)"
2938
- ];
2939
- "type": "u8";
2319
+ name: "decimals";
2320
+ docs: ["Token decimals (e.g., 6 for USDC, 9 for SOL)"];
2321
+ type: "u8";
2940
2322
  },
2941
2323
  {
2942
- "name": "dailyCapBase";
2943
- "docs": [
2324
+ name: "dailyCapBase";
2325
+ docs: [
2944
2326
  "Per-token daily cap in base units (0 = no per-token limit,",
2945
2327
  "only the aggregate USD cap applies)"
2946
2328
  ];
2947
- "type": "u64";
2329
+ type: "u64";
2948
2330
  },
2949
2331
  {
2950
- "name": "maxTxBase";
2951
- "docs": [
2332
+ name: "maxTxBase";
2333
+ docs: [
2952
2334
  "Per-token max single transaction in base units",
2953
2335
  "(0 = no per-token tx limit, only USD tx limit applies)"
2954
2336
  ];
2955
- "type": "u64";
2337
+ type: "u64";
2956
2338
  }
2957
2339
  ];
2958
2340
  };
2959
2341
  },
2960
2342
  {
2961
- "name": "delegationRevoked";
2962
- "type": {
2963
- "kind": "struct";
2964
- "fields": [
2343
+ name: "delegationRevoked";
2344
+ type: {
2345
+ kind: "struct";
2346
+ fields: [
2965
2347
  {
2966
- "name": "vault";
2967
- "type": "pubkey";
2348
+ name: "vault";
2349
+ type: "pubkey";
2968
2350
  },
2969
2351
  {
2970
- "name": "tokenAccount";
2971
- "type": "pubkey";
2352
+ name: "tokenAccount";
2353
+ type: "pubkey";
2972
2354
  },
2973
2355
  {
2974
- "name": "timestamp";
2975
- "type": "i64";
2356
+ name: "timestamp";
2357
+ type: "i64";
2976
2358
  }
2977
2359
  ];
2978
2360
  };
2979
2361
  },
2980
2362
  {
2981
- "name": "feesCollected";
2982
- "type": {
2983
- "kind": "struct";
2984
- "fields": [
2363
+ name: "feesCollected";
2364
+ type: {
2365
+ kind: "struct";
2366
+ fields: [
2985
2367
  {
2986
- "name": "vault";
2987
- "type": "pubkey";
2368
+ name: "vault";
2369
+ type: "pubkey";
2988
2370
  },
2989
2371
  {
2990
- "name": "tokenMint";
2991
- "type": "pubkey";
2372
+ name: "tokenMint";
2373
+ type: "pubkey";
2992
2374
  },
2993
2375
  {
2994
- "name": "protocolFeeAmount";
2995
- "type": "u64";
2376
+ name: "protocolFeeAmount";
2377
+ type: "u64";
2996
2378
  },
2997
2379
  {
2998
- "name": "developerFeeAmount";
2999
- "type": "u64";
2380
+ name: "developerFeeAmount";
2381
+ type: "u64";
3000
2382
  },
3001
2383
  {
3002
- "name": "protocolFeeRate";
3003
- "type": "u16";
2384
+ name: "protocolFeeRate";
2385
+ type: "u16";
3004
2386
  },
3005
2387
  {
3006
- "name": "developerFeeRate";
3007
- "type": "u16";
2388
+ name: "developerFeeRate";
2389
+ type: "u16";
3008
2390
  },
3009
2391
  {
3010
- "name": "transactionAmount";
3011
- "type": "u64";
2392
+ name: "transactionAmount";
2393
+ type: "u64";
3012
2394
  },
3013
2395
  {
3014
- "name": "protocolTreasury";
3015
- "type": "pubkey";
2396
+ name: "protocolTreasury";
2397
+ type: "pubkey";
3016
2398
  },
3017
2399
  {
3018
- "name": "developerFeeDestination";
3019
- "type": "pubkey";
2400
+ name: "developerFeeDestination";
2401
+ type: "pubkey";
3020
2402
  },
3021
2403
  {
3022
- "name": "cumulativeDeveloperFees";
3023
- "type": "u64";
2404
+ name: "cumulativeDeveloperFees";
2405
+ type: "u64";
3024
2406
  },
3025
2407
  {
3026
- "name": "timestamp";
3027
- "type": "i64";
2408
+ name: "timestamp";
2409
+ type: "i64";
3028
2410
  }
3029
2411
  ];
3030
2412
  };
3031
2413
  },
3032
2414
  {
3033
- "name": "fundsDeposited";
3034
- "type": {
3035
- "kind": "struct";
3036
- "fields": [
2415
+ name: "fundsDeposited";
2416
+ type: {
2417
+ kind: "struct";
2418
+ fields: [
3037
2419
  {
3038
- "name": "vault";
3039
- "type": "pubkey";
2420
+ name: "vault";
2421
+ type: "pubkey";
3040
2422
  },
3041
2423
  {
3042
- "name": "tokenMint";
3043
- "type": "pubkey";
2424
+ name: "tokenMint";
2425
+ type: "pubkey";
3044
2426
  },
3045
2427
  {
3046
- "name": "amount";
3047
- "type": "u64";
2428
+ name: "amount";
2429
+ type: "u64";
3048
2430
  },
3049
2431
  {
3050
- "name": "timestamp";
3051
- "type": "i64";
2432
+ name: "timestamp";
2433
+ type: "i64";
3052
2434
  }
3053
2435
  ];
3054
2436
  };
3055
2437
  },
3056
2438
  {
3057
- "name": "fundsWithdrawn";
3058
- "type": {
3059
- "kind": "struct";
3060
- "fields": [
2439
+ name: "fundsWithdrawn";
2440
+ type: {
2441
+ kind: "struct";
2442
+ fields: [
3061
2443
  {
3062
- "name": "vault";
3063
- "type": "pubkey";
2444
+ name: "vault";
2445
+ type: "pubkey";
3064
2446
  },
3065
2447
  {
3066
- "name": "tokenMint";
3067
- "type": "pubkey";
2448
+ name: "tokenMint";
2449
+ type: "pubkey";
3068
2450
  },
3069
2451
  {
3070
- "name": "amount";
3071
- "type": "u64";
2452
+ name: "amount";
2453
+ type: "u64";
3072
2454
  },
3073
2455
  {
3074
- "name": "destination";
3075
- "type": "pubkey";
2456
+ name: "destination";
2457
+ type: "pubkey";
3076
2458
  },
3077
2459
  {
3078
- "name": "timestamp";
3079
- "type": "i64";
2460
+ name: "timestamp";
2461
+ type: "i64";
3080
2462
  }
3081
2463
  ];
3082
2464
  };
3083
2465
  },
3084
2466
  {
3085
- "name": "pendingPolicyUpdate";
3086
- "docs": [
2467
+ name: "pendingPolicyUpdate";
2468
+ docs: [
3087
2469
  "Queued policy update that becomes executable after a timelock period.",
3088
2470
  "Created by `queue_policy_update`, applied by `apply_pending_policy`,",
3089
2471
  "or cancelled by `cancel_pending_policy`.",
3090
2472
  "",
3091
- "PDA seeds: `[b\"pending_policy\", vault.key().as_ref()]`"
2473
+ 'PDA seeds: `[b"pending_policy", vault.key().as_ref()]`'
3092
2474
  ];
3093
- "type": {
3094
- "kind": "struct";
3095
- "fields": [
2475
+ type: {
2476
+ kind: "struct";
2477
+ fields: [
3096
2478
  {
3097
- "name": "vault";
3098
- "docs": [
3099
- "Associated vault pubkey"
3100
- ];
3101
- "type": "pubkey";
2479
+ name: "vault";
2480
+ docs: ["Associated vault pubkey"];
2481
+ type: "pubkey";
3102
2482
  },
3103
2483
  {
3104
- "name": "queuedAt";
3105
- "docs": [
3106
- "Unix timestamp when this update was queued"
3107
- ];
3108
- "type": "i64";
2484
+ name: "queuedAt";
2485
+ docs: ["Unix timestamp when this update was queued"];
2486
+ type: "i64";
3109
2487
  },
3110
2488
  {
3111
- "name": "executesAt";
3112
- "docs": [
3113
- "Unix timestamp when this update becomes executable"
3114
- ];
3115
- "type": "i64";
2489
+ name: "executesAt";
2490
+ docs: ["Unix timestamp when this update becomes executable"];
2491
+ type: "i64";
3116
2492
  },
3117
2493
  {
3118
- "name": "dailySpendingCapUsd";
3119
- "type": {
3120
- "option": "u64";
2494
+ name: "dailySpendingCapUsd";
2495
+ type: {
2496
+ option: "u64";
3121
2497
  };
3122
2498
  },
3123
2499
  {
3124
- "name": "maxTransactionAmountUsd";
3125
- "type": {
3126
- "option": "u64";
2500
+ name: "maxTransactionAmountUsd";
2501
+ type: {
2502
+ option: "u64";
3127
2503
  };
3128
2504
  },
3129
2505
  {
3130
- "name": "allowedTokens";
3131
- "type": {
3132
- "option": {
3133
- "vec": {
3134
- "defined": {
3135
- "name": "allowedToken";
2506
+ name: "allowedTokens";
2507
+ type: {
2508
+ option: {
2509
+ vec: {
2510
+ defined: {
2511
+ name: "allowedToken";
3136
2512
  };
3137
2513
  };
3138
2514
  };
3139
2515
  };
3140
2516
  },
3141
2517
  {
3142
- "name": "allowedProtocols";
3143
- "type": {
3144
- "option": {
3145
- "vec": "pubkey";
2518
+ name: "allowedProtocols";
2519
+ type: {
2520
+ option: {
2521
+ vec: "pubkey";
3146
2522
  };
3147
2523
  };
3148
2524
  },
3149
2525
  {
3150
- "name": "maxLeverageBps";
3151
- "type": {
3152
- "option": "u16";
2526
+ name: "maxLeverageBps";
2527
+ type: {
2528
+ option: "u16";
3153
2529
  };
3154
2530
  },
3155
2531
  {
3156
- "name": "canOpenPositions";
3157
- "type": {
3158
- "option": "bool";
2532
+ name: "canOpenPositions";
2533
+ type: {
2534
+ option: "bool";
3159
2535
  };
3160
2536
  },
3161
2537
  {
3162
- "name": "maxConcurrentPositions";
3163
- "type": {
3164
- "option": "u8";
2538
+ name: "maxConcurrentPositions";
2539
+ type: {
2540
+ option: "u8";
3165
2541
  };
3166
2542
  },
3167
2543
  {
3168
- "name": "developerFeeRate";
3169
- "type": {
3170
- "option": "u16";
2544
+ name: "developerFeeRate";
2545
+ type: {
2546
+ option: "u16";
3171
2547
  };
3172
2548
  },
3173
2549
  {
3174
- "name": "timelockDuration";
3175
- "type": {
3176
- "option": "u64";
2550
+ name: "timelockDuration";
2551
+ type: {
2552
+ option: "u64";
3177
2553
  };
3178
2554
  },
3179
2555
  {
3180
- "name": "allowedDestinations";
3181
- "type": {
3182
- "option": {
3183
- "vec": "pubkey";
2556
+ name: "allowedDestinations";
2557
+ type: {
2558
+ option: {
2559
+ vec: "pubkey";
3184
2560
  };
3185
2561
  };
3186
2562
  },
3187
2563
  {
3188
- "name": "bump";
3189
- "docs": [
3190
- "Bump seed for PDA"
3191
- ];
3192
- "type": "u8";
2564
+ name: "bump";
2565
+ docs: ["Bump seed for PDA"];
2566
+ type: "u8";
3193
2567
  }
3194
2568
  ];
3195
2569
  };
3196
2570
  },
3197
2571
  {
3198
- "name": "policyChangeApplied";
3199
- "type": {
3200
- "kind": "struct";
3201
- "fields": [
2572
+ name: "policyChangeApplied";
2573
+ type: {
2574
+ kind: "struct";
2575
+ fields: [
3202
2576
  {
3203
- "name": "vault";
3204
- "type": "pubkey";
2577
+ name: "vault";
2578
+ type: "pubkey";
3205
2579
  },
3206
2580
  {
3207
- "name": "appliedAt";
3208
- "type": "i64";
2581
+ name: "appliedAt";
2582
+ type: "i64";
3209
2583
  }
3210
2584
  ];
3211
2585
  };
3212
2586
  },
3213
2587
  {
3214
- "name": "policyChangeCancelled";
3215
- "type": {
3216
- "kind": "struct";
3217
- "fields": [
2588
+ name: "policyChangeCancelled";
2589
+ type: {
2590
+ kind: "struct";
2591
+ fields: [
3218
2592
  {
3219
- "name": "vault";
3220
- "type": "pubkey";
2593
+ name: "vault";
2594
+ type: "pubkey";
3221
2595
  }
3222
2596
  ];
3223
2597
  };
3224
2598
  },
3225
2599
  {
3226
- "name": "policyChangeQueued";
3227
- "type": {
3228
- "kind": "struct";
3229
- "fields": [
2600
+ name: "policyChangeQueued";
2601
+ type: {
2602
+ kind: "struct";
2603
+ fields: [
3230
2604
  {
3231
- "name": "vault";
3232
- "type": "pubkey";
2605
+ name: "vault";
2606
+ type: "pubkey";
3233
2607
  },
3234
2608
  {
3235
- "name": "executesAt";
3236
- "type": "i64";
2609
+ name: "executesAt";
2610
+ type: "i64";
3237
2611
  }
3238
2612
  ];
3239
2613
  };
3240
2614
  },
3241
2615
  {
3242
- "name": "policyConfig";
3243
- "type": {
3244
- "kind": "struct";
3245
- "fields": [
2616
+ name: "policyConfig";
2617
+ type: {
2618
+ kind: "struct";
2619
+ fields: [
3246
2620
  {
3247
- "name": "vault";
3248
- "docs": [
3249
- "Associated vault pubkey"
3250
- ];
3251
- "type": "pubkey";
2621
+ name: "vault";
2622
+ docs: ["Associated vault pubkey"];
2623
+ type: "pubkey";
3252
2624
  },
3253
2625
  {
3254
- "name": "dailySpendingCapUsd";
3255
- "docs": [
2626
+ name: "dailySpendingCapUsd";
2627
+ docs: [
3256
2628
  "Maximum aggregate spend per rolling 24h period in USD (6 decimals).",
3257
2629
  "$500 = 500_000_000. This is the primary spending cap."
3258
2630
  ];
3259
- "type": "u64";
2631
+ type: "u64";
3260
2632
  },
3261
2633
  {
3262
- "name": "maxTransactionSizeUsd";
3263
- "docs": [
3264
- "Maximum single transaction size in USD (6 decimals)."
3265
- ];
3266
- "type": "u64";
2634
+ name: "maxTransactionSizeUsd";
2635
+ docs: ["Maximum single transaction size in USD (6 decimals)."];
2636
+ type: "u64";
3267
2637
  },
3268
2638
  {
3269
- "name": "allowedTokens";
3270
- "docs": [
2639
+ name: "allowedTokens";
2640
+ docs: [
3271
2641
  "Allowed token mints with oracle feeds and per-token caps.",
3272
2642
  "Bounded to MAX_ALLOWED_TOKENS entries."
3273
2643
  ];
3274
- "type": {
3275
- "vec": {
3276
- "defined": {
3277
- "name": "allowedToken";
2644
+ type: {
2645
+ vec: {
2646
+ defined: {
2647
+ name: "allowedToken";
3278
2648
  };
3279
2649
  };
3280
2650
  };
3281
2651
  },
3282
2652
  {
3283
- "name": "allowedProtocols";
3284
- "docs": [
2653
+ name: "allowedProtocols";
2654
+ docs: [
3285
2655
  "Allowed program IDs the agent can call (Jupiter, Flash Trade, etc.)",
3286
2656
  "Bounded to MAX_ALLOWED_PROTOCOLS entries"
3287
2657
  ];
3288
- "type": {
3289
- "vec": "pubkey";
2658
+ type: {
2659
+ vec: "pubkey";
3290
2660
  };
3291
2661
  },
3292
2662
  {
3293
- "name": "maxLeverageBps";
3294
- "docs": [
2663
+ name: "maxLeverageBps";
2664
+ docs: [
3295
2665
  "Maximum leverage multiplier in basis points (e.g., 10000 = 100x, 1000 = 10x)",
3296
2666
  "Set to 0 to disallow leveraged positions entirely"
3297
2667
  ];
3298
- "type": "u16";
2668
+ type: "u16";
3299
2669
  },
3300
2670
  {
3301
- "name": "canOpenPositions";
3302
- "docs": [
2671
+ name: "canOpenPositions";
2672
+ docs: [
3303
2673
  "Whether the agent can open new positions (vs only close existing)"
3304
2674
  ];
3305
- "type": "bool";
2675
+ type: "bool";
3306
2676
  },
3307
2677
  {
3308
- "name": "maxConcurrentPositions";
3309
- "docs": [
3310
- "Maximum number of concurrent open positions"
3311
- ];
3312
- "type": "u8";
2678
+ name: "maxConcurrentPositions";
2679
+ docs: ["Maximum number of concurrent open positions"];
2680
+ type: "u8";
3313
2681
  },
3314
2682
  {
3315
- "name": "developerFeeRate";
3316
- "docs": [
2683
+ name: "developerFeeRate";
2684
+ docs: [
3317
2685
  "Developer fee rate (rate / 1,000,000). Applied to every finalized",
3318
2686
  "transaction. Fee deducted from vault, transferred to vault's",
3319
- "fee_destination. Max MAX_DEVELOPER_FEE_RATE (50 = 0.5 BPS).",
2687
+ "fee_destination. Max MAX_DEVELOPER_FEE_RATE (500 = 5 BPS).",
3320
2688
  "Set to 0 for no developer fee. Protocol fee is always applied",
3321
2689
  "separately at PROTOCOL_FEE_RATE."
3322
2690
  ];
3323
- "type": "u16";
2691
+ type: "u16";
3324
2692
  },
3325
2693
  {
3326
- "name": "timelockDuration";
3327
- "docs": [
2694
+ name: "timelockDuration";
2695
+ docs: [
3328
2696
  "Timelock duration in seconds for policy changes. 0 = no timelock",
3329
2697
  "(immediate updates allowed). When > 0, policy changes must go",
3330
2698
  "through queue_policy_update → apply_pending_policy."
3331
2699
  ];
3332
- "type": "u64";
2700
+ type: "u64";
3333
2701
  },
3334
2702
  {
3335
- "name": "allowedDestinations";
3336
- "docs": [
2703
+ name: "allowedDestinations";
2704
+ docs: [
3337
2705
  "Allowed destination addresses for agent transfers.",
3338
2706
  "Empty = any destination allowed. Bounded to MAX_ALLOWED_DESTINATIONS."
3339
2707
  ];
3340
- "type": {
3341
- "vec": "pubkey";
2708
+ type: {
2709
+ vec: "pubkey";
3342
2710
  };
3343
2711
  },
3344
2712
  {
3345
- "name": "bump";
3346
- "docs": [
3347
- "Bump seed for PDA"
3348
- ];
3349
- "type": "u8";
2713
+ name: "bump";
2714
+ docs: ["Bump seed for PDA"];
2715
+ type: "u8";
3350
2716
  }
3351
2717
  ];
3352
2718
  };
3353
2719
  },
3354
2720
  {
3355
- "name": "policyUpdated";
3356
- "type": {
3357
- "kind": "struct";
3358
- "fields": [
2721
+ name: "policyUpdated";
2722
+ type: {
2723
+ kind: "struct";
2724
+ fields: [
3359
2725
  {
3360
- "name": "vault";
3361
- "type": "pubkey";
2726
+ name: "vault";
2727
+ type: "pubkey";
3362
2728
  },
3363
2729
  {
3364
- "name": "dailyCapUsd";
3365
- "type": "u64";
2730
+ name: "dailyCapUsd";
2731
+ type: "u64";
3366
2732
  },
3367
2733
  {
3368
- "name": "maxTransactionSizeUsd";
3369
- "type": "u64";
2734
+ name: "maxTransactionSizeUsd";
2735
+ type: "u64";
3370
2736
  },
3371
2737
  {
3372
- "name": "allowedTokensCount";
3373
- "type": "u8";
2738
+ name: "allowedTokensCount";
2739
+ type: "u8";
3374
2740
  },
3375
2741
  {
3376
- "name": "allowedProtocolsCount";
3377
- "type": "u8";
2742
+ name: "allowedProtocolsCount";
2743
+ type: "u8";
3378
2744
  },
3379
2745
  {
3380
- "name": "maxLeverageBps";
3381
- "type": "u16";
2746
+ name: "maxLeverageBps";
2747
+ type: "u16";
3382
2748
  },
3383
2749
  {
3384
- "name": "developerFeeRate";
3385
- "type": "u16";
2750
+ name: "developerFeeRate";
2751
+ type: "u16";
3386
2752
  },
3387
2753
  {
3388
- "name": "timestamp";
3389
- "type": "i64";
2754
+ name: "timestamp";
2755
+ type: "i64";
3390
2756
  }
3391
2757
  ];
3392
2758
  };
3393
2759
  },
3394
2760
  {
3395
- "name": "sessionAuthority";
3396
- "type": {
3397
- "kind": "struct";
3398
- "fields": [
2761
+ name: "sessionAuthority";
2762
+ type: {
2763
+ kind: "struct";
2764
+ fields: [
3399
2765
  {
3400
- "name": "vault";
3401
- "docs": [
3402
- "Associated vault"
3403
- ];
3404
- "type": "pubkey";
2766
+ name: "vault";
2767
+ docs: ["Associated vault"];
2768
+ type: "pubkey";
3405
2769
  },
3406
2770
  {
3407
- "name": "agent";
3408
- "docs": [
3409
- "The agent who initiated this session"
3410
- ];
3411
- "type": "pubkey";
2771
+ name: "agent";
2772
+ docs: ["The agent who initiated this session"];
2773
+ type: "pubkey";
3412
2774
  },
3413
2775
  {
3414
- "name": "authorized";
3415
- "docs": [
2776
+ name: "authorized";
2777
+ docs: [
3416
2778
  "Whether this session has been authorized by the permission check"
3417
2779
  ];
3418
- "type": "bool";
2780
+ type: "bool";
3419
2781
  },
3420
2782
  {
3421
- "name": "authorizedAmount";
3422
- "docs": [
3423
- "Authorized action details (for verification in finalize)"
3424
- ];
3425
- "type": "u64";
2783
+ name: "authorizedAmount";
2784
+ docs: ["Authorized action details (for verification in finalize)"];
2785
+ type: "u64";
3426
2786
  },
3427
2787
  {
3428
- "name": "authorizedToken";
3429
- "type": "pubkey";
2788
+ name: "authorizedToken";
2789
+ type: "pubkey";
3430
2790
  },
3431
2791
  {
3432
- "name": "authorizedProtocol";
3433
- "type": "pubkey";
2792
+ name: "authorizedProtocol";
2793
+ type: "pubkey";
3434
2794
  },
3435
2795
  {
3436
- "name": "actionType";
3437
- "docs": [
2796
+ name: "actionType";
2797
+ docs: [
3438
2798
  "The action type that was authorized (stored so finalize can record it)"
3439
2799
  ];
3440
- "type": {
3441
- "defined": {
3442
- "name": "actionType";
2800
+ type: {
2801
+ defined: {
2802
+ name: "actionType";
3443
2803
  };
3444
2804
  };
3445
2805
  },
3446
2806
  {
3447
- "name": "expiresAtSlot";
3448
- "docs": [
3449
- "Slot-based expiry: session is valid until this slot"
3450
- ];
3451
- "type": "u64";
2807
+ name: "expiresAtSlot";
2808
+ docs: ["Slot-based expiry: session is valid until this slot"];
2809
+ type: "u64";
3452
2810
  },
3453
2811
  {
3454
- "name": "delegated";
3455
- "docs": [
3456
- "Whether token delegation was set up (approve CPI)"
3457
- ];
3458
- "type": "bool";
2812
+ name: "delegated";
2813
+ docs: ["Whether token delegation was set up (approve CPI)"];
2814
+ type: "bool";
3459
2815
  },
3460
2816
  {
3461
- "name": "delegationTokenAccount";
3462
- "docs": [
2817
+ name: "delegationTokenAccount";
2818
+ docs: [
3463
2819
  "The vault's token account that was delegated to the agent",
3464
2820
  "(only meaningful when delegated == true)"
3465
2821
  ];
3466
- "type": "pubkey";
2822
+ type: "pubkey";
3467
2823
  },
3468
2824
  {
3469
- "name": "bump";
3470
- "docs": [
3471
- "Bump seed for PDA"
3472
- ];
3473
- "type": "u8";
2825
+ name: "bump";
2826
+ docs: ["Bump seed for PDA"];
2827
+ type: "u8";
3474
2828
  }
3475
2829
  ];
3476
2830
  };
3477
2831
  },
3478
2832
  {
3479
- "name": "sessionFinalized";
3480
- "type": {
3481
- "kind": "struct";
3482
- "fields": [
2833
+ name: "sessionFinalized";
2834
+ type: {
2835
+ kind: "struct";
2836
+ fields: [
3483
2837
  {
3484
- "name": "vault";
3485
- "type": "pubkey";
2838
+ name: "vault";
2839
+ type: "pubkey";
3486
2840
  },
3487
2841
  {
3488
- "name": "agent";
3489
- "type": "pubkey";
2842
+ name: "agent";
2843
+ type: "pubkey";
3490
2844
  },
3491
2845
  {
3492
- "name": "success";
3493
- "type": "bool";
2846
+ name: "success";
2847
+ type: "bool";
3494
2848
  },
3495
2849
  {
3496
- "name": "isExpired";
3497
- "type": "bool";
2850
+ name: "isExpired";
2851
+ type: "bool";
3498
2852
  },
3499
2853
  {
3500
- "name": "timestamp";
3501
- "type": "i64";
2854
+ name: "timestamp";
2855
+ type: "i64";
3502
2856
  }
3503
2857
  ];
3504
2858
  };
3505
2859
  },
3506
2860
  {
3507
- "name": "spendEntry";
3508
- "type": {
3509
- "kind": "struct";
3510
- "fields": [
2861
+ name: "spendEntry";
2862
+ type: {
2863
+ kind: "struct";
2864
+ fields: [
3511
2865
  {
3512
- "name": "tokenIndex";
3513
- "docs": [
2866
+ name: "tokenIndex";
2867
+ docs: [
3514
2868
  "Index into PolicyConfig.allowed_tokens[] (0-9).",
3515
2869
  "Compact representation — avoids storing full 32-byte Pubkey per entry.",
3516
2870
  "Invalidated when token list changes (rolling_spends is cleared)."
3517
2871
  ];
3518
- "type": "u8";
2872
+ type: "u8";
3519
2873
  },
3520
2874
  {
3521
- "name": "usdAmount";
3522
- "docs": [
2875
+ name: "usdAmount";
2876
+ docs: [
3523
2877
  "USD value of this spend (6 decimals, e.g., $500 = 500_000_000)"
3524
2878
  ];
3525
- "type": "u64";
2879
+ type: "u64";
3526
2880
  },
3527
2881
  {
3528
- "name": "baseAmount";
3529
- "docs": [
2882
+ name: "baseAmount";
2883
+ docs: [
3530
2884
  "Original amount in token base units (for per-token cap checks)"
3531
2885
  ];
3532
- "type": "u64";
2886
+ type: "u64";
3533
2887
  },
3534
2888
  {
3535
- "name": "timestamp";
3536
- "type": "i64";
2889
+ name: "timestamp";
2890
+ type: "i64";
3537
2891
  }
3538
2892
  ];
3539
2893
  };
3540
2894
  },
3541
2895
  {
3542
- "name": "spendTracker";
3543
- "type": {
3544
- "kind": "struct";
3545
- "fields": [
2896
+ name: "spendTracker";
2897
+ type: {
2898
+ kind: "struct";
2899
+ fields: [
3546
2900
  {
3547
- "name": "vault";
3548
- "docs": [
3549
- "Associated vault pubkey"
3550
- ];
3551
- "type": "pubkey";
2901
+ name: "vault";
2902
+ docs: ["Associated vault pubkey"];
2903
+ type: "pubkey";
3552
2904
  },
3553
2905
  {
3554
- "name": "trackerTier";
3555
- "docs": [
3556
- "Tracker capacity tier (Standard/Pro/Max)"
3557
- ];
3558
- "type": {
3559
- "defined": {
3560
- "name": "trackerTier";
2906
+ name: "trackerTier";
2907
+ docs: ["Tracker capacity tier (Standard/Pro/Max)"];
2908
+ type: {
2909
+ defined: {
2910
+ name: "trackerTier";
3561
2911
  };
3562
2912
  };
3563
2913
  },
3564
2914
  {
3565
- "name": "maxSpendEntries";
3566
- "docs": [
2915
+ name: "maxSpendEntries";
2916
+ docs: [
3567
2917
  "Maximum spend entries for this tracker (derived from tier at init)"
3568
2918
  ];
3569
- "type": "u32";
2919
+ type: "u32";
3570
2920
  },
3571
2921
  {
3572
- "name": "rollingSpends";
3573
- "docs": [
2922
+ name: "rollingSpends";
2923
+ docs: [
3574
2924
  "Rolling spend entries: (token_mint, usd_amount, base_amount, timestamp)",
3575
2925
  "Entries older than ROLLING_WINDOW_SECONDS are pruned on each access"
3576
2926
  ];
3577
- "type": {
3578
- "vec": {
3579
- "defined": {
3580
- "name": "spendEntry";
2927
+ type: {
2928
+ vec: {
2929
+ defined: {
2930
+ name: "spendEntry";
3581
2931
  };
3582
2932
  };
3583
2933
  };
3584
2934
  },
3585
2935
  {
3586
- "name": "recentTransactions";
3587
- "docs": [
2936
+ name: "recentTransactions";
2937
+ docs: [
3588
2938
  "Recent transaction log for on-chain audit trail",
3589
2939
  "Bounded to MAX_RECENT_TRANSACTIONS, oldest entries evicted (ring buffer)"
3590
2940
  ];
3591
- "type": {
3592
- "vec": {
3593
- "defined": {
3594
- "name": "transactionRecord";
2941
+ type: {
2942
+ vec: {
2943
+ defined: {
2944
+ name: "transactionRecord";
3595
2945
  };
3596
2946
  };
3597
2947
  };
3598
2948
  },
3599
2949
  {
3600
- "name": "bump";
3601
- "docs": [
3602
- "Bump seed for PDA"
3603
- ];
3604
- "type": "u8";
2950
+ name: "bump";
2951
+ docs: ["Bump seed for PDA"];
2952
+ type: "u8";
3605
2953
  }
3606
2954
  ];
3607
2955
  };
3608
2956
  },
3609
2957
  {
3610
- "name": "trackerTier";
3611
- "docs": [
2958
+ name: "trackerTier";
2959
+ docs: [
3612
2960
  "Tracker capacity tiers — chosen at vault creation, determines",
3613
2961
  "max rolling spend entries and SpendTracker account size."
3614
2962
  ];
3615
- "type": {
3616
- "kind": "enum";
3617
- "variants": [
2963
+ type: {
2964
+ kind: "enum";
2965
+ variants: [
3618
2966
  {
3619
- "name": "standard";
2967
+ name: "standard";
3620
2968
  },
3621
2969
  {
3622
- "name": "pro";
2970
+ name: "pro";
3623
2971
  },
3624
2972
  {
3625
- "name": "max";
2973
+ name: "max";
3626
2974
  }
3627
2975
  ];
3628
2976
  };
3629
2977
  },
3630
2978
  {
3631
- "name": "transactionRecord";
3632
- "type": {
3633
- "kind": "struct";
3634
- "fields": [
2979
+ name: "transactionRecord";
2980
+ type: {
2981
+ kind: "struct";
2982
+ fields: [
3635
2983
  {
3636
- "name": "timestamp";
3637
- "type": "i64";
2984
+ name: "timestamp";
2985
+ type: "i64";
3638
2986
  },
3639
2987
  {
3640
- "name": "actionType";
3641
- "type": {
3642
- "defined": {
3643
- "name": "actionType";
2988
+ name: "actionType";
2989
+ type: {
2990
+ defined: {
2991
+ name: "actionType";
3644
2992
  };
3645
2993
  };
3646
2994
  },
3647
2995
  {
3648
- "name": "tokenMint";
3649
- "type": "pubkey";
2996
+ name: "tokenMint";
2997
+ type: "pubkey";
3650
2998
  },
3651
2999
  {
3652
- "name": "amount";
3653
- "type": "u64";
3000
+ name: "amount";
3001
+ type: "u64";
3654
3002
  },
3655
3003
  {
3656
- "name": "protocol";
3657
- "type": "pubkey";
3004
+ name: "protocol";
3005
+ type: "pubkey";
3658
3006
  },
3659
3007
  {
3660
- "name": "success";
3661
- "type": "bool";
3008
+ name: "success";
3009
+ type: "bool";
3662
3010
  },
3663
3011
  {
3664
- "name": "slot";
3665
- "type": "u64";
3012
+ name: "slot";
3013
+ type: "u64";
3666
3014
  }
3667
3015
  ];
3668
3016
  };
3669
3017
  },
3670
3018
  {
3671
- "name": "vaultClosed";
3672
- "type": {
3673
- "kind": "struct";
3674
- "fields": [
3019
+ name: "vaultClosed";
3020
+ type: {
3021
+ kind: "struct";
3022
+ fields: [
3675
3023
  {
3676
- "name": "vault";
3677
- "type": "pubkey";
3024
+ name: "vault";
3025
+ type: "pubkey";
3678
3026
  },
3679
3027
  {
3680
- "name": "owner";
3681
- "type": "pubkey";
3028
+ name: "owner";
3029
+ type: "pubkey";
3682
3030
  },
3683
3031
  {
3684
- "name": "timestamp";
3685
- "type": "i64";
3032
+ name: "timestamp";
3033
+ type: "i64";
3686
3034
  }
3687
3035
  ];
3688
3036
  };
3689
3037
  },
3690
3038
  {
3691
- "name": "vaultCreated";
3692
- "type": {
3693
- "kind": "struct";
3694
- "fields": [
3039
+ name: "vaultCreated";
3040
+ type: {
3041
+ kind: "struct";
3042
+ fields: [
3695
3043
  {
3696
- "name": "vault";
3697
- "type": "pubkey";
3044
+ name: "vault";
3045
+ type: "pubkey";
3698
3046
  },
3699
3047
  {
3700
- "name": "owner";
3701
- "type": "pubkey";
3048
+ name: "owner";
3049
+ type: "pubkey";
3702
3050
  },
3703
3051
  {
3704
- "name": "vaultId";
3705
- "type": "u64";
3052
+ name: "vaultId";
3053
+ type: "u64";
3706
3054
  },
3707
3055
  {
3708
- "name": "timestamp";
3709
- "type": "i64";
3056
+ name: "timestamp";
3057
+ type: "i64";
3710
3058
  }
3711
3059
  ];
3712
3060
  };
3713
3061
  },
3714
3062
  {
3715
- "name": "vaultReactivated";
3716
- "type": {
3717
- "kind": "struct";
3718
- "fields": [
3063
+ name: "vaultReactivated";
3064
+ type: {
3065
+ kind: "struct";
3066
+ fields: [
3719
3067
  {
3720
- "name": "vault";
3721
- "type": "pubkey";
3068
+ name: "vault";
3069
+ type: "pubkey";
3722
3070
  },
3723
3071
  {
3724
- "name": "newAgent";
3725
- "type": {
3726
- "option": "pubkey";
3072
+ name: "newAgent";
3073
+ type: {
3074
+ option: "pubkey";
3727
3075
  };
3728
3076
  },
3729
3077
  {
3730
- "name": "timestamp";
3731
- "type": "i64";
3078
+ name: "timestamp";
3079
+ type: "i64";
3732
3080
  }
3733
3081
  ];
3734
3082
  };
3735
3083
  },
3736
3084
  {
3737
- "name": "vaultStatus";
3738
- "docs": [
3739
- "Vault status enum"
3740
- ];
3741
- "type": {
3742
- "kind": "enum";
3743
- "variants": [
3085
+ name: "vaultStatus";
3086
+ docs: ["Vault status enum"];
3087
+ type: {
3088
+ kind: "enum";
3089
+ variants: [
3744
3090
  {
3745
- "name": "active";
3091
+ name: "active";
3746
3092
  },
3747
3093
  {
3748
- "name": "frozen";
3094
+ name: "frozen";
3749
3095
  },
3750
3096
  {
3751
- "name": "closed";
3097
+ name: "closed";
3752
3098
  }
3753
3099
  ];
3754
3100
  };