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