@gitmyabi/railgunsmartwallet 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,3643 @@
1
+ import type { Abi, Address, PublicClient, WalletClient, GetContractReturnType } from 'viem';
2
+ import { getContract } from 'viem';
3
+
4
+
5
+ /**
6
+ * CommitmentPreimage struct type
7
+ */
8
+ export type CommitmentPreimage = {
9
+ npk: `0x${string}`;
10
+ token: TokenData;
11
+ value: bigint;
12
+ };
13
+
14
+ /**
15
+ * TokenData struct type
16
+ */
17
+ export type TokenData = {
18
+ tokenType: bigint;
19
+ tokenAddress: `0x${string}`;
20
+ tokenSubID: bigint;
21
+ };
22
+
23
+ /**
24
+ * ShieldCiphertext struct type
25
+ */
26
+ export type ShieldCiphertext = {
27
+ encryptedBundle: `0x${string}`[];
28
+ shieldKey: `0x${string}`;
29
+ };
30
+
31
+ /**
32
+ * CommitmentCiphertext struct type
33
+ */
34
+ export type CommitmentCiphertext = {
35
+ ciphertext: `0x${string}`[];
36
+ blindedSenderViewingKey: `0x${string}`;
37
+ blindedReceiverViewingKey: `0x${string}`;
38
+ annotationData: `0x${string}`;
39
+ memo: `0x${string}`;
40
+ };
41
+
42
+ /**
43
+ * VerifyingKey struct type
44
+ */
45
+ export type VerifyingKey = {
46
+ artifactsIPFSHash: string;
47
+ alpha1: G1Point;
48
+ beta2: G2Point;
49
+ gamma2: G2Point;
50
+ delta2: G2Point;
51
+ ic: G1Point[];
52
+ };
53
+
54
+ /**
55
+ * G1Point struct type
56
+ */
57
+ export type G1Point = {
58
+ x: bigint;
59
+ y: bigint;
60
+ };
61
+
62
+ /**
63
+ * G2Point struct type
64
+ */
65
+ export type G2Point = {
66
+ x: bigint[];
67
+ y: bigint[];
68
+ };
69
+
70
+ /**
71
+ * BoundParams struct type
72
+ */
73
+ export type BoundParams = {
74
+ treeNumber: bigint;
75
+ minGasPrice: bigint;
76
+ unshield: bigint;
77
+ chainID: bigint;
78
+ adaptContract: `0x${string}`;
79
+ adaptParams: `0x${string}`;
80
+ commitmentCiphertext: CommitmentCiphertext[];
81
+ };
82
+
83
+ /**
84
+ * ShieldRequest struct type
85
+ */
86
+ export type ShieldRequest = {
87
+ preimage: CommitmentPreimage;
88
+ ciphertext: ShieldCiphertext;
89
+ };
90
+
91
+ /**
92
+ * Transaction struct type
93
+ */
94
+ export type Transaction = {
95
+ proof: SnarkProof;
96
+ merkleRoot: `0x${string}`;
97
+ nullifiers: `0x${string}`[];
98
+ commitments: `0x${string}`[];
99
+ boundParams: BoundParams;
100
+ unshieldPreimage: CommitmentPreimage;
101
+ };
102
+
103
+ /**
104
+ * SnarkProof struct type
105
+ */
106
+ export type SnarkProof = {
107
+ a: G1Point;
108
+ b: G2Point;
109
+ c: G1Point;
110
+ };
111
+ /**
112
+ * RailgunSmartWallet_json ABI
113
+ *
114
+ * This ABI is typed using viem's type system for full type safety.
115
+ */
116
+ export const RailgunSmartWallet_jsonAbi = [
117
+ {
118
+ "anonymous": false,
119
+ "inputs": [
120
+ {
121
+ "indexed": true,
122
+ "internalType": "address",
123
+ "name": "token",
124
+ "type": "address"
125
+ }
126
+ ],
127
+ "name": "AddToBlocklist",
128
+ "type": "event"
129
+ },
130
+ {
131
+ "anonymous": false,
132
+ "inputs": [
133
+ {
134
+ "indexed": false,
135
+ "internalType": "uint256",
136
+ "name": "shieldFee",
137
+ "type": "uint256"
138
+ },
139
+ {
140
+ "indexed": false,
141
+ "internalType": "uint256",
142
+ "name": "unshieldFee",
143
+ "type": "uint256"
144
+ },
145
+ {
146
+ "indexed": false,
147
+ "internalType": "uint256",
148
+ "name": "nftFee",
149
+ "type": "uint256"
150
+ }
151
+ ],
152
+ "name": "FeeChange",
153
+ "type": "event"
154
+ },
155
+ {
156
+ "anonymous": false,
157
+ "inputs": [
158
+ {
159
+ "indexed": false,
160
+ "internalType": "uint8",
161
+ "name": "version",
162
+ "type": "uint8"
163
+ }
164
+ ],
165
+ "name": "Initialized",
166
+ "type": "event"
167
+ },
168
+ {
169
+ "anonymous": false,
170
+ "inputs": [
171
+ {
172
+ "indexed": false,
173
+ "internalType": "uint16",
174
+ "name": "treeNumber",
175
+ "type": "uint16"
176
+ },
177
+ {
178
+ "indexed": false,
179
+ "internalType": "bytes32[]",
180
+ "name": "nullifier",
181
+ "type": "bytes32[]"
182
+ }
183
+ ],
184
+ "name": "Nullified",
185
+ "type": "event"
186
+ },
187
+ {
188
+ "anonymous": false,
189
+ "inputs": [
190
+ {
191
+ "indexed": true,
192
+ "internalType": "address",
193
+ "name": "previousOwner",
194
+ "type": "address"
195
+ },
196
+ {
197
+ "indexed": true,
198
+ "internalType": "address",
199
+ "name": "newOwner",
200
+ "type": "address"
201
+ }
202
+ ],
203
+ "name": "OwnershipTransferred",
204
+ "type": "event"
205
+ },
206
+ {
207
+ "anonymous": false,
208
+ "inputs": [
209
+ {
210
+ "indexed": true,
211
+ "internalType": "address",
212
+ "name": "token",
213
+ "type": "address"
214
+ }
215
+ ],
216
+ "name": "RemoveFromBlocklist",
217
+ "type": "event"
218
+ },
219
+ {
220
+ "anonymous": false,
221
+ "inputs": [
222
+ {
223
+ "indexed": false,
224
+ "internalType": "uint256",
225
+ "name": "treeNumber",
226
+ "type": "uint256"
227
+ },
228
+ {
229
+ "indexed": false,
230
+ "internalType": "uint256",
231
+ "name": "startPosition",
232
+ "type": "uint256"
233
+ },
234
+ {
235
+ "components": [
236
+ {
237
+ "internalType": "bytes32",
238
+ "name": "npk",
239
+ "type": "bytes32"
240
+ },
241
+ {
242
+ "components": [
243
+ {
244
+ "internalType": "enum TokenType",
245
+ "name": "tokenType",
246
+ "type": "uint8"
247
+ },
248
+ {
249
+ "internalType": "address",
250
+ "name": "tokenAddress",
251
+ "type": "address"
252
+ },
253
+ {
254
+ "internalType": "uint256",
255
+ "name": "tokenSubID",
256
+ "type": "uint256"
257
+ }
258
+ ],
259
+ "internalType": "struct TokenData",
260
+ "name": "token",
261
+ "type": "tuple"
262
+ },
263
+ {
264
+ "internalType": "uint120",
265
+ "name": "value",
266
+ "type": "uint120"
267
+ }
268
+ ],
269
+ "indexed": false,
270
+ "internalType": "struct CommitmentPreimage[]",
271
+ "name": "commitments",
272
+ "type": "tuple[]"
273
+ },
274
+ {
275
+ "components": [
276
+ {
277
+ "internalType": "bytes32[3]",
278
+ "name": "encryptedBundle",
279
+ "type": "bytes32[3]"
280
+ },
281
+ {
282
+ "internalType": "bytes32",
283
+ "name": "shieldKey",
284
+ "type": "bytes32"
285
+ }
286
+ ],
287
+ "indexed": false,
288
+ "internalType": "struct ShieldCiphertext[]",
289
+ "name": "shieldCiphertext",
290
+ "type": "tuple[]"
291
+ },
292
+ {
293
+ "indexed": false,
294
+ "internalType": "uint256[]",
295
+ "name": "fees",
296
+ "type": "uint256[]"
297
+ }
298
+ ],
299
+ "name": "Shield",
300
+ "type": "event"
301
+ },
302
+ {
303
+ "anonymous": false,
304
+ "inputs": [
305
+ {
306
+ "indexed": false,
307
+ "internalType": "uint256",
308
+ "name": "treeNumber",
309
+ "type": "uint256"
310
+ },
311
+ {
312
+ "indexed": false,
313
+ "internalType": "uint256",
314
+ "name": "startPosition",
315
+ "type": "uint256"
316
+ },
317
+ {
318
+ "indexed": false,
319
+ "internalType": "bytes32[]",
320
+ "name": "hash",
321
+ "type": "bytes32[]"
322
+ },
323
+ {
324
+ "components": [
325
+ {
326
+ "internalType": "bytes32[4]",
327
+ "name": "ciphertext",
328
+ "type": "bytes32[4]"
329
+ },
330
+ {
331
+ "internalType": "bytes32",
332
+ "name": "blindedSenderViewingKey",
333
+ "type": "bytes32"
334
+ },
335
+ {
336
+ "internalType": "bytes32",
337
+ "name": "blindedReceiverViewingKey",
338
+ "type": "bytes32"
339
+ },
340
+ {
341
+ "internalType": "bytes",
342
+ "name": "annotationData",
343
+ "type": "bytes"
344
+ },
345
+ {
346
+ "internalType": "bytes",
347
+ "name": "memo",
348
+ "type": "bytes"
349
+ }
350
+ ],
351
+ "indexed": false,
352
+ "internalType": "struct CommitmentCiphertext[]",
353
+ "name": "ciphertext",
354
+ "type": "tuple[]"
355
+ }
356
+ ],
357
+ "name": "Transact",
358
+ "type": "event"
359
+ },
360
+ {
361
+ "anonymous": false,
362
+ "inputs": [
363
+ {
364
+ "indexed": false,
365
+ "internalType": "address",
366
+ "name": "treasury",
367
+ "type": "address"
368
+ }
369
+ ],
370
+ "name": "TreasuryChange",
371
+ "type": "event"
372
+ },
373
+ {
374
+ "anonymous": false,
375
+ "inputs": [
376
+ {
377
+ "indexed": false,
378
+ "internalType": "address",
379
+ "name": "to",
380
+ "type": "address"
381
+ },
382
+ {
383
+ "components": [
384
+ {
385
+ "internalType": "enum TokenType",
386
+ "name": "tokenType",
387
+ "type": "uint8"
388
+ },
389
+ {
390
+ "internalType": "address",
391
+ "name": "tokenAddress",
392
+ "type": "address"
393
+ },
394
+ {
395
+ "internalType": "uint256",
396
+ "name": "tokenSubID",
397
+ "type": "uint256"
398
+ }
399
+ ],
400
+ "indexed": false,
401
+ "internalType": "struct TokenData",
402
+ "name": "token",
403
+ "type": "tuple"
404
+ },
405
+ {
406
+ "indexed": false,
407
+ "internalType": "uint256",
408
+ "name": "amount",
409
+ "type": "uint256"
410
+ },
411
+ {
412
+ "indexed": false,
413
+ "internalType": "uint256",
414
+ "name": "fee",
415
+ "type": "uint256"
416
+ }
417
+ ],
418
+ "name": "Unshield",
419
+ "type": "event"
420
+ },
421
+ {
422
+ "anonymous": false,
423
+ "inputs": [
424
+ {
425
+ "indexed": false,
426
+ "internalType": "uint256",
427
+ "name": "nullifiers",
428
+ "type": "uint256"
429
+ },
430
+ {
431
+ "indexed": false,
432
+ "internalType": "uint256",
433
+ "name": "commitments",
434
+ "type": "uint256"
435
+ },
436
+ {
437
+ "components": [
438
+ {
439
+ "internalType": "string",
440
+ "name": "artifactsIPFSHash",
441
+ "type": "string"
442
+ },
443
+ {
444
+ "components": [
445
+ {
446
+ "internalType": "uint256",
447
+ "name": "x",
448
+ "type": "uint256"
449
+ },
450
+ {
451
+ "internalType": "uint256",
452
+ "name": "y",
453
+ "type": "uint256"
454
+ }
455
+ ],
456
+ "internalType": "struct G1Point",
457
+ "name": "alpha1",
458
+ "type": "tuple"
459
+ },
460
+ {
461
+ "components": [
462
+ {
463
+ "internalType": "uint256[2]",
464
+ "name": "x",
465
+ "type": "uint256[2]"
466
+ },
467
+ {
468
+ "internalType": "uint256[2]",
469
+ "name": "y",
470
+ "type": "uint256[2]"
471
+ }
472
+ ],
473
+ "internalType": "struct G2Point",
474
+ "name": "beta2",
475
+ "type": "tuple"
476
+ },
477
+ {
478
+ "components": [
479
+ {
480
+ "internalType": "uint256[2]",
481
+ "name": "x",
482
+ "type": "uint256[2]"
483
+ },
484
+ {
485
+ "internalType": "uint256[2]",
486
+ "name": "y",
487
+ "type": "uint256[2]"
488
+ }
489
+ ],
490
+ "internalType": "struct G2Point",
491
+ "name": "gamma2",
492
+ "type": "tuple"
493
+ },
494
+ {
495
+ "components": [
496
+ {
497
+ "internalType": "uint256[2]",
498
+ "name": "x",
499
+ "type": "uint256[2]"
500
+ },
501
+ {
502
+ "internalType": "uint256[2]",
503
+ "name": "y",
504
+ "type": "uint256[2]"
505
+ }
506
+ ],
507
+ "internalType": "struct G2Point",
508
+ "name": "delta2",
509
+ "type": "tuple"
510
+ },
511
+ {
512
+ "components": [
513
+ {
514
+ "internalType": "uint256",
515
+ "name": "x",
516
+ "type": "uint256"
517
+ },
518
+ {
519
+ "internalType": "uint256",
520
+ "name": "y",
521
+ "type": "uint256"
522
+ }
523
+ ],
524
+ "internalType": "struct G1Point[]",
525
+ "name": "ic",
526
+ "type": "tuple[]"
527
+ }
528
+ ],
529
+ "indexed": false,
530
+ "internalType": "struct VerifyingKey",
531
+ "name": "verifyingKey",
532
+ "type": "tuple"
533
+ }
534
+ ],
535
+ "name": "VerifyingKeySet",
536
+ "type": "event"
537
+ },
538
+ {
539
+ "inputs": [],
540
+ "name": "ZERO_VALUE",
541
+ "outputs": [
542
+ {
543
+ "internalType": "bytes32",
544
+ "name": "",
545
+ "type": "bytes32"
546
+ }
547
+ ],
548
+ "stateMutability": "view",
549
+ "type": "function"
550
+ },
551
+ {
552
+ "inputs": [
553
+ {
554
+ "internalType": "address[]",
555
+ "name": "_tokens",
556
+ "type": "address[]"
557
+ }
558
+ ],
559
+ "name": "addToBlocklist",
560
+ "outputs": [],
561
+ "stateMutability": "nonpayable",
562
+ "type": "function"
563
+ },
564
+ {
565
+ "inputs": [
566
+ {
567
+ "internalType": "uint256",
568
+ "name": "vector",
569
+ "type": "uint256"
570
+ }
571
+ ],
572
+ "name": "addVector",
573
+ "outputs": [],
574
+ "stateMutability": "nonpayable",
575
+ "type": "function"
576
+ },
577
+ {
578
+ "inputs": [
579
+ {
580
+ "internalType": "uint120",
581
+ "name": "_shieldFee",
582
+ "type": "uint120"
583
+ },
584
+ {
585
+ "internalType": "uint120",
586
+ "name": "_unshieldFee",
587
+ "type": "uint120"
588
+ },
589
+ {
590
+ "internalType": "uint256",
591
+ "name": "_nftFee",
592
+ "type": "uint256"
593
+ }
594
+ ],
595
+ "name": "changeFee",
596
+ "outputs": [],
597
+ "stateMutability": "nonpayable",
598
+ "type": "function"
599
+ },
600
+ {
601
+ "inputs": [
602
+ {
603
+ "internalType": "address payable",
604
+ "name": "_treasury",
605
+ "type": "address"
606
+ }
607
+ ],
608
+ "name": "changeTreasury",
609
+ "outputs": [],
610
+ "stateMutability": "nonpayable",
611
+ "type": "function"
612
+ },
613
+ {
614
+ "inputs": [],
615
+ "name": "checkSafetyVectors",
616
+ "outputs": [],
617
+ "stateMutability": "nonpayable",
618
+ "type": "function"
619
+ },
620
+ {
621
+ "inputs": [
622
+ {
623
+ "internalType": "uint136",
624
+ "name": "_amount",
625
+ "type": "uint136"
626
+ },
627
+ {
628
+ "internalType": "bool",
629
+ "name": "_isInclusive",
630
+ "type": "bool"
631
+ },
632
+ {
633
+ "internalType": "uint120",
634
+ "name": "_feeBP",
635
+ "type": "uint120"
636
+ }
637
+ ],
638
+ "name": "getFee",
639
+ "outputs": [
640
+ {
641
+ "internalType": "uint120",
642
+ "name": "",
643
+ "type": "uint120"
644
+ },
645
+ {
646
+ "internalType": "uint120",
647
+ "name": "",
648
+ "type": "uint120"
649
+ }
650
+ ],
651
+ "stateMutability": "pure",
652
+ "type": "function"
653
+ },
654
+ {
655
+ "inputs": [
656
+ {
657
+ "internalType": "uint256",
658
+ "name": "_newCommitments",
659
+ "type": "uint256"
660
+ }
661
+ ],
662
+ "name": "getInsertionTreeNumberAndStartingIndex",
663
+ "outputs": [
664
+ {
665
+ "internalType": "uint256",
666
+ "name": "",
667
+ "type": "uint256"
668
+ },
669
+ {
670
+ "internalType": "uint256",
671
+ "name": "",
672
+ "type": "uint256"
673
+ }
674
+ ],
675
+ "stateMutability": "view",
676
+ "type": "function"
677
+ },
678
+ {
679
+ "inputs": [
680
+ {
681
+ "components": [
682
+ {
683
+ "internalType": "enum TokenType",
684
+ "name": "tokenType",
685
+ "type": "uint8"
686
+ },
687
+ {
688
+ "internalType": "address",
689
+ "name": "tokenAddress",
690
+ "type": "address"
691
+ },
692
+ {
693
+ "internalType": "uint256",
694
+ "name": "tokenSubID",
695
+ "type": "uint256"
696
+ }
697
+ ],
698
+ "internalType": "struct TokenData",
699
+ "name": "_tokenData",
700
+ "type": "tuple"
701
+ }
702
+ ],
703
+ "name": "getTokenID",
704
+ "outputs": [
705
+ {
706
+ "internalType": "bytes32",
707
+ "name": "",
708
+ "type": "bytes32"
709
+ }
710
+ ],
711
+ "stateMutability": "pure",
712
+ "type": "function"
713
+ },
714
+ {
715
+ "inputs": [
716
+ {
717
+ "internalType": "uint256",
718
+ "name": "_nullifiers",
719
+ "type": "uint256"
720
+ },
721
+ {
722
+ "internalType": "uint256",
723
+ "name": "_commitments",
724
+ "type": "uint256"
725
+ }
726
+ ],
727
+ "name": "getVerificationKey",
728
+ "outputs": [
729
+ {
730
+ "components": [
731
+ {
732
+ "internalType": "string",
733
+ "name": "artifactsIPFSHash",
734
+ "type": "string"
735
+ },
736
+ {
737
+ "components": [
738
+ {
739
+ "internalType": "uint256",
740
+ "name": "x",
741
+ "type": "uint256"
742
+ },
743
+ {
744
+ "internalType": "uint256",
745
+ "name": "y",
746
+ "type": "uint256"
747
+ }
748
+ ],
749
+ "internalType": "struct G1Point",
750
+ "name": "alpha1",
751
+ "type": "tuple"
752
+ },
753
+ {
754
+ "components": [
755
+ {
756
+ "internalType": "uint256[2]",
757
+ "name": "x",
758
+ "type": "uint256[2]"
759
+ },
760
+ {
761
+ "internalType": "uint256[2]",
762
+ "name": "y",
763
+ "type": "uint256[2]"
764
+ }
765
+ ],
766
+ "internalType": "struct G2Point",
767
+ "name": "beta2",
768
+ "type": "tuple"
769
+ },
770
+ {
771
+ "components": [
772
+ {
773
+ "internalType": "uint256[2]",
774
+ "name": "x",
775
+ "type": "uint256[2]"
776
+ },
777
+ {
778
+ "internalType": "uint256[2]",
779
+ "name": "y",
780
+ "type": "uint256[2]"
781
+ }
782
+ ],
783
+ "internalType": "struct G2Point",
784
+ "name": "gamma2",
785
+ "type": "tuple"
786
+ },
787
+ {
788
+ "components": [
789
+ {
790
+ "internalType": "uint256[2]",
791
+ "name": "x",
792
+ "type": "uint256[2]"
793
+ },
794
+ {
795
+ "internalType": "uint256[2]",
796
+ "name": "y",
797
+ "type": "uint256[2]"
798
+ }
799
+ ],
800
+ "internalType": "struct G2Point",
801
+ "name": "delta2",
802
+ "type": "tuple"
803
+ },
804
+ {
805
+ "components": [
806
+ {
807
+ "internalType": "uint256",
808
+ "name": "x",
809
+ "type": "uint256"
810
+ },
811
+ {
812
+ "internalType": "uint256",
813
+ "name": "y",
814
+ "type": "uint256"
815
+ }
816
+ ],
817
+ "internalType": "struct G1Point[]",
818
+ "name": "ic",
819
+ "type": "tuple[]"
820
+ }
821
+ ],
822
+ "internalType": "struct VerifyingKey",
823
+ "name": "",
824
+ "type": "tuple"
825
+ }
826
+ ],
827
+ "stateMutability": "view",
828
+ "type": "function"
829
+ },
830
+ {
831
+ "inputs": [
832
+ {
833
+ "components": [
834
+ {
835
+ "internalType": "uint16",
836
+ "name": "treeNumber",
837
+ "type": "uint16"
838
+ },
839
+ {
840
+ "internalType": "uint72",
841
+ "name": "minGasPrice",
842
+ "type": "uint72"
843
+ },
844
+ {
845
+ "internalType": "enum UnshieldType",
846
+ "name": "unshield",
847
+ "type": "uint8"
848
+ },
849
+ {
850
+ "internalType": "uint64",
851
+ "name": "chainID",
852
+ "type": "uint64"
853
+ },
854
+ {
855
+ "internalType": "address",
856
+ "name": "adaptContract",
857
+ "type": "address"
858
+ },
859
+ {
860
+ "internalType": "bytes32",
861
+ "name": "adaptParams",
862
+ "type": "bytes32"
863
+ },
864
+ {
865
+ "components": [
866
+ {
867
+ "internalType": "bytes32[4]",
868
+ "name": "ciphertext",
869
+ "type": "bytes32[4]"
870
+ },
871
+ {
872
+ "internalType": "bytes32",
873
+ "name": "blindedSenderViewingKey",
874
+ "type": "bytes32"
875
+ },
876
+ {
877
+ "internalType": "bytes32",
878
+ "name": "blindedReceiverViewingKey",
879
+ "type": "bytes32"
880
+ },
881
+ {
882
+ "internalType": "bytes",
883
+ "name": "annotationData",
884
+ "type": "bytes"
885
+ },
886
+ {
887
+ "internalType": "bytes",
888
+ "name": "memo",
889
+ "type": "bytes"
890
+ }
891
+ ],
892
+ "internalType": "struct CommitmentCiphertext[]",
893
+ "name": "commitmentCiphertext",
894
+ "type": "tuple[]"
895
+ }
896
+ ],
897
+ "internalType": "struct BoundParams",
898
+ "name": "_boundParams",
899
+ "type": "tuple"
900
+ }
901
+ ],
902
+ "name": "hashBoundParams",
903
+ "outputs": [
904
+ {
905
+ "internalType": "uint256",
906
+ "name": "",
907
+ "type": "uint256"
908
+ }
909
+ ],
910
+ "stateMutability": "pure",
911
+ "type": "function"
912
+ },
913
+ {
914
+ "inputs": [
915
+ {
916
+ "components": [
917
+ {
918
+ "internalType": "bytes32",
919
+ "name": "npk",
920
+ "type": "bytes32"
921
+ },
922
+ {
923
+ "components": [
924
+ {
925
+ "internalType": "enum TokenType",
926
+ "name": "tokenType",
927
+ "type": "uint8"
928
+ },
929
+ {
930
+ "internalType": "address",
931
+ "name": "tokenAddress",
932
+ "type": "address"
933
+ },
934
+ {
935
+ "internalType": "uint256",
936
+ "name": "tokenSubID",
937
+ "type": "uint256"
938
+ }
939
+ ],
940
+ "internalType": "struct TokenData",
941
+ "name": "token",
942
+ "type": "tuple"
943
+ },
944
+ {
945
+ "internalType": "uint120",
946
+ "name": "value",
947
+ "type": "uint120"
948
+ }
949
+ ],
950
+ "internalType": "struct CommitmentPreimage",
951
+ "name": "_commitmentPreimage",
952
+ "type": "tuple"
953
+ }
954
+ ],
955
+ "name": "hashCommitment",
956
+ "outputs": [
957
+ {
958
+ "internalType": "bytes32",
959
+ "name": "",
960
+ "type": "bytes32"
961
+ }
962
+ ],
963
+ "stateMutability": "pure",
964
+ "type": "function"
965
+ },
966
+ {
967
+ "inputs": [
968
+ {
969
+ "internalType": "bytes32",
970
+ "name": "_left",
971
+ "type": "bytes32"
972
+ },
973
+ {
974
+ "internalType": "bytes32",
975
+ "name": "_right",
976
+ "type": "bytes32"
977
+ }
978
+ ],
979
+ "name": "hashLeftRight",
980
+ "outputs": [
981
+ {
982
+ "internalType": "bytes32",
983
+ "name": "",
984
+ "type": "bytes32"
985
+ }
986
+ ],
987
+ "stateMutability": "pure",
988
+ "type": "function"
989
+ },
990
+ {
991
+ "inputs": [
992
+ {
993
+ "internalType": "address payable",
994
+ "name": "_treasury",
995
+ "type": "address"
996
+ },
997
+ {
998
+ "internalType": "uint120",
999
+ "name": "_shieldFee",
1000
+ "type": "uint120"
1001
+ },
1002
+ {
1003
+ "internalType": "uint120",
1004
+ "name": "_unshieldFee",
1005
+ "type": "uint120"
1006
+ },
1007
+ {
1008
+ "internalType": "uint256",
1009
+ "name": "_nftFee",
1010
+ "type": "uint256"
1011
+ },
1012
+ {
1013
+ "internalType": "address",
1014
+ "name": "_owner",
1015
+ "type": "address"
1016
+ }
1017
+ ],
1018
+ "name": "initializeRailgunLogic",
1019
+ "outputs": [],
1020
+ "stateMutability": "nonpayable",
1021
+ "type": "function"
1022
+ },
1023
+ {
1024
+ "inputs": [],
1025
+ "name": "lastEventBlock",
1026
+ "outputs": [
1027
+ {
1028
+ "internalType": "uint256",
1029
+ "name": "",
1030
+ "type": "uint256"
1031
+ }
1032
+ ],
1033
+ "stateMutability": "view",
1034
+ "type": "function"
1035
+ },
1036
+ {
1037
+ "inputs": [],
1038
+ "name": "merkleRoot",
1039
+ "outputs": [
1040
+ {
1041
+ "internalType": "bytes32",
1042
+ "name": "",
1043
+ "type": "bytes32"
1044
+ }
1045
+ ],
1046
+ "stateMutability": "view",
1047
+ "type": "function"
1048
+ },
1049
+ {
1050
+ "inputs": [],
1051
+ "name": "nextLeafIndex",
1052
+ "outputs": [
1053
+ {
1054
+ "internalType": "uint256",
1055
+ "name": "",
1056
+ "type": "uint256"
1057
+ }
1058
+ ],
1059
+ "stateMutability": "view",
1060
+ "type": "function"
1061
+ },
1062
+ {
1063
+ "inputs": [],
1064
+ "name": "nftFee",
1065
+ "outputs": [
1066
+ {
1067
+ "internalType": "uint256",
1068
+ "name": "",
1069
+ "type": "uint256"
1070
+ }
1071
+ ],
1072
+ "stateMutability": "view",
1073
+ "type": "function"
1074
+ },
1075
+ {
1076
+ "inputs": [
1077
+ {
1078
+ "internalType": "uint256",
1079
+ "name": "",
1080
+ "type": "uint256"
1081
+ },
1082
+ {
1083
+ "internalType": "bytes32",
1084
+ "name": "",
1085
+ "type": "bytes32"
1086
+ }
1087
+ ],
1088
+ "name": "nullifiers",
1089
+ "outputs": [
1090
+ {
1091
+ "internalType": "bool",
1092
+ "name": "",
1093
+ "type": "bool"
1094
+ }
1095
+ ],
1096
+ "stateMutability": "view",
1097
+ "type": "function"
1098
+ },
1099
+ {
1100
+ "inputs": [],
1101
+ "name": "owner",
1102
+ "outputs": [
1103
+ {
1104
+ "internalType": "address",
1105
+ "name": "",
1106
+ "type": "address"
1107
+ }
1108
+ ],
1109
+ "stateMutability": "view",
1110
+ "type": "function"
1111
+ },
1112
+ {
1113
+ "inputs": [
1114
+ {
1115
+ "internalType": "address[]",
1116
+ "name": "_tokens",
1117
+ "type": "address[]"
1118
+ }
1119
+ ],
1120
+ "name": "removeFromBlocklist",
1121
+ "outputs": [],
1122
+ "stateMutability": "nonpayable",
1123
+ "type": "function"
1124
+ },
1125
+ {
1126
+ "inputs": [
1127
+ {
1128
+ "internalType": "uint256",
1129
+ "name": "vector",
1130
+ "type": "uint256"
1131
+ }
1132
+ ],
1133
+ "name": "removeVector",
1134
+ "outputs": [],
1135
+ "stateMutability": "nonpayable",
1136
+ "type": "function"
1137
+ },
1138
+ {
1139
+ "inputs": [],
1140
+ "name": "renounceOwnership",
1141
+ "outputs": [],
1142
+ "stateMutability": "nonpayable",
1143
+ "type": "function"
1144
+ },
1145
+ {
1146
+ "inputs": [
1147
+ {
1148
+ "internalType": "uint256",
1149
+ "name": "",
1150
+ "type": "uint256"
1151
+ },
1152
+ {
1153
+ "internalType": "bytes32",
1154
+ "name": "",
1155
+ "type": "bytes32"
1156
+ }
1157
+ ],
1158
+ "name": "rootHistory",
1159
+ "outputs": [
1160
+ {
1161
+ "internalType": "bool",
1162
+ "name": "",
1163
+ "type": "bool"
1164
+ }
1165
+ ],
1166
+ "stateMutability": "view",
1167
+ "type": "function"
1168
+ },
1169
+ {
1170
+ "inputs": [
1171
+ {
1172
+ "internalType": "uint256",
1173
+ "name": "_nullifiers",
1174
+ "type": "uint256"
1175
+ },
1176
+ {
1177
+ "internalType": "uint256",
1178
+ "name": "_commitments",
1179
+ "type": "uint256"
1180
+ },
1181
+ {
1182
+ "components": [
1183
+ {
1184
+ "internalType": "string",
1185
+ "name": "artifactsIPFSHash",
1186
+ "type": "string"
1187
+ },
1188
+ {
1189
+ "components": [
1190
+ {
1191
+ "internalType": "uint256",
1192
+ "name": "x",
1193
+ "type": "uint256"
1194
+ },
1195
+ {
1196
+ "internalType": "uint256",
1197
+ "name": "y",
1198
+ "type": "uint256"
1199
+ }
1200
+ ],
1201
+ "internalType": "struct G1Point",
1202
+ "name": "alpha1",
1203
+ "type": "tuple"
1204
+ },
1205
+ {
1206
+ "components": [
1207
+ {
1208
+ "internalType": "uint256[2]",
1209
+ "name": "x",
1210
+ "type": "uint256[2]"
1211
+ },
1212
+ {
1213
+ "internalType": "uint256[2]",
1214
+ "name": "y",
1215
+ "type": "uint256[2]"
1216
+ }
1217
+ ],
1218
+ "internalType": "struct G2Point",
1219
+ "name": "beta2",
1220
+ "type": "tuple"
1221
+ },
1222
+ {
1223
+ "components": [
1224
+ {
1225
+ "internalType": "uint256[2]",
1226
+ "name": "x",
1227
+ "type": "uint256[2]"
1228
+ },
1229
+ {
1230
+ "internalType": "uint256[2]",
1231
+ "name": "y",
1232
+ "type": "uint256[2]"
1233
+ }
1234
+ ],
1235
+ "internalType": "struct G2Point",
1236
+ "name": "gamma2",
1237
+ "type": "tuple"
1238
+ },
1239
+ {
1240
+ "components": [
1241
+ {
1242
+ "internalType": "uint256[2]",
1243
+ "name": "x",
1244
+ "type": "uint256[2]"
1245
+ },
1246
+ {
1247
+ "internalType": "uint256[2]",
1248
+ "name": "y",
1249
+ "type": "uint256[2]"
1250
+ }
1251
+ ],
1252
+ "internalType": "struct G2Point",
1253
+ "name": "delta2",
1254
+ "type": "tuple"
1255
+ },
1256
+ {
1257
+ "components": [
1258
+ {
1259
+ "internalType": "uint256",
1260
+ "name": "x",
1261
+ "type": "uint256"
1262
+ },
1263
+ {
1264
+ "internalType": "uint256",
1265
+ "name": "y",
1266
+ "type": "uint256"
1267
+ }
1268
+ ],
1269
+ "internalType": "struct G1Point[]",
1270
+ "name": "ic",
1271
+ "type": "tuple[]"
1272
+ }
1273
+ ],
1274
+ "internalType": "struct VerifyingKey",
1275
+ "name": "_verifyingKey",
1276
+ "type": "tuple"
1277
+ }
1278
+ ],
1279
+ "name": "setVerificationKey",
1280
+ "outputs": [],
1281
+ "stateMutability": "nonpayable",
1282
+ "type": "function"
1283
+ },
1284
+ {
1285
+ "inputs": [
1286
+ {
1287
+ "components": [
1288
+ {
1289
+ "components": [
1290
+ {
1291
+ "internalType": "bytes32",
1292
+ "name": "npk",
1293
+ "type": "bytes32"
1294
+ },
1295
+ {
1296
+ "components": [
1297
+ {
1298
+ "internalType": "enum TokenType",
1299
+ "name": "tokenType",
1300
+ "type": "uint8"
1301
+ },
1302
+ {
1303
+ "internalType": "address",
1304
+ "name": "tokenAddress",
1305
+ "type": "address"
1306
+ },
1307
+ {
1308
+ "internalType": "uint256",
1309
+ "name": "tokenSubID",
1310
+ "type": "uint256"
1311
+ }
1312
+ ],
1313
+ "internalType": "struct TokenData",
1314
+ "name": "token",
1315
+ "type": "tuple"
1316
+ },
1317
+ {
1318
+ "internalType": "uint120",
1319
+ "name": "value",
1320
+ "type": "uint120"
1321
+ }
1322
+ ],
1323
+ "internalType": "struct CommitmentPreimage",
1324
+ "name": "preimage",
1325
+ "type": "tuple"
1326
+ },
1327
+ {
1328
+ "components": [
1329
+ {
1330
+ "internalType": "bytes32[3]",
1331
+ "name": "encryptedBundle",
1332
+ "type": "bytes32[3]"
1333
+ },
1334
+ {
1335
+ "internalType": "bytes32",
1336
+ "name": "shieldKey",
1337
+ "type": "bytes32"
1338
+ }
1339
+ ],
1340
+ "internalType": "struct ShieldCiphertext",
1341
+ "name": "ciphertext",
1342
+ "type": "tuple"
1343
+ }
1344
+ ],
1345
+ "internalType": "struct ShieldRequest[]",
1346
+ "name": "_shieldRequests",
1347
+ "type": "tuple[]"
1348
+ }
1349
+ ],
1350
+ "name": "shield",
1351
+ "outputs": [],
1352
+ "stateMutability": "nonpayable",
1353
+ "type": "function"
1354
+ },
1355
+ {
1356
+ "inputs": [],
1357
+ "name": "shieldFee",
1358
+ "outputs": [
1359
+ {
1360
+ "internalType": "uint120",
1361
+ "name": "",
1362
+ "type": "uint120"
1363
+ }
1364
+ ],
1365
+ "stateMutability": "view",
1366
+ "type": "function"
1367
+ },
1368
+ {
1369
+ "inputs": [
1370
+ {
1371
+ "internalType": "uint256",
1372
+ "name": "",
1373
+ "type": "uint256"
1374
+ }
1375
+ ],
1376
+ "name": "snarkSafetyVector",
1377
+ "outputs": [
1378
+ {
1379
+ "internalType": "bool",
1380
+ "name": "",
1381
+ "type": "bool"
1382
+ }
1383
+ ],
1384
+ "stateMutability": "view",
1385
+ "type": "function"
1386
+ },
1387
+ {
1388
+ "inputs": [
1389
+ {
1390
+ "components": [
1391
+ {
1392
+ "components": [
1393
+ {
1394
+ "components": [
1395
+ {
1396
+ "internalType": "uint256",
1397
+ "name": "x",
1398
+ "type": "uint256"
1399
+ },
1400
+ {
1401
+ "internalType": "uint256",
1402
+ "name": "y",
1403
+ "type": "uint256"
1404
+ }
1405
+ ],
1406
+ "internalType": "struct G1Point",
1407
+ "name": "a",
1408
+ "type": "tuple"
1409
+ },
1410
+ {
1411
+ "components": [
1412
+ {
1413
+ "internalType": "uint256[2]",
1414
+ "name": "x",
1415
+ "type": "uint256[2]"
1416
+ },
1417
+ {
1418
+ "internalType": "uint256[2]",
1419
+ "name": "y",
1420
+ "type": "uint256[2]"
1421
+ }
1422
+ ],
1423
+ "internalType": "struct G2Point",
1424
+ "name": "b",
1425
+ "type": "tuple"
1426
+ },
1427
+ {
1428
+ "components": [
1429
+ {
1430
+ "internalType": "uint256",
1431
+ "name": "x",
1432
+ "type": "uint256"
1433
+ },
1434
+ {
1435
+ "internalType": "uint256",
1436
+ "name": "y",
1437
+ "type": "uint256"
1438
+ }
1439
+ ],
1440
+ "internalType": "struct G1Point",
1441
+ "name": "c",
1442
+ "type": "tuple"
1443
+ }
1444
+ ],
1445
+ "internalType": "struct SnarkProof",
1446
+ "name": "proof",
1447
+ "type": "tuple"
1448
+ },
1449
+ {
1450
+ "internalType": "bytes32",
1451
+ "name": "merkleRoot",
1452
+ "type": "bytes32"
1453
+ },
1454
+ {
1455
+ "internalType": "bytes32[]",
1456
+ "name": "nullifiers",
1457
+ "type": "bytes32[]"
1458
+ },
1459
+ {
1460
+ "internalType": "bytes32[]",
1461
+ "name": "commitments",
1462
+ "type": "bytes32[]"
1463
+ },
1464
+ {
1465
+ "components": [
1466
+ {
1467
+ "internalType": "uint16",
1468
+ "name": "treeNumber",
1469
+ "type": "uint16"
1470
+ },
1471
+ {
1472
+ "internalType": "uint72",
1473
+ "name": "minGasPrice",
1474
+ "type": "uint72"
1475
+ },
1476
+ {
1477
+ "internalType": "enum UnshieldType",
1478
+ "name": "unshield",
1479
+ "type": "uint8"
1480
+ },
1481
+ {
1482
+ "internalType": "uint64",
1483
+ "name": "chainID",
1484
+ "type": "uint64"
1485
+ },
1486
+ {
1487
+ "internalType": "address",
1488
+ "name": "adaptContract",
1489
+ "type": "address"
1490
+ },
1491
+ {
1492
+ "internalType": "bytes32",
1493
+ "name": "adaptParams",
1494
+ "type": "bytes32"
1495
+ },
1496
+ {
1497
+ "components": [
1498
+ {
1499
+ "internalType": "bytes32[4]",
1500
+ "name": "ciphertext",
1501
+ "type": "bytes32[4]"
1502
+ },
1503
+ {
1504
+ "internalType": "bytes32",
1505
+ "name": "blindedSenderViewingKey",
1506
+ "type": "bytes32"
1507
+ },
1508
+ {
1509
+ "internalType": "bytes32",
1510
+ "name": "blindedReceiverViewingKey",
1511
+ "type": "bytes32"
1512
+ },
1513
+ {
1514
+ "internalType": "bytes",
1515
+ "name": "annotationData",
1516
+ "type": "bytes"
1517
+ },
1518
+ {
1519
+ "internalType": "bytes",
1520
+ "name": "memo",
1521
+ "type": "bytes"
1522
+ }
1523
+ ],
1524
+ "internalType": "struct CommitmentCiphertext[]",
1525
+ "name": "commitmentCiphertext",
1526
+ "type": "tuple[]"
1527
+ }
1528
+ ],
1529
+ "internalType": "struct BoundParams",
1530
+ "name": "boundParams",
1531
+ "type": "tuple"
1532
+ },
1533
+ {
1534
+ "components": [
1535
+ {
1536
+ "internalType": "bytes32",
1537
+ "name": "npk",
1538
+ "type": "bytes32"
1539
+ },
1540
+ {
1541
+ "components": [
1542
+ {
1543
+ "internalType": "enum TokenType",
1544
+ "name": "tokenType",
1545
+ "type": "uint8"
1546
+ },
1547
+ {
1548
+ "internalType": "address",
1549
+ "name": "tokenAddress",
1550
+ "type": "address"
1551
+ },
1552
+ {
1553
+ "internalType": "uint256",
1554
+ "name": "tokenSubID",
1555
+ "type": "uint256"
1556
+ }
1557
+ ],
1558
+ "internalType": "struct TokenData",
1559
+ "name": "token",
1560
+ "type": "tuple"
1561
+ },
1562
+ {
1563
+ "internalType": "uint120",
1564
+ "name": "value",
1565
+ "type": "uint120"
1566
+ }
1567
+ ],
1568
+ "internalType": "struct CommitmentPreimage",
1569
+ "name": "unshieldPreimage",
1570
+ "type": "tuple"
1571
+ }
1572
+ ],
1573
+ "internalType": "struct Transaction[]",
1574
+ "name": "_transactions",
1575
+ "type": "tuple[]"
1576
+ }
1577
+ ],
1578
+ "name": "sumCommitments",
1579
+ "outputs": [
1580
+ {
1581
+ "internalType": "uint256",
1582
+ "name": "",
1583
+ "type": "uint256"
1584
+ }
1585
+ ],
1586
+ "stateMutability": "pure",
1587
+ "type": "function"
1588
+ },
1589
+ {
1590
+ "inputs": [
1591
+ {
1592
+ "internalType": "address",
1593
+ "name": "",
1594
+ "type": "address"
1595
+ }
1596
+ ],
1597
+ "name": "tokenBlocklist",
1598
+ "outputs": [
1599
+ {
1600
+ "internalType": "bool",
1601
+ "name": "",
1602
+ "type": "bool"
1603
+ }
1604
+ ],
1605
+ "stateMutability": "view",
1606
+ "type": "function"
1607
+ },
1608
+ {
1609
+ "inputs": [
1610
+ {
1611
+ "internalType": "bytes32",
1612
+ "name": "",
1613
+ "type": "bytes32"
1614
+ }
1615
+ ],
1616
+ "name": "tokenIDMapping",
1617
+ "outputs": [
1618
+ {
1619
+ "internalType": "enum TokenType",
1620
+ "name": "tokenType",
1621
+ "type": "uint8"
1622
+ },
1623
+ {
1624
+ "internalType": "address",
1625
+ "name": "tokenAddress",
1626
+ "type": "address"
1627
+ },
1628
+ {
1629
+ "internalType": "uint256",
1630
+ "name": "tokenSubID",
1631
+ "type": "uint256"
1632
+ }
1633
+ ],
1634
+ "stateMutability": "view",
1635
+ "type": "function"
1636
+ },
1637
+ {
1638
+ "inputs": [
1639
+ {
1640
+ "components": [
1641
+ {
1642
+ "components": [
1643
+ {
1644
+ "components": [
1645
+ {
1646
+ "internalType": "uint256",
1647
+ "name": "x",
1648
+ "type": "uint256"
1649
+ },
1650
+ {
1651
+ "internalType": "uint256",
1652
+ "name": "y",
1653
+ "type": "uint256"
1654
+ }
1655
+ ],
1656
+ "internalType": "struct G1Point",
1657
+ "name": "a",
1658
+ "type": "tuple"
1659
+ },
1660
+ {
1661
+ "components": [
1662
+ {
1663
+ "internalType": "uint256[2]",
1664
+ "name": "x",
1665
+ "type": "uint256[2]"
1666
+ },
1667
+ {
1668
+ "internalType": "uint256[2]",
1669
+ "name": "y",
1670
+ "type": "uint256[2]"
1671
+ }
1672
+ ],
1673
+ "internalType": "struct G2Point",
1674
+ "name": "b",
1675
+ "type": "tuple"
1676
+ },
1677
+ {
1678
+ "components": [
1679
+ {
1680
+ "internalType": "uint256",
1681
+ "name": "x",
1682
+ "type": "uint256"
1683
+ },
1684
+ {
1685
+ "internalType": "uint256",
1686
+ "name": "y",
1687
+ "type": "uint256"
1688
+ }
1689
+ ],
1690
+ "internalType": "struct G1Point",
1691
+ "name": "c",
1692
+ "type": "tuple"
1693
+ }
1694
+ ],
1695
+ "internalType": "struct SnarkProof",
1696
+ "name": "proof",
1697
+ "type": "tuple"
1698
+ },
1699
+ {
1700
+ "internalType": "bytes32",
1701
+ "name": "merkleRoot",
1702
+ "type": "bytes32"
1703
+ },
1704
+ {
1705
+ "internalType": "bytes32[]",
1706
+ "name": "nullifiers",
1707
+ "type": "bytes32[]"
1708
+ },
1709
+ {
1710
+ "internalType": "bytes32[]",
1711
+ "name": "commitments",
1712
+ "type": "bytes32[]"
1713
+ },
1714
+ {
1715
+ "components": [
1716
+ {
1717
+ "internalType": "uint16",
1718
+ "name": "treeNumber",
1719
+ "type": "uint16"
1720
+ },
1721
+ {
1722
+ "internalType": "uint72",
1723
+ "name": "minGasPrice",
1724
+ "type": "uint72"
1725
+ },
1726
+ {
1727
+ "internalType": "enum UnshieldType",
1728
+ "name": "unshield",
1729
+ "type": "uint8"
1730
+ },
1731
+ {
1732
+ "internalType": "uint64",
1733
+ "name": "chainID",
1734
+ "type": "uint64"
1735
+ },
1736
+ {
1737
+ "internalType": "address",
1738
+ "name": "adaptContract",
1739
+ "type": "address"
1740
+ },
1741
+ {
1742
+ "internalType": "bytes32",
1743
+ "name": "adaptParams",
1744
+ "type": "bytes32"
1745
+ },
1746
+ {
1747
+ "components": [
1748
+ {
1749
+ "internalType": "bytes32[4]",
1750
+ "name": "ciphertext",
1751
+ "type": "bytes32[4]"
1752
+ },
1753
+ {
1754
+ "internalType": "bytes32",
1755
+ "name": "blindedSenderViewingKey",
1756
+ "type": "bytes32"
1757
+ },
1758
+ {
1759
+ "internalType": "bytes32",
1760
+ "name": "blindedReceiverViewingKey",
1761
+ "type": "bytes32"
1762
+ },
1763
+ {
1764
+ "internalType": "bytes",
1765
+ "name": "annotationData",
1766
+ "type": "bytes"
1767
+ },
1768
+ {
1769
+ "internalType": "bytes",
1770
+ "name": "memo",
1771
+ "type": "bytes"
1772
+ }
1773
+ ],
1774
+ "internalType": "struct CommitmentCiphertext[]",
1775
+ "name": "commitmentCiphertext",
1776
+ "type": "tuple[]"
1777
+ }
1778
+ ],
1779
+ "internalType": "struct BoundParams",
1780
+ "name": "boundParams",
1781
+ "type": "tuple"
1782
+ },
1783
+ {
1784
+ "components": [
1785
+ {
1786
+ "internalType": "bytes32",
1787
+ "name": "npk",
1788
+ "type": "bytes32"
1789
+ },
1790
+ {
1791
+ "components": [
1792
+ {
1793
+ "internalType": "enum TokenType",
1794
+ "name": "tokenType",
1795
+ "type": "uint8"
1796
+ },
1797
+ {
1798
+ "internalType": "address",
1799
+ "name": "tokenAddress",
1800
+ "type": "address"
1801
+ },
1802
+ {
1803
+ "internalType": "uint256",
1804
+ "name": "tokenSubID",
1805
+ "type": "uint256"
1806
+ }
1807
+ ],
1808
+ "internalType": "struct TokenData",
1809
+ "name": "token",
1810
+ "type": "tuple"
1811
+ },
1812
+ {
1813
+ "internalType": "uint120",
1814
+ "name": "value",
1815
+ "type": "uint120"
1816
+ }
1817
+ ],
1818
+ "internalType": "struct CommitmentPreimage",
1819
+ "name": "unshieldPreimage",
1820
+ "type": "tuple"
1821
+ }
1822
+ ],
1823
+ "internalType": "struct Transaction[]",
1824
+ "name": "_transactions",
1825
+ "type": "tuple[]"
1826
+ }
1827
+ ],
1828
+ "name": "transact",
1829
+ "outputs": [],
1830
+ "stateMutability": "nonpayable",
1831
+ "type": "function"
1832
+ },
1833
+ {
1834
+ "inputs": [
1835
+ {
1836
+ "internalType": "address",
1837
+ "name": "newOwner",
1838
+ "type": "address"
1839
+ }
1840
+ ],
1841
+ "name": "transferOwnership",
1842
+ "outputs": [],
1843
+ "stateMutability": "nonpayable",
1844
+ "type": "function"
1845
+ },
1846
+ {
1847
+ "inputs": [],
1848
+ "name": "treasury",
1849
+ "outputs": [
1850
+ {
1851
+ "internalType": "address payable",
1852
+ "name": "",
1853
+ "type": "address"
1854
+ }
1855
+ ],
1856
+ "stateMutability": "view",
1857
+ "type": "function"
1858
+ },
1859
+ {
1860
+ "inputs": [],
1861
+ "name": "treeNumber",
1862
+ "outputs": [
1863
+ {
1864
+ "internalType": "uint256",
1865
+ "name": "",
1866
+ "type": "uint256"
1867
+ }
1868
+ ],
1869
+ "stateMutability": "view",
1870
+ "type": "function"
1871
+ },
1872
+ {
1873
+ "inputs": [],
1874
+ "name": "unshieldFee",
1875
+ "outputs": [
1876
+ {
1877
+ "internalType": "uint120",
1878
+ "name": "",
1879
+ "type": "uint120"
1880
+ }
1881
+ ],
1882
+ "stateMutability": "view",
1883
+ "type": "function"
1884
+ },
1885
+ {
1886
+ "inputs": [
1887
+ {
1888
+ "components": [
1889
+ {
1890
+ "internalType": "bytes32",
1891
+ "name": "npk",
1892
+ "type": "bytes32"
1893
+ },
1894
+ {
1895
+ "components": [
1896
+ {
1897
+ "internalType": "enum TokenType",
1898
+ "name": "tokenType",
1899
+ "type": "uint8"
1900
+ },
1901
+ {
1902
+ "internalType": "address",
1903
+ "name": "tokenAddress",
1904
+ "type": "address"
1905
+ },
1906
+ {
1907
+ "internalType": "uint256",
1908
+ "name": "tokenSubID",
1909
+ "type": "uint256"
1910
+ }
1911
+ ],
1912
+ "internalType": "struct TokenData",
1913
+ "name": "token",
1914
+ "type": "tuple"
1915
+ },
1916
+ {
1917
+ "internalType": "uint120",
1918
+ "name": "value",
1919
+ "type": "uint120"
1920
+ }
1921
+ ],
1922
+ "internalType": "struct CommitmentPreimage",
1923
+ "name": "_note",
1924
+ "type": "tuple"
1925
+ }
1926
+ ],
1927
+ "name": "validateCommitmentPreimage",
1928
+ "outputs": [
1929
+ {
1930
+ "internalType": "bool",
1931
+ "name": "",
1932
+ "type": "bool"
1933
+ },
1934
+ {
1935
+ "internalType": "string",
1936
+ "name": "",
1937
+ "type": "string"
1938
+ }
1939
+ ],
1940
+ "stateMutability": "view",
1941
+ "type": "function"
1942
+ },
1943
+ {
1944
+ "inputs": [
1945
+ {
1946
+ "components": [
1947
+ {
1948
+ "components": [
1949
+ {
1950
+ "components": [
1951
+ {
1952
+ "internalType": "uint256",
1953
+ "name": "x",
1954
+ "type": "uint256"
1955
+ },
1956
+ {
1957
+ "internalType": "uint256",
1958
+ "name": "y",
1959
+ "type": "uint256"
1960
+ }
1961
+ ],
1962
+ "internalType": "struct G1Point",
1963
+ "name": "a",
1964
+ "type": "tuple"
1965
+ },
1966
+ {
1967
+ "components": [
1968
+ {
1969
+ "internalType": "uint256[2]",
1970
+ "name": "x",
1971
+ "type": "uint256[2]"
1972
+ },
1973
+ {
1974
+ "internalType": "uint256[2]",
1975
+ "name": "y",
1976
+ "type": "uint256[2]"
1977
+ }
1978
+ ],
1979
+ "internalType": "struct G2Point",
1980
+ "name": "b",
1981
+ "type": "tuple"
1982
+ },
1983
+ {
1984
+ "components": [
1985
+ {
1986
+ "internalType": "uint256",
1987
+ "name": "x",
1988
+ "type": "uint256"
1989
+ },
1990
+ {
1991
+ "internalType": "uint256",
1992
+ "name": "y",
1993
+ "type": "uint256"
1994
+ }
1995
+ ],
1996
+ "internalType": "struct G1Point",
1997
+ "name": "c",
1998
+ "type": "tuple"
1999
+ }
2000
+ ],
2001
+ "internalType": "struct SnarkProof",
2002
+ "name": "proof",
2003
+ "type": "tuple"
2004
+ },
2005
+ {
2006
+ "internalType": "bytes32",
2007
+ "name": "merkleRoot",
2008
+ "type": "bytes32"
2009
+ },
2010
+ {
2011
+ "internalType": "bytes32[]",
2012
+ "name": "nullifiers",
2013
+ "type": "bytes32[]"
2014
+ },
2015
+ {
2016
+ "internalType": "bytes32[]",
2017
+ "name": "commitments",
2018
+ "type": "bytes32[]"
2019
+ },
2020
+ {
2021
+ "components": [
2022
+ {
2023
+ "internalType": "uint16",
2024
+ "name": "treeNumber",
2025
+ "type": "uint16"
2026
+ },
2027
+ {
2028
+ "internalType": "uint72",
2029
+ "name": "minGasPrice",
2030
+ "type": "uint72"
2031
+ },
2032
+ {
2033
+ "internalType": "enum UnshieldType",
2034
+ "name": "unshield",
2035
+ "type": "uint8"
2036
+ },
2037
+ {
2038
+ "internalType": "uint64",
2039
+ "name": "chainID",
2040
+ "type": "uint64"
2041
+ },
2042
+ {
2043
+ "internalType": "address",
2044
+ "name": "adaptContract",
2045
+ "type": "address"
2046
+ },
2047
+ {
2048
+ "internalType": "bytes32",
2049
+ "name": "adaptParams",
2050
+ "type": "bytes32"
2051
+ },
2052
+ {
2053
+ "components": [
2054
+ {
2055
+ "internalType": "bytes32[4]",
2056
+ "name": "ciphertext",
2057
+ "type": "bytes32[4]"
2058
+ },
2059
+ {
2060
+ "internalType": "bytes32",
2061
+ "name": "blindedSenderViewingKey",
2062
+ "type": "bytes32"
2063
+ },
2064
+ {
2065
+ "internalType": "bytes32",
2066
+ "name": "blindedReceiverViewingKey",
2067
+ "type": "bytes32"
2068
+ },
2069
+ {
2070
+ "internalType": "bytes",
2071
+ "name": "annotationData",
2072
+ "type": "bytes"
2073
+ },
2074
+ {
2075
+ "internalType": "bytes",
2076
+ "name": "memo",
2077
+ "type": "bytes"
2078
+ }
2079
+ ],
2080
+ "internalType": "struct CommitmentCiphertext[]",
2081
+ "name": "commitmentCiphertext",
2082
+ "type": "tuple[]"
2083
+ }
2084
+ ],
2085
+ "internalType": "struct BoundParams",
2086
+ "name": "boundParams",
2087
+ "type": "tuple"
2088
+ },
2089
+ {
2090
+ "components": [
2091
+ {
2092
+ "internalType": "bytes32",
2093
+ "name": "npk",
2094
+ "type": "bytes32"
2095
+ },
2096
+ {
2097
+ "components": [
2098
+ {
2099
+ "internalType": "enum TokenType",
2100
+ "name": "tokenType",
2101
+ "type": "uint8"
2102
+ },
2103
+ {
2104
+ "internalType": "address",
2105
+ "name": "tokenAddress",
2106
+ "type": "address"
2107
+ },
2108
+ {
2109
+ "internalType": "uint256",
2110
+ "name": "tokenSubID",
2111
+ "type": "uint256"
2112
+ }
2113
+ ],
2114
+ "internalType": "struct TokenData",
2115
+ "name": "token",
2116
+ "type": "tuple"
2117
+ },
2118
+ {
2119
+ "internalType": "uint120",
2120
+ "name": "value",
2121
+ "type": "uint120"
2122
+ }
2123
+ ],
2124
+ "internalType": "struct CommitmentPreimage",
2125
+ "name": "unshieldPreimage",
2126
+ "type": "tuple"
2127
+ }
2128
+ ],
2129
+ "internalType": "struct Transaction",
2130
+ "name": "_transaction",
2131
+ "type": "tuple"
2132
+ }
2133
+ ],
2134
+ "name": "validateTransaction",
2135
+ "outputs": [
2136
+ {
2137
+ "internalType": "bool",
2138
+ "name": "",
2139
+ "type": "bool"
2140
+ },
2141
+ {
2142
+ "internalType": "string",
2143
+ "name": "",
2144
+ "type": "string"
2145
+ }
2146
+ ],
2147
+ "stateMutability": "view",
2148
+ "type": "function"
2149
+ },
2150
+ {
2151
+ "inputs": [
2152
+ {
2153
+ "components": [
2154
+ {
2155
+ "components": [
2156
+ {
2157
+ "components": [
2158
+ {
2159
+ "internalType": "uint256",
2160
+ "name": "x",
2161
+ "type": "uint256"
2162
+ },
2163
+ {
2164
+ "internalType": "uint256",
2165
+ "name": "y",
2166
+ "type": "uint256"
2167
+ }
2168
+ ],
2169
+ "internalType": "struct G1Point",
2170
+ "name": "a",
2171
+ "type": "tuple"
2172
+ },
2173
+ {
2174
+ "components": [
2175
+ {
2176
+ "internalType": "uint256[2]",
2177
+ "name": "x",
2178
+ "type": "uint256[2]"
2179
+ },
2180
+ {
2181
+ "internalType": "uint256[2]",
2182
+ "name": "y",
2183
+ "type": "uint256[2]"
2184
+ }
2185
+ ],
2186
+ "internalType": "struct G2Point",
2187
+ "name": "b",
2188
+ "type": "tuple"
2189
+ },
2190
+ {
2191
+ "components": [
2192
+ {
2193
+ "internalType": "uint256",
2194
+ "name": "x",
2195
+ "type": "uint256"
2196
+ },
2197
+ {
2198
+ "internalType": "uint256",
2199
+ "name": "y",
2200
+ "type": "uint256"
2201
+ }
2202
+ ],
2203
+ "internalType": "struct G1Point",
2204
+ "name": "c",
2205
+ "type": "tuple"
2206
+ }
2207
+ ],
2208
+ "internalType": "struct SnarkProof",
2209
+ "name": "proof",
2210
+ "type": "tuple"
2211
+ },
2212
+ {
2213
+ "internalType": "bytes32",
2214
+ "name": "merkleRoot",
2215
+ "type": "bytes32"
2216
+ },
2217
+ {
2218
+ "internalType": "bytes32[]",
2219
+ "name": "nullifiers",
2220
+ "type": "bytes32[]"
2221
+ },
2222
+ {
2223
+ "internalType": "bytes32[]",
2224
+ "name": "commitments",
2225
+ "type": "bytes32[]"
2226
+ },
2227
+ {
2228
+ "components": [
2229
+ {
2230
+ "internalType": "uint16",
2231
+ "name": "treeNumber",
2232
+ "type": "uint16"
2233
+ },
2234
+ {
2235
+ "internalType": "uint72",
2236
+ "name": "minGasPrice",
2237
+ "type": "uint72"
2238
+ },
2239
+ {
2240
+ "internalType": "enum UnshieldType",
2241
+ "name": "unshield",
2242
+ "type": "uint8"
2243
+ },
2244
+ {
2245
+ "internalType": "uint64",
2246
+ "name": "chainID",
2247
+ "type": "uint64"
2248
+ },
2249
+ {
2250
+ "internalType": "address",
2251
+ "name": "adaptContract",
2252
+ "type": "address"
2253
+ },
2254
+ {
2255
+ "internalType": "bytes32",
2256
+ "name": "adaptParams",
2257
+ "type": "bytes32"
2258
+ },
2259
+ {
2260
+ "components": [
2261
+ {
2262
+ "internalType": "bytes32[4]",
2263
+ "name": "ciphertext",
2264
+ "type": "bytes32[4]"
2265
+ },
2266
+ {
2267
+ "internalType": "bytes32",
2268
+ "name": "blindedSenderViewingKey",
2269
+ "type": "bytes32"
2270
+ },
2271
+ {
2272
+ "internalType": "bytes32",
2273
+ "name": "blindedReceiverViewingKey",
2274
+ "type": "bytes32"
2275
+ },
2276
+ {
2277
+ "internalType": "bytes",
2278
+ "name": "annotationData",
2279
+ "type": "bytes"
2280
+ },
2281
+ {
2282
+ "internalType": "bytes",
2283
+ "name": "memo",
2284
+ "type": "bytes"
2285
+ }
2286
+ ],
2287
+ "internalType": "struct CommitmentCiphertext[]",
2288
+ "name": "commitmentCiphertext",
2289
+ "type": "tuple[]"
2290
+ }
2291
+ ],
2292
+ "internalType": "struct BoundParams",
2293
+ "name": "boundParams",
2294
+ "type": "tuple"
2295
+ },
2296
+ {
2297
+ "components": [
2298
+ {
2299
+ "internalType": "bytes32",
2300
+ "name": "npk",
2301
+ "type": "bytes32"
2302
+ },
2303
+ {
2304
+ "components": [
2305
+ {
2306
+ "internalType": "enum TokenType",
2307
+ "name": "tokenType",
2308
+ "type": "uint8"
2309
+ },
2310
+ {
2311
+ "internalType": "address",
2312
+ "name": "tokenAddress",
2313
+ "type": "address"
2314
+ },
2315
+ {
2316
+ "internalType": "uint256",
2317
+ "name": "tokenSubID",
2318
+ "type": "uint256"
2319
+ }
2320
+ ],
2321
+ "internalType": "struct TokenData",
2322
+ "name": "token",
2323
+ "type": "tuple"
2324
+ },
2325
+ {
2326
+ "internalType": "uint120",
2327
+ "name": "value",
2328
+ "type": "uint120"
2329
+ }
2330
+ ],
2331
+ "internalType": "struct CommitmentPreimage",
2332
+ "name": "unshieldPreimage",
2333
+ "type": "tuple"
2334
+ }
2335
+ ],
2336
+ "internalType": "struct Transaction",
2337
+ "name": "_transaction",
2338
+ "type": "tuple"
2339
+ }
2340
+ ],
2341
+ "name": "verify",
2342
+ "outputs": [
2343
+ {
2344
+ "internalType": "bool",
2345
+ "name": "",
2346
+ "type": "bool"
2347
+ }
2348
+ ],
2349
+ "stateMutability": "view",
2350
+ "type": "function"
2351
+ },
2352
+ {
2353
+ "inputs": [
2354
+ {
2355
+ "components": [
2356
+ {
2357
+ "internalType": "string",
2358
+ "name": "artifactsIPFSHash",
2359
+ "type": "string"
2360
+ },
2361
+ {
2362
+ "components": [
2363
+ {
2364
+ "internalType": "uint256",
2365
+ "name": "x",
2366
+ "type": "uint256"
2367
+ },
2368
+ {
2369
+ "internalType": "uint256",
2370
+ "name": "y",
2371
+ "type": "uint256"
2372
+ }
2373
+ ],
2374
+ "internalType": "struct G1Point",
2375
+ "name": "alpha1",
2376
+ "type": "tuple"
2377
+ },
2378
+ {
2379
+ "components": [
2380
+ {
2381
+ "internalType": "uint256[2]",
2382
+ "name": "x",
2383
+ "type": "uint256[2]"
2384
+ },
2385
+ {
2386
+ "internalType": "uint256[2]",
2387
+ "name": "y",
2388
+ "type": "uint256[2]"
2389
+ }
2390
+ ],
2391
+ "internalType": "struct G2Point",
2392
+ "name": "beta2",
2393
+ "type": "tuple"
2394
+ },
2395
+ {
2396
+ "components": [
2397
+ {
2398
+ "internalType": "uint256[2]",
2399
+ "name": "x",
2400
+ "type": "uint256[2]"
2401
+ },
2402
+ {
2403
+ "internalType": "uint256[2]",
2404
+ "name": "y",
2405
+ "type": "uint256[2]"
2406
+ }
2407
+ ],
2408
+ "internalType": "struct G2Point",
2409
+ "name": "gamma2",
2410
+ "type": "tuple"
2411
+ },
2412
+ {
2413
+ "components": [
2414
+ {
2415
+ "internalType": "uint256[2]",
2416
+ "name": "x",
2417
+ "type": "uint256[2]"
2418
+ },
2419
+ {
2420
+ "internalType": "uint256[2]",
2421
+ "name": "y",
2422
+ "type": "uint256[2]"
2423
+ }
2424
+ ],
2425
+ "internalType": "struct G2Point",
2426
+ "name": "delta2",
2427
+ "type": "tuple"
2428
+ },
2429
+ {
2430
+ "components": [
2431
+ {
2432
+ "internalType": "uint256",
2433
+ "name": "x",
2434
+ "type": "uint256"
2435
+ },
2436
+ {
2437
+ "internalType": "uint256",
2438
+ "name": "y",
2439
+ "type": "uint256"
2440
+ }
2441
+ ],
2442
+ "internalType": "struct G1Point[]",
2443
+ "name": "ic",
2444
+ "type": "tuple[]"
2445
+ }
2446
+ ],
2447
+ "internalType": "struct VerifyingKey",
2448
+ "name": "_verifyingKey",
2449
+ "type": "tuple"
2450
+ },
2451
+ {
2452
+ "components": [
2453
+ {
2454
+ "components": [
2455
+ {
2456
+ "internalType": "uint256",
2457
+ "name": "x",
2458
+ "type": "uint256"
2459
+ },
2460
+ {
2461
+ "internalType": "uint256",
2462
+ "name": "y",
2463
+ "type": "uint256"
2464
+ }
2465
+ ],
2466
+ "internalType": "struct G1Point",
2467
+ "name": "a",
2468
+ "type": "tuple"
2469
+ },
2470
+ {
2471
+ "components": [
2472
+ {
2473
+ "internalType": "uint256[2]",
2474
+ "name": "x",
2475
+ "type": "uint256[2]"
2476
+ },
2477
+ {
2478
+ "internalType": "uint256[2]",
2479
+ "name": "y",
2480
+ "type": "uint256[2]"
2481
+ }
2482
+ ],
2483
+ "internalType": "struct G2Point",
2484
+ "name": "b",
2485
+ "type": "tuple"
2486
+ },
2487
+ {
2488
+ "components": [
2489
+ {
2490
+ "internalType": "uint256",
2491
+ "name": "x",
2492
+ "type": "uint256"
2493
+ },
2494
+ {
2495
+ "internalType": "uint256",
2496
+ "name": "y",
2497
+ "type": "uint256"
2498
+ }
2499
+ ],
2500
+ "internalType": "struct G1Point",
2501
+ "name": "c",
2502
+ "type": "tuple"
2503
+ }
2504
+ ],
2505
+ "internalType": "struct SnarkProof",
2506
+ "name": "_proof",
2507
+ "type": "tuple"
2508
+ },
2509
+ {
2510
+ "internalType": "uint256[]",
2511
+ "name": "_inputs",
2512
+ "type": "uint256[]"
2513
+ }
2514
+ ],
2515
+ "name": "verifyProof",
2516
+ "outputs": [
2517
+ {
2518
+ "internalType": "bool",
2519
+ "name": "",
2520
+ "type": "bool"
2521
+ }
2522
+ ],
2523
+ "stateMutability": "view",
2524
+ "type": "function"
2525
+ },
2526
+ {
2527
+ "inputs": [
2528
+ {
2529
+ "internalType": "uint256",
2530
+ "name": "",
2531
+ "type": "uint256"
2532
+ }
2533
+ ],
2534
+ "name": "zeros",
2535
+ "outputs": [
2536
+ {
2537
+ "internalType": "bytes32",
2538
+ "name": "",
2539
+ "type": "bytes32"
2540
+ }
2541
+ ],
2542
+ "stateMutability": "view",
2543
+ "type": "function"
2544
+ }
2545
+ ] as const satisfies Abi;
2546
+
2547
+ /**
2548
+ * Type-safe ABI for RailgunSmartWallet_json
2549
+ */
2550
+ export type RailgunSmartWallet_jsonAbi = typeof RailgunSmartWallet_jsonAbi;
2551
+
2552
+ /**
2553
+ * Contract instance type for RailgunSmartWallet_json
2554
+ */
2555
+ // Use any for contract type to avoid complex viem type issues
2556
+ // The runtime behavior is type-safe through viem's ABI typing
2557
+ export type RailgunSmartWallet_jsonContract = any;
2558
+
2559
+ /**
2560
+ * RailgunSmartWallet_json Contract Class
2561
+ *
2562
+ * Provides a class-based API similar to TypeChain for interacting with the contract.
2563
+ *
2564
+ * @example
2565
+ * ```typescript
2566
+ * import { createPublicClient, createWalletClient, http } from 'viem';
2567
+ * import { mainnet } from 'viem/chains';
2568
+ * import { RailgunSmartWallet_json } from 'RailgunSmartWallet_json';
2569
+ *
2570
+ * const publicClient = createPublicClient({ chain: mainnet, transport: http() });
2571
+ * const walletClient = createWalletClient({ chain: mainnet, transport: http() });
2572
+ *
2573
+ * const contract = new RailgunSmartWallet_json('0x...', { publicClient, walletClient });
2574
+ *
2575
+ * // Read functions
2576
+ * const result = await contract.balanceOf('0x...');
2577
+ *
2578
+ * // Write functions
2579
+ * const hash = await contract.transfer('0x...', 1000n);
2580
+ *
2581
+ * // Simulate transactions (dry-run)
2582
+ * const simulation = await contract.simulate.transfer('0x...', 1000n);
2583
+ * console.log('Gas estimate:', simulation.request.gas);
2584
+ *
2585
+ * // Watch events
2586
+ * const unwatch = contract.watch.Transfer((event) => {
2587
+ * console.log('Transfer event:', event);
2588
+ * });
2589
+ * ```
2590
+ */
2591
+ export class RailgunSmartWallet_json {
2592
+ private contract: RailgunSmartWallet_jsonContract;
2593
+ private contractAddress: Address;
2594
+ private publicClient: PublicClient;
2595
+
2596
+ constructor(
2597
+ address: Address,
2598
+ clients: {
2599
+ publicClient: PublicClient;
2600
+ walletClient?: WalletClient;
2601
+ }
2602
+ ) {
2603
+ this.contractAddress = address;
2604
+ this.publicClient = clients.publicClient;
2605
+ this.contract = getContract({
2606
+ address,
2607
+ abi: RailgunSmartWallet_jsonAbi,
2608
+ client: {
2609
+ public: clients.publicClient,
2610
+ wallet: clients.walletClient,
2611
+ },
2612
+ });
2613
+ }
2614
+
2615
+ /**
2616
+ * Get the contract address
2617
+ */
2618
+ get address(): Address {
2619
+ return this.contractAddress;
2620
+ }
2621
+
2622
+ /**
2623
+ * Get the underlying viem contract instance
2624
+ */
2625
+ getContract(): RailgunSmartWallet_jsonContract {
2626
+ return this.contract;
2627
+ }
2628
+
2629
+ /**
2630
+ * ZERO_VALUE
2631
+ * view
2632
+ */
2633
+ async ZERO_VALUE(): Promise<`0x${string}`> {
2634
+ return this.contract.read.ZERO_VALUE() as Promise<`0x${string}`>;
2635
+ }
2636
+
2637
+ /**
2638
+ * getFee
2639
+ * pure
2640
+ */
2641
+ async getFee(_amount: bigint, _isInclusive: boolean, _feeBP: bigint): Promise<[bigint, bigint]> {
2642
+ return this.contract.read.getFee([_amount, _isInclusive, _feeBP] as const) as Promise<[bigint, bigint]>;
2643
+ }
2644
+
2645
+ /**
2646
+ * getInsertionTreeNumberAndStartingIndex
2647
+ * view
2648
+ */
2649
+ async getInsertionTreeNumberAndStartingIndex(_newCommitments: bigint): Promise<[bigint, bigint]> {
2650
+ return this.contract.read.getInsertionTreeNumberAndStartingIndex([_newCommitments] as const) as Promise<[bigint, bigint]>;
2651
+ }
2652
+
2653
+ /**
2654
+ * getTokenID
2655
+ * pure
2656
+ */
2657
+ async getTokenID(_tokenData: TokenData): Promise<`0x${string}`> {
2658
+ return this.contract.read.getTokenID([_tokenData] as const) as Promise<`0x${string}`>;
2659
+ }
2660
+
2661
+ /**
2662
+ * getVerificationKey
2663
+ * view
2664
+ */
2665
+ async getVerificationKey(_nullifiers: bigint, _commitments: bigint): Promise<VerifyingKey> {
2666
+ return this.contract.read.getVerificationKey([_nullifiers, _commitments] as const) as Promise<VerifyingKey>;
2667
+ }
2668
+
2669
+ /**
2670
+ * hashBoundParams
2671
+ * pure
2672
+ */
2673
+ async hashBoundParams(_boundParams: BoundParams): Promise<bigint> {
2674
+ return this.contract.read.hashBoundParams([_boundParams] as const) as Promise<bigint>;
2675
+ }
2676
+
2677
+ /**
2678
+ * hashCommitment
2679
+ * pure
2680
+ */
2681
+ async hashCommitment(_commitmentPreimage: CommitmentPreimage): Promise<`0x${string}`> {
2682
+ return this.contract.read.hashCommitment([_commitmentPreimage] as const) as Promise<`0x${string}`>;
2683
+ }
2684
+
2685
+ /**
2686
+ * hashLeftRight
2687
+ * pure
2688
+ */
2689
+ async hashLeftRight(_left: `0x${string}`, _right: `0x${string}`): Promise<`0x${string}`> {
2690
+ return this.contract.read.hashLeftRight([_left, _right] as const) as Promise<`0x${string}`>;
2691
+ }
2692
+
2693
+ /**
2694
+ * lastEventBlock
2695
+ * view
2696
+ */
2697
+ async lastEventBlock(): Promise<bigint> {
2698
+ return this.contract.read.lastEventBlock() as Promise<bigint>;
2699
+ }
2700
+
2701
+ /**
2702
+ * merkleRoot
2703
+ * view
2704
+ */
2705
+ async merkleRoot(): Promise<`0x${string}`> {
2706
+ return this.contract.read.merkleRoot() as Promise<`0x${string}`>;
2707
+ }
2708
+
2709
+ /**
2710
+ * nextLeafIndex
2711
+ * view
2712
+ */
2713
+ async nextLeafIndex(): Promise<bigint> {
2714
+ return this.contract.read.nextLeafIndex() as Promise<bigint>;
2715
+ }
2716
+
2717
+ /**
2718
+ * nftFee
2719
+ * view
2720
+ */
2721
+ async nftFee(): Promise<bigint> {
2722
+ return this.contract.read.nftFee() as Promise<bigint>;
2723
+ }
2724
+
2725
+ /**
2726
+ * nullifiers
2727
+ * view
2728
+ */
2729
+ async nullifiers(arg0: bigint, arg1: `0x${string}`): Promise<boolean> {
2730
+ return this.contract.read.nullifiers([arg0, arg1] as const) as Promise<boolean>;
2731
+ }
2732
+
2733
+ /**
2734
+ * owner
2735
+ * view
2736
+ */
2737
+ async owner(): Promise<`0x${string}`> {
2738
+ return this.contract.read.owner() as Promise<`0x${string}`>;
2739
+ }
2740
+
2741
+ /**
2742
+ * rootHistory
2743
+ * view
2744
+ */
2745
+ async rootHistory(arg0: bigint, arg1: `0x${string}`): Promise<boolean> {
2746
+ return this.contract.read.rootHistory([arg0, arg1] as const) as Promise<boolean>;
2747
+ }
2748
+
2749
+ /**
2750
+ * shieldFee
2751
+ * view
2752
+ */
2753
+ async shieldFee(): Promise<bigint> {
2754
+ return this.contract.read.shieldFee() as Promise<bigint>;
2755
+ }
2756
+
2757
+ /**
2758
+ * snarkSafetyVector
2759
+ * view
2760
+ */
2761
+ async snarkSafetyVector(arg0: bigint): Promise<boolean> {
2762
+ return this.contract.read.snarkSafetyVector([arg0] as const) as Promise<boolean>;
2763
+ }
2764
+
2765
+ /**
2766
+ * sumCommitments
2767
+ * pure
2768
+ */
2769
+ async sumCommitments(_transactions: Transaction[]): Promise<bigint> {
2770
+ return this.contract.read.sumCommitments([_transactions] as const) as Promise<bigint>;
2771
+ }
2772
+
2773
+ /**
2774
+ * tokenBlocklist
2775
+ * view
2776
+ */
2777
+ async tokenBlocklist(arg0: `0x${string}`): Promise<boolean> {
2778
+ return this.contract.read.tokenBlocklist([arg0] as const) as Promise<boolean>;
2779
+ }
2780
+
2781
+ /**
2782
+ * tokenIDMapping
2783
+ * view
2784
+ */
2785
+ async tokenIDMapping(arg0: `0x${string}`): Promise<[bigint, `0x${string}`, bigint]> {
2786
+ return this.contract.read.tokenIDMapping([arg0] as const) as Promise<[bigint, `0x${string}`, bigint]>;
2787
+ }
2788
+
2789
+ /**
2790
+ * treasury
2791
+ * view
2792
+ */
2793
+ async treasury(): Promise<`0x${string}`> {
2794
+ return this.contract.read.treasury() as Promise<`0x${string}`>;
2795
+ }
2796
+
2797
+ /**
2798
+ * treeNumber
2799
+ * view
2800
+ */
2801
+ async treeNumber(): Promise<bigint> {
2802
+ return this.contract.read.treeNumber() as Promise<bigint>;
2803
+ }
2804
+
2805
+ /**
2806
+ * unshieldFee
2807
+ * view
2808
+ */
2809
+ async unshieldFee(): Promise<bigint> {
2810
+ return this.contract.read.unshieldFee() as Promise<bigint>;
2811
+ }
2812
+
2813
+ /**
2814
+ * validateCommitmentPreimage
2815
+ * view
2816
+ */
2817
+ async validateCommitmentPreimage(_note: CommitmentPreimage): Promise<[boolean, string]> {
2818
+ return this.contract.read.validateCommitmentPreimage([_note] as const) as Promise<[boolean, string]>;
2819
+ }
2820
+
2821
+ /**
2822
+ * validateTransaction
2823
+ * view
2824
+ */
2825
+ async validateTransaction(_transaction: Transaction): Promise<[boolean, string]> {
2826
+ return this.contract.read.validateTransaction([_transaction] as const) as Promise<[boolean, string]>;
2827
+ }
2828
+
2829
+ /**
2830
+ * verify
2831
+ * view
2832
+ */
2833
+ async verify(_transaction: Transaction): Promise<boolean> {
2834
+ return this.contract.read.verify([_transaction] as const) as Promise<boolean>;
2835
+ }
2836
+
2837
+ /**
2838
+ * verifyProof
2839
+ * view
2840
+ */
2841
+ async verifyProof(_verifyingKey: VerifyingKey, _proof: SnarkProof, _inputs: bigint[]): Promise<boolean> {
2842
+ return this.contract.read.verifyProof([_verifyingKey, _proof, _inputs] as const) as Promise<boolean>;
2843
+ }
2844
+
2845
+ /**
2846
+ * zeros
2847
+ * view
2848
+ */
2849
+ async zeros(arg0: bigint): Promise<`0x${string}`> {
2850
+ return this.contract.read.zeros([arg0] as const) as Promise<`0x${string}`>;
2851
+ }
2852
+
2853
+ /**
2854
+ * addToBlocklist
2855
+ * nonpayable
2856
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
2857
+ */
2858
+ async addToBlocklist(_tokens: `0x${string}`[], options?: {
2859
+ accessList?: import('viem').AccessList;
2860
+ authorizationList?: import('viem').AuthorizationList;
2861
+ chain?: import('viem').Chain | null;
2862
+ dataSuffix?: `0x${string}`;
2863
+ gas?: bigint;
2864
+ gasPrice?: bigint;
2865
+ maxFeePerGas?: bigint;
2866
+ maxPriorityFeePerGas?: bigint;
2867
+ nonce?: number;
2868
+ value?: bigint;
2869
+ }): Promise<`0x${string}`> {
2870
+ if (!this.contract.write) {
2871
+ throw new Error('Wallet client is required for write operations');
2872
+ }
2873
+ return this.contract.write.addToBlocklist([_tokens] as const, options) as Promise<`0x${string}`>;
2874
+ }
2875
+
2876
+ /**
2877
+ * addVector
2878
+ * nonpayable
2879
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
2880
+ */
2881
+ async addVector(vector: bigint, options?: {
2882
+ accessList?: import('viem').AccessList;
2883
+ authorizationList?: import('viem').AuthorizationList;
2884
+ chain?: import('viem').Chain | null;
2885
+ dataSuffix?: `0x${string}`;
2886
+ gas?: bigint;
2887
+ gasPrice?: bigint;
2888
+ maxFeePerGas?: bigint;
2889
+ maxPriorityFeePerGas?: bigint;
2890
+ nonce?: number;
2891
+ value?: bigint;
2892
+ }): Promise<`0x${string}`> {
2893
+ if (!this.contract.write) {
2894
+ throw new Error('Wallet client is required for write operations');
2895
+ }
2896
+ return this.contract.write.addVector([vector] as const, options) as Promise<`0x${string}`>;
2897
+ }
2898
+
2899
+ /**
2900
+ * changeFee
2901
+ * nonpayable
2902
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
2903
+ */
2904
+ async changeFee(_shieldFee: bigint, _unshieldFee: bigint, _nftFee: bigint, options?: {
2905
+ accessList?: import('viem').AccessList;
2906
+ authorizationList?: import('viem').AuthorizationList;
2907
+ chain?: import('viem').Chain | null;
2908
+ dataSuffix?: `0x${string}`;
2909
+ gas?: bigint;
2910
+ gasPrice?: bigint;
2911
+ maxFeePerGas?: bigint;
2912
+ maxPriorityFeePerGas?: bigint;
2913
+ nonce?: number;
2914
+ value?: bigint;
2915
+ }): Promise<`0x${string}`> {
2916
+ if (!this.contract.write) {
2917
+ throw new Error('Wallet client is required for write operations');
2918
+ }
2919
+ return this.contract.write.changeFee([_shieldFee, _unshieldFee, _nftFee] as const, options) as Promise<`0x${string}`>;
2920
+ }
2921
+
2922
+ /**
2923
+ * changeTreasury
2924
+ * nonpayable
2925
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
2926
+ */
2927
+ async changeTreasury(_treasury: `0x${string}`, options?: {
2928
+ accessList?: import('viem').AccessList;
2929
+ authorizationList?: import('viem').AuthorizationList;
2930
+ chain?: import('viem').Chain | null;
2931
+ dataSuffix?: `0x${string}`;
2932
+ gas?: bigint;
2933
+ gasPrice?: bigint;
2934
+ maxFeePerGas?: bigint;
2935
+ maxPriorityFeePerGas?: bigint;
2936
+ nonce?: number;
2937
+ value?: bigint;
2938
+ }): Promise<`0x${string}`> {
2939
+ if (!this.contract.write) {
2940
+ throw new Error('Wallet client is required for write operations');
2941
+ }
2942
+ return this.contract.write.changeTreasury([_treasury] as const, options) as Promise<`0x${string}`>;
2943
+ }
2944
+
2945
+ /**
2946
+ * checkSafetyVectors
2947
+ * nonpayable
2948
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
2949
+ */
2950
+ async checkSafetyVectors(options?: {
2951
+ accessList?: import('viem').AccessList;
2952
+ authorizationList?: import('viem').AuthorizationList;
2953
+ chain?: import('viem').Chain | null;
2954
+ dataSuffix?: `0x${string}`;
2955
+ gas?: bigint;
2956
+ gasPrice?: bigint;
2957
+ maxFeePerGas?: bigint;
2958
+ maxPriorityFeePerGas?: bigint;
2959
+ nonce?: number;
2960
+ value?: bigint;
2961
+ }): Promise<`0x${string}`> {
2962
+ if (!this.contract.write) {
2963
+ throw new Error('Wallet client is required for write operations');
2964
+ }
2965
+ return this.contract.write.checkSafetyVectors(options) as Promise<`0x${string}`>;
2966
+ }
2967
+
2968
+ /**
2969
+ * initializeRailgunLogic
2970
+ * nonpayable
2971
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
2972
+ */
2973
+ async initializeRailgunLogic(_treasury: `0x${string}`, _shieldFee: bigint, _unshieldFee: bigint, _nftFee: bigint, _owner: `0x${string}`, options?: {
2974
+ accessList?: import('viem').AccessList;
2975
+ authorizationList?: import('viem').AuthorizationList;
2976
+ chain?: import('viem').Chain | null;
2977
+ dataSuffix?: `0x${string}`;
2978
+ gas?: bigint;
2979
+ gasPrice?: bigint;
2980
+ maxFeePerGas?: bigint;
2981
+ maxPriorityFeePerGas?: bigint;
2982
+ nonce?: number;
2983
+ value?: bigint;
2984
+ }): Promise<`0x${string}`> {
2985
+ if (!this.contract.write) {
2986
+ throw new Error('Wallet client is required for write operations');
2987
+ }
2988
+ return this.contract.write.initializeRailgunLogic([_treasury, _shieldFee, _unshieldFee, _nftFee, _owner] as const, options) as Promise<`0x${string}`>;
2989
+ }
2990
+
2991
+ /**
2992
+ * removeFromBlocklist
2993
+ * nonpayable
2994
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
2995
+ */
2996
+ async removeFromBlocklist(_tokens: `0x${string}`[], options?: {
2997
+ accessList?: import('viem').AccessList;
2998
+ authorizationList?: import('viem').AuthorizationList;
2999
+ chain?: import('viem').Chain | null;
3000
+ dataSuffix?: `0x${string}`;
3001
+ gas?: bigint;
3002
+ gasPrice?: bigint;
3003
+ maxFeePerGas?: bigint;
3004
+ maxPriorityFeePerGas?: bigint;
3005
+ nonce?: number;
3006
+ value?: bigint;
3007
+ }): Promise<`0x${string}`> {
3008
+ if (!this.contract.write) {
3009
+ throw new Error('Wallet client is required for write operations');
3010
+ }
3011
+ return this.contract.write.removeFromBlocklist([_tokens] as const, options) as Promise<`0x${string}`>;
3012
+ }
3013
+
3014
+ /**
3015
+ * removeVector
3016
+ * nonpayable
3017
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
3018
+ */
3019
+ async removeVector(vector: bigint, options?: {
3020
+ accessList?: import('viem').AccessList;
3021
+ authorizationList?: import('viem').AuthorizationList;
3022
+ chain?: import('viem').Chain | null;
3023
+ dataSuffix?: `0x${string}`;
3024
+ gas?: bigint;
3025
+ gasPrice?: bigint;
3026
+ maxFeePerGas?: bigint;
3027
+ maxPriorityFeePerGas?: bigint;
3028
+ nonce?: number;
3029
+ value?: bigint;
3030
+ }): Promise<`0x${string}`> {
3031
+ if (!this.contract.write) {
3032
+ throw new Error('Wallet client is required for write operations');
3033
+ }
3034
+ return this.contract.write.removeVector([vector] as const, options) as Promise<`0x${string}`>;
3035
+ }
3036
+
3037
+ /**
3038
+ * renounceOwnership
3039
+ * nonpayable
3040
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
3041
+ */
3042
+ async renounceOwnership(options?: {
3043
+ accessList?: import('viem').AccessList;
3044
+ authorizationList?: import('viem').AuthorizationList;
3045
+ chain?: import('viem').Chain | null;
3046
+ dataSuffix?: `0x${string}`;
3047
+ gas?: bigint;
3048
+ gasPrice?: bigint;
3049
+ maxFeePerGas?: bigint;
3050
+ maxPriorityFeePerGas?: bigint;
3051
+ nonce?: number;
3052
+ value?: bigint;
3053
+ }): Promise<`0x${string}`> {
3054
+ if (!this.contract.write) {
3055
+ throw new Error('Wallet client is required for write operations');
3056
+ }
3057
+ return this.contract.write.renounceOwnership(options) as Promise<`0x${string}`>;
3058
+ }
3059
+
3060
+ /**
3061
+ * setVerificationKey
3062
+ * nonpayable
3063
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
3064
+ */
3065
+ async setVerificationKey(_nullifiers: bigint, _commitments: bigint, _verifyingKey: VerifyingKey, options?: {
3066
+ accessList?: import('viem').AccessList;
3067
+ authorizationList?: import('viem').AuthorizationList;
3068
+ chain?: import('viem').Chain | null;
3069
+ dataSuffix?: `0x${string}`;
3070
+ gas?: bigint;
3071
+ gasPrice?: bigint;
3072
+ maxFeePerGas?: bigint;
3073
+ maxPriorityFeePerGas?: bigint;
3074
+ nonce?: number;
3075
+ value?: bigint;
3076
+ }): Promise<`0x${string}`> {
3077
+ if (!this.contract.write) {
3078
+ throw new Error('Wallet client is required for write operations');
3079
+ }
3080
+ return this.contract.write.setVerificationKey([_nullifiers, _commitments, _verifyingKey] as const, options) as Promise<`0x${string}`>;
3081
+ }
3082
+
3083
+ /**
3084
+ * shield
3085
+ * nonpayable
3086
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
3087
+ */
3088
+ async shield(_shieldRequests: ShieldRequest[], options?: {
3089
+ accessList?: import('viem').AccessList;
3090
+ authorizationList?: import('viem').AuthorizationList;
3091
+ chain?: import('viem').Chain | null;
3092
+ dataSuffix?: `0x${string}`;
3093
+ gas?: bigint;
3094
+ gasPrice?: bigint;
3095
+ maxFeePerGas?: bigint;
3096
+ maxPriorityFeePerGas?: bigint;
3097
+ nonce?: number;
3098
+ value?: bigint;
3099
+ }): Promise<`0x${string}`> {
3100
+ if (!this.contract.write) {
3101
+ throw new Error('Wallet client is required for write operations');
3102
+ }
3103
+ return this.contract.write.shield([_shieldRequests] as const, options) as Promise<`0x${string}`>;
3104
+ }
3105
+
3106
+ /**
3107
+ * transact
3108
+ * nonpayable
3109
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
3110
+ */
3111
+ async transact(_transactions: Transaction[], options?: {
3112
+ accessList?: import('viem').AccessList;
3113
+ authorizationList?: import('viem').AuthorizationList;
3114
+ chain?: import('viem').Chain | null;
3115
+ dataSuffix?: `0x${string}`;
3116
+ gas?: bigint;
3117
+ gasPrice?: bigint;
3118
+ maxFeePerGas?: bigint;
3119
+ maxPriorityFeePerGas?: bigint;
3120
+ nonce?: number;
3121
+ value?: bigint;
3122
+ }): Promise<`0x${string}`> {
3123
+ if (!this.contract.write) {
3124
+ throw new Error('Wallet client is required for write operations');
3125
+ }
3126
+ return this.contract.write.transact([_transactions] as const, options) as Promise<`0x${string}`>;
3127
+ }
3128
+
3129
+ /**
3130
+ * transferOwnership
3131
+ * nonpayable
3132
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
3133
+ */
3134
+ async transferOwnership(newOwner: `0x${string}`, options?: {
3135
+ accessList?: import('viem').AccessList;
3136
+ authorizationList?: import('viem').AuthorizationList;
3137
+ chain?: import('viem').Chain | null;
3138
+ dataSuffix?: `0x${string}`;
3139
+ gas?: bigint;
3140
+ gasPrice?: bigint;
3141
+ maxFeePerGas?: bigint;
3142
+ maxPriorityFeePerGas?: bigint;
3143
+ nonce?: number;
3144
+ value?: bigint;
3145
+ }): Promise<`0x${string}`> {
3146
+ if (!this.contract.write) {
3147
+ throw new Error('Wallet client is required for write operations');
3148
+ }
3149
+ return this.contract.write.transferOwnership([newOwner] as const, options) as Promise<`0x${string}`>;
3150
+ }
3151
+
3152
+
3153
+
3154
+ /**
3155
+ * Simulate contract write operations (dry-run without sending transaction)
3156
+ *
3157
+ * @example
3158
+ * const result = await contract.simulate.transfer('0x...', 1000n);
3159
+ * console.log('Gas estimate:', result.request.gas);
3160
+ * console.log('Would succeed:', result.result);
3161
+ */
3162
+ get simulate() {
3163
+ const contract = this.contract;
3164
+ if (!contract.simulate) {
3165
+ throw new Error('Public client is required for simulation');
3166
+ }
3167
+ return {
3168
+ /**
3169
+ * Simulate addToBlocklist
3170
+ * Returns gas estimate and result without sending transaction
3171
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
3172
+ */
3173
+ async addToBlocklist(_tokens: `0x${string}`[], options?: {
3174
+ accessList?: import('viem').AccessList;
3175
+ authorizationList?: import('viem').AuthorizationList;
3176
+ chain?: import('viem').Chain | null;
3177
+ dataSuffix?: `0x${string}`;
3178
+ gas?: bigint;
3179
+ gasPrice?: bigint;
3180
+ maxFeePerGas?: bigint;
3181
+ maxPriorityFeePerGas?: bigint;
3182
+ nonce?: number;
3183
+ value?: bigint;
3184
+ }): Promise<void> {
3185
+ return contract.simulate.addToBlocklist([_tokens] as const, options) as Promise<void>;
3186
+ },
3187
+ /**
3188
+ * Simulate addVector
3189
+ * Returns gas estimate and result without sending transaction
3190
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
3191
+ */
3192
+ async addVector(vector: bigint, options?: {
3193
+ accessList?: import('viem').AccessList;
3194
+ authorizationList?: import('viem').AuthorizationList;
3195
+ chain?: import('viem').Chain | null;
3196
+ dataSuffix?: `0x${string}`;
3197
+ gas?: bigint;
3198
+ gasPrice?: bigint;
3199
+ maxFeePerGas?: bigint;
3200
+ maxPriorityFeePerGas?: bigint;
3201
+ nonce?: number;
3202
+ value?: bigint;
3203
+ }): Promise<void> {
3204
+ return contract.simulate.addVector([vector] as const, options) as Promise<void>;
3205
+ },
3206
+ /**
3207
+ * Simulate changeFee
3208
+ * Returns gas estimate and result without sending transaction
3209
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
3210
+ */
3211
+ async changeFee(_shieldFee: bigint, _unshieldFee: bigint, _nftFee: bigint, options?: {
3212
+ accessList?: import('viem').AccessList;
3213
+ authorizationList?: import('viem').AuthorizationList;
3214
+ chain?: import('viem').Chain | null;
3215
+ dataSuffix?: `0x${string}`;
3216
+ gas?: bigint;
3217
+ gasPrice?: bigint;
3218
+ maxFeePerGas?: bigint;
3219
+ maxPriorityFeePerGas?: bigint;
3220
+ nonce?: number;
3221
+ value?: bigint;
3222
+ }): Promise<void> {
3223
+ return contract.simulate.changeFee([_shieldFee, _unshieldFee, _nftFee] as const, options) as Promise<void>;
3224
+ },
3225
+ /**
3226
+ * Simulate changeTreasury
3227
+ * Returns gas estimate and result without sending transaction
3228
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
3229
+ */
3230
+ async changeTreasury(_treasury: `0x${string}`, options?: {
3231
+ accessList?: import('viem').AccessList;
3232
+ authorizationList?: import('viem').AuthorizationList;
3233
+ chain?: import('viem').Chain | null;
3234
+ dataSuffix?: `0x${string}`;
3235
+ gas?: bigint;
3236
+ gasPrice?: bigint;
3237
+ maxFeePerGas?: bigint;
3238
+ maxPriorityFeePerGas?: bigint;
3239
+ nonce?: number;
3240
+ value?: bigint;
3241
+ }): Promise<void> {
3242
+ return contract.simulate.changeTreasury([_treasury] as const, options) as Promise<void>;
3243
+ },
3244
+ /**
3245
+ * Simulate checkSafetyVectors
3246
+ * Returns gas estimate and result without sending transaction
3247
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
3248
+ */
3249
+ async checkSafetyVectors(options?: {
3250
+ accessList?: import('viem').AccessList;
3251
+ authorizationList?: import('viem').AuthorizationList;
3252
+ chain?: import('viem').Chain | null;
3253
+ dataSuffix?: `0x${string}`;
3254
+ gas?: bigint;
3255
+ gasPrice?: bigint;
3256
+ maxFeePerGas?: bigint;
3257
+ maxPriorityFeePerGas?: bigint;
3258
+ nonce?: number;
3259
+ value?: bigint;
3260
+ }): Promise<void> {
3261
+ return contract.simulate.checkSafetyVectors(options) as Promise<void>;
3262
+ },
3263
+ /**
3264
+ * Simulate initializeRailgunLogic
3265
+ * Returns gas estimate and result without sending transaction
3266
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
3267
+ */
3268
+ async initializeRailgunLogic(_treasury: `0x${string}`, _shieldFee: bigint, _unshieldFee: bigint, _nftFee: bigint, _owner: `0x${string}`, options?: {
3269
+ accessList?: import('viem').AccessList;
3270
+ authorizationList?: import('viem').AuthorizationList;
3271
+ chain?: import('viem').Chain | null;
3272
+ dataSuffix?: `0x${string}`;
3273
+ gas?: bigint;
3274
+ gasPrice?: bigint;
3275
+ maxFeePerGas?: bigint;
3276
+ maxPriorityFeePerGas?: bigint;
3277
+ nonce?: number;
3278
+ value?: bigint;
3279
+ }): Promise<void> {
3280
+ return contract.simulate.initializeRailgunLogic([_treasury, _shieldFee, _unshieldFee, _nftFee, _owner] as const, options) as Promise<void>;
3281
+ },
3282
+ /**
3283
+ * Simulate removeFromBlocklist
3284
+ * Returns gas estimate and result without sending transaction
3285
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
3286
+ */
3287
+ async removeFromBlocklist(_tokens: `0x${string}`[], options?: {
3288
+ accessList?: import('viem').AccessList;
3289
+ authorizationList?: import('viem').AuthorizationList;
3290
+ chain?: import('viem').Chain | null;
3291
+ dataSuffix?: `0x${string}`;
3292
+ gas?: bigint;
3293
+ gasPrice?: bigint;
3294
+ maxFeePerGas?: bigint;
3295
+ maxPriorityFeePerGas?: bigint;
3296
+ nonce?: number;
3297
+ value?: bigint;
3298
+ }): Promise<void> {
3299
+ return contract.simulate.removeFromBlocklist([_tokens] as const, options) as Promise<void>;
3300
+ },
3301
+ /**
3302
+ * Simulate removeVector
3303
+ * Returns gas estimate and result without sending transaction
3304
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
3305
+ */
3306
+ async removeVector(vector: bigint, options?: {
3307
+ accessList?: import('viem').AccessList;
3308
+ authorizationList?: import('viem').AuthorizationList;
3309
+ chain?: import('viem').Chain | null;
3310
+ dataSuffix?: `0x${string}`;
3311
+ gas?: bigint;
3312
+ gasPrice?: bigint;
3313
+ maxFeePerGas?: bigint;
3314
+ maxPriorityFeePerGas?: bigint;
3315
+ nonce?: number;
3316
+ value?: bigint;
3317
+ }): Promise<void> {
3318
+ return contract.simulate.removeVector([vector] as const, options) as Promise<void>;
3319
+ },
3320
+ /**
3321
+ * Simulate renounceOwnership
3322
+ * Returns gas estimate and result without sending transaction
3323
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
3324
+ */
3325
+ async renounceOwnership(options?: {
3326
+ accessList?: import('viem').AccessList;
3327
+ authorizationList?: import('viem').AuthorizationList;
3328
+ chain?: import('viem').Chain | null;
3329
+ dataSuffix?: `0x${string}`;
3330
+ gas?: bigint;
3331
+ gasPrice?: bigint;
3332
+ maxFeePerGas?: bigint;
3333
+ maxPriorityFeePerGas?: bigint;
3334
+ nonce?: number;
3335
+ value?: bigint;
3336
+ }): Promise<void> {
3337
+ return contract.simulate.renounceOwnership(options) as Promise<void>;
3338
+ },
3339
+ /**
3340
+ * Simulate setVerificationKey
3341
+ * Returns gas estimate and result without sending transaction
3342
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
3343
+ */
3344
+ async setVerificationKey(_nullifiers: bigint, _commitments: bigint, _verifyingKey: VerifyingKey, options?: {
3345
+ accessList?: import('viem').AccessList;
3346
+ authorizationList?: import('viem').AuthorizationList;
3347
+ chain?: import('viem').Chain | null;
3348
+ dataSuffix?: `0x${string}`;
3349
+ gas?: bigint;
3350
+ gasPrice?: bigint;
3351
+ maxFeePerGas?: bigint;
3352
+ maxPriorityFeePerGas?: bigint;
3353
+ nonce?: number;
3354
+ value?: bigint;
3355
+ }): Promise<void> {
3356
+ return contract.simulate.setVerificationKey([_nullifiers, _commitments, _verifyingKey] as const, options) as Promise<void>;
3357
+ },
3358
+ /**
3359
+ * Simulate shield
3360
+ * Returns gas estimate and result without sending transaction
3361
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
3362
+ */
3363
+ async shield(_shieldRequests: ShieldRequest[], options?: {
3364
+ accessList?: import('viem').AccessList;
3365
+ authorizationList?: import('viem').AuthorizationList;
3366
+ chain?: import('viem').Chain | null;
3367
+ dataSuffix?: `0x${string}`;
3368
+ gas?: bigint;
3369
+ gasPrice?: bigint;
3370
+ maxFeePerGas?: bigint;
3371
+ maxPriorityFeePerGas?: bigint;
3372
+ nonce?: number;
3373
+ value?: bigint;
3374
+ }): Promise<void> {
3375
+ return contract.simulate.shield([_shieldRequests] as const, options) as Promise<void>;
3376
+ },
3377
+ /**
3378
+ * Simulate transact
3379
+ * Returns gas estimate and result without sending transaction
3380
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
3381
+ */
3382
+ async transact(_transactions: Transaction[], options?: {
3383
+ accessList?: import('viem').AccessList;
3384
+ authorizationList?: import('viem').AuthorizationList;
3385
+ chain?: import('viem').Chain | null;
3386
+ dataSuffix?: `0x${string}`;
3387
+ gas?: bigint;
3388
+ gasPrice?: bigint;
3389
+ maxFeePerGas?: bigint;
3390
+ maxPriorityFeePerGas?: bigint;
3391
+ nonce?: number;
3392
+ value?: bigint;
3393
+ }): Promise<void> {
3394
+ return contract.simulate.transact([_transactions] as const, options) as Promise<void>;
3395
+ },
3396
+ /**
3397
+ * Simulate transferOwnership
3398
+ * Returns gas estimate and result without sending transaction
3399
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
3400
+ */
3401
+ async transferOwnership(newOwner: `0x${string}`, options?: {
3402
+ accessList?: import('viem').AccessList;
3403
+ authorizationList?: import('viem').AuthorizationList;
3404
+ chain?: import('viem').Chain | null;
3405
+ dataSuffix?: `0x${string}`;
3406
+ gas?: bigint;
3407
+ gasPrice?: bigint;
3408
+ maxFeePerGas?: bigint;
3409
+ maxPriorityFeePerGas?: bigint;
3410
+ nonce?: number;
3411
+ value?: bigint;
3412
+ }): Promise<void> {
3413
+ return contract.simulate.transferOwnership([newOwner] as const, options) as Promise<void>;
3414
+ }
3415
+ };
3416
+ }
3417
+
3418
+ /**
3419
+ * Watch contract events
3420
+ *
3421
+ * @example
3422
+ * // Watch all Transfer events
3423
+ * const unwatch = contract.watch.Transfer((event) => {
3424
+ * console.log('Transfer:', event);
3425
+ * });
3426
+ *
3427
+ * // Stop watching
3428
+ * unwatch();
3429
+ */
3430
+ get watch() {
3431
+ return {
3432
+ /**
3433
+ * Watch AddToBlocklist events
3434
+ * @param callback Function to call when event is emitted
3435
+ * @param filter Optional filter for indexed parameters
3436
+ * @returns Unwatch function to stop listening
3437
+ */
3438
+ AddToBlocklist: (callback: (event: { token: `0x${string}` }) => void, filter?: { token: `0x${string}` }) => {
3439
+ return this.publicClient.watchContractEvent({
3440
+ address: this.contractAddress,
3441
+ abi: RailgunSmartWallet_jsonAbi,
3442
+ eventName: 'AddToBlocklist',
3443
+ args: filter,
3444
+ onLogs: (logs: any[]) => {
3445
+ logs.forEach((log: any) => {
3446
+ callback(log.args as any);
3447
+ });
3448
+ },
3449
+ }) as () => void;
3450
+ },
3451
+ /**
3452
+ * Watch FeeChange events
3453
+ * @param callback Function to call when event is emitted
3454
+ * @param filter Optional filter for indexed parameters
3455
+ * @returns Unwatch function to stop listening
3456
+ */
3457
+ FeeChange: (callback: (event: { shieldFee: bigint; unshieldFee: bigint; nftFee: bigint }) => void) => {
3458
+ return this.publicClient.watchContractEvent({
3459
+ address: this.contractAddress,
3460
+ abi: RailgunSmartWallet_jsonAbi,
3461
+ eventName: 'FeeChange',
3462
+
3463
+ onLogs: (logs: any[]) => {
3464
+ logs.forEach((log: any) => {
3465
+ callback(log.args as any);
3466
+ });
3467
+ },
3468
+ }) as () => void;
3469
+ },
3470
+ /**
3471
+ * Watch Initialized events
3472
+ * @param callback Function to call when event is emitted
3473
+ * @param filter Optional filter for indexed parameters
3474
+ * @returns Unwatch function to stop listening
3475
+ */
3476
+ Initialized: (callback: (event: { version: bigint }) => void) => {
3477
+ return this.publicClient.watchContractEvent({
3478
+ address: this.contractAddress,
3479
+ abi: RailgunSmartWallet_jsonAbi,
3480
+ eventName: 'Initialized',
3481
+
3482
+ onLogs: (logs: any[]) => {
3483
+ logs.forEach((log: any) => {
3484
+ callback(log.args as any);
3485
+ });
3486
+ },
3487
+ }) as () => void;
3488
+ },
3489
+ /**
3490
+ * Watch Nullified events
3491
+ * @param callback Function to call when event is emitted
3492
+ * @param filter Optional filter for indexed parameters
3493
+ * @returns Unwatch function to stop listening
3494
+ */
3495
+ Nullified: (callback: (event: { treeNumber: bigint; nullifier: `0x${string}`[] }) => void) => {
3496
+ return this.publicClient.watchContractEvent({
3497
+ address: this.contractAddress,
3498
+ abi: RailgunSmartWallet_jsonAbi,
3499
+ eventName: 'Nullified',
3500
+
3501
+ onLogs: (logs: any[]) => {
3502
+ logs.forEach((log: any) => {
3503
+ callback(log.args as any);
3504
+ });
3505
+ },
3506
+ }) as () => void;
3507
+ },
3508
+ /**
3509
+ * Watch OwnershipTransferred events
3510
+ * @param callback Function to call when event is emitted
3511
+ * @param filter Optional filter for indexed parameters
3512
+ * @returns Unwatch function to stop listening
3513
+ */
3514
+ OwnershipTransferred: (callback: (event: { previousOwner: `0x${string}`; newOwner: `0x${string}` }) => void, filter?: { previousOwner: `0x${string}`; newOwner: `0x${string}` }) => {
3515
+ return this.publicClient.watchContractEvent({
3516
+ address: this.contractAddress,
3517
+ abi: RailgunSmartWallet_jsonAbi,
3518
+ eventName: 'OwnershipTransferred',
3519
+ args: filter,
3520
+ onLogs: (logs: any[]) => {
3521
+ logs.forEach((log: any) => {
3522
+ callback(log.args as any);
3523
+ });
3524
+ },
3525
+ }) as () => void;
3526
+ },
3527
+ /**
3528
+ * Watch RemoveFromBlocklist events
3529
+ * @param callback Function to call when event is emitted
3530
+ * @param filter Optional filter for indexed parameters
3531
+ * @returns Unwatch function to stop listening
3532
+ */
3533
+ RemoveFromBlocklist: (callback: (event: { token: `0x${string}` }) => void, filter?: { token: `0x${string}` }) => {
3534
+ return this.publicClient.watchContractEvent({
3535
+ address: this.contractAddress,
3536
+ abi: RailgunSmartWallet_jsonAbi,
3537
+ eventName: 'RemoveFromBlocklist',
3538
+ args: filter,
3539
+ onLogs: (logs: any[]) => {
3540
+ logs.forEach((log: any) => {
3541
+ callback(log.args as any);
3542
+ });
3543
+ },
3544
+ }) as () => void;
3545
+ },
3546
+ /**
3547
+ * Watch Shield events
3548
+ * @param callback Function to call when event is emitted
3549
+ * @param filter Optional filter for indexed parameters
3550
+ * @returns Unwatch function to stop listening
3551
+ */
3552
+ Shield: (callback: (event: { treeNumber: bigint; startPosition: bigint; commitments: CommitmentPreimage[]; shieldCiphertext: ShieldCiphertext[]; fees: bigint[] }) => void) => {
3553
+ return this.publicClient.watchContractEvent({
3554
+ address: this.contractAddress,
3555
+ abi: RailgunSmartWallet_jsonAbi,
3556
+ eventName: 'Shield',
3557
+
3558
+ onLogs: (logs: any[]) => {
3559
+ logs.forEach((log: any) => {
3560
+ callback(log.args as any);
3561
+ });
3562
+ },
3563
+ }) as () => void;
3564
+ },
3565
+ /**
3566
+ * Watch Transact events
3567
+ * @param callback Function to call when event is emitted
3568
+ * @param filter Optional filter for indexed parameters
3569
+ * @returns Unwatch function to stop listening
3570
+ */
3571
+ Transact: (callback: (event: { treeNumber: bigint; startPosition: bigint; hash: `0x${string}`[]; ciphertext: CommitmentCiphertext[] }) => void) => {
3572
+ return this.publicClient.watchContractEvent({
3573
+ address: this.contractAddress,
3574
+ abi: RailgunSmartWallet_jsonAbi,
3575
+ eventName: 'Transact',
3576
+
3577
+ onLogs: (logs: any[]) => {
3578
+ logs.forEach((log: any) => {
3579
+ callback(log.args as any);
3580
+ });
3581
+ },
3582
+ }) as () => void;
3583
+ },
3584
+ /**
3585
+ * Watch TreasuryChange events
3586
+ * @param callback Function to call when event is emitted
3587
+ * @param filter Optional filter for indexed parameters
3588
+ * @returns Unwatch function to stop listening
3589
+ */
3590
+ TreasuryChange: (callback: (event: { treasury: `0x${string}` }) => void) => {
3591
+ return this.publicClient.watchContractEvent({
3592
+ address: this.contractAddress,
3593
+ abi: RailgunSmartWallet_jsonAbi,
3594
+ eventName: 'TreasuryChange',
3595
+
3596
+ onLogs: (logs: any[]) => {
3597
+ logs.forEach((log: any) => {
3598
+ callback(log.args as any);
3599
+ });
3600
+ },
3601
+ }) as () => void;
3602
+ },
3603
+ /**
3604
+ * Watch Unshield events
3605
+ * @param callback Function to call when event is emitted
3606
+ * @param filter Optional filter for indexed parameters
3607
+ * @returns Unwatch function to stop listening
3608
+ */
3609
+ Unshield: (callback: (event: { to: `0x${string}`; token: TokenData; amount: bigint; fee: bigint }) => void) => {
3610
+ return this.publicClient.watchContractEvent({
3611
+ address: this.contractAddress,
3612
+ abi: RailgunSmartWallet_jsonAbi,
3613
+ eventName: 'Unshield',
3614
+
3615
+ onLogs: (logs: any[]) => {
3616
+ logs.forEach((log: any) => {
3617
+ callback(log.args as any);
3618
+ });
3619
+ },
3620
+ }) as () => void;
3621
+ },
3622
+ /**
3623
+ * Watch VerifyingKeySet events
3624
+ * @param callback Function to call when event is emitted
3625
+ * @param filter Optional filter for indexed parameters
3626
+ * @returns Unwatch function to stop listening
3627
+ */
3628
+ VerifyingKeySet: (callback: (event: { nullifiers: bigint; commitments: bigint; verifyingKey: VerifyingKey }) => void) => {
3629
+ return this.publicClient.watchContractEvent({
3630
+ address: this.contractAddress,
3631
+ abi: RailgunSmartWallet_jsonAbi,
3632
+ eventName: 'VerifyingKeySet',
3633
+
3634
+ onLogs: (logs: any[]) => {
3635
+ logs.forEach((log: any) => {
3636
+ callback(log.args as any);
3637
+ });
3638
+ },
3639
+ }) as () => void;
3640
+ }
3641
+ };
3642
+ }
3643
+ }