@fangorn-network/sdk 2026.7.12 → 2026.7.14

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 (72) hide show
  1. package/README.md +104 -69
  2. package/lib/cli/cli.js +26 -19
  3. package/lib/cli/index.d.ts +13 -13
  4. package/lib/config.d.ts +93 -92
  5. package/lib/contracts/data-registry/abi.d.ts +207 -35
  6. package/lib/contracts/data-registry/index.js +4 -4
  7. package/lib/contracts/index.d.ts +3 -1
  8. package/lib/contracts/index.js +3 -1
  9. package/lib/contracts/settlement-registry/abi.d.ts +47 -0
  10. package/lib/contracts/settlement-registry/abi.js +48 -0
  11. package/lib/contracts/settlement-registry/index.d.ts +25 -0
  12. package/lib/contracts/settlement-registry/index.js +40 -0
  13. package/lib/crypto/aes.d.ts +1 -8
  14. package/lib/crypto/aes.js +2 -34
  15. package/lib/crypto/encryption.d.ts +112 -26
  16. package/lib/crypto/encryption.js +105 -21
  17. package/lib/engine/car.d.ts +10 -0
  18. package/lib/engine/car.js +37 -0
  19. package/lib/engine/graph.d.ts +70 -0
  20. package/lib/engine/graph.js +73 -0
  21. package/lib/engine/index.d.ts +109 -70
  22. package/lib/engine/index.js +296 -226
  23. package/lib/engine/test-helpers.d.ts +43 -0
  24. package/lib/engine/test-helpers.js +69 -0
  25. package/lib/fangorn.d.ts +28 -25
  26. package/lib/fangorn.js +118 -83
  27. package/lib/harness/index.d.ts +4 -3
  28. package/lib/harness/index.js +9 -3
  29. package/lib/index.d.ts +3 -3
  30. package/lib/index.js +2 -2
  31. package/lib/node_modules/{.pnpm/@noble_ciphers@1.3.0/node_modules/@noble → @noble}/ciphers/esm/_polyval.js +1 -1
  32. package/lib/node_modules/{.pnpm/@noble_ciphers@1.3.0/node_modules/@noble → @noble}/ciphers/esm/aes.js +1 -1
  33. package/lib/node_modules/{.pnpm/@noble_ciphers@1.3.0/node_modules/@noble → @noble}/ciphers/esm/utils.js +1 -1
  34. package/lib/node_modules/{.pnpm/@noble_curves@1.9.7/node_modules/@noble → @noble}/curves/esm/abstract/curve.js +1 -1
  35. package/lib/node_modules/{.pnpm/@noble_curves@1.9.7/node_modules/@noble → @noble}/curves/esm/abstract/edwards.js +1 -1
  36. package/lib/node_modules/{.pnpm/@noble_curves@1.9.7/node_modules/@noble → @noble}/curves/esm/abstract/modular.js +1 -1
  37. package/lib/node_modules/{.pnpm/@noble_curves@1.9.7/node_modules/@noble → @noble}/curves/esm/abstract/montgomery.js +1 -1
  38. package/lib/node_modules/{.pnpm/@noble_curves@1.9.7/node_modules/@noble → @noble}/curves/esm/ed25519.js +1 -1
  39. package/lib/node_modules/{.pnpm/@noble_curves@1.9.7/node_modules/@noble → @noble}/curves/esm/utils.js +1 -1
  40. package/lib/providers/storage/car.js +2 -1
  41. package/lib/providers/storage/pinata.d.ts +16 -9
  42. package/lib/providers/storage/pinata.js +34 -25
  43. package/lib/providers/storage/types.d.ts +18 -8
  44. package/lib/{roles/repo → repo}/index.d.ts +1 -1
  45. package/lib/{roles/repo → repo}/index.js +1 -1
  46. package/lib/test/testbed.d.ts +9 -7
  47. package/lib/test/testbed.js +3 -2
  48. package/package.json +3 -9
  49. package/lib/ crypto/constants.d.ts +0 -4
  50. package/lib/ crypto/constants.js +0 -5
  51. package/lib/ crypto/merkle.d.ts +0 -10
  52. package/lib/ crypto/merkle.js +0 -34
  53. package/lib/ crypto/utils.d.ts +0 -1
  54. package/lib/ crypto/utils.js +0 -1
  55. package/lib/builders/a2aCardBuilder.d.ts +0 -28
  56. package/lib/builders/a2aCardBuilder.js +0 -105
  57. package/lib/engine/blockstore.d.ts +0 -24
  58. package/lib/engine/blockstore.js +0 -85
  59. package/lib/roles/index.d.ts +0 -1
  60. package/lib/roles/index.js +0 -1
  61. package/lib/test/car_smoke.d.ts +0 -1
  62. package/lib/test/car_smoke.js +0 -81
  63. package/lib/test/cleanup-embeddings-testdata.d.ts +0 -1
  64. package/lib/test/cleanup-embeddings-testdata.js +0 -75
  65. package/lib/test/index.d.ts +0 -10
  66. package/lib/test/index.js +0 -27
  67. package/lib/test/setup-embeddings-testdata.d.ts +0 -11
  68. package/lib/test/setup-embeddings-testdata.js +0 -155
  69. package/lib/utils/index.d.ts +0 -11
  70. package/lib/utils/index.js +0 -29
  71. package/lib/utils/manifest.d.ts +0 -23
  72. package/lib/utils/manifest.js +0 -77
package/lib/config.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import * as viem_chains0 from "viem/chains";
2
- import * as viem0 from "viem";
2
+ import * as viem19 from "viem";
3
3
  import { Chain, Hex } from "viem";
4
+ import * as abitype0 from "abitype";
4
5
 
5
6
  //#region src/config.d.ts
6
7
  /**
@@ -42,17 +43,17 @@ declare const SupportedNetworks: {
42
43
  testnet: true;
43
44
  custom?: Record<string, unknown> | undefined;
44
45
  extendSchema?: Record<string, unknown> | undefined;
45
- fees?: viem0.ChainFees<undefined> | undefined;
46
+ fees?: viem19.ChainFees<undefined> | undefined;
46
47
  formatters?: undefined;
47
- prepareTransactionRequest?: ((args: viem0.PrepareTransactionRequestParameters, options: {
48
+ prepareTransactionRequest?: ((args: viem19.PrepareTransactionRequestParameters, options: {
48
49
  phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
49
- }) => Promise<viem0.PrepareTransactionRequestParameters>) | [fn: ((args: viem0.PrepareTransactionRequestParameters, options: {
50
+ }) => Promise<viem19.PrepareTransactionRequestParameters>) | [fn: ((args: viem19.PrepareTransactionRequestParameters, options: {
50
51
  phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
51
- }) => Promise<viem0.PrepareTransactionRequestParameters>) | undefined, options: {
52
+ }) => Promise<viem19.PrepareTransactionRequestParameters>) | undefined, options: {
52
53
  runAt: readonly ("beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters")[];
53
54
  }] | undefined;
54
- serializers?: viem0.ChainSerializers<undefined, viem0.TransactionSerializable> | undefined;
55
- verifyHash?: ((client: viem0.Client, parameters: viem0.VerifyHashActionParameters) => Promise<viem0.VerifyHashActionReturnType>) | undefined;
55
+ serializers?: viem19.ChainSerializers<undefined, viem19.TransactionSerializable> | undefined;
56
+ verifyHash?: ((client: viem19.Client, parameters: viem19.VerifyHashActionParameters) => Promise<viem19.VerifyHashActionReturnType>) | undefined;
56
57
  };
57
58
  };
58
59
  BaseSepolia: {
@@ -130,7 +131,7 @@ declare const SupportedNetworks: {
130
131
  testnet: true;
131
132
  custom?: Record<string, unknown> | undefined;
132
133
  extendSchema?: Record<string, unknown> | undefined;
133
- fees?: viem0.ChainFees<undefined> | undefined;
134
+ fees?: viem19.ChainFees<undefined> | undefined;
134
135
  formatters: {
135
136
  readonly block: {
136
137
  exclude: [] | undefined;
@@ -139,28 +140,28 @@ declare const SupportedNetworks: {
139
140
  blobGasUsed: bigint;
140
141
  difficulty: bigint;
141
142
  excessBlobGas: bigint;
142
- extraData: viem0.Hex;
143
+ extraData: viem19.Hex;
143
144
  gasLimit: bigint;
144
145
  gasUsed: bigint;
145
146
  hash: `0x${string}` | null;
146
147
  logsBloom: `0x${string}` | null;
147
- miner: viem0.Address;
148
- mixHash: viem0.Hash;
148
+ miner: abitype0.Address;
149
+ mixHash: viem19.Hash;
149
150
  nonce: `0x${string}` | null;
150
151
  number: bigint | null;
151
152
  parentBeaconBlockRoot?: `0x${string}` | undefined;
152
- parentHash: viem0.Hash;
153
- receiptsRoot: viem0.Hex;
154
- sealFields: viem0.Hex[];
155
- sha3Uncles: viem0.Hash;
153
+ parentHash: viem19.Hash;
154
+ receiptsRoot: viem19.Hex;
155
+ sealFields: viem19.Hex[];
156
+ sha3Uncles: viem19.Hash;
156
157
  size: bigint;
157
- stateRoot: viem0.Hash;
158
+ stateRoot: viem19.Hash;
158
159
  timestamp: bigint;
159
160
  totalDifficulty: bigint | null;
160
161
  transactions: `0x${string}`[] | viem_chains0.OpStackTransaction<boolean>[];
161
- transactionsRoot: viem0.Hash;
162
- uncles: viem0.Hash[];
163
- withdrawals?: viem0.Withdrawal[] | undefined | undefined;
162
+ transactionsRoot: viem19.Hash;
163
+ uncles: viem19.Hash[];
164
+ withdrawals?: viem19.Withdrawal[] | undefined | undefined;
164
165
  withdrawalsRoot?: `0x${string}` | undefined;
165
166
  } & {};
166
167
  type: "block";
@@ -170,16 +171,16 @@ declare const SupportedNetworks: {
170
171
  format: (args: viem_chains0.OpStackRpcTransaction, action?: string | undefined) => ({
171
172
  blockHash: `0x${string}` | null;
172
173
  blockNumber: bigint | null;
173
- from: viem0.Address;
174
+ from: abitype0.Address;
174
175
  gas: bigint;
175
- hash: viem0.Hash;
176
- input: viem0.Hex;
176
+ hash: viem19.Hash;
177
+ input: viem19.Hex;
177
178
  nonce: number;
178
- r: viem0.Hex;
179
- s: viem0.Hex;
180
- to: viem0.Address | null;
179
+ r: viem19.Hex;
180
+ s: viem19.Hex;
181
+ to: abitype0.Address | null;
181
182
  transactionIndex: number | null;
182
- typeHex: viem0.Hex | null;
183
+ typeHex: viem19.Hex | null;
183
184
  v: bigint;
184
185
  value: bigint;
185
186
  yParity: number;
@@ -189,23 +190,23 @@ declare const SupportedNetworks: {
189
190
  maxPriorityFeePerGas: bigint;
190
191
  isSystemTx?: boolean;
191
192
  mint?: bigint | undefined | undefined;
192
- sourceHash: viem0.Hex;
193
+ sourceHash: viem19.Hex;
193
194
  type: "deposit";
194
195
  } | {
195
- r: viem0.Hex;
196
- s: viem0.Hex;
196
+ r: viem19.Hex;
197
+ s: viem19.Hex;
197
198
  v: bigint;
198
- to: viem0.Address | null;
199
- from: viem0.Address;
199
+ to: abitype0.Address | null;
200
+ from: abitype0.Address;
200
201
  gas: bigint;
201
202
  nonce: number;
202
203
  value: bigint;
203
204
  blockHash: `0x${string}` | null;
204
205
  blockNumber: bigint | null;
205
- hash: viem0.Hash;
206
- input: viem0.Hex;
206
+ hash: viem19.Hash;
207
+ input: viem19.Hex;
207
208
  transactionIndex: number | null;
208
- typeHex: viem0.Hex | null;
209
+ typeHex: viem19.Hex | null;
209
210
  accessList?: undefined | undefined;
210
211
  authorizationList?: undefined | undefined;
211
212
  blobVersionedHashes?: undefined | undefined;
@@ -222,20 +223,20 @@ declare const SupportedNetworks: {
222
223
  } | {
223
224
  blockHash: `0x${string}` | null;
224
225
  blockNumber: bigint | null;
225
- from: viem0.Address;
226
+ from: abitype0.Address;
226
227
  gas: bigint;
227
- hash: viem0.Hash;
228
- input: viem0.Hex;
228
+ hash: viem19.Hash;
229
+ input: viem19.Hex;
229
230
  nonce: number;
230
- r: viem0.Hex;
231
- s: viem0.Hex;
232
- to: viem0.Address | null;
231
+ r: viem19.Hex;
232
+ s: viem19.Hex;
233
+ to: abitype0.Address | null;
233
234
  transactionIndex: number | null;
234
- typeHex: viem0.Hex | null;
235
+ typeHex: viem19.Hex | null;
235
236
  v: bigint;
236
237
  value: bigint;
237
238
  yParity: number;
238
- accessList: viem0.AccessList;
239
+ accessList: viem19.AccessList;
239
240
  authorizationList?: undefined | undefined;
240
241
  blobVersionedHashes?: undefined | undefined;
241
242
  chainId: number;
@@ -250,20 +251,20 @@ declare const SupportedNetworks: {
250
251
  } | {
251
252
  blockHash: `0x${string}` | null;
252
253
  blockNumber: bigint | null;
253
- from: viem0.Address;
254
+ from: abitype0.Address;
254
255
  gas: bigint;
255
- hash: viem0.Hash;
256
- input: viem0.Hex;
256
+ hash: viem19.Hash;
257
+ input: viem19.Hex;
257
258
  nonce: number;
258
- r: viem0.Hex;
259
- s: viem0.Hex;
260
- to: viem0.Address | null;
259
+ r: viem19.Hex;
260
+ s: viem19.Hex;
261
+ to: abitype0.Address | null;
261
262
  transactionIndex: number | null;
262
- typeHex: viem0.Hex | null;
263
+ typeHex: viem19.Hex | null;
263
264
  v: bigint;
264
265
  value: bigint;
265
266
  yParity: number;
266
- accessList: viem0.AccessList;
267
+ accessList: viem19.AccessList;
267
268
  authorizationList?: undefined | undefined;
268
269
  blobVersionedHashes?: undefined | undefined;
269
270
  chainId: number;
@@ -278,22 +279,22 @@ declare const SupportedNetworks: {
278
279
  } | {
279
280
  blockHash: `0x${string}` | null;
280
281
  blockNumber: bigint | null;
281
- from: viem0.Address;
282
+ from: abitype0.Address;
282
283
  gas: bigint;
283
- hash: viem0.Hash;
284
- input: viem0.Hex;
284
+ hash: viem19.Hash;
285
+ input: viem19.Hex;
285
286
  nonce: number;
286
- r: viem0.Hex;
287
- s: viem0.Hex;
288
- to: viem0.Address | null;
287
+ r: viem19.Hex;
288
+ s: viem19.Hex;
289
+ to: abitype0.Address | null;
289
290
  transactionIndex: number | null;
290
- typeHex: viem0.Hex | null;
291
+ typeHex: viem19.Hex | null;
291
292
  v: bigint;
292
293
  value: bigint;
293
294
  yParity: number;
294
- accessList: viem0.AccessList;
295
+ accessList: viem19.AccessList;
295
296
  authorizationList?: undefined | undefined;
296
- blobVersionedHashes: readonly viem0.Hex[];
297
+ blobVersionedHashes: readonly viem19.Hex[];
297
298
  chainId: number;
298
299
  type: "eip4844";
299
300
  gasPrice?: undefined | undefined;
@@ -306,21 +307,21 @@ declare const SupportedNetworks: {
306
307
  } | {
307
308
  blockHash: `0x${string}` | null;
308
309
  blockNumber: bigint | null;
309
- from: viem0.Address;
310
+ from: abitype0.Address;
310
311
  gas: bigint;
311
- hash: viem0.Hash;
312
- input: viem0.Hex;
312
+ hash: viem19.Hash;
313
+ input: viem19.Hex;
313
314
  nonce: number;
314
- r: viem0.Hex;
315
- s: viem0.Hex;
316
- to: viem0.Address | null;
315
+ r: viem19.Hex;
316
+ s: viem19.Hex;
317
+ to: abitype0.Address | null;
317
318
  transactionIndex: number | null;
318
- typeHex: viem0.Hex | null;
319
+ typeHex: viem19.Hex | null;
319
320
  v: bigint;
320
321
  value: bigint;
321
322
  yParity: number;
322
- accessList: viem0.AccessList;
323
- authorizationList: viem0.SignedAuthorizationList;
323
+ accessList: viem19.AccessList;
324
+ authorizationList: viem19.SignedAuthorizationList;
324
325
  blobVersionedHashes?: undefined | undefined;
325
326
  chainId: number;
326
327
  type: "eip7702";
@@ -339,22 +340,22 @@ declare const SupportedNetworks: {
339
340
  format: (args: viem_chains0.OpStackRpcTransactionReceipt, action?: string | undefined) => {
340
341
  blobGasPrice?: bigint | undefined;
341
342
  blobGasUsed?: bigint | undefined;
342
- blockHash: viem0.Hash;
343
+ blockHash: viem19.Hash;
343
344
  blockNumber: bigint;
344
345
  blockTimestamp?: bigint | undefined;
345
- contractAddress: viem0.Address | null | undefined;
346
+ contractAddress: abitype0.Address | null | undefined;
346
347
  cumulativeGasUsed: bigint;
347
348
  effectiveGasPrice: bigint;
348
- from: viem0.Address;
349
+ from: abitype0.Address;
349
350
  gasUsed: bigint;
350
- logs: viem0.Log<bigint, number, false>[];
351
- logsBloom: viem0.Hex;
351
+ logs: viem19.Log<bigint, number, false>[];
352
+ logsBloom: viem19.Hex;
352
353
  root?: `0x${string}` | undefined;
353
354
  status: "success" | "reverted";
354
- to: viem0.Address | null;
355
- transactionHash: viem0.Hash;
355
+ to: abitype0.Address | null;
356
+ transactionHash: viem19.Hash;
356
357
  transactionIndex: number;
357
- type: viem0.TransactionType;
358
+ type: viem19.TransactionType;
358
359
  l1GasPrice: bigint | null;
359
360
  l1GasUsed: bigint | null;
360
361
  l1Fee: bigint | null;
@@ -363,17 +364,17 @@ declare const SupportedNetworks: {
363
364
  type: "transactionReceipt";
364
365
  };
365
366
  };
366
- prepareTransactionRequest?: ((args: viem0.PrepareTransactionRequestParameters, options: {
367
+ prepareTransactionRequest?: ((args: viem19.PrepareTransactionRequestParameters, options: {
367
368
  phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
368
- }) => Promise<viem0.PrepareTransactionRequestParameters>) | [fn: ((args: viem0.PrepareTransactionRequestParameters, options: {
369
+ }) => Promise<viem19.PrepareTransactionRequestParameters>) | [fn: ((args: viem19.PrepareTransactionRequestParameters, options: {
369
370
  phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
370
- }) => Promise<viem0.PrepareTransactionRequestParameters>) | undefined, options: {
371
+ }) => Promise<viem19.PrepareTransactionRequestParameters>) | undefined, options: {
371
372
  runAt: readonly ("beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters")[];
372
373
  }] | undefined;
373
374
  serializers: {
374
375
  readonly transaction: typeof viem_chains0.serializeTransactionOpStack;
375
376
  };
376
- verifyHash?: ((client: viem0.Client, parameters: viem0.VerifyHashActionParameters) => Promise<viem0.VerifyHashActionReturnType>) | undefined;
377
+ verifyHash?: ((client: viem19.Client, parameters: viem19.VerifyHashActionParameters) => Promise<viem19.VerifyHashActionReturnType>) | undefined;
377
378
  readonly network: "base-sepolia";
378
379
  };
379
380
  };
@@ -416,17 +417,17 @@ declare function getNetwork(name: string): {
416
417
  testnet: true;
417
418
  custom?: Record<string, unknown> | undefined;
418
419
  extendSchema?: Record<string, unknown> | undefined;
419
- fees?: viem0.ChainFees<undefined> | undefined;
420
+ fees?: viem19.ChainFees<undefined> | undefined;
420
421
  formatters?: undefined;
421
- prepareTransactionRequest?: ((args: viem0.PrepareTransactionRequestParameters, options: {
422
+ prepareTransactionRequest?: ((args: viem19.PrepareTransactionRequestParameters, options: {
422
423
  phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
423
- }) => Promise<viem0.PrepareTransactionRequestParameters>) | [fn: ((args: viem0.PrepareTransactionRequestParameters, options: {
424
+ }) => Promise<viem19.PrepareTransactionRequestParameters>) | [fn: ((args: viem19.PrepareTransactionRequestParameters, options: {
424
425
  phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
425
- }) => Promise<viem0.PrepareTransactionRequestParameters>) | undefined, options: {
426
+ }) => Promise<viem19.PrepareTransactionRequestParameters>) | undefined, options: {
426
427
  runAt: readonly ("beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters")[];
427
428
  }] | undefined;
428
- serializers?: viem0.ChainSerializers<undefined, viem0.TransactionSerializable> | undefined;
429
- verifyHash?: ((client: viem0.Client, parameters: viem0.VerifyHashActionParameters) => Promise<viem0.VerifyHashActionReturnType>) | undefined;
429
+ serializers?: viem19.ChainSerializers<undefined, viem19.TransactionSerializable> | undefined;
430
+ verifyHash?: ((client: viem19.Client, parameters: viem19.VerifyHashActionParameters) => Promise<viem19.VerifyHashActionReturnType>) | undefined;
430
431
  };
431
432
  interface AppConfig {
432
433
  dataRegistryContractAddress: Hex;
@@ -470,17 +471,17 @@ declare const FangornConfig: {
470
471
  testnet: true;
471
472
  custom?: Record<string, unknown> | undefined;
472
473
  extendSchema?: Record<string, unknown> | undefined;
473
- fees?: viem0.ChainFees<undefined> | undefined;
474
+ fees?: viem19.ChainFees<undefined> | undefined;
474
475
  formatters?: undefined;
475
- prepareTransactionRequest?: ((args: viem0.PrepareTransactionRequestParameters, options: {
476
+ prepareTransactionRequest?: ((args: viem19.PrepareTransactionRequestParameters, options: {
476
477
  phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
477
- }) => Promise<viem0.PrepareTransactionRequestParameters>) | [fn: ((args: viem0.PrepareTransactionRequestParameters, options: {
478
+ }) => Promise<viem19.PrepareTransactionRequestParameters>) | [fn: ((args: viem19.PrepareTransactionRequestParameters, options: {
478
479
  phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
479
- }) => Promise<viem0.PrepareTransactionRequestParameters>) | undefined, options: {
480
+ }) => Promise<viem19.PrepareTransactionRequestParameters>) | undefined, options: {
480
481
  runAt: readonly ("beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters")[];
481
482
  }] | undefined;
482
- serializers?: viem0.ChainSerializers<undefined, viem0.TransactionSerializable> | undefined;
483
- verifyHash?: ((client: viem0.Client, parameters: viem0.VerifyHashActionParameters) => Promise<viem0.VerifyHashActionReturnType>) | undefined;
483
+ serializers?: viem19.ChainSerializers<undefined, viem19.TransactionSerializable> | undefined;
484
+ verifyHash?: ((client: viem19.Client, parameters: viem19.VerifyHashActionParameters) => Promise<viem19.VerifyHashActionReturnType>) | undefined;
484
485
  };
485
486
  rpcUrl: string;
486
487
  caip2: number;
@@ -1,38 +1,210 @@
1
1
  //#region src/contracts/data-registry/abi.d.ts
2
- declare const DATA_REGISTRY_ABI: ({
3
- inputs: never[];
4
- name: string;
5
- type: string;
6
- anonymous?: undefined;
7
- outputs?: undefined;
8
- stateMutability?: undefined;
9
- } | {
10
- anonymous: boolean;
11
- inputs: {
12
- indexed: boolean;
13
- internalType: string;
14
- name: string;
15
- type: string;
16
- }[];
17
- name: string;
18
- type: string;
19
- outputs?: undefined;
20
- stateMutability?: undefined;
21
- } | {
22
- inputs: {
23
- internalType: string;
24
- name: string;
25
- type: string;
26
- }[];
27
- name: string;
28
- outputs: {
29
- internalType: string;
30
- name: string;
31
- type: string;
32
- }[];
33
- stateMutability: string;
34
- type: string;
35
- anonymous?: undefined;
36
- })[];
2
+ declare const DATA_REGISTRY_ABI: readonly [{
3
+ readonly inputs: readonly [];
4
+ readonly name: "AlreadyRegistered";
5
+ readonly type: "error";
6
+ }, {
7
+ readonly inputs: readonly [];
8
+ readonly name: "NotRegistered";
9
+ readonly type: "error";
10
+ }, {
11
+ readonly inputs: readonly [];
12
+ readonly name: "PublisherSuspendedErr";
13
+ readonly type: "error";
14
+ }, {
15
+ readonly inputs: readonly [];
16
+ readonly name: "RegistrationFeeRequired";
17
+ readonly type: "error";
18
+ }, {
19
+ readonly inputs: readonly [];
20
+ readonly name: "StaleStateRoot";
21
+ readonly type: "error";
22
+ }, {
23
+ readonly inputs: readonly [];
24
+ readonly name: "Unauthorized";
25
+ readonly type: "error";
26
+ }, {
27
+ readonly anonymous: false;
28
+ readonly inputs: readonly [{
29
+ readonly indexed: true;
30
+ readonly internalType: "address";
31
+ readonly name: "publisher";
32
+ readonly type: "address";
33
+ }, {
34
+ readonly indexed: false;
35
+ readonly internalType: "bytes32";
36
+ readonly name: "initial_root";
37
+ readonly type: "bytes32";
38
+ }];
39
+ readonly name: "PublisherRegistered";
40
+ readonly type: "event";
41
+ }, {
42
+ readonly anonymous: false;
43
+ readonly inputs: readonly [{
44
+ readonly indexed: true;
45
+ readonly internalType: "address";
46
+ readonly name: "publisher";
47
+ readonly type: "address";
48
+ }, {
49
+ readonly indexed: false;
50
+ readonly internalType: "bytes32";
51
+ readonly name: "current_root";
52
+ readonly type: "bytes32";
53
+ }];
54
+ readonly name: "PublisherReactivated";
55
+ readonly type: "event";
56
+ }, {
57
+ readonly anonymous: false;
58
+ readonly inputs: readonly [{
59
+ readonly indexed: true;
60
+ readonly internalType: "address";
61
+ readonly name: "publisher";
62
+ readonly type: "address";
63
+ }];
64
+ readonly name: "PublisherSuspended";
65
+ readonly type: "event";
66
+ }, {
67
+ readonly anonymous: false;
68
+ readonly inputs: readonly [{
69
+ readonly indexed: false;
70
+ readonly internalType: "uint256";
71
+ readonly name: "fee";
72
+ readonly type: "uint256";
73
+ }];
74
+ readonly name: "RegistrationFeeChanged";
75
+ readonly type: "event";
76
+ }, {
77
+ readonly anonymous: false;
78
+ readonly inputs: readonly [{
79
+ readonly indexed: true;
80
+ readonly internalType: "address";
81
+ readonly name: "publisher";
82
+ readonly type: "address";
83
+ }, {
84
+ readonly indexed: true;
85
+ readonly internalType: "bytes32";
86
+ readonly name: "old_root";
87
+ readonly type: "bytes32";
88
+ }, {
89
+ readonly indexed: true;
90
+ readonly internalType: "bytes32";
91
+ readonly name: "new_root";
92
+ readonly type: "bytes32";
93
+ }];
94
+ readonly name: "StateCommitted";
95
+ readonly type: "event";
96
+ }, {
97
+ readonly inputs: readonly [];
98
+ readonly name: "admin";
99
+ readonly outputs: readonly [{
100
+ readonly internalType: "address";
101
+ readonly name: "";
102
+ readonly type: "address";
103
+ }];
104
+ readonly stateMutability: "view";
105
+ readonly type: "function";
106
+ }, {
107
+ readonly inputs: readonly [{
108
+ readonly internalType: "bytes32";
109
+ readonly name: "old_root";
110
+ readonly type: "bytes32";
111
+ }, {
112
+ readonly internalType: "bytes32";
113
+ readonly name: "new_root";
114
+ readonly type: "bytes32";
115
+ }];
116
+ readonly name: "commitStateRoot";
117
+ readonly outputs: readonly [];
118
+ readonly stateMutability: "nonpayable";
119
+ readonly type: "function";
120
+ }, {
121
+ readonly inputs: readonly [{
122
+ readonly internalType: "address";
123
+ readonly name: "publisher";
124
+ readonly type: "address";
125
+ }];
126
+ readonly name: "getNamespaceHead";
127
+ readonly outputs: readonly [{
128
+ readonly internalType: "bytes32";
129
+ readonly name: "";
130
+ readonly type: "bytes32";
131
+ }];
132
+ readonly stateMutability: "view";
133
+ readonly type: "function";
134
+ }, {
135
+ readonly inputs: readonly [{
136
+ readonly internalType: "address";
137
+ readonly name: "publisher";
138
+ readonly type: "address";
139
+ }];
140
+ readonly name: "getPublisherStatus";
141
+ readonly outputs: readonly [{
142
+ readonly internalType: "uint8";
143
+ readonly name: "";
144
+ readonly type: "uint8";
145
+ }];
146
+ readonly stateMutability: "view";
147
+ readonly type: "function";
148
+ }, {
149
+ readonly inputs: readonly [{
150
+ readonly internalType: "address";
151
+ readonly name: "publisher";
152
+ readonly type: "address";
153
+ }];
154
+ readonly name: "isRegistered";
155
+ readonly outputs: readonly [{
156
+ readonly internalType: "bool";
157
+ readonly name: "";
158
+ readonly type: "bool";
159
+ }];
160
+ readonly stateMutability: "view";
161
+ readonly type: "function";
162
+ }, {
163
+ readonly inputs: readonly [];
164
+ readonly name: "publisherCount";
165
+ readonly outputs: readonly [{
166
+ readonly internalType: "uint64";
167
+ readonly name: "";
168
+ readonly type: "uint64";
169
+ }];
170
+ readonly stateMutability: "view";
171
+ readonly type: "function";
172
+ }, {
173
+ readonly inputs: readonly [];
174
+ readonly name: "register";
175
+ readonly outputs: readonly [];
176
+ readonly stateMutability: "payable";
177
+ readonly type: "function";
178
+ }, {
179
+ readonly inputs: readonly [];
180
+ readonly name: "registrationFee";
181
+ readonly outputs: readonly [{
182
+ readonly internalType: "uint256";
183
+ readonly name: "";
184
+ readonly type: "uint256";
185
+ }];
186
+ readonly stateMutability: "view";
187
+ readonly type: "function";
188
+ }, {
189
+ readonly inputs: readonly [{
190
+ readonly internalType: "uint256";
191
+ readonly name: "fee";
192
+ readonly type: "uint256";
193
+ }];
194
+ readonly name: "setRegistrationFee";
195
+ readonly outputs: readonly [];
196
+ readonly stateMutability: "nonpayable";
197
+ readonly type: "function";
198
+ }, {
199
+ readonly inputs: readonly [{
200
+ readonly internalType: "address";
201
+ readonly name: "publisher";
202
+ readonly type: "address";
203
+ }];
204
+ readonly name: "suspendPublisher";
205
+ readonly outputs: readonly [];
206
+ readonly stateMutability: "nonpayable";
207
+ readonly type: "function";
208
+ }];
37
209
  //#endregion
38
210
  export { DATA_REGISTRY_ABI };
@@ -8,11 +8,12 @@ let PublisherStatus = /* @__PURE__ */ function(PublisherStatus$1) {
8
8
  return PublisherStatus$1;
9
9
  }({});
10
10
  function decodeStateCommitted(log) {
11
+ if (log.args.old_root === void 0 || log.args.new_root === void 0) throw new Error("Malformed log event: missing state roots");
11
12
  return {
12
13
  oldRoot: log.args.old_root,
13
14
  newRoot: log.args.new_root,
14
15
  blockNumber: log.blockNumber,
15
- logId: `${log.transactionHash}:${String(log.logIndex)}`
16
+ logId: `${log.transactionHash}:${log.logIndex.toString()}`
16
17
  };
17
18
  }
18
19
  var DataRegistryClient = class {
@@ -52,7 +53,7 @@ var DataRegistryClient = class {
52
53
  chain,
53
54
  account,
54
55
  gas: gas * 130n / 100n,
55
- maxFeePerGas: (fees.maxFeePerGas ?? 0n) * 3n,
56
+ maxFeePerGas: fees.maxFeePerGas * 3n,
56
57
  maxPriorityFeePerGas: fees.maxPriorityFeePerGas,
57
58
  value
58
59
  });
@@ -89,13 +90,12 @@ var DataRegistryClient = class {
89
90
  * Reads the explicit enum lifecycle state from the registry status machine.
90
91
  */
91
92
  async getPublisherStatus(publisher) {
92
- const status = await this.publicClient.readContract({
93
+ return await this.publicClient.readContract({
93
94
  address: this.contractAddress,
94
95
  abi: DATA_REGISTRY_ABI,
95
96
  functionName: "getPublisherStatus",
96
97
  args: [publisher]
97
98
  });
98
- return Number(status);
99
99
  }
100
100
  /**
101
101
  * Helper boolean view returning true if a publisher can currently commit data.
@@ -1,3 +1,5 @@
1
1
  import { DATA_REGISTRY_ABI } from "./data-registry/abi.js";
2
2
  import { DataRegistryClient, PublisherStatus, StateCommittedLog } from "./data-registry/index.js";
3
- export { DATA_REGISTRY_ABI, DataRegistryClient, PublisherStatus, StateCommittedLog };
3
+ import { SettlementRegistryClient } from "./settlement-registry/index.js";
4
+ import { SETTLEMENT_REGISTRY_ABI } from "./settlement-registry/abi.js";
5
+ export { DATA_REGISTRY_ABI, DataRegistryClient, PublisherStatus, SETTLEMENT_REGISTRY_ABI, SettlementRegistryClient, StateCommittedLog };
@@ -1,4 +1,6 @@
1
1
  import { DATA_REGISTRY_ABI } from "./data-registry/abi.js";
2
2
  import { DataRegistryClient, PublisherStatus } from "./data-registry/index.js";
3
+ import { SETTLEMENT_REGISTRY_ABI } from "./settlement-registry/abi.js";
4
+ import { SettlementRegistryClient } from "./settlement-registry/index.js";
3
5
 
4
- export { DATA_REGISTRY_ABI, DataRegistryClient, PublisherStatus };
6
+ export { DATA_REGISTRY_ABI, DataRegistryClient, PublisherStatus, SETTLEMENT_REGISTRY_ABI, SettlementRegistryClient };