@gitmyabi/fbtc 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,2017 @@
1
+ import type { Abi, Address, PublicClient, WalletClient, GetContractReturnType } from 'viem';
2
+ import { getContract } from 'viem';
3
+
4
+ /**
5
+ * FBTC_json ABI
6
+ *
7
+ * This ABI is typed using viem's type system for full type safety.
8
+ */
9
+ export const FBTC_jsonAbi = [
10
+ {
11
+ "inputs": [
12
+ {
13
+ "internalType": "address",
14
+ "name": "_owner",
15
+ "type": "address"
16
+ },
17
+ {
18
+ "internalType": "address",
19
+ "name": "_bridge",
20
+ "type": "address"
21
+ }
22
+ ],
23
+ "stateMutability": "nonpayable",
24
+ "type": "constructor"
25
+ },
26
+ {
27
+ "inputs": [
28
+ {
29
+ "internalType": "address",
30
+ "name": "target",
31
+ "type": "address"
32
+ }
33
+ ],
34
+ "name": "AddressEmptyCode",
35
+ "type": "error"
36
+ },
37
+ {
38
+ "inputs": [
39
+ {
40
+ "internalType": "address",
41
+ "name": "account",
42
+ "type": "address"
43
+ }
44
+ ],
45
+ "name": "AddressInsufficientBalance",
46
+ "type": "error"
47
+ },
48
+ {
49
+ "inputs": [
50
+ {
51
+ "internalType": "address",
52
+ "name": "implementation",
53
+ "type": "address"
54
+ }
55
+ ],
56
+ "name": "ERC1967InvalidImplementation",
57
+ "type": "error"
58
+ },
59
+ {
60
+ "inputs": [],
61
+ "name": "ERC1967NonPayable",
62
+ "type": "error"
63
+ },
64
+ {
65
+ "inputs": [
66
+ {
67
+ "internalType": "address",
68
+ "name": "spender",
69
+ "type": "address"
70
+ },
71
+ {
72
+ "internalType": "uint256",
73
+ "name": "allowance",
74
+ "type": "uint256"
75
+ },
76
+ {
77
+ "internalType": "uint256",
78
+ "name": "needed",
79
+ "type": "uint256"
80
+ }
81
+ ],
82
+ "name": "ERC20InsufficientAllowance",
83
+ "type": "error"
84
+ },
85
+ {
86
+ "inputs": [
87
+ {
88
+ "internalType": "address",
89
+ "name": "sender",
90
+ "type": "address"
91
+ },
92
+ {
93
+ "internalType": "uint256",
94
+ "name": "balance",
95
+ "type": "uint256"
96
+ },
97
+ {
98
+ "internalType": "uint256",
99
+ "name": "needed",
100
+ "type": "uint256"
101
+ }
102
+ ],
103
+ "name": "ERC20InsufficientBalance",
104
+ "type": "error"
105
+ },
106
+ {
107
+ "inputs": [
108
+ {
109
+ "internalType": "address",
110
+ "name": "approver",
111
+ "type": "address"
112
+ }
113
+ ],
114
+ "name": "ERC20InvalidApprover",
115
+ "type": "error"
116
+ },
117
+ {
118
+ "inputs": [
119
+ {
120
+ "internalType": "address",
121
+ "name": "receiver",
122
+ "type": "address"
123
+ }
124
+ ],
125
+ "name": "ERC20InvalidReceiver",
126
+ "type": "error"
127
+ },
128
+ {
129
+ "inputs": [
130
+ {
131
+ "internalType": "address",
132
+ "name": "sender",
133
+ "type": "address"
134
+ }
135
+ ],
136
+ "name": "ERC20InvalidSender",
137
+ "type": "error"
138
+ },
139
+ {
140
+ "inputs": [
141
+ {
142
+ "internalType": "address",
143
+ "name": "spender",
144
+ "type": "address"
145
+ }
146
+ ],
147
+ "name": "ERC20InvalidSpender",
148
+ "type": "error"
149
+ },
150
+ {
151
+ "inputs": [],
152
+ "name": "EnforcedPause",
153
+ "type": "error"
154
+ },
155
+ {
156
+ "inputs": [],
157
+ "name": "ExpectedPause",
158
+ "type": "error"
159
+ },
160
+ {
161
+ "inputs": [],
162
+ "name": "FailedInnerCall",
163
+ "type": "error"
164
+ },
165
+ {
166
+ "inputs": [],
167
+ "name": "InvalidInitialization",
168
+ "type": "error"
169
+ },
170
+ {
171
+ "inputs": [],
172
+ "name": "NotInitializing",
173
+ "type": "error"
174
+ },
175
+ {
176
+ "inputs": [
177
+ {
178
+ "internalType": "address",
179
+ "name": "owner",
180
+ "type": "address"
181
+ }
182
+ ],
183
+ "name": "OwnableInvalidOwner",
184
+ "type": "error"
185
+ },
186
+ {
187
+ "inputs": [
188
+ {
189
+ "internalType": "address",
190
+ "name": "account",
191
+ "type": "address"
192
+ }
193
+ ],
194
+ "name": "OwnableUnauthorizedAccount",
195
+ "type": "error"
196
+ },
197
+ {
198
+ "inputs": [
199
+ {
200
+ "internalType": "address",
201
+ "name": "token",
202
+ "type": "address"
203
+ }
204
+ ],
205
+ "name": "SafeERC20FailedOperation",
206
+ "type": "error"
207
+ },
208
+ {
209
+ "inputs": [],
210
+ "name": "UUPSUnauthorizedCallContext",
211
+ "type": "error"
212
+ },
213
+ {
214
+ "inputs": [
215
+ {
216
+ "internalType": "bytes32",
217
+ "name": "slot",
218
+ "type": "bytes32"
219
+ }
220
+ ],
221
+ "name": "UUPSUnsupportedProxiableUUID",
222
+ "type": "error"
223
+ },
224
+ {
225
+ "anonymous": false,
226
+ "inputs": [
227
+ {
228
+ "indexed": true,
229
+ "internalType": "address",
230
+ "name": "owner",
231
+ "type": "address"
232
+ },
233
+ {
234
+ "indexed": true,
235
+ "internalType": "address",
236
+ "name": "spender",
237
+ "type": "address"
238
+ },
239
+ {
240
+ "indexed": false,
241
+ "internalType": "uint256",
242
+ "name": "value",
243
+ "type": "uint256"
244
+ }
245
+ ],
246
+ "name": "Approval",
247
+ "type": "event"
248
+ },
249
+ {
250
+ "anonymous": false,
251
+ "inputs": [
252
+ {
253
+ "indexed": true,
254
+ "internalType": "address",
255
+ "name": "newBridge",
256
+ "type": "address"
257
+ },
258
+ {
259
+ "indexed": true,
260
+ "internalType": "address",
261
+ "name": "oldBridge",
262
+ "type": "address"
263
+ }
264
+ ],
265
+ "name": "BridgeUpdated",
266
+ "type": "event"
267
+ },
268
+ {
269
+ "anonymous": false,
270
+ "inputs": [
271
+ {
272
+ "indexed": false,
273
+ "internalType": "uint64",
274
+ "name": "version",
275
+ "type": "uint64"
276
+ }
277
+ ],
278
+ "name": "Initialized",
279
+ "type": "event"
280
+ },
281
+ {
282
+ "anonymous": false,
283
+ "inputs": [
284
+ {
285
+ "indexed": true,
286
+ "internalType": "address",
287
+ "name": "previousOwner",
288
+ "type": "address"
289
+ },
290
+ {
291
+ "indexed": true,
292
+ "internalType": "address",
293
+ "name": "newOwner",
294
+ "type": "address"
295
+ }
296
+ ],
297
+ "name": "OwnershipTransferStarted",
298
+ "type": "event"
299
+ },
300
+ {
301
+ "anonymous": false,
302
+ "inputs": [
303
+ {
304
+ "indexed": true,
305
+ "internalType": "address",
306
+ "name": "previousOwner",
307
+ "type": "address"
308
+ },
309
+ {
310
+ "indexed": true,
311
+ "internalType": "address",
312
+ "name": "newOwner",
313
+ "type": "address"
314
+ }
315
+ ],
316
+ "name": "OwnershipTransferred",
317
+ "type": "event"
318
+ },
319
+ {
320
+ "anonymous": false,
321
+ "inputs": [
322
+ {
323
+ "indexed": false,
324
+ "internalType": "address",
325
+ "name": "account",
326
+ "type": "address"
327
+ }
328
+ ],
329
+ "name": "Paused",
330
+ "type": "event"
331
+ },
332
+ {
333
+ "anonymous": false,
334
+ "inputs": [
335
+ {
336
+ "indexed": true,
337
+ "internalType": "address",
338
+ "name": "from",
339
+ "type": "address"
340
+ },
341
+ {
342
+ "indexed": true,
343
+ "internalType": "address",
344
+ "name": "to",
345
+ "type": "address"
346
+ },
347
+ {
348
+ "indexed": false,
349
+ "internalType": "uint256",
350
+ "name": "value",
351
+ "type": "uint256"
352
+ }
353
+ ],
354
+ "name": "Transfer",
355
+ "type": "event"
356
+ },
357
+ {
358
+ "anonymous": false,
359
+ "inputs": [
360
+ {
361
+ "indexed": false,
362
+ "internalType": "address",
363
+ "name": "account",
364
+ "type": "address"
365
+ }
366
+ ],
367
+ "name": "Unpaused",
368
+ "type": "event"
369
+ },
370
+ {
371
+ "anonymous": false,
372
+ "inputs": [
373
+ {
374
+ "indexed": true,
375
+ "internalType": "address",
376
+ "name": "implementation",
377
+ "type": "address"
378
+ }
379
+ ],
380
+ "name": "Upgraded",
381
+ "type": "event"
382
+ },
383
+ {
384
+ "anonymous": false,
385
+ "inputs": [
386
+ {
387
+ "indexed": true,
388
+ "internalType": "address",
389
+ "name": "user",
390
+ "type": "address"
391
+ }
392
+ ],
393
+ "name": "UserLocked",
394
+ "type": "event"
395
+ },
396
+ {
397
+ "anonymous": false,
398
+ "inputs": [
399
+ {
400
+ "indexed": true,
401
+ "internalType": "address",
402
+ "name": "user",
403
+ "type": "address"
404
+ }
405
+ ],
406
+ "name": "UserUnlocked",
407
+ "type": "event"
408
+ },
409
+ {
410
+ "inputs": [],
411
+ "name": "UPGRADE_INTERFACE_VERSION",
412
+ "outputs": [
413
+ {
414
+ "internalType": "string",
415
+ "name": "",
416
+ "type": "string"
417
+ }
418
+ ],
419
+ "stateMutability": "view",
420
+ "type": "function"
421
+ },
422
+ {
423
+ "inputs": [],
424
+ "name": "acceptOwnership",
425
+ "outputs": [],
426
+ "stateMutability": "nonpayable",
427
+ "type": "function"
428
+ },
429
+ {
430
+ "inputs": [
431
+ {
432
+ "internalType": "address",
433
+ "name": "owner",
434
+ "type": "address"
435
+ },
436
+ {
437
+ "internalType": "address",
438
+ "name": "spender",
439
+ "type": "address"
440
+ }
441
+ ],
442
+ "name": "allowance",
443
+ "outputs": [
444
+ {
445
+ "internalType": "uint256",
446
+ "name": "",
447
+ "type": "uint256"
448
+ }
449
+ ],
450
+ "stateMutability": "view",
451
+ "type": "function"
452
+ },
453
+ {
454
+ "inputs": [
455
+ {
456
+ "internalType": "address",
457
+ "name": "spender",
458
+ "type": "address"
459
+ },
460
+ {
461
+ "internalType": "uint256",
462
+ "name": "value",
463
+ "type": "uint256"
464
+ }
465
+ ],
466
+ "name": "approve",
467
+ "outputs": [
468
+ {
469
+ "internalType": "bool",
470
+ "name": "",
471
+ "type": "bool"
472
+ }
473
+ ],
474
+ "stateMutability": "nonpayable",
475
+ "type": "function"
476
+ },
477
+ {
478
+ "inputs": [
479
+ {
480
+ "internalType": "address",
481
+ "name": "account",
482
+ "type": "address"
483
+ }
484
+ ],
485
+ "name": "balanceOf",
486
+ "outputs": [
487
+ {
488
+ "internalType": "uint256",
489
+ "name": "",
490
+ "type": "uint256"
491
+ }
492
+ ],
493
+ "stateMutability": "view",
494
+ "type": "function"
495
+ },
496
+ {
497
+ "inputs": [],
498
+ "name": "bridge",
499
+ "outputs": [
500
+ {
501
+ "internalType": "address",
502
+ "name": "",
503
+ "type": "address"
504
+ }
505
+ ],
506
+ "stateMutability": "view",
507
+ "type": "function"
508
+ },
509
+ {
510
+ "inputs": [
511
+ {
512
+ "internalType": "address",
513
+ "name": "from",
514
+ "type": "address"
515
+ },
516
+ {
517
+ "internalType": "uint256",
518
+ "name": "amount",
519
+ "type": "uint256"
520
+ }
521
+ ],
522
+ "name": "burn",
523
+ "outputs": [],
524
+ "stateMutability": "nonpayable",
525
+ "type": "function"
526
+ },
527
+ {
528
+ "inputs": [],
529
+ "name": "decimals",
530
+ "outputs": [
531
+ {
532
+ "internalType": "uint8",
533
+ "name": "",
534
+ "type": "uint8"
535
+ }
536
+ ],
537
+ "stateMutability": "pure",
538
+ "type": "function"
539
+ },
540
+ {
541
+ "inputs": [
542
+ {
543
+ "internalType": "address",
544
+ "name": "_owner",
545
+ "type": "address"
546
+ },
547
+ {
548
+ "internalType": "address",
549
+ "name": "_bridge",
550
+ "type": "address"
551
+ }
552
+ ],
553
+ "name": "initialize",
554
+ "outputs": [],
555
+ "stateMutability": "nonpayable",
556
+ "type": "function"
557
+ },
558
+ {
559
+ "inputs": [
560
+ {
561
+ "internalType": "address",
562
+ "name": "_user",
563
+ "type": "address"
564
+ }
565
+ ],
566
+ "name": "lockUser",
567
+ "outputs": [],
568
+ "stateMutability": "nonpayable",
569
+ "type": "function"
570
+ },
571
+ {
572
+ "inputs": [
573
+ {
574
+ "internalType": "address",
575
+ "name": "to",
576
+ "type": "address"
577
+ },
578
+ {
579
+ "internalType": "uint256",
580
+ "name": "amount",
581
+ "type": "uint256"
582
+ }
583
+ ],
584
+ "name": "mint",
585
+ "outputs": [],
586
+ "stateMutability": "nonpayable",
587
+ "type": "function"
588
+ },
589
+ {
590
+ "inputs": [],
591
+ "name": "name",
592
+ "outputs": [
593
+ {
594
+ "internalType": "string",
595
+ "name": "",
596
+ "type": "string"
597
+ }
598
+ ],
599
+ "stateMutability": "view",
600
+ "type": "function"
601
+ },
602
+ {
603
+ "inputs": [],
604
+ "name": "owner",
605
+ "outputs": [
606
+ {
607
+ "internalType": "address",
608
+ "name": "",
609
+ "type": "address"
610
+ }
611
+ ],
612
+ "stateMutability": "view",
613
+ "type": "function"
614
+ },
615
+ {
616
+ "inputs": [],
617
+ "name": "pause",
618
+ "outputs": [],
619
+ "stateMutability": "nonpayable",
620
+ "type": "function"
621
+ },
622
+ {
623
+ "inputs": [],
624
+ "name": "paused",
625
+ "outputs": [
626
+ {
627
+ "internalType": "bool",
628
+ "name": "",
629
+ "type": "bool"
630
+ }
631
+ ],
632
+ "stateMutability": "view",
633
+ "type": "function"
634
+ },
635
+ {
636
+ "inputs": [
637
+ {
638
+ "internalType": "address",
639
+ "name": "payer",
640
+ "type": "address"
641
+ },
642
+ {
643
+ "internalType": "address",
644
+ "name": "feeRecipient",
645
+ "type": "address"
646
+ },
647
+ {
648
+ "internalType": "uint256",
649
+ "name": "amount",
650
+ "type": "uint256"
651
+ }
652
+ ],
653
+ "name": "payFee",
654
+ "outputs": [],
655
+ "stateMutability": "nonpayable",
656
+ "type": "function"
657
+ },
658
+ {
659
+ "inputs": [],
660
+ "name": "pendingOwner",
661
+ "outputs": [
662
+ {
663
+ "internalType": "address",
664
+ "name": "",
665
+ "type": "address"
666
+ }
667
+ ],
668
+ "stateMutability": "view",
669
+ "type": "function"
670
+ },
671
+ {
672
+ "inputs": [],
673
+ "name": "proxiableUUID",
674
+ "outputs": [
675
+ {
676
+ "internalType": "bytes32",
677
+ "name": "",
678
+ "type": "bytes32"
679
+ }
680
+ ],
681
+ "stateMutability": "view",
682
+ "type": "function"
683
+ },
684
+ {
685
+ "inputs": [],
686
+ "name": "renounceOwnership",
687
+ "outputs": [],
688
+ "stateMutability": "nonpayable",
689
+ "type": "function"
690
+ },
691
+ {
692
+ "inputs": [
693
+ {
694
+ "internalType": "address",
695
+ "name": "token",
696
+ "type": "address"
697
+ },
698
+ {
699
+ "internalType": "address",
700
+ "name": "to",
701
+ "type": "address"
702
+ }
703
+ ],
704
+ "name": "rescue",
705
+ "outputs": [],
706
+ "stateMutability": "nonpayable",
707
+ "type": "function"
708
+ },
709
+ {
710
+ "inputs": [
711
+ {
712
+ "internalType": "address",
713
+ "name": "_bridge",
714
+ "type": "address"
715
+ }
716
+ ],
717
+ "name": "setBridge",
718
+ "outputs": [],
719
+ "stateMutability": "nonpayable",
720
+ "type": "function"
721
+ },
722
+ {
723
+ "inputs": [],
724
+ "name": "symbol",
725
+ "outputs": [
726
+ {
727
+ "internalType": "string",
728
+ "name": "",
729
+ "type": "string"
730
+ }
731
+ ],
732
+ "stateMutability": "view",
733
+ "type": "function"
734
+ },
735
+ {
736
+ "inputs": [],
737
+ "name": "totalSupply",
738
+ "outputs": [
739
+ {
740
+ "internalType": "uint256",
741
+ "name": "",
742
+ "type": "uint256"
743
+ }
744
+ ],
745
+ "stateMutability": "view",
746
+ "type": "function"
747
+ },
748
+ {
749
+ "inputs": [
750
+ {
751
+ "internalType": "address",
752
+ "name": "to",
753
+ "type": "address"
754
+ },
755
+ {
756
+ "internalType": "uint256",
757
+ "name": "value",
758
+ "type": "uint256"
759
+ }
760
+ ],
761
+ "name": "transfer",
762
+ "outputs": [
763
+ {
764
+ "internalType": "bool",
765
+ "name": "",
766
+ "type": "bool"
767
+ }
768
+ ],
769
+ "stateMutability": "nonpayable",
770
+ "type": "function"
771
+ },
772
+ {
773
+ "inputs": [
774
+ {
775
+ "internalType": "address",
776
+ "name": "from",
777
+ "type": "address"
778
+ },
779
+ {
780
+ "internalType": "address",
781
+ "name": "to",
782
+ "type": "address"
783
+ },
784
+ {
785
+ "internalType": "uint256",
786
+ "name": "value",
787
+ "type": "uint256"
788
+ }
789
+ ],
790
+ "name": "transferFrom",
791
+ "outputs": [
792
+ {
793
+ "internalType": "bool",
794
+ "name": "",
795
+ "type": "bool"
796
+ }
797
+ ],
798
+ "stateMutability": "nonpayable",
799
+ "type": "function"
800
+ },
801
+ {
802
+ "inputs": [
803
+ {
804
+ "internalType": "address",
805
+ "name": "newOwner",
806
+ "type": "address"
807
+ }
808
+ ],
809
+ "name": "transferOwnership",
810
+ "outputs": [],
811
+ "stateMutability": "nonpayable",
812
+ "type": "function"
813
+ },
814
+ {
815
+ "inputs": [
816
+ {
817
+ "internalType": "address",
818
+ "name": "_user",
819
+ "type": "address"
820
+ }
821
+ ],
822
+ "name": "unlockUser",
823
+ "outputs": [],
824
+ "stateMutability": "nonpayable",
825
+ "type": "function"
826
+ },
827
+ {
828
+ "inputs": [],
829
+ "name": "unpause",
830
+ "outputs": [],
831
+ "stateMutability": "nonpayable",
832
+ "type": "function"
833
+ },
834
+ {
835
+ "inputs": [
836
+ {
837
+ "internalType": "address",
838
+ "name": "newImplementation",
839
+ "type": "address"
840
+ },
841
+ {
842
+ "internalType": "bytes",
843
+ "name": "data",
844
+ "type": "bytes"
845
+ }
846
+ ],
847
+ "name": "upgradeToAndCall",
848
+ "outputs": [],
849
+ "stateMutability": "payable",
850
+ "type": "function"
851
+ },
852
+ {
853
+ "inputs": [
854
+ {
855
+ "internalType": "address",
856
+ "name": "user",
857
+ "type": "address"
858
+ }
859
+ ],
860
+ "name": "userBlocked",
861
+ "outputs": [
862
+ {
863
+ "internalType": "bool",
864
+ "name": "blocked",
865
+ "type": "bool"
866
+ }
867
+ ],
868
+ "stateMutability": "view",
869
+ "type": "function"
870
+ }
871
+ ] as const satisfies Abi;
872
+
873
+ /**
874
+ * Type-safe ABI for FBTC_json
875
+ */
876
+ export type FBTC_jsonAbi = typeof FBTC_jsonAbi;
877
+
878
+ /**
879
+ * Contract instance type for FBTC_json
880
+ */
881
+ // Use any for contract type to avoid complex viem type issues
882
+ // The runtime behavior is type-safe through viem's ABI typing
883
+ export type FBTC_jsonContract = any;
884
+
885
+ /**
886
+ * FBTC_json Contract Class
887
+ *
888
+ * Provides a class-based API similar to TypeChain for interacting with the contract.
889
+ *
890
+ * @example
891
+ * ```typescript
892
+ * import { createPublicClient, createWalletClient, http } from 'viem';
893
+ * import { mainnet } from 'viem/chains';
894
+ * import { FBTC_json } from 'FBTC_json';
895
+ *
896
+ * const publicClient = createPublicClient({ chain: mainnet, transport: http() });
897
+ * const walletClient = createWalletClient({ chain: mainnet, transport: http() });
898
+ *
899
+ * const contract = new FBTC_json('0x...', { publicClient, walletClient });
900
+ *
901
+ * // Read functions
902
+ * const result = await contract.balanceOf('0x...');
903
+ *
904
+ * // Write functions
905
+ * const hash = await contract.transfer('0x...', 1000n);
906
+ *
907
+ * // Simulate transactions (dry-run)
908
+ * const simulation = await contract.simulate.transfer('0x...', 1000n);
909
+ * console.log('Gas estimate:', simulation.request.gas);
910
+ *
911
+ * // Watch events
912
+ * const unwatch = contract.watch.Transfer((event) => {
913
+ * console.log('Transfer event:', event);
914
+ * });
915
+ * ```
916
+ */
917
+ export class FBTC_json {
918
+ private contract: FBTC_jsonContract;
919
+ private contractAddress: Address;
920
+ private publicClient: PublicClient;
921
+
922
+ constructor(
923
+ address: Address,
924
+ clients: {
925
+ publicClient: PublicClient;
926
+ walletClient?: WalletClient;
927
+ }
928
+ ) {
929
+ this.contractAddress = address;
930
+ this.publicClient = clients.publicClient;
931
+ this.contract = getContract({
932
+ address,
933
+ abi: FBTC_jsonAbi,
934
+ client: {
935
+ public: clients.publicClient,
936
+ wallet: clients.walletClient,
937
+ },
938
+ });
939
+ }
940
+
941
+ /**
942
+ * Get the contract address
943
+ */
944
+ get address(): Address {
945
+ return this.contractAddress;
946
+ }
947
+
948
+ /**
949
+ * Get the underlying viem contract instance
950
+ */
951
+ getContract(): FBTC_jsonContract {
952
+ return this.contract;
953
+ }
954
+
955
+ /**
956
+ * UPGRADE_INTERFACE_VERSION
957
+ * view
958
+ */
959
+ async UPGRADE_INTERFACE_VERSION(): Promise<string> {
960
+ return this.contract.read.UPGRADE_INTERFACE_VERSION() as Promise<string>;
961
+ }
962
+
963
+ /**
964
+ * allowance
965
+ * view
966
+ */
967
+ async allowance(owner: `0x${string}`, spender: `0x${string}`): Promise<bigint> {
968
+ return this.contract.read.allowance([owner, spender] as const) as Promise<bigint>;
969
+ }
970
+
971
+ /**
972
+ * balanceOf
973
+ * view
974
+ */
975
+ async balanceOf(account: `0x${string}`): Promise<bigint> {
976
+ return this.contract.read.balanceOf([account] as const) as Promise<bigint>;
977
+ }
978
+
979
+ /**
980
+ * bridge
981
+ * view
982
+ */
983
+ async bridge(): Promise<`0x${string}`> {
984
+ return this.contract.read.bridge() as Promise<`0x${string}`>;
985
+ }
986
+
987
+ /**
988
+ * decimals
989
+ * pure
990
+ */
991
+ async decimals(): Promise<bigint> {
992
+ return this.contract.read.decimals() as Promise<bigint>;
993
+ }
994
+
995
+ /**
996
+ * name
997
+ * view
998
+ */
999
+ async name(): Promise<string> {
1000
+ return this.contract.read.name() as Promise<string>;
1001
+ }
1002
+
1003
+ /**
1004
+ * owner
1005
+ * view
1006
+ */
1007
+ async owner(): Promise<`0x${string}`> {
1008
+ return this.contract.read.owner() as Promise<`0x${string}`>;
1009
+ }
1010
+
1011
+ /**
1012
+ * paused
1013
+ * view
1014
+ */
1015
+ async paused(): Promise<boolean> {
1016
+ return this.contract.read.paused() as Promise<boolean>;
1017
+ }
1018
+
1019
+ /**
1020
+ * pendingOwner
1021
+ * view
1022
+ */
1023
+ async pendingOwner(): Promise<`0x${string}`> {
1024
+ return this.contract.read.pendingOwner() as Promise<`0x${string}`>;
1025
+ }
1026
+
1027
+ /**
1028
+ * proxiableUUID
1029
+ * view
1030
+ */
1031
+ async proxiableUUID(): Promise<`0x${string}`> {
1032
+ return this.contract.read.proxiableUUID() as Promise<`0x${string}`>;
1033
+ }
1034
+
1035
+ /**
1036
+ * symbol
1037
+ * view
1038
+ */
1039
+ async symbol(): Promise<string> {
1040
+ return this.contract.read.symbol() as Promise<string>;
1041
+ }
1042
+
1043
+ /**
1044
+ * totalSupply
1045
+ * view
1046
+ */
1047
+ async totalSupply(): Promise<bigint> {
1048
+ return this.contract.read.totalSupply() as Promise<bigint>;
1049
+ }
1050
+
1051
+ /**
1052
+ * userBlocked
1053
+ * view
1054
+ */
1055
+ async userBlocked(user: `0x${string}`): Promise<boolean> {
1056
+ return this.contract.read.userBlocked([user] as const) as Promise<boolean>;
1057
+ }
1058
+
1059
+ /**
1060
+ * acceptOwnership
1061
+ * nonpayable
1062
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1063
+ */
1064
+ async acceptOwnership(options?: {
1065
+ accessList?: import('viem').AccessList;
1066
+ authorizationList?: import('viem').AuthorizationList;
1067
+ chain?: import('viem').Chain | null;
1068
+ dataSuffix?: `0x${string}`;
1069
+ gas?: bigint;
1070
+ gasPrice?: bigint;
1071
+ maxFeePerGas?: bigint;
1072
+ maxPriorityFeePerGas?: bigint;
1073
+ nonce?: number;
1074
+ value?: bigint;
1075
+ }): Promise<`0x${string}`> {
1076
+ if (!this.contract.write) {
1077
+ throw new Error('Wallet client is required for write operations');
1078
+ }
1079
+ return this.contract.write.acceptOwnership(options) as Promise<`0x${string}`>;
1080
+ }
1081
+
1082
+ /**
1083
+ * approve
1084
+ * nonpayable
1085
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1086
+ */
1087
+ async approve(spender: `0x${string}`, value: bigint, options?: {
1088
+ accessList?: import('viem').AccessList;
1089
+ authorizationList?: import('viem').AuthorizationList;
1090
+ chain?: import('viem').Chain | null;
1091
+ dataSuffix?: `0x${string}`;
1092
+ gas?: bigint;
1093
+ gasPrice?: bigint;
1094
+ maxFeePerGas?: bigint;
1095
+ maxPriorityFeePerGas?: bigint;
1096
+ nonce?: number;
1097
+ value?: bigint;
1098
+ }): Promise<`0x${string}`> {
1099
+ if (!this.contract.write) {
1100
+ throw new Error('Wallet client is required for write operations');
1101
+ }
1102
+ return this.contract.write.approve([spender, value] as const, options) as Promise<`0x${string}`>;
1103
+ }
1104
+
1105
+ /**
1106
+ * burn
1107
+ * nonpayable
1108
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1109
+ */
1110
+ async burn(from: `0x${string}`, amount: bigint, options?: {
1111
+ accessList?: import('viem').AccessList;
1112
+ authorizationList?: import('viem').AuthorizationList;
1113
+ chain?: import('viem').Chain | null;
1114
+ dataSuffix?: `0x${string}`;
1115
+ gas?: bigint;
1116
+ gasPrice?: bigint;
1117
+ maxFeePerGas?: bigint;
1118
+ maxPriorityFeePerGas?: bigint;
1119
+ nonce?: number;
1120
+ value?: bigint;
1121
+ }): Promise<`0x${string}`> {
1122
+ if (!this.contract.write) {
1123
+ throw new Error('Wallet client is required for write operations');
1124
+ }
1125
+ return this.contract.write.burn([from, amount] as const, options) as Promise<`0x${string}`>;
1126
+ }
1127
+
1128
+ /**
1129
+ * initialize
1130
+ * nonpayable
1131
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1132
+ */
1133
+ async initialize(_owner: `0x${string}`, _bridge: `0x${string}`, options?: {
1134
+ accessList?: import('viem').AccessList;
1135
+ authorizationList?: import('viem').AuthorizationList;
1136
+ chain?: import('viem').Chain | null;
1137
+ dataSuffix?: `0x${string}`;
1138
+ gas?: bigint;
1139
+ gasPrice?: bigint;
1140
+ maxFeePerGas?: bigint;
1141
+ maxPriorityFeePerGas?: bigint;
1142
+ nonce?: number;
1143
+ value?: bigint;
1144
+ }): Promise<`0x${string}`> {
1145
+ if (!this.contract.write) {
1146
+ throw new Error('Wallet client is required for write operations');
1147
+ }
1148
+ return this.contract.write.initialize([_owner, _bridge] as const, options) as Promise<`0x${string}`>;
1149
+ }
1150
+
1151
+ /**
1152
+ * lockUser
1153
+ * nonpayable
1154
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1155
+ */
1156
+ async lockUser(_user: `0x${string}`, options?: {
1157
+ accessList?: import('viem').AccessList;
1158
+ authorizationList?: import('viem').AuthorizationList;
1159
+ chain?: import('viem').Chain | null;
1160
+ dataSuffix?: `0x${string}`;
1161
+ gas?: bigint;
1162
+ gasPrice?: bigint;
1163
+ maxFeePerGas?: bigint;
1164
+ maxPriorityFeePerGas?: bigint;
1165
+ nonce?: number;
1166
+ value?: bigint;
1167
+ }): Promise<`0x${string}`> {
1168
+ if (!this.contract.write) {
1169
+ throw new Error('Wallet client is required for write operations');
1170
+ }
1171
+ return this.contract.write.lockUser([_user] as const, options) as Promise<`0x${string}`>;
1172
+ }
1173
+
1174
+ /**
1175
+ * mint
1176
+ * nonpayable
1177
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1178
+ */
1179
+ async mint(to: `0x${string}`, amount: bigint, options?: {
1180
+ accessList?: import('viem').AccessList;
1181
+ authorizationList?: import('viem').AuthorizationList;
1182
+ chain?: import('viem').Chain | null;
1183
+ dataSuffix?: `0x${string}`;
1184
+ gas?: bigint;
1185
+ gasPrice?: bigint;
1186
+ maxFeePerGas?: bigint;
1187
+ maxPriorityFeePerGas?: bigint;
1188
+ nonce?: number;
1189
+ value?: bigint;
1190
+ }): Promise<`0x${string}`> {
1191
+ if (!this.contract.write) {
1192
+ throw new Error('Wallet client is required for write operations');
1193
+ }
1194
+ return this.contract.write.mint([to, amount] as const, options) as Promise<`0x${string}`>;
1195
+ }
1196
+
1197
+ /**
1198
+ * pause
1199
+ * nonpayable
1200
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1201
+ */
1202
+ async pause(options?: {
1203
+ accessList?: import('viem').AccessList;
1204
+ authorizationList?: import('viem').AuthorizationList;
1205
+ chain?: import('viem').Chain | null;
1206
+ dataSuffix?: `0x${string}`;
1207
+ gas?: bigint;
1208
+ gasPrice?: bigint;
1209
+ maxFeePerGas?: bigint;
1210
+ maxPriorityFeePerGas?: bigint;
1211
+ nonce?: number;
1212
+ value?: bigint;
1213
+ }): Promise<`0x${string}`> {
1214
+ if (!this.contract.write) {
1215
+ throw new Error('Wallet client is required for write operations');
1216
+ }
1217
+ return this.contract.write.pause(options) as Promise<`0x${string}`>;
1218
+ }
1219
+
1220
+ /**
1221
+ * payFee
1222
+ * nonpayable
1223
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1224
+ */
1225
+ async payFee(payer: `0x${string}`, feeRecipient: `0x${string}`, amount: bigint, options?: {
1226
+ accessList?: import('viem').AccessList;
1227
+ authorizationList?: import('viem').AuthorizationList;
1228
+ chain?: import('viem').Chain | null;
1229
+ dataSuffix?: `0x${string}`;
1230
+ gas?: bigint;
1231
+ gasPrice?: bigint;
1232
+ maxFeePerGas?: bigint;
1233
+ maxPriorityFeePerGas?: bigint;
1234
+ nonce?: number;
1235
+ value?: bigint;
1236
+ }): Promise<`0x${string}`> {
1237
+ if (!this.contract.write) {
1238
+ throw new Error('Wallet client is required for write operations');
1239
+ }
1240
+ return this.contract.write.payFee([payer, feeRecipient, amount] as const, options) as Promise<`0x${string}`>;
1241
+ }
1242
+
1243
+ /**
1244
+ * renounceOwnership
1245
+ * nonpayable
1246
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1247
+ */
1248
+ async renounceOwnership(options?: {
1249
+ accessList?: import('viem').AccessList;
1250
+ authorizationList?: import('viem').AuthorizationList;
1251
+ chain?: import('viem').Chain | null;
1252
+ dataSuffix?: `0x${string}`;
1253
+ gas?: bigint;
1254
+ gasPrice?: bigint;
1255
+ maxFeePerGas?: bigint;
1256
+ maxPriorityFeePerGas?: bigint;
1257
+ nonce?: number;
1258
+ value?: bigint;
1259
+ }): Promise<`0x${string}`> {
1260
+ if (!this.contract.write) {
1261
+ throw new Error('Wallet client is required for write operations');
1262
+ }
1263
+ return this.contract.write.renounceOwnership(options) as Promise<`0x${string}`>;
1264
+ }
1265
+
1266
+ /**
1267
+ * rescue
1268
+ * nonpayable
1269
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1270
+ */
1271
+ async rescue(token: `0x${string}`, to: `0x${string}`, options?: {
1272
+ accessList?: import('viem').AccessList;
1273
+ authorizationList?: import('viem').AuthorizationList;
1274
+ chain?: import('viem').Chain | null;
1275
+ dataSuffix?: `0x${string}`;
1276
+ gas?: bigint;
1277
+ gasPrice?: bigint;
1278
+ maxFeePerGas?: bigint;
1279
+ maxPriorityFeePerGas?: bigint;
1280
+ nonce?: number;
1281
+ value?: bigint;
1282
+ }): Promise<`0x${string}`> {
1283
+ if (!this.contract.write) {
1284
+ throw new Error('Wallet client is required for write operations');
1285
+ }
1286
+ return this.contract.write.rescue([token, to] as const, options) as Promise<`0x${string}`>;
1287
+ }
1288
+
1289
+ /**
1290
+ * setBridge
1291
+ * nonpayable
1292
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1293
+ */
1294
+ async setBridge(_bridge: `0x${string}`, options?: {
1295
+ accessList?: import('viem').AccessList;
1296
+ authorizationList?: import('viem').AuthorizationList;
1297
+ chain?: import('viem').Chain | null;
1298
+ dataSuffix?: `0x${string}`;
1299
+ gas?: bigint;
1300
+ gasPrice?: bigint;
1301
+ maxFeePerGas?: bigint;
1302
+ maxPriorityFeePerGas?: bigint;
1303
+ nonce?: number;
1304
+ value?: bigint;
1305
+ }): Promise<`0x${string}`> {
1306
+ if (!this.contract.write) {
1307
+ throw new Error('Wallet client is required for write operations');
1308
+ }
1309
+ return this.contract.write.setBridge([_bridge] as const, options) as Promise<`0x${string}`>;
1310
+ }
1311
+
1312
+ /**
1313
+ * transfer
1314
+ * nonpayable
1315
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1316
+ */
1317
+ async transfer(to: `0x${string}`, value: bigint, options?: {
1318
+ accessList?: import('viem').AccessList;
1319
+ authorizationList?: import('viem').AuthorizationList;
1320
+ chain?: import('viem').Chain | null;
1321
+ dataSuffix?: `0x${string}`;
1322
+ gas?: bigint;
1323
+ gasPrice?: bigint;
1324
+ maxFeePerGas?: bigint;
1325
+ maxPriorityFeePerGas?: bigint;
1326
+ nonce?: number;
1327
+ value?: bigint;
1328
+ }): Promise<`0x${string}`> {
1329
+ if (!this.contract.write) {
1330
+ throw new Error('Wallet client is required for write operations');
1331
+ }
1332
+ return this.contract.write.transfer([to, value] as const, options) as Promise<`0x${string}`>;
1333
+ }
1334
+
1335
+ /**
1336
+ * transferFrom
1337
+ * nonpayable
1338
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1339
+ */
1340
+ async transferFrom(from: `0x${string}`, to: `0x${string}`, value: bigint, options?: {
1341
+ accessList?: import('viem').AccessList;
1342
+ authorizationList?: import('viem').AuthorizationList;
1343
+ chain?: import('viem').Chain | null;
1344
+ dataSuffix?: `0x${string}`;
1345
+ gas?: bigint;
1346
+ gasPrice?: bigint;
1347
+ maxFeePerGas?: bigint;
1348
+ maxPriorityFeePerGas?: bigint;
1349
+ nonce?: number;
1350
+ value?: bigint;
1351
+ }): Promise<`0x${string}`> {
1352
+ if (!this.contract.write) {
1353
+ throw new Error('Wallet client is required for write operations');
1354
+ }
1355
+ return this.contract.write.transferFrom([from, to, value] as const, options) as Promise<`0x${string}`>;
1356
+ }
1357
+
1358
+ /**
1359
+ * transferOwnership
1360
+ * nonpayable
1361
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1362
+ */
1363
+ async transferOwnership(newOwner: `0x${string}`, options?: {
1364
+ accessList?: import('viem').AccessList;
1365
+ authorizationList?: import('viem').AuthorizationList;
1366
+ chain?: import('viem').Chain | null;
1367
+ dataSuffix?: `0x${string}`;
1368
+ gas?: bigint;
1369
+ gasPrice?: bigint;
1370
+ maxFeePerGas?: bigint;
1371
+ maxPriorityFeePerGas?: bigint;
1372
+ nonce?: number;
1373
+ value?: bigint;
1374
+ }): Promise<`0x${string}`> {
1375
+ if (!this.contract.write) {
1376
+ throw new Error('Wallet client is required for write operations');
1377
+ }
1378
+ return this.contract.write.transferOwnership([newOwner] as const, options) as Promise<`0x${string}`>;
1379
+ }
1380
+
1381
+ /**
1382
+ * unlockUser
1383
+ * nonpayable
1384
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1385
+ */
1386
+ async unlockUser(_user: `0x${string}`, options?: {
1387
+ accessList?: import('viem').AccessList;
1388
+ authorizationList?: import('viem').AuthorizationList;
1389
+ chain?: import('viem').Chain | null;
1390
+ dataSuffix?: `0x${string}`;
1391
+ gas?: bigint;
1392
+ gasPrice?: bigint;
1393
+ maxFeePerGas?: bigint;
1394
+ maxPriorityFeePerGas?: bigint;
1395
+ nonce?: number;
1396
+ value?: bigint;
1397
+ }): Promise<`0x${string}`> {
1398
+ if (!this.contract.write) {
1399
+ throw new Error('Wallet client is required for write operations');
1400
+ }
1401
+ return this.contract.write.unlockUser([_user] as const, options) as Promise<`0x${string}`>;
1402
+ }
1403
+
1404
+ /**
1405
+ * unpause
1406
+ * nonpayable
1407
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1408
+ */
1409
+ async unpause(options?: {
1410
+ accessList?: import('viem').AccessList;
1411
+ authorizationList?: import('viem').AuthorizationList;
1412
+ chain?: import('viem').Chain | null;
1413
+ dataSuffix?: `0x${string}`;
1414
+ gas?: bigint;
1415
+ gasPrice?: bigint;
1416
+ maxFeePerGas?: bigint;
1417
+ maxPriorityFeePerGas?: bigint;
1418
+ nonce?: number;
1419
+ value?: bigint;
1420
+ }): Promise<`0x${string}`> {
1421
+ if (!this.contract.write) {
1422
+ throw new Error('Wallet client is required for write operations');
1423
+ }
1424
+ return this.contract.write.unpause(options) as Promise<`0x${string}`>;
1425
+ }
1426
+
1427
+ /**
1428
+ * upgradeToAndCall
1429
+ * payable
1430
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1431
+ */
1432
+ async upgradeToAndCall(newImplementation: `0x${string}`, data: `0x${string}`, options?: {
1433
+ accessList?: import('viem').AccessList;
1434
+ authorizationList?: import('viem').AuthorizationList;
1435
+ chain?: import('viem').Chain | null;
1436
+ dataSuffix?: `0x${string}`;
1437
+ gas?: bigint;
1438
+ gasPrice?: bigint;
1439
+ maxFeePerGas?: bigint;
1440
+ maxPriorityFeePerGas?: bigint;
1441
+ nonce?: number;
1442
+ value?: bigint;
1443
+ }): Promise<`0x${string}`> {
1444
+ if (!this.contract.write) {
1445
+ throw new Error('Wallet client is required for write operations');
1446
+ }
1447
+ return this.contract.write.upgradeToAndCall([newImplementation, data] as const, options) as Promise<`0x${string}`>;
1448
+ }
1449
+
1450
+
1451
+
1452
+ /**
1453
+ * Simulate contract write operations (dry-run without sending transaction)
1454
+ *
1455
+ * @example
1456
+ * const result = await contract.simulate.transfer('0x...', 1000n);
1457
+ * console.log('Gas estimate:', result.request.gas);
1458
+ * console.log('Would succeed:', result.result);
1459
+ */
1460
+ get simulate() {
1461
+ const contract = this.contract;
1462
+ if (!contract.simulate) {
1463
+ throw new Error('Public client is required for simulation');
1464
+ }
1465
+ return {
1466
+ /**
1467
+ * Simulate acceptOwnership
1468
+ * Returns gas estimate and result without sending transaction
1469
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1470
+ */
1471
+ async acceptOwnership(options?: {
1472
+ accessList?: import('viem').AccessList;
1473
+ authorizationList?: import('viem').AuthorizationList;
1474
+ chain?: import('viem').Chain | null;
1475
+ dataSuffix?: `0x${string}`;
1476
+ gas?: bigint;
1477
+ gasPrice?: bigint;
1478
+ maxFeePerGas?: bigint;
1479
+ maxPriorityFeePerGas?: bigint;
1480
+ nonce?: number;
1481
+ value?: bigint;
1482
+ }): Promise<void> {
1483
+ return contract.simulate.acceptOwnership(options) as Promise<void>;
1484
+ },
1485
+ /**
1486
+ * Simulate approve
1487
+ * Returns gas estimate and result without sending transaction
1488
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1489
+ */
1490
+ async approve(spender: `0x${string}`, value: bigint, options?: {
1491
+ accessList?: import('viem').AccessList;
1492
+ authorizationList?: import('viem').AuthorizationList;
1493
+ chain?: import('viem').Chain | null;
1494
+ dataSuffix?: `0x${string}`;
1495
+ gas?: bigint;
1496
+ gasPrice?: bigint;
1497
+ maxFeePerGas?: bigint;
1498
+ maxPriorityFeePerGas?: bigint;
1499
+ nonce?: number;
1500
+ value?: bigint;
1501
+ }): Promise<boolean> {
1502
+ return contract.simulate.approve([spender, value] as const, options) as Promise<boolean>;
1503
+ },
1504
+ /**
1505
+ * Simulate burn
1506
+ * Returns gas estimate and result without sending transaction
1507
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1508
+ */
1509
+ async burn(from: `0x${string}`, amount: bigint, options?: {
1510
+ accessList?: import('viem').AccessList;
1511
+ authorizationList?: import('viem').AuthorizationList;
1512
+ chain?: import('viem').Chain | null;
1513
+ dataSuffix?: `0x${string}`;
1514
+ gas?: bigint;
1515
+ gasPrice?: bigint;
1516
+ maxFeePerGas?: bigint;
1517
+ maxPriorityFeePerGas?: bigint;
1518
+ nonce?: number;
1519
+ value?: bigint;
1520
+ }): Promise<void> {
1521
+ return contract.simulate.burn([from, amount] as const, options) as Promise<void>;
1522
+ },
1523
+ /**
1524
+ * Simulate initialize
1525
+ * Returns gas estimate and result without sending transaction
1526
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1527
+ */
1528
+ async initialize(_owner: `0x${string}`, _bridge: `0x${string}`, options?: {
1529
+ accessList?: import('viem').AccessList;
1530
+ authorizationList?: import('viem').AuthorizationList;
1531
+ chain?: import('viem').Chain | null;
1532
+ dataSuffix?: `0x${string}`;
1533
+ gas?: bigint;
1534
+ gasPrice?: bigint;
1535
+ maxFeePerGas?: bigint;
1536
+ maxPriorityFeePerGas?: bigint;
1537
+ nonce?: number;
1538
+ value?: bigint;
1539
+ }): Promise<void> {
1540
+ return contract.simulate.initialize([_owner, _bridge] as const, options) as Promise<void>;
1541
+ },
1542
+ /**
1543
+ * Simulate lockUser
1544
+ * Returns gas estimate and result without sending transaction
1545
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1546
+ */
1547
+ async lockUser(_user: `0x${string}`, options?: {
1548
+ accessList?: import('viem').AccessList;
1549
+ authorizationList?: import('viem').AuthorizationList;
1550
+ chain?: import('viem').Chain | null;
1551
+ dataSuffix?: `0x${string}`;
1552
+ gas?: bigint;
1553
+ gasPrice?: bigint;
1554
+ maxFeePerGas?: bigint;
1555
+ maxPriorityFeePerGas?: bigint;
1556
+ nonce?: number;
1557
+ value?: bigint;
1558
+ }): Promise<void> {
1559
+ return contract.simulate.lockUser([_user] as const, options) as Promise<void>;
1560
+ },
1561
+ /**
1562
+ * Simulate mint
1563
+ * Returns gas estimate and result without sending transaction
1564
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1565
+ */
1566
+ async mint(to: `0x${string}`, amount: bigint, options?: {
1567
+ accessList?: import('viem').AccessList;
1568
+ authorizationList?: import('viem').AuthorizationList;
1569
+ chain?: import('viem').Chain | null;
1570
+ dataSuffix?: `0x${string}`;
1571
+ gas?: bigint;
1572
+ gasPrice?: bigint;
1573
+ maxFeePerGas?: bigint;
1574
+ maxPriorityFeePerGas?: bigint;
1575
+ nonce?: number;
1576
+ value?: bigint;
1577
+ }): Promise<void> {
1578
+ return contract.simulate.mint([to, amount] as const, options) as Promise<void>;
1579
+ },
1580
+ /**
1581
+ * Simulate pause
1582
+ * Returns gas estimate and result without sending transaction
1583
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1584
+ */
1585
+ async pause(options?: {
1586
+ accessList?: import('viem').AccessList;
1587
+ authorizationList?: import('viem').AuthorizationList;
1588
+ chain?: import('viem').Chain | null;
1589
+ dataSuffix?: `0x${string}`;
1590
+ gas?: bigint;
1591
+ gasPrice?: bigint;
1592
+ maxFeePerGas?: bigint;
1593
+ maxPriorityFeePerGas?: bigint;
1594
+ nonce?: number;
1595
+ value?: bigint;
1596
+ }): Promise<void> {
1597
+ return contract.simulate.pause(options) as Promise<void>;
1598
+ },
1599
+ /**
1600
+ * Simulate payFee
1601
+ * Returns gas estimate and result without sending transaction
1602
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1603
+ */
1604
+ async payFee(payer: `0x${string}`, feeRecipient: `0x${string}`, amount: bigint, options?: {
1605
+ accessList?: import('viem').AccessList;
1606
+ authorizationList?: import('viem').AuthorizationList;
1607
+ chain?: import('viem').Chain | null;
1608
+ dataSuffix?: `0x${string}`;
1609
+ gas?: bigint;
1610
+ gasPrice?: bigint;
1611
+ maxFeePerGas?: bigint;
1612
+ maxPriorityFeePerGas?: bigint;
1613
+ nonce?: number;
1614
+ value?: bigint;
1615
+ }): Promise<void> {
1616
+ return contract.simulate.payFee([payer, feeRecipient, amount] as const, options) as Promise<void>;
1617
+ },
1618
+ /**
1619
+ * Simulate renounceOwnership
1620
+ * Returns gas estimate and result without sending transaction
1621
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1622
+ */
1623
+ async renounceOwnership(options?: {
1624
+ accessList?: import('viem').AccessList;
1625
+ authorizationList?: import('viem').AuthorizationList;
1626
+ chain?: import('viem').Chain | null;
1627
+ dataSuffix?: `0x${string}`;
1628
+ gas?: bigint;
1629
+ gasPrice?: bigint;
1630
+ maxFeePerGas?: bigint;
1631
+ maxPriorityFeePerGas?: bigint;
1632
+ nonce?: number;
1633
+ value?: bigint;
1634
+ }): Promise<void> {
1635
+ return contract.simulate.renounceOwnership(options) as Promise<void>;
1636
+ },
1637
+ /**
1638
+ * Simulate rescue
1639
+ * Returns gas estimate and result without sending transaction
1640
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1641
+ */
1642
+ async rescue(token: `0x${string}`, to: `0x${string}`, options?: {
1643
+ accessList?: import('viem').AccessList;
1644
+ authorizationList?: import('viem').AuthorizationList;
1645
+ chain?: import('viem').Chain | null;
1646
+ dataSuffix?: `0x${string}`;
1647
+ gas?: bigint;
1648
+ gasPrice?: bigint;
1649
+ maxFeePerGas?: bigint;
1650
+ maxPriorityFeePerGas?: bigint;
1651
+ nonce?: number;
1652
+ value?: bigint;
1653
+ }): Promise<void> {
1654
+ return contract.simulate.rescue([token, to] as const, options) as Promise<void>;
1655
+ },
1656
+ /**
1657
+ * Simulate setBridge
1658
+ * Returns gas estimate and result without sending transaction
1659
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1660
+ */
1661
+ async setBridge(_bridge: `0x${string}`, options?: {
1662
+ accessList?: import('viem').AccessList;
1663
+ authorizationList?: import('viem').AuthorizationList;
1664
+ chain?: import('viem').Chain | null;
1665
+ dataSuffix?: `0x${string}`;
1666
+ gas?: bigint;
1667
+ gasPrice?: bigint;
1668
+ maxFeePerGas?: bigint;
1669
+ maxPriorityFeePerGas?: bigint;
1670
+ nonce?: number;
1671
+ value?: bigint;
1672
+ }): Promise<void> {
1673
+ return contract.simulate.setBridge([_bridge] as const, options) as Promise<void>;
1674
+ },
1675
+ /**
1676
+ * Simulate transfer
1677
+ * Returns gas estimate and result without sending transaction
1678
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1679
+ */
1680
+ async transfer(to: `0x${string}`, value: bigint, options?: {
1681
+ accessList?: import('viem').AccessList;
1682
+ authorizationList?: import('viem').AuthorizationList;
1683
+ chain?: import('viem').Chain | null;
1684
+ dataSuffix?: `0x${string}`;
1685
+ gas?: bigint;
1686
+ gasPrice?: bigint;
1687
+ maxFeePerGas?: bigint;
1688
+ maxPriorityFeePerGas?: bigint;
1689
+ nonce?: number;
1690
+ value?: bigint;
1691
+ }): Promise<boolean> {
1692
+ return contract.simulate.transfer([to, value] as const, options) as Promise<boolean>;
1693
+ },
1694
+ /**
1695
+ * Simulate transferFrom
1696
+ * Returns gas estimate and result without sending transaction
1697
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1698
+ */
1699
+ async transferFrom(from: `0x${string}`, to: `0x${string}`, value: bigint, options?: {
1700
+ accessList?: import('viem').AccessList;
1701
+ authorizationList?: import('viem').AuthorizationList;
1702
+ chain?: import('viem').Chain | null;
1703
+ dataSuffix?: `0x${string}`;
1704
+ gas?: bigint;
1705
+ gasPrice?: bigint;
1706
+ maxFeePerGas?: bigint;
1707
+ maxPriorityFeePerGas?: bigint;
1708
+ nonce?: number;
1709
+ value?: bigint;
1710
+ }): Promise<boolean> {
1711
+ return contract.simulate.transferFrom([from, to, value] as const, options) as Promise<boolean>;
1712
+ },
1713
+ /**
1714
+ * Simulate transferOwnership
1715
+ * Returns gas estimate and result without sending transaction
1716
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1717
+ */
1718
+ async transferOwnership(newOwner: `0x${string}`, options?: {
1719
+ accessList?: import('viem').AccessList;
1720
+ authorizationList?: import('viem').AuthorizationList;
1721
+ chain?: import('viem').Chain | null;
1722
+ dataSuffix?: `0x${string}`;
1723
+ gas?: bigint;
1724
+ gasPrice?: bigint;
1725
+ maxFeePerGas?: bigint;
1726
+ maxPriorityFeePerGas?: bigint;
1727
+ nonce?: number;
1728
+ value?: bigint;
1729
+ }): Promise<void> {
1730
+ return contract.simulate.transferOwnership([newOwner] as const, options) as Promise<void>;
1731
+ },
1732
+ /**
1733
+ * Simulate unlockUser
1734
+ * Returns gas estimate and result without sending transaction
1735
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1736
+ */
1737
+ async unlockUser(_user: `0x${string}`, options?: {
1738
+ accessList?: import('viem').AccessList;
1739
+ authorizationList?: import('viem').AuthorizationList;
1740
+ chain?: import('viem').Chain | null;
1741
+ dataSuffix?: `0x${string}`;
1742
+ gas?: bigint;
1743
+ gasPrice?: bigint;
1744
+ maxFeePerGas?: bigint;
1745
+ maxPriorityFeePerGas?: bigint;
1746
+ nonce?: number;
1747
+ value?: bigint;
1748
+ }): Promise<void> {
1749
+ return contract.simulate.unlockUser([_user] as const, options) as Promise<void>;
1750
+ },
1751
+ /**
1752
+ * Simulate unpause
1753
+ * Returns gas estimate and result without sending transaction
1754
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1755
+ */
1756
+ async unpause(options?: {
1757
+ accessList?: import('viem').AccessList;
1758
+ authorizationList?: import('viem').AuthorizationList;
1759
+ chain?: import('viem').Chain | null;
1760
+ dataSuffix?: `0x${string}`;
1761
+ gas?: bigint;
1762
+ gasPrice?: bigint;
1763
+ maxFeePerGas?: bigint;
1764
+ maxPriorityFeePerGas?: bigint;
1765
+ nonce?: number;
1766
+ value?: bigint;
1767
+ }): Promise<void> {
1768
+ return contract.simulate.unpause(options) as Promise<void>;
1769
+ },
1770
+ /**
1771
+ * Simulate upgradeToAndCall
1772
+ * Returns gas estimate and result without sending transaction
1773
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1774
+ */
1775
+ async upgradeToAndCall(newImplementation: `0x${string}`, data: `0x${string}`, options?: {
1776
+ accessList?: import('viem').AccessList;
1777
+ authorizationList?: import('viem').AuthorizationList;
1778
+ chain?: import('viem').Chain | null;
1779
+ dataSuffix?: `0x${string}`;
1780
+ gas?: bigint;
1781
+ gasPrice?: bigint;
1782
+ maxFeePerGas?: bigint;
1783
+ maxPriorityFeePerGas?: bigint;
1784
+ nonce?: number;
1785
+ value?: bigint;
1786
+ }): Promise<void> {
1787
+ return contract.simulate.upgradeToAndCall([newImplementation, data] as const, options) as Promise<void>;
1788
+ }
1789
+ };
1790
+ }
1791
+
1792
+ /**
1793
+ * Watch contract events
1794
+ *
1795
+ * @example
1796
+ * // Watch all Transfer events
1797
+ * const unwatch = contract.watch.Transfer((event) => {
1798
+ * console.log('Transfer:', event);
1799
+ * });
1800
+ *
1801
+ * // Stop watching
1802
+ * unwatch();
1803
+ */
1804
+ get watch() {
1805
+ return {
1806
+ /**
1807
+ * Watch Approval events
1808
+ * @param callback Function to call when event is emitted
1809
+ * @param filter Optional filter for indexed parameters
1810
+ * @returns Unwatch function to stop listening
1811
+ */
1812
+ Approval: (callback: (event: { owner: `0x${string}`; spender: `0x${string}`; value: bigint }) => void, filter?: { owner: `0x${string}`; spender: `0x${string}` }) => {
1813
+ return this.publicClient.watchContractEvent({
1814
+ address: this.contractAddress,
1815
+ abi: FBTC_jsonAbi,
1816
+ eventName: 'Approval',
1817
+ args: filter,
1818
+ onLogs: (logs: any[]) => {
1819
+ logs.forEach((log: any) => {
1820
+ callback(log.args as any);
1821
+ });
1822
+ },
1823
+ }) as () => void;
1824
+ },
1825
+ /**
1826
+ * Watch BridgeUpdated events
1827
+ * @param callback Function to call when event is emitted
1828
+ * @param filter Optional filter for indexed parameters
1829
+ * @returns Unwatch function to stop listening
1830
+ */
1831
+ BridgeUpdated: (callback: (event: { newBridge: `0x${string}`; oldBridge: `0x${string}` }) => void, filter?: { newBridge: `0x${string}`; oldBridge: `0x${string}` }) => {
1832
+ return this.publicClient.watchContractEvent({
1833
+ address: this.contractAddress,
1834
+ abi: FBTC_jsonAbi,
1835
+ eventName: 'BridgeUpdated',
1836
+ args: filter,
1837
+ onLogs: (logs: any[]) => {
1838
+ logs.forEach((log: any) => {
1839
+ callback(log.args as any);
1840
+ });
1841
+ },
1842
+ }) as () => void;
1843
+ },
1844
+ /**
1845
+ * Watch Initialized events
1846
+ * @param callback Function to call when event is emitted
1847
+ * @param filter Optional filter for indexed parameters
1848
+ * @returns Unwatch function to stop listening
1849
+ */
1850
+ Initialized: (callback: (event: { version: bigint }) => void) => {
1851
+ return this.publicClient.watchContractEvent({
1852
+ address: this.contractAddress,
1853
+ abi: FBTC_jsonAbi,
1854
+ eventName: 'Initialized',
1855
+
1856
+ onLogs: (logs: any[]) => {
1857
+ logs.forEach((log: any) => {
1858
+ callback(log.args as any);
1859
+ });
1860
+ },
1861
+ }) as () => void;
1862
+ },
1863
+ /**
1864
+ * Watch OwnershipTransferStarted events
1865
+ * @param callback Function to call when event is emitted
1866
+ * @param filter Optional filter for indexed parameters
1867
+ * @returns Unwatch function to stop listening
1868
+ */
1869
+ OwnershipTransferStarted: (callback: (event: { previousOwner: `0x${string}`; newOwner: `0x${string}` }) => void, filter?: { previousOwner: `0x${string}`; newOwner: `0x${string}` }) => {
1870
+ return this.publicClient.watchContractEvent({
1871
+ address: this.contractAddress,
1872
+ abi: FBTC_jsonAbi,
1873
+ eventName: 'OwnershipTransferStarted',
1874
+ args: filter,
1875
+ onLogs: (logs: any[]) => {
1876
+ logs.forEach((log: any) => {
1877
+ callback(log.args as any);
1878
+ });
1879
+ },
1880
+ }) as () => void;
1881
+ },
1882
+ /**
1883
+ * Watch OwnershipTransferred events
1884
+ * @param callback Function to call when event is emitted
1885
+ * @param filter Optional filter for indexed parameters
1886
+ * @returns Unwatch function to stop listening
1887
+ */
1888
+ OwnershipTransferred: (callback: (event: { previousOwner: `0x${string}`; newOwner: `0x${string}` }) => void, filter?: { previousOwner: `0x${string}`; newOwner: `0x${string}` }) => {
1889
+ return this.publicClient.watchContractEvent({
1890
+ address: this.contractAddress,
1891
+ abi: FBTC_jsonAbi,
1892
+ eventName: 'OwnershipTransferred',
1893
+ args: filter,
1894
+ onLogs: (logs: any[]) => {
1895
+ logs.forEach((log: any) => {
1896
+ callback(log.args as any);
1897
+ });
1898
+ },
1899
+ }) as () => void;
1900
+ },
1901
+ /**
1902
+ * Watch Paused events
1903
+ * @param callback Function to call when event is emitted
1904
+ * @param filter Optional filter for indexed parameters
1905
+ * @returns Unwatch function to stop listening
1906
+ */
1907
+ Paused: (callback: (event: { account: `0x${string}` }) => void) => {
1908
+ return this.publicClient.watchContractEvent({
1909
+ address: this.contractAddress,
1910
+ abi: FBTC_jsonAbi,
1911
+ eventName: 'Paused',
1912
+
1913
+ onLogs: (logs: any[]) => {
1914
+ logs.forEach((log: any) => {
1915
+ callback(log.args as any);
1916
+ });
1917
+ },
1918
+ }) as () => void;
1919
+ },
1920
+ /**
1921
+ * Watch Transfer events
1922
+ * @param callback Function to call when event is emitted
1923
+ * @param filter Optional filter for indexed parameters
1924
+ * @returns Unwatch function to stop listening
1925
+ */
1926
+ Transfer: (callback: (event: { from: `0x${string}`; to: `0x${string}`; value: bigint }) => void, filter?: { from: `0x${string}`; to: `0x${string}` }) => {
1927
+ return this.publicClient.watchContractEvent({
1928
+ address: this.contractAddress,
1929
+ abi: FBTC_jsonAbi,
1930
+ eventName: 'Transfer',
1931
+ args: filter,
1932
+ onLogs: (logs: any[]) => {
1933
+ logs.forEach((log: any) => {
1934
+ callback(log.args as any);
1935
+ });
1936
+ },
1937
+ }) as () => void;
1938
+ },
1939
+ /**
1940
+ * Watch Unpaused events
1941
+ * @param callback Function to call when event is emitted
1942
+ * @param filter Optional filter for indexed parameters
1943
+ * @returns Unwatch function to stop listening
1944
+ */
1945
+ Unpaused: (callback: (event: { account: `0x${string}` }) => void) => {
1946
+ return this.publicClient.watchContractEvent({
1947
+ address: this.contractAddress,
1948
+ abi: FBTC_jsonAbi,
1949
+ eventName: 'Unpaused',
1950
+
1951
+ onLogs: (logs: any[]) => {
1952
+ logs.forEach((log: any) => {
1953
+ callback(log.args as any);
1954
+ });
1955
+ },
1956
+ }) as () => void;
1957
+ },
1958
+ /**
1959
+ * Watch Upgraded events
1960
+ * @param callback Function to call when event is emitted
1961
+ * @param filter Optional filter for indexed parameters
1962
+ * @returns Unwatch function to stop listening
1963
+ */
1964
+ Upgraded: (callback: (event: { implementation: `0x${string}` }) => void, filter?: { implementation: `0x${string}` }) => {
1965
+ return this.publicClient.watchContractEvent({
1966
+ address: this.contractAddress,
1967
+ abi: FBTC_jsonAbi,
1968
+ eventName: 'Upgraded',
1969
+ args: filter,
1970
+ onLogs: (logs: any[]) => {
1971
+ logs.forEach((log: any) => {
1972
+ callback(log.args as any);
1973
+ });
1974
+ },
1975
+ }) as () => void;
1976
+ },
1977
+ /**
1978
+ * Watch UserLocked events
1979
+ * @param callback Function to call when event is emitted
1980
+ * @param filter Optional filter for indexed parameters
1981
+ * @returns Unwatch function to stop listening
1982
+ */
1983
+ UserLocked: (callback: (event: { user: `0x${string}` }) => void, filter?: { user: `0x${string}` }) => {
1984
+ return this.publicClient.watchContractEvent({
1985
+ address: this.contractAddress,
1986
+ abi: FBTC_jsonAbi,
1987
+ eventName: 'UserLocked',
1988
+ args: filter,
1989
+ onLogs: (logs: any[]) => {
1990
+ logs.forEach((log: any) => {
1991
+ callback(log.args as any);
1992
+ });
1993
+ },
1994
+ }) as () => void;
1995
+ },
1996
+ /**
1997
+ * Watch UserUnlocked events
1998
+ * @param callback Function to call when event is emitted
1999
+ * @param filter Optional filter for indexed parameters
2000
+ * @returns Unwatch function to stop listening
2001
+ */
2002
+ UserUnlocked: (callback: (event: { user: `0x${string}` }) => void, filter?: { user: `0x${string}` }) => {
2003
+ return this.publicClient.watchContractEvent({
2004
+ address: this.contractAddress,
2005
+ abi: FBTC_jsonAbi,
2006
+ eventName: 'UserUnlocked',
2007
+ args: filter,
2008
+ onLogs: (logs: any[]) => {
2009
+ logs.forEach((log: any) => {
2010
+ callback(log.args as any);
2011
+ });
2012
+ },
2013
+ }) as () => void;
2014
+ }
2015
+ };
2016
+ }
2017
+ }