@fangorn-network/sdk 2026.10.1-9.0-dev → 2026.10.19-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 +2 -13
- package/lib/cli/cli.js +8 -13
- package/lib/cli/index.d.ts +91 -3
- package/lib/cli/index.js +2 -5
- package/lib/config.d.ts +111 -347
- package/lib/config.js +18 -28
- package/lib/index.d.ts +2 -2
- package/lib/index.js +2 -2
- package/lib/test/testbed.d.ts +5009 -5009
- package/package.json +1 -1
package/lib/config.d.ts
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as viem5596 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
|
/**
|
|
@@ -15,6 +13,109 @@ declare function appId(name: string): Hex;
|
|
|
15
13
|
*/
|
|
16
14
|
declare function nonBlank(value: string | undefined): string | undefined;
|
|
17
15
|
declare function toAppId(nameOrId: string): Hex;
|
|
16
|
+
/**
|
|
17
|
+
* The networks supported by Fangorn currently
|
|
18
|
+
*/
|
|
19
|
+
declare const SupportedNetworks: {
|
|
20
|
+
ArbitrumSepolia: {
|
|
21
|
+
name: string;
|
|
22
|
+
chain: {
|
|
23
|
+
blockExplorers: {
|
|
24
|
+
readonly default: {
|
|
25
|
+
readonly name: "Arbiscan";
|
|
26
|
+
readonly url: "https://sepolia.arbiscan.io";
|
|
27
|
+
readonly apiUrl: "https://api-sepolia.arbiscan.io/api";
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
blockTime: 250;
|
|
31
|
+
contracts: {
|
|
32
|
+
readonly multicall3: {
|
|
33
|
+
readonly address: "0xca11bde05977b3631167028862be2a173976ca11";
|
|
34
|
+
readonly blockCreated: 81930;
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
ensTlds?: readonly string[] | undefined;
|
|
38
|
+
id: 421614;
|
|
39
|
+
name: "Arbitrum Sepolia";
|
|
40
|
+
nativeCurrency: {
|
|
41
|
+
readonly name: "Arbitrum Sepolia Ether";
|
|
42
|
+
readonly symbol: "ETH";
|
|
43
|
+
readonly decimals: 18;
|
|
44
|
+
};
|
|
45
|
+
experimental_preconfirmationTime?: number | undefined | undefined;
|
|
46
|
+
rpcUrls: {
|
|
47
|
+
readonly default: {
|
|
48
|
+
readonly http: readonly ["https://sepolia-rollup.arbitrum.io/rpc"];
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
sourceId?: number | undefined | undefined;
|
|
52
|
+
testnet: true;
|
|
53
|
+
custom?: Record<string, unknown> | undefined;
|
|
54
|
+
extendSchema?: Record<string, unknown> | undefined;
|
|
55
|
+
fees?: viem5596.ChainFees<undefined> | undefined;
|
|
56
|
+
formatters?: undefined;
|
|
57
|
+
prepareTransactionRequest?: ((args: viem5596.PrepareTransactionRequestParameters, options: {
|
|
58
|
+
phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
|
|
59
|
+
}) => Promise<viem5596.PrepareTransactionRequestParameters>) | [fn: ((args: viem5596.PrepareTransactionRequestParameters, options: {
|
|
60
|
+
phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
|
|
61
|
+
}) => Promise<viem5596.PrepareTransactionRequestParameters>) | undefined, options: {
|
|
62
|
+
runAt: readonly ("beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters")[];
|
|
63
|
+
}] | undefined;
|
|
64
|
+
serializers?: viem5596.ChainSerializers<undefined, viem5596.TransactionSerializable> | undefined;
|
|
65
|
+
verifyHash?: ((client: viem5596.Client, parameters: viem5596.VerifyHashActionParameters) => Promise<viem5596.VerifyHashActionReturnType>) | undefined;
|
|
66
|
+
};
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
/**
|
|
70
|
+
* Get the network based on the string name
|
|
71
|
+
* @param name "arbitrumSepolia" is the only one supported right now
|
|
72
|
+
* @returns The corresponding network if it is supported, otherwise an error
|
|
73
|
+
*/
|
|
74
|
+
declare function getNetwork(name: string): {
|
|
75
|
+
blockExplorers: {
|
|
76
|
+
readonly default: {
|
|
77
|
+
readonly name: "Arbiscan";
|
|
78
|
+
readonly url: "https://sepolia.arbiscan.io";
|
|
79
|
+
readonly apiUrl: "https://api-sepolia.arbiscan.io/api";
|
|
80
|
+
};
|
|
81
|
+
};
|
|
82
|
+
blockTime: 250;
|
|
83
|
+
contracts: {
|
|
84
|
+
readonly multicall3: {
|
|
85
|
+
readonly address: "0xca11bde05977b3631167028862be2a173976ca11";
|
|
86
|
+
readonly blockCreated: 81930;
|
|
87
|
+
};
|
|
88
|
+
};
|
|
89
|
+
ensTlds?: readonly string[] | undefined;
|
|
90
|
+
id: 421614;
|
|
91
|
+
name: "Arbitrum Sepolia";
|
|
92
|
+
nativeCurrency: {
|
|
93
|
+
readonly name: "Arbitrum Sepolia Ether";
|
|
94
|
+
readonly symbol: "ETH";
|
|
95
|
+
readonly decimals: 18;
|
|
96
|
+
};
|
|
97
|
+
experimental_preconfirmationTime?: number | undefined | undefined;
|
|
98
|
+
rpcUrls: {
|
|
99
|
+
readonly default: {
|
|
100
|
+
readonly http: readonly ["https://sepolia-rollup.arbitrum.io/rpc"];
|
|
101
|
+
};
|
|
102
|
+
};
|
|
103
|
+
sourceId?: number | undefined | undefined;
|
|
104
|
+
testnet: true;
|
|
105
|
+
custom?: Record<string, unknown> | undefined;
|
|
106
|
+
extendSchema?: Record<string, unknown> | undefined;
|
|
107
|
+
fees?: viem5596.ChainFees<undefined> | undefined;
|
|
108
|
+
formatters?: undefined;
|
|
109
|
+
prepareTransactionRequest?: ((args: viem5596.PrepareTransactionRequestParameters, options: {
|
|
110
|
+
phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
|
|
111
|
+
}) => Promise<viem5596.PrepareTransactionRequestParameters>) | [fn: ((args: viem5596.PrepareTransactionRequestParameters, options: {
|
|
112
|
+
phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
|
|
113
|
+
}) => Promise<viem5596.PrepareTransactionRequestParameters>) | undefined, options: {
|
|
114
|
+
runAt: readonly ("beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters")[];
|
|
115
|
+
}] | undefined;
|
|
116
|
+
serializers?: viem5596.ChainSerializers<undefined, viem5596.TransactionSerializable> | undefined;
|
|
117
|
+
verifyHash?: ((client: viem5596.Client, parameters: viem5596.VerifyHashActionParameters) => Promise<viem5596.VerifyHashActionReturnType>) | undefined;
|
|
118
|
+
};
|
|
18
119
|
interface AppConfig {
|
|
19
120
|
dataRegistryContractAddress: Hex;
|
|
20
121
|
appRegistryContractAddress: Hex;
|
|
@@ -63,358 +164,21 @@ declare const FangornConfig: {
|
|
|
63
164
|
testnet: true;
|
|
64
165
|
custom?: Record<string, unknown> | undefined;
|
|
65
166
|
extendSchema?: Record<string, unknown> | undefined;
|
|
66
|
-
fees?:
|
|
167
|
+
fees?: viem5596.ChainFees<undefined> | undefined;
|
|
67
168
|
formatters?: undefined;
|
|
68
|
-
prepareTransactionRequest?: ((args:
|
|
169
|
+
prepareTransactionRequest?: ((args: viem5596.PrepareTransactionRequestParameters, options: {
|
|
69
170
|
phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
|
|
70
|
-
}) => Promise<
|
|
171
|
+
}) => Promise<viem5596.PrepareTransactionRequestParameters>) | [fn: ((args: viem5596.PrepareTransactionRequestParameters, options: {
|
|
71
172
|
phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
|
|
72
|
-
}) => Promise<
|
|
173
|
+
}) => Promise<viem5596.PrepareTransactionRequestParameters>) | undefined, options: {
|
|
73
174
|
runAt: readonly ("beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters")[];
|
|
74
175
|
}] | undefined;
|
|
75
|
-
serializers?:
|
|
76
|
-
verifyHash?: ((client:
|
|
176
|
+
serializers?: viem5596.ChainSerializers<undefined, viem5596.TransactionSerializable> | undefined;
|
|
177
|
+
verifyHash?: ((client: viem5596.Client, parameters: viem5596.VerifyHashActionParameters) => Promise<viem5596.VerifyHashActionReturnType>) | undefined;
|
|
77
178
|
};
|
|
78
179
|
rpcUrl: string;
|
|
79
180
|
caip2: number;
|
|
80
181
|
ipfsGateway: string;
|
|
81
182
|
};
|
|
82
|
-
declare const BaseSepoliaConfig: {
|
|
83
|
-
dataRegistryContractAddress: "0xE9183f768865dd2Cde5f1B71F8446F0Cd798ebe0";
|
|
84
|
-
appRegistryContractAddress: "0x0D3e98399df41b558048Cdd7D71723c37A3A9D6F";
|
|
85
|
-
membershipRegistryContractAddress: "0x0e96C012b5c53622EcDAA82F342E31C2623A04f5";
|
|
86
|
-
appRegistryFromBlock: bigint;
|
|
87
|
-
chain: {
|
|
88
|
-
blockExplorers: {
|
|
89
|
-
readonly default: {
|
|
90
|
-
readonly name: "Basescan";
|
|
91
|
-
readonly url: "https://sepolia.basescan.org";
|
|
92
|
-
readonly apiUrl: "https://api-sepolia.basescan.org/api";
|
|
93
|
-
};
|
|
94
|
-
};
|
|
95
|
-
blockTime: 2000;
|
|
96
|
-
contracts: {
|
|
97
|
-
readonly disputeGameFactory: {
|
|
98
|
-
readonly 11155111: {
|
|
99
|
-
readonly address: "0xd6E6dBf4F7EA0ac412fD8b65ED297e64BB7a06E1";
|
|
100
|
-
};
|
|
101
|
-
};
|
|
102
|
-
readonly l2OutputOracle: {
|
|
103
|
-
readonly 11155111: {
|
|
104
|
-
readonly address: "0x84457ca9D0163FbC4bbfe4Dfbb20ba46e48DF254";
|
|
105
|
-
};
|
|
106
|
-
};
|
|
107
|
-
readonly portal: {
|
|
108
|
-
readonly 11155111: {
|
|
109
|
-
readonly address: "0x49f53e41452c74589e85ca1677426ba426459e85";
|
|
110
|
-
readonly blockCreated: 4446677;
|
|
111
|
-
};
|
|
112
|
-
};
|
|
113
|
-
readonly l1StandardBridge: {
|
|
114
|
-
readonly 11155111: {
|
|
115
|
-
readonly address: "0xfd0Bf71F60660E2f608ed56e1659C450eB113120";
|
|
116
|
-
readonly blockCreated: 4446677;
|
|
117
|
-
};
|
|
118
|
-
};
|
|
119
|
-
readonly multicall3: {
|
|
120
|
-
readonly address: "0xca11bde05977b3631167028862be2a173976ca11";
|
|
121
|
-
readonly blockCreated: 1059647;
|
|
122
|
-
};
|
|
123
|
-
readonly gasPriceOracle: {
|
|
124
|
-
readonly address: "0x420000000000000000000000000000000000000F";
|
|
125
|
-
};
|
|
126
|
-
readonly l1Block: {
|
|
127
|
-
readonly address: "0x4200000000000000000000000000000000000015";
|
|
128
|
-
};
|
|
129
|
-
readonly l2CrossDomainMessenger: {
|
|
130
|
-
readonly address: "0x4200000000000000000000000000000000000007";
|
|
131
|
-
};
|
|
132
|
-
readonly l2Erc721Bridge: {
|
|
133
|
-
readonly address: "0x4200000000000000000000000000000000000014";
|
|
134
|
-
};
|
|
135
|
-
readonly l2StandardBridge: {
|
|
136
|
-
readonly address: "0x4200000000000000000000000000000000000010";
|
|
137
|
-
};
|
|
138
|
-
readonly l2ToL1MessagePasser: {
|
|
139
|
-
readonly address: "0x4200000000000000000000000000000000000016";
|
|
140
|
-
};
|
|
141
|
-
};
|
|
142
|
-
ensTlds?: readonly string[] | undefined;
|
|
143
|
-
id: 84532;
|
|
144
|
-
name: "Base Sepolia";
|
|
145
|
-
nativeCurrency: {
|
|
146
|
-
readonly name: "Sepolia Ether";
|
|
147
|
-
readonly symbol: "ETH";
|
|
148
|
-
readonly decimals: 18;
|
|
149
|
-
};
|
|
150
|
-
experimental_preconfirmationTime?: number | undefined | undefined;
|
|
151
|
-
rpcUrls: {
|
|
152
|
-
readonly default: {
|
|
153
|
-
readonly http: readonly ["https://sepolia.base.org"];
|
|
154
|
-
};
|
|
155
|
-
};
|
|
156
|
-
sourceId: 11155111;
|
|
157
|
-
testnet: true;
|
|
158
|
-
custom?: Record<string, unknown> | undefined;
|
|
159
|
-
extendSchema?: Record<string, unknown> | undefined;
|
|
160
|
-
fees?: viem0.ChainFees<undefined> | undefined;
|
|
161
|
-
formatters: {
|
|
162
|
-
readonly block: {
|
|
163
|
-
exclude: [] | undefined;
|
|
164
|
-
format: (args: viem_chains0.OpStackRpcBlock, action?: string | undefined) => {
|
|
165
|
-
baseFeePerGas: bigint | null;
|
|
166
|
-
blobGasUsed: bigint;
|
|
167
|
-
difficulty: bigint;
|
|
168
|
-
excessBlobGas: bigint;
|
|
169
|
-
extraData: viem0.Hex;
|
|
170
|
-
gasLimit: bigint;
|
|
171
|
-
gasUsed: bigint;
|
|
172
|
-
hash: `0x${string}` | null;
|
|
173
|
-
logsBloom: `0x${string}` | null;
|
|
174
|
-
miner: abitype0.Address;
|
|
175
|
-
mixHash: viem0.Hash;
|
|
176
|
-
nonce: `0x${string}` | null;
|
|
177
|
-
number: bigint | null;
|
|
178
|
-
parentBeaconBlockRoot?: `0x${string}` | undefined;
|
|
179
|
-
parentHash: viem0.Hash;
|
|
180
|
-
receiptsRoot: viem0.Hex;
|
|
181
|
-
sealFields: viem0.Hex[];
|
|
182
|
-
sha3Uncles: viem0.Hash;
|
|
183
|
-
size: bigint;
|
|
184
|
-
stateRoot: viem0.Hash;
|
|
185
|
-
timestamp: bigint;
|
|
186
|
-
totalDifficulty: bigint | null;
|
|
187
|
-
transactions: `0x${string}`[] | viem_chains0.OpStackTransaction<boolean>[];
|
|
188
|
-
transactionsRoot: viem0.Hash;
|
|
189
|
-
uncles: viem0.Hash[];
|
|
190
|
-
withdrawals?: viem0.Withdrawal[] | undefined | undefined;
|
|
191
|
-
withdrawalsRoot?: `0x${string}` | undefined;
|
|
192
|
-
} & {};
|
|
193
|
-
type: "block";
|
|
194
|
-
};
|
|
195
|
-
readonly transaction: {
|
|
196
|
-
exclude: [] | undefined;
|
|
197
|
-
format: (args: viem_chains0.OpStackRpcTransaction, action?: string | undefined) => ({
|
|
198
|
-
blockHash: `0x${string}` | null;
|
|
199
|
-
blockNumber: bigint | null;
|
|
200
|
-
from: abitype0.Address;
|
|
201
|
-
gas: bigint;
|
|
202
|
-
hash: viem0.Hash;
|
|
203
|
-
input: viem0.Hex;
|
|
204
|
-
nonce: number;
|
|
205
|
-
r: viem0.Hex;
|
|
206
|
-
s: viem0.Hex;
|
|
207
|
-
to: abitype0.Address | null;
|
|
208
|
-
transactionIndex: number | null;
|
|
209
|
-
typeHex: viem0.Hex | null;
|
|
210
|
-
v: bigint;
|
|
211
|
-
value: bigint;
|
|
212
|
-
yParity: number;
|
|
213
|
-
gasPrice?: undefined | undefined;
|
|
214
|
-
maxFeePerBlobGas?: undefined | undefined;
|
|
215
|
-
maxFeePerGas: bigint;
|
|
216
|
-
maxPriorityFeePerGas: bigint;
|
|
217
|
-
isSystemTx?: boolean;
|
|
218
|
-
mint?: bigint | undefined | undefined;
|
|
219
|
-
sourceHash: viem0.Hex;
|
|
220
|
-
type: "deposit";
|
|
221
|
-
} | {
|
|
222
|
-
r: viem0.Hex;
|
|
223
|
-
s: viem0.Hex;
|
|
224
|
-
v: bigint;
|
|
225
|
-
to: abitype0.Address | null;
|
|
226
|
-
from: abitype0.Address;
|
|
227
|
-
gas: bigint;
|
|
228
|
-
nonce: number;
|
|
229
|
-
value: bigint;
|
|
230
|
-
blockHash: `0x${string}` | null;
|
|
231
|
-
blockNumber: bigint | null;
|
|
232
|
-
hash: viem0.Hash;
|
|
233
|
-
input: viem0.Hex;
|
|
234
|
-
transactionIndex: number | null;
|
|
235
|
-
typeHex: viem0.Hex | null;
|
|
236
|
-
accessList?: undefined | undefined;
|
|
237
|
-
authorizationList?: undefined | undefined;
|
|
238
|
-
blobVersionedHashes?: undefined | undefined;
|
|
239
|
-
chainId?: number | undefined;
|
|
240
|
-
yParity?: undefined | undefined;
|
|
241
|
-
type: "legacy";
|
|
242
|
-
gasPrice: bigint;
|
|
243
|
-
maxFeePerBlobGas?: undefined | undefined;
|
|
244
|
-
maxFeePerGas?: undefined | undefined;
|
|
245
|
-
maxPriorityFeePerGas?: undefined | undefined;
|
|
246
|
-
isSystemTx?: undefined | undefined;
|
|
247
|
-
mint?: undefined | undefined;
|
|
248
|
-
sourceHash?: undefined | undefined;
|
|
249
|
-
} | {
|
|
250
|
-
blockHash: `0x${string}` | null;
|
|
251
|
-
blockNumber: bigint | null;
|
|
252
|
-
from: abitype0.Address;
|
|
253
|
-
gas: bigint;
|
|
254
|
-
hash: viem0.Hash;
|
|
255
|
-
input: viem0.Hex;
|
|
256
|
-
nonce: number;
|
|
257
|
-
r: viem0.Hex;
|
|
258
|
-
s: viem0.Hex;
|
|
259
|
-
to: abitype0.Address | null;
|
|
260
|
-
transactionIndex: number | null;
|
|
261
|
-
typeHex: viem0.Hex | null;
|
|
262
|
-
v: bigint;
|
|
263
|
-
value: bigint;
|
|
264
|
-
yParity: number;
|
|
265
|
-
accessList: viem0.AccessList;
|
|
266
|
-
authorizationList?: undefined | undefined;
|
|
267
|
-
blobVersionedHashes?: undefined | undefined;
|
|
268
|
-
chainId: number;
|
|
269
|
-
type: "eip2930";
|
|
270
|
-
gasPrice: bigint;
|
|
271
|
-
maxFeePerBlobGas?: undefined | undefined;
|
|
272
|
-
maxFeePerGas?: undefined | undefined;
|
|
273
|
-
maxPriorityFeePerGas?: undefined | undefined;
|
|
274
|
-
isSystemTx?: undefined | undefined;
|
|
275
|
-
mint?: undefined | undefined;
|
|
276
|
-
sourceHash?: undefined | undefined;
|
|
277
|
-
} | {
|
|
278
|
-
blockHash: `0x${string}` | null;
|
|
279
|
-
blockNumber: bigint | null;
|
|
280
|
-
from: abitype0.Address;
|
|
281
|
-
gas: bigint;
|
|
282
|
-
hash: viem0.Hash;
|
|
283
|
-
input: viem0.Hex;
|
|
284
|
-
nonce: number;
|
|
285
|
-
r: viem0.Hex;
|
|
286
|
-
s: viem0.Hex;
|
|
287
|
-
to: abitype0.Address | null;
|
|
288
|
-
transactionIndex: number | null;
|
|
289
|
-
typeHex: viem0.Hex | null;
|
|
290
|
-
v: bigint;
|
|
291
|
-
value: bigint;
|
|
292
|
-
yParity: number;
|
|
293
|
-
accessList: viem0.AccessList;
|
|
294
|
-
authorizationList?: undefined | undefined;
|
|
295
|
-
blobVersionedHashes?: undefined | undefined;
|
|
296
|
-
chainId: number;
|
|
297
|
-
type: "eip1559";
|
|
298
|
-
gasPrice?: undefined | undefined;
|
|
299
|
-
maxFeePerBlobGas?: undefined | undefined;
|
|
300
|
-
maxFeePerGas: bigint;
|
|
301
|
-
maxPriorityFeePerGas: bigint;
|
|
302
|
-
isSystemTx?: undefined | undefined;
|
|
303
|
-
mint?: undefined | undefined;
|
|
304
|
-
sourceHash?: undefined | undefined;
|
|
305
|
-
} | {
|
|
306
|
-
blockHash: `0x${string}` | null;
|
|
307
|
-
blockNumber: bigint | null;
|
|
308
|
-
from: abitype0.Address;
|
|
309
|
-
gas: bigint;
|
|
310
|
-
hash: viem0.Hash;
|
|
311
|
-
input: viem0.Hex;
|
|
312
|
-
nonce: number;
|
|
313
|
-
r: viem0.Hex;
|
|
314
|
-
s: viem0.Hex;
|
|
315
|
-
to: abitype0.Address | null;
|
|
316
|
-
transactionIndex: number | null;
|
|
317
|
-
typeHex: viem0.Hex | null;
|
|
318
|
-
v: bigint;
|
|
319
|
-
value: bigint;
|
|
320
|
-
yParity: number;
|
|
321
|
-
accessList: viem0.AccessList;
|
|
322
|
-
authorizationList?: undefined | undefined;
|
|
323
|
-
blobVersionedHashes: readonly viem0.Hex[];
|
|
324
|
-
chainId: number;
|
|
325
|
-
type: "eip4844";
|
|
326
|
-
gasPrice?: undefined | undefined;
|
|
327
|
-
maxFeePerBlobGas: bigint;
|
|
328
|
-
maxFeePerGas: bigint;
|
|
329
|
-
maxPriorityFeePerGas: bigint;
|
|
330
|
-
isSystemTx?: undefined | undefined;
|
|
331
|
-
mint?: undefined | undefined;
|
|
332
|
-
sourceHash?: undefined | undefined;
|
|
333
|
-
} | {
|
|
334
|
-
blockHash: `0x${string}` | null;
|
|
335
|
-
blockNumber: bigint | null;
|
|
336
|
-
from: abitype0.Address;
|
|
337
|
-
gas: bigint;
|
|
338
|
-
hash: viem0.Hash;
|
|
339
|
-
input: viem0.Hex;
|
|
340
|
-
nonce: number;
|
|
341
|
-
r: viem0.Hex;
|
|
342
|
-
s: viem0.Hex;
|
|
343
|
-
to: abitype0.Address | null;
|
|
344
|
-
transactionIndex: number | null;
|
|
345
|
-
typeHex: viem0.Hex | null;
|
|
346
|
-
v: bigint;
|
|
347
|
-
value: bigint;
|
|
348
|
-
yParity: number;
|
|
349
|
-
accessList: viem0.AccessList;
|
|
350
|
-
authorizationList: viem0.SignedAuthorizationList;
|
|
351
|
-
blobVersionedHashes?: undefined | undefined;
|
|
352
|
-
chainId: number;
|
|
353
|
-
type: "eip7702";
|
|
354
|
-
gasPrice?: undefined | undefined;
|
|
355
|
-
maxFeePerBlobGas?: undefined | undefined;
|
|
356
|
-
maxFeePerGas: bigint;
|
|
357
|
-
maxPriorityFeePerGas: bigint;
|
|
358
|
-
isSystemTx?: undefined | undefined;
|
|
359
|
-
mint?: undefined | undefined;
|
|
360
|
-
sourceHash?: undefined | undefined;
|
|
361
|
-
}) & {};
|
|
362
|
-
type: "transaction";
|
|
363
|
-
};
|
|
364
|
-
readonly transactionReceipt: {
|
|
365
|
-
exclude: [] | undefined;
|
|
366
|
-
format: (args: viem_chains0.OpStackRpcTransactionReceipt, action?: string | undefined) => {
|
|
367
|
-
blobGasPrice?: bigint | undefined;
|
|
368
|
-
blobGasUsed?: bigint | undefined;
|
|
369
|
-
blockHash: viem0.Hash;
|
|
370
|
-
blockNumber: bigint;
|
|
371
|
-
blockTimestamp?: bigint | undefined;
|
|
372
|
-
contractAddress: abitype0.Address | null | undefined;
|
|
373
|
-
cumulativeGasUsed: bigint;
|
|
374
|
-
effectiveGasPrice: bigint;
|
|
375
|
-
from: abitype0.Address;
|
|
376
|
-
gasUsed: bigint;
|
|
377
|
-
logs: viem0.Log<bigint, number, false>[];
|
|
378
|
-
logsBloom: viem0.Hex;
|
|
379
|
-
root?: `0x${string}` | undefined;
|
|
380
|
-
status: "success" | "reverted";
|
|
381
|
-
to: abitype0.Address | null;
|
|
382
|
-
transactionHash: viem0.Hash;
|
|
383
|
-
transactionIndex: number;
|
|
384
|
-
type: viem0.TransactionType;
|
|
385
|
-
l1GasPrice: bigint | null;
|
|
386
|
-
l1GasUsed: bigint | null;
|
|
387
|
-
l1Fee: bigint | null;
|
|
388
|
-
l1FeeScalar: number | null;
|
|
389
|
-
} & {};
|
|
390
|
-
type: "transactionReceipt";
|
|
391
|
-
};
|
|
392
|
-
};
|
|
393
|
-
prepareTransactionRequest?: ((args: viem0.PrepareTransactionRequestParameters, options: {
|
|
394
|
-
phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
|
|
395
|
-
}) => Promise<viem0.PrepareTransactionRequestParameters>) | [fn: ((args: viem0.PrepareTransactionRequestParameters, options: {
|
|
396
|
-
phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
|
|
397
|
-
}) => Promise<viem0.PrepareTransactionRequestParameters>) | undefined, options: {
|
|
398
|
-
runAt: readonly ("beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters")[];
|
|
399
|
-
}] | undefined;
|
|
400
|
-
serializers: {
|
|
401
|
-
readonly transaction: typeof viem_chains0.serializeTransactionOpStack;
|
|
402
|
-
};
|
|
403
|
-
verifyHash?: ((client: viem0.Client, parameters: viem0.VerifyHashActionParameters) => Promise<viem0.VerifyHashActionReturnType>) | undefined;
|
|
404
|
-
readonly network: "base-sepolia";
|
|
405
|
-
};
|
|
406
|
-
rpcUrl: string;
|
|
407
|
-
caip2: number;
|
|
408
|
-
ipfsGateway: string;
|
|
409
|
-
};
|
|
410
|
-
/**
|
|
411
|
-
* The networks supported by Fangorn, by the name `CHAIN_NAME` takes.
|
|
412
|
-
*/
|
|
413
|
-
declare const SupportedNetworks: Record<string, AppConfig>;
|
|
414
|
-
/**
|
|
415
|
-
* Get a network's deployment by name ("arbitrumSepolia" or "baseSepolia").
|
|
416
|
-
* @returns The corresponding config if it is supported, otherwise an error
|
|
417
|
-
*/
|
|
418
|
-
declare function getNetwork(name: string): AppConfig;
|
|
419
183
|
//#endregion
|
|
420
|
-
export { AppConfig,
|
|
184
|
+
export { AppConfig, FangornConfig, SupportedNetworks, appId, getNetwork as default, nonBlank, toAppId };
|
package/lib/config.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { keccak256, toHex } from "viem";
|
|
2
|
-
import { arbitrumSepolia
|
|
2
|
+
import { arbitrumSepolia } from "viem/chains";
|
|
3
3
|
|
|
4
4
|
//#region src/config.ts
|
|
5
5
|
/**
|
|
@@ -22,6 +22,22 @@ function toAppId(nameOrId) {
|
|
|
22
22
|
if (!name) throw new Error("App name or id must not be blank.");
|
|
23
23
|
return /^0x[0-9a-fA-F]{64}$/.test(name) ? name : appId(name);
|
|
24
24
|
}
|
|
25
|
+
/**
|
|
26
|
+
* The networks supported by Fangorn currently
|
|
27
|
+
*/
|
|
28
|
+
const SupportedNetworks = { ArbitrumSepolia: {
|
|
29
|
+
name: "arbitrumSepolia",
|
|
30
|
+
chain: arbitrumSepolia
|
|
31
|
+
} };
|
|
32
|
+
/**
|
|
33
|
+
* Get the network based on the string name
|
|
34
|
+
* @param name "arbitrumSepolia" is the only one supported right now
|
|
35
|
+
* @returns The corresponding network if it is supported, otherwise an error
|
|
36
|
+
*/
|
|
37
|
+
function getNetwork(name) {
|
|
38
|
+
if (name === SupportedNetworks.ArbitrumSepolia.name) return arbitrumSepolia;
|
|
39
|
+
throw new Error(`Chain ${name} is not supported`);
|
|
40
|
+
}
|
|
25
41
|
const FangornConfig = {
|
|
26
42
|
dataRegistryContractAddress: "0x72B5f83526F3893aF9f1eE0f32A27218EA09f8aE",
|
|
27
43
|
appRegistryContractAddress: "0x55e6209ea1833ceD900989a3b3b22466934E04A5",
|
|
@@ -32,32 +48,6 @@ const FangornConfig = {
|
|
|
32
48
|
caip2: 421614,
|
|
33
49
|
ipfsGateway: "https://ipfs.io"
|
|
34
50
|
};
|
|
35
|
-
const BaseSepoliaConfig = {
|
|
36
|
-
dataRegistryContractAddress: "0xE9183f768865dd2Cde5f1B71F8446F0Cd798ebe0",
|
|
37
|
-
appRegistryContractAddress: "0x0D3e98399df41b558048Cdd7D71723c37A3A9D6F",
|
|
38
|
-
membershipRegistryContractAddress: "0x0e96C012b5c53622EcDAA82F342E31C2623A04f5",
|
|
39
|
-
appRegistryFromBlock: 48340483n,
|
|
40
|
-
chain: baseSepolia,
|
|
41
|
-
rpcUrl: "https://sepolia.base.org",
|
|
42
|
-
caip2: 84532,
|
|
43
|
-
ipfsGateway: "https://ipfs.io"
|
|
44
|
-
};
|
|
45
|
-
/**
|
|
46
|
-
* The networks supported by Fangorn, by the name `CHAIN_NAME` takes.
|
|
47
|
-
*/
|
|
48
|
-
const SupportedNetworks = {
|
|
49
|
-
arbitrumSepolia: FangornConfig,
|
|
50
|
-
baseSepolia: BaseSepoliaConfig
|
|
51
|
-
};
|
|
52
|
-
/**
|
|
53
|
-
* Get a network's deployment by name ("arbitrumSepolia" or "baseSepolia").
|
|
54
|
-
* @returns The corresponding config if it is supported, otherwise an error
|
|
55
|
-
*/
|
|
56
|
-
function getNetwork(name) {
|
|
57
|
-
const config = SupportedNetworks[name];
|
|
58
|
-
if (!config) throw new Error(`Chain ${name} is not supported. Use one of: ${Object.keys(SupportedNetworks).join(", ")}`);
|
|
59
|
-
return config;
|
|
60
|
-
}
|
|
61
51
|
|
|
62
52
|
//#endregion
|
|
63
|
-
export {
|
|
53
|
+
export { FangornConfig, SupportedNetworks, appId, getNetwork as default, nonBlank, toAppId };
|
package/lib/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AppConfig,
|
|
1
|
+
import { AppConfig, FangornConfig, SupportedNetworks, appId, nonBlank, toAppId } from "./config.js";
|
|
2
2
|
import { APP_REGISTRY_ABI } from "./contracts/app-registry/abi.js";
|
|
3
3
|
import { PublisherStatus } from "./contracts/types.js";
|
|
4
4
|
import { PreparedTx } from "./contracts/write.js";
|
|
@@ -17,4 +17,4 @@ import { AssetProcessor, BuildAssetGraphOptions, CommitFileGraph, Edge, FileFaca
|
|
|
17
17
|
import { PinataBackend } from "./providers/storage/pinata.js";
|
|
18
18
|
import { DEFAULT_SIGNED_URL_WORKER, SignedUrlBackend, SignedUrlSigner } from "./providers/storage/signed-url.js";
|
|
19
19
|
import { MAX_UPLOAD_ATTEMPTS, deserialize, fetchRawByCid, isTransientUpload, retrieveByCid, serialize, withUploadRetry } from "./providers/storage/utils.js";
|
|
20
|
-
export { APP_REGISTRY_ABI, AccessRequest, AccessSigner, AgentCard, AppAccess, AppAgentLog, AppConfig, AppFeed, AppRegistryClient, AssetProcessor,
|
|
20
|
+
export { APP_REGISTRY_ABI, AccessRequest, AccessSigner, AgentCard, AppAccess, AppAgentLog, AppConfig, AppFeed, AppRegistryClient, AssetProcessor, BuildAssetGraphOptions, ChainRegistry, ChainRegistryConfig, ClaimArgs, CommitFileGraph, DATA_REGISTRY_ABI, DEFAULT_SIGNED_URL_WORKER, DecryptHandleParams, EPOCH_SECONDS, Edge, EncryptAndUploadParams, Exclusion, FANGORN_APP_EXTENSION, Fangorn, FangornConfig, FangornContext, FangornCreateOptions, FileFacade, GADGET_SELF_HKDF_V1, GADGET_WORKER_USDC_V1, Gadget, HandleFieldInput, JoinArgs, LogFilter, MAX_UPLOAD_ATTEMPTS, MEMBERSHIP_REGISTRY_ABI, MembershipPayment, MembershipRegistryClient, PinataBackend, PreparedTx, ProcessorResult, PublisherStatus, Registry, RepoChange, RepoRef, SignedUrlBackend, SignedUrlSigner, StorageConfig, SubscribeOptions, SupportedNetworks, UpdateEntry, Vertex, X25519_PUBKEY_LENGTH, ZERO_HEAD, accessMessageHash, appId, buildAccessRequest, buildAssetGraph, buildMarkdownGraph, covers, decryptHandle, deserialize, encryptAndUpload, epochOf, exclusionId, extractMarkdownLinks, fetchRawByCid, isTransientUpload, joinNonce, membershipScope, membershipTokenId, nonBlank, repoExcluded, repoId, retrieveByCid, seal, sealSelf, serialize, sha256Hex, toAppId, unseal, unsealSelf, withUploadRetry };
|
package/lib/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { FangornConfig, SupportedNetworks, appId, nonBlank, toAppId } from "./config.js";
|
|
2
2
|
import { DEFAULT_SIGNED_URL_WORKER, SignedUrlBackend } from "./providers/storage/signed-url.js";
|
|
3
3
|
import { MAX_UPLOAD_ATTEMPTS, deserialize, fetchRawByCid, isTransientUpload, retrieveByCid, serialize, withUploadRetry } from "./providers/storage/utils.js";
|
|
4
4
|
import { PinataBackend } from "./providers/storage/pinata.js";
|
|
@@ -16,4 +16,4 @@ import { FANGORN_APP_EXTENSION, Fangorn } from "./fangorn.js";
|
|
|
16
16
|
import { buildAssetGraph, buildMarkdownGraph, extractMarkdownLinks } from "./harness/index.js";
|
|
17
17
|
import { GADGET_SELF_HKDF_V1, GADGET_WORKER_USDC_V1, X25519_PUBKEY_LENGTH, accessMessageHash, buildAccessRequest, decryptHandle, encryptAndUpload, seal, sealSelf, sha256Hex, unseal, unsealSelf } from "./crypto/encryption.js";
|
|
18
18
|
|
|
19
|
-
export { APP_REGISTRY_ABI, AppFeed, AppRegistryClient,
|
|
19
|
+
export { APP_REGISTRY_ABI, AppFeed, AppRegistryClient, ChainRegistry, DATA_REGISTRY_ABI, DEFAULT_SIGNED_URL_WORKER, EPOCH_SECONDS, FANGORN_APP_EXTENSION, Fangorn, FangornConfig, GADGET_SELF_HKDF_V1, GADGET_WORKER_USDC_V1, MAX_UPLOAD_ATTEMPTS, MEMBERSHIP_REGISTRY_ABI, MembershipRegistryClient, PinataBackend, PublisherStatus, SignedUrlBackend, SupportedNetworks, X25519_PUBKEY_LENGTH, ZERO_HEAD, accessMessageHash, appId, buildAccessRequest, buildAssetGraph, buildMarkdownGraph, covers, decryptHandle, deserialize, encryptAndUpload, epochOf, exclusionId, extractMarkdownLinks, fetchRawByCid, isTransientUpload, joinNonce, membershipScope, membershipTokenId, nonBlank, repoExcluded, repoId, retrieveByCid, seal, sealSelf, serialize, sha256Hex, toAppId, unseal, unsealSelf, withUploadRetry };
|