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