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