@gitmyabi-stg/lpt 0.0.1

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