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