@gitmyabi/yee 1.0.0 → 1.0.2

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