@agirails/sdk 4.0.0-beta.9 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -516,6 +516,30 @@ This TypeScript SDK maintains **full parity** with the Python SDK:
516
516
  - **EAS Integration**: Ethereum Attestation Service for delivery proofs
517
517
  - **ERC-8004 Reputation**: On-chain settlement/dispute feedback after ACTP transactions
518
518
  - **Input Validation**: All user inputs validated before processing
519
+ - **SSRF Guard on Negotiation Channels**: Both `QuoteChannel` and `RelayChannel` route consumer-supplied base URLs through `assertSafePeerUrl`, rejecting loopback, RFC1918, link-local (incl. cloud metadata `169.254.169.254`), and IPv4-mapped IPv6 bypass shapes by default. Opt-in dev escape: `allowInsecureTargets: true`.
520
+
521
+ ### Runtime secret handling
522
+
523
+ How the SDK treats wallet keys and other sensitive material:
524
+
525
+ **What the SDK reads:**
526
+ - `ACTP_KEYSTORE_BASE64` + `ACTP_KEY_PASSWORD` — encrypted keystore (preferred for CI / deploy targets). The base64 blob and the password should live in **separate secret scopes** (different vaults, env groups, or teams) so neither alone is sufficient.
527
+ - `ACTP_PRIVATE_KEY` — raw hex private key. **Testnet only**; the SDK refuses this path on `mainnet` mode and routes you to the keystore pattern instead.
528
+ - `.actp/keystore.json` + `ACTP_KEY_PASSWORD` — the on-disk file the keystore env vars are derived from.
529
+ - `AGIRAILS_PUBLISH_KEY` — *public* client identifier for the publish proxy (same threat model as a Firebase / Stripe publishable key; safe to embed, no privileged scope).
530
+
531
+ **What the SDK never reads:**
532
+ - CLI inline flags for keys, mnemonics, signed payloads, or tokens. No `--key`, `--mnemonic`, `--secret`, or `--token` flag exists on any `actp` subcommand. This avoids the `ps` / shell history / CI-log leakage class (CWE-532, CWE-312).
533
+
534
+ **What the SDK logs:**
535
+ - The cached *address* derived from the resolved key (for diagnostic confirmation). Never the key, mnemonic, or password.
536
+ - Bundler / paymaster RPC errors verbatim, which can include the smart-wallet address but not the signer key.
537
+
538
+ **What `actp init` does for downstream consumers:**
539
+ - Adds `.actp/`, `.env`, and `.env.*` to `.gitignore` so a forgetful operator can't accidentally commit a populated `.env`.
540
+ - Writes a starter `.env.example` documenting the keystore + RPC schema with **placeholder values only**.
541
+
542
+ If a CI / deployment context needs sensitive material, prefer file-based delivery (mounted secrets, encrypted-at-rest stores) over env vars where the platform supports it, and never echo command lines through `set -x` while ACTP env vars are populated.
519
543
 
520
544
  ### Transaction Confirmations
521
545
 
@@ -16,10 +16,33 @@
16
16
  "name": "_feeRecipient",
17
17
  "type": "address",
18
18
  "internalType": "address"
19
+ },
20
+ {
21
+ "name": "_agentRegistry",
22
+ "type": "address",
23
+ "internalType": "address"
24
+ },
25
+ {
26
+ "name": "_usdc",
27
+ "type": "address",
28
+ "internalType": "address"
19
29
  }
20
30
  ],
21
31
  "stateMutability": "nonpayable"
22
32
  },
33
+ {
34
+ "type": "function",
35
+ "name": "ARCHIVE_ALLOCATION_BPS",
36
+ "inputs": [],
37
+ "outputs": [
38
+ {
39
+ "name": "",
40
+ "type": "uint16",
41
+ "internalType": "uint16"
42
+ }
43
+ ],
44
+ "stateMutability": "view"
45
+ },
23
46
  {
24
47
  "type": "function",
25
48
  "name": "DEFAULT_DISPUTE_WINDOW",
@@ -72,6 +95,19 @@
72
95
  ],
73
96
  "stateMutability": "view"
74
97
  },
98
+ {
99
+ "type": "function",
100
+ "name": "MAX_DISPUTE_BOND_BPS",
101
+ "inputs": [],
102
+ "outputs": [
103
+ {
104
+ "name": "",
105
+ "type": "uint16",
106
+ "internalType": "uint16"
107
+ }
108
+ ],
109
+ "stateMutability": "view"
110
+ },
75
111
  {
76
112
  "type": "function",
77
113
  "name": "MAX_DISPUTE_WINDOW",
@@ -150,6 +186,19 @@
150
186
  ],
151
187
  "stateMutability": "view"
152
188
  },
189
+ {
190
+ "type": "function",
191
+ "name": "MIN_DISPUTE_BOND",
192
+ "inputs": [],
193
+ "outputs": [
194
+ {
195
+ "name": "",
196
+ "type": "uint256",
197
+ "internalType": "uint256"
198
+ }
199
+ ],
200
+ "stateMutability": "view"
201
+ },
153
202
  {
154
203
  "type": "function",
155
204
  "name": "MIN_DISPUTE_WINDOW",
@@ -163,6 +212,19 @@
163
212
  ],
164
213
  "stateMutability": "view"
165
214
  },
215
+ {
216
+ "type": "function",
217
+ "name": "MIN_FEE",
218
+ "inputs": [],
219
+ "outputs": [
220
+ {
221
+ "name": "",
222
+ "type": "uint256",
223
+ "internalType": "uint256"
224
+ }
225
+ ],
226
+ "stateMutability": "view"
227
+ },
166
228
  {
167
229
  "type": "function",
168
230
  "name": "MIN_TRANSACTION_AMOUNT",
@@ -176,6 +238,19 @@
176
238
  ],
177
239
  "stateMutability": "view"
178
240
  },
241
+ {
242
+ "type": "function",
243
+ "name": "USDC",
244
+ "inputs": [],
245
+ "outputs": [
246
+ {
247
+ "name": "",
248
+ "type": "address",
249
+ "internalType": "contract IERC20"
250
+ }
251
+ ],
252
+ "stateMutability": "view"
253
+ },
179
254
  {
180
255
  "type": "function",
181
256
  "name": "acceptAdmin",
@@ -183,6 +258,24 @@
183
258
  "outputs": [],
184
259
  "stateMutability": "nonpayable"
185
260
  },
261
+ {
262
+ "type": "function",
263
+ "name": "acceptQuote",
264
+ "inputs": [
265
+ {
266
+ "name": "transactionId",
267
+ "type": "bytes32",
268
+ "internalType": "bytes32"
269
+ },
270
+ {
271
+ "name": "newAmount",
272
+ "type": "uint256",
273
+ "internalType": "uint256"
274
+ }
275
+ ],
276
+ "outputs": [],
277
+ "stateMutability": "nonpayable"
278
+ },
186
279
  {
187
280
  "type": "function",
188
281
  "name": "admin",
@@ -196,6 +289,19 @@
196
289
  ],
197
290
  "stateMutability": "view"
198
291
  },
292
+ {
293
+ "type": "function",
294
+ "name": "agentRegistry",
295
+ "inputs": [],
296
+ "outputs": [
297
+ {
298
+ "name": "",
299
+ "type": "address",
300
+ "internalType": "contract IAgentRegistry"
301
+ }
302
+ ],
303
+ "stateMutability": "view"
304
+ },
199
305
  {
200
306
  "type": "function",
201
307
  "name": "anchorAttestation",
@@ -288,6 +394,26 @@
288
394
  ],
289
395
  "stateMutability": "view"
290
396
  },
397
+ {
398
+ "type": "function",
399
+ "name": "archiveTreasury",
400
+ "inputs": [],
401
+ "outputs": [
402
+ {
403
+ "name": "",
404
+ "type": "address",
405
+ "internalType": "address"
406
+ }
407
+ ],
408
+ "stateMutability": "view"
409
+ },
410
+ {
411
+ "type": "function",
412
+ "name": "cancelAgentRegistryUpdate",
413
+ "inputs": [],
414
+ "outputs": [],
415
+ "stateMutability": "nonpayable"
416
+ },
291
417
  {
292
418
  "type": "function",
293
419
  "name": "cancelEconomicParamsUpdate",
@@ -349,6 +475,44 @@
349
475
  ],
350
476
  "stateMutability": "nonpayable"
351
477
  },
478
+ {
479
+ "type": "function",
480
+ "name": "disputeBondBps",
481
+ "inputs": [],
482
+ "outputs": [
483
+ {
484
+ "name": "",
485
+ "type": "uint16",
486
+ "internalType": "uint16"
487
+ }
488
+ ],
489
+ "stateMutability": "view"
490
+ },
491
+ {
492
+ "type": "function",
493
+ "name": "emergencyRecoverUSDC",
494
+ "inputs": [
495
+ {
496
+ "name": "recipient",
497
+ "type": "address",
498
+ "internalType": "address"
499
+ },
500
+ {
501
+ "name": "amount",
502
+ "type": "uint256",
503
+ "internalType": "uint256"
504
+ }
505
+ ],
506
+ "outputs": [],
507
+ "stateMutability": "nonpayable"
508
+ },
509
+ {
510
+ "type": "function",
511
+ "name": "executeAgentRegistryUpdate",
512
+ "inputs": [],
513
+ "outputs": [],
514
+ "stateMutability": "nonpayable"
515
+ },
352
516
  {
353
517
  "type": "function",
354
518
  "name": "executeEconomicParamsUpdate",
@@ -488,6 +652,16 @@
488
652
  "type": "uint16",
489
653
  "internalType": "uint16"
490
654
  },
655
+ {
656
+ "name": "requesterPenaltyBpsLocked",
657
+ "type": "uint16",
658
+ "internalType": "uint16"
659
+ },
660
+ {
661
+ "name": "disputeBondBpsLocked",
662
+ "type": "uint16",
663
+ "internalType": "uint16"
664
+ },
491
665
  {
492
666
  "name": "agentId",
493
667
  "type": "uint256",
@@ -555,6 +729,25 @@
555
729
  ],
556
730
  "stateMutability": "view"
557
731
  },
732
+ {
733
+ "type": "function",
734
+ "name": "mediatorRevokedAt",
735
+ "inputs": [
736
+ {
737
+ "name": "",
738
+ "type": "address",
739
+ "internalType": "address"
740
+ }
741
+ ],
742
+ "outputs": [
743
+ {
744
+ "name": "",
745
+ "type": "uint256",
746
+ "internalType": "uint256"
747
+ }
748
+ ],
749
+ "stateMutability": "view"
750
+ },
558
751
  {
559
752
  "type": "function",
560
753
  "name": "pause",
@@ -645,6 +838,44 @@
645
838
  "outputs": [],
646
839
  "stateMutability": "nonpayable"
647
840
  },
841
+ {
842
+ "type": "function",
843
+ "name": "reputationProcessedBy",
844
+ "inputs": [
845
+ {
846
+ "name": "",
847
+ "type": "bytes32",
848
+ "internalType": "bytes32"
849
+ }
850
+ ],
851
+ "outputs": [
852
+ {
853
+ "name": "",
854
+ "type": "address",
855
+ "internalType": "address"
856
+ }
857
+ ],
858
+ "stateMutability": "view"
859
+ },
860
+ {
861
+ "type": "function",
862
+ "name": "requesterNonces",
863
+ "inputs": [
864
+ {
865
+ "name": "",
866
+ "type": "address",
867
+ "internalType": "address"
868
+ }
869
+ ],
870
+ "outputs": [
871
+ {
872
+ "name": "",
873
+ "type": "uint256",
874
+ "internalType": "uint256"
875
+ }
876
+ ],
877
+ "stateMutability": "view"
878
+ },
648
879
  {
649
880
  "type": "function",
650
881
  "name": "requesterPenaltyBps",
@@ -658,6 +889,19 @@
658
889
  ],
659
890
  "stateMutability": "view"
660
891
  },
892
+ {
893
+ "type": "function",
894
+ "name": "scheduleAgentRegistryUpdate",
895
+ "inputs": [
896
+ {
897
+ "name": "newRegistry",
898
+ "type": "address",
899
+ "internalType": "address"
900
+ }
901
+ ],
902
+ "outputs": [],
903
+ "stateMutability": "nonpayable"
904
+ },
661
905
  {
662
906
  "type": "function",
663
907
  "name": "scheduleEconomicParams",
@@ -676,6 +920,19 @@
676
920
  "outputs": [],
677
921
  "stateMutability": "nonpayable"
678
922
  },
923
+ {
924
+ "type": "function",
925
+ "name": "setArchiveTreasury",
926
+ "inputs": [
927
+ {
928
+ "name": "_archiveTreasury",
929
+ "type": "address",
930
+ "internalType": "address"
931
+ }
932
+ ],
933
+ "outputs": [],
934
+ "stateMutability": "nonpayable"
935
+ },
679
936
  {
680
937
  "type": "function",
681
938
  "name": "transferAdmin",
@@ -719,6 +976,19 @@
719
976
  "outputs": [],
720
977
  "stateMutability": "nonpayable"
721
978
  },
979
+ {
980
+ "type": "function",
981
+ "name": "updateDisputeBondBps",
982
+ "inputs": [
983
+ {
984
+ "name": "newBps",
985
+ "type": "uint16",
986
+ "internalType": "uint16"
987
+ }
988
+ ],
989
+ "outputs": [],
990
+ "stateMutability": "nonpayable"
991
+ },
722
992
  {
723
993
  "type": "function",
724
994
  "name": "updateFeeRecipient",
@@ -783,6 +1053,132 @@
783
1053
  ],
784
1054
  "anonymous": false
785
1055
  },
1056
+ {
1057
+ "type": "event",
1058
+ "name": "AgentRegistryUpdateCancelled",
1059
+ "inputs": [
1060
+ {
1061
+ "name": "newRegistry",
1062
+ "type": "address",
1063
+ "indexed": true,
1064
+ "internalType": "address"
1065
+ },
1066
+ {
1067
+ "name": "timestamp",
1068
+ "type": "uint256",
1069
+ "indexed": false,
1070
+ "internalType": "uint256"
1071
+ }
1072
+ ],
1073
+ "anonymous": false
1074
+ },
1075
+ {
1076
+ "type": "event",
1077
+ "name": "AgentRegistryUpdateScheduled",
1078
+ "inputs": [
1079
+ {
1080
+ "name": "newRegistry",
1081
+ "type": "address",
1082
+ "indexed": true,
1083
+ "internalType": "address"
1084
+ },
1085
+ {
1086
+ "name": "executeAfter",
1087
+ "type": "uint256",
1088
+ "indexed": false,
1089
+ "internalType": "uint256"
1090
+ }
1091
+ ],
1092
+ "anonymous": false
1093
+ },
1094
+ {
1095
+ "type": "event",
1096
+ "name": "AgentRegistryUpdated",
1097
+ "inputs": [
1098
+ {
1099
+ "name": "oldRegistry",
1100
+ "type": "address",
1101
+ "indexed": true,
1102
+ "internalType": "address"
1103
+ },
1104
+ {
1105
+ "name": "newRegistry",
1106
+ "type": "address",
1107
+ "indexed": true,
1108
+ "internalType": "address"
1109
+ }
1110
+ ],
1111
+ "anonymous": false
1112
+ },
1113
+ {
1114
+ "type": "event",
1115
+ "name": "ArchivePayoutMismatch",
1116
+ "inputs": [
1117
+ {
1118
+ "name": "transactionId",
1119
+ "type": "bytes32",
1120
+ "indexed": true,
1121
+ "internalType": "bytes32"
1122
+ },
1123
+ {
1124
+ "name": "expected",
1125
+ "type": "uint256",
1126
+ "indexed": false,
1127
+ "internalType": "uint256"
1128
+ },
1129
+ {
1130
+ "name": "actual",
1131
+ "type": "uint256",
1132
+ "indexed": false,
1133
+ "internalType": "uint256"
1134
+ }
1135
+ ],
1136
+ "anonymous": false
1137
+ },
1138
+ {
1139
+ "type": "event",
1140
+ "name": "ArchiveTreasuryFailed",
1141
+ "inputs": [
1142
+ {
1143
+ "name": "transactionId",
1144
+ "type": "bytes32",
1145
+ "indexed": true,
1146
+ "internalType": "bytes32"
1147
+ },
1148
+ {
1149
+ "name": "amount",
1150
+ "type": "uint256",
1151
+ "indexed": false,
1152
+ "internalType": "uint256"
1153
+ },
1154
+ {
1155
+ "name": "reason",
1156
+ "type": "bytes",
1157
+ "indexed": false,
1158
+ "internalType": "bytes"
1159
+ }
1160
+ ],
1161
+ "anonymous": false
1162
+ },
1163
+ {
1164
+ "type": "event",
1165
+ "name": "ArchiveTreasuryUpdated",
1166
+ "inputs": [
1167
+ {
1168
+ "name": "oldTreasury",
1169
+ "type": "address",
1170
+ "indexed": true,
1171
+ "internalType": "address"
1172
+ },
1173
+ {
1174
+ "name": "newTreasury",
1175
+ "type": "address",
1176
+ "indexed": true,
1177
+ "internalType": "address"
1178
+ }
1179
+ ],
1180
+ "anonymous": false
1181
+ },
786
1182
  {
787
1183
  "type": "event",
788
1184
  "name": "AttestationAnchored",
@@ -963,6 +1359,31 @@
963
1359
  ],
964
1360
  "anonymous": false
965
1361
  },
1362
+ {
1363
+ "type": "event",
1364
+ "name": "EmergencyUSDCRecovered",
1365
+ "inputs": [
1366
+ {
1367
+ "name": "recipient",
1368
+ "type": "address",
1369
+ "indexed": true,
1370
+ "internalType": "address"
1371
+ },
1372
+ {
1373
+ "name": "amount",
1374
+ "type": "uint256",
1375
+ "indexed": false,
1376
+ "internalType": "uint256"
1377
+ },
1378
+ {
1379
+ "name": "timestamp",
1380
+ "type": "uint256",
1381
+ "indexed": false,
1382
+ "internalType": "uint256"
1383
+ }
1384
+ ],
1385
+ "anonymous": false
1386
+ },
966
1387
  {
967
1388
  "type": "event",
968
1389
  "name": "EscrowLinked",
@@ -1288,6 +1709,37 @@
1288
1709
  ],
1289
1710
  "anonymous": false
1290
1711
  },
1712
+ {
1713
+ "type": "event",
1714
+ "name": "QuoteAccepted",
1715
+ "inputs": [
1716
+ {
1717
+ "name": "transactionId",
1718
+ "type": "bytes32",
1719
+ "indexed": true,
1720
+ "internalType": "bytes32"
1721
+ },
1722
+ {
1723
+ "name": "oldAmount",
1724
+ "type": "uint256",
1725
+ "indexed": false,
1726
+ "internalType": "uint256"
1727
+ },
1728
+ {
1729
+ "name": "newAmount",
1730
+ "type": "uint256",
1731
+ "indexed": false,
1732
+ "internalType": "uint256"
1733
+ },
1734
+ {
1735
+ "name": "timestamp",
1736
+ "type": "uint256",
1737
+ "indexed": false,
1738
+ "internalType": "uint256"
1739
+ }
1740
+ ],
1741
+ "anonymous": false
1742
+ },
1291
1743
  {
1292
1744
  "type": "event",
1293
1745
  "name": "StateTransitioned",
@@ -1381,57 +1833,19 @@
1381
1833
  "anonymous": false
1382
1834
  },
1383
1835
  {
1384
- "type": "function",
1385
- "name": "acceptQuote",
1386
- "inputs": [
1387
- {
1388
- "name": "transactionId",
1389
- "type": "bytes32",
1390
- "internalType": "bytes32"
1391
- },
1392
- {
1393
- "name": "newAmount",
1394
- "type": "uint256",
1395
- "internalType": "uint256"
1396
- }
1397
- ],
1398
- "outputs": [],
1399
- "stateMutability": "nonpayable"
1836
+ "type": "error",
1837
+ "name": "ReentrancyGuardReentrantCall",
1838
+ "inputs": []
1400
1839
  },
1401
1840
  {
1402
- "type": "event",
1403
- "name": "QuoteAccepted",
1841
+ "type": "error",
1842
+ "name": "SafeERC20FailedOperation",
1404
1843
  "inputs": [
1405
1844
  {
1406
- "name": "transactionId",
1407
- "type": "bytes32",
1408
- "indexed": true,
1409
- "internalType": "bytes32"
1410
- },
1411
- {
1412
- "name": "oldAmount",
1413
- "type": "uint256",
1414
- "indexed": false,
1415
- "internalType": "uint256"
1416
- },
1417
- {
1418
- "name": "newAmount",
1419
- "type": "uint256",
1420
- "indexed": false,
1421
- "internalType": "uint256"
1422
- },
1423
- {
1424
- "name": "timestamp",
1425
- "type": "uint256",
1426
- "indexed": false,
1427
- "internalType": "uint256"
1845
+ "name": "token",
1846
+ "type": "address",
1847
+ "internalType": "address"
1428
1848
  }
1429
- ],
1430
- "anonymous": false
1431
- },
1432
- {
1433
- "type": "error",
1434
- "name": "ReentrancyGuardReentrantCall",
1435
- "inputs": []
1849
+ ]
1436
1850
  }
1437
1851
  ]
@@ -1 +1 @@
1
- {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/init.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAKH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAWpC,OAAO,EAAE,MAAM,EAAiB,MAAM,iBAAiB,CAAC;AAQxD,wBAAgB,iBAAiB,IAAI,OAAO,CAgC3C;AAQD,UAAU,WAAW;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,oFAAoF;IACpF,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAED,iBAAe,OAAO,CAAC,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAkSzF;AAoOD,OAAO,EAAE,OAAO,EAAE,CAAC"}
1
+ {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/init.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAKH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAYpC,OAAO,EAAE,MAAM,EAAiB,MAAM,iBAAiB,CAAC;AAQxD,wBAAgB,iBAAiB,IAAI,OAAO,CAgC3C;AAQD,UAAU,WAAW;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,oFAAoF;IACpF,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAED,iBAAe,OAAO,CAAC,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CA2SzF;AAoOD,OAAO,EAAE,OAAO,EAAE,CAAC"}