@gitmyabi/usdt 1.0.12 → 1.0.13

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