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