@gitmyabi/tcmc 0.0.0-stage → 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,773 @@
1
+ import type { Abi, Address, PublicClient, WalletClient, GetContractReturnType } from 'viem';
2
+ import { getContract } from 'viem';
3
+
4
+ /**
5
+ * TokenMintERC20Token_json ABI
6
+ *
7
+ * This ABI is typed using viem's type system for full type safety.
8
+ */
9
+ export const TokenMintERC20Token_jsonAbi = [
10
+ {
11
+ "constant": true,
12
+ "inputs": [],
13
+ "name": "name",
14
+ "outputs": [
15
+ {
16
+ "name": "",
17
+ "type": "string"
18
+ }
19
+ ],
20
+ "payable": false,
21
+ "stateMutability": "view",
22
+ "type": "function"
23
+ },
24
+ {
25
+ "constant": false,
26
+ "inputs": [
27
+ {
28
+ "name": "spender",
29
+ "type": "address"
30
+ },
31
+ {
32
+ "name": "value",
33
+ "type": "uint256"
34
+ }
35
+ ],
36
+ "name": "approve",
37
+ "outputs": [
38
+ {
39
+ "name": "",
40
+ "type": "bool"
41
+ }
42
+ ],
43
+ "payable": false,
44
+ "stateMutability": "nonpayable",
45
+ "type": "function"
46
+ },
47
+ {
48
+ "constant": true,
49
+ "inputs": [],
50
+ "name": "totalSupply",
51
+ "outputs": [
52
+ {
53
+ "name": "",
54
+ "type": "uint256"
55
+ }
56
+ ],
57
+ "payable": false,
58
+ "stateMutability": "view",
59
+ "type": "function"
60
+ },
61
+ {
62
+ "constant": false,
63
+ "inputs": [
64
+ {
65
+ "name": "sender",
66
+ "type": "address"
67
+ },
68
+ {
69
+ "name": "recipient",
70
+ "type": "address"
71
+ },
72
+ {
73
+ "name": "amount",
74
+ "type": "uint256"
75
+ }
76
+ ],
77
+ "name": "transferFrom",
78
+ "outputs": [
79
+ {
80
+ "name": "",
81
+ "type": "bool"
82
+ }
83
+ ],
84
+ "payable": false,
85
+ "stateMutability": "nonpayable",
86
+ "type": "function"
87
+ },
88
+ {
89
+ "constant": true,
90
+ "inputs": [],
91
+ "name": "decimals",
92
+ "outputs": [
93
+ {
94
+ "name": "",
95
+ "type": "uint8"
96
+ }
97
+ ],
98
+ "payable": false,
99
+ "stateMutability": "view",
100
+ "type": "function"
101
+ },
102
+ {
103
+ "constant": false,
104
+ "inputs": [
105
+ {
106
+ "name": "spender",
107
+ "type": "address"
108
+ },
109
+ {
110
+ "name": "addedValue",
111
+ "type": "uint256"
112
+ }
113
+ ],
114
+ "name": "increaseAllowance",
115
+ "outputs": [
116
+ {
117
+ "name": "",
118
+ "type": "bool"
119
+ }
120
+ ],
121
+ "payable": false,
122
+ "stateMutability": "nonpayable",
123
+ "type": "function"
124
+ },
125
+ {
126
+ "constant": false,
127
+ "inputs": [
128
+ {
129
+ "name": "value",
130
+ "type": "uint256"
131
+ }
132
+ ],
133
+ "name": "burn",
134
+ "outputs": [],
135
+ "payable": false,
136
+ "stateMutability": "nonpayable",
137
+ "type": "function"
138
+ },
139
+ {
140
+ "constant": true,
141
+ "inputs": [
142
+ {
143
+ "name": "account",
144
+ "type": "address"
145
+ }
146
+ ],
147
+ "name": "balanceOf",
148
+ "outputs": [
149
+ {
150
+ "name": "",
151
+ "type": "uint256"
152
+ }
153
+ ],
154
+ "payable": false,
155
+ "stateMutability": "view",
156
+ "type": "function"
157
+ },
158
+ {
159
+ "constant": true,
160
+ "inputs": [],
161
+ "name": "symbol",
162
+ "outputs": [
163
+ {
164
+ "name": "",
165
+ "type": "string"
166
+ }
167
+ ],
168
+ "payable": false,
169
+ "stateMutability": "view",
170
+ "type": "function"
171
+ },
172
+ {
173
+ "constant": false,
174
+ "inputs": [
175
+ {
176
+ "name": "spender",
177
+ "type": "address"
178
+ },
179
+ {
180
+ "name": "subtractedValue",
181
+ "type": "uint256"
182
+ }
183
+ ],
184
+ "name": "decreaseAllowance",
185
+ "outputs": [
186
+ {
187
+ "name": "",
188
+ "type": "bool"
189
+ }
190
+ ],
191
+ "payable": false,
192
+ "stateMutability": "nonpayable",
193
+ "type": "function"
194
+ },
195
+ {
196
+ "constant": false,
197
+ "inputs": [
198
+ {
199
+ "name": "recipient",
200
+ "type": "address"
201
+ },
202
+ {
203
+ "name": "amount",
204
+ "type": "uint256"
205
+ }
206
+ ],
207
+ "name": "transfer",
208
+ "outputs": [
209
+ {
210
+ "name": "",
211
+ "type": "bool"
212
+ }
213
+ ],
214
+ "payable": false,
215
+ "stateMutability": "nonpayable",
216
+ "type": "function"
217
+ },
218
+ {
219
+ "constant": true,
220
+ "inputs": [
221
+ {
222
+ "name": "owner",
223
+ "type": "address"
224
+ },
225
+ {
226
+ "name": "spender",
227
+ "type": "address"
228
+ }
229
+ ],
230
+ "name": "allowance",
231
+ "outputs": [
232
+ {
233
+ "name": "",
234
+ "type": "uint256"
235
+ }
236
+ ],
237
+ "payable": false,
238
+ "stateMutability": "view",
239
+ "type": "function"
240
+ },
241
+ {
242
+ "inputs": [
243
+ {
244
+ "name": "name",
245
+ "type": "string"
246
+ },
247
+ {
248
+ "name": "symbol",
249
+ "type": "string"
250
+ },
251
+ {
252
+ "name": "decimals",
253
+ "type": "uint8"
254
+ },
255
+ {
256
+ "name": "totalSupply",
257
+ "type": "uint256"
258
+ },
259
+ {
260
+ "name": "feeReceiver",
261
+ "type": "address"
262
+ },
263
+ {
264
+ "name": "tokenOwnerAddress",
265
+ "type": "address"
266
+ }
267
+ ],
268
+ "payable": true,
269
+ "stateMutability": "payable",
270
+ "type": "constructor"
271
+ },
272
+ {
273
+ "anonymous": false,
274
+ "inputs": [
275
+ {
276
+ "indexed": true,
277
+ "name": "from",
278
+ "type": "address"
279
+ },
280
+ {
281
+ "indexed": true,
282
+ "name": "to",
283
+ "type": "address"
284
+ },
285
+ {
286
+ "indexed": false,
287
+ "name": "value",
288
+ "type": "uint256"
289
+ }
290
+ ],
291
+ "name": "Transfer",
292
+ "type": "event"
293
+ },
294
+ {
295
+ "anonymous": false,
296
+ "inputs": [
297
+ {
298
+ "indexed": true,
299
+ "name": "owner",
300
+ "type": "address"
301
+ },
302
+ {
303
+ "indexed": true,
304
+ "name": "spender",
305
+ "type": "address"
306
+ },
307
+ {
308
+ "indexed": false,
309
+ "name": "value",
310
+ "type": "uint256"
311
+ }
312
+ ],
313
+ "name": "Approval",
314
+ "type": "event"
315
+ }
316
+ ] as const satisfies Abi;
317
+
318
+ /**
319
+ * Type-safe ABI for TokenMintERC20Token_json
320
+ */
321
+ export type TokenMintERC20Token_jsonAbi = typeof TokenMintERC20Token_jsonAbi;
322
+
323
+ /**
324
+ * Contract instance type for TokenMintERC20Token_json
325
+ */
326
+ // Use any for contract type to avoid complex viem type issues
327
+ // The runtime behavior is type-safe through viem's ABI typing
328
+ export type TokenMintERC20Token_jsonContract = any;
329
+
330
+ /**
331
+ * TokenMintERC20Token_json Contract Class
332
+ *
333
+ * Provides a class-based API similar to TypeChain for interacting with the contract.
334
+ *
335
+ * @example
336
+ * ```typescript
337
+ * import { createPublicClient, createWalletClient, http } from 'viem';
338
+ * import { mainnet } from 'viem/chains';
339
+ * import { TokenMintERC20Token_json } from 'TokenMintERC20Token_json';
340
+ *
341
+ * const publicClient = createPublicClient({ chain: mainnet, transport: http() });
342
+ * const walletClient = createWalletClient({ chain: mainnet, transport: http() });
343
+ *
344
+ * const contract = new TokenMintERC20Token_json('0x...', { publicClient, walletClient });
345
+ *
346
+ * // Read functions
347
+ * const result = await contract.balanceOf('0x...');
348
+ *
349
+ * // Write functions
350
+ * const hash = await contract.transfer('0x...', 1000n);
351
+ *
352
+ * // Simulate transactions (dry-run)
353
+ * const simulation = await contract.simulate.transfer('0x...', 1000n);
354
+ * console.log('Gas estimate:', simulation.request.gas);
355
+ *
356
+ * // Watch events
357
+ * const unwatch = contract.watch.Transfer((event) => {
358
+ * console.log('Transfer event:', event);
359
+ * });
360
+ * ```
361
+ */
362
+ export class TokenMintERC20Token_json {
363
+ private contract: TokenMintERC20Token_jsonContract;
364
+ private contractAddress: Address;
365
+ private publicClient: PublicClient;
366
+
367
+ constructor(
368
+ address: Address,
369
+ clients: {
370
+ publicClient: PublicClient;
371
+ walletClient?: WalletClient;
372
+ }
373
+ ) {
374
+ this.contractAddress = address;
375
+ this.publicClient = clients.publicClient;
376
+ this.contract = getContract({
377
+ address,
378
+ abi: TokenMintERC20Token_jsonAbi,
379
+ client: {
380
+ public: clients.publicClient,
381
+ wallet: clients.walletClient,
382
+ },
383
+ });
384
+ }
385
+
386
+ /**
387
+ * Get the contract address
388
+ */
389
+ get address(): Address {
390
+ return this.contractAddress;
391
+ }
392
+
393
+ /**
394
+ * Get the underlying viem contract instance
395
+ */
396
+ getContract(): TokenMintERC20Token_jsonContract {
397
+ return this.contract;
398
+ }
399
+
400
+ /**
401
+ * name
402
+ * view
403
+ */
404
+ async name(): Promise<string> {
405
+ return this.contract.read.name() as Promise<string>;
406
+ }
407
+
408
+ /**
409
+ * totalSupply
410
+ * view
411
+ */
412
+ async totalSupply(): Promise<bigint> {
413
+ return this.contract.read.totalSupply() as Promise<bigint>;
414
+ }
415
+
416
+ /**
417
+ * decimals
418
+ * view
419
+ */
420
+ async decimals(): Promise<bigint> {
421
+ return this.contract.read.decimals() as Promise<bigint>;
422
+ }
423
+
424
+ /**
425
+ * balanceOf
426
+ * view
427
+ */
428
+ async balanceOf(account: `0x${string}`): Promise<bigint> {
429
+ return this.contract.read.balanceOf([account] as const) as Promise<bigint>;
430
+ }
431
+
432
+ /**
433
+ * symbol
434
+ * view
435
+ */
436
+ async symbol(): Promise<string> {
437
+ return this.contract.read.symbol() as Promise<string>;
438
+ }
439
+
440
+ /**
441
+ * allowance
442
+ * view
443
+ */
444
+ async allowance(owner: `0x${string}`, spender: `0x${string}`): Promise<bigint> {
445
+ return this.contract.read.allowance([owner, spender] as const) as Promise<bigint>;
446
+ }
447
+
448
+ /**
449
+ * approve
450
+ * nonpayable
451
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
452
+ */
453
+ async approve(spender: `0x${string}`, value: bigint, options?: {
454
+ accessList?: import('viem').AccessList;
455
+ authorizationList?: import('viem').AuthorizationList;
456
+ chain?: import('viem').Chain | null;
457
+ dataSuffix?: `0x${string}`;
458
+ gas?: bigint;
459
+ gasPrice?: bigint;
460
+ maxFeePerGas?: bigint;
461
+ maxPriorityFeePerGas?: bigint;
462
+ nonce?: number;
463
+ value?: bigint;
464
+ }): Promise<`0x${string}`> {
465
+ if (!this.contract.write) {
466
+ throw new Error('Wallet client is required for write operations');
467
+ }
468
+ return this.contract.write.approve([spender, value] as const, options) as Promise<`0x${string}`>;
469
+ }
470
+
471
+ /**
472
+ * transferFrom
473
+ * nonpayable
474
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
475
+ */
476
+ async transferFrom(sender: `0x${string}`, recipient: `0x${string}`, amount: bigint, options?: {
477
+ accessList?: import('viem').AccessList;
478
+ authorizationList?: import('viem').AuthorizationList;
479
+ chain?: import('viem').Chain | null;
480
+ dataSuffix?: `0x${string}`;
481
+ gas?: bigint;
482
+ gasPrice?: bigint;
483
+ maxFeePerGas?: bigint;
484
+ maxPriorityFeePerGas?: bigint;
485
+ nonce?: number;
486
+ value?: bigint;
487
+ }): Promise<`0x${string}`> {
488
+ if (!this.contract.write) {
489
+ throw new Error('Wallet client is required for write operations');
490
+ }
491
+ return this.contract.write.transferFrom([sender, recipient, amount] as const, options) as Promise<`0x${string}`>;
492
+ }
493
+
494
+ /**
495
+ * increaseAllowance
496
+ * nonpayable
497
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
498
+ */
499
+ async increaseAllowance(spender: `0x${string}`, addedValue: bigint, options?: {
500
+ accessList?: import('viem').AccessList;
501
+ authorizationList?: import('viem').AuthorizationList;
502
+ chain?: import('viem').Chain | null;
503
+ dataSuffix?: `0x${string}`;
504
+ gas?: bigint;
505
+ gasPrice?: bigint;
506
+ maxFeePerGas?: bigint;
507
+ maxPriorityFeePerGas?: bigint;
508
+ nonce?: number;
509
+ value?: bigint;
510
+ }): Promise<`0x${string}`> {
511
+ if (!this.contract.write) {
512
+ throw new Error('Wallet client is required for write operations');
513
+ }
514
+ return this.contract.write.increaseAllowance([spender, addedValue] as const, options) as Promise<`0x${string}`>;
515
+ }
516
+
517
+ /**
518
+ * burn
519
+ * nonpayable
520
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
521
+ */
522
+ async burn(value: bigint, options?: {
523
+ accessList?: import('viem').AccessList;
524
+ authorizationList?: import('viem').AuthorizationList;
525
+ chain?: import('viem').Chain | null;
526
+ dataSuffix?: `0x${string}`;
527
+ gas?: bigint;
528
+ gasPrice?: bigint;
529
+ maxFeePerGas?: bigint;
530
+ maxPriorityFeePerGas?: bigint;
531
+ nonce?: number;
532
+ value?: bigint;
533
+ }): Promise<`0x${string}`> {
534
+ if (!this.contract.write) {
535
+ throw new Error('Wallet client is required for write operations');
536
+ }
537
+ return this.contract.write.burn([value] as const, options) as Promise<`0x${string}`>;
538
+ }
539
+
540
+ /**
541
+ * decreaseAllowance
542
+ * nonpayable
543
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
544
+ */
545
+ async decreaseAllowance(spender: `0x${string}`, subtractedValue: bigint, options?: {
546
+ accessList?: import('viem').AccessList;
547
+ authorizationList?: import('viem').AuthorizationList;
548
+ chain?: import('viem').Chain | null;
549
+ dataSuffix?: `0x${string}`;
550
+ gas?: bigint;
551
+ gasPrice?: bigint;
552
+ maxFeePerGas?: bigint;
553
+ maxPriorityFeePerGas?: bigint;
554
+ nonce?: number;
555
+ value?: bigint;
556
+ }): Promise<`0x${string}`> {
557
+ if (!this.contract.write) {
558
+ throw new Error('Wallet client is required for write operations');
559
+ }
560
+ return this.contract.write.decreaseAllowance([spender, subtractedValue] as const, options) as Promise<`0x${string}`>;
561
+ }
562
+
563
+ /**
564
+ * transfer
565
+ * nonpayable
566
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
567
+ */
568
+ async transfer(recipient: `0x${string}`, amount: bigint, options?: {
569
+ accessList?: import('viem').AccessList;
570
+ authorizationList?: import('viem').AuthorizationList;
571
+ chain?: import('viem').Chain | null;
572
+ dataSuffix?: `0x${string}`;
573
+ gas?: bigint;
574
+ gasPrice?: bigint;
575
+ maxFeePerGas?: bigint;
576
+ maxPriorityFeePerGas?: bigint;
577
+ nonce?: number;
578
+ value?: bigint;
579
+ }): Promise<`0x${string}`> {
580
+ if (!this.contract.write) {
581
+ throw new Error('Wallet client is required for write operations');
582
+ }
583
+ return this.contract.write.transfer([recipient, amount] as const, options) as Promise<`0x${string}`>;
584
+ }
585
+
586
+
587
+
588
+ /**
589
+ * Simulate contract write operations (dry-run without sending transaction)
590
+ *
591
+ * @example
592
+ * const result = await contract.simulate.transfer('0x...', 1000n);
593
+ * console.log('Gas estimate:', result.request.gas);
594
+ * console.log('Would succeed:', result.result);
595
+ */
596
+ get simulate() {
597
+ const contract = this.contract;
598
+ if (!contract.simulate) {
599
+ throw new Error('Public client is required for simulation');
600
+ }
601
+ return {
602
+ /**
603
+ * Simulate approve
604
+ * Returns gas estimate and result without sending transaction
605
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
606
+ */
607
+ async approve(spender: `0x${string}`, value: bigint, options?: {
608
+ accessList?: import('viem').AccessList;
609
+ authorizationList?: import('viem').AuthorizationList;
610
+ chain?: import('viem').Chain | null;
611
+ dataSuffix?: `0x${string}`;
612
+ gas?: bigint;
613
+ gasPrice?: bigint;
614
+ maxFeePerGas?: bigint;
615
+ maxPriorityFeePerGas?: bigint;
616
+ nonce?: number;
617
+ value?: bigint;
618
+ }): Promise<boolean> {
619
+ return contract.simulate.approve([spender, value] as const, options) as Promise<boolean>;
620
+ },
621
+ /**
622
+ * Simulate transferFrom
623
+ * Returns gas estimate and result without sending transaction
624
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
625
+ */
626
+ async transferFrom(sender: `0x${string}`, recipient: `0x${string}`, amount: bigint, options?: {
627
+ accessList?: import('viem').AccessList;
628
+ authorizationList?: import('viem').AuthorizationList;
629
+ chain?: import('viem').Chain | null;
630
+ dataSuffix?: `0x${string}`;
631
+ gas?: bigint;
632
+ gasPrice?: bigint;
633
+ maxFeePerGas?: bigint;
634
+ maxPriorityFeePerGas?: bigint;
635
+ nonce?: number;
636
+ value?: bigint;
637
+ }): Promise<boolean> {
638
+ return contract.simulate.transferFrom([sender, recipient, amount] as const, options) as Promise<boolean>;
639
+ },
640
+ /**
641
+ * Simulate increaseAllowance
642
+ * Returns gas estimate and result without sending transaction
643
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
644
+ */
645
+ async increaseAllowance(spender: `0x${string}`, addedValue: bigint, options?: {
646
+ accessList?: import('viem').AccessList;
647
+ authorizationList?: import('viem').AuthorizationList;
648
+ chain?: import('viem').Chain | null;
649
+ dataSuffix?: `0x${string}`;
650
+ gas?: bigint;
651
+ gasPrice?: bigint;
652
+ maxFeePerGas?: bigint;
653
+ maxPriorityFeePerGas?: bigint;
654
+ nonce?: number;
655
+ value?: bigint;
656
+ }): Promise<boolean> {
657
+ return contract.simulate.increaseAllowance([spender, addedValue] as const, options) as Promise<boolean>;
658
+ },
659
+ /**
660
+ * Simulate burn
661
+ * Returns gas estimate and result without sending transaction
662
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
663
+ */
664
+ async burn(value: bigint, options?: {
665
+ accessList?: import('viem').AccessList;
666
+ authorizationList?: import('viem').AuthorizationList;
667
+ chain?: import('viem').Chain | null;
668
+ dataSuffix?: `0x${string}`;
669
+ gas?: bigint;
670
+ gasPrice?: bigint;
671
+ maxFeePerGas?: bigint;
672
+ maxPriorityFeePerGas?: bigint;
673
+ nonce?: number;
674
+ value?: bigint;
675
+ }): Promise<void> {
676
+ return contract.simulate.burn([value] as const, options) as Promise<void>;
677
+ },
678
+ /**
679
+ * Simulate decreaseAllowance
680
+ * Returns gas estimate and result without sending transaction
681
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
682
+ */
683
+ async decreaseAllowance(spender: `0x${string}`, subtractedValue: bigint, options?: {
684
+ accessList?: import('viem').AccessList;
685
+ authorizationList?: import('viem').AuthorizationList;
686
+ chain?: import('viem').Chain | null;
687
+ dataSuffix?: `0x${string}`;
688
+ gas?: bigint;
689
+ gasPrice?: bigint;
690
+ maxFeePerGas?: bigint;
691
+ maxPriorityFeePerGas?: bigint;
692
+ nonce?: number;
693
+ value?: bigint;
694
+ }): Promise<boolean> {
695
+ return contract.simulate.decreaseAllowance([spender, subtractedValue] as const, options) as Promise<boolean>;
696
+ },
697
+ /**
698
+ * Simulate transfer
699
+ * Returns gas estimate and result without sending transaction
700
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
701
+ */
702
+ async transfer(recipient: `0x${string}`, amount: bigint, options?: {
703
+ accessList?: import('viem').AccessList;
704
+ authorizationList?: import('viem').AuthorizationList;
705
+ chain?: import('viem').Chain | null;
706
+ dataSuffix?: `0x${string}`;
707
+ gas?: bigint;
708
+ gasPrice?: bigint;
709
+ maxFeePerGas?: bigint;
710
+ maxPriorityFeePerGas?: bigint;
711
+ nonce?: number;
712
+ value?: bigint;
713
+ }): Promise<boolean> {
714
+ return contract.simulate.transfer([recipient, amount] as const, options) as Promise<boolean>;
715
+ }
716
+ };
717
+ }
718
+
719
+ /**
720
+ * Watch contract events
721
+ *
722
+ * @example
723
+ * // Watch all Transfer events
724
+ * const unwatch = contract.watch.Transfer((event) => {
725
+ * console.log('Transfer:', event);
726
+ * });
727
+ *
728
+ * // Stop watching
729
+ * unwatch();
730
+ */
731
+ get watch() {
732
+ return {
733
+ /**
734
+ * Watch Transfer events
735
+ * @param callback Function to call when event is emitted
736
+ * @param filter Optional filter for indexed parameters
737
+ * @returns Unwatch function to stop listening
738
+ */
739
+ Transfer: (callback: (event: { from: `0x${string}`; to: `0x${string}`; value: bigint }) => void, filter?: { from: `0x${string}`; to: `0x${string}` }) => {
740
+ return this.publicClient.watchContractEvent({
741
+ address: this.contractAddress,
742
+ abi: TokenMintERC20Token_jsonAbi,
743
+ eventName: 'Transfer',
744
+ args: filter,
745
+ onLogs: (logs: any[]) => {
746
+ logs.forEach((log: any) => {
747
+ callback(log.args as any);
748
+ });
749
+ },
750
+ }) as () => void;
751
+ },
752
+ /**
753
+ * Watch Approval events
754
+ * @param callback Function to call when event is emitted
755
+ * @param filter Optional filter for indexed parameters
756
+ * @returns Unwatch function to stop listening
757
+ */
758
+ Approval: (callback: (event: { owner: `0x${string}`; spender: `0x${string}`; value: bigint }) => void, filter?: { owner: `0x${string}`; spender: `0x${string}` }) => {
759
+ return this.publicClient.watchContractEvent({
760
+ address: this.contractAddress,
761
+ abi: TokenMintERC20Token_jsonAbi,
762
+ eventName: 'Approval',
763
+ args: filter,
764
+ onLogs: (logs: any[]) => {
765
+ logs.forEach((log: any) => {
766
+ callback(log.args as any);
767
+ });
768
+ },
769
+ }) as () => void;
770
+ }
771
+ };
772
+ }
773
+ }