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