@fangorn-network/sdk 0.1.0-dev → 0.1.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.
Files changed (96) hide show
  1. package/lib/cli/cli.js +328 -128
  2. package/lib/cli/index.d.ts +4 -1
  3. package/lib/cli/index.js +20 -2
  4. package/lib/config.d.ts +111 -48
  5. package/lib/config.js +39 -11
  6. package/lib/contracts/app-registry/abi.d.ts +1265 -0
  7. package/lib/contracts/app-registry/abi.js +1454 -0
  8. package/lib/contracts/app-registry/index.d.ts +161 -0
  9. package/lib/contracts/app-registry/index.js +274 -0
  10. package/lib/contracts/data-registry/abi.d.ts +19 -195
  11. package/lib/contracts/data-registry/abi.js +206 -409
  12. package/lib/contracts/data-registry/index.d.ts +2 -126
  13. package/lib/contracts/data-registry/index.js +1 -174
  14. package/lib/contracts/index.d.ts +7 -4
  15. package/lib/contracts/index.js +7 -4
  16. package/lib/contracts/logs.d.ts +1 -1
  17. package/lib/contracts/logs.js +1 -1
  18. package/lib/contracts/{settlement-registry → membership-registry}/abi.d.ts +636 -301
  19. package/lib/contracts/membership-registry/abi.js +1333 -0
  20. package/lib/contracts/membership-registry/index.d.ts +79 -0
  21. package/lib/contracts/membership-registry/index.js +104 -0
  22. package/lib/contracts/types.d.ts +10 -0
  23. package/lib/contracts/types.js +12 -0
  24. package/lib/crypto/aes.d.ts +2 -2
  25. package/lib/crypto/aes.js +4 -4
  26. package/lib/crypto/encryption.d.ts +109 -8
  27. package/lib/crypto/encryption.js +114 -16
  28. package/lib/engine/car.d.ts +1 -5
  29. package/lib/engine/car.js +2 -2
  30. package/lib/engine/index.d.ts +14 -33
  31. package/lib/engine/index.js +41 -98
  32. package/lib/engine/records.d.ts +8 -19
  33. package/lib/engine/records.js +7 -81
  34. package/lib/engine/test-helpers.d.ts +3 -2
  35. package/lib/engine/test-helpers.js +5 -7
  36. package/lib/erc8004.js +10 -7
  37. package/lib/fangorn.d.ts +86 -65
  38. package/lib/fangorn.js +153 -115
  39. package/lib/feed.d.ts +8 -7
  40. package/lib/feed.js +8 -7
  41. package/lib/harness/examples/hackmd/build-markdown-graph.d.ts +1 -0
  42. package/lib/harness/examples/hackmd/build-markdown-graph.js +17 -0
  43. package/lib/harness/index.d.ts +58 -0
  44. package/lib/harness/index.js +73 -0
  45. package/lib/index.d.ts +13 -10
  46. package/lib/index.js +13 -10
  47. package/lib/node_modules/{@jridgewell → .pnpm/@jridgewell_sourcemap-codec@1.5.5/node_modules/@jridgewell}/sourcemap-codec/dist/sourcemap-codec.js +1 -1
  48. package/lib/node_modules/{@vitest → .pnpm/@vitest_expect@4.0.18/node_modules/@vitest}/expect/dist/index.js +8 -8
  49. package/lib/node_modules/{@vitest → .pnpm/@vitest_pretty-format@4.0.18/node_modules/@vitest}/pretty-format/dist/index.js +2 -2
  50. package/lib/node_modules/{@vitest → .pnpm/@vitest_runner@4.0.18/node_modules/@vitest}/runner/dist/chunk-tasks.js +2 -2
  51. package/lib/node_modules/{@vitest → .pnpm/@vitest_runner@4.0.18/node_modules/@vitest}/runner/dist/index.js +4 -4
  52. package/lib/node_modules/{@vitest → .pnpm/@vitest_snapshot@4.0.18/node_modules/@vitest}/snapshot/dist/index.js +4 -4
  53. package/lib/node_modules/{@vitest → .pnpm/@vitest_spy@4.0.18/node_modules/@vitest}/spy/dist/index.js +1 -1
  54. package/lib/node_modules/{@vitest → .pnpm/@vitest_utils@4.0.18/node_modules/@vitest}/utils/dist/chunk-_commonjsHelpers.js +1 -1
  55. package/lib/node_modules/{@vitest → .pnpm/@vitest_utils@4.0.18/node_modules/@vitest}/utils/dist/chunk-pathe.M-eThtNZ.js +1 -1
  56. package/lib/node_modules/{@vitest → .pnpm/@vitest_utils@4.0.18/node_modules/@vitest}/utils/dist/diff.js +3 -3
  57. package/lib/node_modules/{@vitest → .pnpm/@vitest_utils@4.0.18/node_modules/@vitest}/utils/dist/display.js +2 -2
  58. package/lib/node_modules/{@vitest → .pnpm/@vitest_utils@4.0.18/node_modules/@vitest}/utils/dist/error.js +2 -2
  59. package/lib/node_modules/{@vitest → .pnpm/@vitest_utils@4.0.18/node_modules/@vitest}/utils/dist/helpers.js +1 -1
  60. package/lib/node_modules/{@vitest → .pnpm/@vitest_utils@4.0.18/node_modules/@vitest}/utils/dist/serialize.js +1 -1
  61. package/lib/node_modules/{@vitest → .pnpm/@vitest_utils@4.0.18/node_modules/@vitest}/utils/dist/source-map.js +1 -1
  62. package/lib/node_modules/{@vitest → .pnpm/@vitest_utils@4.0.18/node_modules/@vitest}/utils/dist/timers.js +1 -1
  63. package/lib/node_modules/{chai → .pnpm/chai@6.2.2/node_modules/chai}/index.js +1 -1
  64. package/lib/node_modules/{magic-string → .pnpm/magic-string@0.30.21/node_modules/magic-string}/dist/magic-string.es.js +2 -2
  65. package/lib/node_modules/{pathe → .pnpm/pathe@2.0.3/node_modules/pathe}/dist/shared/pathe.M-eThtNZ.js +1 -1
  66. package/lib/node_modules/{tinyrainbow → .pnpm/tinyrainbow@3.0.3/node_modules/tinyrainbow}/dist/index.js +1 -1
  67. package/lib/node_modules/{vitest → .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}/dist/chunks/_commonjsHelpers.D26ty3Ew.js +1 -1
  68. package/lib/node_modules/{vitest → .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}/dist/chunks/date.Bq6ZW5rf.js +1 -1
  69. package/lib/node_modules/{vitest → .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}/dist/chunks/utils.DvEY5TfP.js +2 -2
  70. package/lib/node_modules/{vitest → .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}/dist/chunks/vi.2VT5v0um.js +11 -11
  71. package/lib/providers/storage/signed-url.d.ts +10 -2
  72. package/lib/providers/storage/signed-url.js +15 -5
  73. package/lib/providers/storage/types.d.ts +1 -1
  74. package/lib/providers/storage/utils.js +3 -5
  75. package/lib/registry.d.ts +118 -0
  76. package/lib/registry.js +184 -0
  77. package/lib/test/mem-registry.d.ts +19 -14
  78. package/lib/test/mem-registry.js +37 -44
  79. package/lib/test/sdk-suite.d.ts +4 -1
  80. package/lib/test/sdk-suite.js +89 -18
  81. package/lib/test/testbed.d.ts +5227 -5218
  82. package/lib/test/testbed.js +56 -29
  83. package/lib/types/index.d.ts +11 -6
  84. package/package.json +1 -1
  85. package/lib/cli/sell.d.ts +0 -28
  86. package/lib/cli/sell.js +0 -95
  87. package/lib/cli/stage.d.ts +0 -19
  88. package/lib/cli/stage.js +0 -94
  89. package/lib/contracts/settlement-registry/abi.js +0 -962
  90. package/lib/contracts/settlement-registry/index.d.ts +0 -143
  91. package/lib/contracts/settlement-registry/index.js +0 -213
  92. package/lib/crypto/paid.d.ts +0 -104
  93. package/lib/crypto/paid.js +0 -147
  94. package/lib/test/key-server.d.ts +0 -12
  95. package/lib/test/key-server.js +0 -30
  96. /package/lib/node_modules/{@vitest → .pnpm/@vitest_runner@4.0.18/node_modules/@vitest}/runner/dist/utils.js +0 -0
@@ -7,26 +7,6 @@ declare const DATA_REGISTRY_ABI: readonly [{
7
7
  readonly type: "constructor";
8
8
  readonly inputs: readonly [];
9
9
  readonly stateMutability: "nonpayable";
10
- }, {
11
- readonly type: "function";
12
- readonly name: "EPOCH_SECONDS";
13
- readonly inputs: readonly [];
14
- readonly outputs: readonly [{
15
- readonly name: "";
16
- readonly type: "uint64";
17
- readonly internalType: "uint64";
18
- }];
19
- readonly stateMutability: "view";
20
- }, {
21
- readonly type: "function";
22
- readonly name: "UPDATE_TYPEHASH";
23
- readonly inputs: readonly [];
24
- readonly outputs: readonly [{
25
- readonly name: "";
26
- readonly type: "bytes32";
27
- readonly internalType: "bytes32";
28
- }];
29
- readonly stateMutability: "view";
30
10
  }, {
31
11
  readonly type: "function";
32
12
  readonly name: "UPGRADE_INTERFACE_VERSION";
@@ -37,16 +17,6 @@ declare const DATA_REGISTRY_ABI: readonly [{
37
17
  readonly internalType: "string";
38
18
  }];
39
19
  readonly stateMutability: "view";
40
- }, {
41
- readonly type: "function";
42
- readonly name: "WINDOW";
43
- readonly inputs: readonly [];
44
- readonly outputs: readonly [{
45
- readonly name: "";
46
- readonly type: "uint64";
47
- readonly internalType: "uint64";
48
- }];
49
- readonly stateMutability: "view";
50
20
  }, {
51
21
  readonly type: "function";
52
22
  readonly name: "admin";
@@ -59,52 +29,12 @@ declare const DATA_REGISTRY_ABI: readonly [{
59
29
  readonly stateMutability: "view";
60
30
  }, {
61
31
  readonly type: "function";
62
- readonly name: "commitHead";
63
- readonly inputs: readonly [{
64
- readonly name: "repo";
65
- readonly type: "string";
66
- readonly internalType: "string";
67
- }, {
68
- readonly name: "epoch";
69
- readonly type: "uint64";
70
- readonly internalType: "uint64";
71
- }, {
72
- readonly name: "parent";
73
- readonly type: "bytes32";
74
- readonly internalType: "bytes32";
75
- }, {
76
- readonly name: "root";
77
- readonly type: "bytes32";
78
- readonly internalType: "bytes32";
79
- }, {
80
- readonly name: "car";
81
- readonly type: "bytes";
82
- readonly internalType: "bytes";
83
- }];
84
- readonly outputs: readonly [{
85
- readonly name: "";
86
- readonly type: "bytes32";
87
- readonly internalType: "bytes32";
88
- }];
89
- readonly stateMutability: "pure";
90
- }, {
91
- readonly type: "function";
92
- readonly name: "currentEpoch";
93
- readonly inputs: readonly [];
94
- readonly outputs: readonly [{
95
- readonly name: "";
96
- readonly type: "uint64";
97
- readonly internalType: "uint64";
98
- }];
99
- readonly stateMutability: "view";
100
- }, {
101
- readonly type: "function";
102
- readonly name: "domainSeparator";
32
+ readonly name: "appRegistry";
103
33
  readonly inputs: readonly [];
104
34
  readonly outputs: readonly [{
105
35
  readonly name: "";
106
- readonly type: "bytes32";
107
- readonly internalType: "bytes32";
36
+ readonly type: "address";
37
+ readonly internalType: "address";
108
38
  }];
109
39
  readonly stateMutability: "view";
110
40
  }, {
@@ -136,43 +66,13 @@ declare const DATA_REGISTRY_ABI: readonly [{
136
66
  readonly name: "admin_";
137
67
  readonly type: "address";
138
68
  readonly internalType: "address";
69
+ }, {
70
+ readonly name: "appRegistry_";
71
+ readonly type: "address";
72
+ readonly internalType: "address";
139
73
  }];
140
74
  readonly outputs: readonly [];
141
75
  readonly stateMutability: "nonpayable";
142
- }, {
143
- readonly type: "function";
144
- readonly name: "logLength";
145
- readonly inputs: readonly [];
146
- readonly outputs: readonly [{
147
- readonly name: "";
148
- readonly type: "uint64";
149
- readonly internalType: "uint64";
150
- }];
151
- readonly stateMutability: "view";
152
- }, {
153
- readonly type: "function";
154
- readonly name: "logRoot";
155
- readonly inputs: readonly [];
156
- readonly outputs: readonly [{
157
- readonly name: "";
158
- readonly type: "bytes32";
159
- readonly internalType: "bytes32";
160
- }];
161
- readonly stateMutability: "view";
162
- }, {
163
- readonly type: "function";
164
- readonly name: "peaks";
165
- readonly inputs: readonly [{
166
- readonly name: "";
167
- readonly type: "uint256";
168
- readonly internalType: "uint256";
169
- }];
170
- readonly outputs: readonly [{
171
- readonly name: "";
172
- readonly type: "bytes32";
173
- readonly internalType: "bytes32";
174
- }];
175
- readonly stateMutability: "view";
176
76
  }, {
177
77
  readonly type: "function";
178
78
  readonly name: "proxiableUUID";
@@ -183,38 +83,6 @@ declare const DATA_REGISTRY_ABI: readonly [{
183
83
  readonly internalType: "bytes32";
184
84
  }];
185
85
  readonly stateMutability: "view";
186
- }, {
187
- readonly type: "function";
188
- readonly name: "repoCount";
189
- readonly inputs: readonly [{
190
- readonly name: "publisher";
191
- readonly type: "address";
192
- readonly internalType: "address";
193
- }];
194
- readonly outputs: readonly [{
195
- readonly name: "";
196
- readonly type: "uint256";
197
- readonly internalType: "uint256";
198
- }];
199
- readonly stateMutability: "view";
200
- }, {
201
- readonly type: "function";
202
- readonly name: "repoIds";
203
- readonly inputs: readonly [{
204
- readonly name: "";
205
- readonly type: "address";
206
- readonly internalType: "address";
207
- }, {
208
- readonly name: "";
209
- readonly type: "uint256";
210
- readonly internalType: "uint256";
211
- }];
212
- readonly outputs: readonly [{
213
- readonly name: "";
214
- readonly type: "bytes32";
215
- readonly internalType: "bytes32";
216
- }];
217
- readonly stateMutability: "view";
218
86
  }, {
219
87
  readonly type: "function";
220
88
  readonly name: "setAdmin";
@@ -227,71 +95,31 @@ declare const DATA_REGISTRY_ABI: readonly [{
227
95
  readonly stateMutability: "nonpayable";
228
96
  }, {
229
97
  readonly type: "function";
230
- readonly name: "update";
98
+ readonly name: "setAppRegistry";
231
99
  readonly inputs: readonly [{
232
- readonly name: "repo";
233
- readonly type: "string";
234
- readonly internalType: "string";
235
- }, {
236
- readonly name: "epoch";
237
- readonly type: "uint64";
238
- readonly internalType: "uint64";
239
- }, {
240
- readonly name: "parent";
241
- readonly type: "bytes32";
242
- readonly internalType: "bytes32";
243
- }, {
244
- readonly name: "root";
245
- readonly type: "bytes32";
246
- readonly internalType: "bytes32";
247
- }, {
248
- readonly name: "car";
249
- readonly type: "bytes";
250
- readonly internalType: "bytes";
251
- }];
252
- readonly outputs: readonly [{
253
- readonly name: "";
254
- readonly type: "bytes32";
255
- readonly internalType: "bytes32";
100
+ readonly name: "registry";
101
+ readonly type: "address";
102
+ readonly internalType: "address";
256
103
  }];
104
+ readonly outputs: readonly [];
257
105
  readonly stateMutability: "nonpayable";
258
106
  }, {
259
107
  readonly type: "function";
260
- readonly name: "updateBySig";
108
+ readonly name: "update";
261
109
  readonly inputs: readonly [{
262
- readonly name: "publisher";
263
- readonly type: "address";
264
- readonly internalType: "address";
265
- }, {
266
110
  readonly name: "repo";
267
111
  readonly type: "string";
268
112
  readonly internalType: "string";
269
- }, {
270
- readonly name: "epoch";
271
- readonly type: "uint64";
272
- readonly internalType: "uint64";
273
113
  }, {
274
114
  readonly name: "parent";
275
115
  readonly type: "bytes32";
276
116
  readonly internalType: "bytes32";
277
117
  }, {
278
- readonly name: "root";
279
- readonly type: "bytes32";
280
- readonly internalType: "bytes32";
281
- }, {
282
- readonly name: "car";
283
- readonly type: "bytes";
284
- readonly internalType: "bytes";
285
- }, {
286
- readonly name: "signature";
287
- readonly type: "bytes";
288
- readonly internalType: "bytes";
289
- }];
290
- readonly outputs: readonly [{
291
- readonly name: "";
118
+ readonly name: "head";
292
119
  readonly type: "bytes32";
293
120
  readonly internalType: "bytes32";
294
121
  }];
122
+ readonly outputs: readonly [];
295
123
  readonly stateMutability: "nonpayable";
296
124
  }, {
297
125
  readonly type: "function";
@@ -385,10 +213,6 @@ declare const DATA_REGISTRY_ABI: readonly [{
385
213
  readonly type: "address";
386
214
  readonly internalType: "address";
387
215
  }];
388
- }, {
389
- readonly type: "error";
390
- readonly name: "BadSignature";
391
- readonly inputs: readonly [];
392
216
  }, {
393
217
  readonly type: "error";
394
218
  readonly name: "ERC1967InvalidImplementation";
@@ -401,10 +225,6 @@ declare const DATA_REGISTRY_ABI: readonly [{
401
225
  readonly type: "error";
402
226
  readonly name: "ERC1967NonPayable";
403
227
  readonly inputs: readonly [];
404
- }, {
405
- readonly type: "error";
406
- readonly name: "EpochOutOfWindow";
407
- readonly inputs: readonly [];
408
228
  }, {
409
229
  readonly type: "error";
410
230
  readonly name: "FailedCall";
@@ -437,6 +257,10 @@ declare const DATA_REGISTRY_ABI: readonly [{
437
257
  readonly type: "error";
438
258
  readonly name: "Unauthorized";
439
259
  readonly inputs: readonly [];
260
+ }, {
261
+ readonly type: "error";
262
+ readonly name: "ZeroHead";
263
+ readonly inputs: readonly [];
440
264
  }];
441
265
  //#endregion
442
266
  export { DATA_REGISTRY_ABI };