@agent-shield/sdk 0.1.5 → 0.2.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 (49) hide show
  1. package/README.md +14 -12
  2. package/dist/accounts.d.ts +5 -3
  3. package/dist/accounts.d.ts.map +1 -1
  4. package/dist/accounts.js +23 -4
  5. package/dist/accounts.js.map +1 -1
  6. package/dist/client.d.ts +16 -4
  7. package/dist/client.d.ts.map +1 -1
  8. package/dist/client.js +48 -7
  9. package/dist/client.js.map +1 -1
  10. package/dist/composer.d.ts.map +1 -1
  11. package/dist/composer.js +3 -3
  12. package/dist/composer.js.map +1 -1
  13. package/dist/idl-json.d.ts +655 -24
  14. package/dist/idl-json.d.ts.map +1 -1
  15. package/dist/idl-json.js +1174 -87
  16. package/dist/idl-json.js.map +1 -1
  17. package/dist/idl.d.ts +1283 -196
  18. package/dist/idl.d.ts.map +1 -1
  19. package/dist/index.d.ts +6 -3
  20. package/dist/index.d.ts.map +1 -1
  21. package/dist/index.js +25 -1
  22. package/dist/index.js.map +1 -1
  23. package/dist/instructions.d.ts +604 -61
  24. package/dist/instructions.d.ts.map +1 -1
  25. package/dist/instructions.js +76 -8
  26. package/dist/instructions.js.map +1 -1
  27. package/dist/integrations/flash-trade.d.ts.map +1 -1
  28. package/dist/integrations/flash-trade.js +14 -6
  29. package/dist/integrations/flash-trade.js.map +1 -1
  30. package/dist/integrations/jupiter.d.ts.map +1 -1
  31. package/dist/integrations/jupiter.js +4 -1
  32. package/dist/integrations/jupiter.js.map +1 -1
  33. package/dist/oracle.d.ts +31 -0
  34. package/dist/oracle.d.ts.map +1 -0
  35. package/dist/oracle.js +57 -0
  36. package/dist/oracle.js.map +1 -0
  37. package/dist/rewriter.d.ts +21 -0
  38. package/dist/rewriter.d.ts.map +1 -0
  39. package/dist/rewriter.js +33 -0
  40. package/dist/rewriter.js.map +1 -0
  41. package/dist/types.d.ts +82 -12
  42. package/dist/types.d.ts.map +1 -1
  43. package/dist/types.js +5 -1
  44. package/dist/types.js.map +1 -1
  45. package/dist/wrap.d.ts +60 -0
  46. package/dist/wrap.d.ts.map +1 -0
  47. package/dist/wrap.js +88 -0
  48. package/dist/wrap.js.map +1 -0
  49. package/package.json +10 -1
@@ -1,6 +1,6 @@
1
1
  import { PublicKey } from "@solana/web3.js";
2
2
  import { BN, Program } from "@coral-xyz/anchor";
3
- import type { AgentShield, InitializeVaultParams, UpdatePolicyParams, AuthorizeParams } from "./types";
3
+ import type { AgentShield, InitializeVaultParams, UpdatePolicyParams, QueuePolicyUpdateParams, AgentTransferParams, AuthorizeParams } from "./types";
4
4
  export declare function buildInitializeVault(program: Program<AgentShield>, owner: PublicKey, params: InitializeVaultParams): import("@coral-xyz/anchor/dist/cjs/program/namespace/methods").MethodsBuilder<AgentShield, {
5
5
  name: "initializeVault";
6
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."];
@@ -59,15 +59,19 @@ export declare function buildInitializeVault(program: Program<AgentShield>, owne
59
59
  "name": "vaultId";
60
60
  "type": "u64";
61
61
  }, {
62
- "name": "dailySpendingCap";
62
+ "name": "dailySpendingCapUsd";
63
63
  "type": "u64";
64
64
  }, {
65
- "name": "maxTransactionSize";
65
+ "name": "maxTransactionSizeUsd";
66
66
  "type": "u64";
67
67
  }, {
68
68
  "name": "allowedTokens";
69
69
  "type": {
70
- "vec": "pubkey";
70
+ "vec": {
71
+ "defined": {
72
+ "name": "allowedToken";
73
+ };
74
+ };
71
75
  };
72
76
  }, {
73
77
  "name": "allowedProtocols";
@@ -83,6 +87,14 @@ export declare function buildInitializeVault(program: Program<AgentShield>, owne
83
87
  }, {
84
88
  "name": "developerFeeRate";
85
89
  "type": "u16";
90
+ }, {
91
+ "name": "timelockDuration";
92
+ "type": "u64";
93
+ }, {
94
+ "name": "allowedDestinations";
95
+ "type": {
96
+ "vec": "pubkey";
97
+ };
86
98
  }];
87
99
  } & {
88
100
  name: "initializeVault";
@@ -156,8 +168,8 @@ export declare function buildDepositFunds(program: Program<AgentShield>, owner:
156
168
  "path": "owner";
157
169
  }, {
158
170
  "kind": "account";
159
- "path": "vault.vaultId";
160
- "account": "AgentVault";
171
+ "path": "vault.vault_id";
172
+ "account": "agentVault";
161
173
  }];
162
174
  };
163
175
  }, {
@@ -234,8 +246,8 @@ export declare function buildDepositFunds(program: Program<AgentShield>, owner:
234
246
  "path": "owner";
235
247
  }, {
236
248
  "kind": "account";
237
- "path": "vault.vaultId";
238
- "account": "AgentVault";
249
+ "path": "vault.vault_id";
250
+ "account": "agentVault";
239
251
  }];
240
252
  };
241
253
  } | {
@@ -310,8 +322,8 @@ export declare function buildRegisterAgent(program: Program<AgentShield>, owner:
310
322
  "path": "owner";
311
323
  }, {
312
324
  "kind": "account";
313
- "path": "vault.vaultId";
314
- "account": "AgentVault";
325
+ "path": "vault.vault_id";
326
+ "account": "agentVault";
315
327
  }];
316
328
  };
317
329
  }];
@@ -337,14 +349,14 @@ export declare function buildRegisterAgent(program: Program<AgentShield>, owner:
337
349
  "path": "owner";
338
350
  }, {
339
351
  "kind": "account";
340
- "path": "vault.vaultId";
341
- "account": "AgentVault";
352
+ "path": "vault.vault_id";
353
+ "account": "agentVault";
342
354
  }];
343
355
  };
344
356
  }>;
345
357
  export declare function buildUpdatePolicy(program: Program<AgentShield>, owner: PublicKey, vault: PublicKey, params: UpdatePolicyParams): import("@coral-xyz/anchor/dist/cjs/program/namespace/methods").MethodsBuilder<AgentShield, {
346
358
  name: "updatePolicy";
347
- docs: ["Update the policy configuration for a vault.", "Only the owner can call this. Cannot be called by the agent."];
359
+ docs: ["Update the policy configuration for a vault.", "Only the owner can call this. Cannot be called by the agent.", "Blocked when timelock_duration > 0 \u2014 use queue_policy_update instead."];
348
360
  discriminator: [212, 245, 246, 7, 163, 151, 18, 57];
349
361
  accounts: [{
350
362
  "name": "owner";
@@ -361,8 +373,8 @@ export declare function buildUpdatePolicy(program: Program<AgentShield>, owner:
361
373
  "path": "owner";
362
374
  }, {
363
375
  "kind": "account";
364
- "path": "vault.vaultId";
365
- "account": "AgentVault";
376
+ "path": "vault.vault_id";
377
+ "account": "agentVault";
366
378
  }];
367
379
  };
368
380
  "relations": ["policy"];
@@ -380,12 +392,12 @@ export declare function buildUpdatePolicy(program: Program<AgentShield>, owner:
380
392
  };
381
393
  }];
382
394
  args: [{
383
- "name": "dailySpendingCap";
395
+ "name": "dailySpendingCapUsd";
384
396
  "type": {
385
397
  "option": "u64";
386
398
  };
387
399
  }, {
388
- "name": "maxTransactionSize";
400
+ "name": "maxTransactionSizeUsd";
389
401
  "type": {
390
402
  "option": "u64";
391
403
  };
@@ -393,7 +405,11 @@ export declare function buildUpdatePolicy(program: Program<AgentShield>, owner:
393
405
  "name": "allowedTokens";
394
406
  "type": {
395
407
  "option": {
396
- "vec": "pubkey";
408
+ "vec": {
409
+ "defined": {
410
+ "name": "allowedToken";
411
+ };
412
+ };
397
413
  };
398
414
  };
399
415
  }, {
@@ -423,6 +439,18 @@ export declare function buildUpdatePolicy(program: Program<AgentShield>, owner:
423
439
  "type": {
424
440
  "option": "u16";
425
441
  };
442
+ }, {
443
+ "name": "timelockDuration";
444
+ "type": {
445
+ "option": "u64";
446
+ };
447
+ }, {
448
+ "name": "allowedDestinations";
449
+ "type": {
450
+ "option": {
451
+ "vec": "pubkey";
452
+ };
453
+ };
426
454
  }];
427
455
  } & {
428
456
  name: "updatePolicy";
@@ -441,8 +469,8 @@ export declare function buildUpdatePolicy(program: Program<AgentShield>, owner:
441
469
  "path": "owner";
442
470
  }, {
443
471
  "kind": "account";
444
- "path": "vault.vaultId";
445
- "account": "AgentVault";
472
+ "path": "vault.vault_id";
473
+ "account": "agentVault";
446
474
  }];
447
475
  };
448
476
  relations: ["policy"];
@@ -459,9 +487,9 @@ export declare function buildUpdatePolicy(program: Program<AgentShield>, owner:
459
487
  }];
460
488
  };
461
489
  }>;
462
- export declare function buildValidateAndAuthorize(program: Program<AgentShield>, agent: PublicKey, vault: PublicKey, params: AuthorizeParams): import("@coral-xyz/anchor/dist/cjs/program/namespace/methods").MethodsBuilder<AgentShield, {
490
+ export declare function buildValidateAndAuthorize(program: Program<AgentShield>, agent: PublicKey, vault: PublicKey, vaultTokenAccount: PublicKey, params: AuthorizeParams, oracleFeedAccount?: PublicKey): import("@coral-xyz/anchor/dist/cjs/program/namespace/methods").MethodsBuilder<AgentShield, {
463
491
  name: "validateAndAuthorize";
464
- 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)."];
492
+ docs: ["Core permission check. Called by the agent before a DeFi action.", "Validates the action against all policy constraints (USD caps, per-token caps).", "If approved, creates a SessionAuthority PDA, delegates tokens to agent,", "and updates spend tracking.", "If denied, reverts the entire transaction (including subsequent DeFi instructions)."];
465
493
  discriminator: [22, 183, 48, 222, 218, 11, 197, 152];
466
494
  accounts: [{
467
495
  "name": "agent";
@@ -477,11 +505,11 @@ export declare function buildValidateAndAuthorize(program: Program<AgentShield>,
477
505
  }, {
478
506
  "kind": "account";
479
507
  "path": "vault.owner";
480
- "account": "AgentVault";
508
+ "account": "agentVault";
481
509
  }, {
482
510
  "kind": "account";
483
- "path": "vault.vaultId";
484
- "account": "AgentVault";
511
+ "path": "vault.vault_id";
512
+ "account": "agentVault";
485
513
  }];
486
514
  };
487
515
  "relations": ["policy", "tracker"];
@@ -510,7 +538,7 @@ export declare function buildValidateAndAuthorize(program: Program<AgentShield>,
510
538
  };
511
539
  }, {
512
540
  "name": "session";
513
- "docs": ["Ephemeral session PDA \u2014 `init` ensures no double-authorization"];
541
+ "docs": ["Ephemeral session PDA \u2014 `init` ensures no double-authorization.", "Seeds include token_mint for per-token concurrent sessions."];
514
542
  "writable": true;
515
543
  "pda": {
516
544
  "seeds": [{
@@ -522,8 +550,21 @@ export declare function buildValidateAndAuthorize(program: Program<AgentShield>,
522
550
  }, {
523
551
  "kind": "account";
524
552
  "path": "agent";
553
+ }, {
554
+ "kind": "arg";
555
+ "path": "tokenMint";
525
556
  }];
526
557
  };
558
+ }, {
559
+ "name": "vaultTokenAccount";
560
+ "docs": ["Vault's PDA-owned token account for the spend token (delegation source)"];
561
+ "writable": true;
562
+ }, {
563
+ "name": "tokenMintAccount";
564
+ "docs": ["The token mint being spent"];
565
+ }, {
566
+ "name": "tokenProgram";
567
+ "address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
527
568
  }, {
528
569
  "name": "systemProgram";
529
570
  "address": "11111111111111111111111111111111";
@@ -532,7 +573,7 @@ export declare function buildValidateAndAuthorize(program: Program<AgentShield>,
532
573
  "name": "actionType";
533
574
  "type": {
534
575
  "defined": {
535
- "name": "ActionType";
576
+ "name": "actionType";
536
577
  };
537
578
  };
538
579
  }, {
@@ -566,11 +607,11 @@ export declare function buildValidateAndAuthorize(program: Program<AgentShield>,
566
607
  }, {
567
608
  "kind": "account";
568
609
  "path": "vault.owner";
569
- "account": "AgentVault";
610
+ "account": "agentVault";
570
611
  }, {
571
612
  "kind": "account";
572
- "path": "vault.vaultId";
573
- "account": "AgentVault";
613
+ "path": "vault.vault_id";
614
+ "account": "agentVault";
574
615
  }];
575
616
  };
576
617
  relations: ["policy", "tracker"];
@@ -599,7 +640,7 @@ export declare function buildValidateAndAuthorize(program: Program<AgentShield>,
599
640
  };
600
641
  } | {
601
642
  name: "session";
602
- docs: ["Ephemeral session PDA \u2014 `init` ensures no double-authorization"];
643
+ docs: ["Ephemeral session PDA \u2014 `init` ensures no double-authorization.", "Seeds include token_mint for per-token concurrent sessions."];
603
644
  writable: true;
604
645
  pda: {
605
646
  "seeds": [{
@@ -611,15 +652,28 @@ export declare function buildValidateAndAuthorize(program: Program<AgentShield>,
611
652
  }, {
612
653
  "kind": "account";
613
654
  "path": "agent";
655
+ }, {
656
+ "kind": "arg";
657
+ "path": "tokenMint";
614
658
  }];
615
659
  };
660
+ } | {
661
+ name: "vaultTokenAccount";
662
+ docs: ["Vault's PDA-owned token account for the spend token (delegation source)"];
663
+ writable: true;
664
+ } | {
665
+ name: "tokenMintAccount";
666
+ docs: ["The token mint being spent"];
667
+ } | {
668
+ name: "tokenProgram";
669
+ address: "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
616
670
  } | {
617
671
  name: "systemProgram";
618
672
  address: "11111111111111111111111111111111";
619
673
  }>;
620
- export declare function buildFinalizeSession(program: Program<AgentShield>, payer: PublicKey, vault: PublicKey, agent: PublicKey, success: boolean, vaultTokenAccount?: PublicKey | null, feeDestinationTokenAccount?: PublicKey | null, protocolTreasuryTokenAccount?: PublicKey | null): import("@coral-xyz/anchor/dist/cjs/program/namespace/methods").MethodsBuilder<AgentShield, {
674
+ export declare function buildFinalizeSession(program: Program<AgentShield>, payer: PublicKey, vault: PublicKey, agent: PublicKey, tokenMint: PublicKey, success: boolean, vaultTokenAccount: PublicKey, feeDestinationTokenAccount?: PublicKey | null, protocolTreasuryTokenAccount?: PublicKey | null): import("@coral-xyz/anchor/dist/cjs/program/namespace/methods").MethodsBuilder<AgentShield, {
621
675
  name: "finalizeSession";
622
- 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)."];
676
+ docs: ["Finalize a session after the DeFi action completes.", "Revokes token delegation, collects fees, 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)."];
623
677
  discriminator: [34, 148, 144, 47, 37, 130, 206, 161];
624
678
  accounts: [{
625
679
  "name": "payer";
@@ -635,11 +689,11 @@ export declare function buildFinalizeSession(program: Program<AgentShield>, paye
635
689
  }, {
636
690
  "kind": "account";
637
691
  "path": "vault.owner";
638
- "account": "AgentVault";
692
+ "account": "agentVault";
639
693
  }, {
640
694
  "kind": "account";
641
- "path": "vault.vaultId";
642
- "account": "AgentVault";
695
+ "path": "vault.vault_id";
696
+ "account": "agentVault";
643
697
  }];
644
698
  };
645
699
  "relations": ["policy", "tracker", "session"];
@@ -668,7 +722,7 @@ export declare function buildFinalizeSession(program: Program<AgentShield>, paye
668
722
  };
669
723
  }, {
670
724
  "name": "session";
671
- "docs": ["Session rent is returned to the session's agent (who paid for it),", "not the arbitrary payer, to prevent rent theft."];
725
+ "docs": ["Session rent is returned to the session's agent (who paid for it),", "not the arbitrary payer, to prevent rent theft.", "Seeds include token_mint for per-token concurrent sessions."];
672
726
  "writable": true;
673
727
  "pda": {
674
728
  "seeds": [{
@@ -680,7 +734,11 @@ export declare function buildFinalizeSession(program: Program<AgentShield>, paye
680
734
  }, {
681
735
  "kind": "account";
682
736
  "path": "session.agent";
683
- "account": "SessionAuthority";
737
+ "account": "sessionAuthority";
738
+ }, {
739
+ "kind": "account";
740
+ "path": "session.authorized_token";
741
+ "account": "sessionAuthority";
684
742
  }];
685
743
  };
686
744
  }, {
@@ -689,7 +747,7 @@ export declare function buildFinalizeSession(program: Program<AgentShield>, paye
689
747
  "writable": true;
690
748
  }, {
691
749
  "name": "vaultTokenAccount";
692
- "docs": ["Vault's PDA token account for the session's token (fee source)"];
750
+ "docs": ["Vault's PDA token account for the session's token (fee source + delegation revocation)"];
693
751
  "writable": true;
694
752
  "optional": true;
695
753
  }, {
@@ -729,11 +787,11 @@ export declare function buildFinalizeSession(program: Program<AgentShield>, paye
729
787
  }, {
730
788
  "kind": "account";
731
789
  "path": "vault.owner";
732
- "account": "AgentVault";
790
+ "account": "agentVault";
733
791
  }, {
734
792
  "kind": "account";
735
- "path": "vault.vaultId";
736
- "account": "AgentVault";
793
+ "path": "vault.vault_id";
794
+ "account": "agentVault";
737
795
  }];
738
796
  };
739
797
  relations: ["policy", "tracker", "session"];
@@ -762,7 +820,7 @@ export declare function buildFinalizeSession(program: Program<AgentShield>, paye
762
820
  };
763
821
  } | {
764
822
  name: "session";
765
- docs: ["Session rent is returned to the session's agent (who paid for it),", "not the arbitrary payer, to prevent rent theft."];
823
+ docs: ["Session rent is returned to the session's agent (who paid for it),", "not the arbitrary payer, to prevent rent theft.", "Seeds include token_mint for per-token concurrent sessions."];
766
824
  writable: true;
767
825
  pda: {
768
826
  "seeds": [{
@@ -774,7 +832,11 @@ export declare function buildFinalizeSession(program: Program<AgentShield>, paye
774
832
  }, {
775
833
  "kind": "account";
776
834
  "path": "session.agent";
777
- "account": "SessionAuthority";
835
+ "account": "sessionAuthority";
836
+ }, {
837
+ "kind": "account";
838
+ "path": "session.authorized_token";
839
+ "account": "sessionAuthority";
778
840
  }];
779
841
  };
780
842
  } | {
@@ -783,7 +845,7 @@ export declare function buildFinalizeSession(program: Program<AgentShield>, paye
783
845
  writable: true;
784
846
  } | {
785
847
  name: "vaultTokenAccount";
786
- docs: ["Vault's PDA token account for the session's token (fee source)"];
848
+ docs: ["Vault's PDA token account for the session's token (fee source + delegation revocation)"];
787
849
  writable: true;
788
850
  optional: true;
789
851
  } | {
@@ -823,8 +885,8 @@ export declare function buildRevokeAgent(program: Program<AgentShield>, owner: P
823
885
  "path": "owner";
824
886
  }, {
825
887
  "kind": "account";
826
- "path": "vault.vaultId";
827
- "account": "AgentVault";
888
+ "path": "vault.vault_id";
889
+ "account": "agentVault";
828
890
  }];
829
891
  };
830
892
  }];
@@ -847,8 +909,8 @@ export declare function buildRevokeAgent(program: Program<AgentShield>, owner: P
847
909
  "path": "owner";
848
910
  }, {
849
911
  "kind": "account";
850
- "path": "vault.vaultId";
851
- "account": "AgentVault";
912
+ "path": "vault.vault_id";
913
+ "account": "agentVault";
852
914
  }];
853
915
  };
854
916
  }>;
@@ -872,8 +934,8 @@ export declare function buildReactivateVault(program: Program<AgentShield>, owne
872
934
  "path": "owner";
873
935
  }, {
874
936
  "kind": "account";
875
- "path": "vault.vaultId";
876
- "account": "AgentVault";
937
+ "path": "vault.vault_id";
938
+ "account": "agentVault";
877
939
  }];
878
940
  };
879
941
  }];
@@ -901,8 +963,8 @@ export declare function buildReactivateVault(program: Program<AgentShield>, owne
901
963
  "path": "owner";
902
964
  }, {
903
965
  "kind": "account";
904
- "path": "vault.vaultId";
905
- "account": "AgentVault";
966
+ "path": "vault.vault_id";
967
+ "account": "agentVault";
906
968
  }];
907
969
  };
908
970
  }>;
@@ -926,8 +988,8 @@ export declare function buildWithdrawFunds(program: Program<AgentShield>, owner:
926
988
  "path": "owner";
927
989
  }, {
928
990
  "kind": "account";
929
- "path": "vault.vaultId";
930
- "account": "AgentVault";
991
+ "path": "vault.vault_id";
992
+ "account": "agentVault";
931
993
  }];
932
994
  };
933
995
  }, {
@@ -998,8 +1060,8 @@ export declare function buildWithdrawFunds(program: Program<AgentShield>, owner:
998
1060
  "path": "owner";
999
1061
  }, {
1000
1062
  "kind": "account";
1001
- "path": "vault.vaultId";
1002
- "account": "AgentVault";
1063
+ "path": "vault.vault_id";
1064
+ "account": "agentVault";
1003
1065
  }];
1004
1066
  };
1005
1067
  } | {
@@ -1069,8 +1131,8 @@ export declare function buildCloseVault(program: Program<AgentShield>, owner: Pu
1069
1131
  "path": "owner";
1070
1132
  }, {
1071
1133
  "kind": "account";
1072
- "path": "vault.vaultId";
1073
- "account": "AgentVault";
1134
+ "path": "vault.vault_id";
1135
+ "account": "agentVault";
1074
1136
  }];
1075
1137
  };
1076
1138
  "relations": ["policy", "tracker"];
@@ -1122,8 +1184,8 @@ export declare function buildCloseVault(program: Program<AgentShield>, owner: Pu
1122
1184
  "path": "owner";
1123
1185
  }, {
1124
1186
  "kind": "account";
1125
- "path": "vault.vaultId";
1126
- "account": "AgentVault";
1187
+ "path": "vault.vault_id";
1188
+ "account": "agentVault";
1127
1189
  }];
1128
1190
  };
1129
1191
  relations: ["policy", "tracker"];
@@ -1155,4 +1217,485 @@ export declare function buildCloseVault(program: Program<AgentShield>, owner: Pu
1155
1217
  name: "systemProgram";
1156
1218
  address: "11111111111111111111111111111111";
1157
1219
  }>;
1220
+ export declare function buildQueuePolicyUpdate(program: Program<AgentShield>, owner: PublicKey, vault: PublicKey, params: QueuePolicyUpdateParams): import("@coral-xyz/anchor/dist/cjs/program/namespace/methods").MethodsBuilder<AgentShield, {
1221
+ name: "queuePolicyUpdate";
1222
+ docs: ["Queue a policy update when timelock is active.", "Creates a PendingPolicyUpdate PDA that becomes executable after", "the timelock period expires."];
1223
+ discriminator: [149, 18, 76, 197, 179, 193, 91, 77];
1224
+ accounts: [{
1225
+ "name": "owner";
1226
+ "writable": true;
1227
+ "signer": true;
1228
+ "relations": ["vault"];
1229
+ }, {
1230
+ "name": "vault";
1231
+ "pda": {
1232
+ "seeds": [{
1233
+ "kind": "const";
1234
+ "value": [118, 97, 117, 108, 116];
1235
+ }, {
1236
+ "kind": "account";
1237
+ "path": "owner";
1238
+ }, {
1239
+ "kind": "account";
1240
+ "path": "vault.vault_id";
1241
+ "account": "agentVault";
1242
+ }];
1243
+ };
1244
+ "relations": ["policy"];
1245
+ }, {
1246
+ "name": "policy";
1247
+ "pda": {
1248
+ "seeds": [{
1249
+ "kind": "const";
1250
+ "value": [112, 111, 108, 105, 99, 121];
1251
+ }, {
1252
+ "kind": "account";
1253
+ "path": "vault";
1254
+ }];
1255
+ };
1256
+ }, {
1257
+ "name": "pendingPolicy";
1258
+ "writable": true;
1259
+ "pda": {
1260
+ "seeds": [{
1261
+ "kind": "const";
1262
+ "value": [112, 101, 110, 100, 105, 110, 103, 95, 112, 111, 108, 105, 99, 121];
1263
+ }, {
1264
+ "kind": "account";
1265
+ "path": "vault";
1266
+ }];
1267
+ };
1268
+ }, {
1269
+ "name": "systemProgram";
1270
+ "address": "11111111111111111111111111111111";
1271
+ }];
1272
+ args: [{
1273
+ "name": "dailySpendingCapUsd";
1274
+ "type": {
1275
+ "option": "u64";
1276
+ };
1277
+ }, {
1278
+ "name": "maxTransactionAmountUsd";
1279
+ "type": {
1280
+ "option": "u64";
1281
+ };
1282
+ }, {
1283
+ "name": "allowedTokens";
1284
+ "type": {
1285
+ "option": {
1286
+ "vec": {
1287
+ "defined": {
1288
+ "name": "allowedToken";
1289
+ };
1290
+ };
1291
+ };
1292
+ };
1293
+ }, {
1294
+ "name": "allowedProtocols";
1295
+ "type": {
1296
+ "option": {
1297
+ "vec": "pubkey";
1298
+ };
1299
+ };
1300
+ }, {
1301
+ "name": "maxLeverageBps";
1302
+ "type": {
1303
+ "option": "u16";
1304
+ };
1305
+ }, {
1306
+ "name": "canOpenPositions";
1307
+ "type": {
1308
+ "option": "bool";
1309
+ };
1310
+ }, {
1311
+ "name": "maxConcurrentPositions";
1312
+ "type": {
1313
+ "option": "u8";
1314
+ };
1315
+ }, {
1316
+ "name": "developerFeeRate";
1317
+ "type": {
1318
+ "option": "u16";
1319
+ };
1320
+ }, {
1321
+ "name": "timelockDuration";
1322
+ "type": {
1323
+ "option": "u64";
1324
+ };
1325
+ }, {
1326
+ "name": "allowedDestinations";
1327
+ "type": {
1328
+ "option": {
1329
+ "vec": "pubkey";
1330
+ };
1331
+ };
1332
+ }];
1333
+ } & {
1334
+ name: "queuePolicyUpdate";
1335
+ }, {
1336
+ name: "owner";
1337
+ writable: true;
1338
+ signer: true;
1339
+ relations: ["vault"];
1340
+ } | {
1341
+ name: "vault";
1342
+ pda: {
1343
+ "seeds": [{
1344
+ "kind": "const";
1345
+ "value": [118, 97, 117, 108, 116];
1346
+ }, {
1347
+ "kind": "account";
1348
+ "path": "owner";
1349
+ }, {
1350
+ "kind": "account";
1351
+ "path": "vault.vault_id";
1352
+ "account": "agentVault";
1353
+ }];
1354
+ };
1355
+ relations: ["policy"];
1356
+ } | {
1357
+ name: "policy";
1358
+ pda: {
1359
+ "seeds": [{
1360
+ "kind": "const";
1361
+ "value": [112, 111, 108, 105, 99, 121];
1362
+ }, {
1363
+ "kind": "account";
1364
+ "path": "vault";
1365
+ }];
1366
+ };
1367
+ } | {
1368
+ name: "pendingPolicy";
1369
+ writable: true;
1370
+ pda: {
1371
+ "seeds": [{
1372
+ "kind": "const";
1373
+ "value": [112, 101, 110, 100, 105, 110, 103, 95, 112, 111, 108, 105, 99, 121];
1374
+ }, {
1375
+ "kind": "account";
1376
+ "path": "vault";
1377
+ }];
1378
+ };
1379
+ } | {
1380
+ name: "systemProgram";
1381
+ address: "11111111111111111111111111111111";
1382
+ }>;
1383
+ export declare function buildApplyPendingPolicy(program: Program<AgentShield>, owner: PublicKey, vault: PublicKey): import("@coral-xyz/anchor/dist/cjs/program/namespace/methods").MethodsBuilder<AgentShield, {
1384
+ name: "applyPendingPolicy";
1385
+ docs: ["Apply a queued policy update after the timelock period has expired.", "Closes the PendingPolicyUpdate PDA and returns rent to the owner."];
1386
+ discriminator: [114, 212, 19, 227, 89, 199, 74, 62];
1387
+ accounts: [{
1388
+ "name": "owner";
1389
+ "writable": true;
1390
+ "signer": true;
1391
+ "relations": ["vault"];
1392
+ }, {
1393
+ "name": "vault";
1394
+ "pda": {
1395
+ "seeds": [{
1396
+ "kind": "const";
1397
+ "value": [118, 97, 117, 108, 116];
1398
+ }, {
1399
+ "kind": "account";
1400
+ "path": "owner";
1401
+ }, {
1402
+ "kind": "account";
1403
+ "path": "vault.vault_id";
1404
+ "account": "agentVault";
1405
+ }];
1406
+ };
1407
+ "relations": ["policy", "pendingPolicy"];
1408
+ }, {
1409
+ "name": "policy";
1410
+ "writable": true;
1411
+ "pda": {
1412
+ "seeds": [{
1413
+ "kind": "const";
1414
+ "value": [112, 111, 108, 105, 99, 121];
1415
+ }, {
1416
+ "kind": "account";
1417
+ "path": "vault";
1418
+ }];
1419
+ };
1420
+ }, {
1421
+ "name": "pendingPolicy";
1422
+ "writable": true;
1423
+ "pda": {
1424
+ "seeds": [{
1425
+ "kind": "const";
1426
+ "value": [112, 101, 110, 100, 105, 110, 103, 95, 112, 111, 108, 105, 99, 121];
1427
+ }, {
1428
+ "kind": "account";
1429
+ "path": "vault";
1430
+ }];
1431
+ };
1432
+ }];
1433
+ args: [];
1434
+ } & {
1435
+ name: "applyPendingPolicy";
1436
+ }, {
1437
+ name: "owner";
1438
+ writable: true;
1439
+ signer: true;
1440
+ relations: ["vault"];
1441
+ } | {
1442
+ name: "vault";
1443
+ pda: {
1444
+ "seeds": [{
1445
+ "kind": "const";
1446
+ "value": [118, 97, 117, 108, 116];
1447
+ }, {
1448
+ "kind": "account";
1449
+ "path": "owner";
1450
+ }, {
1451
+ "kind": "account";
1452
+ "path": "vault.vault_id";
1453
+ "account": "agentVault";
1454
+ }];
1455
+ };
1456
+ relations: ["policy", "pendingPolicy"];
1457
+ } | {
1458
+ name: "policy";
1459
+ writable: true;
1460
+ pda: {
1461
+ "seeds": [{
1462
+ "kind": "const";
1463
+ "value": [112, 111, 108, 105, 99, 121];
1464
+ }, {
1465
+ "kind": "account";
1466
+ "path": "vault";
1467
+ }];
1468
+ };
1469
+ } | {
1470
+ name: "pendingPolicy";
1471
+ writable: true;
1472
+ pda: {
1473
+ "seeds": [{
1474
+ "kind": "const";
1475
+ "value": [112, 101, 110, 100, 105, 110, 103, 95, 112, 111, 108, 105, 99, 121];
1476
+ }, {
1477
+ "kind": "account";
1478
+ "path": "vault";
1479
+ }];
1480
+ };
1481
+ }>;
1482
+ export declare function buildCancelPendingPolicy(program: Program<AgentShield>, owner: PublicKey, vault: PublicKey): import("@coral-xyz/anchor/dist/cjs/program/namespace/methods").MethodsBuilder<AgentShield, {
1483
+ name: "cancelPendingPolicy";
1484
+ docs: ["Cancel a queued policy update. Closes the PendingPolicyUpdate PDA", "and returns rent to the owner."];
1485
+ discriminator: [153, 36, 104, 200, 50, 94, 207, 33];
1486
+ accounts: [{
1487
+ "name": "owner";
1488
+ "writable": true;
1489
+ "signer": true;
1490
+ "relations": ["vault"];
1491
+ }, {
1492
+ "name": "vault";
1493
+ "pda": {
1494
+ "seeds": [{
1495
+ "kind": "const";
1496
+ "value": [118, 97, 117, 108, 116];
1497
+ }, {
1498
+ "kind": "account";
1499
+ "path": "owner";
1500
+ }, {
1501
+ "kind": "account";
1502
+ "path": "vault.vault_id";
1503
+ "account": "agentVault";
1504
+ }];
1505
+ };
1506
+ "relations": ["pendingPolicy"];
1507
+ }, {
1508
+ "name": "pendingPolicy";
1509
+ "writable": true;
1510
+ "pda": {
1511
+ "seeds": [{
1512
+ "kind": "const";
1513
+ "value": [112, 101, 110, 100, 105, 110, 103, 95, 112, 111, 108, 105, 99, 121];
1514
+ }, {
1515
+ "kind": "account";
1516
+ "path": "vault";
1517
+ }];
1518
+ };
1519
+ }];
1520
+ args: [];
1521
+ } & {
1522
+ name: "cancelPendingPolicy";
1523
+ }, {
1524
+ name: "owner";
1525
+ writable: true;
1526
+ signer: true;
1527
+ relations: ["vault"];
1528
+ } | {
1529
+ name: "vault";
1530
+ pda: {
1531
+ "seeds": [{
1532
+ "kind": "const";
1533
+ "value": [118, 97, 117, 108, 116];
1534
+ }, {
1535
+ "kind": "account";
1536
+ "path": "owner";
1537
+ }, {
1538
+ "kind": "account";
1539
+ "path": "vault.vault_id";
1540
+ "account": "agentVault";
1541
+ }];
1542
+ };
1543
+ relations: ["pendingPolicy"];
1544
+ } | {
1545
+ name: "pendingPolicy";
1546
+ writable: true;
1547
+ pda: {
1548
+ "seeds": [{
1549
+ "kind": "const";
1550
+ "value": [112, 101, 110, 100, 105, 110, 103, 95, 112, 111, 108, 105, 99, 121];
1551
+ }, {
1552
+ "kind": "account";
1553
+ "path": "vault";
1554
+ }];
1555
+ };
1556
+ }>;
1557
+ export declare function buildAgentTransfer(program: Program<AgentShield>, agent: PublicKey, vault: PublicKey, params: AgentTransferParams, oracleFeedAccount?: PublicKey): import("@coral-xyz/anchor/dist/cjs/program/namespace/methods").MethodsBuilder<AgentShield, {
1558
+ name: "agentTransfer";
1559
+ docs: ["Transfer tokens from the vault to an allowed destination.", "Only the agent can call this. Respects destination allowlist,", "spending caps, and per-token limits."];
1560
+ discriminator: [199, 111, 151, 49, 124, 13, 150, 44];
1561
+ accounts: [{
1562
+ "name": "agent";
1563
+ "writable": true;
1564
+ "signer": true;
1565
+ }, {
1566
+ "name": "vault";
1567
+ "writable": true;
1568
+ "pda": {
1569
+ "seeds": [{
1570
+ "kind": "const";
1571
+ "value": [118, 97, 117, 108, 116];
1572
+ }, {
1573
+ "kind": "account";
1574
+ "path": "vault.owner";
1575
+ "account": "agentVault";
1576
+ }, {
1577
+ "kind": "account";
1578
+ "path": "vault.vault_id";
1579
+ "account": "agentVault";
1580
+ }];
1581
+ };
1582
+ "relations": ["policy", "tracker"];
1583
+ }, {
1584
+ "name": "policy";
1585
+ "pda": {
1586
+ "seeds": [{
1587
+ "kind": "const";
1588
+ "value": [112, 111, 108, 105, 99, 121];
1589
+ }, {
1590
+ "kind": "account";
1591
+ "path": "vault";
1592
+ }];
1593
+ };
1594
+ }, {
1595
+ "name": "tracker";
1596
+ "writable": true;
1597
+ "pda": {
1598
+ "seeds": [{
1599
+ "kind": "const";
1600
+ "value": [116, 114, 97, 99, 107, 101, 114];
1601
+ }, {
1602
+ "kind": "account";
1603
+ "path": "vault";
1604
+ }];
1605
+ };
1606
+ }, {
1607
+ "name": "vaultTokenAccount";
1608
+ "docs": ["Vault's PDA-owned token account (source)"];
1609
+ "writable": true;
1610
+ }, {
1611
+ "name": "destinationTokenAccount";
1612
+ "docs": ["Destination token account (must be in allowed destinations if configured)"];
1613
+ "writable": true;
1614
+ }, {
1615
+ "name": "feeDestinationTokenAccount";
1616
+ "docs": ["Developer fee destination token account \u2014 must match vault.fee_destination"];
1617
+ "writable": true;
1618
+ "optional": true;
1619
+ }, {
1620
+ "name": "protocolTreasuryTokenAccount";
1621
+ "docs": ["Protocol treasury token account"];
1622
+ "writable": true;
1623
+ "optional": true;
1624
+ }, {
1625
+ "name": "tokenProgram";
1626
+ "address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
1627
+ }];
1628
+ args: [{
1629
+ "name": "amount";
1630
+ "type": "u64";
1631
+ }];
1632
+ } & {
1633
+ name: "agentTransfer";
1634
+ }, {
1635
+ name: "agent";
1636
+ writable: true;
1637
+ signer: true;
1638
+ } | {
1639
+ name: "vault";
1640
+ writable: true;
1641
+ pda: {
1642
+ "seeds": [{
1643
+ "kind": "const";
1644
+ "value": [118, 97, 117, 108, 116];
1645
+ }, {
1646
+ "kind": "account";
1647
+ "path": "vault.owner";
1648
+ "account": "agentVault";
1649
+ }, {
1650
+ "kind": "account";
1651
+ "path": "vault.vault_id";
1652
+ "account": "agentVault";
1653
+ }];
1654
+ };
1655
+ relations: ["policy", "tracker"];
1656
+ } | {
1657
+ name: "policy";
1658
+ pda: {
1659
+ "seeds": [{
1660
+ "kind": "const";
1661
+ "value": [112, 111, 108, 105, 99, 121];
1662
+ }, {
1663
+ "kind": "account";
1664
+ "path": "vault";
1665
+ }];
1666
+ };
1667
+ } | {
1668
+ name: "tracker";
1669
+ writable: true;
1670
+ pda: {
1671
+ "seeds": [{
1672
+ "kind": "const";
1673
+ "value": [116, 114, 97, 99, 107, 101, 114];
1674
+ }, {
1675
+ "kind": "account";
1676
+ "path": "vault";
1677
+ }];
1678
+ };
1679
+ } | {
1680
+ name: "vaultTokenAccount";
1681
+ docs: ["Vault's PDA-owned token account (source)"];
1682
+ writable: true;
1683
+ } | {
1684
+ name: "destinationTokenAccount";
1685
+ docs: ["Destination token account (must be in allowed destinations if configured)"];
1686
+ writable: true;
1687
+ } | {
1688
+ name: "feeDestinationTokenAccount";
1689
+ docs: ["Developer fee destination token account \u2014 must match vault.fee_destination"];
1690
+ writable: true;
1691
+ optional: true;
1692
+ } | {
1693
+ name: "protocolTreasuryTokenAccount";
1694
+ docs: ["Protocol treasury token account"];
1695
+ writable: true;
1696
+ optional: true;
1697
+ } | {
1698
+ name: "tokenProgram";
1699
+ address: "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
1700
+ }>;
1158
1701
  //# sourceMappingURL=instructions.d.ts.map