@fangorn-network/sdk 2026.4.22-1 → 2026.4.23
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/lib/cli/index.d.ts +159 -159
- package/lib/config.d.ts +3 -3
- package/lib/config.js +3 -3
- package/lib/registries/datasource-registry/index.d.ts +2 -2
- package/lib/registries/schema-registry/index.d.ts +2 -2
- package/lib/registries/settlement-registry/abi.d.ts +11 -75
- package/lib/registries/settlement-registry/abi.js +12 -88
- package/lib/registries/settlement-registry/index.d.ts +3 -9
- package/lib/registries/settlement-registry/index.js +4 -29
- package/package.json +1 -1
package/lib/cli/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "./cli.js";
|
|
2
2
|
import * as viem_chains0 from "viem/chains";
|
|
3
|
-
import * as
|
|
3
|
+
import * as viem2 from "viem";
|
|
4
4
|
|
|
5
5
|
//#region src/cli/index.d.ts
|
|
6
6
|
declare const getChain: (chainStr: string) => {
|
|
@@ -36,17 +36,17 @@ declare const getChain: (chainStr: string) => {
|
|
|
36
36
|
testnet: true;
|
|
37
37
|
custom?: Record<string, unknown> | undefined;
|
|
38
38
|
extendSchema?: Record<string, unknown> | undefined;
|
|
39
|
-
fees?:
|
|
39
|
+
fees?: viem2.ChainFees<undefined> | undefined;
|
|
40
40
|
formatters?: undefined;
|
|
41
|
-
prepareTransactionRequest?: ((args:
|
|
41
|
+
prepareTransactionRequest?: ((args: viem2.PrepareTransactionRequestParameters, options: {
|
|
42
42
|
phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
|
|
43
|
-
}) => Promise<
|
|
43
|
+
}) => Promise<viem2.PrepareTransactionRequestParameters>) | [fn: ((args: viem2.PrepareTransactionRequestParameters, options: {
|
|
44
44
|
phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
|
|
45
|
-
}) => Promise<
|
|
45
|
+
}) => Promise<viem2.PrepareTransactionRequestParameters>) | undefined, options: {
|
|
46
46
|
runAt: readonly ("beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters")[];
|
|
47
47
|
}] | undefined;
|
|
48
|
-
serializers?:
|
|
49
|
-
verifyHash?: ((client:
|
|
48
|
+
serializers?: viem2.ChainSerializers<undefined, viem2.TransactionSerializable> | undefined;
|
|
49
|
+
verifyHash?: ((client: viem2.Client, parameters: viem2.VerifyHashActionParameters) => Promise<viem2.VerifyHashActionReturnType>) | undefined;
|
|
50
50
|
} | {
|
|
51
51
|
blockExplorers: {
|
|
52
52
|
readonly default: {
|
|
@@ -120,7 +120,7 @@ declare const getChain: (chainStr: string) => {
|
|
|
120
120
|
testnet: true;
|
|
121
121
|
custom?: Record<string, unknown> | undefined;
|
|
122
122
|
extendSchema?: Record<string, unknown> | undefined;
|
|
123
|
-
fees?:
|
|
123
|
+
fees?: viem2.ChainFees<undefined> | undefined;
|
|
124
124
|
formatters: {
|
|
125
125
|
readonly block: {
|
|
126
126
|
exclude: [] | undefined;
|
|
@@ -129,28 +129,28 @@ declare const getChain: (chainStr: string) => {
|
|
|
129
129
|
blobGasUsed: bigint;
|
|
130
130
|
difficulty: bigint;
|
|
131
131
|
excessBlobGas: bigint;
|
|
132
|
-
extraData:
|
|
132
|
+
extraData: viem2.Hex;
|
|
133
133
|
gasLimit: bigint;
|
|
134
134
|
gasUsed: bigint;
|
|
135
135
|
hash: `0x${string}` | null;
|
|
136
136
|
logsBloom: `0x${string}` | null;
|
|
137
|
-
miner:
|
|
138
|
-
mixHash:
|
|
137
|
+
miner: viem2.Address;
|
|
138
|
+
mixHash: viem2.Hash;
|
|
139
139
|
nonce: `0x${string}` | null;
|
|
140
140
|
number: bigint | null;
|
|
141
141
|
parentBeaconBlockRoot?: `0x${string}` | undefined;
|
|
142
|
-
parentHash:
|
|
143
|
-
receiptsRoot:
|
|
144
|
-
sealFields:
|
|
145
|
-
sha3Uncles:
|
|
142
|
+
parentHash: viem2.Hash;
|
|
143
|
+
receiptsRoot: viem2.Hex;
|
|
144
|
+
sealFields: viem2.Hex[];
|
|
145
|
+
sha3Uncles: viem2.Hash;
|
|
146
146
|
size: bigint;
|
|
147
|
-
stateRoot:
|
|
147
|
+
stateRoot: viem2.Hash;
|
|
148
148
|
timestamp: bigint;
|
|
149
149
|
totalDifficulty: bigint | null;
|
|
150
150
|
transactions: `0x${string}`[] | viem_chains0.OpStackTransaction<boolean>[];
|
|
151
|
-
transactionsRoot:
|
|
152
|
-
uncles:
|
|
153
|
-
withdrawals?:
|
|
151
|
+
transactionsRoot: viem2.Hash;
|
|
152
|
+
uncles: viem2.Hash[];
|
|
153
|
+
withdrawals?: viem2.Withdrawal[] | undefined | undefined;
|
|
154
154
|
withdrawalsRoot?: `0x${string}` | undefined;
|
|
155
155
|
} & {};
|
|
156
156
|
type: "block";
|
|
@@ -160,16 +160,16 @@ declare const getChain: (chainStr: string) => {
|
|
|
160
160
|
format: (args: viem_chains0.OpStackRpcTransaction, action?: string | undefined) => ({
|
|
161
161
|
blockHash: `0x${string}` | null;
|
|
162
162
|
blockNumber: bigint | null;
|
|
163
|
-
from:
|
|
163
|
+
from: viem2.Address;
|
|
164
164
|
gas: bigint;
|
|
165
|
-
hash:
|
|
166
|
-
input:
|
|
165
|
+
hash: viem2.Hash;
|
|
166
|
+
input: viem2.Hex;
|
|
167
167
|
nonce: number;
|
|
168
|
-
r:
|
|
169
|
-
s:
|
|
170
|
-
to:
|
|
168
|
+
r: viem2.Hex;
|
|
169
|
+
s: viem2.Hex;
|
|
170
|
+
to: viem2.Address | null;
|
|
171
171
|
transactionIndex: number | null;
|
|
172
|
-
typeHex:
|
|
172
|
+
typeHex: viem2.Hex | null;
|
|
173
173
|
v: bigint;
|
|
174
174
|
value: bigint;
|
|
175
175
|
yParity: number;
|
|
@@ -179,23 +179,23 @@ declare const getChain: (chainStr: string) => {
|
|
|
179
179
|
maxPriorityFeePerGas: bigint;
|
|
180
180
|
isSystemTx?: boolean;
|
|
181
181
|
mint?: bigint | undefined | undefined;
|
|
182
|
-
sourceHash:
|
|
182
|
+
sourceHash: viem2.Hex;
|
|
183
183
|
type: "deposit";
|
|
184
184
|
} | {
|
|
185
|
-
r:
|
|
186
|
-
s:
|
|
185
|
+
r: viem2.Hex;
|
|
186
|
+
s: viem2.Hex;
|
|
187
187
|
v: bigint;
|
|
188
|
-
to:
|
|
189
|
-
from:
|
|
188
|
+
to: viem2.Address | null;
|
|
189
|
+
from: viem2.Address;
|
|
190
190
|
gas: bigint;
|
|
191
191
|
nonce: number;
|
|
192
192
|
value: bigint;
|
|
193
193
|
blockHash: `0x${string}` | null;
|
|
194
194
|
blockNumber: bigint | null;
|
|
195
|
-
hash:
|
|
196
|
-
input:
|
|
195
|
+
hash: viem2.Hash;
|
|
196
|
+
input: viem2.Hex;
|
|
197
197
|
transactionIndex: number | null;
|
|
198
|
-
typeHex:
|
|
198
|
+
typeHex: viem2.Hex | null;
|
|
199
199
|
accessList?: undefined | undefined;
|
|
200
200
|
authorizationList?: undefined | undefined;
|
|
201
201
|
blobVersionedHashes?: undefined | undefined;
|
|
@@ -212,20 +212,20 @@ declare const getChain: (chainStr: string) => {
|
|
|
212
212
|
} | {
|
|
213
213
|
blockHash: `0x${string}` | null;
|
|
214
214
|
blockNumber: bigint | null;
|
|
215
|
-
from:
|
|
215
|
+
from: viem2.Address;
|
|
216
216
|
gas: bigint;
|
|
217
|
-
hash:
|
|
218
|
-
input:
|
|
217
|
+
hash: viem2.Hash;
|
|
218
|
+
input: viem2.Hex;
|
|
219
219
|
nonce: number;
|
|
220
|
-
r:
|
|
221
|
-
s:
|
|
222
|
-
to:
|
|
220
|
+
r: viem2.Hex;
|
|
221
|
+
s: viem2.Hex;
|
|
222
|
+
to: viem2.Address | null;
|
|
223
223
|
transactionIndex: number | null;
|
|
224
|
-
typeHex:
|
|
224
|
+
typeHex: viem2.Hex | null;
|
|
225
225
|
v: bigint;
|
|
226
226
|
value: bigint;
|
|
227
227
|
yParity: number;
|
|
228
|
-
accessList:
|
|
228
|
+
accessList: viem2.AccessList;
|
|
229
229
|
authorizationList?: undefined | undefined;
|
|
230
230
|
blobVersionedHashes?: undefined | undefined;
|
|
231
231
|
chainId: number;
|
|
@@ -240,20 +240,20 @@ declare const getChain: (chainStr: string) => {
|
|
|
240
240
|
} | {
|
|
241
241
|
blockHash: `0x${string}` | null;
|
|
242
242
|
blockNumber: bigint | null;
|
|
243
|
-
from:
|
|
243
|
+
from: viem2.Address;
|
|
244
244
|
gas: bigint;
|
|
245
|
-
hash:
|
|
246
|
-
input:
|
|
245
|
+
hash: viem2.Hash;
|
|
246
|
+
input: viem2.Hex;
|
|
247
247
|
nonce: number;
|
|
248
|
-
r:
|
|
249
|
-
s:
|
|
250
|
-
to:
|
|
248
|
+
r: viem2.Hex;
|
|
249
|
+
s: viem2.Hex;
|
|
250
|
+
to: viem2.Address | null;
|
|
251
251
|
transactionIndex: number | null;
|
|
252
|
-
typeHex:
|
|
252
|
+
typeHex: viem2.Hex | null;
|
|
253
253
|
v: bigint;
|
|
254
254
|
value: bigint;
|
|
255
255
|
yParity: number;
|
|
256
|
-
accessList:
|
|
256
|
+
accessList: viem2.AccessList;
|
|
257
257
|
authorizationList?: undefined | undefined;
|
|
258
258
|
blobVersionedHashes?: undefined | undefined;
|
|
259
259
|
chainId: number;
|
|
@@ -268,22 +268,22 @@ declare const getChain: (chainStr: string) => {
|
|
|
268
268
|
} | {
|
|
269
269
|
blockHash: `0x${string}` | null;
|
|
270
270
|
blockNumber: bigint | null;
|
|
271
|
-
from:
|
|
271
|
+
from: viem2.Address;
|
|
272
272
|
gas: bigint;
|
|
273
|
-
hash:
|
|
274
|
-
input:
|
|
273
|
+
hash: viem2.Hash;
|
|
274
|
+
input: viem2.Hex;
|
|
275
275
|
nonce: number;
|
|
276
|
-
r:
|
|
277
|
-
s:
|
|
278
|
-
to:
|
|
276
|
+
r: viem2.Hex;
|
|
277
|
+
s: viem2.Hex;
|
|
278
|
+
to: viem2.Address | null;
|
|
279
279
|
transactionIndex: number | null;
|
|
280
|
-
typeHex:
|
|
280
|
+
typeHex: viem2.Hex | null;
|
|
281
281
|
v: bigint;
|
|
282
282
|
value: bigint;
|
|
283
283
|
yParity: number;
|
|
284
|
-
accessList:
|
|
284
|
+
accessList: viem2.AccessList;
|
|
285
285
|
authorizationList?: undefined | undefined;
|
|
286
|
-
blobVersionedHashes: readonly
|
|
286
|
+
blobVersionedHashes: readonly viem2.Hex[];
|
|
287
287
|
chainId: number;
|
|
288
288
|
type: "eip4844";
|
|
289
289
|
gasPrice?: undefined | undefined;
|
|
@@ -296,21 +296,21 @@ declare const getChain: (chainStr: string) => {
|
|
|
296
296
|
} | {
|
|
297
297
|
blockHash: `0x${string}` | null;
|
|
298
298
|
blockNumber: bigint | null;
|
|
299
|
-
from:
|
|
299
|
+
from: viem2.Address;
|
|
300
300
|
gas: bigint;
|
|
301
|
-
hash:
|
|
302
|
-
input:
|
|
301
|
+
hash: viem2.Hash;
|
|
302
|
+
input: viem2.Hex;
|
|
303
303
|
nonce: number;
|
|
304
|
-
r:
|
|
305
|
-
s:
|
|
306
|
-
to:
|
|
304
|
+
r: viem2.Hex;
|
|
305
|
+
s: viem2.Hex;
|
|
306
|
+
to: viem2.Address | null;
|
|
307
307
|
transactionIndex: number | null;
|
|
308
|
-
typeHex:
|
|
308
|
+
typeHex: viem2.Hex | null;
|
|
309
309
|
v: bigint;
|
|
310
310
|
value: bigint;
|
|
311
311
|
yParity: number;
|
|
312
|
-
accessList:
|
|
313
|
-
authorizationList:
|
|
312
|
+
accessList: viem2.AccessList;
|
|
313
|
+
authorizationList: viem2.SignedAuthorizationList;
|
|
314
314
|
blobVersionedHashes?: undefined | undefined;
|
|
315
315
|
chainId: number;
|
|
316
316
|
type: "eip7702";
|
|
@@ -329,22 +329,22 @@ declare const getChain: (chainStr: string) => {
|
|
|
329
329
|
format: (args: viem_chains0.OpStackRpcTransactionReceipt, action?: string | undefined) => {
|
|
330
330
|
blobGasPrice?: bigint | undefined;
|
|
331
331
|
blobGasUsed?: bigint | undefined;
|
|
332
|
-
blockHash:
|
|
332
|
+
blockHash: viem2.Hash;
|
|
333
333
|
blockNumber: bigint;
|
|
334
334
|
blockTimestamp?: bigint | undefined;
|
|
335
|
-
contractAddress:
|
|
335
|
+
contractAddress: viem2.Address | null | undefined;
|
|
336
336
|
cumulativeGasUsed: bigint;
|
|
337
337
|
effectiveGasPrice: bigint;
|
|
338
|
-
from:
|
|
338
|
+
from: viem2.Address;
|
|
339
339
|
gasUsed: bigint;
|
|
340
|
-
logs:
|
|
341
|
-
logsBloom:
|
|
340
|
+
logs: viem2.Log<bigint, number, false>[];
|
|
341
|
+
logsBloom: viem2.Hex;
|
|
342
342
|
root?: `0x${string}` | undefined;
|
|
343
343
|
status: "success" | "reverted";
|
|
344
|
-
to:
|
|
345
|
-
transactionHash:
|
|
344
|
+
to: viem2.Address | null;
|
|
345
|
+
transactionHash: viem2.Hash;
|
|
346
346
|
transactionIndex: number;
|
|
347
|
-
type:
|
|
347
|
+
type: viem2.TransactionType;
|
|
348
348
|
l1GasPrice: bigint | null;
|
|
349
349
|
l1GasUsed: bigint | null;
|
|
350
350
|
l1Fee: bigint | null;
|
|
@@ -353,17 +353,17 @@ declare const getChain: (chainStr: string) => {
|
|
|
353
353
|
type: "transactionReceipt";
|
|
354
354
|
};
|
|
355
355
|
};
|
|
356
|
-
prepareTransactionRequest?: ((args:
|
|
356
|
+
prepareTransactionRequest?: ((args: viem2.PrepareTransactionRequestParameters, options: {
|
|
357
357
|
phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
|
|
358
|
-
}) => Promise<
|
|
358
|
+
}) => Promise<viem2.PrepareTransactionRequestParameters>) | [fn: ((args: viem2.PrepareTransactionRequestParameters, options: {
|
|
359
359
|
phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
|
|
360
|
-
}) => Promise<
|
|
360
|
+
}) => Promise<viem2.PrepareTransactionRequestParameters>) | undefined, options: {
|
|
361
361
|
runAt: readonly ("beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters")[];
|
|
362
362
|
}] | undefined;
|
|
363
363
|
serializers: {
|
|
364
364
|
readonly transaction: typeof viem_chains0.serializeTransactionOpStack;
|
|
365
365
|
};
|
|
366
|
-
verifyHash?: ((client:
|
|
366
|
+
verifyHash?: ((client: viem2.Client, parameters: viem2.VerifyHashActionParameters) => Promise<viem2.VerifyHashActionReturnType>) | undefined;
|
|
367
367
|
readonly network: "base-sepolia";
|
|
368
368
|
};
|
|
369
369
|
declare const handleCancel: (value: unknown) => void;
|
|
@@ -400,17 +400,17 @@ declare const selectChain: () => Promise<{
|
|
|
400
400
|
testnet: true;
|
|
401
401
|
custom?: Record<string, unknown> | undefined;
|
|
402
402
|
extendSchema?: Record<string, unknown> | undefined;
|
|
403
|
-
fees?:
|
|
403
|
+
fees?: viem2.ChainFees<undefined> | undefined;
|
|
404
404
|
formatters?: undefined;
|
|
405
|
-
prepareTransactionRequest?: ((args:
|
|
405
|
+
prepareTransactionRequest?: ((args: viem2.PrepareTransactionRequestParameters, options: {
|
|
406
406
|
phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
|
|
407
|
-
}) => Promise<
|
|
407
|
+
}) => Promise<viem2.PrepareTransactionRequestParameters>) | [fn: ((args: viem2.PrepareTransactionRequestParameters, options: {
|
|
408
408
|
phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
|
|
409
|
-
}) => Promise<
|
|
409
|
+
}) => Promise<viem2.PrepareTransactionRequestParameters>) | undefined, options: {
|
|
410
410
|
runAt: readonly ("beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters")[];
|
|
411
411
|
}] | undefined;
|
|
412
|
-
serializers?:
|
|
413
|
-
verifyHash?: ((client:
|
|
412
|
+
serializers?: viem2.ChainSerializers<undefined, viem2.TransactionSerializable> | undefined;
|
|
413
|
+
verifyHash?: ((client: viem2.Client, parameters: viem2.VerifyHashActionParameters) => Promise<viem2.VerifyHashActionReturnType>) | undefined;
|
|
414
414
|
} | {
|
|
415
415
|
blockExplorers: {
|
|
416
416
|
readonly default: {
|
|
@@ -484,7 +484,7 @@ declare const selectChain: () => Promise<{
|
|
|
484
484
|
testnet: true;
|
|
485
485
|
custom?: Record<string, unknown> | undefined;
|
|
486
486
|
extendSchema?: Record<string, unknown> | undefined;
|
|
487
|
-
fees?:
|
|
487
|
+
fees?: viem2.ChainFees<undefined> | undefined;
|
|
488
488
|
formatters: {
|
|
489
489
|
readonly block: {
|
|
490
490
|
exclude: [] | undefined;
|
|
@@ -493,28 +493,28 @@ declare const selectChain: () => Promise<{
|
|
|
493
493
|
blobGasUsed: bigint;
|
|
494
494
|
difficulty: bigint;
|
|
495
495
|
excessBlobGas: bigint;
|
|
496
|
-
extraData:
|
|
496
|
+
extraData: viem2.Hex;
|
|
497
497
|
gasLimit: bigint;
|
|
498
498
|
gasUsed: bigint;
|
|
499
499
|
hash: `0x${string}` | null;
|
|
500
500
|
logsBloom: `0x${string}` | null;
|
|
501
|
-
miner:
|
|
502
|
-
mixHash:
|
|
501
|
+
miner: viem2.Address;
|
|
502
|
+
mixHash: viem2.Hash;
|
|
503
503
|
nonce: `0x${string}` | null;
|
|
504
504
|
number: bigint | null;
|
|
505
505
|
parentBeaconBlockRoot?: `0x${string}` | undefined;
|
|
506
|
-
parentHash:
|
|
507
|
-
receiptsRoot:
|
|
508
|
-
sealFields:
|
|
509
|
-
sha3Uncles:
|
|
506
|
+
parentHash: viem2.Hash;
|
|
507
|
+
receiptsRoot: viem2.Hex;
|
|
508
|
+
sealFields: viem2.Hex[];
|
|
509
|
+
sha3Uncles: viem2.Hash;
|
|
510
510
|
size: bigint;
|
|
511
|
-
stateRoot:
|
|
511
|
+
stateRoot: viem2.Hash;
|
|
512
512
|
timestamp: bigint;
|
|
513
513
|
totalDifficulty: bigint | null;
|
|
514
514
|
transactions: `0x${string}`[] | viem_chains0.OpStackTransaction<boolean>[];
|
|
515
|
-
transactionsRoot:
|
|
516
|
-
uncles:
|
|
517
|
-
withdrawals?:
|
|
515
|
+
transactionsRoot: viem2.Hash;
|
|
516
|
+
uncles: viem2.Hash[];
|
|
517
|
+
withdrawals?: viem2.Withdrawal[] | undefined | undefined;
|
|
518
518
|
withdrawalsRoot?: `0x${string}` | undefined;
|
|
519
519
|
} & {};
|
|
520
520
|
type: "block";
|
|
@@ -524,16 +524,16 @@ declare const selectChain: () => Promise<{
|
|
|
524
524
|
format: (args: viem_chains0.OpStackRpcTransaction, action?: string | undefined) => ({
|
|
525
525
|
blockHash: `0x${string}` | null;
|
|
526
526
|
blockNumber: bigint | null;
|
|
527
|
-
from:
|
|
527
|
+
from: viem2.Address;
|
|
528
528
|
gas: bigint;
|
|
529
|
-
hash:
|
|
530
|
-
input:
|
|
529
|
+
hash: viem2.Hash;
|
|
530
|
+
input: viem2.Hex;
|
|
531
531
|
nonce: number;
|
|
532
|
-
r:
|
|
533
|
-
s:
|
|
534
|
-
to:
|
|
532
|
+
r: viem2.Hex;
|
|
533
|
+
s: viem2.Hex;
|
|
534
|
+
to: viem2.Address | null;
|
|
535
535
|
transactionIndex: number | null;
|
|
536
|
-
typeHex:
|
|
536
|
+
typeHex: viem2.Hex | null;
|
|
537
537
|
v: bigint;
|
|
538
538
|
value: bigint;
|
|
539
539
|
yParity: number;
|
|
@@ -543,23 +543,23 @@ declare const selectChain: () => Promise<{
|
|
|
543
543
|
maxPriorityFeePerGas: bigint;
|
|
544
544
|
isSystemTx?: boolean;
|
|
545
545
|
mint?: bigint | undefined | undefined;
|
|
546
|
-
sourceHash:
|
|
546
|
+
sourceHash: viem2.Hex;
|
|
547
547
|
type: "deposit";
|
|
548
548
|
} | {
|
|
549
|
-
r:
|
|
550
|
-
s:
|
|
549
|
+
r: viem2.Hex;
|
|
550
|
+
s: viem2.Hex;
|
|
551
551
|
v: bigint;
|
|
552
|
-
to:
|
|
553
|
-
from:
|
|
552
|
+
to: viem2.Address | null;
|
|
553
|
+
from: viem2.Address;
|
|
554
554
|
gas: bigint;
|
|
555
555
|
nonce: number;
|
|
556
556
|
value: bigint;
|
|
557
557
|
blockHash: `0x${string}` | null;
|
|
558
558
|
blockNumber: bigint | null;
|
|
559
|
-
hash:
|
|
560
|
-
input:
|
|
559
|
+
hash: viem2.Hash;
|
|
560
|
+
input: viem2.Hex;
|
|
561
561
|
transactionIndex: number | null;
|
|
562
|
-
typeHex:
|
|
562
|
+
typeHex: viem2.Hex | null;
|
|
563
563
|
accessList?: undefined | undefined;
|
|
564
564
|
authorizationList?: undefined | undefined;
|
|
565
565
|
blobVersionedHashes?: undefined | undefined;
|
|
@@ -576,20 +576,20 @@ declare const selectChain: () => Promise<{
|
|
|
576
576
|
} | {
|
|
577
577
|
blockHash: `0x${string}` | null;
|
|
578
578
|
blockNumber: bigint | null;
|
|
579
|
-
from:
|
|
579
|
+
from: viem2.Address;
|
|
580
580
|
gas: bigint;
|
|
581
|
-
hash:
|
|
582
|
-
input:
|
|
581
|
+
hash: viem2.Hash;
|
|
582
|
+
input: viem2.Hex;
|
|
583
583
|
nonce: number;
|
|
584
|
-
r:
|
|
585
|
-
s:
|
|
586
|
-
to:
|
|
584
|
+
r: viem2.Hex;
|
|
585
|
+
s: viem2.Hex;
|
|
586
|
+
to: viem2.Address | null;
|
|
587
587
|
transactionIndex: number | null;
|
|
588
|
-
typeHex:
|
|
588
|
+
typeHex: viem2.Hex | null;
|
|
589
589
|
v: bigint;
|
|
590
590
|
value: bigint;
|
|
591
591
|
yParity: number;
|
|
592
|
-
accessList:
|
|
592
|
+
accessList: viem2.AccessList;
|
|
593
593
|
authorizationList?: undefined | undefined;
|
|
594
594
|
blobVersionedHashes?: undefined | undefined;
|
|
595
595
|
chainId: number;
|
|
@@ -604,20 +604,20 @@ declare const selectChain: () => Promise<{
|
|
|
604
604
|
} | {
|
|
605
605
|
blockHash: `0x${string}` | null;
|
|
606
606
|
blockNumber: bigint | null;
|
|
607
|
-
from:
|
|
607
|
+
from: viem2.Address;
|
|
608
608
|
gas: bigint;
|
|
609
|
-
hash:
|
|
610
|
-
input:
|
|
609
|
+
hash: viem2.Hash;
|
|
610
|
+
input: viem2.Hex;
|
|
611
611
|
nonce: number;
|
|
612
|
-
r:
|
|
613
|
-
s:
|
|
614
|
-
to:
|
|
612
|
+
r: viem2.Hex;
|
|
613
|
+
s: viem2.Hex;
|
|
614
|
+
to: viem2.Address | null;
|
|
615
615
|
transactionIndex: number | null;
|
|
616
|
-
typeHex:
|
|
616
|
+
typeHex: viem2.Hex | null;
|
|
617
617
|
v: bigint;
|
|
618
618
|
value: bigint;
|
|
619
619
|
yParity: number;
|
|
620
|
-
accessList:
|
|
620
|
+
accessList: viem2.AccessList;
|
|
621
621
|
authorizationList?: undefined | undefined;
|
|
622
622
|
blobVersionedHashes?: undefined | undefined;
|
|
623
623
|
chainId: number;
|
|
@@ -632,22 +632,22 @@ declare const selectChain: () => Promise<{
|
|
|
632
632
|
} | {
|
|
633
633
|
blockHash: `0x${string}` | null;
|
|
634
634
|
blockNumber: bigint | null;
|
|
635
|
-
from:
|
|
635
|
+
from: viem2.Address;
|
|
636
636
|
gas: bigint;
|
|
637
|
-
hash:
|
|
638
|
-
input:
|
|
637
|
+
hash: viem2.Hash;
|
|
638
|
+
input: viem2.Hex;
|
|
639
639
|
nonce: number;
|
|
640
|
-
r:
|
|
641
|
-
s:
|
|
642
|
-
to:
|
|
640
|
+
r: viem2.Hex;
|
|
641
|
+
s: viem2.Hex;
|
|
642
|
+
to: viem2.Address | null;
|
|
643
643
|
transactionIndex: number | null;
|
|
644
|
-
typeHex:
|
|
644
|
+
typeHex: viem2.Hex | null;
|
|
645
645
|
v: bigint;
|
|
646
646
|
value: bigint;
|
|
647
647
|
yParity: number;
|
|
648
|
-
accessList:
|
|
648
|
+
accessList: viem2.AccessList;
|
|
649
649
|
authorizationList?: undefined | undefined;
|
|
650
|
-
blobVersionedHashes: readonly
|
|
650
|
+
blobVersionedHashes: readonly viem2.Hex[];
|
|
651
651
|
chainId: number;
|
|
652
652
|
type: "eip4844";
|
|
653
653
|
gasPrice?: undefined | undefined;
|
|
@@ -660,21 +660,21 @@ declare const selectChain: () => Promise<{
|
|
|
660
660
|
} | {
|
|
661
661
|
blockHash: `0x${string}` | null;
|
|
662
662
|
blockNumber: bigint | null;
|
|
663
|
-
from:
|
|
663
|
+
from: viem2.Address;
|
|
664
664
|
gas: bigint;
|
|
665
|
-
hash:
|
|
666
|
-
input:
|
|
665
|
+
hash: viem2.Hash;
|
|
666
|
+
input: viem2.Hex;
|
|
667
667
|
nonce: number;
|
|
668
|
-
r:
|
|
669
|
-
s:
|
|
670
|
-
to:
|
|
668
|
+
r: viem2.Hex;
|
|
669
|
+
s: viem2.Hex;
|
|
670
|
+
to: viem2.Address | null;
|
|
671
671
|
transactionIndex: number | null;
|
|
672
|
-
typeHex:
|
|
672
|
+
typeHex: viem2.Hex | null;
|
|
673
673
|
v: bigint;
|
|
674
674
|
value: bigint;
|
|
675
675
|
yParity: number;
|
|
676
|
-
accessList:
|
|
677
|
-
authorizationList:
|
|
676
|
+
accessList: viem2.AccessList;
|
|
677
|
+
authorizationList: viem2.SignedAuthorizationList;
|
|
678
678
|
blobVersionedHashes?: undefined | undefined;
|
|
679
679
|
chainId: number;
|
|
680
680
|
type: "eip7702";
|
|
@@ -693,22 +693,22 @@ declare const selectChain: () => Promise<{
|
|
|
693
693
|
format: (args: viem_chains0.OpStackRpcTransactionReceipt, action?: string | undefined) => {
|
|
694
694
|
blobGasPrice?: bigint | undefined;
|
|
695
695
|
blobGasUsed?: bigint | undefined;
|
|
696
|
-
blockHash:
|
|
696
|
+
blockHash: viem2.Hash;
|
|
697
697
|
blockNumber: bigint;
|
|
698
698
|
blockTimestamp?: bigint | undefined;
|
|
699
|
-
contractAddress:
|
|
699
|
+
contractAddress: viem2.Address | null | undefined;
|
|
700
700
|
cumulativeGasUsed: bigint;
|
|
701
701
|
effectiveGasPrice: bigint;
|
|
702
|
-
from:
|
|
702
|
+
from: viem2.Address;
|
|
703
703
|
gasUsed: bigint;
|
|
704
|
-
logs:
|
|
705
|
-
logsBloom:
|
|
704
|
+
logs: viem2.Log<bigint, number, false>[];
|
|
705
|
+
logsBloom: viem2.Hex;
|
|
706
706
|
root?: `0x${string}` | undefined;
|
|
707
707
|
status: "success" | "reverted";
|
|
708
|
-
to:
|
|
709
|
-
transactionHash:
|
|
708
|
+
to: viem2.Address | null;
|
|
709
|
+
transactionHash: viem2.Hash;
|
|
710
710
|
transactionIndex: number;
|
|
711
|
-
type:
|
|
711
|
+
type: viem2.TransactionType;
|
|
712
712
|
l1GasPrice: bigint | null;
|
|
713
713
|
l1GasUsed: bigint | null;
|
|
714
714
|
l1Fee: bigint | null;
|
|
@@ -717,17 +717,17 @@ declare const selectChain: () => Promise<{
|
|
|
717
717
|
type: "transactionReceipt";
|
|
718
718
|
};
|
|
719
719
|
};
|
|
720
|
-
prepareTransactionRequest?: ((args:
|
|
720
|
+
prepareTransactionRequest?: ((args: viem2.PrepareTransactionRequestParameters, options: {
|
|
721
721
|
phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
|
|
722
|
-
}) => Promise<
|
|
722
|
+
}) => Promise<viem2.PrepareTransactionRequestParameters>) | [fn: ((args: viem2.PrepareTransactionRequestParameters, options: {
|
|
723
723
|
phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
|
|
724
|
-
}) => Promise<
|
|
724
|
+
}) => Promise<viem2.PrepareTransactionRequestParameters>) | undefined, options: {
|
|
725
725
|
runAt: readonly ("beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters")[];
|
|
726
726
|
}] | undefined;
|
|
727
727
|
serializers: {
|
|
728
728
|
readonly transaction: typeof viem_chains0.serializeTransactionOpStack;
|
|
729
729
|
};
|
|
730
|
-
verifyHash?: ((client:
|
|
730
|
+
verifyHash?: ((client: viem2.Client, parameters: viem2.VerifyHashActionParameters) => Promise<viem2.VerifyHashActionReturnType>) | undefined;
|
|
731
731
|
readonly network: "base-sepolia";
|
|
732
732
|
}>;
|
|
733
733
|
declare function parseGadgetArg(raw: string): {
|
package/lib/config.d.ts
CHANGED
|
@@ -758,9 +758,9 @@ interface AppConfig {
|
|
|
758
758
|
}
|
|
759
759
|
declare const FangornConfig: {
|
|
760
760
|
ArbitrumSepolia: {
|
|
761
|
-
dataSourceRegistryContractAddress: "
|
|
762
|
-
schemaRegistryContractAddress: "
|
|
763
|
-
settlementRegistryContractAddress: "
|
|
761
|
+
dataSourceRegistryContractAddress: "0x14cff4b583cabde7066d12f04bf9eaba408a426f";
|
|
762
|
+
schemaRegistryContractAddress: "0xfe63c0748cc992c7258dc3c92b44247f44f88577";
|
|
763
|
+
settlementRegistryContractAddress: "0x282915f5c6f6c9b15c131fa379916da47754fbef";
|
|
764
764
|
chainName: string;
|
|
765
765
|
chain: {
|
|
766
766
|
blockExplorers: {
|
package/lib/config.js
CHANGED
|
@@ -26,9 +26,9 @@ function getNetwork(name) {
|
|
|
26
26
|
}
|
|
27
27
|
const FangornConfig = {
|
|
28
28
|
ArbitrumSepolia: {
|
|
29
|
-
dataSourceRegistryContractAddress: "
|
|
30
|
-
schemaRegistryContractAddress: "
|
|
31
|
-
settlementRegistryContractAddress: "
|
|
29
|
+
dataSourceRegistryContractAddress: "0x14cff4b583cabde7066d12f04bf9eaba408a426f",
|
|
30
|
+
schemaRegistryContractAddress: "0xfe63c0748cc992c7258dc3c92b44247f44f88577",
|
|
31
|
+
settlementRegistryContractAddress: "0x282915f5c6f6c9b15c131fa379916da47754fbef",
|
|
32
32
|
chainName: "arbitrumSepolia",
|
|
33
33
|
chain: arbitrumSepolia,
|
|
34
34
|
rpcUrl: "https://sepolia-rollup.arbitrum.io/rpc",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as viem0 from "viem";
|
|
2
2
|
import { Address, Hash, Hex, PublicClient, WalletClient } from "viem";
|
|
3
3
|
|
|
4
4
|
//#region src/registries/datasource-registry/index.d.ts
|
|
@@ -23,7 +23,7 @@ declare class DataSourceRegistry {
|
|
|
23
23
|
resourceId(owner: Address, schemaId: Hex, name: string): Promise<Hex>;
|
|
24
24
|
static resourceIdLocal(owner: Address, schemaId: Hex, name: string): Hex;
|
|
25
25
|
hashName(name: string): Hex;
|
|
26
|
-
waitForTransaction(hash: Hash): Promise<
|
|
26
|
+
waitForTransaction(hash: Hash): Promise<viem0.TransactionReceipt>;
|
|
27
27
|
private estimateGas;
|
|
28
28
|
}
|
|
29
29
|
//#endregion
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as viem0 from "viem";
|
|
2
2
|
import { Address, Hash, Hex, PublicClient, WalletClient } from "viem";
|
|
3
3
|
|
|
4
4
|
//#region src/registries/schema-registry/index.d.ts
|
|
@@ -27,7 +27,7 @@ declare class SchemaRegistry {
|
|
|
27
27
|
hasPublishers(nameOrId: string): Promise<boolean>;
|
|
28
28
|
isPublisher(nameOrId: string, publisher: Address): Promise<boolean>;
|
|
29
29
|
getPublisherCount(nameOrId: string): Promise<bigint>;
|
|
30
|
-
waitForTransaction(hash: Hash): Promise<
|
|
30
|
+
waitForTransaction(hash: Hash): Promise<viem0.TransactionReceipt>;
|
|
31
31
|
private resolveId;
|
|
32
32
|
}
|
|
33
33
|
//#endregion
|
|
@@ -1,47 +1,11 @@
|
|
|
1
1
|
//#region src/registries/settlement-registry/abi.d.ts
|
|
2
2
|
declare const SETTLEMENT_REGISTRY_ABI: readonly [{
|
|
3
|
-
readonly inputs: readonly [
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
readonly name: "
|
|
9
|
-
readonly type: "error";
|
|
10
|
-
}, {
|
|
11
|
-
readonly inputs: readonly [];
|
|
12
|
-
readonly name: "GroupCreationFailed";
|
|
13
|
-
readonly type: "error";
|
|
14
|
-
}, {
|
|
15
|
-
readonly inputs: readonly [];
|
|
16
|
-
readonly name: "HookFailed";
|
|
17
|
-
readonly type: "error";
|
|
18
|
-
}, {
|
|
19
|
-
readonly inputs: readonly [];
|
|
20
|
-
readonly name: "IncorrectPaymentAmount";
|
|
21
|
-
readonly type: "error";
|
|
22
|
-
}, {
|
|
23
|
-
readonly inputs: readonly [];
|
|
24
|
-
readonly name: "NotAdmin";
|
|
25
|
-
readonly type: "error";
|
|
26
|
-
}, {
|
|
27
|
-
readonly inputs: readonly [];
|
|
28
|
-
readonly name: "NotAuthorizedRegistry";
|
|
29
|
-
readonly type: "error";
|
|
30
|
-
}, {
|
|
31
|
-
readonly inputs: readonly [];
|
|
32
|
-
readonly name: "NotResourceOwner";
|
|
33
|
-
readonly type: "error";
|
|
34
|
-
}, {
|
|
35
|
-
readonly inputs: readonly [];
|
|
36
|
-
readonly name: "ResourceNotFound";
|
|
37
|
-
readonly type: "error";
|
|
38
|
-
}, {
|
|
39
|
-
readonly inputs: readonly [];
|
|
40
|
-
readonly name: "TransferFailed";
|
|
41
|
-
readonly type: "error";
|
|
42
|
-
}, {
|
|
43
|
-
readonly inputs: readonly [];
|
|
44
|
-
readonly name: "VerificationFailed";
|
|
3
|
+
readonly inputs: readonly [{
|
|
4
|
+
readonly internalType: "uint8";
|
|
5
|
+
readonly name: "";
|
|
6
|
+
readonly type: "uint8";
|
|
7
|
+
}];
|
|
8
|
+
readonly name: "ErrCode";
|
|
45
9
|
readonly type: "error";
|
|
46
10
|
}, {
|
|
47
11
|
readonly inputs: readonly [{
|
|
@@ -79,20 +43,6 @@ declare const SETTLEMENT_REGISTRY_ABI: readonly [{
|
|
|
79
43
|
}];
|
|
80
44
|
readonly stateMutability: "view";
|
|
81
45
|
readonly type: "function";
|
|
82
|
-
}, {
|
|
83
|
-
readonly inputs: readonly [{
|
|
84
|
-
readonly internalType: "bytes32";
|
|
85
|
-
readonly name: "resource_id";
|
|
86
|
-
readonly type: "bytes32";
|
|
87
|
-
}];
|
|
88
|
-
readonly name: "getOwner";
|
|
89
|
-
readonly outputs: readonly [{
|
|
90
|
-
readonly internalType: "address";
|
|
91
|
-
readonly name: "";
|
|
92
|
-
readonly type: "address";
|
|
93
|
-
}];
|
|
94
|
-
readonly stateMutability: "view";
|
|
95
|
-
readonly type: "function";
|
|
96
46
|
}, {
|
|
97
47
|
readonly inputs: readonly [{
|
|
98
48
|
readonly internalType: "bytes32";
|
|
@@ -193,20 +143,6 @@ declare const SETTLEMENT_REGISTRY_ABI: readonly [{
|
|
|
193
143
|
readonly outputs: readonly [];
|
|
194
144
|
readonly stateMutability: "payable";
|
|
195
145
|
readonly type: "function";
|
|
196
|
-
}, {
|
|
197
|
-
readonly inputs: readonly [{
|
|
198
|
-
readonly internalType: "bytes32";
|
|
199
|
-
readonly name: "resource_id";
|
|
200
|
-
readonly type: "bytes32";
|
|
201
|
-
}, {
|
|
202
|
-
readonly internalType: "address";
|
|
203
|
-
readonly name: "hook";
|
|
204
|
-
readonly type: "address";
|
|
205
|
-
}];
|
|
206
|
-
readonly name: "registerHook";
|
|
207
|
-
readonly outputs: readonly [];
|
|
208
|
-
readonly stateMutability: "nonpayable";
|
|
209
|
-
readonly type: "function";
|
|
210
146
|
}, {
|
|
211
147
|
readonly inputs: readonly [{
|
|
212
148
|
readonly internalType: "address";
|
|
@@ -264,16 +200,16 @@ declare const SETTLEMENT_REGISTRY_ABI: readonly [{
|
|
|
264
200
|
readonly internalType: "bytes32";
|
|
265
201
|
readonly name: "resource_id";
|
|
266
202
|
readonly type: "bytes32";
|
|
203
|
+
}, {
|
|
204
|
+
readonly internalType: "address";
|
|
205
|
+
readonly name: "hook";
|
|
206
|
+
readonly type: "address";
|
|
267
207
|
}, {
|
|
268
208
|
readonly internalType: "uint256";
|
|
269
209
|
readonly name: "price";
|
|
270
210
|
readonly type: "uint256";
|
|
271
|
-
}, {
|
|
272
|
-
readonly internalType: "address";
|
|
273
|
-
readonly name: "owner";
|
|
274
|
-
readonly type: "address";
|
|
275
211
|
}];
|
|
276
|
-
readonly name: "
|
|
212
|
+
readonly name: "updateResource";
|
|
277
213
|
readonly outputs: readonly [];
|
|
278
214
|
readonly stateMutability: "nonpayable";
|
|
279
215
|
readonly type: "function";
|
|
@@ -1,58 +1,12 @@
|
|
|
1
1
|
//#region src/registries/settlement-registry/abi.ts
|
|
2
2
|
const SETTLEMENT_REGISTRY_ABI = [
|
|
3
3
|
{
|
|
4
|
-
"inputs": [
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
"
|
|
10
|
-
"name": "AlreadySettled",
|
|
11
|
-
"type": "error"
|
|
12
|
-
},
|
|
13
|
-
{
|
|
14
|
-
"inputs": [],
|
|
15
|
-
"name": "GroupCreationFailed",
|
|
16
|
-
"type": "error"
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
"inputs": [],
|
|
20
|
-
"name": "HookFailed",
|
|
21
|
-
"type": "error"
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
"inputs": [],
|
|
25
|
-
"name": "IncorrectPaymentAmount",
|
|
26
|
-
"type": "error"
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
"inputs": [],
|
|
30
|
-
"name": "NotAdmin",
|
|
31
|
-
"type": "error"
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
"inputs": [],
|
|
35
|
-
"name": "NotAuthorizedRegistry",
|
|
36
|
-
"type": "error"
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
"inputs": [],
|
|
40
|
-
"name": "NotResourceOwner",
|
|
41
|
-
"type": "error"
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
"inputs": [],
|
|
45
|
-
"name": "ResourceNotFound",
|
|
46
|
-
"type": "error"
|
|
47
|
-
},
|
|
48
|
-
{
|
|
49
|
-
"inputs": [],
|
|
50
|
-
"name": "TransferFailed",
|
|
51
|
-
"type": "error"
|
|
52
|
-
},
|
|
53
|
-
{
|
|
54
|
-
"inputs": [],
|
|
55
|
-
"name": "VerificationFailed",
|
|
4
|
+
"inputs": [{
|
|
5
|
+
"internalType": "uint8",
|
|
6
|
+
"name": "",
|
|
7
|
+
"type": "uint8"
|
|
8
|
+
}],
|
|
9
|
+
"name": "ErrCode",
|
|
56
10
|
"type": "error"
|
|
57
11
|
},
|
|
58
12
|
{
|
|
@@ -97,21 +51,6 @@ const SETTLEMENT_REGISTRY_ABI = [
|
|
|
97
51
|
"stateMutability": "view",
|
|
98
52
|
"type": "function"
|
|
99
53
|
},
|
|
100
|
-
{
|
|
101
|
-
"inputs": [{
|
|
102
|
-
"internalType": "bytes32",
|
|
103
|
-
"name": "resource_id",
|
|
104
|
-
"type": "bytes32"
|
|
105
|
-
}],
|
|
106
|
-
"name": "getOwner",
|
|
107
|
-
"outputs": [{
|
|
108
|
-
"internalType": "address",
|
|
109
|
-
"name": "",
|
|
110
|
-
"type": "address"
|
|
111
|
-
}],
|
|
112
|
-
"stateMutability": "view",
|
|
113
|
-
"type": "function"
|
|
114
|
-
},
|
|
115
54
|
{
|
|
116
55
|
"inputs": [{
|
|
117
56
|
"internalType": "bytes32",
|
|
@@ -228,21 +167,6 @@ const SETTLEMENT_REGISTRY_ABI = [
|
|
|
228
167
|
"stateMutability": "payable",
|
|
229
168
|
"type": "function"
|
|
230
169
|
},
|
|
231
|
-
{
|
|
232
|
-
"inputs": [{
|
|
233
|
-
"internalType": "bytes32",
|
|
234
|
-
"name": "resource_id",
|
|
235
|
-
"type": "bytes32"
|
|
236
|
-
}, {
|
|
237
|
-
"internalType": "address",
|
|
238
|
-
"name": "hook",
|
|
239
|
-
"type": "address"
|
|
240
|
-
}],
|
|
241
|
-
"name": "registerHook",
|
|
242
|
-
"outputs": [],
|
|
243
|
-
"stateMutability": "nonpayable",
|
|
244
|
-
"type": "function"
|
|
245
|
-
},
|
|
246
170
|
{
|
|
247
171
|
"inputs": [{
|
|
248
172
|
"internalType": "address",
|
|
@@ -313,18 +237,18 @@ const SETTLEMENT_REGISTRY_ABI = [
|
|
|
313
237
|
"name": "resource_id",
|
|
314
238
|
"type": "bytes32"
|
|
315
239
|
},
|
|
240
|
+
{
|
|
241
|
+
"internalType": "address",
|
|
242
|
+
"name": "hook",
|
|
243
|
+
"type": "address"
|
|
244
|
+
},
|
|
316
245
|
{
|
|
317
246
|
"internalType": "uint256",
|
|
318
247
|
"name": "price",
|
|
319
248
|
"type": "uint256"
|
|
320
|
-
},
|
|
321
|
-
{
|
|
322
|
-
"internalType": "address",
|
|
323
|
-
"name": "owner",
|
|
324
|
-
"type": "address"
|
|
325
249
|
}
|
|
326
250
|
],
|
|
327
|
-
"name": "
|
|
251
|
+
"name": "updateResource",
|
|
328
252
|
"outputs": [],
|
|
329
253
|
"stateMutability": "nonpayable",
|
|
330
254
|
"type": "function"
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PrepareSettleParams, PrepareSettleResult, RegisterParams, SettleParams, TransferWithAuthParams, TransferWithAuthPayload } from "./types.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as viem1 from "viem";
|
|
3
3
|
import { Address, Hex, PublicClient, WalletClient } from "viem";
|
|
4
4
|
|
|
5
5
|
//#region src/registries/settlement-registry/index.d.ts
|
|
@@ -26,12 +26,7 @@ declare class SettlementRegistry {
|
|
|
26
26
|
* Update the price for a resource.
|
|
27
27
|
* In production this is called by the DataSourceRegistry.
|
|
28
28
|
*/
|
|
29
|
-
updatePrice(resourceId: Hex,
|
|
30
|
-
/**
|
|
31
|
-
* Register a hook contract for a resource.
|
|
32
|
-
* Called directly by the publisher wallet (msg.sender must be resource owner).
|
|
33
|
-
*/
|
|
34
|
-
registerHook(resourceId: Hex, hook: Address): Promise<Hex>;
|
|
29
|
+
updatePrice(resourceId: Hex, hook: Address, price: bigint): Promise<Hex>;
|
|
35
30
|
/**
|
|
36
31
|
* Prepare the EIP-3009 transferWithAuthorization signature.
|
|
37
32
|
*/
|
|
@@ -58,8 +53,7 @@ declare class SettlementRegistry {
|
|
|
58
53
|
isRegistered(resourceId: Hex, identityCommitment: bigint): Promise<boolean>;
|
|
59
54
|
getGroupId(resourceId: Hex): Promise<bigint>;
|
|
60
55
|
getPrice(resourceId: Hex): Promise<bigint>;
|
|
61
|
-
|
|
62
|
-
waitForTransaction(hash: Hex): Promise<viem171.TransactionReceipt>;
|
|
56
|
+
waitForTransaction(hash: Hex): Promise<viem1.TransactionReceipt>;
|
|
63
57
|
/**
|
|
64
58
|
* Reconstruct the Semaphore group from MemberRegistered events.
|
|
65
59
|
*/
|
|
@@ -65,16 +65,16 @@ var SettlementRegistry = class {
|
|
|
65
65
|
* Update the price for a resource.
|
|
66
66
|
* In production this is called by the DataSourceRegistry.
|
|
67
67
|
*/
|
|
68
|
-
async updatePrice(resourceId,
|
|
68
|
+
async updatePrice(resourceId, hook, price) {
|
|
69
69
|
const account = this.getAccount();
|
|
70
70
|
const hash = await this.walletClient.writeContract({
|
|
71
71
|
address: this.contractAddress,
|
|
72
72
|
abi: SETTLEMENT_REGISTRY_ABI,
|
|
73
|
-
functionName: "
|
|
73
|
+
functionName: "updateResource",
|
|
74
74
|
args: [
|
|
75
75
|
resourceId,
|
|
76
|
-
|
|
77
|
-
|
|
76
|
+
hook,
|
|
77
|
+
price
|
|
78
78
|
],
|
|
79
79
|
chain: this.getChain(),
|
|
80
80
|
account
|
|
@@ -83,23 +83,6 @@ var SettlementRegistry = class {
|
|
|
83
83
|
return hash;
|
|
84
84
|
}
|
|
85
85
|
/**
|
|
86
|
-
* Register a hook contract for a resource.
|
|
87
|
-
* Called directly by the publisher wallet (msg.sender must be resource owner).
|
|
88
|
-
*/
|
|
89
|
-
async registerHook(resourceId, hook) {
|
|
90
|
-
const account = this.getAccount();
|
|
91
|
-
const hash = await this.walletClient.writeContract({
|
|
92
|
-
address: this.contractAddress,
|
|
93
|
-
abi: SETTLEMENT_REGISTRY_ABI,
|
|
94
|
-
functionName: "registerHook",
|
|
95
|
-
args: [resourceId, hook],
|
|
96
|
-
chain: this.getChain(),
|
|
97
|
-
account
|
|
98
|
-
});
|
|
99
|
-
await this.publicClient.waitForTransactionReceipt({ hash });
|
|
100
|
-
return hash;
|
|
101
|
-
}
|
|
102
|
-
/**
|
|
103
86
|
* Prepare the EIP-3009 transferWithAuthorization signature.
|
|
104
87
|
*/
|
|
105
88
|
async prepareTransferWithAuth(params) {
|
|
@@ -300,14 +283,6 @@ var SettlementRegistry = class {
|
|
|
300
283
|
args: [resourceId]
|
|
301
284
|
});
|
|
302
285
|
}
|
|
303
|
-
async getOwner(resourceId) {
|
|
304
|
-
return this.publicClient.readContract({
|
|
305
|
-
address: this.contractAddress,
|
|
306
|
-
abi: SETTLEMENT_REGISTRY_ABI,
|
|
307
|
-
functionName: "getOwner",
|
|
308
|
-
args: [resourceId]
|
|
309
|
-
});
|
|
310
|
-
}
|
|
311
286
|
async waitForTransaction(hash) {
|
|
312
287
|
return this.publicClient.waitForTransactionReceipt({ hash });
|
|
313
288
|
}
|