@gitmyabi/relayadapt7702 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +108 -0
- package/contracts/RelayAdapt7702_json.d.ts +1154 -0
- package/contracts/RelayAdapt7702_json.js +1207 -0
- package/contracts/RelayAdapt7702_json.ts +1504 -0
- package/contracts/index.d.ts +2 -0
- package/contracts/index.js +7 -0
- package/contracts/index.ts +3 -0
- package/index.d.ts +1 -0
- package/index.js +19 -0
- package/package.json +43 -0
|
@@ -0,0 +1,1207 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RelayAdapt7702_json = exports.RelayAdapt7702_jsonAbi = void 0;
|
|
4
|
+
const viem_1 = require("viem");
|
|
5
|
+
/**
|
|
6
|
+
* RelayAdapt7702_json ABI
|
|
7
|
+
*
|
|
8
|
+
* This ABI is typed using viem's type system for full type safety.
|
|
9
|
+
*/
|
|
10
|
+
exports.RelayAdapt7702_jsonAbi = [
|
|
11
|
+
{
|
|
12
|
+
"inputs": [
|
|
13
|
+
{
|
|
14
|
+
"internalType": "address",
|
|
15
|
+
"name": "_railgun",
|
|
16
|
+
"type": "address"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"internalType": "address",
|
|
20
|
+
"name": "_wBase",
|
|
21
|
+
"type": "address"
|
|
22
|
+
}
|
|
23
|
+
],
|
|
24
|
+
"stateMutability": "nonpayable",
|
|
25
|
+
"type": "constructor"
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"inputs": [
|
|
29
|
+
{
|
|
30
|
+
"internalType": "uint256",
|
|
31
|
+
"name": "callIndex",
|
|
32
|
+
"type": "uint256"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"internalType": "bytes",
|
|
36
|
+
"name": "revertReason",
|
|
37
|
+
"type": "bytes"
|
|
38
|
+
}
|
|
39
|
+
],
|
|
40
|
+
"name": "CallFailed",
|
|
41
|
+
"type": "error"
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"inputs": [],
|
|
45
|
+
"name": "ECDSAInvalidSignature",
|
|
46
|
+
"type": "error"
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"inputs": [
|
|
50
|
+
{
|
|
51
|
+
"internalType": "uint256",
|
|
52
|
+
"name": "length",
|
|
53
|
+
"type": "uint256"
|
|
54
|
+
}
|
|
55
|
+
],
|
|
56
|
+
"name": "ECDSAInvalidSignatureLength",
|
|
57
|
+
"type": "error"
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"inputs": [
|
|
61
|
+
{
|
|
62
|
+
"internalType": "bytes32",
|
|
63
|
+
"name": "s",
|
|
64
|
+
"type": "bytes32"
|
|
65
|
+
}
|
|
66
|
+
],
|
|
67
|
+
"name": "ECDSAInvalidSignatureS",
|
|
68
|
+
"type": "error"
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
"inputs": [
|
|
72
|
+
{
|
|
73
|
+
"internalType": "address",
|
|
74
|
+
"name": "token",
|
|
75
|
+
"type": "address"
|
|
76
|
+
}
|
|
77
|
+
],
|
|
78
|
+
"name": "SafeERC20FailedOperation",
|
|
79
|
+
"type": "error"
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
"anonymous": false,
|
|
83
|
+
"inputs": [
|
|
84
|
+
{
|
|
85
|
+
"indexed": false,
|
|
86
|
+
"internalType": "uint256",
|
|
87
|
+
"name": "callIndex",
|
|
88
|
+
"type": "uint256"
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
"indexed": false,
|
|
92
|
+
"internalType": "bytes",
|
|
93
|
+
"name": "revertReason",
|
|
94
|
+
"type": "bytes"
|
|
95
|
+
}
|
|
96
|
+
],
|
|
97
|
+
"name": "CallError",
|
|
98
|
+
"type": "event"
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
"inputs": [],
|
|
102
|
+
"name": "DOMAIN_SEPARATOR",
|
|
103
|
+
"outputs": [
|
|
104
|
+
{
|
|
105
|
+
"internalType": "bytes32",
|
|
106
|
+
"name": "",
|
|
107
|
+
"type": "bytes32"
|
|
108
|
+
}
|
|
109
|
+
],
|
|
110
|
+
"stateMutability": "view",
|
|
111
|
+
"type": "function"
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
"inputs": [],
|
|
115
|
+
"name": "EXECUTE_TYPEHASH",
|
|
116
|
+
"outputs": [
|
|
117
|
+
{
|
|
118
|
+
"internalType": "bytes32",
|
|
119
|
+
"name": "",
|
|
120
|
+
"type": "bytes32"
|
|
121
|
+
}
|
|
122
|
+
],
|
|
123
|
+
"stateMutability": "view",
|
|
124
|
+
"type": "function"
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
"inputs": [],
|
|
128
|
+
"name": "MULTICALL_TYPEHASH",
|
|
129
|
+
"outputs": [
|
|
130
|
+
{
|
|
131
|
+
"internalType": "bytes32",
|
|
132
|
+
"name": "",
|
|
133
|
+
"type": "bytes32"
|
|
134
|
+
}
|
|
135
|
+
],
|
|
136
|
+
"stateMutability": "view",
|
|
137
|
+
"type": "function"
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
"inputs": [],
|
|
141
|
+
"name": "adaptImplementation",
|
|
142
|
+
"outputs": [
|
|
143
|
+
{
|
|
144
|
+
"internalType": "address",
|
|
145
|
+
"name": "",
|
|
146
|
+
"type": "address"
|
|
147
|
+
}
|
|
148
|
+
],
|
|
149
|
+
"stateMutability": "view",
|
|
150
|
+
"type": "function"
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
"inputs": [
|
|
154
|
+
{
|
|
155
|
+
"components": [
|
|
156
|
+
{
|
|
157
|
+
"components": [
|
|
158
|
+
{
|
|
159
|
+
"components": [
|
|
160
|
+
{
|
|
161
|
+
"internalType": "uint256",
|
|
162
|
+
"name": "x",
|
|
163
|
+
"type": "uint256"
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
"internalType": "uint256",
|
|
167
|
+
"name": "y",
|
|
168
|
+
"type": "uint256"
|
|
169
|
+
}
|
|
170
|
+
],
|
|
171
|
+
"internalType": "struct G1Point",
|
|
172
|
+
"name": "a",
|
|
173
|
+
"type": "tuple"
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
"components": [
|
|
177
|
+
{
|
|
178
|
+
"internalType": "uint256[2]",
|
|
179
|
+
"name": "x",
|
|
180
|
+
"type": "uint256[2]"
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
"internalType": "uint256[2]",
|
|
184
|
+
"name": "y",
|
|
185
|
+
"type": "uint256[2]"
|
|
186
|
+
}
|
|
187
|
+
],
|
|
188
|
+
"internalType": "struct G2Point",
|
|
189
|
+
"name": "b",
|
|
190
|
+
"type": "tuple"
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
"components": [
|
|
194
|
+
{
|
|
195
|
+
"internalType": "uint256",
|
|
196
|
+
"name": "x",
|
|
197
|
+
"type": "uint256"
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
"internalType": "uint256",
|
|
201
|
+
"name": "y",
|
|
202
|
+
"type": "uint256"
|
|
203
|
+
}
|
|
204
|
+
],
|
|
205
|
+
"internalType": "struct G1Point",
|
|
206
|
+
"name": "c",
|
|
207
|
+
"type": "tuple"
|
|
208
|
+
}
|
|
209
|
+
],
|
|
210
|
+
"internalType": "struct SnarkProof",
|
|
211
|
+
"name": "proof",
|
|
212
|
+
"type": "tuple"
|
|
213
|
+
},
|
|
214
|
+
{
|
|
215
|
+
"internalType": "bytes32",
|
|
216
|
+
"name": "merkleRoot",
|
|
217
|
+
"type": "bytes32"
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
"internalType": "bytes32[]",
|
|
221
|
+
"name": "nullifiers",
|
|
222
|
+
"type": "bytes32[]"
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
"internalType": "bytes32[]",
|
|
226
|
+
"name": "commitments",
|
|
227
|
+
"type": "bytes32[]"
|
|
228
|
+
},
|
|
229
|
+
{
|
|
230
|
+
"components": [
|
|
231
|
+
{
|
|
232
|
+
"internalType": "uint16",
|
|
233
|
+
"name": "treeNumber",
|
|
234
|
+
"type": "uint16"
|
|
235
|
+
},
|
|
236
|
+
{
|
|
237
|
+
"internalType": "uint72",
|
|
238
|
+
"name": "minGasPrice",
|
|
239
|
+
"type": "uint72"
|
|
240
|
+
},
|
|
241
|
+
{
|
|
242
|
+
"internalType": "enum UnshieldType",
|
|
243
|
+
"name": "unshield",
|
|
244
|
+
"type": "uint8"
|
|
245
|
+
},
|
|
246
|
+
{
|
|
247
|
+
"internalType": "uint64",
|
|
248
|
+
"name": "chainID",
|
|
249
|
+
"type": "uint64"
|
|
250
|
+
},
|
|
251
|
+
{
|
|
252
|
+
"internalType": "address",
|
|
253
|
+
"name": "adaptContract",
|
|
254
|
+
"type": "address"
|
|
255
|
+
},
|
|
256
|
+
{
|
|
257
|
+
"internalType": "bytes32",
|
|
258
|
+
"name": "adaptParams",
|
|
259
|
+
"type": "bytes32"
|
|
260
|
+
},
|
|
261
|
+
{
|
|
262
|
+
"components": [
|
|
263
|
+
{
|
|
264
|
+
"internalType": "bytes32[4]",
|
|
265
|
+
"name": "ciphertext",
|
|
266
|
+
"type": "bytes32[4]"
|
|
267
|
+
},
|
|
268
|
+
{
|
|
269
|
+
"internalType": "bytes32",
|
|
270
|
+
"name": "blindedSenderViewingKey",
|
|
271
|
+
"type": "bytes32"
|
|
272
|
+
},
|
|
273
|
+
{
|
|
274
|
+
"internalType": "bytes32",
|
|
275
|
+
"name": "blindedReceiverViewingKey",
|
|
276
|
+
"type": "bytes32"
|
|
277
|
+
},
|
|
278
|
+
{
|
|
279
|
+
"internalType": "bytes",
|
|
280
|
+
"name": "annotationData",
|
|
281
|
+
"type": "bytes"
|
|
282
|
+
},
|
|
283
|
+
{
|
|
284
|
+
"internalType": "bytes",
|
|
285
|
+
"name": "memo",
|
|
286
|
+
"type": "bytes"
|
|
287
|
+
}
|
|
288
|
+
],
|
|
289
|
+
"internalType": "struct CommitmentCiphertext[]",
|
|
290
|
+
"name": "commitmentCiphertext",
|
|
291
|
+
"type": "tuple[]"
|
|
292
|
+
}
|
|
293
|
+
],
|
|
294
|
+
"internalType": "struct BoundParams",
|
|
295
|
+
"name": "boundParams",
|
|
296
|
+
"type": "tuple"
|
|
297
|
+
},
|
|
298
|
+
{
|
|
299
|
+
"components": [
|
|
300
|
+
{
|
|
301
|
+
"internalType": "bytes32",
|
|
302
|
+
"name": "npk",
|
|
303
|
+
"type": "bytes32"
|
|
304
|
+
},
|
|
305
|
+
{
|
|
306
|
+
"components": [
|
|
307
|
+
{
|
|
308
|
+
"internalType": "enum TokenType",
|
|
309
|
+
"name": "tokenType",
|
|
310
|
+
"type": "uint8"
|
|
311
|
+
},
|
|
312
|
+
{
|
|
313
|
+
"internalType": "address",
|
|
314
|
+
"name": "tokenAddress",
|
|
315
|
+
"type": "address"
|
|
316
|
+
},
|
|
317
|
+
{
|
|
318
|
+
"internalType": "uint256",
|
|
319
|
+
"name": "tokenSubID",
|
|
320
|
+
"type": "uint256"
|
|
321
|
+
}
|
|
322
|
+
],
|
|
323
|
+
"internalType": "struct TokenData",
|
|
324
|
+
"name": "token",
|
|
325
|
+
"type": "tuple"
|
|
326
|
+
},
|
|
327
|
+
{
|
|
328
|
+
"internalType": "uint120",
|
|
329
|
+
"name": "value",
|
|
330
|
+
"type": "uint120"
|
|
331
|
+
}
|
|
332
|
+
],
|
|
333
|
+
"internalType": "struct CommitmentPreimage",
|
|
334
|
+
"name": "unshieldPreimage",
|
|
335
|
+
"type": "tuple"
|
|
336
|
+
}
|
|
337
|
+
],
|
|
338
|
+
"internalType": "struct Transaction[]",
|
|
339
|
+
"name": "_transactions",
|
|
340
|
+
"type": "tuple[]"
|
|
341
|
+
},
|
|
342
|
+
{
|
|
343
|
+
"components": [
|
|
344
|
+
{
|
|
345
|
+
"internalType": "bool",
|
|
346
|
+
"name": "requireSuccess",
|
|
347
|
+
"type": "bool"
|
|
348
|
+
},
|
|
349
|
+
{
|
|
350
|
+
"internalType": "uint256",
|
|
351
|
+
"name": "minGasLimit",
|
|
352
|
+
"type": "uint256"
|
|
353
|
+
},
|
|
354
|
+
{
|
|
355
|
+
"components": [
|
|
356
|
+
{
|
|
357
|
+
"internalType": "address",
|
|
358
|
+
"name": "to",
|
|
359
|
+
"type": "address"
|
|
360
|
+
},
|
|
361
|
+
{
|
|
362
|
+
"internalType": "bytes",
|
|
363
|
+
"name": "data",
|
|
364
|
+
"type": "bytes"
|
|
365
|
+
},
|
|
366
|
+
{
|
|
367
|
+
"internalType": "uint256",
|
|
368
|
+
"name": "value",
|
|
369
|
+
"type": "uint256"
|
|
370
|
+
}
|
|
371
|
+
],
|
|
372
|
+
"internalType": "struct RelayAdapt7702.Call[]",
|
|
373
|
+
"name": "calls",
|
|
374
|
+
"type": "tuple[]"
|
|
375
|
+
}
|
|
376
|
+
],
|
|
377
|
+
"internalType": "struct RelayAdapt7702.ActionData",
|
|
378
|
+
"name": "_actionData",
|
|
379
|
+
"type": "tuple"
|
|
380
|
+
},
|
|
381
|
+
{
|
|
382
|
+
"internalType": "uint256",
|
|
383
|
+
"name": "_nonce",
|
|
384
|
+
"type": "uint256"
|
|
385
|
+
},
|
|
386
|
+
{
|
|
387
|
+
"internalType": "bytes",
|
|
388
|
+
"name": "_signature",
|
|
389
|
+
"type": "bytes"
|
|
390
|
+
}
|
|
391
|
+
],
|
|
392
|
+
"name": "execute",
|
|
393
|
+
"outputs": [],
|
|
394
|
+
"stateMutability": "payable",
|
|
395
|
+
"type": "function"
|
|
396
|
+
},
|
|
397
|
+
{
|
|
398
|
+
"inputs": [
|
|
399
|
+
{
|
|
400
|
+
"components": [
|
|
401
|
+
{
|
|
402
|
+
"components": [
|
|
403
|
+
{
|
|
404
|
+
"components": [
|
|
405
|
+
{
|
|
406
|
+
"internalType": "uint256",
|
|
407
|
+
"name": "x",
|
|
408
|
+
"type": "uint256"
|
|
409
|
+
},
|
|
410
|
+
{
|
|
411
|
+
"internalType": "uint256",
|
|
412
|
+
"name": "y",
|
|
413
|
+
"type": "uint256"
|
|
414
|
+
}
|
|
415
|
+
],
|
|
416
|
+
"internalType": "struct G1Point",
|
|
417
|
+
"name": "a",
|
|
418
|
+
"type": "tuple"
|
|
419
|
+
},
|
|
420
|
+
{
|
|
421
|
+
"components": [
|
|
422
|
+
{
|
|
423
|
+
"internalType": "uint256[2]",
|
|
424
|
+
"name": "x",
|
|
425
|
+
"type": "uint256[2]"
|
|
426
|
+
},
|
|
427
|
+
{
|
|
428
|
+
"internalType": "uint256[2]",
|
|
429
|
+
"name": "y",
|
|
430
|
+
"type": "uint256[2]"
|
|
431
|
+
}
|
|
432
|
+
],
|
|
433
|
+
"internalType": "struct G2Point",
|
|
434
|
+
"name": "b",
|
|
435
|
+
"type": "tuple"
|
|
436
|
+
},
|
|
437
|
+
{
|
|
438
|
+
"components": [
|
|
439
|
+
{
|
|
440
|
+
"internalType": "uint256",
|
|
441
|
+
"name": "x",
|
|
442
|
+
"type": "uint256"
|
|
443
|
+
},
|
|
444
|
+
{
|
|
445
|
+
"internalType": "uint256",
|
|
446
|
+
"name": "y",
|
|
447
|
+
"type": "uint256"
|
|
448
|
+
}
|
|
449
|
+
],
|
|
450
|
+
"internalType": "struct G1Point",
|
|
451
|
+
"name": "c",
|
|
452
|
+
"type": "tuple"
|
|
453
|
+
}
|
|
454
|
+
],
|
|
455
|
+
"internalType": "struct SnarkProof",
|
|
456
|
+
"name": "proof",
|
|
457
|
+
"type": "tuple"
|
|
458
|
+
},
|
|
459
|
+
{
|
|
460
|
+
"internalType": "bytes32",
|
|
461
|
+
"name": "merkleRoot",
|
|
462
|
+
"type": "bytes32"
|
|
463
|
+
},
|
|
464
|
+
{
|
|
465
|
+
"internalType": "bytes32[]",
|
|
466
|
+
"name": "nullifiers",
|
|
467
|
+
"type": "bytes32[]"
|
|
468
|
+
},
|
|
469
|
+
{
|
|
470
|
+
"internalType": "bytes32[]",
|
|
471
|
+
"name": "commitments",
|
|
472
|
+
"type": "bytes32[]"
|
|
473
|
+
},
|
|
474
|
+
{
|
|
475
|
+
"components": [
|
|
476
|
+
{
|
|
477
|
+
"internalType": "uint16",
|
|
478
|
+
"name": "treeNumber",
|
|
479
|
+
"type": "uint16"
|
|
480
|
+
},
|
|
481
|
+
{
|
|
482
|
+
"internalType": "uint72",
|
|
483
|
+
"name": "minGasPrice",
|
|
484
|
+
"type": "uint72"
|
|
485
|
+
},
|
|
486
|
+
{
|
|
487
|
+
"internalType": "enum UnshieldType",
|
|
488
|
+
"name": "unshield",
|
|
489
|
+
"type": "uint8"
|
|
490
|
+
},
|
|
491
|
+
{
|
|
492
|
+
"internalType": "uint64",
|
|
493
|
+
"name": "chainID",
|
|
494
|
+
"type": "uint64"
|
|
495
|
+
},
|
|
496
|
+
{
|
|
497
|
+
"internalType": "address",
|
|
498
|
+
"name": "adaptContract",
|
|
499
|
+
"type": "address"
|
|
500
|
+
},
|
|
501
|
+
{
|
|
502
|
+
"internalType": "bytes32",
|
|
503
|
+
"name": "adaptParams",
|
|
504
|
+
"type": "bytes32"
|
|
505
|
+
},
|
|
506
|
+
{
|
|
507
|
+
"components": [
|
|
508
|
+
{
|
|
509
|
+
"internalType": "bytes32[4]",
|
|
510
|
+
"name": "ciphertext",
|
|
511
|
+
"type": "bytes32[4]"
|
|
512
|
+
},
|
|
513
|
+
{
|
|
514
|
+
"internalType": "bytes32",
|
|
515
|
+
"name": "blindedSenderViewingKey",
|
|
516
|
+
"type": "bytes32"
|
|
517
|
+
},
|
|
518
|
+
{
|
|
519
|
+
"internalType": "bytes32",
|
|
520
|
+
"name": "blindedReceiverViewingKey",
|
|
521
|
+
"type": "bytes32"
|
|
522
|
+
},
|
|
523
|
+
{
|
|
524
|
+
"internalType": "bytes",
|
|
525
|
+
"name": "annotationData",
|
|
526
|
+
"type": "bytes"
|
|
527
|
+
},
|
|
528
|
+
{
|
|
529
|
+
"internalType": "bytes",
|
|
530
|
+
"name": "memo",
|
|
531
|
+
"type": "bytes"
|
|
532
|
+
}
|
|
533
|
+
],
|
|
534
|
+
"internalType": "struct CommitmentCiphertext[]",
|
|
535
|
+
"name": "commitmentCiphertext",
|
|
536
|
+
"type": "tuple[]"
|
|
537
|
+
}
|
|
538
|
+
],
|
|
539
|
+
"internalType": "struct BoundParams",
|
|
540
|
+
"name": "boundParams",
|
|
541
|
+
"type": "tuple"
|
|
542
|
+
},
|
|
543
|
+
{
|
|
544
|
+
"components": [
|
|
545
|
+
{
|
|
546
|
+
"internalType": "bytes32",
|
|
547
|
+
"name": "npk",
|
|
548
|
+
"type": "bytes32"
|
|
549
|
+
},
|
|
550
|
+
{
|
|
551
|
+
"components": [
|
|
552
|
+
{
|
|
553
|
+
"internalType": "enum TokenType",
|
|
554
|
+
"name": "tokenType",
|
|
555
|
+
"type": "uint8"
|
|
556
|
+
},
|
|
557
|
+
{
|
|
558
|
+
"internalType": "address",
|
|
559
|
+
"name": "tokenAddress",
|
|
560
|
+
"type": "address"
|
|
561
|
+
},
|
|
562
|
+
{
|
|
563
|
+
"internalType": "uint256",
|
|
564
|
+
"name": "tokenSubID",
|
|
565
|
+
"type": "uint256"
|
|
566
|
+
}
|
|
567
|
+
],
|
|
568
|
+
"internalType": "struct TokenData",
|
|
569
|
+
"name": "token",
|
|
570
|
+
"type": "tuple"
|
|
571
|
+
},
|
|
572
|
+
{
|
|
573
|
+
"internalType": "uint120",
|
|
574
|
+
"name": "value",
|
|
575
|
+
"type": "uint120"
|
|
576
|
+
}
|
|
577
|
+
],
|
|
578
|
+
"internalType": "struct CommitmentPreimage",
|
|
579
|
+
"name": "unshieldPreimage",
|
|
580
|
+
"type": "tuple"
|
|
581
|
+
}
|
|
582
|
+
],
|
|
583
|
+
"internalType": "struct Transaction[]",
|
|
584
|
+
"name": "_transactions",
|
|
585
|
+
"type": "tuple[]"
|
|
586
|
+
},
|
|
587
|
+
{
|
|
588
|
+
"components": [
|
|
589
|
+
{
|
|
590
|
+
"internalType": "bool",
|
|
591
|
+
"name": "requireSuccess",
|
|
592
|
+
"type": "bool"
|
|
593
|
+
},
|
|
594
|
+
{
|
|
595
|
+
"internalType": "uint256",
|
|
596
|
+
"name": "minGasLimit",
|
|
597
|
+
"type": "uint256"
|
|
598
|
+
},
|
|
599
|
+
{
|
|
600
|
+
"components": [
|
|
601
|
+
{
|
|
602
|
+
"internalType": "address",
|
|
603
|
+
"name": "to",
|
|
604
|
+
"type": "address"
|
|
605
|
+
},
|
|
606
|
+
{
|
|
607
|
+
"internalType": "bytes",
|
|
608
|
+
"name": "data",
|
|
609
|
+
"type": "bytes"
|
|
610
|
+
},
|
|
611
|
+
{
|
|
612
|
+
"internalType": "uint256",
|
|
613
|
+
"name": "value",
|
|
614
|
+
"type": "uint256"
|
|
615
|
+
}
|
|
616
|
+
],
|
|
617
|
+
"internalType": "struct RelayAdapt7702.Call[]",
|
|
618
|
+
"name": "calls",
|
|
619
|
+
"type": "tuple[]"
|
|
620
|
+
}
|
|
621
|
+
],
|
|
622
|
+
"internalType": "struct RelayAdapt7702.ActionData",
|
|
623
|
+
"name": "_actionData",
|
|
624
|
+
"type": "tuple"
|
|
625
|
+
},
|
|
626
|
+
{
|
|
627
|
+
"internalType": "uint256",
|
|
628
|
+
"name": "_nonce",
|
|
629
|
+
"type": "uint256"
|
|
630
|
+
}
|
|
631
|
+
],
|
|
632
|
+
"name": "getExecutePayloadHash",
|
|
633
|
+
"outputs": [
|
|
634
|
+
{
|
|
635
|
+
"internalType": "bytes32",
|
|
636
|
+
"name": "",
|
|
637
|
+
"type": "bytes32"
|
|
638
|
+
}
|
|
639
|
+
],
|
|
640
|
+
"stateMutability": "pure",
|
|
641
|
+
"type": "function"
|
|
642
|
+
},
|
|
643
|
+
{
|
|
644
|
+
"inputs": [
|
|
645
|
+
{
|
|
646
|
+
"internalType": "bool",
|
|
647
|
+
"name": "_requireSuccess",
|
|
648
|
+
"type": "bool"
|
|
649
|
+
},
|
|
650
|
+
{
|
|
651
|
+
"components": [
|
|
652
|
+
{
|
|
653
|
+
"internalType": "address",
|
|
654
|
+
"name": "to",
|
|
655
|
+
"type": "address"
|
|
656
|
+
},
|
|
657
|
+
{
|
|
658
|
+
"internalType": "bytes",
|
|
659
|
+
"name": "data",
|
|
660
|
+
"type": "bytes"
|
|
661
|
+
},
|
|
662
|
+
{
|
|
663
|
+
"internalType": "uint256",
|
|
664
|
+
"name": "value",
|
|
665
|
+
"type": "uint256"
|
|
666
|
+
}
|
|
667
|
+
],
|
|
668
|
+
"internalType": "struct RelayAdapt7702.Call[]",
|
|
669
|
+
"name": "_calls",
|
|
670
|
+
"type": "tuple[]"
|
|
671
|
+
},
|
|
672
|
+
{
|
|
673
|
+
"internalType": "uint256",
|
|
674
|
+
"name": "_nonce",
|
|
675
|
+
"type": "uint256"
|
|
676
|
+
}
|
|
677
|
+
],
|
|
678
|
+
"name": "getMulticallPayloadHash",
|
|
679
|
+
"outputs": [
|
|
680
|
+
{
|
|
681
|
+
"internalType": "bytes32",
|
|
682
|
+
"name": "",
|
|
683
|
+
"type": "bytes32"
|
|
684
|
+
}
|
|
685
|
+
],
|
|
686
|
+
"stateMutability": "pure",
|
|
687
|
+
"type": "function"
|
|
688
|
+
},
|
|
689
|
+
{
|
|
690
|
+
"inputs": [
|
|
691
|
+
{
|
|
692
|
+
"internalType": "bool",
|
|
693
|
+
"name": "_requireSuccess",
|
|
694
|
+
"type": "bool"
|
|
695
|
+
},
|
|
696
|
+
{
|
|
697
|
+
"components": [
|
|
698
|
+
{
|
|
699
|
+
"internalType": "address",
|
|
700
|
+
"name": "to",
|
|
701
|
+
"type": "address"
|
|
702
|
+
},
|
|
703
|
+
{
|
|
704
|
+
"internalType": "bytes",
|
|
705
|
+
"name": "data",
|
|
706
|
+
"type": "bytes"
|
|
707
|
+
},
|
|
708
|
+
{
|
|
709
|
+
"internalType": "uint256",
|
|
710
|
+
"name": "value",
|
|
711
|
+
"type": "uint256"
|
|
712
|
+
}
|
|
713
|
+
],
|
|
714
|
+
"internalType": "struct RelayAdapt7702.Call[]",
|
|
715
|
+
"name": "_calls",
|
|
716
|
+
"type": "tuple[]"
|
|
717
|
+
},
|
|
718
|
+
{
|
|
719
|
+
"internalType": "uint256",
|
|
720
|
+
"name": "_nonce",
|
|
721
|
+
"type": "uint256"
|
|
722
|
+
},
|
|
723
|
+
{
|
|
724
|
+
"internalType": "bytes",
|
|
725
|
+
"name": "_signature",
|
|
726
|
+
"type": "bytes"
|
|
727
|
+
}
|
|
728
|
+
],
|
|
729
|
+
"name": "multicall",
|
|
730
|
+
"outputs": [],
|
|
731
|
+
"stateMutability": "payable",
|
|
732
|
+
"type": "function"
|
|
733
|
+
},
|
|
734
|
+
{
|
|
735
|
+
"inputs": [],
|
|
736
|
+
"name": "nonce",
|
|
737
|
+
"outputs": [
|
|
738
|
+
{
|
|
739
|
+
"internalType": "uint256",
|
|
740
|
+
"name": "",
|
|
741
|
+
"type": "uint256"
|
|
742
|
+
}
|
|
743
|
+
],
|
|
744
|
+
"stateMutability": "view",
|
|
745
|
+
"type": "function"
|
|
746
|
+
},
|
|
747
|
+
{
|
|
748
|
+
"inputs": [],
|
|
749
|
+
"name": "railgun",
|
|
750
|
+
"outputs": [
|
|
751
|
+
{
|
|
752
|
+
"internalType": "contract RailgunSmartWallet",
|
|
753
|
+
"name": "",
|
|
754
|
+
"type": "address"
|
|
755
|
+
}
|
|
756
|
+
],
|
|
757
|
+
"stateMutability": "view",
|
|
758
|
+
"type": "function"
|
|
759
|
+
},
|
|
760
|
+
{
|
|
761
|
+
"inputs": [
|
|
762
|
+
{
|
|
763
|
+
"components": [
|
|
764
|
+
{
|
|
765
|
+
"components": [
|
|
766
|
+
{
|
|
767
|
+
"internalType": "bytes32",
|
|
768
|
+
"name": "npk",
|
|
769
|
+
"type": "bytes32"
|
|
770
|
+
},
|
|
771
|
+
{
|
|
772
|
+
"components": [
|
|
773
|
+
{
|
|
774
|
+
"internalType": "enum TokenType",
|
|
775
|
+
"name": "tokenType",
|
|
776
|
+
"type": "uint8"
|
|
777
|
+
},
|
|
778
|
+
{
|
|
779
|
+
"internalType": "address",
|
|
780
|
+
"name": "tokenAddress",
|
|
781
|
+
"type": "address"
|
|
782
|
+
},
|
|
783
|
+
{
|
|
784
|
+
"internalType": "uint256",
|
|
785
|
+
"name": "tokenSubID",
|
|
786
|
+
"type": "uint256"
|
|
787
|
+
}
|
|
788
|
+
],
|
|
789
|
+
"internalType": "struct TokenData",
|
|
790
|
+
"name": "token",
|
|
791
|
+
"type": "tuple"
|
|
792
|
+
},
|
|
793
|
+
{
|
|
794
|
+
"internalType": "uint120",
|
|
795
|
+
"name": "value",
|
|
796
|
+
"type": "uint120"
|
|
797
|
+
}
|
|
798
|
+
],
|
|
799
|
+
"internalType": "struct CommitmentPreimage",
|
|
800
|
+
"name": "preimage",
|
|
801
|
+
"type": "tuple"
|
|
802
|
+
},
|
|
803
|
+
{
|
|
804
|
+
"components": [
|
|
805
|
+
{
|
|
806
|
+
"internalType": "bytes32[3]",
|
|
807
|
+
"name": "encryptedBundle",
|
|
808
|
+
"type": "bytes32[3]"
|
|
809
|
+
},
|
|
810
|
+
{
|
|
811
|
+
"internalType": "bytes32",
|
|
812
|
+
"name": "shieldKey",
|
|
813
|
+
"type": "bytes32"
|
|
814
|
+
}
|
|
815
|
+
],
|
|
816
|
+
"internalType": "struct ShieldCiphertext",
|
|
817
|
+
"name": "ciphertext",
|
|
818
|
+
"type": "tuple"
|
|
819
|
+
}
|
|
820
|
+
],
|
|
821
|
+
"internalType": "struct ShieldRequest[]",
|
|
822
|
+
"name": "_shieldRequests",
|
|
823
|
+
"type": "tuple[]"
|
|
824
|
+
}
|
|
825
|
+
],
|
|
826
|
+
"name": "shield",
|
|
827
|
+
"outputs": [],
|
|
828
|
+
"stateMutability": "nonpayable",
|
|
829
|
+
"type": "function"
|
|
830
|
+
},
|
|
831
|
+
{
|
|
832
|
+
"inputs": [
|
|
833
|
+
{
|
|
834
|
+
"components": [
|
|
835
|
+
{
|
|
836
|
+
"components": [
|
|
837
|
+
{
|
|
838
|
+
"internalType": "enum TokenType",
|
|
839
|
+
"name": "tokenType",
|
|
840
|
+
"type": "uint8"
|
|
841
|
+
},
|
|
842
|
+
{
|
|
843
|
+
"internalType": "address",
|
|
844
|
+
"name": "tokenAddress",
|
|
845
|
+
"type": "address"
|
|
846
|
+
},
|
|
847
|
+
{
|
|
848
|
+
"internalType": "uint256",
|
|
849
|
+
"name": "tokenSubID",
|
|
850
|
+
"type": "uint256"
|
|
851
|
+
}
|
|
852
|
+
],
|
|
853
|
+
"internalType": "struct TokenData",
|
|
854
|
+
"name": "token",
|
|
855
|
+
"type": "tuple"
|
|
856
|
+
},
|
|
857
|
+
{
|
|
858
|
+
"internalType": "address",
|
|
859
|
+
"name": "to",
|
|
860
|
+
"type": "address"
|
|
861
|
+
},
|
|
862
|
+
{
|
|
863
|
+
"internalType": "uint256",
|
|
864
|
+
"name": "value",
|
|
865
|
+
"type": "uint256"
|
|
866
|
+
}
|
|
867
|
+
],
|
|
868
|
+
"internalType": "struct RelayAdapt7702.TokenTransfer[]",
|
|
869
|
+
"name": "_transfers",
|
|
870
|
+
"type": "tuple[]"
|
|
871
|
+
}
|
|
872
|
+
],
|
|
873
|
+
"name": "transfer",
|
|
874
|
+
"outputs": [],
|
|
875
|
+
"stateMutability": "nonpayable",
|
|
876
|
+
"type": "function"
|
|
877
|
+
},
|
|
878
|
+
{
|
|
879
|
+
"inputs": [
|
|
880
|
+
{
|
|
881
|
+
"internalType": "uint256",
|
|
882
|
+
"name": "_amount",
|
|
883
|
+
"type": "uint256"
|
|
884
|
+
}
|
|
885
|
+
],
|
|
886
|
+
"name": "unwrapBase",
|
|
887
|
+
"outputs": [],
|
|
888
|
+
"stateMutability": "nonpayable",
|
|
889
|
+
"type": "function"
|
|
890
|
+
},
|
|
891
|
+
{
|
|
892
|
+
"inputs": [],
|
|
893
|
+
"name": "wBase",
|
|
894
|
+
"outputs": [
|
|
895
|
+
{
|
|
896
|
+
"internalType": "contract IWBase",
|
|
897
|
+
"name": "",
|
|
898
|
+
"type": "address"
|
|
899
|
+
}
|
|
900
|
+
],
|
|
901
|
+
"stateMutability": "view",
|
|
902
|
+
"type": "function"
|
|
903
|
+
},
|
|
904
|
+
{
|
|
905
|
+
"inputs": [
|
|
906
|
+
{
|
|
907
|
+
"internalType": "uint256",
|
|
908
|
+
"name": "_amount",
|
|
909
|
+
"type": "uint256"
|
|
910
|
+
}
|
|
911
|
+
],
|
|
912
|
+
"name": "wrapBase",
|
|
913
|
+
"outputs": [],
|
|
914
|
+
"stateMutability": "nonpayable",
|
|
915
|
+
"type": "function"
|
|
916
|
+
},
|
|
917
|
+
{
|
|
918
|
+
"stateMutability": "payable",
|
|
919
|
+
"type": "receive"
|
|
920
|
+
}
|
|
921
|
+
];
|
|
922
|
+
/**
|
|
923
|
+
* RelayAdapt7702_json Contract Class
|
|
924
|
+
*
|
|
925
|
+
* Provides a class-based API similar to TypeChain for interacting with the contract.
|
|
926
|
+
*
|
|
927
|
+
* @example
|
|
928
|
+
* ```typescript
|
|
929
|
+
* import { createPublicClient, createWalletClient, http } from 'viem';
|
|
930
|
+
* import { mainnet } from 'viem/chains';
|
|
931
|
+
* import { RelayAdapt7702_json } from 'RelayAdapt7702_json';
|
|
932
|
+
*
|
|
933
|
+
* const publicClient = createPublicClient({ chain: mainnet, transport: http() });
|
|
934
|
+
* const walletClient = createWalletClient({ chain: mainnet, transport: http() });
|
|
935
|
+
*
|
|
936
|
+
* const contract = new RelayAdapt7702_json('0x...', { publicClient, walletClient });
|
|
937
|
+
*
|
|
938
|
+
* // Read functions
|
|
939
|
+
* const result = await contract.balanceOf('0x...');
|
|
940
|
+
*
|
|
941
|
+
* // Write functions
|
|
942
|
+
* const hash = await contract.transfer('0x...', 1000n);
|
|
943
|
+
*
|
|
944
|
+
* // Simulate transactions (dry-run)
|
|
945
|
+
* const simulation = await contract.simulate.transfer('0x...', 1000n);
|
|
946
|
+
* console.log('Gas estimate:', simulation.request.gas);
|
|
947
|
+
*
|
|
948
|
+
* // Watch events
|
|
949
|
+
* const unwatch = contract.watch.Transfer((event) => {
|
|
950
|
+
* console.log('Transfer event:', event);
|
|
951
|
+
* });
|
|
952
|
+
* ```
|
|
953
|
+
*/
|
|
954
|
+
class RelayAdapt7702_json {
|
|
955
|
+
constructor(address, clients) {
|
|
956
|
+
this.contractAddress = address;
|
|
957
|
+
this.publicClient = clients.publicClient;
|
|
958
|
+
this.contract = (0, viem_1.getContract)({
|
|
959
|
+
address,
|
|
960
|
+
abi: exports.RelayAdapt7702_jsonAbi,
|
|
961
|
+
client: {
|
|
962
|
+
public: clients.publicClient,
|
|
963
|
+
wallet: clients.walletClient,
|
|
964
|
+
},
|
|
965
|
+
});
|
|
966
|
+
}
|
|
967
|
+
/**
|
|
968
|
+
* Get the contract address
|
|
969
|
+
*/
|
|
970
|
+
get address() {
|
|
971
|
+
return this.contractAddress;
|
|
972
|
+
}
|
|
973
|
+
/**
|
|
974
|
+
* Get the underlying viem contract instance
|
|
975
|
+
*/
|
|
976
|
+
getContract() {
|
|
977
|
+
return this.contract;
|
|
978
|
+
}
|
|
979
|
+
/**
|
|
980
|
+
* DOMAIN_SEPARATOR
|
|
981
|
+
* view
|
|
982
|
+
*/
|
|
983
|
+
async DOMAIN_SEPARATOR() {
|
|
984
|
+
return this.contract.read.DOMAIN_SEPARATOR();
|
|
985
|
+
}
|
|
986
|
+
/**
|
|
987
|
+
* EXECUTE_TYPEHASH
|
|
988
|
+
* view
|
|
989
|
+
*/
|
|
990
|
+
async EXECUTE_TYPEHASH() {
|
|
991
|
+
return this.contract.read.EXECUTE_TYPEHASH();
|
|
992
|
+
}
|
|
993
|
+
/**
|
|
994
|
+
* MULTICALL_TYPEHASH
|
|
995
|
+
* view
|
|
996
|
+
*/
|
|
997
|
+
async MULTICALL_TYPEHASH() {
|
|
998
|
+
return this.contract.read.MULTICALL_TYPEHASH();
|
|
999
|
+
}
|
|
1000
|
+
/**
|
|
1001
|
+
* adaptImplementation
|
|
1002
|
+
* view
|
|
1003
|
+
*/
|
|
1004
|
+
async adaptImplementation() {
|
|
1005
|
+
return this.contract.read.adaptImplementation();
|
|
1006
|
+
}
|
|
1007
|
+
/**
|
|
1008
|
+
* getExecutePayloadHash
|
|
1009
|
+
* pure
|
|
1010
|
+
*/
|
|
1011
|
+
async getExecutePayloadHash(_transactions, _actionData, _nonce) {
|
|
1012
|
+
return this.contract.read.getExecutePayloadHash([_transactions, _actionData, _nonce]);
|
|
1013
|
+
}
|
|
1014
|
+
/**
|
|
1015
|
+
* getMulticallPayloadHash
|
|
1016
|
+
* pure
|
|
1017
|
+
*/
|
|
1018
|
+
async getMulticallPayloadHash(_requireSuccess, _calls, _nonce) {
|
|
1019
|
+
return this.contract.read.getMulticallPayloadHash([_requireSuccess, _calls, _nonce]);
|
|
1020
|
+
}
|
|
1021
|
+
/**
|
|
1022
|
+
* nonce
|
|
1023
|
+
* view
|
|
1024
|
+
*/
|
|
1025
|
+
async nonce() {
|
|
1026
|
+
return this.contract.read.nonce();
|
|
1027
|
+
}
|
|
1028
|
+
/**
|
|
1029
|
+
* railgun
|
|
1030
|
+
* view
|
|
1031
|
+
*/
|
|
1032
|
+
async railgun() {
|
|
1033
|
+
return this.contract.read.railgun();
|
|
1034
|
+
}
|
|
1035
|
+
/**
|
|
1036
|
+
* wBase
|
|
1037
|
+
* view
|
|
1038
|
+
*/
|
|
1039
|
+
async wBase() {
|
|
1040
|
+
return this.contract.read.wBase();
|
|
1041
|
+
}
|
|
1042
|
+
/**
|
|
1043
|
+
* execute
|
|
1044
|
+
* payable
|
|
1045
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1046
|
+
*/
|
|
1047
|
+
async execute(_transactions, _actionData, _nonce, _signature, options) {
|
|
1048
|
+
if (!this.contract.write) {
|
|
1049
|
+
throw new Error('Wallet client is required for write operations');
|
|
1050
|
+
}
|
|
1051
|
+
return this.contract.write.execute([_transactions, _actionData, _nonce, _signature], options);
|
|
1052
|
+
}
|
|
1053
|
+
/**
|
|
1054
|
+
* multicall
|
|
1055
|
+
* payable
|
|
1056
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1057
|
+
*/
|
|
1058
|
+
async multicall(_requireSuccess, _calls, _nonce, _signature, options) {
|
|
1059
|
+
if (!this.contract.write) {
|
|
1060
|
+
throw new Error('Wallet client is required for write operations');
|
|
1061
|
+
}
|
|
1062
|
+
return this.contract.write.multicall([_requireSuccess, _calls, _nonce, _signature], options);
|
|
1063
|
+
}
|
|
1064
|
+
/**
|
|
1065
|
+
* shield
|
|
1066
|
+
* nonpayable
|
|
1067
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1068
|
+
*/
|
|
1069
|
+
async shield(_shieldRequests, options) {
|
|
1070
|
+
if (!this.contract.write) {
|
|
1071
|
+
throw new Error('Wallet client is required for write operations');
|
|
1072
|
+
}
|
|
1073
|
+
return this.contract.write.shield([_shieldRequests], options);
|
|
1074
|
+
}
|
|
1075
|
+
/**
|
|
1076
|
+
* transfer
|
|
1077
|
+
* nonpayable
|
|
1078
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1079
|
+
*/
|
|
1080
|
+
async transfer(_transfers, options) {
|
|
1081
|
+
if (!this.contract.write) {
|
|
1082
|
+
throw new Error('Wallet client is required for write operations');
|
|
1083
|
+
}
|
|
1084
|
+
return this.contract.write.transfer([_transfers], options);
|
|
1085
|
+
}
|
|
1086
|
+
/**
|
|
1087
|
+
* unwrapBase
|
|
1088
|
+
* nonpayable
|
|
1089
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1090
|
+
*/
|
|
1091
|
+
async unwrapBase(_amount, options) {
|
|
1092
|
+
if (!this.contract.write) {
|
|
1093
|
+
throw new Error('Wallet client is required for write operations');
|
|
1094
|
+
}
|
|
1095
|
+
return this.contract.write.unwrapBase([_amount], options);
|
|
1096
|
+
}
|
|
1097
|
+
/**
|
|
1098
|
+
* wrapBase
|
|
1099
|
+
* nonpayable
|
|
1100
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1101
|
+
*/
|
|
1102
|
+
async wrapBase(_amount, options) {
|
|
1103
|
+
if (!this.contract.write) {
|
|
1104
|
+
throw new Error('Wallet client is required for write operations');
|
|
1105
|
+
}
|
|
1106
|
+
return this.contract.write.wrapBase([_amount], options);
|
|
1107
|
+
}
|
|
1108
|
+
/**
|
|
1109
|
+
* Simulate contract write operations (dry-run without sending transaction)
|
|
1110
|
+
*
|
|
1111
|
+
* @example
|
|
1112
|
+
* const result = await contract.simulate.transfer('0x...', 1000n);
|
|
1113
|
+
* console.log('Gas estimate:', result.request.gas);
|
|
1114
|
+
* console.log('Would succeed:', result.result);
|
|
1115
|
+
*/
|
|
1116
|
+
get simulate() {
|
|
1117
|
+
const contract = this.contract;
|
|
1118
|
+
if (!contract.simulate) {
|
|
1119
|
+
throw new Error('Public client is required for simulation');
|
|
1120
|
+
}
|
|
1121
|
+
return {
|
|
1122
|
+
/**
|
|
1123
|
+
* Simulate execute
|
|
1124
|
+
* Returns gas estimate and result without sending transaction
|
|
1125
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1126
|
+
*/
|
|
1127
|
+
async execute(_transactions, _actionData, _nonce, _signature, options) {
|
|
1128
|
+
return contract.simulate.execute([_transactions, _actionData, _nonce, _signature], options);
|
|
1129
|
+
},
|
|
1130
|
+
/**
|
|
1131
|
+
* Simulate multicall
|
|
1132
|
+
* Returns gas estimate and result without sending transaction
|
|
1133
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1134
|
+
*/
|
|
1135
|
+
async multicall(_requireSuccess, _calls, _nonce, _signature, options) {
|
|
1136
|
+
return contract.simulate.multicall([_requireSuccess, _calls, _nonce, _signature], options);
|
|
1137
|
+
},
|
|
1138
|
+
/**
|
|
1139
|
+
* Simulate shield
|
|
1140
|
+
* Returns gas estimate and result without sending transaction
|
|
1141
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1142
|
+
*/
|
|
1143
|
+
async shield(_shieldRequests, options) {
|
|
1144
|
+
return contract.simulate.shield([_shieldRequests], options);
|
|
1145
|
+
},
|
|
1146
|
+
/**
|
|
1147
|
+
* Simulate transfer
|
|
1148
|
+
* Returns gas estimate and result without sending transaction
|
|
1149
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1150
|
+
*/
|
|
1151
|
+
async transfer(_transfers, options) {
|
|
1152
|
+
return contract.simulate.transfer([_transfers], options);
|
|
1153
|
+
},
|
|
1154
|
+
/**
|
|
1155
|
+
* Simulate unwrapBase
|
|
1156
|
+
* Returns gas estimate and result without sending transaction
|
|
1157
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1158
|
+
*/
|
|
1159
|
+
async unwrapBase(_amount, options) {
|
|
1160
|
+
return contract.simulate.unwrapBase([_amount], options);
|
|
1161
|
+
},
|
|
1162
|
+
/**
|
|
1163
|
+
* Simulate wrapBase
|
|
1164
|
+
* Returns gas estimate and result without sending transaction
|
|
1165
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1166
|
+
*/
|
|
1167
|
+
async wrapBase(_amount, options) {
|
|
1168
|
+
return contract.simulate.wrapBase([_amount], options);
|
|
1169
|
+
}
|
|
1170
|
+
};
|
|
1171
|
+
}
|
|
1172
|
+
/**
|
|
1173
|
+
* Watch contract events
|
|
1174
|
+
*
|
|
1175
|
+
* @example
|
|
1176
|
+
* // Watch all Transfer events
|
|
1177
|
+
* const unwatch = contract.watch.Transfer((event) => {
|
|
1178
|
+
* console.log('Transfer:', event);
|
|
1179
|
+
* });
|
|
1180
|
+
*
|
|
1181
|
+
* // Stop watching
|
|
1182
|
+
* unwatch();
|
|
1183
|
+
*/
|
|
1184
|
+
get watch() {
|
|
1185
|
+
return {
|
|
1186
|
+
/**
|
|
1187
|
+
* Watch CallError events
|
|
1188
|
+
* @param callback Function to call when event is emitted
|
|
1189
|
+
* @param filter Optional filter for indexed parameters
|
|
1190
|
+
* @returns Unwatch function to stop listening
|
|
1191
|
+
*/
|
|
1192
|
+
CallError: (callback) => {
|
|
1193
|
+
return this.publicClient.watchContractEvent({
|
|
1194
|
+
address: this.contractAddress,
|
|
1195
|
+
abi: exports.RelayAdapt7702_jsonAbi,
|
|
1196
|
+
eventName: 'CallError',
|
|
1197
|
+
onLogs: (logs) => {
|
|
1198
|
+
logs.forEach((log) => {
|
|
1199
|
+
callback(log.args);
|
|
1200
|
+
});
|
|
1201
|
+
},
|
|
1202
|
+
});
|
|
1203
|
+
}
|
|
1204
|
+
};
|
|
1205
|
+
}
|
|
1206
|
+
}
|
|
1207
|
+
exports.RelayAdapt7702_json = RelayAdapt7702_json;
|