@fangorn-network/sdk 2026.10.26-dev → 2026.10.28

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.
@@ -179,6 +179,34 @@ declare const APP_REGISTRY_ABI: readonly [{
179
179
  }];
180
180
  readonly outputs: readonly [];
181
181
  readonly stateMutability: "payable";
182
+ }, {
183
+ readonly type: "function";
184
+ readonly name: "canonicalAppId";
185
+ readonly inputs: readonly [{
186
+ readonly name: "app_id";
187
+ readonly type: "bytes32";
188
+ readonly internalType: "bytes32";
189
+ }];
190
+ readonly outputs: readonly [{
191
+ readonly name: "";
192
+ readonly type: "bytes32";
193
+ readonly internalType: "bytes32";
194
+ }];
195
+ readonly stateMutability: "view";
196
+ }, {
197
+ readonly type: "function";
198
+ readonly name: "currentAppId";
199
+ readonly inputs: readonly [{
200
+ readonly name: "app_id";
201
+ readonly type: "bytes32";
202
+ readonly internalType: "bytes32";
203
+ }];
204
+ readonly outputs: readonly [{
205
+ readonly name: "";
206
+ readonly type: "bytes32";
207
+ readonly internalType: "bytes32";
208
+ }];
209
+ readonly stateMutability: "view";
182
210
  }, {
183
211
  readonly type: "function";
184
212
  readonly name: "dataRegistry";
@@ -215,11 +243,11 @@ declare const APP_REGISTRY_ABI: readonly [{
215
243
  readonly type: "function";
216
244
  readonly name: "exclusionCount";
217
245
  readonly inputs: readonly [{
218
- readonly name: "";
246
+ readonly name: "app_id";
219
247
  readonly type: "bytes32";
220
248
  readonly internalType: "bytes32";
221
249
  }, {
222
- readonly name: "";
250
+ readonly name: "exclusion_id";
223
251
  readonly type: "bytes32";
224
252
  readonly internalType: "bytes32";
225
253
  }];
@@ -329,16 +357,6 @@ declare const APP_REGISTRY_ABI: readonly [{
329
357
  }];
330
358
  readonly outputs: readonly [];
331
359
  readonly stateMutability: "nonpayable";
332
- }, {
333
- readonly type: "function";
334
- readonly name: "initializeV2";
335
- readonly inputs: readonly [{
336
- readonly name: "existing";
337
- readonly type: "bytes32[]";
338
- readonly internalType: "bytes32[]";
339
- }];
340
- readonly outputs: readonly [];
341
- readonly stateMutability: "nonpayable";
342
360
  }, {
343
361
  readonly type: "function";
344
362
  readonly name: "isAppSuspended";
@@ -385,20 +403,6 @@ declare const APP_REGISTRY_ABI: readonly [{
385
403
  readonly internalType: "bool";
386
404
  }];
387
405
  readonly stateMutability: "view";
388
- }, {
389
- readonly type: "function";
390
- readonly name: "joinFeesOwed";
391
- readonly inputs: readonly [{
392
- readonly name: "";
393
- readonly type: "address";
394
- readonly internalType: "address";
395
- }];
396
- readonly outputs: readonly [{
397
- readonly name: "";
398
- readonly type: "uint256";
399
- readonly internalType: "uint256";
400
- }];
401
- readonly stateMutability: "view";
402
406
  }, {
403
407
  readonly type: "function";
404
408
  readonly name: "name";
@@ -447,6 +451,20 @@ declare const APP_REGISTRY_ABI: readonly [{
447
451
  }];
448
452
  readonly outputs: readonly [];
449
453
  readonly stateMutability: "nonpayable";
454
+ }, {
455
+ readonly type: "function";
456
+ readonly name: "renameApp";
457
+ readonly inputs: readonly [{
458
+ readonly name: "app_id";
459
+ readonly type: "bytes32";
460
+ readonly internalType: "bytes32";
461
+ }, {
462
+ readonly name: "new_id";
463
+ readonly type: "bytes32";
464
+ readonly internalType: "bytes32";
465
+ }];
466
+ readonly outputs: readonly [];
467
+ readonly stateMutability: "nonpayable";
450
468
  }, {
451
469
  readonly type: "function";
452
470
  readonly name: "renewSubscription";
@@ -641,11 +659,11 @@ declare const APP_REGISTRY_ABI: readonly [{
641
659
  readonly type: "function";
642
660
  readonly name: "statusForApp";
643
661
  readonly inputs: readonly [{
644
- readonly name: "";
662
+ readonly name: "app_id";
645
663
  readonly type: "bytes32";
646
664
  readonly internalType: "bytes32";
647
665
  }, {
648
- readonly name: "";
666
+ readonly name: "publisher";
649
667
  readonly type: "address";
650
668
  readonly internalType: "address";
651
669
  }];
@@ -713,16 +731,6 @@ declare const APP_REGISTRY_ABI: readonly [{
713
731
  readonly internalType: "string";
714
732
  }];
715
733
  readonly stateMutability: "view";
716
- }, {
717
- readonly type: "function";
718
- readonly name: "totalJoinFeesOwed";
719
- readonly inputs: readonly [];
720
- readonly outputs: readonly [{
721
- readonly name: "";
722
- readonly type: "uint256";
723
- readonly internalType: "uint256";
724
- }];
725
- readonly stateMutability: "view";
726
734
  }, {
727
735
  readonly type: "function";
728
736
  readonly name: "transferFrom";
@@ -765,16 +773,6 @@ declare const APP_REGISTRY_ABI: readonly [{
765
773
  readonly internalType: "address";
766
774
  }];
767
775
  readonly stateMutability: "view";
768
- }, {
769
- readonly type: "function";
770
- readonly name: "withdrawJoinFees";
771
- readonly inputs: readonly [{
772
- readonly name: "to";
773
- readonly type: "address";
774
- readonly internalType: "address";
775
- }];
776
- readonly outputs: readonly [];
777
- readonly stateMutability: "nonpayable";
778
776
  }, {
779
777
  readonly type: "function";
780
778
  readonly name: "withdrawToken";
@@ -838,6 +836,21 @@ declare const APP_REGISTRY_ABI: readonly [{
838
836
  readonly internalType: "address";
839
837
  }];
840
838
  readonly anonymous: false;
839
+ }, {
840
+ readonly type: "event";
841
+ readonly name: "AppRenamed";
842
+ readonly inputs: readonly [{
843
+ readonly name: "app_id";
844
+ readonly type: "bytes32";
845
+ readonly indexed: true;
846
+ readonly internalType: "bytes32";
847
+ }, {
848
+ readonly name: "new_id";
849
+ readonly type: "bytes32";
850
+ readonly indexed: true;
851
+ readonly internalType: "bytes32";
852
+ }];
853
+ readonly anonymous: false;
841
854
  }, {
842
855
  readonly type: "event";
843
856
  readonly name: "AppSuspensionChanged";
@@ -968,26 +981,6 @@ declare const APP_REGISTRY_ABI: readonly [{
968
981
  readonly internalType: "uint64";
969
982
  }];
970
983
  readonly anonymous: false;
971
- }, {
972
- readonly type: "event";
973
- readonly name: "JoinFeesWithdrawn";
974
- readonly inputs: readonly [{
975
- readonly name: "owner";
976
- readonly type: "address";
977
- readonly indexed: true;
978
- readonly internalType: "address";
979
- }, {
980
- readonly name: "to";
981
- readonly type: "address";
982
- readonly indexed: false;
983
- readonly internalType: "address";
984
- }, {
985
- readonly name: "amount";
986
- readonly type: "uint256";
987
- readonly indexed: false;
988
- readonly internalType: "uint256";
989
- }];
990
- readonly anonymous: false;
991
984
  }, {
992
985
  readonly type: "event";
993
986
  readonly name: "PublisherAccepted";
@@ -1232,10 +1225,6 @@ declare const APP_REGISTRY_ABI: readonly [{
1232
1225
  readonly type: "error";
1233
1226
  readonly name: "EthNotAccepted";
1234
1227
  readonly inputs: readonly [];
1235
- }, {
1236
- readonly type: "error";
1237
- readonly name: "ExceedsProtocolBalance";
1238
- readonly inputs: readonly [];
1239
1228
  }, {
1240
1229
  readonly type: "error";
1241
1230
  readonly name: "FailedCall";
@@ -1260,10 +1249,6 @@ declare const APP_REGISTRY_ABI: readonly [{
1260
1249
  readonly type: "error";
1261
1250
  readonly name: "NotTransferable";
1262
1251
  readonly inputs: readonly [];
1263
- }, {
1264
- readonly type: "error";
1265
- readonly name: "NothingToWithdraw";
1266
- readonly inputs: readonly [];
1267
1252
  }, {
1268
1253
  readonly type: "error";
1269
1254
  readonly name: "PublisherNotSuspended";
@@ -1308,6 +1293,10 @@ declare const APP_REGISTRY_ABI: readonly [{
1308
1293
  readonly type: "error";
1309
1294
  readonly name: "Unauthorized";
1310
1295
  readonly inputs: readonly [];
1296
+ }, {
1297
+ readonly type: "error";
1298
+ readonly name: "ZeroAppId";
1299
+ readonly inputs: readonly [];
1311
1300
  }, {
1312
1301
  readonly type: "error";
1313
1302
  readonly name: "ZeroPeriod";
@@ -197,6 +197,36 @@ const APP_REGISTRY_ABI = [
197
197
  "outputs": [],
198
198
  "stateMutability": "payable"
199
199
  },
200
+ {
201
+ "type": "function",
202
+ "name": "canonicalAppId",
203
+ "inputs": [{
204
+ "name": "app_id",
205
+ "type": "bytes32",
206
+ "internalType": "bytes32"
207
+ }],
208
+ "outputs": [{
209
+ "name": "",
210
+ "type": "bytes32",
211
+ "internalType": "bytes32"
212
+ }],
213
+ "stateMutability": "view"
214
+ },
215
+ {
216
+ "type": "function",
217
+ "name": "currentAppId",
218
+ "inputs": [{
219
+ "name": "app_id",
220
+ "type": "bytes32",
221
+ "internalType": "bytes32"
222
+ }],
223
+ "outputs": [{
224
+ "name": "",
225
+ "type": "bytes32",
226
+ "internalType": "bytes32"
227
+ }],
228
+ "stateMutability": "view"
229
+ },
200
230
  {
201
231
  "type": "function",
202
232
  "name": "dataRegistry",
@@ -240,11 +270,11 @@ const APP_REGISTRY_ABI = [
240
270
  "type": "function",
241
271
  "name": "exclusionCount",
242
272
  "inputs": [{
243
- "name": "",
273
+ "name": "app_id",
244
274
  "type": "bytes32",
245
275
  "internalType": "bytes32"
246
276
  }, {
247
- "name": "",
277
+ "name": "exclusion_id",
248
278
  "type": "bytes32",
249
279
  "internalType": "bytes32"
250
280
  }],
@@ -370,17 +400,6 @@ const APP_REGISTRY_ABI = [
370
400
  "outputs": [],
371
401
  "stateMutability": "nonpayable"
372
402
  },
373
- {
374
- "type": "function",
375
- "name": "initializeV2",
376
- "inputs": [{
377
- "name": "existing",
378
- "type": "bytes32[]",
379
- "internalType": "bytes32[]"
380
- }],
381
- "outputs": [],
382
- "stateMutability": "nonpayable"
383
- },
384
403
  {
385
404
  "type": "function",
386
405
  "name": "isAppSuspended",
@@ -430,21 +449,6 @@ const APP_REGISTRY_ABI = [
430
449
  }],
431
450
  "stateMutability": "view"
432
451
  },
433
- {
434
- "type": "function",
435
- "name": "joinFeesOwed",
436
- "inputs": [{
437
- "name": "",
438
- "type": "address",
439
- "internalType": "address"
440
- }],
441
- "outputs": [{
442
- "name": "",
443
- "type": "uint256",
444
- "internalType": "uint256"
445
- }],
446
- "stateMutability": "view"
447
- },
448
452
  {
449
453
  "type": "function",
450
454
  "name": "name",
@@ -497,6 +501,21 @@ const APP_REGISTRY_ABI = [
497
501
  "outputs": [],
498
502
  "stateMutability": "nonpayable"
499
503
  },
504
+ {
505
+ "type": "function",
506
+ "name": "renameApp",
507
+ "inputs": [{
508
+ "name": "app_id",
509
+ "type": "bytes32",
510
+ "internalType": "bytes32"
511
+ }, {
512
+ "name": "new_id",
513
+ "type": "bytes32",
514
+ "internalType": "bytes32"
515
+ }],
516
+ "outputs": [],
517
+ "stateMutability": "nonpayable"
518
+ },
500
519
  {
501
520
  "type": "function",
502
521
  "name": "renewSubscription",
@@ -722,11 +741,11 @@ const APP_REGISTRY_ABI = [
722
741
  "type": "function",
723
742
  "name": "statusForApp",
724
743
  "inputs": [{
725
- "name": "",
744
+ "name": "app_id",
726
745
  "type": "bytes32",
727
746
  "internalType": "bytes32"
728
747
  }, {
729
- "name": "",
748
+ "name": "publisher",
730
749
  "type": "address",
731
750
  "internalType": "address"
732
751
  }],
@@ -800,17 +819,6 @@ const APP_REGISTRY_ABI = [
800
819
  }],
801
820
  "stateMutability": "view"
802
821
  },
803
- {
804
- "type": "function",
805
- "name": "totalJoinFeesOwed",
806
- "inputs": [],
807
- "outputs": [{
808
- "name": "",
809
- "type": "uint256",
810
- "internalType": "uint256"
811
- }],
812
- "stateMutability": "view"
813
- },
814
822
  {
815
823
  "type": "function",
816
824
  "name": "transferFrom",
@@ -860,17 +868,6 @@ const APP_REGISTRY_ABI = [
860
868
  }],
861
869
  "stateMutability": "view"
862
870
  },
863
- {
864
- "type": "function",
865
- "name": "withdrawJoinFees",
866
- "inputs": [{
867
- "name": "to",
868
- "type": "address",
869
- "internalType": "address"
870
- }],
871
- "outputs": [],
872
- "stateMutability": "nonpayable"
873
- },
874
871
  {
875
872
  "type": "function",
876
873
  "name": "withdrawToken",
@@ -942,6 +939,22 @@ const APP_REGISTRY_ABI = [
942
939
  }],
943
940
  "anonymous": false
944
941
  },
942
+ {
943
+ "type": "event",
944
+ "name": "AppRenamed",
945
+ "inputs": [{
946
+ "name": "app_id",
947
+ "type": "bytes32",
948
+ "indexed": true,
949
+ "internalType": "bytes32"
950
+ }, {
951
+ "name": "new_id",
952
+ "type": "bytes32",
953
+ "indexed": true,
954
+ "internalType": "bytes32"
955
+ }],
956
+ "anonymous": false
957
+ },
945
958
  {
946
959
  "type": "event",
947
960
  "name": "AppSuspensionChanged",
@@ -1094,31 +1107,6 @@ const APP_REGISTRY_ABI = [
1094
1107
  }],
1095
1108
  "anonymous": false
1096
1109
  },
1097
- {
1098
- "type": "event",
1099
- "name": "JoinFeesWithdrawn",
1100
- "inputs": [
1101
- {
1102
- "name": "owner",
1103
- "type": "address",
1104
- "indexed": true,
1105
- "internalType": "address"
1106
- },
1107
- {
1108
- "name": "to",
1109
- "type": "address",
1110
- "indexed": false,
1111
- "internalType": "address"
1112
- },
1113
- {
1114
- "name": "amount",
1115
- "type": "uint256",
1116
- "indexed": false,
1117
- "internalType": "uint256"
1118
- }
1119
- ],
1120
- "anonymous": false
1121
- },
1122
1110
  {
1123
1111
  "type": "event",
1124
1112
  "name": "PublisherAccepted",
@@ -1405,11 +1393,6 @@ const APP_REGISTRY_ABI = [
1405
1393
  "name": "EthNotAccepted",
1406
1394
  "inputs": []
1407
1395
  },
1408
- {
1409
- "type": "error",
1410
- "name": "ExceedsProtocolBalance",
1411
- "inputs": []
1412
- },
1413
1396
  {
1414
1397
  "type": "error",
1415
1398
  "name": "FailedCall",
@@ -1440,11 +1423,6 @@ const APP_REGISTRY_ABI = [
1440
1423
  "name": "NotTransferable",
1441
1424
  "inputs": []
1442
1425
  },
1443
- {
1444
- "type": "error",
1445
- "name": "NothingToWithdraw",
1446
- "inputs": []
1447
- },
1448
1426
  {
1449
1427
  "type": "error",
1450
1428
  "name": "PublisherNotSuspended",
@@ -1499,6 +1477,11 @@ const APP_REGISTRY_ABI = [
1499
1477
  "name": "Unauthorized",
1500
1478
  "inputs": []
1501
1479
  },
1480
+ {
1481
+ "type": "error",
1482
+ "name": "ZeroAppId",
1483
+ "inputs": []
1484
+ },
1502
1485
  {
1503
1486
  "type": "error",
1504
1487
  "name": "ZeroPeriod",
@@ -22,8 +22,15 @@ interface AppAgentLog {
22
22
  /**
23
23
  * Client for the AppRegistry's app management: apps and their ERC-5643
24
24
  * subscriptions, the publishers each app accepts, the agent card, and the
25
- * protocol admin's powers. What an app presents — its members, less exclusions — is
26
- * read through the registry (`ChainRegistry`), not this client.
25
+ * protocol admin's powers.
26
+ *
27
+ * An app can be renamed (`renameApp`): the new id is an alias of the id the app
28
+ * was claimed under, its canonical id. The contract accepts any id an app has gone
29
+ * by, so this client may be scoped to any of them; what the contract keys by the
30
+ * canonical id alone (the token, events) is resolved here first.
31
+ *
32
+ * What an app presents — its members, less exclusions — is read through the
33
+ * registry (`ChainRegistry`), not this client.
27
34
  *
28
35
  * Scoped to one app, which may be unset: then only the calls that take no app work.
29
36
  */
@@ -39,8 +46,11 @@ declare class AppRegistryClient {
39
46
  getAddress(): Address;
40
47
  /** This client's app, or a clear error for a call that needs one. */
41
48
  private app;
42
- /** The app's subscription token: an app's token id is its app id. */
43
- tokenId(appId?: Hex): bigint;
49
+ /**
50
+ * The app's subscription token: its canonical id, as a number. Not the id
51
+ * passed in, if that is an id the app was renamed to.
52
+ */
53
+ tokenId(appId?: Hex): Promise<bigint>;
44
54
  private executeWrite;
45
55
  private read;
46
56
  /**
@@ -78,17 +88,35 @@ declare class AppRegistryClient {
78
88
  /** The ERC-20 token (USDC) every fee is paid in. */
79
89
  usdc(): Promise<Address>;
80
90
  getAppOwner(appId?: Hex): Promise<Address>;
81
- /** How many apps have been claimed. */
91
+ /**
92
+ * Give this app a new id (owner only). Nothing moves: `newId` becomes an
93
+ * alias of the canonical id, so the app's publishers, exclusions,
94
+ * subscription and token carry on, and every id it went by still resolves to
95
+ * it. `newId` must be unclaimed, or an id this app already goes by (renaming
96
+ * back); one held by another app reverts `AppAlreadyRegistered`.
97
+ *
98
+ * This client stays scoped to the id it had, which still works; switch it
99
+ * with `setAppId(newId)`.
100
+ */
101
+ renameApp(newId: Hex): Promise<Hash>;
102
+ /** The id this app (or `appId`) was claimed under. An id no app goes by comes back unchanged. */
103
+ canonicalAppId(appId?: Hex): Promise<Hex>;
104
+ /**
105
+ * The id this app (or `appId`) goes by now: the last it was renamed to, or its
106
+ * canonical id. An id no app goes by comes back unchanged.
107
+ */
108
+ currentAppId(appId?: Hex): Promise<Hex>;
109
+ /** How many apps have been claimed. A rename adds none. */
82
110
  appCount(): Promise<bigint>;
83
- /** Up to `limit` app ids from position `offset`, oldest first; fewer past the end. */
111
+ /** Up to `limit` canonical app ids from position `offset`, oldest first; fewer past the end. */
84
112
  appsPage(offset: bigint, limit: bigint): Promise<readonly Hex[]>;
85
113
  /**
86
- * Every claimed app id, oldest first.
114
+ * Every claimed app id (canonical; see `currentAppId`), oldest first.
87
115
  * ponytail: one eth_call for all of them; page with `appsPage` once the list
88
116
  * outgrows the RPC's eth_call gas cap (tens of thousands of apps).
89
117
  */
90
118
  allApps(): Promise<readonly Hex[]>;
91
- /** The app ids `owner` claimed, oldest first. */
119
+ /** The app ids `owner` claimed (canonical; see `currentAppId`), oldest first. */
92
120
  appsOf(owner: Address): Promise<readonly Hex[]>;
93
121
  /**
94
122
  * Point this app at its ERC-8004 agent card.
@@ -96,10 +124,6 @@ declare class AppRegistryClient {
96
124
  * Safe to call whenever the card moves: it leaves the app's publishers alone.
97
125
  */
98
126
  setAppAgentUri(agentUri: string): Promise<Hash>;
99
- /** Send the join fees the caller is still owed, from the old join flow, to `to`. */
100
- withdrawJoinFees(to?: Address): Promise<Hash>;
101
- /** Join fees still owed to `owner` from the old join flow, in USDC base units. Nothing adds to it. */
102
- joinFeesOwed(owner?: Address): Promise<bigint>;
103
127
  isAppSuspended(): Promise<boolean>;
104
128
  /** The agent card URI of this app, or of `appId`. Empty if none is set. */
105
129
  appAgentUri(appId?: Hex): Promise<string>;
@@ -128,6 +152,9 @@ declare class AppRegistryClient {
128
152
  * `AppAgentChanged` events, oldest first. The last one for an app is its
129
153
  * current card; an empty `agentUri` means the owner unset it.
130
154
  *
155
+ * Events carry the canonical id: `appId` may be any id the app goes by, and
156
+ * each log's `appId` is the canonical one.
157
+ *
131
158
  * Leave `appId` out to list every app that has ever set a card. To list apps,
132
159
  * use `allApps` or `appsOf`, which are one read each; this is a windowed log
133
160
  * scan, for a card's history. `fromBlock` is required because scanning from genesis on an L2 costs