@agent-shield/sdk 0.1.0 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +182 -0
- package/dist/accounts.js +7 -7
- package/dist/client.d.ts +9 -1
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +19 -2
- package/dist/client.js.map +1 -1
- package/dist/composer.d.ts.map +1 -1
- package/dist/composer.js +1 -1
- package/dist/composer.js.map +1 -1
- package/dist/idl-json.d.ts +57 -11
- package/dist/idl-json.d.ts.map +1 -1
- package/dist/idl-json.js +84 -16
- package/dist/idl-json.js.map +1 -1
- package/dist/idl.d.ts +191 -112
- package/dist/idl.d.ts.map +1 -1
- package/dist/instructions.d.ts +74 -46
- package/dist/instructions.d.ts.map +1 -1
- package/dist/instructions.js +5 -3
- package/dist/instructions.js.map +1 -1
- package/dist/types.d.ts +9 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +6 -1
- package/dist/types.js.map +1 -1
- package/package.json +2 -2
package/dist/idl.d.ts
CHANGED
|
@@ -59,8 +59,8 @@ export type AgentShield = {
|
|
|
59
59
|
},
|
|
60
60
|
{
|
|
61
61
|
"kind": "account";
|
|
62
|
-
"path": "vault.
|
|
63
|
-
"account": "
|
|
62
|
+
"path": "vault.vaultId";
|
|
63
|
+
"account": "AgentVault";
|
|
64
64
|
}
|
|
65
65
|
];
|
|
66
66
|
};
|
|
@@ -168,8 +168,8 @@ export type AgentShield = {
|
|
|
168
168
|
},
|
|
169
169
|
{
|
|
170
170
|
"kind": "account";
|
|
171
|
-
"path": "vault.
|
|
172
|
-
"account": "
|
|
171
|
+
"path": "vault.vaultId";
|
|
172
|
+
"account": "AgentVault";
|
|
173
173
|
}
|
|
174
174
|
];
|
|
175
175
|
};
|
|
@@ -424,12 +424,12 @@ export type AgentShield = {
|
|
|
424
424
|
{
|
|
425
425
|
"kind": "account";
|
|
426
426
|
"path": "vault.owner";
|
|
427
|
-
"account": "
|
|
427
|
+
"account": "AgentVault";
|
|
428
428
|
},
|
|
429
429
|
{
|
|
430
430
|
"kind": "account";
|
|
431
|
-
"path": "vault.
|
|
432
|
-
"account": "
|
|
431
|
+
"path": "vault.vaultId";
|
|
432
|
+
"account": "AgentVault";
|
|
433
433
|
}
|
|
434
434
|
];
|
|
435
435
|
};
|
|
@@ -487,6 +487,10 @@ export type AgentShield = {
|
|
|
487
487
|
},
|
|
488
488
|
{
|
|
489
489
|
"name": "session";
|
|
490
|
+
"docs": [
|
|
491
|
+
"Session rent is returned to the session's agent (who paid for it),",
|
|
492
|
+
"not the arbitrary payer, to prevent rent theft."
|
|
493
|
+
];
|
|
490
494
|
"writable": true;
|
|
491
495
|
"pda": {
|
|
492
496
|
"seeds": [
|
|
@@ -509,11 +513,18 @@ export type AgentShield = {
|
|
|
509
513
|
{
|
|
510
514
|
"kind": "account";
|
|
511
515
|
"path": "session.agent";
|
|
512
|
-
"account": "
|
|
516
|
+
"account": "SessionAuthority";
|
|
513
517
|
}
|
|
514
518
|
];
|
|
515
519
|
};
|
|
516
520
|
},
|
|
521
|
+
{
|
|
522
|
+
"name": "sessionRentRecipient";
|
|
523
|
+
"docs": [
|
|
524
|
+
"Validated in handler to equal session.agent."
|
|
525
|
+
];
|
|
526
|
+
"writable": true;
|
|
527
|
+
},
|
|
517
528
|
{
|
|
518
529
|
"name": "vaultTokenAccount";
|
|
519
530
|
"docs": [
|
|
@@ -525,7 +536,15 @@ export type AgentShield = {
|
|
|
525
536
|
{
|
|
526
537
|
"name": "feeDestinationTokenAccount";
|
|
527
538
|
"docs": [
|
|
528
|
-
"
|
|
539
|
+
"Developer fee destination token account \u2014 must match vault.fee_destination"
|
|
540
|
+
];
|
|
541
|
+
"writable": true;
|
|
542
|
+
"optional": true;
|
|
543
|
+
},
|
|
544
|
+
{
|
|
545
|
+
"name": "protocolTreasuryTokenAccount";
|
|
546
|
+
"docs": [
|
|
547
|
+
"Protocol treasury token account \u2014 must be owned by PROTOCOL_TREASURY"
|
|
529
548
|
];
|
|
530
549
|
"writable": true;
|
|
531
550
|
"optional": true;
|
|
@@ -684,6 +703,10 @@ export type AgentShield = {
|
|
|
684
703
|
{
|
|
685
704
|
"name": "maxConcurrentPositions";
|
|
686
705
|
"type": "u8";
|
|
706
|
+
},
|
|
707
|
+
{
|
|
708
|
+
"name": "developerFeeRate";
|
|
709
|
+
"type": "u16";
|
|
687
710
|
}
|
|
688
711
|
];
|
|
689
712
|
},
|
|
@@ -732,8 +755,8 @@ export type AgentShield = {
|
|
|
732
755
|
},
|
|
733
756
|
{
|
|
734
757
|
"kind": "account";
|
|
735
|
-
"path": "vault.
|
|
736
|
-
"account": "
|
|
758
|
+
"path": "vault.vaultId";
|
|
759
|
+
"account": "AgentVault";
|
|
737
760
|
}
|
|
738
761
|
];
|
|
739
762
|
};
|
|
@@ -793,8 +816,8 @@ export type AgentShield = {
|
|
|
793
816
|
},
|
|
794
817
|
{
|
|
795
818
|
"kind": "account";
|
|
796
|
-
"path": "vault.
|
|
797
|
-
"account": "
|
|
819
|
+
"path": "vault.vaultId";
|
|
820
|
+
"account": "AgentVault";
|
|
798
821
|
}
|
|
799
822
|
];
|
|
800
823
|
};
|
|
@@ -852,8 +875,8 @@ export type AgentShield = {
|
|
|
852
875
|
},
|
|
853
876
|
{
|
|
854
877
|
"kind": "account";
|
|
855
|
-
"path": "vault.
|
|
856
|
-
"account": "
|
|
878
|
+
"path": "vault.vaultId";
|
|
879
|
+
"account": "AgentVault";
|
|
857
880
|
}
|
|
858
881
|
];
|
|
859
882
|
};
|
|
@@ -905,8 +928,8 @@ export type AgentShield = {
|
|
|
905
928
|
},
|
|
906
929
|
{
|
|
907
930
|
"kind": "account";
|
|
908
|
-
"path": "vault.
|
|
909
|
-
"account": "
|
|
931
|
+
"path": "vault.vaultId";
|
|
932
|
+
"account": "AgentVault";
|
|
910
933
|
}
|
|
911
934
|
];
|
|
912
935
|
};
|
|
@@ -984,6 +1007,12 @@ export type AgentShield = {
|
|
|
984
1007
|
"type": {
|
|
985
1008
|
"option": "u8";
|
|
986
1009
|
};
|
|
1010
|
+
},
|
|
1011
|
+
{
|
|
1012
|
+
"name": "developerFeeRate";
|
|
1013
|
+
"type": {
|
|
1014
|
+
"option": "u16";
|
|
1015
|
+
};
|
|
987
1016
|
}
|
|
988
1017
|
];
|
|
989
1018
|
},
|
|
@@ -1029,12 +1058,12 @@ export type AgentShield = {
|
|
|
1029
1058
|
{
|
|
1030
1059
|
"kind": "account";
|
|
1031
1060
|
"path": "vault.owner";
|
|
1032
|
-
"account": "
|
|
1061
|
+
"account": "AgentVault";
|
|
1033
1062
|
},
|
|
1034
1063
|
{
|
|
1035
1064
|
"kind": "account";
|
|
1036
|
-
"path": "vault.
|
|
1037
|
-
"account": "
|
|
1065
|
+
"path": "vault.vaultId";
|
|
1066
|
+
"account": "AgentVault";
|
|
1038
1067
|
}
|
|
1039
1068
|
];
|
|
1040
1069
|
};
|
|
@@ -1092,7 +1121,7 @@ export type AgentShield = {
|
|
|
1092
1121
|
{
|
|
1093
1122
|
"name": "session";
|
|
1094
1123
|
"docs": [
|
|
1095
|
-
"Ephemeral session PDA
|
|
1124
|
+
"Ephemeral session PDA \u2014 `init` ensures no double-authorization"
|
|
1096
1125
|
];
|
|
1097
1126
|
"writable": true;
|
|
1098
1127
|
"pda": {
|
|
@@ -1130,7 +1159,7 @@ export type AgentShield = {
|
|
|
1130
1159
|
"name": "actionType";
|
|
1131
1160
|
"type": {
|
|
1132
1161
|
"defined": {
|
|
1133
|
-
"name": "
|
|
1162
|
+
"name": "ActionType";
|
|
1134
1163
|
};
|
|
1135
1164
|
};
|
|
1136
1165
|
},
|
|
@@ -1199,8 +1228,8 @@ export type AgentShield = {
|
|
|
1199
1228
|
},
|
|
1200
1229
|
{
|
|
1201
1230
|
"kind": "account";
|
|
1202
|
-
"path": "vault.
|
|
1203
|
-
"account": "
|
|
1231
|
+
"path": "vault.vaultId";
|
|
1232
|
+
"account": "AgentVault";
|
|
1204
1233
|
}
|
|
1205
1234
|
];
|
|
1206
1235
|
};
|
|
@@ -1409,7 +1438,7 @@ export type AgentShield = {
|
|
|
1409
1438
|
];
|
|
1410
1439
|
"accounts": [
|
|
1411
1440
|
{
|
|
1412
|
-
"name": "
|
|
1441
|
+
"name": "AgentVault";
|
|
1413
1442
|
"discriminator": [
|
|
1414
1443
|
232,
|
|
1415
1444
|
220,
|
|
@@ -1422,7 +1451,7 @@ export type AgentShield = {
|
|
|
1422
1451
|
];
|
|
1423
1452
|
},
|
|
1424
1453
|
{
|
|
1425
|
-
"name": "
|
|
1454
|
+
"name": "PolicyConfig";
|
|
1426
1455
|
"discriminator": [
|
|
1427
1456
|
219,
|
|
1428
1457
|
7,
|
|
@@ -1435,7 +1464,7 @@ export type AgentShield = {
|
|
|
1435
1464
|
];
|
|
1436
1465
|
},
|
|
1437
1466
|
{
|
|
1438
|
-
"name": "
|
|
1467
|
+
"name": "SessionAuthority";
|
|
1439
1468
|
"discriminator": [
|
|
1440
1469
|
48,
|
|
1441
1470
|
9,
|
|
@@ -1448,7 +1477,7 @@ export type AgentShield = {
|
|
|
1448
1477
|
];
|
|
1449
1478
|
},
|
|
1450
1479
|
{
|
|
1451
|
-
"name": "
|
|
1480
|
+
"name": "SpendTracker";
|
|
1452
1481
|
"discriminator": [
|
|
1453
1482
|
180,
|
|
1454
1483
|
17,
|
|
@@ -1463,7 +1492,7 @@ export type AgentShield = {
|
|
|
1463
1492
|
];
|
|
1464
1493
|
"events": [
|
|
1465
1494
|
{
|
|
1466
|
-
"name": "
|
|
1495
|
+
"name": "ActionAuthorized";
|
|
1467
1496
|
"discriminator": [
|
|
1468
1497
|
85,
|
|
1469
1498
|
90,
|
|
@@ -1476,7 +1505,7 @@ export type AgentShield = {
|
|
|
1476
1505
|
];
|
|
1477
1506
|
},
|
|
1478
1507
|
{
|
|
1479
|
-
"name": "
|
|
1508
|
+
"name": "ActionDenied";
|
|
1480
1509
|
"discriminator": [
|
|
1481
1510
|
243,
|
|
1482
1511
|
239,
|
|
@@ -1489,7 +1518,7 @@ export type AgentShield = {
|
|
|
1489
1518
|
];
|
|
1490
1519
|
},
|
|
1491
1520
|
{
|
|
1492
|
-
"name": "
|
|
1521
|
+
"name": "AgentRegistered";
|
|
1493
1522
|
"discriminator": [
|
|
1494
1523
|
191,
|
|
1495
1524
|
78,
|
|
@@ -1502,7 +1531,7 @@ export type AgentShield = {
|
|
|
1502
1531
|
];
|
|
1503
1532
|
},
|
|
1504
1533
|
{
|
|
1505
|
-
"name": "
|
|
1534
|
+
"name": "AgentRevoked";
|
|
1506
1535
|
"discriminator": [
|
|
1507
1536
|
12,
|
|
1508
1537
|
251,
|
|
@@ -1515,7 +1544,7 @@ export type AgentShield = {
|
|
|
1515
1544
|
];
|
|
1516
1545
|
},
|
|
1517
1546
|
{
|
|
1518
|
-
"name": "
|
|
1547
|
+
"name": "FeesCollected";
|
|
1519
1548
|
"discriminator": [
|
|
1520
1549
|
233,
|
|
1521
1550
|
23,
|
|
@@ -1528,7 +1557,7 @@ export type AgentShield = {
|
|
|
1528
1557
|
];
|
|
1529
1558
|
},
|
|
1530
1559
|
{
|
|
1531
|
-
"name": "
|
|
1560
|
+
"name": "FundsDeposited";
|
|
1532
1561
|
"discriminator": [
|
|
1533
1562
|
157,
|
|
1534
1563
|
209,
|
|
@@ -1541,7 +1570,7 @@ export type AgentShield = {
|
|
|
1541
1570
|
];
|
|
1542
1571
|
},
|
|
1543
1572
|
{
|
|
1544
|
-
"name": "
|
|
1573
|
+
"name": "FundsWithdrawn";
|
|
1545
1574
|
"discriminator": [
|
|
1546
1575
|
56,
|
|
1547
1576
|
130,
|
|
@@ -1554,7 +1583,7 @@ export type AgentShield = {
|
|
|
1554
1583
|
];
|
|
1555
1584
|
},
|
|
1556
1585
|
{
|
|
1557
|
-
"name": "
|
|
1586
|
+
"name": "PolicyUpdated";
|
|
1558
1587
|
"discriminator": [
|
|
1559
1588
|
225,
|
|
1560
1589
|
112,
|
|
@@ -1567,7 +1596,7 @@ export type AgentShield = {
|
|
|
1567
1596
|
];
|
|
1568
1597
|
},
|
|
1569
1598
|
{
|
|
1570
|
-
"name": "
|
|
1599
|
+
"name": "SessionFinalized";
|
|
1571
1600
|
"discriminator": [
|
|
1572
1601
|
33,
|
|
1573
1602
|
12,
|
|
@@ -1580,7 +1609,7 @@ export type AgentShield = {
|
|
|
1580
1609
|
];
|
|
1581
1610
|
},
|
|
1582
1611
|
{
|
|
1583
|
-
"name": "
|
|
1612
|
+
"name": "VaultClosed";
|
|
1584
1613
|
"discriminator": [
|
|
1585
1614
|
238,
|
|
1586
1615
|
129,
|
|
@@ -1593,7 +1622,7 @@ export type AgentShield = {
|
|
|
1593
1622
|
];
|
|
1594
1623
|
},
|
|
1595
1624
|
{
|
|
1596
|
-
"name": "
|
|
1625
|
+
"name": "VaultCreated";
|
|
1597
1626
|
"discriminator": [
|
|
1598
1627
|
117,
|
|
1599
1628
|
25,
|
|
@@ -1606,7 +1635,7 @@ export type AgentShield = {
|
|
|
1606
1635
|
];
|
|
1607
1636
|
},
|
|
1608
1637
|
{
|
|
1609
|
-
"name": "
|
|
1638
|
+
"name": "VaultReactivated";
|
|
1610
1639
|
"discriminator": [
|
|
1611
1640
|
197,
|
|
1612
1641
|
52,
|
|
@@ -1622,128 +1651,148 @@ export type AgentShield = {
|
|
|
1622
1651
|
"errors": [
|
|
1623
1652
|
{
|
|
1624
1653
|
"code": 6000;
|
|
1625
|
-
"name": "
|
|
1654
|
+
"name": "VaultNotActive";
|
|
1626
1655
|
"msg": "Vault is not active";
|
|
1627
1656
|
},
|
|
1628
1657
|
{
|
|
1629
1658
|
"code": 6001;
|
|
1630
|
-
"name": "
|
|
1659
|
+
"name": "UnauthorizedAgent";
|
|
1631
1660
|
"msg": "Unauthorized: signer is not the registered agent";
|
|
1632
1661
|
},
|
|
1633
1662
|
{
|
|
1634
1663
|
"code": 6002;
|
|
1635
|
-
"name": "
|
|
1664
|
+
"name": "UnauthorizedOwner";
|
|
1636
1665
|
"msg": "Unauthorized: signer is not the vault owner";
|
|
1637
1666
|
},
|
|
1638
1667
|
{
|
|
1639
1668
|
"code": 6003;
|
|
1640
|
-
"name": "
|
|
1669
|
+
"name": "TokenNotAllowed";
|
|
1641
1670
|
"msg": "Token not in allowed list";
|
|
1642
1671
|
},
|
|
1643
1672
|
{
|
|
1644
1673
|
"code": 6004;
|
|
1645
|
-
"name": "
|
|
1674
|
+
"name": "ProtocolNotAllowed";
|
|
1646
1675
|
"msg": "Protocol not in allowed list";
|
|
1647
1676
|
},
|
|
1648
1677
|
{
|
|
1649
1678
|
"code": 6005;
|
|
1650
|
-
"name": "
|
|
1679
|
+
"name": "TransactionTooLarge";
|
|
1651
1680
|
"msg": "Transaction exceeds maximum single transaction size";
|
|
1652
1681
|
},
|
|
1653
1682
|
{
|
|
1654
1683
|
"code": 6006;
|
|
1655
|
-
"name": "
|
|
1684
|
+
"name": "DailyCapExceeded";
|
|
1656
1685
|
"msg": "Daily spending cap would be exceeded";
|
|
1657
1686
|
},
|
|
1658
1687
|
{
|
|
1659
1688
|
"code": 6007;
|
|
1660
|
-
"name": "
|
|
1689
|
+
"name": "LeverageTooHigh";
|
|
1661
1690
|
"msg": "Leverage exceeds maximum allowed";
|
|
1662
1691
|
},
|
|
1663
1692
|
{
|
|
1664
1693
|
"code": 6008;
|
|
1665
|
-
"name": "
|
|
1694
|
+
"name": "TooManyPositions";
|
|
1666
1695
|
"msg": "Maximum concurrent open positions reached";
|
|
1667
1696
|
},
|
|
1668
1697
|
{
|
|
1669
1698
|
"code": 6009;
|
|
1670
|
-
"name": "
|
|
1699
|
+
"name": "PositionOpeningDisallowed";
|
|
1671
1700
|
"msg": "Cannot open new positions (policy disallows)";
|
|
1672
1701
|
},
|
|
1673
1702
|
{
|
|
1674
1703
|
"code": 6010;
|
|
1675
|
-
"name": "
|
|
1704
|
+
"name": "SessionExpired";
|
|
1676
1705
|
"msg": "Session has expired";
|
|
1677
1706
|
},
|
|
1678
1707
|
{
|
|
1679
1708
|
"code": 6011;
|
|
1680
|
-
"name": "
|
|
1709
|
+
"name": "SessionNotAuthorized";
|
|
1681
1710
|
"msg": "Session not authorized";
|
|
1682
1711
|
},
|
|
1683
1712
|
{
|
|
1684
1713
|
"code": 6012;
|
|
1685
|
-
"name": "
|
|
1714
|
+
"name": "InvalidSession";
|
|
1686
1715
|
"msg": "Invalid session: does not belong to this vault";
|
|
1687
1716
|
},
|
|
1688
1717
|
{
|
|
1689
1718
|
"code": 6013;
|
|
1690
|
-
"name": "
|
|
1719
|
+
"name": "OpenPositionsExist";
|
|
1691
1720
|
"msg": "Vault has open positions, cannot close";
|
|
1692
1721
|
},
|
|
1693
1722
|
{
|
|
1694
1723
|
"code": 6014;
|
|
1695
|
-
"name": "
|
|
1724
|
+
"name": "TooManyAllowedTokens";
|
|
1696
1725
|
"msg": "Policy configuration invalid: too many allowed tokens";
|
|
1697
1726
|
},
|
|
1698
1727
|
{
|
|
1699
1728
|
"code": 6015;
|
|
1700
|
-
"name": "
|
|
1729
|
+
"name": "TooManyAllowedProtocols";
|
|
1701
1730
|
"msg": "Policy configuration invalid: too many allowed protocols";
|
|
1702
1731
|
},
|
|
1703
1732
|
{
|
|
1704
1733
|
"code": 6016;
|
|
1705
|
-
"name": "
|
|
1734
|
+
"name": "AgentAlreadyRegistered";
|
|
1706
1735
|
"msg": "Agent already registered for this vault";
|
|
1707
1736
|
},
|
|
1708
1737
|
{
|
|
1709
1738
|
"code": 6017;
|
|
1710
|
-
"name": "
|
|
1739
|
+
"name": "NoAgentRegistered";
|
|
1711
1740
|
"msg": "No agent registered for this vault";
|
|
1712
1741
|
},
|
|
1713
1742
|
{
|
|
1714
1743
|
"code": 6018;
|
|
1715
|
-
"name": "
|
|
1744
|
+
"name": "VaultNotFrozen";
|
|
1716
1745
|
"msg": "Vault is not frozen (expected frozen for reactivation)";
|
|
1717
1746
|
},
|
|
1718
1747
|
{
|
|
1719
1748
|
"code": 6019;
|
|
1720
|
-
"name": "
|
|
1749
|
+
"name": "VaultAlreadyClosed";
|
|
1721
1750
|
"msg": "Vault is already closed";
|
|
1722
1751
|
},
|
|
1723
1752
|
{
|
|
1724
1753
|
"code": 6020;
|
|
1725
|
-
"name": "
|
|
1754
|
+
"name": "InsufficientBalance";
|
|
1726
1755
|
"msg": "Insufficient vault balance for withdrawal";
|
|
1727
1756
|
},
|
|
1728
1757
|
{
|
|
1729
1758
|
"code": 6021;
|
|
1730
|
-
"name": "
|
|
1731
|
-
"msg": "
|
|
1759
|
+
"name": "DeveloperFeeTooHigh";
|
|
1760
|
+
"msg": "Developer fee rate exceeds maximum (50 / 1,000,000 = 0.5 BPS)";
|
|
1732
1761
|
},
|
|
1733
1762
|
{
|
|
1734
1763
|
"code": 6022;
|
|
1735
|
-
"name": "
|
|
1764
|
+
"name": "InvalidFeeDestination";
|
|
1736
1765
|
"msg": "Fee destination account invalid";
|
|
1737
1766
|
},
|
|
1738
1767
|
{
|
|
1739
1768
|
"code": 6023;
|
|
1740
|
-
"name": "
|
|
1769
|
+
"name": "InvalidProtocolTreasury";
|
|
1770
|
+
"msg": "Protocol treasury account does not match expected address";
|
|
1771
|
+
},
|
|
1772
|
+
{
|
|
1773
|
+
"code": 6024;
|
|
1774
|
+
"name": "TooManySpendEntries";
|
|
1775
|
+
"msg": "Spend entry limit reached (too many active entries in rolling window)";
|
|
1776
|
+
},
|
|
1777
|
+
{
|
|
1778
|
+
"code": 6025;
|
|
1779
|
+
"name": "InvalidAgentKey";
|
|
1780
|
+
"msg": "Invalid agent: cannot be the zero address";
|
|
1781
|
+
},
|
|
1782
|
+
{
|
|
1783
|
+
"code": 6026;
|
|
1784
|
+
"name": "AgentIsOwner";
|
|
1785
|
+
"msg": "Invalid agent: agent cannot be the vault owner";
|
|
1786
|
+
},
|
|
1787
|
+
{
|
|
1788
|
+
"code": 6027;
|
|
1789
|
+
"name": "Overflow";
|
|
1741
1790
|
"msg": "Arithmetic overflow";
|
|
1742
1791
|
}
|
|
1743
1792
|
];
|
|
1744
1793
|
"types": [
|
|
1745
1794
|
{
|
|
1746
|
-
"name": "
|
|
1795
|
+
"name": "ActionAuthorized";
|
|
1747
1796
|
"type": {
|
|
1748
1797
|
"kind": "struct";
|
|
1749
1798
|
"fields": [
|
|
@@ -1759,7 +1808,7 @@ export type AgentShield = {
|
|
|
1759
1808
|
"name": "actionType";
|
|
1760
1809
|
"type": {
|
|
1761
1810
|
"defined": {
|
|
1762
|
-
"name": "
|
|
1811
|
+
"name": "ActionType";
|
|
1763
1812
|
};
|
|
1764
1813
|
};
|
|
1765
1814
|
},
|
|
@@ -1791,7 +1840,7 @@ export type AgentShield = {
|
|
|
1791
1840
|
};
|
|
1792
1841
|
},
|
|
1793
1842
|
{
|
|
1794
|
-
"name": "
|
|
1843
|
+
"name": "ActionDenied";
|
|
1795
1844
|
"type": {
|
|
1796
1845
|
"kind": "struct";
|
|
1797
1846
|
"fields": [
|
|
@@ -1815,7 +1864,7 @@ export type AgentShield = {
|
|
|
1815
1864
|
};
|
|
1816
1865
|
},
|
|
1817
1866
|
{
|
|
1818
|
-
"name": "
|
|
1867
|
+
"name": "ActionType";
|
|
1819
1868
|
"docs": [
|
|
1820
1869
|
"Action types that agents can request"
|
|
1821
1870
|
];
|
|
@@ -1823,31 +1872,31 @@ export type AgentShield = {
|
|
|
1823
1872
|
"kind": "enum";
|
|
1824
1873
|
"variants": [
|
|
1825
1874
|
{
|
|
1826
|
-
"name": "
|
|
1875
|
+
"name": "Swap";
|
|
1827
1876
|
},
|
|
1828
1877
|
{
|
|
1829
|
-
"name": "
|
|
1878
|
+
"name": "OpenPosition";
|
|
1830
1879
|
},
|
|
1831
1880
|
{
|
|
1832
|
-
"name": "
|
|
1881
|
+
"name": "ClosePosition";
|
|
1833
1882
|
},
|
|
1834
1883
|
{
|
|
1835
|
-
"name": "
|
|
1884
|
+
"name": "IncreasePosition";
|
|
1836
1885
|
},
|
|
1837
1886
|
{
|
|
1838
|
-
"name": "
|
|
1887
|
+
"name": "DecreasePosition";
|
|
1839
1888
|
},
|
|
1840
1889
|
{
|
|
1841
|
-
"name": "
|
|
1890
|
+
"name": "Deposit";
|
|
1842
1891
|
},
|
|
1843
1892
|
{
|
|
1844
|
-
"name": "
|
|
1893
|
+
"name": "Withdraw";
|
|
1845
1894
|
}
|
|
1846
1895
|
];
|
|
1847
1896
|
};
|
|
1848
1897
|
},
|
|
1849
1898
|
{
|
|
1850
|
-
"name": "
|
|
1899
|
+
"name": "AgentRegistered";
|
|
1851
1900
|
"type": {
|
|
1852
1901
|
"kind": "struct";
|
|
1853
1902
|
"fields": [
|
|
@@ -1867,7 +1916,7 @@ export type AgentShield = {
|
|
|
1867
1916
|
};
|
|
1868
1917
|
},
|
|
1869
1918
|
{
|
|
1870
|
-
"name": "
|
|
1919
|
+
"name": "AgentRevoked";
|
|
1871
1920
|
"type": {
|
|
1872
1921
|
"kind": "struct";
|
|
1873
1922
|
"fields": [
|
|
@@ -1887,7 +1936,7 @@ export type AgentShield = {
|
|
|
1887
1936
|
};
|
|
1888
1937
|
},
|
|
1889
1938
|
{
|
|
1890
|
-
"name": "
|
|
1939
|
+
"name": "AgentVault";
|
|
1891
1940
|
"type": {
|
|
1892
1941
|
"kind": "struct";
|
|
1893
1942
|
"fields": [
|
|
@@ -1908,9 +1957,9 @@ export type AgentShield = {
|
|
|
1908
1957
|
{
|
|
1909
1958
|
"name": "feeDestination";
|
|
1910
1959
|
"docs": [
|
|
1911
|
-
"
|
|
1912
|
-
"
|
|
1913
|
-
"
|
|
1960
|
+
"Developer fee destination \u2014 the wallet that receives developer fees",
|
|
1961
|
+
"on every finalized transaction. Set at vault creation, immutable after",
|
|
1962
|
+
"initialization. Protocol fees go to PROTOCOL_TREASURY separately."
|
|
1914
1963
|
];
|
|
1915
1964
|
"type": "pubkey";
|
|
1916
1965
|
},
|
|
@@ -1928,7 +1977,7 @@ export type AgentShield = {
|
|
|
1928
1977
|
];
|
|
1929
1978
|
"type": {
|
|
1930
1979
|
"defined": {
|
|
1931
|
-
"name": "
|
|
1980
|
+
"name": "VaultStatus";
|
|
1932
1981
|
};
|
|
1933
1982
|
};
|
|
1934
1983
|
},
|
|
@@ -1970,7 +2019,8 @@ export type AgentShield = {
|
|
|
1970
2019
|
{
|
|
1971
2020
|
"name": "totalFeesCollected";
|
|
1972
2021
|
"docs": [
|
|
1973
|
-
"Cumulative
|
|
2022
|
+
"Cumulative developer fees collected from this vault (token base units).",
|
|
2023
|
+
"Protocol fees are tracked separately via events."
|
|
1974
2024
|
];
|
|
1975
2025
|
"type": "u64";
|
|
1976
2026
|
}
|
|
@@ -1978,7 +2028,7 @@ export type AgentShield = {
|
|
|
1978
2028
|
};
|
|
1979
2029
|
},
|
|
1980
2030
|
{
|
|
1981
|
-
"name": "
|
|
2031
|
+
"name": "FeesCollected";
|
|
1982
2032
|
"type": {
|
|
1983
2033
|
"kind": "struct";
|
|
1984
2034
|
"fields": [
|
|
@@ -1991,11 +2041,19 @@ export type AgentShield = {
|
|
|
1991
2041
|
"type": "pubkey";
|
|
1992
2042
|
},
|
|
1993
2043
|
{
|
|
1994
|
-
"name": "
|
|
2044
|
+
"name": "protocolFeeAmount";
|
|
1995
2045
|
"type": "u64";
|
|
1996
2046
|
},
|
|
1997
2047
|
{
|
|
1998
|
-
"name": "
|
|
2048
|
+
"name": "developerFeeAmount";
|
|
2049
|
+
"type": "u64";
|
|
2050
|
+
},
|
|
2051
|
+
{
|
|
2052
|
+
"name": "protocolFeeRate";
|
|
2053
|
+
"type": "u16";
|
|
2054
|
+
},
|
|
2055
|
+
{
|
|
2056
|
+
"name": "developerFeeRate";
|
|
1999
2057
|
"type": "u16";
|
|
2000
2058
|
},
|
|
2001
2059
|
{
|
|
@@ -2003,11 +2061,15 @@ export type AgentShield = {
|
|
|
2003
2061
|
"type": "u64";
|
|
2004
2062
|
},
|
|
2005
2063
|
{
|
|
2006
|
-
"name": "
|
|
2064
|
+
"name": "protocolTreasury";
|
|
2065
|
+
"type": "pubkey";
|
|
2066
|
+
},
|
|
2067
|
+
{
|
|
2068
|
+
"name": "developerFeeDestination";
|
|
2007
2069
|
"type": "pubkey";
|
|
2008
2070
|
},
|
|
2009
2071
|
{
|
|
2010
|
-
"name": "
|
|
2072
|
+
"name": "cumulativeDeveloperFees";
|
|
2011
2073
|
"type": "u64";
|
|
2012
2074
|
},
|
|
2013
2075
|
{
|
|
@@ -2018,7 +2080,7 @@ export type AgentShield = {
|
|
|
2018
2080
|
};
|
|
2019
2081
|
},
|
|
2020
2082
|
{
|
|
2021
|
-
"name": "
|
|
2083
|
+
"name": "FundsDeposited";
|
|
2022
2084
|
"type": {
|
|
2023
2085
|
"kind": "struct";
|
|
2024
2086
|
"fields": [
|
|
@@ -2042,7 +2104,7 @@ export type AgentShield = {
|
|
|
2042
2104
|
};
|
|
2043
2105
|
},
|
|
2044
2106
|
{
|
|
2045
|
-
"name": "
|
|
2107
|
+
"name": "FundsWithdrawn";
|
|
2046
2108
|
"type": {
|
|
2047
2109
|
"kind": "struct";
|
|
2048
2110
|
"fields": [
|
|
@@ -2070,7 +2132,7 @@ export type AgentShield = {
|
|
|
2070
2132
|
};
|
|
2071
2133
|
},
|
|
2072
2134
|
{
|
|
2073
|
-
"name": "
|
|
2135
|
+
"name": "PolicyConfig";
|
|
2074
2136
|
"type": {
|
|
2075
2137
|
"kind": "struct";
|
|
2076
2138
|
"fields": [
|
|
@@ -2138,11 +2200,13 @@ export type AgentShield = {
|
|
|
2138
2200
|
"type": "u8";
|
|
2139
2201
|
},
|
|
2140
2202
|
{
|
|
2141
|
-
"name": "
|
|
2203
|
+
"name": "developerFeeRate";
|
|
2142
2204
|
"docs": [
|
|
2143
|
-
"
|
|
2144
|
-
"transaction. Fee deducted from vault, transferred to
|
|
2145
|
-
"Max
|
|
2205
|
+
"Developer fee rate (rate / 1,000,000). Applied to every finalized",
|
|
2206
|
+
"transaction. Fee deducted from vault, transferred to vault's",
|
|
2207
|
+
"fee_destination. Max MAX_DEVELOPER_FEE_RATE (50 = 0.5 BPS).",
|
|
2208
|
+
"Set to 0 for no developer fee. Protocol fee is always applied",
|
|
2209
|
+
"separately at PROTOCOL_FEE_RATE."
|
|
2146
2210
|
];
|
|
2147
2211
|
"type": "u16";
|
|
2148
2212
|
},
|
|
@@ -2157,7 +2221,7 @@ export type AgentShield = {
|
|
|
2157
2221
|
};
|
|
2158
2222
|
},
|
|
2159
2223
|
{
|
|
2160
|
-
"name": "
|
|
2224
|
+
"name": "PolicyUpdated";
|
|
2161
2225
|
"type": {
|
|
2162
2226
|
"kind": "struct";
|
|
2163
2227
|
"fields": [
|
|
@@ -2185,6 +2249,10 @@ export type AgentShield = {
|
|
|
2185
2249
|
"name": "maxLeverageBps";
|
|
2186
2250
|
"type": "u16";
|
|
2187
2251
|
},
|
|
2252
|
+
{
|
|
2253
|
+
"name": "developerFeeRate";
|
|
2254
|
+
"type": "u16";
|
|
2255
|
+
},
|
|
2188
2256
|
{
|
|
2189
2257
|
"name": "timestamp";
|
|
2190
2258
|
"type": "i64";
|
|
@@ -2193,7 +2261,7 @@ export type AgentShield = {
|
|
|
2193
2261
|
};
|
|
2194
2262
|
},
|
|
2195
2263
|
{
|
|
2196
|
-
"name": "
|
|
2264
|
+
"name": "SessionAuthority";
|
|
2197
2265
|
"type": {
|
|
2198
2266
|
"kind": "struct";
|
|
2199
2267
|
"fields": [
|
|
@@ -2233,6 +2301,17 @@ export type AgentShield = {
|
|
|
2233
2301
|
"name": "authorizedProtocol";
|
|
2234
2302
|
"type": "pubkey";
|
|
2235
2303
|
},
|
|
2304
|
+
{
|
|
2305
|
+
"name": "actionType";
|
|
2306
|
+
"docs": [
|
|
2307
|
+
"The action type that was authorized (stored so finalize can record it)"
|
|
2308
|
+
];
|
|
2309
|
+
"type": {
|
|
2310
|
+
"defined": {
|
|
2311
|
+
"name": "ActionType";
|
|
2312
|
+
};
|
|
2313
|
+
};
|
|
2314
|
+
},
|
|
2236
2315
|
{
|
|
2237
2316
|
"name": "expiresAtSlot";
|
|
2238
2317
|
"docs": [
|
|
@@ -2251,7 +2330,7 @@ export type AgentShield = {
|
|
|
2251
2330
|
};
|
|
2252
2331
|
},
|
|
2253
2332
|
{
|
|
2254
|
-
"name": "
|
|
2333
|
+
"name": "SessionFinalized";
|
|
2255
2334
|
"type": {
|
|
2256
2335
|
"kind": "struct";
|
|
2257
2336
|
"fields": [
|
|
@@ -2275,7 +2354,7 @@ export type AgentShield = {
|
|
|
2275
2354
|
};
|
|
2276
2355
|
},
|
|
2277
2356
|
{
|
|
2278
|
-
"name": "
|
|
2357
|
+
"name": "SpendEntry";
|
|
2279
2358
|
"type": {
|
|
2280
2359
|
"kind": "struct";
|
|
2281
2360
|
"fields": [
|
|
@@ -2295,7 +2374,7 @@ export type AgentShield = {
|
|
|
2295
2374
|
};
|
|
2296
2375
|
},
|
|
2297
2376
|
{
|
|
2298
|
-
"name": "
|
|
2377
|
+
"name": "SpendTracker";
|
|
2299
2378
|
"type": {
|
|
2300
2379
|
"kind": "struct";
|
|
2301
2380
|
"fields": [
|
|
@@ -2315,7 +2394,7 @@ export type AgentShield = {
|
|
|
2315
2394
|
"type": {
|
|
2316
2395
|
"vec": {
|
|
2317
2396
|
"defined": {
|
|
2318
|
-
"name": "
|
|
2397
|
+
"name": "SpendEntry";
|
|
2319
2398
|
};
|
|
2320
2399
|
};
|
|
2321
2400
|
};
|
|
@@ -2329,7 +2408,7 @@ export type AgentShield = {
|
|
|
2329
2408
|
"type": {
|
|
2330
2409
|
"vec": {
|
|
2331
2410
|
"defined": {
|
|
2332
|
-
"name": "
|
|
2411
|
+
"name": "TransactionRecord";
|
|
2333
2412
|
};
|
|
2334
2413
|
};
|
|
2335
2414
|
};
|
|
@@ -2345,7 +2424,7 @@ export type AgentShield = {
|
|
|
2345
2424
|
};
|
|
2346
2425
|
},
|
|
2347
2426
|
{
|
|
2348
|
-
"name": "
|
|
2427
|
+
"name": "TransactionRecord";
|
|
2349
2428
|
"type": {
|
|
2350
2429
|
"kind": "struct";
|
|
2351
2430
|
"fields": [
|
|
@@ -2357,7 +2436,7 @@ export type AgentShield = {
|
|
|
2357
2436
|
"name": "actionType";
|
|
2358
2437
|
"type": {
|
|
2359
2438
|
"defined": {
|
|
2360
|
-
"name": "
|
|
2439
|
+
"name": "ActionType";
|
|
2361
2440
|
};
|
|
2362
2441
|
};
|
|
2363
2442
|
},
|
|
@@ -2385,7 +2464,7 @@ export type AgentShield = {
|
|
|
2385
2464
|
};
|
|
2386
2465
|
},
|
|
2387
2466
|
{
|
|
2388
|
-
"name": "
|
|
2467
|
+
"name": "VaultClosed";
|
|
2389
2468
|
"type": {
|
|
2390
2469
|
"kind": "struct";
|
|
2391
2470
|
"fields": [
|
|
@@ -2405,7 +2484,7 @@ export type AgentShield = {
|
|
|
2405
2484
|
};
|
|
2406
2485
|
},
|
|
2407
2486
|
{
|
|
2408
|
-
"name": "
|
|
2487
|
+
"name": "VaultCreated";
|
|
2409
2488
|
"type": {
|
|
2410
2489
|
"kind": "struct";
|
|
2411
2490
|
"fields": [
|
|
@@ -2429,7 +2508,7 @@ export type AgentShield = {
|
|
|
2429
2508
|
};
|
|
2430
2509
|
},
|
|
2431
2510
|
{
|
|
2432
|
-
"name": "
|
|
2511
|
+
"name": "VaultReactivated";
|
|
2433
2512
|
"type": {
|
|
2434
2513
|
"kind": "struct";
|
|
2435
2514
|
"fields": [
|
|
@@ -2451,7 +2530,7 @@ export type AgentShield = {
|
|
|
2451
2530
|
};
|
|
2452
2531
|
},
|
|
2453
2532
|
{
|
|
2454
|
-
"name": "
|
|
2533
|
+
"name": "VaultStatus";
|
|
2455
2534
|
"docs": [
|
|
2456
2535
|
"Vault status enum"
|
|
2457
2536
|
];
|
|
@@ -2459,13 +2538,13 @@ export type AgentShield = {
|
|
|
2459
2538
|
"kind": "enum";
|
|
2460
2539
|
"variants": [
|
|
2461
2540
|
{
|
|
2462
|
-
"name": "
|
|
2541
|
+
"name": "Active";
|
|
2463
2542
|
},
|
|
2464
2543
|
{
|
|
2465
|
-
"name": "
|
|
2544
|
+
"name": "Frozen";
|
|
2466
2545
|
},
|
|
2467
2546
|
{
|
|
2468
|
-
"name": "
|
|
2547
|
+
"name": "Closed";
|
|
2469
2548
|
}
|
|
2470
2549
|
];
|
|
2471
2550
|
};
|