@gitmyabi/optimismportal 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,1580 @@
1
+ import type { Abi, Address, PublicClient, WalletClient, GetContractReturnType } from 'viem';
2
+ import { getContract } from 'viem';
3
+
4
+
5
+ /**
6
+ * Types.WithdrawalTransaction struct type
7
+ */
8
+ export type Types_WithdrawalTransaction = {
9
+ nonce: bigint;
10
+ sender: `0x${string}`;
11
+ target: `0x${string}`;
12
+ value: bigint;
13
+ gasLimit: bigint;
14
+ data: `0x${string}`;
15
+ };
16
+
17
+ /**
18
+ * Types.OutputRootProof struct type
19
+ */
20
+ export type Types_OutputRootProof = {
21
+ version: `0x${string}`;
22
+ stateRoot: `0x${string}`;
23
+ messagePasserStorageRoot: `0x${string}`;
24
+ latestBlockhash: `0x${string}`;
25
+ };
26
+ /**
27
+ * OptimismPortal2_json ABI
28
+ *
29
+ * This ABI is typed using viem's type system for full type safety.
30
+ */
31
+ export const OptimismPortal2_jsonAbi = [
32
+ {
33
+ "inputs": [
34
+ {
35
+ "internalType": "uint256",
36
+ "name": "_proofMaturityDelaySeconds",
37
+ "type": "uint256"
38
+ }
39
+ ],
40
+ "stateMutability": "nonpayable",
41
+ "type": "constructor"
42
+ },
43
+ {
44
+ "inputs": [],
45
+ "name": "ContentLengthMismatch",
46
+ "type": "error"
47
+ },
48
+ {
49
+ "inputs": [],
50
+ "name": "EmptyItem",
51
+ "type": "error"
52
+ },
53
+ {
54
+ "inputs": [],
55
+ "name": "InvalidDataRemainder",
56
+ "type": "error"
57
+ },
58
+ {
59
+ "inputs": [],
60
+ "name": "InvalidHeader",
61
+ "type": "error"
62
+ },
63
+ {
64
+ "inputs": [],
65
+ "name": "OptimismPortal_AlreadyFinalized",
66
+ "type": "error"
67
+ },
68
+ {
69
+ "inputs": [],
70
+ "name": "OptimismPortal_BadTarget",
71
+ "type": "error"
72
+ },
73
+ {
74
+ "inputs": [],
75
+ "name": "OptimismPortal_CallPaused",
76
+ "type": "error"
77
+ },
78
+ {
79
+ "inputs": [],
80
+ "name": "OptimismPortal_CalldataTooLarge",
81
+ "type": "error"
82
+ },
83
+ {
84
+ "inputs": [],
85
+ "name": "OptimismPortal_GasEstimation",
86
+ "type": "error"
87
+ },
88
+ {
89
+ "inputs": [],
90
+ "name": "OptimismPortal_GasLimitTooLow",
91
+ "type": "error"
92
+ },
93
+ {
94
+ "inputs": [],
95
+ "name": "OptimismPortal_ImproperDisputeGame",
96
+ "type": "error"
97
+ },
98
+ {
99
+ "inputs": [],
100
+ "name": "OptimismPortal_InvalidDisputeGame",
101
+ "type": "error"
102
+ },
103
+ {
104
+ "inputs": [],
105
+ "name": "OptimismPortal_InvalidLockboxState",
106
+ "type": "error"
107
+ },
108
+ {
109
+ "inputs": [],
110
+ "name": "OptimismPortal_InvalidMerkleProof",
111
+ "type": "error"
112
+ },
113
+ {
114
+ "inputs": [],
115
+ "name": "OptimismPortal_InvalidOutputRootProof",
116
+ "type": "error"
117
+ },
118
+ {
119
+ "inputs": [],
120
+ "name": "OptimismPortal_InvalidProofTimestamp",
121
+ "type": "error"
122
+ },
123
+ {
124
+ "inputs": [],
125
+ "name": "OptimismPortal_InvalidRootClaim",
126
+ "type": "error"
127
+ },
128
+ {
129
+ "inputs": [],
130
+ "name": "OptimismPortal_NoReentrancy",
131
+ "type": "error"
132
+ },
133
+ {
134
+ "inputs": [],
135
+ "name": "OptimismPortal_NotAllowedOnCGTMode",
136
+ "type": "error"
137
+ },
138
+ {
139
+ "inputs": [],
140
+ "name": "OptimismPortal_ProofNotOldEnough",
141
+ "type": "error"
142
+ },
143
+ {
144
+ "inputs": [],
145
+ "name": "OptimismPortal_Unproven",
146
+ "type": "error"
147
+ },
148
+ {
149
+ "inputs": [],
150
+ "name": "OutOfGas",
151
+ "type": "error"
152
+ },
153
+ {
154
+ "inputs": [],
155
+ "name": "ProxyAdminOwnedBase_NotProxyAdmin",
156
+ "type": "error"
157
+ },
158
+ {
159
+ "inputs": [],
160
+ "name": "ProxyAdminOwnedBase_NotProxyAdminOrProxyAdminOwner",
161
+ "type": "error"
162
+ },
163
+ {
164
+ "inputs": [],
165
+ "name": "ProxyAdminOwnedBase_NotProxyAdminOwner",
166
+ "type": "error"
167
+ },
168
+ {
169
+ "inputs": [],
170
+ "name": "ProxyAdminOwnedBase_NotResolvedDelegateProxy",
171
+ "type": "error"
172
+ },
173
+ {
174
+ "inputs": [],
175
+ "name": "ProxyAdminOwnedBase_NotSharedProxyAdminOwner",
176
+ "type": "error"
177
+ },
178
+ {
179
+ "inputs": [],
180
+ "name": "ProxyAdminOwnedBase_ProxyAdminNotFound",
181
+ "type": "error"
182
+ },
183
+ {
184
+ "inputs": [],
185
+ "name": "ReinitializableBase_ZeroInitVersion",
186
+ "type": "error"
187
+ },
188
+ {
189
+ "inputs": [],
190
+ "name": "UnexpectedList",
191
+ "type": "error"
192
+ },
193
+ {
194
+ "inputs": [],
195
+ "name": "UnexpectedString",
196
+ "type": "error"
197
+ },
198
+ {
199
+ "anonymous": false,
200
+ "inputs": [
201
+ {
202
+ "indexed": false,
203
+ "internalType": "uint8",
204
+ "name": "version",
205
+ "type": "uint8"
206
+ }
207
+ ],
208
+ "name": "Initialized",
209
+ "type": "event"
210
+ },
211
+ {
212
+ "anonymous": false,
213
+ "inputs": [
214
+ {
215
+ "indexed": true,
216
+ "internalType": "address",
217
+ "name": "from",
218
+ "type": "address"
219
+ },
220
+ {
221
+ "indexed": true,
222
+ "internalType": "address",
223
+ "name": "to",
224
+ "type": "address"
225
+ },
226
+ {
227
+ "indexed": true,
228
+ "internalType": "uint256",
229
+ "name": "version",
230
+ "type": "uint256"
231
+ },
232
+ {
233
+ "indexed": false,
234
+ "internalType": "bytes",
235
+ "name": "opaqueData",
236
+ "type": "bytes"
237
+ }
238
+ ],
239
+ "name": "TransactionDeposited",
240
+ "type": "event"
241
+ },
242
+ {
243
+ "anonymous": false,
244
+ "inputs": [
245
+ {
246
+ "indexed": true,
247
+ "internalType": "bytes32",
248
+ "name": "withdrawalHash",
249
+ "type": "bytes32"
250
+ },
251
+ {
252
+ "indexed": false,
253
+ "internalType": "bool",
254
+ "name": "success",
255
+ "type": "bool"
256
+ }
257
+ ],
258
+ "name": "WithdrawalFinalized",
259
+ "type": "event"
260
+ },
261
+ {
262
+ "anonymous": false,
263
+ "inputs": [
264
+ {
265
+ "indexed": true,
266
+ "internalType": "bytes32",
267
+ "name": "withdrawalHash",
268
+ "type": "bytes32"
269
+ },
270
+ {
271
+ "indexed": true,
272
+ "internalType": "address",
273
+ "name": "from",
274
+ "type": "address"
275
+ },
276
+ {
277
+ "indexed": true,
278
+ "internalType": "address",
279
+ "name": "to",
280
+ "type": "address"
281
+ }
282
+ ],
283
+ "name": "WithdrawalProven",
284
+ "type": "event"
285
+ },
286
+ {
287
+ "anonymous": false,
288
+ "inputs": [
289
+ {
290
+ "indexed": true,
291
+ "internalType": "bytes32",
292
+ "name": "withdrawalHash",
293
+ "type": "bytes32"
294
+ },
295
+ {
296
+ "indexed": true,
297
+ "internalType": "address",
298
+ "name": "proofSubmitter",
299
+ "type": "address"
300
+ }
301
+ ],
302
+ "name": "WithdrawalProvenExtension1",
303
+ "type": "event"
304
+ },
305
+ {
306
+ "inputs": [],
307
+ "name": "anchorStateRegistry",
308
+ "outputs": [
309
+ {
310
+ "internalType": "contract IAnchorStateRegistry",
311
+ "name": "",
312
+ "type": "address"
313
+ }
314
+ ],
315
+ "stateMutability": "view",
316
+ "type": "function"
317
+ },
318
+ {
319
+ "inputs": [
320
+ {
321
+ "internalType": "bytes32",
322
+ "name": "_withdrawalHash",
323
+ "type": "bytes32"
324
+ },
325
+ {
326
+ "internalType": "address",
327
+ "name": "_proofSubmitter",
328
+ "type": "address"
329
+ }
330
+ ],
331
+ "name": "checkWithdrawal",
332
+ "outputs": [],
333
+ "stateMutability": "view",
334
+ "type": "function"
335
+ },
336
+ {
337
+ "inputs": [
338
+ {
339
+ "internalType": "address",
340
+ "name": "_to",
341
+ "type": "address"
342
+ },
343
+ {
344
+ "internalType": "uint256",
345
+ "name": "_value",
346
+ "type": "uint256"
347
+ },
348
+ {
349
+ "internalType": "uint64",
350
+ "name": "_gasLimit",
351
+ "type": "uint64"
352
+ },
353
+ {
354
+ "internalType": "bool",
355
+ "name": "_isCreation",
356
+ "type": "bool"
357
+ },
358
+ {
359
+ "internalType": "bytes",
360
+ "name": "_data",
361
+ "type": "bytes"
362
+ }
363
+ ],
364
+ "name": "depositTransaction",
365
+ "outputs": [],
366
+ "stateMutability": "payable",
367
+ "type": "function"
368
+ },
369
+ {
370
+ "inputs": [
371
+ {
372
+ "internalType": "contract IDisputeGame",
373
+ "name": "_disputeGame",
374
+ "type": "address"
375
+ }
376
+ ],
377
+ "name": "disputeGameBlacklist",
378
+ "outputs": [
379
+ {
380
+ "internalType": "bool",
381
+ "name": "",
382
+ "type": "bool"
383
+ }
384
+ ],
385
+ "stateMutability": "view",
386
+ "type": "function"
387
+ },
388
+ {
389
+ "inputs": [],
390
+ "name": "disputeGameFactory",
391
+ "outputs": [
392
+ {
393
+ "internalType": "contract IDisputeGameFactory",
394
+ "name": "",
395
+ "type": "address"
396
+ }
397
+ ],
398
+ "stateMutability": "view",
399
+ "type": "function"
400
+ },
401
+ {
402
+ "inputs": [],
403
+ "name": "disputeGameFinalityDelaySeconds",
404
+ "outputs": [
405
+ {
406
+ "internalType": "uint256",
407
+ "name": "",
408
+ "type": "uint256"
409
+ }
410
+ ],
411
+ "stateMutability": "view",
412
+ "type": "function"
413
+ },
414
+ {
415
+ "inputs": [],
416
+ "name": "donateETH",
417
+ "outputs": [],
418
+ "stateMutability": "payable",
419
+ "type": "function"
420
+ },
421
+ {
422
+ "inputs": [],
423
+ "name": "ethLockbox",
424
+ "outputs": [
425
+ {
426
+ "internalType": "contract IETHLockbox",
427
+ "name": "",
428
+ "type": "address"
429
+ }
430
+ ],
431
+ "stateMutability": "view",
432
+ "type": "function"
433
+ },
434
+ {
435
+ "inputs": [
436
+ {
437
+ "components": [
438
+ {
439
+ "internalType": "uint256",
440
+ "name": "nonce",
441
+ "type": "uint256"
442
+ },
443
+ {
444
+ "internalType": "address",
445
+ "name": "sender",
446
+ "type": "address"
447
+ },
448
+ {
449
+ "internalType": "address",
450
+ "name": "target",
451
+ "type": "address"
452
+ },
453
+ {
454
+ "internalType": "uint256",
455
+ "name": "value",
456
+ "type": "uint256"
457
+ },
458
+ {
459
+ "internalType": "uint256",
460
+ "name": "gasLimit",
461
+ "type": "uint256"
462
+ },
463
+ {
464
+ "internalType": "bytes",
465
+ "name": "data",
466
+ "type": "bytes"
467
+ }
468
+ ],
469
+ "internalType": "struct Types.WithdrawalTransaction",
470
+ "name": "_tx",
471
+ "type": "tuple"
472
+ }
473
+ ],
474
+ "name": "finalizeWithdrawalTransaction",
475
+ "outputs": [],
476
+ "stateMutability": "nonpayable",
477
+ "type": "function"
478
+ },
479
+ {
480
+ "inputs": [
481
+ {
482
+ "components": [
483
+ {
484
+ "internalType": "uint256",
485
+ "name": "nonce",
486
+ "type": "uint256"
487
+ },
488
+ {
489
+ "internalType": "address",
490
+ "name": "sender",
491
+ "type": "address"
492
+ },
493
+ {
494
+ "internalType": "address",
495
+ "name": "target",
496
+ "type": "address"
497
+ },
498
+ {
499
+ "internalType": "uint256",
500
+ "name": "value",
501
+ "type": "uint256"
502
+ },
503
+ {
504
+ "internalType": "uint256",
505
+ "name": "gasLimit",
506
+ "type": "uint256"
507
+ },
508
+ {
509
+ "internalType": "bytes",
510
+ "name": "data",
511
+ "type": "bytes"
512
+ }
513
+ ],
514
+ "internalType": "struct Types.WithdrawalTransaction",
515
+ "name": "_tx",
516
+ "type": "tuple"
517
+ },
518
+ {
519
+ "internalType": "address",
520
+ "name": "_proofSubmitter",
521
+ "type": "address"
522
+ }
523
+ ],
524
+ "name": "finalizeWithdrawalTransactionExternalProof",
525
+ "outputs": [],
526
+ "stateMutability": "nonpayable",
527
+ "type": "function"
528
+ },
529
+ {
530
+ "inputs": [
531
+ {
532
+ "internalType": "bytes32",
533
+ "name": "",
534
+ "type": "bytes32"
535
+ }
536
+ ],
537
+ "name": "finalizedWithdrawals",
538
+ "outputs": [
539
+ {
540
+ "internalType": "bool",
541
+ "name": "",
542
+ "type": "bool"
543
+ }
544
+ ],
545
+ "stateMutability": "view",
546
+ "type": "function"
547
+ },
548
+ {
549
+ "inputs": [],
550
+ "name": "guardian",
551
+ "outputs": [
552
+ {
553
+ "internalType": "address",
554
+ "name": "",
555
+ "type": "address"
556
+ }
557
+ ],
558
+ "stateMutability": "view",
559
+ "type": "function"
560
+ },
561
+ {
562
+ "inputs": [],
563
+ "name": "initVersion",
564
+ "outputs": [
565
+ {
566
+ "internalType": "uint8",
567
+ "name": "",
568
+ "type": "uint8"
569
+ }
570
+ ],
571
+ "stateMutability": "view",
572
+ "type": "function"
573
+ },
574
+ {
575
+ "inputs": [
576
+ {
577
+ "internalType": "contract ISystemConfig",
578
+ "name": "_systemConfig",
579
+ "type": "address"
580
+ },
581
+ {
582
+ "internalType": "contract IAnchorStateRegistry",
583
+ "name": "_anchorStateRegistry",
584
+ "type": "address"
585
+ }
586
+ ],
587
+ "name": "initialize",
588
+ "outputs": [],
589
+ "stateMutability": "nonpayable",
590
+ "type": "function"
591
+ },
592
+ {
593
+ "inputs": [],
594
+ "name": "l2Sender",
595
+ "outputs": [
596
+ {
597
+ "internalType": "address",
598
+ "name": "",
599
+ "type": "address"
600
+ }
601
+ ],
602
+ "stateMutability": "view",
603
+ "type": "function"
604
+ },
605
+ {
606
+ "inputs": [
607
+ {
608
+ "internalType": "uint64",
609
+ "name": "_byteCount",
610
+ "type": "uint64"
611
+ }
612
+ ],
613
+ "name": "minimumGasLimit",
614
+ "outputs": [
615
+ {
616
+ "internalType": "uint64",
617
+ "name": "",
618
+ "type": "uint64"
619
+ }
620
+ ],
621
+ "stateMutability": "pure",
622
+ "type": "function"
623
+ },
624
+ {
625
+ "inputs": [
626
+ {
627
+ "internalType": "bytes32",
628
+ "name": "_withdrawalHash",
629
+ "type": "bytes32"
630
+ }
631
+ ],
632
+ "name": "numProofSubmitters",
633
+ "outputs": [
634
+ {
635
+ "internalType": "uint256",
636
+ "name": "",
637
+ "type": "uint256"
638
+ }
639
+ ],
640
+ "stateMutability": "view",
641
+ "type": "function"
642
+ },
643
+ {
644
+ "inputs": [],
645
+ "name": "params",
646
+ "outputs": [
647
+ {
648
+ "internalType": "uint128",
649
+ "name": "prevBaseFee",
650
+ "type": "uint128"
651
+ },
652
+ {
653
+ "internalType": "uint64",
654
+ "name": "prevBoughtGas",
655
+ "type": "uint64"
656
+ },
657
+ {
658
+ "internalType": "uint64",
659
+ "name": "prevBlockNum",
660
+ "type": "uint64"
661
+ }
662
+ ],
663
+ "stateMutability": "view",
664
+ "type": "function"
665
+ },
666
+ {
667
+ "inputs": [],
668
+ "name": "paused",
669
+ "outputs": [
670
+ {
671
+ "internalType": "bool",
672
+ "name": "",
673
+ "type": "bool"
674
+ }
675
+ ],
676
+ "stateMutability": "view",
677
+ "type": "function"
678
+ },
679
+ {
680
+ "inputs": [],
681
+ "name": "proofMaturityDelaySeconds",
682
+ "outputs": [
683
+ {
684
+ "internalType": "uint256",
685
+ "name": "",
686
+ "type": "uint256"
687
+ }
688
+ ],
689
+ "stateMutability": "view",
690
+ "type": "function"
691
+ },
692
+ {
693
+ "inputs": [
694
+ {
695
+ "internalType": "bytes32",
696
+ "name": "",
697
+ "type": "bytes32"
698
+ },
699
+ {
700
+ "internalType": "uint256",
701
+ "name": "",
702
+ "type": "uint256"
703
+ }
704
+ ],
705
+ "name": "proofSubmitters",
706
+ "outputs": [
707
+ {
708
+ "internalType": "address",
709
+ "name": "",
710
+ "type": "address"
711
+ }
712
+ ],
713
+ "stateMutability": "view",
714
+ "type": "function"
715
+ },
716
+ {
717
+ "inputs": [
718
+ {
719
+ "components": [
720
+ {
721
+ "internalType": "uint256",
722
+ "name": "nonce",
723
+ "type": "uint256"
724
+ },
725
+ {
726
+ "internalType": "address",
727
+ "name": "sender",
728
+ "type": "address"
729
+ },
730
+ {
731
+ "internalType": "address",
732
+ "name": "target",
733
+ "type": "address"
734
+ },
735
+ {
736
+ "internalType": "uint256",
737
+ "name": "value",
738
+ "type": "uint256"
739
+ },
740
+ {
741
+ "internalType": "uint256",
742
+ "name": "gasLimit",
743
+ "type": "uint256"
744
+ },
745
+ {
746
+ "internalType": "bytes",
747
+ "name": "data",
748
+ "type": "bytes"
749
+ }
750
+ ],
751
+ "internalType": "struct Types.WithdrawalTransaction",
752
+ "name": "_tx",
753
+ "type": "tuple"
754
+ },
755
+ {
756
+ "internalType": "uint256",
757
+ "name": "_disputeGameIndex",
758
+ "type": "uint256"
759
+ },
760
+ {
761
+ "components": [
762
+ {
763
+ "internalType": "bytes32",
764
+ "name": "version",
765
+ "type": "bytes32"
766
+ },
767
+ {
768
+ "internalType": "bytes32",
769
+ "name": "stateRoot",
770
+ "type": "bytes32"
771
+ },
772
+ {
773
+ "internalType": "bytes32",
774
+ "name": "messagePasserStorageRoot",
775
+ "type": "bytes32"
776
+ },
777
+ {
778
+ "internalType": "bytes32",
779
+ "name": "latestBlockhash",
780
+ "type": "bytes32"
781
+ }
782
+ ],
783
+ "internalType": "struct Types.OutputRootProof",
784
+ "name": "_outputRootProof",
785
+ "type": "tuple"
786
+ },
787
+ {
788
+ "internalType": "bytes[]",
789
+ "name": "_withdrawalProof",
790
+ "type": "bytes[]"
791
+ }
792
+ ],
793
+ "name": "proveWithdrawalTransaction",
794
+ "outputs": [],
795
+ "stateMutability": "nonpayable",
796
+ "type": "function"
797
+ },
798
+ {
799
+ "inputs": [
800
+ {
801
+ "internalType": "bytes32",
802
+ "name": "",
803
+ "type": "bytes32"
804
+ },
805
+ {
806
+ "internalType": "address",
807
+ "name": "",
808
+ "type": "address"
809
+ }
810
+ ],
811
+ "name": "provenWithdrawals",
812
+ "outputs": [
813
+ {
814
+ "internalType": "contract IDisputeGame",
815
+ "name": "disputeGameProxy",
816
+ "type": "address"
817
+ },
818
+ {
819
+ "internalType": "uint64",
820
+ "name": "timestamp",
821
+ "type": "uint64"
822
+ }
823
+ ],
824
+ "stateMutability": "view",
825
+ "type": "function"
826
+ },
827
+ {
828
+ "inputs": [],
829
+ "name": "proxyAdmin",
830
+ "outputs": [
831
+ {
832
+ "internalType": "contract IProxyAdmin",
833
+ "name": "",
834
+ "type": "address"
835
+ }
836
+ ],
837
+ "stateMutability": "view",
838
+ "type": "function"
839
+ },
840
+ {
841
+ "inputs": [],
842
+ "name": "proxyAdminOwner",
843
+ "outputs": [
844
+ {
845
+ "internalType": "address",
846
+ "name": "",
847
+ "type": "address"
848
+ }
849
+ ],
850
+ "stateMutability": "view",
851
+ "type": "function"
852
+ },
853
+ {
854
+ "inputs": [],
855
+ "name": "respectedGameType",
856
+ "outputs": [
857
+ {
858
+ "internalType": "GameType",
859
+ "name": "",
860
+ "type": "uint32"
861
+ }
862
+ ],
863
+ "stateMutability": "view",
864
+ "type": "function"
865
+ },
866
+ {
867
+ "inputs": [],
868
+ "name": "respectedGameTypeUpdatedAt",
869
+ "outputs": [
870
+ {
871
+ "internalType": "uint64",
872
+ "name": "",
873
+ "type": "uint64"
874
+ }
875
+ ],
876
+ "stateMutability": "view",
877
+ "type": "function"
878
+ },
879
+ {
880
+ "inputs": [],
881
+ "name": "superchainConfig",
882
+ "outputs": [
883
+ {
884
+ "internalType": "contract ISuperchainConfig",
885
+ "name": "",
886
+ "type": "address"
887
+ }
888
+ ],
889
+ "stateMutability": "view",
890
+ "type": "function"
891
+ },
892
+ {
893
+ "inputs": [],
894
+ "name": "systemConfig",
895
+ "outputs": [
896
+ {
897
+ "internalType": "contract ISystemConfig",
898
+ "name": "",
899
+ "type": "address"
900
+ }
901
+ ],
902
+ "stateMutability": "view",
903
+ "type": "function"
904
+ },
905
+ {
906
+ "inputs": [],
907
+ "name": "version",
908
+ "outputs": [
909
+ {
910
+ "internalType": "string",
911
+ "name": "",
912
+ "type": "string"
913
+ }
914
+ ],
915
+ "stateMutability": "pure",
916
+ "type": "function"
917
+ },
918
+ {
919
+ "stateMutability": "payable",
920
+ "type": "receive"
921
+ }
922
+ ] as const satisfies Abi;
923
+
924
+ /**
925
+ * Type-safe ABI for OptimismPortal2_json
926
+ */
927
+ export type OptimismPortal2_jsonAbi = typeof OptimismPortal2_jsonAbi;
928
+
929
+ /**
930
+ * Contract instance type for OptimismPortal2_json
931
+ */
932
+ // Use any for contract type to avoid complex viem type issues
933
+ // The runtime behavior is type-safe through viem's ABI typing
934
+ export type OptimismPortal2_jsonContract = any;
935
+
936
+ /**
937
+ * OptimismPortal2_json Contract Class
938
+ *
939
+ * Provides a class-based API similar to TypeChain for interacting with the contract.
940
+ *
941
+ * @example
942
+ * ```typescript
943
+ * import { createPublicClient, createWalletClient, http } from 'viem';
944
+ * import { mainnet } from 'viem/chains';
945
+ * import { OptimismPortal2_json } from 'OptimismPortal2_json';
946
+ *
947
+ * const publicClient = createPublicClient({ chain: mainnet, transport: http() });
948
+ * const walletClient = createWalletClient({ chain: mainnet, transport: http() });
949
+ *
950
+ * const contract = new OptimismPortal2_json('0x...', { publicClient, walletClient });
951
+ *
952
+ * // Read functions
953
+ * const result = await contract.balanceOf('0x...');
954
+ *
955
+ * // Write functions
956
+ * const hash = await contract.transfer('0x...', 1000n);
957
+ *
958
+ * // Simulate transactions (dry-run)
959
+ * const simulation = await contract.simulate.transfer('0x...', 1000n);
960
+ * console.log('Gas estimate:', simulation.request.gas);
961
+ *
962
+ * // Watch events
963
+ * const unwatch = contract.watch.Transfer((event) => {
964
+ * console.log('Transfer event:', event);
965
+ * });
966
+ * ```
967
+ */
968
+ export class OptimismPortal2_json {
969
+ private contract: OptimismPortal2_jsonContract;
970
+ private contractAddress: Address;
971
+ private publicClient: PublicClient;
972
+
973
+ constructor(
974
+ address: Address,
975
+ clients: {
976
+ publicClient: PublicClient;
977
+ walletClient?: WalletClient;
978
+ }
979
+ ) {
980
+ this.contractAddress = address;
981
+ this.publicClient = clients.publicClient;
982
+ this.contract = getContract({
983
+ address,
984
+ abi: OptimismPortal2_jsonAbi,
985
+ client: {
986
+ public: clients.publicClient,
987
+ wallet: clients.walletClient,
988
+ },
989
+ });
990
+ }
991
+
992
+ /**
993
+ * Get the contract address
994
+ */
995
+ get address(): Address {
996
+ return this.contractAddress;
997
+ }
998
+
999
+ /**
1000
+ * Get the underlying viem contract instance
1001
+ */
1002
+ getContract(): OptimismPortal2_jsonContract {
1003
+ return this.contract;
1004
+ }
1005
+
1006
+ /**
1007
+ * anchorStateRegistry
1008
+ * view
1009
+ */
1010
+ async anchorStateRegistry(): Promise<`0x${string}`> {
1011
+ return this.contract.read.anchorStateRegistry() as Promise<`0x${string}`>;
1012
+ }
1013
+
1014
+ /**
1015
+ * checkWithdrawal
1016
+ * view
1017
+ */
1018
+ async checkWithdrawal(_withdrawalHash: `0x${string}`, _proofSubmitter: `0x${string}`): Promise<void> {
1019
+ return this.contract.read.checkWithdrawal([_withdrawalHash, _proofSubmitter] as const) as Promise<void>;
1020
+ }
1021
+
1022
+ /**
1023
+ * disputeGameBlacklist
1024
+ * view
1025
+ */
1026
+ async disputeGameBlacklist(_disputeGame: `0x${string}`): Promise<boolean> {
1027
+ return this.contract.read.disputeGameBlacklist([_disputeGame] as const) as Promise<boolean>;
1028
+ }
1029
+
1030
+ /**
1031
+ * disputeGameFactory
1032
+ * view
1033
+ */
1034
+ async disputeGameFactory(): Promise<`0x${string}`> {
1035
+ return this.contract.read.disputeGameFactory() as Promise<`0x${string}`>;
1036
+ }
1037
+
1038
+ /**
1039
+ * disputeGameFinalityDelaySeconds
1040
+ * view
1041
+ */
1042
+ async disputeGameFinalityDelaySeconds(): Promise<bigint> {
1043
+ return this.contract.read.disputeGameFinalityDelaySeconds() as Promise<bigint>;
1044
+ }
1045
+
1046
+ /**
1047
+ * ethLockbox
1048
+ * view
1049
+ */
1050
+ async ethLockbox(): Promise<`0x${string}`> {
1051
+ return this.contract.read.ethLockbox() as Promise<`0x${string}`>;
1052
+ }
1053
+
1054
+ /**
1055
+ * finalizedWithdrawals
1056
+ * view
1057
+ */
1058
+ async finalizedWithdrawals(arg0: `0x${string}`): Promise<boolean> {
1059
+ return this.contract.read.finalizedWithdrawals([arg0] as const) as Promise<boolean>;
1060
+ }
1061
+
1062
+ /**
1063
+ * guardian
1064
+ * view
1065
+ */
1066
+ async guardian(): Promise<`0x${string}`> {
1067
+ return this.contract.read.guardian() as Promise<`0x${string}`>;
1068
+ }
1069
+
1070
+ /**
1071
+ * initVersion
1072
+ * view
1073
+ */
1074
+ async initVersion(): Promise<bigint> {
1075
+ return this.contract.read.initVersion() as Promise<bigint>;
1076
+ }
1077
+
1078
+ /**
1079
+ * l2Sender
1080
+ * view
1081
+ */
1082
+ async l2Sender(): Promise<`0x${string}`> {
1083
+ return this.contract.read.l2Sender() as Promise<`0x${string}`>;
1084
+ }
1085
+
1086
+ /**
1087
+ * minimumGasLimit
1088
+ * pure
1089
+ */
1090
+ async minimumGasLimit(_byteCount: bigint): Promise<bigint> {
1091
+ return this.contract.read.minimumGasLimit([_byteCount] as const) as Promise<bigint>;
1092
+ }
1093
+
1094
+ /**
1095
+ * numProofSubmitters
1096
+ * view
1097
+ */
1098
+ async numProofSubmitters(_withdrawalHash: `0x${string}`): Promise<bigint> {
1099
+ return this.contract.read.numProofSubmitters([_withdrawalHash] as const) as Promise<bigint>;
1100
+ }
1101
+
1102
+ /**
1103
+ * params
1104
+ * view
1105
+ */
1106
+ async params(): Promise<[bigint, bigint, bigint]> {
1107
+ return this.contract.read.params() as Promise<[bigint, bigint, bigint]>;
1108
+ }
1109
+
1110
+ /**
1111
+ * paused
1112
+ * view
1113
+ */
1114
+ async paused(): Promise<boolean> {
1115
+ return this.contract.read.paused() as Promise<boolean>;
1116
+ }
1117
+
1118
+ /**
1119
+ * proofMaturityDelaySeconds
1120
+ * view
1121
+ */
1122
+ async proofMaturityDelaySeconds(): Promise<bigint> {
1123
+ return this.contract.read.proofMaturityDelaySeconds() as Promise<bigint>;
1124
+ }
1125
+
1126
+ /**
1127
+ * proofSubmitters
1128
+ * view
1129
+ */
1130
+ async proofSubmitters(arg0: `0x${string}`, arg1: bigint): Promise<`0x${string}`> {
1131
+ return this.contract.read.proofSubmitters([arg0, arg1] as const) as Promise<`0x${string}`>;
1132
+ }
1133
+
1134
+ /**
1135
+ * provenWithdrawals
1136
+ * view
1137
+ */
1138
+ async provenWithdrawals(arg0: `0x${string}`, arg1: `0x${string}`): Promise<[`0x${string}`, bigint]> {
1139
+ return this.contract.read.provenWithdrawals([arg0, arg1] as const) as Promise<[`0x${string}`, bigint]>;
1140
+ }
1141
+
1142
+ /**
1143
+ * proxyAdmin
1144
+ * view
1145
+ */
1146
+ async proxyAdmin(): Promise<`0x${string}`> {
1147
+ return this.contract.read.proxyAdmin() as Promise<`0x${string}`>;
1148
+ }
1149
+
1150
+ /**
1151
+ * proxyAdminOwner
1152
+ * view
1153
+ */
1154
+ async proxyAdminOwner(): Promise<`0x${string}`> {
1155
+ return this.contract.read.proxyAdminOwner() as Promise<`0x${string}`>;
1156
+ }
1157
+
1158
+ /**
1159
+ * respectedGameType
1160
+ * view
1161
+ */
1162
+ async respectedGameType(): Promise<bigint> {
1163
+ return this.contract.read.respectedGameType() as Promise<bigint>;
1164
+ }
1165
+
1166
+ /**
1167
+ * respectedGameTypeUpdatedAt
1168
+ * view
1169
+ */
1170
+ async respectedGameTypeUpdatedAt(): Promise<bigint> {
1171
+ return this.contract.read.respectedGameTypeUpdatedAt() as Promise<bigint>;
1172
+ }
1173
+
1174
+ /**
1175
+ * superchainConfig
1176
+ * view
1177
+ */
1178
+ async superchainConfig(): Promise<`0x${string}`> {
1179
+ return this.contract.read.superchainConfig() as Promise<`0x${string}`>;
1180
+ }
1181
+
1182
+ /**
1183
+ * systemConfig
1184
+ * view
1185
+ */
1186
+ async systemConfig(): Promise<`0x${string}`> {
1187
+ return this.contract.read.systemConfig() as Promise<`0x${string}`>;
1188
+ }
1189
+
1190
+ /**
1191
+ * version
1192
+ * pure
1193
+ */
1194
+ async version(): Promise<string> {
1195
+ return this.contract.read.version() as Promise<string>;
1196
+ }
1197
+
1198
+ /**
1199
+ * depositTransaction
1200
+ * payable
1201
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1202
+ */
1203
+ async depositTransaction(_to: `0x${string}`, _value: bigint, _gasLimit: bigint, _isCreation: boolean, _data: `0x${string}`, options?: {
1204
+ accessList?: import('viem').AccessList;
1205
+ authorizationList?: import('viem').AuthorizationList;
1206
+ chain?: import('viem').Chain | null;
1207
+ dataSuffix?: `0x${string}`;
1208
+ gas?: bigint;
1209
+ gasPrice?: bigint;
1210
+ maxFeePerGas?: bigint;
1211
+ maxPriorityFeePerGas?: bigint;
1212
+ nonce?: number;
1213
+ value?: bigint;
1214
+ }): Promise<`0x${string}`> {
1215
+ if (!this.contract.write) {
1216
+ throw new Error('Wallet client is required for write operations');
1217
+ }
1218
+ return this.contract.write.depositTransaction([_to, _value, _gasLimit, _isCreation, _data] as const, options) as Promise<`0x${string}`>;
1219
+ }
1220
+
1221
+ /**
1222
+ * donateETH
1223
+ * payable
1224
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1225
+ */
1226
+ async donateETH(options?: {
1227
+ accessList?: import('viem').AccessList;
1228
+ authorizationList?: import('viem').AuthorizationList;
1229
+ chain?: import('viem').Chain | null;
1230
+ dataSuffix?: `0x${string}`;
1231
+ gas?: bigint;
1232
+ gasPrice?: bigint;
1233
+ maxFeePerGas?: bigint;
1234
+ maxPriorityFeePerGas?: bigint;
1235
+ nonce?: number;
1236
+ value?: bigint;
1237
+ }): Promise<`0x${string}`> {
1238
+ if (!this.contract.write) {
1239
+ throw new Error('Wallet client is required for write operations');
1240
+ }
1241
+ return this.contract.write.donateETH(options) as Promise<`0x${string}`>;
1242
+ }
1243
+
1244
+ /**
1245
+ * finalizeWithdrawalTransaction
1246
+ * nonpayable
1247
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1248
+ */
1249
+ async finalizeWithdrawalTransaction(_tx: Types_WithdrawalTransaction, options?: {
1250
+ accessList?: import('viem').AccessList;
1251
+ authorizationList?: import('viem').AuthorizationList;
1252
+ chain?: import('viem').Chain | null;
1253
+ dataSuffix?: `0x${string}`;
1254
+ gas?: bigint;
1255
+ gasPrice?: bigint;
1256
+ maxFeePerGas?: bigint;
1257
+ maxPriorityFeePerGas?: bigint;
1258
+ nonce?: number;
1259
+ value?: bigint;
1260
+ }): Promise<`0x${string}`> {
1261
+ if (!this.contract.write) {
1262
+ throw new Error('Wallet client is required for write operations');
1263
+ }
1264
+ return this.contract.write.finalizeWithdrawalTransaction([_tx] as const, options) as Promise<`0x${string}`>;
1265
+ }
1266
+
1267
+ /**
1268
+ * finalizeWithdrawalTransactionExternalProof
1269
+ * nonpayable
1270
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1271
+ */
1272
+ async finalizeWithdrawalTransactionExternalProof(_tx: Types_WithdrawalTransaction, _proofSubmitter: `0x${string}`, options?: {
1273
+ accessList?: import('viem').AccessList;
1274
+ authorizationList?: import('viem').AuthorizationList;
1275
+ chain?: import('viem').Chain | null;
1276
+ dataSuffix?: `0x${string}`;
1277
+ gas?: bigint;
1278
+ gasPrice?: bigint;
1279
+ maxFeePerGas?: bigint;
1280
+ maxPriorityFeePerGas?: bigint;
1281
+ nonce?: number;
1282
+ value?: bigint;
1283
+ }): Promise<`0x${string}`> {
1284
+ if (!this.contract.write) {
1285
+ throw new Error('Wallet client is required for write operations');
1286
+ }
1287
+ return this.contract.write.finalizeWithdrawalTransactionExternalProof([_tx, _proofSubmitter] as const, options) as Promise<`0x${string}`>;
1288
+ }
1289
+
1290
+ /**
1291
+ * initialize
1292
+ * nonpayable
1293
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1294
+ */
1295
+ async initialize(_systemConfig: `0x${string}`, _anchorStateRegistry: `0x${string}`, options?: {
1296
+ accessList?: import('viem').AccessList;
1297
+ authorizationList?: import('viem').AuthorizationList;
1298
+ chain?: import('viem').Chain | null;
1299
+ dataSuffix?: `0x${string}`;
1300
+ gas?: bigint;
1301
+ gasPrice?: bigint;
1302
+ maxFeePerGas?: bigint;
1303
+ maxPriorityFeePerGas?: bigint;
1304
+ nonce?: number;
1305
+ value?: bigint;
1306
+ }): Promise<`0x${string}`> {
1307
+ if (!this.contract.write) {
1308
+ throw new Error('Wallet client is required for write operations');
1309
+ }
1310
+ return this.contract.write.initialize([_systemConfig, _anchorStateRegistry] as const, options) as Promise<`0x${string}`>;
1311
+ }
1312
+
1313
+ /**
1314
+ * proveWithdrawalTransaction
1315
+ * nonpayable
1316
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1317
+ */
1318
+ async proveWithdrawalTransaction(_tx: Types_WithdrawalTransaction, _disputeGameIndex: bigint, _outputRootProof: Types_OutputRootProof, _withdrawalProof: `0x${string}`[], options?: {
1319
+ accessList?: import('viem').AccessList;
1320
+ authorizationList?: import('viem').AuthorizationList;
1321
+ chain?: import('viem').Chain | null;
1322
+ dataSuffix?: `0x${string}`;
1323
+ gas?: bigint;
1324
+ gasPrice?: bigint;
1325
+ maxFeePerGas?: bigint;
1326
+ maxPriorityFeePerGas?: bigint;
1327
+ nonce?: number;
1328
+ value?: bigint;
1329
+ }): Promise<`0x${string}`> {
1330
+ if (!this.contract.write) {
1331
+ throw new Error('Wallet client is required for write operations');
1332
+ }
1333
+ return this.contract.write.proveWithdrawalTransaction([_tx, _disputeGameIndex, _outputRootProof, _withdrawalProof] as const, options) as Promise<`0x${string}`>;
1334
+ }
1335
+
1336
+
1337
+
1338
+ /**
1339
+ * Simulate contract write operations (dry-run without sending transaction)
1340
+ *
1341
+ * @example
1342
+ * const result = await contract.simulate.transfer('0x...', 1000n);
1343
+ * console.log('Gas estimate:', result.request.gas);
1344
+ * console.log('Would succeed:', result.result);
1345
+ */
1346
+ get simulate() {
1347
+ const contract = this.contract;
1348
+ if (!contract.simulate) {
1349
+ throw new Error('Public client is required for simulation');
1350
+ }
1351
+ return {
1352
+ /**
1353
+ * Simulate depositTransaction
1354
+ * Returns gas estimate and result without sending transaction
1355
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1356
+ */
1357
+ async depositTransaction(_to: `0x${string}`, _value: bigint, _gasLimit: bigint, _isCreation: boolean, _data: `0x${string}`, options?: {
1358
+ accessList?: import('viem').AccessList;
1359
+ authorizationList?: import('viem').AuthorizationList;
1360
+ chain?: import('viem').Chain | null;
1361
+ dataSuffix?: `0x${string}`;
1362
+ gas?: bigint;
1363
+ gasPrice?: bigint;
1364
+ maxFeePerGas?: bigint;
1365
+ maxPriorityFeePerGas?: bigint;
1366
+ nonce?: number;
1367
+ value?: bigint;
1368
+ }): Promise<void> {
1369
+ return contract.simulate.depositTransaction([_to, _value, _gasLimit, _isCreation, _data] as const, options) as Promise<void>;
1370
+ },
1371
+ /**
1372
+ * Simulate donateETH
1373
+ * Returns gas estimate and result without sending transaction
1374
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1375
+ */
1376
+ async donateETH(options?: {
1377
+ accessList?: import('viem').AccessList;
1378
+ authorizationList?: import('viem').AuthorizationList;
1379
+ chain?: import('viem').Chain | null;
1380
+ dataSuffix?: `0x${string}`;
1381
+ gas?: bigint;
1382
+ gasPrice?: bigint;
1383
+ maxFeePerGas?: bigint;
1384
+ maxPriorityFeePerGas?: bigint;
1385
+ nonce?: number;
1386
+ value?: bigint;
1387
+ }): Promise<void> {
1388
+ return contract.simulate.donateETH(options) as Promise<void>;
1389
+ },
1390
+ /**
1391
+ * Simulate finalizeWithdrawalTransaction
1392
+ * Returns gas estimate and result without sending transaction
1393
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1394
+ */
1395
+ async finalizeWithdrawalTransaction(_tx: Types_WithdrawalTransaction, options?: {
1396
+ accessList?: import('viem').AccessList;
1397
+ authorizationList?: import('viem').AuthorizationList;
1398
+ chain?: import('viem').Chain | null;
1399
+ dataSuffix?: `0x${string}`;
1400
+ gas?: bigint;
1401
+ gasPrice?: bigint;
1402
+ maxFeePerGas?: bigint;
1403
+ maxPriorityFeePerGas?: bigint;
1404
+ nonce?: number;
1405
+ value?: bigint;
1406
+ }): Promise<void> {
1407
+ return contract.simulate.finalizeWithdrawalTransaction([_tx] as const, options) as Promise<void>;
1408
+ },
1409
+ /**
1410
+ * Simulate finalizeWithdrawalTransactionExternalProof
1411
+ * Returns gas estimate and result without sending transaction
1412
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1413
+ */
1414
+ async finalizeWithdrawalTransactionExternalProof(_tx: Types_WithdrawalTransaction, _proofSubmitter: `0x${string}`, options?: {
1415
+ accessList?: import('viem').AccessList;
1416
+ authorizationList?: import('viem').AuthorizationList;
1417
+ chain?: import('viem').Chain | null;
1418
+ dataSuffix?: `0x${string}`;
1419
+ gas?: bigint;
1420
+ gasPrice?: bigint;
1421
+ maxFeePerGas?: bigint;
1422
+ maxPriorityFeePerGas?: bigint;
1423
+ nonce?: number;
1424
+ value?: bigint;
1425
+ }): Promise<void> {
1426
+ return contract.simulate.finalizeWithdrawalTransactionExternalProof([_tx, _proofSubmitter] as const, options) as Promise<void>;
1427
+ },
1428
+ /**
1429
+ * Simulate initialize
1430
+ * Returns gas estimate and result without sending transaction
1431
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1432
+ */
1433
+ async initialize(_systemConfig: `0x${string}`, _anchorStateRegistry: `0x${string}`, options?: {
1434
+ accessList?: import('viem').AccessList;
1435
+ authorizationList?: import('viem').AuthorizationList;
1436
+ chain?: import('viem').Chain | null;
1437
+ dataSuffix?: `0x${string}`;
1438
+ gas?: bigint;
1439
+ gasPrice?: bigint;
1440
+ maxFeePerGas?: bigint;
1441
+ maxPriorityFeePerGas?: bigint;
1442
+ nonce?: number;
1443
+ value?: bigint;
1444
+ }): Promise<void> {
1445
+ return contract.simulate.initialize([_systemConfig, _anchorStateRegistry] as const, options) as Promise<void>;
1446
+ },
1447
+ /**
1448
+ * Simulate proveWithdrawalTransaction
1449
+ * Returns gas estimate and result without sending transaction
1450
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1451
+ */
1452
+ async proveWithdrawalTransaction(_tx: Types_WithdrawalTransaction, _disputeGameIndex: bigint, _outputRootProof: Types_OutputRootProof, _withdrawalProof: `0x${string}`[], options?: {
1453
+ accessList?: import('viem').AccessList;
1454
+ authorizationList?: import('viem').AuthorizationList;
1455
+ chain?: import('viem').Chain | null;
1456
+ dataSuffix?: `0x${string}`;
1457
+ gas?: bigint;
1458
+ gasPrice?: bigint;
1459
+ maxFeePerGas?: bigint;
1460
+ maxPriorityFeePerGas?: bigint;
1461
+ nonce?: number;
1462
+ value?: bigint;
1463
+ }): Promise<void> {
1464
+ return contract.simulate.proveWithdrawalTransaction([_tx, _disputeGameIndex, _outputRootProof, _withdrawalProof] as const, options) as Promise<void>;
1465
+ }
1466
+ };
1467
+ }
1468
+
1469
+ /**
1470
+ * Watch contract events
1471
+ *
1472
+ * @example
1473
+ * // Watch all Transfer events
1474
+ * const unwatch = contract.watch.Transfer((event) => {
1475
+ * console.log('Transfer:', event);
1476
+ * });
1477
+ *
1478
+ * // Stop watching
1479
+ * unwatch();
1480
+ */
1481
+ get watch() {
1482
+ return {
1483
+ /**
1484
+ * Watch Initialized events
1485
+ * @param callback Function to call when event is emitted
1486
+ * @param filter Optional filter for indexed parameters
1487
+ * @returns Unwatch function to stop listening
1488
+ */
1489
+ Initialized: (callback: (event: { version: bigint }) => void) => {
1490
+ return this.publicClient.watchContractEvent({
1491
+ address: this.contractAddress,
1492
+ abi: OptimismPortal2_jsonAbi,
1493
+ eventName: 'Initialized',
1494
+
1495
+ onLogs: (logs: any[]) => {
1496
+ logs.forEach((log: any) => {
1497
+ callback(log.args as any);
1498
+ });
1499
+ },
1500
+ }) as () => void;
1501
+ },
1502
+ /**
1503
+ * Watch TransactionDeposited events
1504
+ * @param callback Function to call when event is emitted
1505
+ * @param filter Optional filter for indexed parameters
1506
+ * @returns Unwatch function to stop listening
1507
+ */
1508
+ TransactionDeposited: (callback: (event: { from: `0x${string}`; to: `0x${string}`; version: bigint; opaqueData: `0x${string}` }) => void, filter?: { from: `0x${string}`; to: `0x${string}`; version: bigint }) => {
1509
+ return this.publicClient.watchContractEvent({
1510
+ address: this.contractAddress,
1511
+ abi: OptimismPortal2_jsonAbi,
1512
+ eventName: 'TransactionDeposited',
1513
+ args: filter,
1514
+ onLogs: (logs: any[]) => {
1515
+ logs.forEach((log: any) => {
1516
+ callback(log.args as any);
1517
+ });
1518
+ },
1519
+ }) as () => void;
1520
+ },
1521
+ /**
1522
+ * Watch WithdrawalFinalized events
1523
+ * @param callback Function to call when event is emitted
1524
+ * @param filter Optional filter for indexed parameters
1525
+ * @returns Unwatch function to stop listening
1526
+ */
1527
+ WithdrawalFinalized: (callback: (event: { withdrawalHash: `0x${string}`; success: boolean }) => void, filter?: { withdrawalHash: `0x${string}` }) => {
1528
+ return this.publicClient.watchContractEvent({
1529
+ address: this.contractAddress,
1530
+ abi: OptimismPortal2_jsonAbi,
1531
+ eventName: 'WithdrawalFinalized',
1532
+ args: filter,
1533
+ onLogs: (logs: any[]) => {
1534
+ logs.forEach((log: any) => {
1535
+ callback(log.args as any);
1536
+ });
1537
+ },
1538
+ }) as () => void;
1539
+ },
1540
+ /**
1541
+ * Watch WithdrawalProven events
1542
+ * @param callback Function to call when event is emitted
1543
+ * @param filter Optional filter for indexed parameters
1544
+ * @returns Unwatch function to stop listening
1545
+ */
1546
+ WithdrawalProven: (callback: (event: { withdrawalHash: `0x${string}`; from: `0x${string}`; to: `0x${string}` }) => void, filter?: { withdrawalHash: `0x${string}`; from: `0x${string}`; to: `0x${string}` }) => {
1547
+ return this.publicClient.watchContractEvent({
1548
+ address: this.contractAddress,
1549
+ abi: OptimismPortal2_jsonAbi,
1550
+ eventName: 'WithdrawalProven',
1551
+ args: filter,
1552
+ onLogs: (logs: any[]) => {
1553
+ logs.forEach((log: any) => {
1554
+ callback(log.args as any);
1555
+ });
1556
+ },
1557
+ }) as () => void;
1558
+ },
1559
+ /**
1560
+ * Watch WithdrawalProvenExtension1 events
1561
+ * @param callback Function to call when event is emitted
1562
+ * @param filter Optional filter for indexed parameters
1563
+ * @returns Unwatch function to stop listening
1564
+ */
1565
+ WithdrawalProvenExtension1: (callback: (event: { withdrawalHash: `0x${string}`; proofSubmitter: `0x${string}` }) => void, filter?: { withdrawalHash: `0x${string}`; proofSubmitter: `0x${string}` }) => {
1566
+ return this.publicClient.watchContractEvent({
1567
+ address: this.contractAddress,
1568
+ abi: OptimismPortal2_jsonAbi,
1569
+ eventName: 'WithdrawalProvenExtension1',
1570
+ args: filter,
1571
+ onLogs: (logs: any[]) => {
1572
+ logs.forEach((log: any) => {
1573
+ callback(log.args as any);
1574
+ });
1575
+ },
1576
+ }) as () => void;
1577
+ }
1578
+ };
1579
+ }
1580
+ }