@fangorn-network/sdk 2026.10.22-dev → 2026.10.23-dev

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 (37) hide show
  1. package/lib/cli/cli.d.ts +0 -0
  2. package/lib/cli/index.d.ts +2 -2
  3. package/lib/config.d.ts +33 -33
  4. package/lib/config.js +3 -4
  5. package/lib/contracts/app-registry/abi.d.ts +52 -0
  6. package/lib/contracts/app-registry/abi.js +56 -0
  7. package/lib/contracts/app-registry/index.d.ts +15 -3
  8. package/lib/contracts/app-registry/index.js +23 -3
  9. package/lib/fangorn.js +5 -1
  10. package/lib/node_modules/{.pnpm/@jridgewell_sourcemap-codec@1.5.5/node_modules/@jridgewell → @jridgewell}/sourcemap-codec/dist/sourcemap-codec.js +1 -1
  11. package/lib/node_modules/{.pnpm/@vitest_expect@4.0.18/node_modules/@vitest → @vitest}/expect/dist/index.js +8 -8
  12. package/lib/node_modules/{.pnpm/@vitest_pretty-format@4.0.18/node_modules/@vitest → @vitest}/pretty-format/dist/index.js +2 -2
  13. package/lib/node_modules/{.pnpm/@vitest_runner@4.0.18/node_modules/@vitest → @vitest}/runner/dist/chunk-tasks.js +2 -2
  14. package/lib/node_modules/{.pnpm/@vitest_runner@4.0.18/node_modules/@vitest → @vitest}/runner/dist/index.js +4 -4
  15. package/lib/node_modules/{.pnpm/@vitest_snapshot@4.0.18/node_modules/@vitest → @vitest}/snapshot/dist/index.js +4 -4
  16. package/lib/node_modules/{.pnpm/@vitest_spy@4.0.18/node_modules/@vitest → @vitest}/spy/dist/index.js +1 -1
  17. package/lib/node_modules/{.pnpm/@vitest_utils@4.0.18/node_modules/@vitest → @vitest}/utils/dist/chunk-_commonjsHelpers.js +1 -1
  18. package/lib/node_modules/{.pnpm/@vitest_utils@4.0.18/node_modules/@vitest → @vitest}/utils/dist/chunk-pathe.M-eThtNZ.js +1 -1
  19. package/lib/node_modules/{.pnpm/@vitest_utils@4.0.18/node_modules/@vitest → @vitest}/utils/dist/diff.js +3 -3
  20. package/lib/node_modules/{.pnpm/@vitest_utils@4.0.18/node_modules/@vitest → @vitest}/utils/dist/display.js +2 -2
  21. package/lib/node_modules/{.pnpm/@vitest_utils@4.0.18/node_modules/@vitest → @vitest}/utils/dist/error.js +2 -2
  22. package/lib/node_modules/{.pnpm/@vitest_utils@4.0.18/node_modules/@vitest → @vitest}/utils/dist/helpers.js +1 -1
  23. package/lib/node_modules/{.pnpm/@vitest_utils@4.0.18/node_modules/@vitest → @vitest}/utils/dist/serialize.js +1 -1
  24. package/lib/node_modules/{.pnpm/@vitest_utils@4.0.18/node_modules/@vitest → @vitest}/utils/dist/source-map.js +1 -1
  25. package/lib/node_modules/{.pnpm/@vitest_utils@4.0.18/node_modules/@vitest → @vitest}/utils/dist/timers.js +1 -1
  26. package/lib/node_modules/{.pnpm/chai@6.2.2/node_modules/chai → chai}/index.js +1 -1
  27. package/lib/node_modules/{.pnpm/magic-string@0.30.21/node_modules/magic-string → magic-string}/dist/magic-string.es.js +2 -2
  28. package/lib/node_modules/{.pnpm/pathe@2.0.3/node_modules/pathe → pathe}/dist/shared/pathe.M-eThtNZ.js +1 -1
  29. package/lib/node_modules/{.pnpm/tinyrainbow@3.0.3/node_modules/tinyrainbow → tinyrainbow}/dist/index.js +1 -1
  30. package/lib/node_modules/{.pnpm/vitest@4.0.18_@types_node@24.10.1_jiti@2.6.1_terser@5.51.2_tsx@4.21.0_yaml@2.8.2/node_modules/vitest → vitest}/dist/chunks/_commonjsHelpers.D26ty3Ew.js +1 -1
  31. package/lib/node_modules/{.pnpm/vitest@4.0.18_@types_node@24.10.1_jiti@2.6.1_terser@5.51.2_tsx@4.21.0_yaml@2.8.2/node_modules/vitest → vitest}/dist/chunks/date.Bq6ZW5rf.js +1 -1
  32. package/lib/node_modules/{.pnpm/vitest@4.0.18_@types_node@24.10.1_jiti@2.6.1_terser@5.51.2_tsx@4.21.0_yaml@2.8.2/node_modules/vitest → vitest}/dist/chunks/utils.DvEY5TfP.js +2 -2
  33. package/lib/node_modules/{.pnpm/vitest@4.0.18_@types_node@24.10.1_jiti@2.6.1_terser@5.51.2_tsx@4.21.0_yaml@2.8.2/node_modules/vitest → vitest}/dist/chunks/vi.2VT5v0um.js +11 -11
  34. package/lib/test/sdk-suite.js +2 -2
  35. package/lib/test/testbed.d.ts +5185 -5184
  36. package/package.json +88 -74
  37. /package/lib/node_modules/{.pnpm/@vitest_runner@4.0.18/node_modules/@vitest → @vitest}/runner/dist/utils.js +0 -0
package/lib/cli/cli.d.ts CHANGED
File without changes
@@ -1,8 +1,8 @@
1
1
  import "./cli.js";
2
- import * as viem161 from "viem";
2
+ import * as viem129 from "viem";
3
3
 
4
4
  //#region src/cli/index.d.ts
5
- declare const getChain: (chainStr: string) => viem161.Chain;
5
+ declare const getChain: (chainStr: string) => viem129.Chain;
6
6
  declare const handleCancel: (value: unknown) => void;
7
7
  declare const selectChain: () => Promise<string>;
8
8
  declare function parseGadgetArg(raw: string): {
package/lib/config.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import * as viem0 from "viem";
2
2
  import { Chain, Hex } from "viem";
3
3
  import * as viem_chains0 from "viem/chains";
4
+ import * as abitype0 from "abitype";
4
5
 
5
6
  //#region src/config.d.ts
6
7
  /**
@@ -80,7 +81,6 @@ declare const ArbitrumSepoliaConfig: {
80
81
  caip2: number;
81
82
  ipfsGateway: string;
82
83
  logWindow: bigint;
83
- signedUrlWorker: string;
84
84
  };
85
85
  declare const BaseSepoliaConfig: {
86
86
  dataRegistryContractAddress: "0xE9183f768865dd2Cde5f1B71F8446F0Cd798ebe0";
@@ -174,7 +174,7 @@ declare const BaseSepoliaConfig: {
174
174
  gasUsed: bigint;
175
175
  hash: `0x${string}` | null;
176
176
  logsBloom: `0x${string}` | null;
177
- miner: viem0.Address;
177
+ miner: abitype0.Address;
178
178
  mixHash: viem0.Hash;
179
179
  nonce: `0x${string}` | null;
180
180
  number: bigint | null;
@@ -200,14 +200,14 @@ declare const BaseSepoliaConfig: {
200
200
  format: (args: viem_chains0.OpStackRpcTransaction, action?: string | undefined) => ({
201
201
  blockHash: `0x${string}` | null;
202
202
  blockNumber: bigint | null;
203
- from: viem0.Address;
203
+ from: abitype0.Address;
204
204
  gas: bigint;
205
205
  hash: viem0.Hash;
206
206
  input: viem0.Hex;
207
207
  nonce: number;
208
208
  r: viem0.Hex;
209
209
  s: viem0.Hex;
210
- to: viem0.Address | null;
210
+ to: abitype0.Address | null;
211
211
  transactionIndex: number | null;
212
212
  typeHex: viem0.Hex | null;
213
213
  v: bigint;
@@ -225,8 +225,8 @@ declare const BaseSepoliaConfig: {
225
225
  r: viem0.Hex;
226
226
  s: viem0.Hex;
227
227
  v: bigint;
228
- to: viem0.Address | null;
229
- from: viem0.Address;
228
+ to: abitype0.Address | null;
229
+ from: abitype0.Address;
230
230
  gas: bigint;
231
231
  nonce: number;
232
232
  value: bigint;
@@ -252,14 +252,14 @@ declare const BaseSepoliaConfig: {
252
252
  } | {
253
253
  blockHash: `0x${string}` | null;
254
254
  blockNumber: bigint | null;
255
- from: viem0.Address;
255
+ from: abitype0.Address;
256
256
  gas: bigint;
257
257
  hash: viem0.Hash;
258
258
  input: viem0.Hex;
259
259
  nonce: number;
260
260
  r: viem0.Hex;
261
261
  s: viem0.Hex;
262
- to: viem0.Address | null;
262
+ to: abitype0.Address | null;
263
263
  transactionIndex: number | null;
264
264
  typeHex: viem0.Hex | null;
265
265
  v: bigint;
@@ -280,14 +280,14 @@ declare const BaseSepoliaConfig: {
280
280
  } | {
281
281
  blockHash: `0x${string}` | null;
282
282
  blockNumber: bigint | null;
283
- from: viem0.Address;
283
+ from: abitype0.Address;
284
284
  gas: bigint;
285
285
  hash: viem0.Hash;
286
286
  input: viem0.Hex;
287
287
  nonce: number;
288
288
  r: viem0.Hex;
289
289
  s: viem0.Hex;
290
- to: viem0.Address | null;
290
+ to: abitype0.Address | null;
291
291
  transactionIndex: number | null;
292
292
  typeHex: viem0.Hex | null;
293
293
  v: bigint;
@@ -308,14 +308,14 @@ declare const BaseSepoliaConfig: {
308
308
  } | {
309
309
  blockHash: `0x${string}` | null;
310
310
  blockNumber: bigint | null;
311
- from: viem0.Address;
311
+ from: abitype0.Address;
312
312
  gas: bigint;
313
313
  hash: viem0.Hash;
314
314
  input: viem0.Hex;
315
315
  nonce: number;
316
316
  r: viem0.Hex;
317
317
  s: viem0.Hex;
318
- to: viem0.Address | null;
318
+ to: abitype0.Address | null;
319
319
  transactionIndex: number | null;
320
320
  typeHex: viem0.Hex | null;
321
321
  v: bigint;
@@ -336,14 +336,14 @@ declare const BaseSepoliaConfig: {
336
336
  } | {
337
337
  blockHash: `0x${string}` | null;
338
338
  blockNumber: bigint | null;
339
- from: viem0.Address;
339
+ from: abitype0.Address;
340
340
  gas: bigint;
341
341
  hash: viem0.Hash;
342
342
  input: viem0.Hex;
343
343
  nonce: number;
344
344
  r: viem0.Hex;
345
345
  s: viem0.Hex;
346
- to: viem0.Address | null;
346
+ to: abitype0.Address | null;
347
347
  transactionIndex: number | null;
348
348
  typeHex: viem0.Hex | null;
349
349
  v: bigint;
@@ -372,16 +372,16 @@ declare const BaseSepoliaConfig: {
372
372
  blockHash: viem0.Hash;
373
373
  blockNumber: bigint;
374
374
  blockTimestamp?: bigint | undefined;
375
- contractAddress: viem0.Address | null | undefined;
375
+ contractAddress: abitype0.Address | null | undefined;
376
376
  cumulativeGasUsed: bigint;
377
377
  effectiveGasPrice: bigint;
378
- from: viem0.Address;
378
+ from: abitype0.Address;
379
379
  gasUsed: bigint;
380
380
  logs: viem0.Log<bigint, number, false>[];
381
381
  logsBloom: viem0.Hex;
382
382
  root?: `0x${string}` | undefined;
383
383
  status: "success" | "reverted";
384
- to: viem0.Address | null;
384
+ to: abitype0.Address | null;
385
385
  transactionHash: viem0.Hash;
386
386
  transactionIndex: number;
387
387
  type: viem0.TransactionType;
@@ -509,7 +509,7 @@ declare const FangornConfig: {
509
509
  gasUsed: bigint;
510
510
  hash: `0x${string}` | null;
511
511
  logsBloom: `0x${string}` | null;
512
- miner: viem0.Address;
512
+ miner: abitype0.Address;
513
513
  mixHash: viem0.Hash;
514
514
  nonce: `0x${string}` | null;
515
515
  number: bigint | null;
@@ -535,14 +535,14 @@ declare const FangornConfig: {
535
535
  format: (args: viem_chains0.OpStackRpcTransaction, action?: string | undefined) => ({
536
536
  blockHash: `0x${string}` | null;
537
537
  blockNumber: bigint | null;
538
- from: viem0.Address;
538
+ from: abitype0.Address;
539
539
  gas: bigint;
540
540
  hash: viem0.Hash;
541
541
  input: viem0.Hex;
542
542
  nonce: number;
543
543
  r: viem0.Hex;
544
544
  s: viem0.Hex;
545
- to: viem0.Address | null;
545
+ to: abitype0.Address | null;
546
546
  transactionIndex: number | null;
547
547
  typeHex: viem0.Hex | null;
548
548
  v: bigint;
@@ -560,8 +560,8 @@ declare const FangornConfig: {
560
560
  r: viem0.Hex;
561
561
  s: viem0.Hex;
562
562
  v: bigint;
563
- to: viem0.Address | null;
564
- from: viem0.Address;
563
+ to: abitype0.Address | null;
564
+ from: abitype0.Address;
565
565
  gas: bigint;
566
566
  nonce: number;
567
567
  value: bigint;
@@ -587,14 +587,14 @@ declare const FangornConfig: {
587
587
  } | {
588
588
  blockHash: `0x${string}` | null;
589
589
  blockNumber: bigint | null;
590
- from: viem0.Address;
590
+ from: abitype0.Address;
591
591
  gas: bigint;
592
592
  hash: viem0.Hash;
593
593
  input: viem0.Hex;
594
594
  nonce: number;
595
595
  r: viem0.Hex;
596
596
  s: viem0.Hex;
597
- to: viem0.Address | null;
597
+ to: abitype0.Address | null;
598
598
  transactionIndex: number | null;
599
599
  typeHex: viem0.Hex | null;
600
600
  v: bigint;
@@ -615,14 +615,14 @@ declare const FangornConfig: {
615
615
  } | {
616
616
  blockHash: `0x${string}` | null;
617
617
  blockNumber: bigint | null;
618
- from: viem0.Address;
618
+ from: abitype0.Address;
619
619
  gas: bigint;
620
620
  hash: viem0.Hash;
621
621
  input: viem0.Hex;
622
622
  nonce: number;
623
623
  r: viem0.Hex;
624
624
  s: viem0.Hex;
625
- to: viem0.Address | null;
625
+ to: abitype0.Address | null;
626
626
  transactionIndex: number | null;
627
627
  typeHex: viem0.Hex | null;
628
628
  v: bigint;
@@ -643,14 +643,14 @@ declare const FangornConfig: {
643
643
  } | {
644
644
  blockHash: `0x${string}` | null;
645
645
  blockNumber: bigint | null;
646
- from: viem0.Address;
646
+ from: abitype0.Address;
647
647
  gas: bigint;
648
648
  hash: viem0.Hash;
649
649
  input: viem0.Hex;
650
650
  nonce: number;
651
651
  r: viem0.Hex;
652
652
  s: viem0.Hex;
653
- to: viem0.Address | null;
653
+ to: abitype0.Address | null;
654
654
  transactionIndex: number | null;
655
655
  typeHex: viem0.Hex | null;
656
656
  v: bigint;
@@ -671,14 +671,14 @@ declare const FangornConfig: {
671
671
  } | {
672
672
  blockHash: `0x${string}` | null;
673
673
  blockNumber: bigint | null;
674
- from: viem0.Address;
674
+ from: abitype0.Address;
675
675
  gas: bigint;
676
676
  hash: viem0.Hash;
677
677
  input: viem0.Hex;
678
678
  nonce: number;
679
679
  r: viem0.Hex;
680
680
  s: viem0.Hex;
681
- to: viem0.Address | null;
681
+ to: abitype0.Address | null;
682
682
  transactionIndex: number | null;
683
683
  typeHex: viem0.Hex | null;
684
684
  v: bigint;
@@ -707,16 +707,16 @@ declare const FangornConfig: {
707
707
  blockHash: viem0.Hash;
708
708
  blockNumber: bigint;
709
709
  blockTimestamp?: bigint | undefined;
710
- contractAddress: viem0.Address | null | undefined;
710
+ contractAddress: abitype0.Address | null | undefined;
711
711
  cumulativeGasUsed: bigint;
712
712
  effectiveGasPrice: bigint;
713
- from: viem0.Address;
713
+ from: abitype0.Address;
714
714
  gasUsed: bigint;
715
715
  logs: viem0.Log<bigint, number, false>[];
716
716
  logsBloom: viem0.Hex;
717
717
  root?: `0x${string}` | undefined;
718
718
  status: "success" | "reverted";
719
- to: viem0.Address | null;
719
+ to: abitype0.Address | null;
720
720
  transactionHash: viem0.Hash;
721
721
  transactionIndex: number;
722
722
  type: viem0.TransactionType;
package/lib/config.js CHANGED
@@ -31,8 +31,7 @@ const ArbitrumSepoliaConfig = {
31
31
  rpcUrl: "https://sepolia-rollup.arbitrum.io/rpc",
32
32
  caip2: 421614,
33
33
  ipfsGateway: "https://ipfs.io",
34
- logWindow: 100000n,
35
- signedUrlWorker: "https://pinata-url-provider.fangorn-0be.workers.dev"
34
+ logWindow: 100000n
36
35
  };
37
36
  const BaseSepoliaConfig = {
38
37
  dataRegistryContractAddress: "0xE9183f768865dd2Cde5f1B71F8446F0Cd798ebe0",
@@ -43,8 +42,8 @@ const BaseSepoliaConfig = {
43
42
  rpcUrl: "https://base-sepolia-rpc.publicnode.com",
44
43
  caip2: 84532,
45
44
  ipfsGateway: "https://ipfs.io",
46
- logWindow: 10000n,
47
- signedUrlWorker: "https://pinata-url-provider-base.fangorn-0be.workers.dev"
45
+ logWindow: 1000n,
46
+ signedUrlWorker: "https://base-sepolia.storage-worker.fangorn.network"
48
47
  };
49
48
  /**
50
49
  * The default network: what `Fangorn.create` uses without a `config`, and the CLI
@@ -81,6 +81,16 @@ declare const APP_REGISTRY_ABI: readonly [{
81
81
  readonly internalType: "string";
82
82
  }];
83
83
  readonly stateMutability: "view";
84
+ }, {
85
+ readonly type: "function";
86
+ readonly name: "appCount";
87
+ readonly inputs: readonly [];
88
+ readonly outputs: readonly [{
89
+ readonly name: "";
90
+ readonly type: "uint256";
91
+ readonly internalType: "uint256";
92
+ }];
93
+ readonly stateMutability: "view";
84
94
  }, {
85
95
  readonly type: "function";
86
96
  readonly name: "approve";
@@ -95,6 +105,38 @@ declare const APP_REGISTRY_ABI: readonly [{
95
105
  }];
96
106
  readonly outputs: readonly [];
97
107
  readonly stateMutability: "nonpayable";
108
+ }, {
109
+ readonly type: "function";
110
+ readonly name: "appsOf";
111
+ readonly inputs: readonly [{
112
+ readonly name: "owner";
113
+ readonly type: "address";
114
+ readonly internalType: "address";
115
+ }];
116
+ readonly outputs: readonly [{
117
+ readonly name: "";
118
+ readonly type: "bytes32[]";
119
+ readonly internalType: "bytes32[]";
120
+ }];
121
+ readonly stateMutability: "view";
122
+ }, {
123
+ readonly type: "function";
124
+ readonly name: "appsPage";
125
+ readonly inputs: readonly [{
126
+ readonly name: "offset";
127
+ readonly type: "uint256";
128
+ readonly internalType: "uint256";
129
+ }, {
130
+ readonly name: "limit";
131
+ readonly type: "uint256";
132
+ readonly internalType: "uint256";
133
+ }];
134
+ readonly outputs: readonly [{
135
+ readonly name: "page";
136
+ readonly type: "bytes32[]";
137
+ readonly internalType: "bytes32[]";
138
+ }];
139
+ readonly stateMutability: "view";
98
140
  }, {
99
141
  readonly type: "function";
100
142
  readonly name: "balanceOf";
@@ -287,6 +329,16 @@ declare const APP_REGISTRY_ABI: readonly [{
287
329
  }];
288
330
  readonly outputs: readonly [];
289
331
  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";
290
342
  }, {
291
343
  readonly type: "function";
292
344
  readonly name: "isAppSuspended";
@@ -92,6 +92,17 @@ const APP_REGISTRY_ABI = [
92
92
  }],
93
93
  "stateMutability": "view"
94
94
  },
95
+ {
96
+ "type": "function",
97
+ "name": "appCount",
98
+ "inputs": [],
99
+ "outputs": [{
100
+ "name": "",
101
+ "type": "uint256",
102
+ "internalType": "uint256"
103
+ }],
104
+ "stateMutability": "view"
105
+ },
95
106
  {
96
107
  "type": "function",
97
108
  "name": "approve",
@@ -107,6 +118,40 @@ const APP_REGISTRY_ABI = [
107
118
  "outputs": [],
108
119
  "stateMutability": "nonpayable"
109
120
  },
121
+ {
122
+ "type": "function",
123
+ "name": "appsOf",
124
+ "inputs": [{
125
+ "name": "owner",
126
+ "type": "address",
127
+ "internalType": "address"
128
+ }],
129
+ "outputs": [{
130
+ "name": "",
131
+ "type": "bytes32[]",
132
+ "internalType": "bytes32[]"
133
+ }],
134
+ "stateMutability": "view"
135
+ },
136
+ {
137
+ "type": "function",
138
+ "name": "appsPage",
139
+ "inputs": [{
140
+ "name": "offset",
141
+ "type": "uint256",
142
+ "internalType": "uint256"
143
+ }, {
144
+ "name": "limit",
145
+ "type": "uint256",
146
+ "internalType": "uint256"
147
+ }],
148
+ "outputs": [{
149
+ "name": "page",
150
+ "type": "bytes32[]",
151
+ "internalType": "bytes32[]"
152
+ }],
153
+ "stateMutability": "view"
154
+ },
110
155
  {
111
156
  "type": "function",
112
157
  "name": "balanceOf",
@@ -325,6 +370,17 @@ const APP_REGISTRY_ABI = [
325
370
  "outputs": [],
326
371
  "stateMutability": "nonpayable"
327
372
  },
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
+ },
328
384
  {
329
385
  "type": "function",
330
386
  "name": "isAppSuspended",
@@ -78,6 +78,18 @@ declare class AppRegistryClient {
78
78
  /** The ERC-20 token (USDC) every fee is paid in. */
79
79
  usdc(): Promise<Address>;
80
80
  getAppOwner(appId?: Hex): Promise<Address>;
81
+ /** How many apps have been claimed. */
82
+ appCount(): Promise<bigint>;
83
+ /** Up to `limit` app ids from position `offset`, oldest first; fewer past the end. */
84
+ appsPage(offset: bigint, limit: bigint): Promise<readonly Hex[]>;
85
+ /**
86
+ * Every claimed app id, oldest first.
87
+ * ponytail: one eth_call for all of them; page with `appsPage` once the list
88
+ * outgrows the RPC's eth_call gas cap (tens of thousands of apps).
89
+ */
90
+ allApps(): Promise<readonly Hex[]>;
91
+ /** The app ids `owner` claimed, oldest first. */
92
+ appsOf(owner: Address): Promise<readonly Hex[]>;
81
93
  /**
82
94
  * Point this app at its ERC-8004 agent card.
83
95
  *
@@ -116,9 +128,9 @@ declare class AppRegistryClient {
116
128
  * `AppAgentChanged` events, oldest first. The last one for an app is its
117
129
  * current card; an empty `agentUri` means the owner unset it.
118
130
  *
119
- * Leave `appId` out to list every app that has ever set a card. The chain is
120
- * the directory: one windowed log scan, no indexer and no registry namespace.
121
- * `fromBlock` is required because scanning from genesis on an L2 costs
131
+ * Leave `appId` out to list every app that has ever set a card. To list apps,
132
+ * use `allApps` or `appsOf`, which are one read each; this is a windowed log
133
+ * scan, for a card's history. `fromBlock` is required because scanning from genesis on an L2 costs
122
134
  * hundreds of thousands of RPC calls. Pass the AppRegistry's deploy block, or
123
135
  * a block you know to be before the app's registration.
124
136
  */
@@ -114,6 +114,26 @@ var AppRegistryClient = class {
114
114
  async getAppOwner(appId = this.app()) {
115
115
  return this.read("getAppOwner", [appId]);
116
116
  }
117
+ /** How many apps have been claimed. */
118
+ async appCount() {
119
+ return this.read("appCount", []);
120
+ }
121
+ /** Up to `limit` app ids from position `offset`, oldest first; fewer past the end. */
122
+ async appsPage(offset, limit) {
123
+ return this.read("appsPage", [offset, limit]);
124
+ }
125
+ /**
126
+ * Every claimed app id, oldest first.
127
+ * ponytail: one eth_call for all of them; page with `appsPage` once the list
128
+ * outgrows the RPC's eth_call gas cap (tens of thousands of apps).
129
+ */
130
+ async allApps() {
131
+ return this.appsPage(0n, await this.appCount());
132
+ }
133
+ /** The app ids `owner` claimed, oldest first. */
134
+ async appsOf(owner) {
135
+ return this.read("appsOf", [owner]);
136
+ }
117
137
  /**
118
138
  * Point this app at its ERC-8004 agent card.
119
139
  *
@@ -181,9 +201,9 @@ var AppRegistryClient = class {
181
201
  * `AppAgentChanged` events, oldest first. The last one for an app is its
182
202
  * current card; an empty `agentUri` means the owner unset it.
183
203
  *
184
- * Leave `appId` out to list every app that has ever set a card. The chain is
185
- * the directory: one windowed log scan, no indexer and no registry namespace.
186
- * `fromBlock` is required because scanning from genesis on an L2 costs
204
+ * Leave `appId` out to list every app that has ever set a card. To list apps,
205
+ * use `allApps` or `appsOf`, which are one read each; this is a windowed log
206
+ * scan, for a card's history. `fromBlock` is required because scanning from genesis on an L2 costs
187
207
  * hundreds of thousands of RPC calls. Pass the AppRegistry's deploy block, or
188
208
  * a block you know to be before the app's registration.
189
209
  */
package/lib/fangorn.js CHANGED
@@ -30,7 +30,11 @@ function resolveStorage(storage, walletClient, config, getAppId) {
30
30
  if (!storage) return void 0;
31
31
  if ("backend" in storage) return storage.backend;
32
32
  if ("pinata" in storage) return new PinataBackend(storage.pinata.jwt, storage.pinata.gateway);
33
- if ("signedUrl" in storage) return new SignedUrlBackend(nonBlank(storage.signedUrl.workerUrl) ?? config.signedUrlWorker, walletSigner(walletClient), storage.signedUrl.gateway ?? config.ipfsGateway, getAppId);
33
+ if ("signedUrl" in storage) {
34
+ const workerUrl = nonBlank(storage.signedUrl.workerUrl) ?? nonBlank(config.signedUrlWorker);
35
+ if (!workerUrl) throw new Error(`no hosted upload worker on chain ${config.caip2.toString()}: pass storage.signedUrl.workerUrl, or bring your own storage ({ pinata } or { backend })`);
36
+ return new SignedUrlBackend(workerUrl, walletSigner(walletClient), storage.signedUrl.gateway ?? config.ipfsGateway, getAppId);
37
+ }
34
38
  throw new Error(`Invalid storage config: must be { pinata: … }, { signedUrl: … } or { backend: … }, got ${JSON.stringify(storage)}`);
35
39
  }
36
40
  /** The A2A extension a Fangorn app's agent card carries: it names the app the card speaks for. */
@@ -1,4 +1,4 @@
1
- //#region node_modules/.pnpm/@jridgewell+sourcemap-codec@1.5.5/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs
1
+ //#region node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs
2
2
  var comma = ",".charCodeAt(0);
3
3
  var semicolon = ";".charCodeAt(0);
4
4
  var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
@@ -1,12 +1,12 @@
1
- import { C } from "../../../../../tinyrainbow@3.0.3/node_modules/tinyrainbow/dist/index.js";
2
- import { stringify } from "../../../../../@vitest_utils@4.0.18/node_modules/@vitest/utils/dist/display.js";
3
- import { assertTypes, getType, isObject, noop } from "../../../../../@vitest_utils@4.0.18/node_modules/@vitest/utils/dist/helpers.js";
4
- import { diff, printDiffOrStringify } from "../../../../../@vitest_utils@4.0.18/node_modules/@vitest/utils/dist/diff.js";
5
- import { isMockFunction } from "../../../../../@vitest_spy@4.0.18/node_modules/@vitest/spy/dist/index.js";
6
- import { processError } from "../../../../../@vitest_utils@4.0.18/node_modules/@vitest/utils/dist/error.js";
7
- import { use, utils_exports } from "../../../../../chai@6.2.2/node_modules/chai/index.js";
1
+ import { C } from "../../../tinyrainbow/dist/index.js";
2
+ import { stringify } from "../../utils/dist/display.js";
3
+ import { assertTypes, getType, isObject, noop } from "../../utils/dist/helpers.js";
4
+ import { diff, printDiffOrStringify } from "../../utils/dist/diff.js";
5
+ import { isMockFunction } from "../../spy/dist/index.js";
6
+ import { processError } from "../../utils/dist/error.js";
7
+ import { use, utils_exports } from "../../../chai/index.js";
8
8
 
9
- //#region node_modules/.pnpm/@vitest+expect@4.0.18/node_modules/@vitest/expect/dist/index.js
9
+ //#region node_modules/@vitest/expect/dist/index.js
10
10
  const MATCHERS_OBJECT = Symbol.for("matchers-object");
11
11
  const JEST_MATCHERS_OBJECT = Symbol.for("$$jest-matchers-object");
12
12
  const GLOBAL_EXPECT = Symbol.for("expect-global");
@@ -1,6 +1,6 @@
1
- import { C } from "../../../../../tinyrainbow@3.0.3/node_modules/tinyrainbow/dist/index.js";
1
+ import { C } from "../../../tinyrainbow/dist/index.js";
2
2
 
3
- //#region node_modules/.pnpm/@vitest+pretty-format@4.0.18/node_modules/@vitest/pretty-format/dist/index.js
3
+ //#region node_modules/@vitest/pretty-format/dist/index.js
4
4
  function _mergeNamespaces(n, m) {
5
5
  m.forEach(function(e) {
6
6
  e && typeof e !== "string" && !Array.isArray(e) && Object.keys(e).forEach(function(k) {
@@ -1,6 +1,6 @@
1
- import { parseSingleStack } from "../../../../../@vitest_utils@4.0.18/node_modules/@vitest/utils/dist/source-map.js";
1
+ import { parseSingleStack } from "../../utils/dist/source-map.js";
2
2
 
3
- //#region node_modules/.pnpm/@vitest+runner@4.0.18/node_modules/@vitest/runner/dist/chunk-tasks.js
3
+ //#region node_modules/@vitest/runner/dist/chunk-tasks.js
4
4
  function createChainable(keys, fn) {
5
5
  function create(context) {
6
6
  const chain$1 = function(...args) {
@@ -1,9 +1,9 @@
1
- import { format, formatRegExp, objDisplay } from "../../../../../@vitest_utils@4.0.18/node_modules/@vitest/utils/dist/display.js";
2
- import { assertTypes, createDefer, isNegativeNaN, isObject, objectAttr, toArray } from "../../../../../@vitest_utils@4.0.18/node_modules/@vitest/utils/dist/helpers.js";
3
- import { getSafeTimers } from "../../../../../@vitest_utils@4.0.18/node_modules/@vitest/utils/dist/timers.js";
1
+ import { format, formatRegExp, objDisplay } from "../../utils/dist/display.js";
2
+ import { assertTypes, createDefer, isNegativeNaN, isObject, objectAttr, toArray } from "../../utils/dist/helpers.js";
3
+ import { getSafeTimers } from "../../utils/dist/timers.js";
4
4
  import { createChainable, createTaskName, findTestFileStackTrace } from "./chunk-tasks.js";
5
5
 
6
- //#region node_modules/.pnpm/@vitest+runner@4.0.18/node_modules/@vitest/runner/dist/index.js
6
+ //#region node_modules/@vitest/runner/dist/index.js
7
7
  var PendingError = class extends Error {
8
8
  code = "VITEST_PENDING";
9
9
  taskId;
@@ -1,7 +1,7 @@
1
- import { format, plugins } from "../../../../../@vitest_pretty-format@4.0.18/node_modules/@vitest/pretty-format/dist/index.js";
2
- import { resolve } from "../../../../../pathe@2.0.3/node_modules/pathe/dist/shared/pathe.M-eThtNZ.js";
1
+ import { format, plugins } from "../../pretty-format/dist/index.js";
2
+ import { resolve } from "../../../pathe/dist/shared/pathe.M-eThtNZ.js";
3
3
 
4
- //#region node_modules/.pnpm/@vitest+snapshot@4.0.18/node_modules/@vitest/snapshot/dist/index.js
4
+ //#region node_modules/@vitest/snapshot/dist/index.js
5
5
  var comma = ",".charCodeAt(0);
6
6
  var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
7
7
  var intToChar = new Uint8Array(64);
@@ -420,7 +420,7 @@ function offsetToLineNumber(source, offset) {
420
420
  return line + 1;
421
421
  }
422
422
  async function saveInlineSnapshots(environment, snapshots) {
423
- const MagicString = (await import("../../../../../magic-string@0.30.21/node_modules/magic-string/dist/magic-string.es.js")).default;
423
+ const MagicString = (await import("../../../magic-string/dist/magic-string.es.js")).default;
424
424
  const files = new Set(snapshots.map((i) => i.file));
425
425
  await Promise.all(Array.from(files).map(async (file) => {
426
426
  const snaps = snapshots.filter((i) => i.file === file);
@@ -1,4 +1,4 @@
1
- //#region node_modules/.pnpm/@vitest+spy@4.0.18/node_modules/@vitest/spy/dist/index.js
1
+ //#region node_modules/@vitest/spy/dist/index.js
2
2
  function isMockFunction(fn$1) {
3
3
  return typeof fn$1 === "function" && "_isMockFunction" in fn$1 && fn$1._isMockFunction === true;
4
4
  }
@@ -1,4 +1,4 @@
1
- //#region node_modules/.pnpm/@vitest+utils@4.0.18/node_modules/@vitest/utils/dist/chunk-_commonjsHelpers.js
1
+ //#region node_modules/@vitest/utils/dist/chunk-_commonjsHelpers.js
2
2
  function getDefaultExportFromCjs(x) {
3
3
  return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
4
4
  }
@@ -1,4 +1,4 @@
1
- //#region node_modules/.pnpm/@vitest+utils@4.0.18/node_modules/@vitest/utils/dist/chunk-pathe.M-eThtNZ.js
1
+ //#region node_modules/@vitest/utils/dist/chunk-pathe.M-eThtNZ.js
2
2
  const _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//;
3
3
  function normalizeWindowsPath(input = "") {
4
4
  if (!input) return input;
@@ -1,10 +1,10 @@
1
- import { C } from "../../../../../tinyrainbow@3.0.3/node_modules/tinyrainbow/dist/index.js";
2
- import { format, plugins } from "../../../../../@vitest_pretty-format@4.0.18/node_modules/@vitest/pretty-format/dist/index.js";
1
+ import { C } from "../../../tinyrainbow/dist/index.js";
2
+ import { format, plugins } from "../../pretty-format/dist/index.js";
3
3
  import { stringify } from "./display.js";
4
4
  import { deepClone, getOwnProperties, getType } from "./helpers.js";
5
5
  import { getDefaultExportFromCjs } from "./chunk-_commonjsHelpers.js";
6
6
 
7
- //#region node_modules/.pnpm/@vitest+utils@4.0.18/node_modules/@vitest/utils/dist/diff.js
7
+ //#region node_modules/@vitest/utils/dist/diff.js
8
8
  /**
9
9
  * Diff Match and Patch
10
10
  * Copyright 2018 The diff-match-patch Authors.