@fangorn-network/sdk 2026.8.18-dev → 2026.9.22-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.
package/README.md CHANGED
@@ -1,8 +1,8 @@
1
1
  # Fangorn SDK
2
2
 
3
- The Fangorn SDK is git for graphs, enabling version control and distribution of *metagraphs* organized into applications and namespaces.
3
+ The Fangorn SDK is a lightweight "git for knowledge graphs" protocol, enabling version control and distribution of *metagraphs* organized into applications and namespaces.
4
4
 
5
- It lets you treat IPFS as a hierarchical data store for your app-level storage with enforced terms, conditions, and validation logic for publishers. Data is published under a *namespace* in a *registered application*, **`app : publisher : namespace`**. Each namespace has its own on-chain state root (the digest of a commit block wrapping a native IPLD DAG) owned by the *publisher* who passed the app's validation logic. Updating a namespace root is a compare-and-swap operation (i.e. a git ref update).
5
+ It lets you treat IPFS as a hierarchical data store for app-level storage with published "terms", conditions, and validation logic that publishers must adhere to. Data is published under a *namespace* in a *registered application*, **`app : publisher : namespace`**. Each namespace has its own on-chain state root (the digest of a commit block wrapping a native IPLD DAG) owned by the *publisher* who passed the app's validation logic. Updating a namespace root is a compare-and-swap operation (i.e. a git ref update).
6
6
 
7
7
  Each namespace's state is represented by a **metagraph**, $G = (V, E, L)$ where $V$=**vertices** (a JSON payload tagged by a free-form schema id) and $E$=**edges** (a labeled relation between two vertices, as native IPLD links), $L$=**labels** (the allowed labels in any edge).
8
8
 
@@ -21,7 +21,7 @@ Metagraphs are stored in IPFS. The SDK currently expects Pinata to be used to en
21
21
 
22
22
  #### What it is not
23
23
 
24
- This is not a graph database, there is no query langauge here, and there is no native indexer.
24
+ This is not a graph database. There is no query langauge here and there is no native indexer.
25
25
 
26
26
 
27
27
  ## Supported Networks
package/lib/cli/cli.js CHANGED
@@ -352,6 +352,64 @@ appCmd.command("fee").description("Set what joining your app costs, in wei (owne
352
352
  process.exit(1);
353
353
  }
354
354
  });
355
+ const ERC8004_ARBITRUM_SEPOLIA = {
356
+ IDENTITY: "0x8004A818BFB912233c491871b3d84c89A494BD9e",
357
+ REPUTATION: "0x8004B663056A597Dffe9eCcC1965A193B7388713"
358
+ };
359
+ const ERC8004_SUBGRAPH = "https://api.studio.thegraph.com/query/1742225/erc-8004-arbitrum-sepolia/version/latest";
360
+ appCmd.command("agent").description("Register this app's gateway as an ERC-8004 agent and point the app at its card (owner only)").argument("[cardUrl]", "The agent card URL; defaults to the configured access worker's /.well-known/agent-card.json").option("--mcp <url>", "An MCP endpoint to index alongside the card").option("--skip-register", "Only set agent_uri on-chain — for a gateway already registered with ERC-8004").action(async (cardUrl, opts) => {
361
+ try {
362
+ const cfg = loadConfig();
363
+ const url = cardUrl ?? (cfg.accessWorkerUrl ? `${cfg.accessWorkerUrl.replace(/\/$/, "")}/.well-known/agent-card.json` : void 0);
364
+ if (!url) throw new Error("No card URL. Pass one, or set an access worker URL with `fangorn init`.");
365
+ const s = spinner();
366
+ s.start(`Reading ${url}`);
367
+ const res = await fetch(url);
368
+ if (!res.ok) {
369
+ s.stop();
370
+ throw new Error(`card at ${url} returned ${String(res.status)}`);
371
+ }
372
+ const card = await res.json();
373
+ s.stop(`Card: ${card.name ?? "(unnamed)"}`);
374
+ if (!card.name || !card.description) throw new Error("card is missing `name` or `description`");
375
+ let agentId;
376
+ if (!opts.skipRegister) {
377
+ if (!cfg.pinataJwt) throw new Error("ERC-8004 registration pins the registration file to IPFS — set PINATA_JWT, or pass --skip-register.");
378
+ const { SDK } = await import("agent0-sdk");
379
+ const agent = new SDK({
380
+ chainId: cfg.cfg.caip2,
381
+ rpcUrl: cfg.cfg.rpcUrl,
382
+ subgraphUrl: ERC8004_SUBGRAPH,
383
+ registryOverrides: { [cfg.cfg.caip2]: ERC8004_ARBITRUM_SEPOLIA },
384
+ subgraphOverrides: { [cfg.cfg.caip2]: ERC8004_SUBGRAPH },
385
+ ipfs: "pinata",
386
+ pinataJwt: cfg.pinataJwt,
387
+ privateKey: cfg.privateKey
388
+ }).createAgent(card.name, card.description);
389
+ s.start("Indexing skills and capabilities from the card");
390
+ await agent.setA2A(url);
391
+ if (opts.mcp) await agent.setMCP(opts.mcp);
392
+ s.stop();
393
+ agent.setTrust(true, false, false);
394
+ agent.setX402Support(card.skills?.some((sk) => sk.tags?.includes("x402")) ?? false);
395
+ agent.setActive(true);
396
+ s.start("Registering with the ERC-8004 identity registry");
397
+ const { result } = await (await agent.registerIPFS()).waitConfirmed();
398
+ s.stop();
399
+ agentId = String(result.agentId);
400
+ }
401
+ s.start("Pointing the app at its card");
402
+ const txHash = await getFangorn().getAppRegistry().setAppAgentUri(url);
403
+ s.stop();
404
+ if (agentId) console.log(`Agent ID: ${agentId}`);
405
+ console.log(`Card: ${url}`);
406
+ console.log(`Tx: ${txHash}`);
407
+ process.exit(0);
408
+ } catch (err) {
409
+ console.error("Failed:", err.message);
410
+ process.exit(1);
411
+ }
412
+ });
355
413
  appCmd.command("suspend").description("Eject a publisher from your app (owner only)").argument("<publisher>", "Publisher address").action(async (publisher) => {
356
414
  try {
357
415
  const s = spinner();
@@ -1,5 +1,5 @@
1
1
  import "./cli.js";
2
- import * as viem89 from "viem";
2
+ import * as viem0 from "viem";
3
3
 
4
4
  //#region src/cli/index.d.ts
5
5
  declare const getChain: (chainStr: string) => {
@@ -35,17 +35,17 @@ declare const getChain: (chainStr: string) => {
35
35
  testnet: true;
36
36
  custom?: Record<string, unknown> | undefined;
37
37
  extendSchema?: Record<string, unknown> | undefined;
38
- fees?: viem89.ChainFees<undefined> | undefined;
38
+ fees?: viem0.ChainFees<undefined> | undefined;
39
39
  formatters?: undefined;
40
- prepareTransactionRequest?: ((args: viem89.PrepareTransactionRequestParameters, options: {
40
+ prepareTransactionRequest?: ((args: viem0.PrepareTransactionRequestParameters, options: {
41
41
  phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
42
- }) => Promise<viem89.PrepareTransactionRequestParameters>) | [fn: ((args: viem89.PrepareTransactionRequestParameters, options: {
42
+ }) => Promise<viem0.PrepareTransactionRequestParameters>) | [fn: ((args: viem0.PrepareTransactionRequestParameters, options: {
43
43
  phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
44
- }) => Promise<viem89.PrepareTransactionRequestParameters>) | undefined, options: {
44
+ }) => Promise<viem0.PrepareTransactionRequestParameters>) | undefined, options: {
45
45
  runAt: readonly ("beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters")[];
46
46
  }] | undefined;
47
- serializers?: viem89.ChainSerializers<undefined, viem89.TransactionSerializable> | undefined;
48
- verifyHash?: ((client: viem89.Client, parameters: viem89.VerifyHashActionParameters) => Promise<viem89.VerifyHashActionReturnType>) | undefined;
47
+ serializers?: viem0.ChainSerializers<undefined, viem0.TransactionSerializable> | undefined;
48
+ verifyHash?: ((client: viem0.Client, parameters: viem0.VerifyHashActionParameters) => Promise<viem0.VerifyHashActionReturnType>) | undefined;
49
49
  };
50
50
  declare const handleCancel: (value: unknown) => void;
51
51
  declare const selectChain: () => Promise<{
@@ -81,17 +81,17 @@ declare const selectChain: () => Promise<{
81
81
  testnet: true;
82
82
  custom?: Record<string, unknown> | undefined;
83
83
  extendSchema?: Record<string, unknown> | undefined;
84
- fees?: viem89.ChainFees<undefined> | undefined;
84
+ fees?: viem0.ChainFees<undefined> | undefined;
85
85
  formatters?: undefined;
86
- prepareTransactionRequest?: ((args: viem89.PrepareTransactionRequestParameters, options: {
86
+ prepareTransactionRequest?: ((args: viem0.PrepareTransactionRequestParameters, options: {
87
87
  phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
88
- }) => Promise<viem89.PrepareTransactionRequestParameters>) | [fn: ((args: viem89.PrepareTransactionRequestParameters, options: {
88
+ }) => Promise<viem0.PrepareTransactionRequestParameters>) | [fn: ((args: viem0.PrepareTransactionRequestParameters, options: {
89
89
  phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
90
- }) => Promise<viem89.PrepareTransactionRequestParameters>) | undefined, options: {
90
+ }) => Promise<viem0.PrepareTransactionRequestParameters>) | undefined, options: {
91
91
  runAt: readonly ("beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters")[];
92
92
  }] | undefined;
93
- serializers?: viem89.ChainSerializers<undefined, viem89.TransactionSerializable> | undefined;
94
- verifyHash?: ((client: viem89.Client, parameters: viem89.VerifyHashActionParameters) => Promise<viem89.VerifyHashActionReturnType>) | undefined;
93
+ serializers?: viem0.ChainSerializers<undefined, viem0.TransactionSerializable> | undefined;
94
+ verifyHash?: ((client: viem0.Client, parameters: viem0.VerifyHashActionParameters) => Promise<viem0.VerifyHashActionReturnType>) | undefined;
95
95
  }>;
96
96
  declare function parseGadgetArg(raw: string): {
97
97
  type: string;
package/lib/config.d.ts CHANGED
@@ -1,18 +1,15 @@
1
- import * as viem0 from "viem";
1
+ import * as viem19 from "viem";
2
2
  import { Chain, Hex } from "viem";
3
- import * as viem_chains0 from "viem/chains";
4
- import * as abitype0 from "abitype";
5
3
 
6
4
  //#region src/config.d.ts
7
5
  /**
8
6
  * Derive an app id from a human-readable name (keccak256(hex(name)).
9
- * Apps are claim one of these on-chain with `AppRegistry.registerApp`
10
7
  */
11
8
  declare function appId(name: string): Hex;
12
9
  declare const DEFAULT_APP = "fangorn";
13
10
  declare function toAppId(nameOrId: string): Hex;
14
11
  /**
15
- * The networks supproted by Fangorn currently
12
+ * The networks supported by Fangorn currently
16
13
  */
17
14
  declare const SupportedNetworks: {
18
15
  ArbitrumSepolia: {
@@ -50,339 +47,17 @@ declare const SupportedNetworks: {
50
47
  testnet: true;
51
48
  custom?: Record<string, unknown> | undefined;
52
49
  extendSchema?: Record<string, unknown> | undefined;
53
- fees?: viem0.ChainFees<undefined> | undefined;
50
+ fees?: viem19.ChainFees<undefined> | undefined;
54
51
  formatters?: undefined;
55
- prepareTransactionRequest?: ((args: viem0.PrepareTransactionRequestParameters, options: {
52
+ prepareTransactionRequest?: ((args: viem19.PrepareTransactionRequestParameters, options: {
56
53
  phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
57
- }) => Promise<viem0.PrepareTransactionRequestParameters>) | [fn: ((args: viem0.PrepareTransactionRequestParameters, options: {
54
+ }) => Promise<viem19.PrepareTransactionRequestParameters>) | [fn: ((args: viem19.PrepareTransactionRequestParameters, options: {
58
55
  phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
59
- }) => Promise<viem0.PrepareTransactionRequestParameters>) | undefined, options: {
56
+ }) => Promise<viem19.PrepareTransactionRequestParameters>) | undefined, options: {
60
57
  runAt: readonly ("beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters")[];
61
58
  }] | undefined;
62
- serializers?: viem0.ChainSerializers<undefined, viem0.TransactionSerializable> | undefined;
63
- verifyHash?: ((client: viem0.Client, parameters: viem0.VerifyHashActionParameters) => Promise<viem0.VerifyHashActionReturnType>) | undefined;
64
- };
65
- };
66
- BaseSepolia: {
67
- name: string;
68
- chain: {
69
- blockExplorers: {
70
- readonly default: {
71
- readonly name: "Basescan";
72
- readonly url: "https://sepolia.basescan.org";
73
- readonly apiUrl: "https://api-sepolia.basescan.org/api";
74
- };
75
- };
76
- blockTime: 2000;
77
- contracts: {
78
- readonly disputeGameFactory: {
79
- readonly 11155111: {
80
- readonly address: "0xd6E6dBf4F7EA0ac412fD8b65ED297e64BB7a06E1";
81
- };
82
- };
83
- readonly l2OutputOracle: {
84
- readonly 11155111: {
85
- readonly address: "0x84457ca9D0163FbC4bbfe4Dfbb20ba46e48DF254";
86
- };
87
- };
88
- readonly portal: {
89
- readonly 11155111: {
90
- readonly address: "0x49f53e41452c74589e85ca1677426ba426459e85";
91
- readonly blockCreated: 4446677;
92
- };
93
- };
94
- readonly l1StandardBridge: {
95
- readonly 11155111: {
96
- readonly address: "0xfd0Bf71F60660E2f608ed56e1659C450eB113120";
97
- readonly blockCreated: 4446677;
98
- };
99
- };
100
- readonly multicall3: {
101
- readonly address: "0xca11bde05977b3631167028862be2a173976ca11";
102
- readonly blockCreated: 1059647;
103
- };
104
- readonly gasPriceOracle: {
105
- readonly address: "0x420000000000000000000000000000000000000F";
106
- };
107
- readonly l1Block: {
108
- readonly address: "0x4200000000000000000000000000000000000015";
109
- };
110
- readonly l2CrossDomainMessenger: {
111
- readonly address: "0x4200000000000000000000000000000000000007";
112
- };
113
- readonly l2Erc721Bridge: {
114
- readonly address: "0x4200000000000000000000000000000000000014";
115
- };
116
- readonly l2StandardBridge: {
117
- readonly address: "0x4200000000000000000000000000000000000010";
118
- };
119
- readonly l2ToL1MessagePasser: {
120
- readonly address: "0x4200000000000000000000000000000000000016";
121
- };
122
- };
123
- ensTlds?: readonly string[] | undefined;
124
- id: 84532;
125
- name: "Base Sepolia";
126
- nativeCurrency: {
127
- readonly name: "Sepolia Ether";
128
- readonly symbol: "ETH";
129
- readonly decimals: 18;
130
- };
131
- experimental_preconfirmationTime?: number | undefined | undefined;
132
- rpcUrls: {
133
- readonly default: {
134
- readonly http: readonly ["https://sepolia.base.org"];
135
- };
136
- };
137
- sourceId: 11155111;
138
- testnet: true;
139
- custom?: Record<string, unknown> | undefined;
140
- extendSchema?: Record<string, unknown> | undefined;
141
- fees?: viem0.ChainFees<undefined> | undefined;
142
- formatters: {
143
- readonly block: {
144
- exclude: [] | undefined;
145
- format: (args: viem_chains0.OpStackRpcBlock, action?: string | undefined) => {
146
- baseFeePerGas: bigint | null;
147
- blobGasUsed: bigint;
148
- difficulty: bigint;
149
- excessBlobGas: bigint;
150
- extraData: viem0.Hex;
151
- gasLimit: bigint;
152
- gasUsed: bigint;
153
- hash: `0x${string}` | null;
154
- logsBloom: `0x${string}` | null;
155
- miner: abitype0.Address;
156
- mixHash: viem0.Hash;
157
- nonce: `0x${string}` | null;
158
- number: bigint | null;
159
- parentBeaconBlockRoot?: `0x${string}` | undefined;
160
- parentHash: viem0.Hash;
161
- receiptsRoot: viem0.Hex;
162
- sealFields: viem0.Hex[];
163
- sha3Uncles: viem0.Hash;
164
- size: bigint;
165
- stateRoot: viem0.Hash;
166
- timestamp: bigint;
167
- totalDifficulty: bigint | null;
168
- transactions: `0x${string}`[] | viem_chains0.OpStackTransaction<boolean>[];
169
- transactionsRoot: viem0.Hash;
170
- uncles: viem0.Hash[];
171
- withdrawals?: viem0.Withdrawal[] | undefined | undefined;
172
- withdrawalsRoot?: `0x${string}` | undefined;
173
- } & {};
174
- type: "block";
175
- };
176
- readonly transaction: {
177
- exclude: [] | undefined;
178
- format: (args: viem_chains0.OpStackRpcTransaction, action?: string | undefined) => ({
179
- blockHash: `0x${string}` | null;
180
- blockNumber: bigint | null;
181
- from: abitype0.Address;
182
- gas: bigint;
183
- hash: viem0.Hash;
184
- input: viem0.Hex;
185
- nonce: number;
186
- r: viem0.Hex;
187
- s: viem0.Hex;
188
- to: abitype0.Address | null;
189
- transactionIndex: number | null;
190
- typeHex: viem0.Hex | null;
191
- v: bigint;
192
- value: bigint;
193
- yParity: number;
194
- gasPrice?: undefined | undefined;
195
- maxFeePerBlobGas?: undefined | undefined;
196
- maxFeePerGas: bigint;
197
- maxPriorityFeePerGas: bigint;
198
- isSystemTx?: boolean;
199
- mint?: bigint | undefined | undefined;
200
- sourceHash: viem0.Hex;
201
- type: "deposit";
202
- } | {
203
- r: viem0.Hex;
204
- s: viem0.Hex;
205
- v: bigint;
206
- to: abitype0.Address | null;
207
- from: abitype0.Address;
208
- gas: bigint;
209
- nonce: number;
210
- value: bigint;
211
- blockHash: `0x${string}` | null;
212
- blockNumber: bigint | null;
213
- hash: viem0.Hash;
214
- input: viem0.Hex;
215
- transactionIndex: number | null;
216
- typeHex: viem0.Hex | null;
217
- accessList?: undefined | undefined;
218
- authorizationList?: undefined | undefined;
219
- blobVersionedHashes?: undefined | undefined;
220
- chainId?: number | undefined;
221
- yParity?: undefined | undefined;
222
- type: "legacy";
223
- gasPrice: bigint;
224
- maxFeePerBlobGas?: undefined | undefined;
225
- maxFeePerGas?: undefined | undefined;
226
- maxPriorityFeePerGas?: undefined | undefined;
227
- isSystemTx?: undefined | undefined;
228
- mint?: undefined | undefined;
229
- sourceHash?: undefined | undefined;
230
- } | {
231
- blockHash: `0x${string}` | null;
232
- blockNumber: bigint | null;
233
- from: abitype0.Address;
234
- gas: bigint;
235
- hash: viem0.Hash;
236
- input: viem0.Hex;
237
- nonce: number;
238
- r: viem0.Hex;
239
- s: viem0.Hex;
240
- to: abitype0.Address | null;
241
- transactionIndex: number | null;
242
- typeHex: viem0.Hex | null;
243
- v: bigint;
244
- value: bigint;
245
- yParity: number;
246
- accessList: viem0.AccessList;
247
- authorizationList?: undefined | undefined;
248
- blobVersionedHashes?: undefined | undefined;
249
- chainId: number;
250
- type: "eip2930";
251
- gasPrice: bigint;
252
- maxFeePerBlobGas?: undefined | undefined;
253
- maxFeePerGas?: undefined | undefined;
254
- maxPriorityFeePerGas?: undefined | undefined;
255
- isSystemTx?: undefined | undefined;
256
- mint?: undefined | undefined;
257
- sourceHash?: undefined | undefined;
258
- } | {
259
- blockHash: `0x${string}` | null;
260
- blockNumber: bigint | null;
261
- from: abitype0.Address;
262
- gas: bigint;
263
- hash: viem0.Hash;
264
- input: viem0.Hex;
265
- nonce: number;
266
- r: viem0.Hex;
267
- s: viem0.Hex;
268
- to: abitype0.Address | null;
269
- transactionIndex: number | null;
270
- typeHex: viem0.Hex | null;
271
- v: bigint;
272
- value: bigint;
273
- yParity: number;
274
- accessList: viem0.AccessList;
275
- authorizationList?: undefined | undefined;
276
- blobVersionedHashes?: undefined | undefined;
277
- chainId: number;
278
- type: "eip1559";
279
- gasPrice?: undefined | undefined;
280
- maxFeePerBlobGas?: undefined | undefined;
281
- maxFeePerGas: bigint;
282
- maxPriorityFeePerGas: bigint;
283
- isSystemTx?: undefined | undefined;
284
- mint?: undefined | undefined;
285
- sourceHash?: undefined | undefined;
286
- } | {
287
- blockHash: `0x${string}` | null;
288
- blockNumber: bigint | null;
289
- from: abitype0.Address;
290
- gas: bigint;
291
- hash: viem0.Hash;
292
- input: viem0.Hex;
293
- nonce: number;
294
- r: viem0.Hex;
295
- s: viem0.Hex;
296
- to: abitype0.Address | null;
297
- transactionIndex: number | null;
298
- typeHex: viem0.Hex | null;
299
- v: bigint;
300
- value: bigint;
301
- yParity: number;
302
- accessList: viem0.AccessList;
303
- authorizationList?: undefined | undefined;
304
- blobVersionedHashes: readonly viem0.Hex[];
305
- chainId: number;
306
- type: "eip4844";
307
- gasPrice?: undefined | undefined;
308
- maxFeePerBlobGas: bigint;
309
- maxFeePerGas: bigint;
310
- maxPriorityFeePerGas: bigint;
311
- isSystemTx?: undefined | undefined;
312
- mint?: undefined | undefined;
313
- sourceHash?: undefined | undefined;
314
- } | {
315
- blockHash: `0x${string}` | null;
316
- blockNumber: bigint | null;
317
- from: abitype0.Address;
318
- gas: bigint;
319
- hash: viem0.Hash;
320
- input: viem0.Hex;
321
- nonce: number;
322
- r: viem0.Hex;
323
- s: viem0.Hex;
324
- to: abitype0.Address | null;
325
- transactionIndex: number | null;
326
- typeHex: viem0.Hex | null;
327
- v: bigint;
328
- value: bigint;
329
- yParity: number;
330
- accessList: viem0.AccessList;
331
- authorizationList: viem0.SignedAuthorizationList;
332
- blobVersionedHashes?: undefined | undefined;
333
- chainId: number;
334
- type: "eip7702";
335
- gasPrice?: undefined | undefined;
336
- maxFeePerBlobGas?: undefined | undefined;
337
- maxFeePerGas: bigint;
338
- maxPriorityFeePerGas: bigint;
339
- isSystemTx?: undefined | undefined;
340
- mint?: undefined | undefined;
341
- sourceHash?: undefined | undefined;
342
- }) & {};
343
- type: "transaction";
344
- };
345
- readonly transactionReceipt: {
346
- exclude: [] | undefined;
347
- format: (args: viem_chains0.OpStackRpcTransactionReceipt, action?: string | undefined) => {
348
- blobGasPrice?: bigint | undefined;
349
- blobGasUsed?: bigint | undefined;
350
- blockHash: viem0.Hash;
351
- blockNumber: bigint;
352
- blockTimestamp?: bigint | undefined;
353
- contractAddress: abitype0.Address | null | undefined;
354
- cumulativeGasUsed: bigint;
355
- effectiveGasPrice: bigint;
356
- from: abitype0.Address;
357
- gasUsed: bigint;
358
- logs: viem0.Log<bigint, number, false>[];
359
- logsBloom: viem0.Hex;
360
- root?: `0x${string}` | undefined;
361
- status: "success" | "reverted";
362
- to: abitype0.Address | null;
363
- transactionHash: viem0.Hash;
364
- transactionIndex: number;
365
- type: viem0.TransactionType;
366
- l1GasPrice: bigint | null;
367
- l1GasUsed: bigint | null;
368
- l1Fee: bigint | null;
369
- l1FeeScalar: number | null;
370
- } & {};
371
- type: "transactionReceipt";
372
- };
373
- };
374
- prepareTransactionRequest?: ((args: viem0.PrepareTransactionRequestParameters, options: {
375
- phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
376
- }) => Promise<viem0.PrepareTransactionRequestParameters>) | [fn: ((args: viem0.PrepareTransactionRequestParameters, options: {
377
- phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
378
- }) => Promise<viem0.PrepareTransactionRequestParameters>) | undefined, options: {
379
- runAt: readonly ("beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters")[];
380
- }] | undefined;
381
- serializers: {
382
- readonly transaction: typeof viem_chains0.serializeTransactionOpStack;
383
- };
384
- verifyHash?: ((client: viem0.Client, parameters: viem0.VerifyHashActionParameters) => Promise<viem0.VerifyHashActionReturnType>) | undefined;
385
- readonly network: "base-sepolia";
59
+ serializers?: viem19.ChainSerializers<undefined, viem19.TransactionSerializable> | undefined;
60
+ verifyHash?: ((client: viem19.Client, parameters: viem19.VerifyHashActionParameters) => Promise<viem19.VerifyHashActionReturnType>) | undefined;
386
61
  };
387
62
  };
388
63
  };
@@ -424,17 +99,17 @@ declare function getNetwork(name: string): {
424
99
  testnet: true;
425
100
  custom?: Record<string, unknown> | undefined;
426
101
  extendSchema?: Record<string, unknown> | undefined;
427
- fees?: viem0.ChainFees<undefined> | undefined;
102
+ fees?: viem19.ChainFees<undefined> | undefined;
428
103
  formatters?: undefined;
429
- prepareTransactionRequest?: ((args: viem0.PrepareTransactionRequestParameters, options: {
104
+ prepareTransactionRequest?: ((args: viem19.PrepareTransactionRequestParameters, options: {
430
105
  phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
431
- }) => Promise<viem0.PrepareTransactionRequestParameters>) | [fn: ((args: viem0.PrepareTransactionRequestParameters, options: {
106
+ }) => Promise<viem19.PrepareTransactionRequestParameters>) | [fn: ((args: viem19.PrepareTransactionRequestParameters, options: {
432
107
  phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
433
- }) => Promise<viem0.PrepareTransactionRequestParameters>) | undefined, options: {
108
+ }) => Promise<viem19.PrepareTransactionRequestParameters>) | undefined, options: {
434
109
  runAt: readonly ("beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters")[];
435
110
  }] | undefined;
436
- serializers?: viem0.ChainSerializers<undefined, viem0.TransactionSerializable> | undefined;
437
- verifyHash?: ((client: viem0.Client, parameters: viem0.VerifyHashActionParameters) => Promise<viem0.VerifyHashActionReturnType>) | undefined;
111
+ serializers?: viem19.ChainSerializers<undefined, viem19.TransactionSerializable> | undefined;
112
+ verifyHash?: ((client: viem19.Client, parameters: viem19.VerifyHashActionParameters) => Promise<viem19.VerifyHashActionReturnType>) | undefined;
438
113
  };
439
114
  interface AppConfig {
440
115
  dataRegistryContractAddress: Hex;
@@ -447,10 +122,10 @@ interface AppConfig {
447
122
  ipfsGateway: string;
448
123
  }
449
124
  declare const FangornConfig: {
450
- dataRegistryContractAddress: "0x97d63259bd91e386322c12fa7e923e5e1c0ddf91";
451
- appRegistryContractAddress: "0xeb1309d4607ffbe2051d296de72d3ca4d2795731";
452
- subscriptionRegistryContractAddress: "0x81681e4f89a24cb46112480f63404fdc35ee4cec";
453
- settlementRegistryContractAddress: "0x480d54411d77820701fd80f42b81fb6e20176d12";
125
+ dataRegistryContractAddress: "0x775026e905d7b58b34d16bcbd385fa630ee36c26";
126
+ appRegistryContractAddress: "0x11d228c4774af3d9cae3b4b6874a12576a1a83ec";
127
+ subscriptionRegistryContractAddress: "0x9c599136b195d70edea0106017fdf081a0401f9d";
128
+ settlementRegistryContractAddress: "0xbbecb93142d1a5144260d2c30fe3c4a11fdda346";
454
129
  chain: {
455
130
  blockExplorers: {
456
131
  readonly default: {
@@ -484,17 +159,17 @@ declare const FangornConfig: {
484
159
  testnet: true;
485
160
  custom?: Record<string, unknown> | undefined;
486
161
  extendSchema?: Record<string, unknown> | undefined;
487
- fees?: viem0.ChainFees<undefined> | undefined;
162
+ fees?: viem19.ChainFees<undefined> | undefined;
488
163
  formatters?: undefined;
489
- prepareTransactionRequest?: ((args: viem0.PrepareTransactionRequestParameters, options: {
164
+ prepareTransactionRequest?: ((args: viem19.PrepareTransactionRequestParameters, options: {
490
165
  phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
491
- }) => Promise<viem0.PrepareTransactionRequestParameters>) | [fn: ((args: viem0.PrepareTransactionRequestParameters, options: {
166
+ }) => Promise<viem19.PrepareTransactionRequestParameters>) | [fn: ((args: viem19.PrepareTransactionRequestParameters, options: {
492
167
  phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
493
- }) => Promise<viem0.PrepareTransactionRequestParameters>) | undefined, options: {
168
+ }) => Promise<viem19.PrepareTransactionRequestParameters>) | undefined, options: {
494
169
  runAt: readonly ("beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters")[];
495
170
  }] | undefined;
496
- serializers?: viem0.ChainSerializers<undefined, viem0.TransactionSerializable> | undefined;
497
- verifyHash?: ((client: viem0.Client, parameters: viem0.VerifyHashActionParameters) => Promise<viem0.VerifyHashActionReturnType>) | undefined;
171
+ serializers?: viem19.ChainSerializers<undefined, viem19.TransactionSerializable> | undefined;
172
+ verifyHash?: ((client: viem19.Client, parameters: viem19.VerifyHashActionParameters) => Promise<viem19.VerifyHashActionReturnType>) | undefined;
498
173
  };
499
174
  rpcUrl: string;
500
175
  caip2: number;
package/lib/config.js CHANGED
@@ -1,10 +1,9 @@
1
1
  import { keccak256, toHex } from "viem";
2
- import { arbitrumSepolia, baseSepolia } from "viem/chains";
2
+ import { arbitrumSepolia } from "viem/chains";
3
3
 
4
4
  //#region src/config.ts
5
5
  /**
6
6
  * Derive an app id from a human-readable name (keccak256(hex(name)).
7
- * Apps are claim one of these on-chain with `AppRegistry.registerApp`
8
7
  */
9
8
  function appId(name) {
10
9
  return keccak256(toHex(name));
@@ -14,18 +13,12 @@ function toAppId(nameOrId) {
14
13
  return /^0x[0-9a-fA-F]{64}$/.test(nameOrId) ? nameOrId : appId(nameOrId);
15
14
  }
16
15
  /**
17
- * The networks supproted by Fangorn currently
16
+ * The networks supported by Fangorn currently
18
17
  */
19
- const SupportedNetworks = {
20
- ArbitrumSepolia: {
21
- name: "arbitrumSepolia",
22
- chain: arbitrumSepolia
23
- },
24
- BaseSepolia: {
25
- name: "baseSepolia",
26
- chain: baseSepolia
27
- }
28
- };
18
+ const SupportedNetworks = { ArbitrumSepolia: {
19
+ name: "arbitrumSepolia",
20
+ chain: arbitrumSepolia
21
+ } };
29
22
  /**
30
23
  * Get the network based on the string name
31
24
  * @param name "arbitrumSepolia" is the only one supported right now
@@ -36,10 +29,10 @@ function getNetwork(name) {
36
29
  throw new Error(`Chain ${name} is not supported`);
37
30
  }
38
31
  const FangornConfig = {
39
- dataRegistryContractAddress: "0x97d63259bd91e386322c12fa7e923e5e1c0ddf91",
40
- appRegistryContractAddress: "0xeb1309d4607ffbe2051d296de72d3ca4d2795731",
41
- subscriptionRegistryContractAddress: "0x81681e4f89a24cb46112480f63404fdc35ee4cec",
42
- settlementRegistryContractAddress: "0x480d54411d77820701fd80f42b81fb6e20176d12",
32
+ dataRegistryContractAddress: "0x775026e905d7b58b34d16bcbd385fa630ee36c26",
33
+ appRegistryContractAddress: "0x11d228c4774af3d9cae3b4b6874a12576a1a83ec",
34
+ subscriptionRegistryContractAddress: "0x9c599136b195d70edea0106017fdf081a0401f9d",
35
+ settlementRegistryContractAddress: "0xbbecb93142d1a5144260d2c30fe3c4a11fdda346",
43
36
  chain: arbitrumSepolia,
44
37
  rpcUrl: "https://sepolia-rollup.arbitrum.io/rpc",
45
38
  caip2: 421614,