@agent-shield/sdk 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/dist/accounts.d.ts +15 -0
  2. package/dist/accounts.d.ts.map +1 -0
  3. package/dist/accounts.js +59 -0
  4. package/dist/accounts.js.map +1 -0
  5. package/dist/client.d.ts +85 -0
  6. package/dist/client.d.ts.map +1 -0
  7. package/dist/client.js +233 -0
  8. package/dist/client.js.map +1 -0
  9. package/dist/composer.d.ts +21 -0
  10. package/dist/composer.d.ts.map +1 -0
  11. package/dist/composer.js +51 -0
  12. package/dist/composer.js.map +1 -0
  13. package/dist/idl-json.d.ts +1299 -0
  14. package/dist/idl-json.d.ts.map +1 -0
  15. package/dist/idl-json.js +2486 -0
  16. package/dist/idl-json.js.map +1 -0
  17. package/dist/idl.d.ts +2475 -0
  18. package/dist/idl.d.ts.map +1 -0
  19. package/dist/idl.js +3 -0
  20. package/dist/idl.js.map +1 -0
  21. package/dist/index.d.ts +9 -0
  22. package/dist/index.d.ts.map +1 -0
  23. package/dist/index.js +63 -0
  24. package/dist/index.js.map +1 -0
  25. package/dist/instructions.d.ts +1130 -0
  26. package/dist/instructions.d.ts.map +1 -0
  27. package/dist/instructions.js +127 -0
  28. package/dist/instructions.js.map +1 -0
  29. package/dist/integrations/flash-trade.d.ts +130 -0
  30. package/dist/integrations/flash-trade.d.ts.map +1 -0
  31. package/dist/integrations/flash-trade.js +170 -0
  32. package/dist/integrations/flash-trade.js.map +1 -0
  33. package/dist/integrations/jupiter.d.ts +131 -0
  34. package/dist/integrations/jupiter.d.ts.map +1 -0
  35. package/dist/integrations/jupiter.js +178 -0
  36. package/dist/integrations/jupiter.js.map +1 -0
  37. package/dist/types.d.ts +129 -0
  38. package/dist/types.d.ts.map +1 -0
  39. package/dist/types.js +6 -0
  40. package/dist/types.js.map +1 -0
  41. package/package.json +36 -0
@@ -0,0 +1,1130 @@
1
+ import { PublicKey } from "@solana/web3.js";
2
+ import { BN, Program } from "@coral-xyz/anchor";
3
+ import type { AgentShield, InitializeVaultParams, UpdatePolicyParams, AuthorizeParams } from "./types";
4
+ export declare function buildInitializeVault(program: Program<AgentShield>, owner: PublicKey, params: InitializeVaultParams): import("@coral-xyz/anchor/dist/cjs/program/namespace/methods").MethodsBuilder<AgentShield, {
5
+ name: "initializeVault";
6
+ docs: ["Initialize a new agent vault with policy configuration.", "Only the owner can call this. Creates vault PDA, policy PDA, and spend tracker PDA."];
7
+ discriminator: [48, 191, 163, 44, 71, 129, 63, 164];
8
+ accounts: [{
9
+ "name": "owner";
10
+ "writable": true;
11
+ "signer": true;
12
+ }, {
13
+ "name": "vault";
14
+ "writable": true;
15
+ "pda": {
16
+ "seeds": [{
17
+ "kind": "const";
18
+ "value": [118, 97, 117, 108, 116];
19
+ }, {
20
+ "kind": "account";
21
+ "path": "owner";
22
+ }, {
23
+ "kind": "arg";
24
+ "path": "vaultId";
25
+ }];
26
+ };
27
+ }, {
28
+ "name": "policy";
29
+ "writable": true;
30
+ "pda": {
31
+ "seeds": [{
32
+ "kind": "const";
33
+ "value": [112, 111, 108, 105, 99, 121];
34
+ }, {
35
+ "kind": "account";
36
+ "path": "vault";
37
+ }];
38
+ };
39
+ }, {
40
+ "name": "tracker";
41
+ "writable": true;
42
+ "pda": {
43
+ "seeds": [{
44
+ "kind": "const";
45
+ "value": [116, 114, 97, 99, 107, 101, 114];
46
+ }, {
47
+ "kind": "account";
48
+ "path": "vault";
49
+ }];
50
+ };
51
+ }, {
52
+ "name": "feeDestination";
53
+ "docs": ["The protocol treasury that receives fees"];
54
+ }, {
55
+ "name": "systemProgram";
56
+ "address": "11111111111111111111111111111111";
57
+ }];
58
+ args: [{
59
+ "name": "vaultId";
60
+ "type": "u64";
61
+ }, {
62
+ "name": "dailySpendingCap";
63
+ "type": "u64";
64
+ }, {
65
+ "name": "maxTransactionSize";
66
+ "type": "u64";
67
+ }, {
68
+ "name": "allowedTokens";
69
+ "type": {
70
+ "vec": "pubkey";
71
+ };
72
+ }, {
73
+ "name": "allowedProtocols";
74
+ "type": {
75
+ "vec": "pubkey";
76
+ };
77
+ }, {
78
+ "name": "maxLeverageBps";
79
+ "type": "u16";
80
+ }, {
81
+ "name": "maxConcurrentPositions";
82
+ "type": "u8";
83
+ }];
84
+ } & {
85
+ name: "initializeVault";
86
+ }, {
87
+ name: "owner";
88
+ writable: true;
89
+ signer: true;
90
+ } | {
91
+ name: "vault";
92
+ writable: true;
93
+ pda: {
94
+ "seeds": [{
95
+ "kind": "const";
96
+ "value": [118, 97, 117, 108, 116];
97
+ }, {
98
+ "kind": "account";
99
+ "path": "owner";
100
+ }, {
101
+ "kind": "arg";
102
+ "path": "vaultId";
103
+ }];
104
+ };
105
+ } | {
106
+ name: "policy";
107
+ writable: true;
108
+ pda: {
109
+ "seeds": [{
110
+ "kind": "const";
111
+ "value": [112, 111, 108, 105, 99, 121];
112
+ }, {
113
+ "kind": "account";
114
+ "path": "vault";
115
+ }];
116
+ };
117
+ } | {
118
+ name: "tracker";
119
+ writable: true;
120
+ pda: {
121
+ "seeds": [{
122
+ "kind": "const";
123
+ "value": [116, 114, 97, 99, 107, 101, 114];
124
+ }, {
125
+ "kind": "account";
126
+ "path": "vault";
127
+ }];
128
+ };
129
+ } | {
130
+ name: "feeDestination";
131
+ docs: ["The protocol treasury that receives fees"];
132
+ } | {
133
+ name: "systemProgram";
134
+ address: "11111111111111111111111111111111";
135
+ }>;
136
+ export declare function buildDepositFunds(program: Program<AgentShield>, owner: PublicKey, vault: PublicKey, mint: PublicKey, amount: BN): import("@coral-xyz/anchor/dist/cjs/program/namespace/methods").MethodsBuilder<AgentShield, {
137
+ name: "depositFunds";
138
+ docs: ["Deposit SPL tokens into the vault's PDA-controlled token account.", "Only the owner can call this."];
139
+ discriminator: [202, 39, 52, 211, 53, 20, 250, 88];
140
+ accounts: [{
141
+ "name": "owner";
142
+ "writable": true;
143
+ "signer": true;
144
+ "relations": ["vault"];
145
+ }, {
146
+ "name": "vault";
147
+ "pda": {
148
+ "seeds": [{
149
+ "kind": "const";
150
+ "value": [118, 97, 117, 108, 116];
151
+ }, {
152
+ "kind": "account";
153
+ "path": "owner";
154
+ }, {
155
+ "kind": "account";
156
+ "path": "vault.vault_id";
157
+ "account": "agentVault";
158
+ }];
159
+ };
160
+ }, {
161
+ "name": "mint";
162
+ }, {
163
+ "name": "ownerTokenAccount";
164
+ "docs": ["Owner's token account to transfer from"];
165
+ "writable": true;
166
+ "pda": {
167
+ "seeds": [{
168
+ "kind": "account";
169
+ "path": "owner";
170
+ }, {
171
+ "kind": "const";
172
+ "value": [6, 221, 246, 225, 215, 101, 161, 147, 217, 203, 225, 70, 206, 235, 121, 172, 28, 180, 133, 237, 95, 91, 55, 145, 58, 140, 245, 133, 126, 255, 0, 169];
173
+ }, {
174
+ "kind": "account";
175
+ "path": "mint";
176
+ }];
177
+ "program": {
178
+ "kind": "const";
179
+ "value": [140, 151, 37, 143, 78, 36, 137, 241, 187, 61, 16, 41, 20, 142, 13, 131, 11, 90, 19, 153, 218, 255, 16, 132, 4, 142, 123, 216, 219, 233, 248, 89];
180
+ };
181
+ };
182
+ }, {
183
+ "name": "vaultTokenAccount";
184
+ "docs": ["Vault's PDA-controlled token account"];
185
+ "writable": true;
186
+ "pda": {
187
+ "seeds": [{
188
+ "kind": "account";
189
+ "path": "vault";
190
+ }, {
191
+ "kind": "const";
192
+ "value": [6, 221, 246, 225, 215, 101, 161, 147, 217, 203, 225, 70, 206, 235, 121, 172, 28, 180, 133, 237, 95, 91, 55, 145, 58, 140, 245, 133, 126, 255, 0, 169];
193
+ }, {
194
+ "kind": "account";
195
+ "path": "mint";
196
+ }];
197
+ "program": {
198
+ "kind": "const";
199
+ "value": [140, 151, 37, 143, 78, 36, 137, 241, 187, 61, 16, 41, 20, 142, 13, 131, 11, 90, 19, 153, 218, 255, 16, 132, 4, 142, 123, 216, 219, 233, 248, 89];
200
+ };
201
+ };
202
+ }, {
203
+ "name": "tokenProgram";
204
+ "address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
205
+ }, {
206
+ "name": "associatedTokenProgram";
207
+ "address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL";
208
+ }, {
209
+ "name": "systemProgram";
210
+ "address": "11111111111111111111111111111111";
211
+ }];
212
+ args: [{
213
+ "name": "amount";
214
+ "type": "u64";
215
+ }];
216
+ } & {
217
+ name: "depositFunds";
218
+ }, {
219
+ name: "owner";
220
+ writable: true;
221
+ signer: true;
222
+ relations: ["vault"];
223
+ } | {
224
+ name: "vault";
225
+ pda: {
226
+ "seeds": [{
227
+ "kind": "const";
228
+ "value": [118, 97, 117, 108, 116];
229
+ }, {
230
+ "kind": "account";
231
+ "path": "owner";
232
+ }, {
233
+ "kind": "account";
234
+ "path": "vault.vault_id";
235
+ "account": "agentVault";
236
+ }];
237
+ };
238
+ } | {
239
+ name: "mint";
240
+ } | {
241
+ name: "ownerTokenAccount";
242
+ docs: ["Owner's token account to transfer from"];
243
+ writable: true;
244
+ pda: {
245
+ "seeds": [{
246
+ "kind": "account";
247
+ "path": "owner";
248
+ }, {
249
+ "kind": "const";
250
+ "value": [6, 221, 246, 225, 215, 101, 161, 147, 217, 203, 225, 70, 206, 235, 121, 172, 28, 180, 133, 237, 95, 91, 55, 145, 58, 140, 245, 133, 126, 255, 0, 169];
251
+ }, {
252
+ "kind": "account";
253
+ "path": "mint";
254
+ }];
255
+ "program": {
256
+ "kind": "const";
257
+ "value": [140, 151, 37, 143, 78, 36, 137, 241, 187, 61, 16, 41, 20, 142, 13, 131, 11, 90, 19, 153, 218, 255, 16, 132, 4, 142, 123, 216, 219, 233, 248, 89];
258
+ };
259
+ };
260
+ } | {
261
+ name: "vaultTokenAccount";
262
+ docs: ["Vault's PDA-controlled token account"];
263
+ writable: true;
264
+ pda: {
265
+ "seeds": [{
266
+ "kind": "account";
267
+ "path": "vault";
268
+ }, {
269
+ "kind": "const";
270
+ "value": [6, 221, 246, 225, 215, 101, 161, 147, 217, 203, 225, 70, 206, 235, 121, 172, 28, 180, 133, 237, 95, 91, 55, 145, 58, 140, 245, 133, 126, 255, 0, 169];
271
+ }, {
272
+ "kind": "account";
273
+ "path": "mint";
274
+ }];
275
+ "program": {
276
+ "kind": "const";
277
+ "value": [140, 151, 37, 143, 78, 36, 137, 241, 187, 61, 16, 41, 20, 142, 13, 131, 11, 90, 19, 153, 218, 255, 16, 132, 4, 142, 123, 216, 219, 233, 248, 89];
278
+ };
279
+ };
280
+ } | {
281
+ name: "tokenProgram";
282
+ address: "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
283
+ } | {
284
+ name: "associatedTokenProgram";
285
+ address: "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL";
286
+ } | {
287
+ name: "systemProgram";
288
+ address: "11111111111111111111111111111111";
289
+ }>;
290
+ export declare function buildRegisterAgent(program: Program<AgentShield>, owner: PublicKey, vault: PublicKey, agent: PublicKey): import("@coral-xyz/anchor/dist/cjs/program/namespace/methods").MethodsBuilder<AgentShield, {
291
+ name: "registerAgent";
292
+ docs: ["Register an agent's signing key to this vault.", "Only the owner can call this. One agent per vault."];
293
+ discriminator: [135, 157, 66, 195, 2, 113, 175, 30];
294
+ accounts: [{
295
+ "name": "owner";
296
+ "signer": true;
297
+ "relations": ["vault"];
298
+ }, {
299
+ "name": "vault";
300
+ "writable": true;
301
+ "pda": {
302
+ "seeds": [{
303
+ "kind": "const";
304
+ "value": [118, 97, 117, 108, 116];
305
+ }, {
306
+ "kind": "account";
307
+ "path": "owner";
308
+ }, {
309
+ "kind": "account";
310
+ "path": "vault.vault_id";
311
+ "account": "agentVault";
312
+ }];
313
+ };
314
+ }];
315
+ args: [{
316
+ "name": "agent";
317
+ "type": "pubkey";
318
+ }];
319
+ } & {
320
+ name: "registerAgent";
321
+ }, {
322
+ name: "owner";
323
+ signer: true;
324
+ relations: ["vault"];
325
+ } | {
326
+ name: "vault";
327
+ writable: true;
328
+ pda: {
329
+ "seeds": [{
330
+ "kind": "const";
331
+ "value": [118, 97, 117, 108, 116];
332
+ }, {
333
+ "kind": "account";
334
+ "path": "owner";
335
+ }, {
336
+ "kind": "account";
337
+ "path": "vault.vault_id";
338
+ "account": "agentVault";
339
+ }];
340
+ };
341
+ }>;
342
+ export declare function buildUpdatePolicy(program: Program<AgentShield>, owner: PublicKey, vault: PublicKey, params: UpdatePolicyParams): import("@coral-xyz/anchor/dist/cjs/program/namespace/methods").MethodsBuilder<AgentShield, {
343
+ name: "updatePolicy";
344
+ docs: ["Update the policy configuration for a vault.", "Only the owner can call this. Cannot be called by the agent."];
345
+ discriminator: [212, 245, 246, 7, 163, 151, 18, 57];
346
+ accounts: [{
347
+ "name": "owner";
348
+ "signer": true;
349
+ "relations": ["vault"];
350
+ }, {
351
+ "name": "vault";
352
+ "pda": {
353
+ "seeds": [{
354
+ "kind": "const";
355
+ "value": [118, 97, 117, 108, 116];
356
+ }, {
357
+ "kind": "account";
358
+ "path": "owner";
359
+ }, {
360
+ "kind": "account";
361
+ "path": "vault.vault_id";
362
+ "account": "agentVault";
363
+ }];
364
+ };
365
+ "relations": ["policy"];
366
+ }, {
367
+ "name": "policy";
368
+ "writable": true;
369
+ "pda": {
370
+ "seeds": [{
371
+ "kind": "const";
372
+ "value": [112, 111, 108, 105, 99, 121];
373
+ }, {
374
+ "kind": "account";
375
+ "path": "vault";
376
+ }];
377
+ };
378
+ }];
379
+ args: [{
380
+ "name": "dailySpendingCap";
381
+ "type": {
382
+ "option": "u64";
383
+ };
384
+ }, {
385
+ "name": "maxTransactionSize";
386
+ "type": {
387
+ "option": "u64";
388
+ };
389
+ }, {
390
+ "name": "allowedTokens";
391
+ "type": {
392
+ "option": {
393
+ "vec": "pubkey";
394
+ };
395
+ };
396
+ }, {
397
+ "name": "allowedProtocols";
398
+ "type": {
399
+ "option": {
400
+ "vec": "pubkey";
401
+ };
402
+ };
403
+ }, {
404
+ "name": "maxLeverageBps";
405
+ "type": {
406
+ "option": "u16";
407
+ };
408
+ }, {
409
+ "name": "canOpenPositions";
410
+ "type": {
411
+ "option": "bool";
412
+ };
413
+ }, {
414
+ "name": "maxConcurrentPositions";
415
+ "type": {
416
+ "option": "u8";
417
+ };
418
+ }];
419
+ } & {
420
+ name: "updatePolicy";
421
+ }, {
422
+ name: "owner";
423
+ signer: true;
424
+ relations: ["vault"];
425
+ } | {
426
+ name: "vault";
427
+ pda: {
428
+ "seeds": [{
429
+ "kind": "const";
430
+ "value": [118, 97, 117, 108, 116];
431
+ }, {
432
+ "kind": "account";
433
+ "path": "owner";
434
+ }, {
435
+ "kind": "account";
436
+ "path": "vault.vault_id";
437
+ "account": "agentVault";
438
+ }];
439
+ };
440
+ relations: ["policy"];
441
+ } | {
442
+ name: "policy";
443
+ writable: true;
444
+ pda: {
445
+ "seeds": [{
446
+ "kind": "const";
447
+ "value": [112, 111, 108, 105, 99, 121];
448
+ }, {
449
+ "kind": "account";
450
+ "path": "vault";
451
+ }];
452
+ };
453
+ }>;
454
+ export declare function buildValidateAndAuthorize(program: Program<AgentShield>, agent: PublicKey, vault: PublicKey, params: AuthorizeParams): import("@coral-xyz/anchor/dist/cjs/program/namespace/methods").MethodsBuilder<AgentShield, {
455
+ name: "validateAndAuthorize";
456
+ docs: ["Core permission check. Called by the agent before a DeFi action.", "Validates the action against all policy constraints.", "If approved, creates a SessionAuthority PDA and updates spend tracking.", "If denied, reverts the entire transaction (including subsequent DeFi instructions)."];
457
+ discriminator: [22, 183, 48, 222, 218, 11, 197, 152];
458
+ accounts: [{
459
+ "name": "agent";
460
+ "writable": true;
461
+ "signer": true;
462
+ }, {
463
+ "name": "vault";
464
+ "writable": true;
465
+ "pda": {
466
+ "seeds": [{
467
+ "kind": "const";
468
+ "value": [118, 97, 117, 108, 116];
469
+ }, {
470
+ "kind": "account";
471
+ "path": "vault.owner";
472
+ "account": "agentVault";
473
+ }, {
474
+ "kind": "account";
475
+ "path": "vault.vault_id";
476
+ "account": "agentVault";
477
+ }];
478
+ };
479
+ "relations": ["policy", "tracker"];
480
+ }, {
481
+ "name": "policy";
482
+ "pda": {
483
+ "seeds": [{
484
+ "kind": "const";
485
+ "value": [112, 111, 108, 105, 99, 121];
486
+ }, {
487
+ "kind": "account";
488
+ "path": "vault";
489
+ }];
490
+ };
491
+ }, {
492
+ "name": "tracker";
493
+ "writable": true;
494
+ "pda": {
495
+ "seeds": [{
496
+ "kind": "const";
497
+ "value": [116, 114, 97, 99, 107, 101, 114];
498
+ }, {
499
+ "kind": "account";
500
+ "path": "vault";
501
+ }];
502
+ };
503
+ }, {
504
+ "name": "session";
505
+ "docs": ["Ephemeral session PDA \u2014 `init` ensures no double-authorization"];
506
+ "writable": true;
507
+ "pda": {
508
+ "seeds": [{
509
+ "kind": "const";
510
+ "value": [115, 101, 115, 115, 105, 111, 110];
511
+ }, {
512
+ "kind": "account";
513
+ "path": "vault";
514
+ }, {
515
+ "kind": "account";
516
+ "path": "agent";
517
+ }];
518
+ };
519
+ }, {
520
+ "name": "systemProgram";
521
+ "address": "11111111111111111111111111111111";
522
+ }];
523
+ args: [{
524
+ "name": "actionType";
525
+ "type": {
526
+ "defined": {
527
+ "name": "actionType";
528
+ };
529
+ };
530
+ }, {
531
+ "name": "tokenMint";
532
+ "type": "pubkey";
533
+ }, {
534
+ "name": "amount";
535
+ "type": "u64";
536
+ }, {
537
+ "name": "targetProtocol";
538
+ "type": "pubkey";
539
+ }, {
540
+ "name": "leverageBps";
541
+ "type": {
542
+ "option": "u16";
543
+ };
544
+ }];
545
+ } & {
546
+ name: "validateAndAuthorize";
547
+ }, {
548
+ name: "agent";
549
+ writable: true;
550
+ signer: true;
551
+ } | {
552
+ name: "vault";
553
+ writable: true;
554
+ pda: {
555
+ "seeds": [{
556
+ "kind": "const";
557
+ "value": [118, 97, 117, 108, 116];
558
+ }, {
559
+ "kind": "account";
560
+ "path": "vault.owner";
561
+ "account": "agentVault";
562
+ }, {
563
+ "kind": "account";
564
+ "path": "vault.vault_id";
565
+ "account": "agentVault";
566
+ }];
567
+ };
568
+ relations: ["policy", "tracker"];
569
+ } | {
570
+ name: "policy";
571
+ pda: {
572
+ "seeds": [{
573
+ "kind": "const";
574
+ "value": [112, 111, 108, 105, 99, 121];
575
+ }, {
576
+ "kind": "account";
577
+ "path": "vault";
578
+ }];
579
+ };
580
+ } | {
581
+ name: "tracker";
582
+ writable: true;
583
+ pda: {
584
+ "seeds": [{
585
+ "kind": "const";
586
+ "value": [116, 114, 97, 99, 107, 101, 114];
587
+ }, {
588
+ "kind": "account";
589
+ "path": "vault";
590
+ }];
591
+ };
592
+ } | {
593
+ name: "session";
594
+ docs: ["Ephemeral session PDA \u2014 `init` ensures no double-authorization"];
595
+ writable: true;
596
+ pda: {
597
+ "seeds": [{
598
+ "kind": "const";
599
+ "value": [115, 101, 115, 115, 105, 111, 110];
600
+ }, {
601
+ "kind": "account";
602
+ "path": "vault";
603
+ }, {
604
+ "kind": "account";
605
+ "path": "agent";
606
+ }];
607
+ };
608
+ } | {
609
+ name: "systemProgram";
610
+ address: "11111111111111111111111111111111";
611
+ }>;
612
+ export declare function buildFinalizeSession(program: Program<AgentShield>, payer: PublicKey, vault: PublicKey, agent: PublicKey, success: boolean, vaultTokenAccount?: PublicKey | null, feeDestinationTokenAccount?: PublicKey | null): import("@coral-xyz/anchor/dist/cjs/program/namespace/methods").MethodsBuilder<AgentShield, {
613
+ name: "finalizeSession";
614
+ docs: ["Finalize a session after the DeFi action completes.", "Closes the SessionAuthority PDA and records the transaction in the audit log.", "Can be called by the agent or permissionlessly (for cleanup of expired sessions)."];
615
+ discriminator: [34, 148, 144, 47, 37, 130, 206, 161];
616
+ accounts: [{
617
+ "name": "payer";
618
+ "writable": true;
619
+ "signer": true;
620
+ }, {
621
+ "name": "vault";
622
+ "writable": true;
623
+ "pda": {
624
+ "seeds": [{
625
+ "kind": "const";
626
+ "value": [118, 97, 117, 108, 116];
627
+ }, {
628
+ "kind": "account";
629
+ "path": "vault.owner";
630
+ "account": "agentVault";
631
+ }, {
632
+ "kind": "account";
633
+ "path": "vault.vault_id";
634
+ "account": "agentVault";
635
+ }];
636
+ };
637
+ "relations": ["policy", "tracker", "session"];
638
+ }, {
639
+ "name": "policy";
640
+ "pda": {
641
+ "seeds": [{
642
+ "kind": "const";
643
+ "value": [112, 111, 108, 105, 99, 121];
644
+ }, {
645
+ "kind": "account";
646
+ "path": "vault";
647
+ }];
648
+ };
649
+ }, {
650
+ "name": "tracker";
651
+ "writable": true;
652
+ "pda": {
653
+ "seeds": [{
654
+ "kind": "const";
655
+ "value": [116, 114, 97, 99, 107, 101, 114];
656
+ }, {
657
+ "kind": "account";
658
+ "path": "vault";
659
+ }];
660
+ };
661
+ }, {
662
+ "name": "session";
663
+ "writable": true;
664
+ "pda": {
665
+ "seeds": [{
666
+ "kind": "const";
667
+ "value": [115, 101, 115, 115, 105, 111, 110];
668
+ }, {
669
+ "kind": "account";
670
+ "path": "vault";
671
+ }, {
672
+ "kind": "account";
673
+ "path": "session.agent";
674
+ "account": "sessionAuthority";
675
+ }];
676
+ };
677
+ }, {
678
+ "name": "vaultTokenAccount";
679
+ "docs": ["Vault's PDA token account for the session's token (fee source)"];
680
+ "writable": true;
681
+ "optional": true;
682
+ }, {
683
+ "name": "feeDestinationTokenAccount";
684
+ "docs": ["Fee destination token account \u2014 must match vault.fee_destination"];
685
+ "writable": true;
686
+ "optional": true;
687
+ }, {
688
+ "name": "tokenProgram";
689
+ "address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
690
+ }, {
691
+ "name": "systemProgram";
692
+ "address": "11111111111111111111111111111111";
693
+ }];
694
+ args: [{
695
+ "name": "success";
696
+ "type": "bool";
697
+ }];
698
+ } & {
699
+ name: "finalizeSession";
700
+ }, {
701
+ name: "payer";
702
+ writable: true;
703
+ signer: true;
704
+ } | {
705
+ name: "vault";
706
+ writable: true;
707
+ pda: {
708
+ "seeds": [{
709
+ "kind": "const";
710
+ "value": [118, 97, 117, 108, 116];
711
+ }, {
712
+ "kind": "account";
713
+ "path": "vault.owner";
714
+ "account": "agentVault";
715
+ }, {
716
+ "kind": "account";
717
+ "path": "vault.vault_id";
718
+ "account": "agentVault";
719
+ }];
720
+ };
721
+ relations: ["policy", "tracker", "session"];
722
+ } | {
723
+ name: "policy";
724
+ pda: {
725
+ "seeds": [{
726
+ "kind": "const";
727
+ "value": [112, 111, 108, 105, 99, 121];
728
+ }, {
729
+ "kind": "account";
730
+ "path": "vault";
731
+ }];
732
+ };
733
+ } | {
734
+ name: "tracker";
735
+ writable: true;
736
+ pda: {
737
+ "seeds": [{
738
+ "kind": "const";
739
+ "value": [116, 114, 97, 99, 107, 101, 114];
740
+ }, {
741
+ "kind": "account";
742
+ "path": "vault";
743
+ }];
744
+ };
745
+ } | {
746
+ name: "session";
747
+ writable: true;
748
+ pda: {
749
+ "seeds": [{
750
+ "kind": "const";
751
+ "value": [115, 101, 115, 115, 105, 111, 110];
752
+ }, {
753
+ "kind": "account";
754
+ "path": "vault";
755
+ }, {
756
+ "kind": "account";
757
+ "path": "session.agent";
758
+ "account": "sessionAuthority";
759
+ }];
760
+ };
761
+ } | {
762
+ name: "vaultTokenAccount";
763
+ docs: ["Vault's PDA token account for the session's token (fee source)"];
764
+ writable: true;
765
+ optional: true;
766
+ } | {
767
+ name: "feeDestinationTokenAccount";
768
+ docs: ["Fee destination token account \u2014 must match vault.fee_destination"];
769
+ writable: true;
770
+ optional: true;
771
+ } | {
772
+ name: "tokenProgram";
773
+ address: "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
774
+ } | {
775
+ name: "systemProgram";
776
+ address: "11111111111111111111111111111111";
777
+ }>;
778
+ export declare function buildRevokeAgent(program: Program<AgentShield>, owner: PublicKey, vault: PublicKey): import("@coral-xyz/anchor/dist/cjs/program/namespace/methods").MethodsBuilder<AgentShield, {
779
+ name: "revokeAgent";
780
+ docs: ["Kill switch. Immediately freezes the vault, preventing all agent actions.", "Only the owner can call this. Funds can still be withdrawn by the owner."];
781
+ discriminator: [227, 60, 209, 125, 240, 117, 163, 73];
782
+ accounts: [{
783
+ "name": "owner";
784
+ "signer": true;
785
+ "relations": ["vault"];
786
+ }, {
787
+ "name": "vault";
788
+ "writable": true;
789
+ "pda": {
790
+ "seeds": [{
791
+ "kind": "const";
792
+ "value": [118, 97, 117, 108, 116];
793
+ }, {
794
+ "kind": "account";
795
+ "path": "owner";
796
+ }, {
797
+ "kind": "account";
798
+ "path": "vault.vault_id";
799
+ "account": "agentVault";
800
+ }];
801
+ };
802
+ }];
803
+ args: [];
804
+ } & {
805
+ name: "revokeAgent";
806
+ }, {
807
+ name: "owner";
808
+ signer: true;
809
+ relations: ["vault"];
810
+ } | {
811
+ name: "vault";
812
+ writable: true;
813
+ pda: {
814
+ "seeds": [{
815
+ "kind": "const";
816
+ "value": [118, 97, 117, 108, 116];
817
+ }, {
818
+ "kind": "account";
819
+ "path": "owner";
820
+ }, {
821
+ "kind": "account";
822
+ "path": "vault.vault_id";
823
+ "account": "agentVault";
824
+ }];
825
+ };
826
+ }>;
827
+ export declare function buildReactivateVault(program: Program<AgentShield>, owner: PublicKey, vault: PublicKey, newAgent?: PublicKey | null): import("@coral-xyz/anchor/dist/cjs/program/namespace/methods").MethodsBuilder<AgentShield, {
828
+ name: "reactivateVault";
829
+ docs: ["Reactivate a frozen vault. Optionally rotate the agent key.", "Only the owner can call this."];
830
+ discriminator: [245, 50, 143, 70, 114, 220, 25, 251];
831
+ accounts: [{
832
+ "name": "owner";
833
+ "signer": true;
834
+ "relations": ["vault"];
835
+ }, {
836
+ "name": "vault";
837
+ "writable": true;
838
+ "pda": {
839
+ "seeds": [{
840
+ "kind": "const";
841
+ "value": [118, 97, 117, 108, 116];
842
+ }, {
843
+ "kind": "account";
844
+ "path": "owner";
845
+ }, {
846
+ "kind": "account";
847
+ "path": "vault.vault_id";
848
+ "account": "agentVault";
849
+ }];
850
+ };
851
+ }];
852
+ args: [{
853
+ "name": "newAgent";
854
+ "type": {
855
+ "option": "pubkey";
856
+ };
857
+ }];
858
+ } & {
859
+ name: "reactivateVault";
860
+ }, {
861
+ name: "owner";
862
+ signer: true;
863
+ relations: ["vault"];
864
+ } | {
865
+ name: "vault";
866
+ writable: true;
867
+ pda: {
868
+ "seeds": [{
869
+ "kind": "const";
870
+ "value": [118, 97, 117, 108, 116];
871
+ }, {
872
+ "kind": "account";
873
+ "path": "owner";
874
+ }, {
875
+ "kind": "account";
876
+ "path": "vault.vault_id";
877
+ "account": "agentVault";
878
+ }];
879
+ };
880
+ }>;
881
+ export declare function buildWithdrawFunds(program: Program<AgentShield>, owner: PublicKey, vault: PublicKey, mint: PublicKey, amount: BN): import("@coral-xyz/anchor/dist/cjs/program/namespace/methods").MethodsBuilder<AgentShield, {
882
+ name: "withdrawFunds";
883
+ docs: ["Withdraw tokens from the vault back to the owner.", "Works in any vault status (Active or Frozen). Only the owner can call this."];
884
+ discriminator: [241, 36, 29, 111, 208, 31, 104, 217];
885
+ accounts: [{
886
+ "name": "owner";
887
+ "writable": true;
888
+ "signer": true;
889
+ "relations": ["vault"];
890
+ }, {
891
+ "name": "vault";
892
+ "pda": {
893
+ "seeds": [{
894
+ "kind": "const";
895
+ "value": [118, 97, 117, 108, 116];
896
+ }, {
897
+ "kind": "account";
898
+ "path": "owner";
899
+ }, {
900
+ "kind": "account";
901
+ "path": "vault.vault_id";
902
+ "account": "agentVault";
903
+ }];
904
+ };
905
+ }, {
906
+ "name": "mint";
907
+ }, {
908
+ "name": "vaultTokenAccount";
909
+ "docs": ["Vault's PDA-controlled token account"];
910
+ "writable": true;
911
+ "pda": {
912
+ "seeds": [{
913
+ "kind": "account";
914
+ "path": "vault";
915
+ }, {
916
+ "kind": "const";
917
+ "value": [6, 221, 246, 225, 215, 101, 161, 147, 217, 203, 225, 70, 206, 235, 121, 172, 28, 180, 133, 237, 95, 91, 55, 145, 58, 140, 245, 133, 126, 255, 0, 169];
918
+ }, {
919
+ "kind": "account";
920
+ "path": "mint";
921
+ }];
922
+ "program": {
923
+ "kind": "const";
924
+ "value": [140, 151, 37, 143, 78, 36, 137, 241, 187, 61, 16, 41, 20, 142, 13, 131, 11, 90, 19, 153, 218, 255, 16, 132, 4, 142, 123, 216, 219, 233, 248, 89];
925
+ };
926
+ };
927
+ }, {
928
+ "name": "ownerTokenAccount";
929
+ "docs": ["Owner's token account to receive funds"];
930
+ "writable": true;
931
+ "pda": {
932
+ "seeds": [{
933
+ "kind": "account";
934
+ "path": "owner";
935
+ }, {
936
+ "kind": "const";
937
+ "value": [6, 221, 246, 225, 215, 101, 161, 147, 217, 203, 225, 70, 206, 235, 121, 172, 28, 180, 133, 237, 95, 91, 55, 145, 58, 140, 245, 133, 126, 255, 0, 169];
938
+ }, {
939
+ "kind": "account";
940
+ "path": "mint";
941
+ }];
942
+ "program": {
943
+ "kind": "const";
944
+ "value": [140, 151, 37, 143, 78, 36, 137, 241, 187, 61, 16, 41, 20, 142, 13, 131, 11, 90, 19, 153, 218, 255, 16, 132, 4, 142, 123, 216, 219, 233, 248, 89];
945
+ };
946
+ };
947
+ }, {
948
+ "name": "tokenProgram";
949
+ "address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
950
+ }];
951
+ args: [{
952
+ "name": "amount";
953
+ "type": "u64";
954
+ }];
955
+ } & {
956
+ name: "withdrawFunds";
957
+ }, {
958
+ name: "owner";
959
+ writable: true;
960
+ signer: true;
961
+ relations: ["vault"];
962
+ } | {
963
+ name: "vault";
964
+ pda: {
965
+ "seeds": [{
966
+ "kind": "const";
967
+ "value": [118, 97, 117, 108, 116];
968
+ }, {
969
+ "kind": "account";
970
+ "path": "owner";
971
+ }, {
972
+ "kind": "account";
973
+ "path": "vault.vault_id";
974
+ "account": "agentVault";
975
+ }];
976
+ };
977
+ } | {
978
+ name: "mint";
979
+ } | {
980
+ name: "vaultTokenAccount";
981
+ docs: ["Vault's PDA-controlled token account"];
982
+ writable: true;
983
+ pda: {
984
+ "seeds": [{
985
+ "kind": "account";
986
+ "path": "vault";
987
+ }, {
988
+ "kind": "const";
989
+ "value": [6, 221, 246, 225, 215, 101, 161, 147, 217, 203, 225, 70, 206, 235, 121, 172, 28, 180, 133, 237, 95, 91, 55, 145, 58, 140, 245, 133, 126, 255, 0, 169];
990
+ }, {
991
+ "kind": "account";
992
+ "path": "mint";
993
+ }];
994
+ "program": {
995
+ "kind": "const";
996
+ "value": [140, 151, 37, 143, 78, 36, 137, 241, 187, 61, 16, 41, 20, 142, 13, 131, 11, 90, 19, 153, 218, 255, 16, 132, 4, 142, 123, 216, 219, 233, 248, 89];
997
+ };
998
+ };
999
+ } | {
1000
+ name: "ownerTokenAccount";
1001
+ docs: ["Owner's token account to receive funds"];
1002
+ writable: true;
1003
+ pda: {
1004
+ "seeds": [{
1005
+ "kind": "account";
1006
+ "path": "owner";
1007
+ }, {
1008
+ "kind": "const";
1009
+ "value": [6, 221, 246, 225, 215, 101, 161, 147, 217, 203, 225, 70, 206, 235, 121, 172, 28, 180, 133, 237, 95, 91, 55, 145, 58, 140, 245, 133, 126, 255, 0, 169];
1010
+ }, {
1011
+ "kind": "account";
1012
+ "path": "mint";
1013
+ }];
1014
+ "program": {
1015
+ "kind": "const";
1016
+ "value": [140, 151, 37, 143, 78, 36, 137, 241, 187, 61, 16, 41, 20, 142, 13, 131, 11, 90, 19, 153, 218, 255, 16, 132, 4, 142, 123, 216, 219, 233, 248, 89];
1017
+ };
1018
+ };
1019
+ } | {
1020
+ name: "tokenProgram";
1021
+ address: "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
1022
+ }>;
1023
+ export declare function buildCloseVault(program: Program<AgentShield>, owner: PublicKey, vault: PublicKey): import("@coral-xyz/anchor/dist/cjs/program/namespace/methods").MethodsBuilder<AgentShield, {
1024
+ name: "closeVault";
1025
+ docs: ["Close the vault entirely. Withdraws all remaining funds and closes all PDAs.", "Reclaims rent. Vault must have no open positions. Only the owner can call this."];
1026
+ discriminator: [141, 103, 17, 126, 72, 75, 29, 29];
1027
+ accounts: [{
1028
+ "name": "owner";
1029
+ "writable": true;
1030
+ "signer": true;
1031
+ "relations": ["vault"];
1032
+ }, {
1033
+ "name": "vault";
1034
+ "writable": true;
1035
+ "pda": {
1036
+ "seeds": [{
1037
+ "kind": "const";
1038
+ "value": [118, 97, 117, 108, 116];
1039
+ }, {
1040
+ "kind": "account";
1041
+ "path": "owner";
1042
+ }, {
1043
+ "kind": "account";
1044
+ "path": "vault.vault_id";
1045
+ "account": "agentVault";
1046
+ }];
1047
+ };
1048
+ "relations": ["policy", "tracker"];
1049
+ }, {
1050
+ "name": "policy";
1051
+ "writable": true;
1052
+ "pda": {
1053
+ "seeds": [{
1054
+ "kind": "const";
1055
+ "value": [112, 111, 108, 105, 99, 121];
1056
+ }, {
1057
+ "kind": "account";
1058
+ "path": "vault";
1059
+ }];
1060
+ };
1061
+ }, {
1062
+ "name": "tracker";
1063
+ "writable": true;
1064
+ "pda": {
1065
+ "seeds": [{
1066
+ "kind": "const";
1067
+ "value": [116, 114, 97, 99, 107, 101, 114];
1068
+ }, {
1069
+ "kind": "account";
1070
+ "path": "vault";
1071
+ }];
1072
+ };
1073
+ }, {
1074
+ "name": "systemProgram";
1075
+ "address": "11111111111111111111111111111111";
1076
+ }];
1077
+ args: [];
1078
+ } & {
1079
+ name: "closeVault";
1080
+ }, {
1081
+ name: "owner";
1082
+ writable: true;
1083
+ signer: true;
1084
+ relations: ["vault"];
1085
+ } | {
1086
+ name: "vault";
1087
+ writable: true;
1088
+ pda: {
1089
+ "seeds": [{
1090
+ "kind": "const";
1091
+ "value": [118, 97, 117, 108, 116];
1092
+ }, {
1093
+ "kind": "account";
1094
+ "path": "owner";
1095
+ }, {
1096
+ "kind": "account";
1097
+ "path": "vault.vault_id";
1098
+ "account": "agentVault";
1099
+ }];
1100
+ };
1101
+ relations: ["policy", "tracker"];
1102
+ } | {
1103
+ name: "policy";
1104
+ writable: true;
1105
+ pda: {
1106
+ "seeds": [{
1107
+ "kind": "const";
1108
+ "value": [112, 111, 108, 105, 99, 121];
1109
+ }, {
1110
+ "kind": "account";
1111
+ "path": "vault";
1112
+ }];
1113
+ };
1114
+ } | {
1115
+ name: "tracker";
1116
+ writable: true;
1117
+ pda: {
1118
+ "seeds": [{
1119
+ "kind": "const";
1120
+ "value": [116, 114, 97, 99, 107, 101, 114];
1121
+ }, {
1122
+ "kind": "account";
1123
+ "path": "vault";
1124
+ }];
1125
+ };
1126
+ } | {
1127
+ name: "systemProgram";
1128
+ address: "11111111111111111111111111111111";
1129
+ }>;
1130
+ //# sourceMappingURL=instructions.d.ts.map