@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,1233 @@
1
+ import type { Abi, Address, PublicClient, WalletClient, GetContractReturnType } from 'viem';
2
+ import { getContract } from 'viem';
3
+
4
+ /**
5
+ * DarkEnergyCrystals ABI
6
+ *
7
+ * This ABI is typed using viem's type system for full type safety.
8
+ */
9
+ export const DarkEnergyCrystalsAbi = [
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": "amount",
33
+ "type": "uint256"
34
+ }
35
+ ],
36
+ "name": "approve",
37
+ "outputs": [
38
+ {
39
+ "name": "",
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": "sender",
66
+ "type": "address"
67
+ },
68
+ {
69
+ "name": "recipient",
70
+ "type": "address"
71
+ },
72
+ {
73
+ "name": "amount",
74
+ "type": "uint256"
75
+ }
76
+ ],
77
+ "name": "transferFrom",
78
+ "outputs": [
79
+ {
80
+ "name": "",
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": "uint256"
96
+ }
97
+ ],
98
+ "payable": false,
99
+ "stateMutability": "view",
100
+ "type": "function"
101
+ },
102
+ {
103
+ "constant": false,
104
+ "inputs": [
105
+ {
106
+ "name": "spender",
107
+ "type": "address"
108
+ },
109
+ {
110
+ "name": "addedValue",
111
+ "type": "uint256"
112
+ }
113
+ ],
114
+ "name": "increaseAllowance",
115
+ "outputs": [
116
+ {
117
+ "name": "",
118
+ "type": "bool"
119
+ }
120
+ ],
121
+ "payable": false,
122
+ "stateMutability": "nonpayable",
123
+ "type": "function"
124
+ },
125
+ {
126
+ "constant": false,
127
+ "inputs": [
128
+ {
129
+ "name": "_quantity",
130
+ "type": "uint256"
131
+ }
132
+ ],
133
+ "name": "burn",
134
+ "outputs": [],
135
+ "payable": false,
136
+ "stateMutability": "nonpayable",
137
+ "type": "function"
138
+ },
139
+ {
140
+ "constant": true,
141
+ "inputs": [
142
+ {
143
+ "name": "account",
144
+ "type": "address"
145
+ }
146
+ ],
147
+ "name": "balanceOf",
148
+ "outputs": [
149
+ {
150
+ "name": "",
151
+ "type": "uint256"
152
+ }
153
+ ],
154
+ "payable": false,
155
+ "stateMutability": "view",
156
+ "type": "function"
157
+ },
158
+ {
159
+ "constant": false,
160
+ "inputs": [],
161
+ "name": "renounceOwnership",
162
+ "outputs": [],
163
+ "payable": false,
164
+ "stateMutability": "nonpayable",
165
+ "type": "function"
166
+ },
167
+ {
168
+ "constant": false,
169
+ "inputs": [
170
+ {
171
+ "name": "_holder",
172
+ "type": "address"
173
+ },
174
+ {
175
+ "name": "_quantity",
176
+ "type": "uint256"
177
+ }
178
+ ],
179
+ "name": "unlock",
180
+ "outputs": [],
181
+ "payable": false,
182
+ "stateMutability": "nonpayable",
183
+ "type": "function"
184
+ },
185
+ {
186
+ "constant": true,
187
+ "inputs": [],
188
+ "name": "owner",
189
+ "outputs": [
190
+ {
191
+ "name": "",
192
+ "type": "address"
193
+ }
194
+ ],
195
+ "payable": false,
196
+ "stateMutability": "view",
197
+ "type": "function"
198
+ },
199
+ {
200
+ "constant": true,
201
+ "inputs": [],
202
+ "name": "isOwner",
203
+ "outputs": [
204
+ {
205
+ "name": "",
206
+ "type": "bool"
207
+ }
208
+ ],
209
+ "payable": false,
210
+ "stateMutability": "view",
211
+ "type": "function"
212
+ },
213
+ {
214
+ "constant": true,
215
+ "inputs": [],
216
+ "name": "symbol",
217
+ "outputs": [
218
+ {
219
+ "name": "",
220
+ "type": "string"
221
+ }
222
+ ],
223
+ "payable": false,
224
+ "stateMutability": "view",
225
+ "type": "function"
226
+ },
227
+ {
228
+ "constant": false,
229
+ "inputs": [
230
+ {
231
+ "name": "_quantity",
232
+ "type": "uint256"
233
+ }
234
+ ],
235
+ "name": "mint",
236
+ "outputs": [],
237
+ "payable": false,
238
+ "stateMutability": "nonpayable",
239
+ "type": "function"
240
+ },
241
+ {
242
+ "constant": false,
243
+ "inputs": [
244
+ {
245
+ "name": "spender",
246
+ "type": "address"
247
+ },
248
+ {
249
+ "name": "subtractedValue",
250
+ "type": "uint256"
251
+ }
252
+ ],
253
+ "name": "decreaseAllowance",
254
+ "outputs": [
255
+ {
256
+ "name": "",
257
+ "type": "bool"
258
+ }
259
+ ],
260
+ "payable": false,
261
+ "stateMutability": "nonpayable",
262
+ "type": "function"
263
+ },
264
+ {
265
+ "constant": false,
266
+ "inputs": [
267
+ {
268
+ "name": "recipient",
269
+ "type": "address"
270
+ },
271
+ {
272
+ "name": "amount",
273
+ "type": "uint256"
274
+ }
275
+ ],
276
+ "name": "transfer",
277
+ "outputs": [
278
+ {
279
+ "name": "",
280
+ "type": "bool"
281
+ }
282
+ ],
283
+ "payable": false,
284
+ "stateMutability": "nonpayable",
285
+ "type": "function"
286
+ },
287
+ {
288
+ "constant": true,
289
+ "inputs": [
290
+ {
291
+ "name": "owner",
292
+ "type": "address"
293
+ },
294
+ {
295
+ "name": "spender",
296
+ "type": "address"
297
+ }
298
+ ],
299
+ "name": "allowance",
300
+ "outputs": [
301
+ {
302
+ "name": "",
303
+ "type": "uint256"
304
+ }
305
+ ],
306
+ "payable": false,
307
+ "stateMutability": "view",
308
+ "type": "function"
309
+ },
310
+ {
311
+ "constant": false,
312
+ "inputs": [
313
+ {
314
+ "name": "_steemAddr",
315
+ "type": "string"
316
+ },
317
+ {
318
+ "name": "_quantity",
319
+ "type": "uint256"
320
+ }
321
+ ],
322
+ "name": "lock",
323
+ "outputs": [],
324
+ "payable": false,
325
+ "stateMutability": "nonpayable",
326
+ "type": "function"
327
+ },
328
+ {
329
+ "constant": false,
330
+ "inputs": [
331
+ {
332
+ "name": "newOwner",
333
+ "type": "address"
334
+ }
335
+ ],
336
+ "name": "transferOwnership",
337
+ "outputs": [],
338
+ "payable": false,
339
+ "stateMutability": "nonpayable",
340
+ "type": "function"
341
+ },
342
+ {
343
+ "constant": false,
344
+ "inputs": [
345
+ {
346
+ "name": "_newMinter",
347
+ "type": "address"
348
+ }
349
+ ],
350
+ "name": "setMinter",
351
+ "outputs": [],
352
+ "payable": false,
353
+ "stateMutability": "nonpayable",
354
+ "type": "function"
355
+ },
356
+ {
357
+ "anonymous": false,
358
+ "inputs": [
359
+ {
360
+ "indexed": true,
361
+ "name": "minter",
362
+ "type": "address"
363
+ }
364
+ ],
365
+ "name": "SetMinter",
366
+ "type": "event"
367
+ },
368
+ {
369
+ "anonymous": false,
370
+ "inputs": [
371
+ {
372
+ "indexed": true,
373
+ "name": "holder",
374
+ "type": "address"
375
+ },
376
+ {
377
+ "indexed": true,
378
+ "name": "amount",
379
+ "type": "uint256"
380
+ },
381
+ {
382
+ "indexed": false,
383
+ "name": "steemAddr",
384
+ "type": "string"
385
+ }
386
+ ],
387
+ "name": "LockCrystals",
388
+ "type": "event"
389
+ },
390
+ {
391
+ "anonymous": false,
392
+ "inputs": [
393
+ {
394
+ "indexed": true,
395
+ "name": "previousOwner",
396
+ "type": "address"
397
+ },
398
+ {
399
+ "indexed": true,
400
+ "name": "newOwner",
401
+ "type": "address"
402
+ }
403
+ ],
404
+ "name": "OwnershipTransferred",
405
+ "type": "event"
406
+ },
407
+ {
408
+ "anonymous": false,
409
+ "inputs": [
410
+ {
411
+ "indexed": true,
412
+ "name": "from",
413
+ "type": "address"
414
+ },
415
+ {
416
+ "indexed": true,
417
+ "name": "to",
418
+ "type": "address"
419
+ },
420
+ {
421
+ "indexed": false,
422
+ "name": "value",
423
+ "type": "uint256"
424
+ }
425
+ ],
426
+ "name": "Transfer",
427
+ "type": "event"
428
+ },
429
+ {
430
+ "anonymous": false,
431
+ "inputs": [
432
+ {
433
+ "indexed": true,
434
+ "name": "owner",
435
+ "type": "address"
436
+ },
437
+ {
438
+ "indexed": true,
439
+ "name": "spender",
440
+ "type": "address"
441
+ },
442
+ {
443
+ "indexed": false,
444
+ "name": "value",
445
+ "type": "uint256"
446
+ }
447
+ ],
448
+ "name": "Approval",
449
+ "type": "event"
450
+ }
451
+ ] as const satisfies Abi;
452
+
453
+ /**
454
+ * Type-safe ABI for DarkEnergyCrystals
455
+ */
456
+ export type DarkEnergyCrystalsAbi = typeof DarkEnergyCrystalsAbi;
457
+
458
+ /**
459
+ * Contract instance type for DarkEnergyCrystals
460
+ */
461
+ // Use any for contract type to avoid complex viem type issues
462
+ // The runtime behavior is type-safe through viem's ABI typing
463
+ export type DarkEnergyCrystalsContract = any;
464
+
465
+ /**
466
+ * DarkEnergyCrystals Contract Class
467
+ *
468
+ * Provides a class-based API similar to TypeChain for interacting with the contract.
469
+ *
470
+ * @example
471
+ * ```typescript
472
+ * import { createPublicClient, createWalletClient, http } from 'viem';
473
+ * import { mainnet } from 'viem/chains';
474
+ * import { DarkEnergyCrystals } from 'DarkEnergyCrystals';
475
+ *
476
+ * const publicClient = createPublicClient({ chain: mainnet, transport: http() });
477
+ * const walletClient = createWalletClient({ chain: mainnet, transport: http() });
478
+ *
479
+ * const contract = new DarkEnergyCrystals('0x...', { publicClient, walletClient });
480
+ *
481
+ * // Read functions
482
+ * const result = await contract.balanceOf('0x...');
483
+ *
484
+ * // Write functions
485
+ * const hash = await contract.transfer('0x...', 1000n);
486
+ *
487
+ * // Simulate transactions (dry-run)
488
+ * const simulation = await contract.simulate.transfer('0x...', 1000n);
489
+ * console.log('Gas estimate:', simulation.request.gas);
490
+ *
491
+ * // Watch events
492
+ * const unwatch = contract.watch.Transfer((event) => {
493
+ * console.log('Transfer event:', event);
494
+ * });
495
+ * ```
496
+ */
497
+ export class DarkEnergyCrystals {
498
+ private contract: DarkEnergyCrystalsContract;
499
+ private contractAddress: Address;
500
+ private publicClient: PublicClient;
501
+
502
+ constructor(
503
+ address: Address,
504
+ clients: {
505
+ publicClient: PublicClient;
506
+ walletClient?: WalletClient;
507
+ }
508
+ ) {
509
+ this.contractAddress = address;
510
+ this.publicClient = clients.publicClient;
511
+ this.contract = getContract({
512
+ address,
513
+ abi: DarkEnergyCrystalsAbi,
514
+ client: {
515
+ public: clients.publicClient,
516
+ wallet: clients.walletClient,
517
+ },
518
+ });
519
+ }
520
+
521
+ /**
522
+ * Get the contract address
523
+ */
524
+ get address(): Address {
525
+ return this.contractAddress;
526
+ }
527
+
528
+ /**
529
+ * Get the underlying viem contract instance.
530
+ */
531
+ getContract(): DarkEnergyCrystalsContract {
532
+ return this.contract;
533
+ }
534
+
535
+ /**
536
+ * name
537
+ * view
538
+ */
539
+ async name(): Promise<string> {
540
+ return this.contract.read.name() as Promise<string>;
541
+ }
542
+
543
+ /**
544
+ * totalSupply
545
+ * view
546
+ */
547
+ async totalSupply(): Promise<bigint> {
548
+ return this.contract.read.totalSupply() as Promise<bigint>;
549
+ }
550
+
551
+ /**
552
+ * decimals
553
+ * view
554
+ */
555
+ async decimals(): Promise<bigint> {
556
+ return this.contract.read.decimals() as Promise<bigint>;
557
+ }
558
+
559
+ /**
560
+ * balanceOf
561
+ * view
562
+ */
563
+ async balanceOf(account: `0x${string}`): Promise<bigint> {
564
+ return this.contract.read.balanceOf([account] as const) as Promise<bigint>;
565
+ }
566
+
567
+ /**
568
+ * owner
569
+ * view
570
+ */
571
+ async owner(): Promise<`0x${string}`> {
572
+ return this.contract.read.owner() as Promise<`0x${string}`>;
573
+ }
574
+
575
+ /**
576
+ * isOwner
577
+ * view
578
+ */
579
+ async isOwner(): Promise<boolean> {
580
+ return this.contract.read.isOwner() as Promise<boolean>;
581
+ }
582
+
583
+ /**
584
+ * symbol
585
+ * view
586
+ */
587
+ async symbol(): Promise<string> {
588
+ return this.contract.read.symbol() as Promise<string>;
589
+ }
590
+
591
+ /**
592
+ * allowance
593
+ * view
594
+ */
595
+ async allowance(owner: `0x${string}`, spender: `0x${string}`): Promise<bigint> {
596
+ return this.contract.read.allowance([owner, spender] as const) as Promise<bigint>;
597
+ }
598
+
599
+ /**
600
+ * approve
601
+ * nonpayable
602
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
603
+ */
604
+ async approve(spender: `0x${string}`, amount: bigint, options?: {
605
+ accessList?: import('viem').AccessList;
606
+ authorizationList?: import('viem').AuthorizationList;
607
+ chain?: import('viem').Chain | null;
608
+ dataSuffix?: `0x${string}`;
609
+ gas?: bigint;
610
+ gasPrice?: bigint;
611
+ maxFeePerGas?: bigint;
612
+ maxPriorityFeePerGas?: bigint;
613
+ nonce?: number;
614
+ value?: bigint;
615
+ }): Promise<`0x${string}`> {
616
+ if (!this.contract.write) {
617
+ throw new Error('Wallet client is required for write operations');
618
+ }
619
+ return this.contract.write.approve([spender, amount] as const, options) as Promise<`0x${string}`>;
620
+ }
621
+
622
+ /**
623
+ * transferFrom
624
+ * nonpayable
625
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
626
+ */
627
+ async transferFrom(sender: `0x${string}`, recipient: `0x${string}`, amount: bigint, options?: {
628
+ accessList?: import('viem').AccessList;
629
+ authorizationList?: import('viem').AuthorizationList;
630
+ chain?: import('viem').Chain | null;
631
+ dataSuffix?: `0x${string}`;
632
+ gas?: bigint;
633
+ gasPrice?: bigint;
634
+ maxFeePerGas?: bigint;
635
+ maxPriorityFeePerGas?: bigint;
636
+ nonce?: number;
637
+ value?: bigint;
638
+ }): Promise<`0x${string}`> {
639
+ if (!this.contract.write) {
640
+ throw new Error('Wallet client is required for write operations');
641
+ }
642
+ return this.contract.write.transferFrom([sender, recipient, amount] as const, options) as Promise<`0x${string}`>;
643
+ }
644
+
645
+ /**
646
+ * increaseAllowance
647
+ * nonpayable
648
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
649
+ */
650
+ async increaseAllowance(spender: `0x${string}`, addedValue: bigint, options?: {
651
+ accessList?: import('viem').AccessList;
652
+ authorizationList?: import('viem').AuthorizationList;
653
+ chain?: import('viem').Chain | null;
654
+ dataSuffix?: `0x${string}`;
655
+ gas?: bigint;
656
+ gasPrice?: bigint;
657
+ maxFeePerGas?: bigint;
658
+ maxPriorityFeePerGas?: bigint;
659
+ nonce?: number;
660
+ value?: bigint;
661
+ }): Promise<`0x${string}`> {
662
+ if (!this.contract.write) {
663
+ throw new Error('Wallet client is required for write operations');
664
+ }
665
+ return this.contract.write.increaseAllowance([spender, addedValue] as const, options) as Promise<`0x${string}`>;
666
+ }
667
+
668
+ /**
669
+ * burn
670
+ * nonpayable
671
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
672
+ */
673
+ async burn(_quantity: bigint, options?: {
674
+ accessList?: import('viem').AccessList;
675
+ authorizationList?: import('viem').AuthorizationList;
676
+ chain?: import('viem').Chain | null;
677
+ dataSuffix?: `0x${string}`;
678
+ gas?: bigint;
679
+ gasPrice?: bigint;
680
+ maxFeePerGas?: bigint;
681
+ maxPriorityFeePerGas?: bigint;
682
+ nonce?: number;
683
+ value?: bigint;
684
+ }): Promise<`0x${string}`> {
685
+ if (!this.contract.write) {
686
+ throw new Error('Wallet client is required for write operations');
687
+ }
688
+ return this.contract.write.burn([_quantity] as const, options) as Promise<`0x${string}`>;
689
+ }
690
+
691
+ /**
692
+ * renounceOwnership
693
+ * nonpayable
694
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
695
+ */
696
+ async renounceOwnership(options?: {
697
+ accessList?: import('viem').AccessList;
698
+ authorizationList?: import('viem').AuthorizationList;
699
+ chain?: import('viem').Chain | null;
700
+ dataSuffix?: `0x${string}`;
701
+ gas?: bigint;
702
+ gasPrice?: bigint;
703
+ maxFeePerGas?: bigint;
704
+ maxPriorityFeePerGas?: bigint;
705
+ nonce?: number;
706
+ value?: bigint;
707
+ }): Promise<`0x${string}`> {
708
+ if (!this.contract.write) {
709
+ throw new Error('Wallet client is required for write operations');
710
+ }
711
+ return this.contract.write.renounceOwnership(options) as Promise<`0x${string}`>;
712
+ }
713
+
714
+ /**
715
+ * unlock
716
+ * nonpayable
717
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
718
+ */
719
+ async unlock(_holder: `0x${string}`, _quantity: bigint, options?: {
720
+ accessList?: import('viem').AccessList;
721
+ authorizationList?: import('viem').AuthorizationList;
722
+ chain?: import('viem').Chain | null;
723
+ dataSuffix?: `0x${string}`;
724
+ gas?: bigint;
725
+ gasPrice?: bigint;
726
+ maxFeePerGas?: bigint;
727
+ maxPriorityFeePerGas?: bigint;
728
+ nonce?: number;
729
+ value?: bigint;
730
+ }): Promise<`0x${string}`> {
731
+ if (!this.contract.write) {
732
+ throw new Error('Wallet client is required for write operations');
733
+ }
734
+ return this.contract.write.unlock([_holder, _quantity] as const, options) as Promise<`0x${string}`>;
735
+ }
736
+
737
+ /**
738
+ * mint
739
+ * nonpayable
740
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
741
+ */
742
+ async mint(_quantity: bigint, options?: {
743
+ accessList?: import('viem').AccessList;
744
+ authorizationList?: import('viem').AuthorizationList;
745
+ chain?: import('viem').Chain | null;
746
+ dataSuffix?: `0x${string}`;
747
+ gas?: bigint;
748
+ gasPrice?: bigint;
749
+ maxFeePerGas?: bigint;
750
+ maxPriorityFeePerGas?: bigint;
751
+ nonce?: number;
752
+ value?: bigint;
753
+ }): Promise<`0x${string}`> {
754
+ if (!this.contract.write) {
755
+ throw new Error('Wallet client is required for write operations');
756
+ }
757
+ return this.contract.write.mint([_quantity] as const, options) as Promise<`0x${string}`>;
758
+ }
759
+
760
+ /**
761
+ * decreaseAllowance
762
+ * nonpayable
763
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
764
+ */
765
+ async decreaseAllowance(spender: `0x${string}`, subtractedValue: bigint, options?: {
766
+ accessList?: import('viem').AccessList;
767
+ authorizationList?: import('viem').AuthorizationList;
768
+ chain?: import('viem').Chain | null;
769
+ dataSuffix?: `0x${string}`;
770
+ gas?: bigint;
771
+ gasPrice?: bigint;
772
+ maxFeePerGas?: bigint;
773
+ maxPriorityFeePerGas?: bigint;
774
+ nonce?: number;
775
+ value?: bigint;
776
+ }): Promise<`0x${string}`> {
777
+ if (!this.contract.write) {
778
+ throw new Error('Wallet client is required for write operations');
779
+ }
780
+ return this.contract.write.decreaseAllowance([spender, subtractedValue] as const, options) as Promise<`0x${string}`>;
781
+ }
782
+
783
+ /**
784
+ * transfer
785
+ * nonpayable
786
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
787
+ */
788
+ async transfer(recipient: `0x${string}`, amount: bigint, options?: {
789
+ accessList?: import('viem').AccessList;
790
+ authorizationList?: import('viem').AuthorizationList;
791
+ chain?: import('viem').Chain | null;
792
+ dataSuffix?: `0x${string}`;
793
+ gas?: bigint;
794
+ gasPrice?: bigint;
795
+ maxFeePerGas?: bigint;
796
+ maxPriorityFeePerGas?: bigint;
797
+ nonce?: number;
798
+ value?: bigint;
799
+ }): Promise<`0x${string}`> {
800
+ if (!this.contract.write) {
801
+ throw new Error('Wallet client is required for write operations');
802
+ }
803
+ return this.contract.write.transfer([recipient, amount] as const, options) as Promise<`0x${string}`>;
804
+ }
805
+
806
+ /**
807
+ * lock
808
+ * nonpayable
809
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
810
+ */
811
+ async lock(_steemAddr: string, _quantity: bigint, options?: {
812
+ accessList?: import('viem').AccessList;
813
+ authorizationList?: import('viem').AuthorizationList;
814
+ chain?: import('viem').Chain | null;
815
+ dataSuffix?: `0x${string}`;
816
+ gas?: bigint;
817
+ gasPrice?: bigint;
818
+ maxFeePerGas?: bigint;
819
+ maxPriorityFeePerGas?: bigint;
820
+ nonce?: number;
821
+ value?: bigint;
822
+ }): Promise<`0x${string}`> {
823
+ if (!this.contract.write) {
824
+ throw new Error('Wallet client is required for write operations');
825
+ }
826
+ return this.contract.write.lock([_steemAddr, _quantity] as const, options) as Promise<`0x${string}`>;
827
+ }
828
+
829
+ /**
830
+ * transferOwnership
831
+ * nonpayable
832
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
833
+ */
834
+ async transferOwnership(newOwner: `0x${string}`, options?: {
835
+ accessList?: import('viem').AccessList;
836
+ authorizationList?: import('viem').AuthorizationList;
837
+ chain?: import('viem').Chain | null;
838
+ dataSuffix?: `0x${string}`;
839
+ gas?: bigint;
840
+ gasPrice?: bigint;
841
+ maxFeePerGas?: bigint;
842
+ maxPriorityFeePerGas?: bigint;
843
+ nonce?: number;
844
+ value?: bigint;
845
+ }): Promise<`0x${string}`> {
846
+ if (!this.contract.write) {
847
+ throw new Error('Wallet client is required for write operations');
848
+ }
849
+ return this.contract.write.transferOwnership([newOwner] as const, options) as Promise<`0x${string}`>;
850
+ }
851
+
852
+ /**
853
+ * setMinter
854
+ * nonpayable
855
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
856
+ */
857
+ async setMinter(_newMinter: `0x${string}`, options?: {
858
+ accessList?: import('viem').AccessList;
859
+ authorizationList?: import('viem').AuthorizationList;
860
+ chain?: import('viem').Chain | null;
861
+ dataSuffix?: `0x${string}`;
862
+ gas?: bigint;
863
+ gasPrice?: bigint;
864
+ maxFeePerGas?: bigint;
865
+ maxPriorityFeePerGas?: bigint;
866
+ nonce?: number;
867
+ value?: bigint;
868
+ }): Promise<`0x${string}`> {
869
+ if (!this.contract.write) {
870
+ throw new Error('Wallet client is required for write operations');
871
+ }
872
+ return this.contract.write.setMinter([_newMinter] as const, options) as Promise<`0x${string}`>;
873
+ }
874
+
875
+
876
+
877
+ /**
878
+ * Simulate contract write operations (dry-run without sending transaction)
879
+ *
880
+ * @example
881
+ * const result = await contract.simulate.transfer('0x...', 1000n);
882
+ * console.log('Gas estimate:', result.request.gas);
883
+ * console.log('Would succeed:', result.result);
884
+ */
885
+ get simulate() {
886
+ const contract = this.contract;
887
+ if (!contract.simulate) {
888
+ throw new Error('Public client is required for simulation');
889
+ }
890
+ return {
891
+ /**
892
+ * Simulate approve
893
+ * Returns gas estimate and result without sending transaction
894
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
895
+ */
896
+ async approve(spender: `0x${string}`, amount: bigint, options?: {
897
+ accessList?: import('viem').AccessList;
898
+ authorizationList?: import('viem').AuthorizationList;
899
+ chain?: import('viem').Chain | null;
900
+ dataSuffix?: `0x${string}`;
901
+ gas?: bigint;
902
+ gasPrice?: bigint;
903
+ maxFeePerGas?: bigint;
904
+ maxPriorityFeePerGas?: bigint;
905
+ nonce?: number;
906
+ value?: bigint;
907
+ }): Promise<boolean> {
908
+ return contract.simulate.approve([spender, amount] as const, options) as Promise<boolean>;
909
+ },
910
+ /**
911
+ * Simulate transferFrom
912
+ * Returns gas estimate and result without sending transaction
913
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
914
+ */
915
+ async transferFrom(sender: `0x${string}`, recipient: `0x${string}`, amount: bigint, options?: {
916
+ accessList?: import('viem').AccessList;
917
+ authorizationList?: import('viem').AuthorizationList;
918
+ chain?: import('viem').Chain | null;
919
+ dataSuffix?: `0x${string}`;
920
+ gas?: bigint;
921
+ gasPrice?: bigint;
922
+ maxFeePerGas?: bigint;
923
+ maxPriorityFeePerGas?: bigint;
924
+ nonce?: number;
925
+ value?: bigint;
926
+ }): Promise<boolean> {
927
+ return contract.simulate.transferFrom([sender, recipient, amount] as const, options) as Promise<boolean>;
928
+ },
929
+ /**
930
+ * Simulate increaseAllowance
931
+ * Returns gas estimate and result without sending transaction
932
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
933
+ */
934
+ async increaseAllowance(spender: `0x${string}`, addedValue: bigint, options?: {
935
+ accessList?: import('viem').AccessList;
936
+ authorizationList?: import('viem').AuthorizationList;
937
+ chain?: import('viem').Chain | null;
938
+ dataSuffix?: `0x${string}`;
939
+ gas?: bigint;
940
+ gasPrice?: bigint;
941
+ maxFeePerGas?: bigint;
942
+ maxPriorityFeePerGas?: bigint;
943
+ nonce?: number;
944
+ value?: bigint;
945
+ }): Promise<boolean> {
946
+ return contract.simulate.increaseAllowance([spender, addedValue] as const, options) as Promise<boolean>;
947
+ },
948
+ /**
949
+ * Simulate burn
950
+ * Returns gas estimate and result without sending transaction
951
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
952
+ */
953
+ async burn(_quantity: bigint, options?: {
954
+ accessList?: import('viem').AccessList;
955
+ authorizationList?: import('viem').AuthorizationList;
956
+ chain?: import('viem').Chain | null;
957
+ dataSuffix?: `0x${string}`;
958
+ gas?: bigint;
959
+ gasPrice?: bigint;
960
+ maxFeePerGas?: bigint;
961
+ maxPriorityFeePerGas?: bigint;
962
+ nonce?: number;
963
+ value?: bigint;
964
+ }): Promise<void> {
965
+ return contract.simulate.burn([_quantity] as const, options) as Promise<void>;
966
+ },
967
+ /**
968
+ * Simulate renounceOwnership
969
+ * Returns gas estimate and result without sending transaction
970
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
971
+ */
972
+ async renounceOwnership(options?: {
973
+ accessList?: import('viem').AccessList;
974
+ authorizationList?: import('viem').AuthorizationList;
975
+ chain?: import('viem').Chain | null;
976
+ dataSuffix?: `0x${string}`;
977
+ gas?: bigint;
978
+ gasPrice?: bigint;
979
+ maxFeePerGas?: bigint;
980
+ maxPriorityFeePerGas?: bigint;
981
+ nonce?: number;
982
+ value?: bigint;
983
+ }): Promise<void> {
984
+ return contract.simulate.renounceOwnership(options) as Promise<void>;
985
+ },
986
+ /**
987
+ * Simulate unlock
988
+ * Returns gas estimate and result without sending transaction
989
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
990
+ */
991
+ async unlock(_holder: `0x${string}`, _quantity: bigint, options?: {
992
+ accessList?: import('viem').AccessList;
993
+ authorizationList?: import('viem').AuthorizationList;
994
+ chain?: import('viem').Chain | null;
995
+ dataSuffix?: `0x${string}`;
996
+ gas?: bigint;
997
+ gasPrice?: bigint;
998
+ maxFeePerGas?: bigint;
999
+ maxPriorityFeePerGas?: bigint;
1000
+ nonce?: number;
1001
+ value?: bigint;
1002
+ }): Promise<void> {
1003
+ return contract.simulate.unlock([_holder, _quantity] as const, options) as Promise<void>;
1004
+ },
1005
+ /**
1006
+ * Simulate mint
1007
+ * Returns gas estimate and result without sending transaction
1008
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1009
+ */
1010
+ async mint(_quantity: bigint, options?: {
1011
+ accessList?: import('viem').AccessList;
1012
+ authorizationList?: import('viem').AuthorizationList;
1013
+ chain?: import('viem').Chain | null;
1014
+ dataSuffix?: `0x${string}`;
1015
+ gas?: bigint;
1016
+ gasPrice?: bigint;
1017
+ maxFeePerGas?: bigint;
1018
+ maxPriorityFeePerGas?: bigint;
1019
+ nonce?: number;
1020
+ value?: bigint;
1021
+ }): Promise<void> {
1022
+ return contract.simulate.mint([_quantity] as const, options) as Promise<void>;
1023
+ },
1024
+ /**
1025
+ * Simulate decreaseAllowance
1026
+ * Returns gas estimate and result without sending transaction
1027
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1028
+ */
1029
+ async decreaseAllowance(spender: `0x${string}`, subtractedValue: bigint, options?: {
1030
+ accessList?: import('viem').AccessList;
1031
+ authorizationList?: import('viem').AuthorizationList;
1032
+ chain?: import('viem').Chain | null;
1033
+ dataSuffix?: `0x${string}`;
1034
+ gas?: bigint;
1035
+ gasPrice?: bigint;
1036
+ maxFeePerGas?: bigint;
1037
+ maxPriorityFeePerGas?: bigint;
1038
+ nonce?: number;
1039
+ value?: bigint;
1040
+ }): Promise<boolean> {
1041
+ return contract.simulate.decreaseAllowance([spender, subtractedValue] as const, options) as Promise<boolean>;
1042
+ },
1043
+ /**
1044
+ * Simulate transfer
1045
+ * Returns gas estimate and result without sending transaction
1046
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1047
+ */
1048
+ async transfer(recipient: `0x${string}`, amount: bigint, options?: {
1049
+ accessList?: import('viem').AccessList;
1050
+ authorizationList?: import('viem').AuthorizationList;
1051
+ chain?: import('viem').Chain | null;
1052
+ dataSuffix?: `0x${string}`;
1053
+ gas?: bigint;
1054
+ gasPrice?: bigint;
1055
+ maxFeePerGas?: bigint;
1056
+ maxPriorityFeePerGas?: bigint;
1057
+ nonce?: number;
1058
+ value?: bigint;
1059
+ }): Promise<boolean> {
1060
+ return contract.simulate.transfer([recipient, amount] as const, options) as Promise<boolean>;
1061
+ },
1062
+ /**
1063
+ * Simulate lock
1064
+ * Returns gas estimate and result without sending transaction
1065
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1066
+ */
1067
+ async lock(_steemAddr: string, _quantity: bigint, options?: {
1068
+ accessList?: import('viem').AccessList;
1069
+ authorizationList?: import('viem').AuthorizationList;
1070
+ chain?: import('viem').Chain | null;
1071
+ dataSuffix?: `0x${string}`;
1072
+ gas?: bigint;
1073
+ gasPrice?: bigint;
1074
+ maxFeePerGas?: bigint;
1075
+ maxPriorityFeePerGas?: bigint;
1076
+ nonce?: number;
1077
+ value?: bigint;
1078
+ }): Promise<void> {
1079
+ return contract.simulate.lock([_steemAddr, _quantity] as const, options) as Promise<void>;
1080
+ },
1081
+ /**
1082
+ * Simulate transferOwnership
1083
+ * Returns gas estimate and result without sending transaction
1084
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1085
+ */
1086
+ async transferOwnership(newOwner: `0x${string}`, options?: {
1087
+ accessList?: import('viem').AccessList;
1088
+ authorizationList?: import('viem').AuthorizationList;
1089
+ chain?: import('viem').Chain | null;
1090
+ dataSuffix?: `0x${string}`;
1091
+ gas?: bigint;
1092
+ gasPrice?: bigint;
1093
+ maxFeePerGas?: bigint;
1094
+ maxPriorityFeePerGas?: bigint;
1095
+ nonce?: number;
1096
+ value?: bigint;
1097
+ }): Promise<void> {
1098
+ return contract.simulate.transferOwnership([newOwner] as const, options) as Promise<void>;
1099
+ },
1100
+ /**
1101
+ * Simulate setMinter
1102
+ * Returns gas estimate and result without sending transaction
1103
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1104
+ */
1105
+ async setMinter(_newMinter: `0x${string}`, options?: {
1106
+ accessList?: import('viem').AccessList;
1107
+ authorizationList?: import('viem').AuthorizationList;
1108
+ chain?: import('viem').Chain | null;
1109
+ dataSuffix?: `0x${string}`;
1110
+ gas?: bigint;
1111
+ gasPrice?: bigint;
1112
+ maxFeePerGas?: bigint;
1113
+ maxPriorityFeePerGas?: bigint;
1114
+ nonce?: number;
1115
+ value?: bigint;
1116
+ }): Promise<void> {
1117
+ return contract.simulate.setMinter([_newMinter] as const, options) as Promise<void>;
1118
+ }
1119
+ };
1120
+ }
1121
+
1122
+ /**
1123
+ * Watch contract events
1124
+ *
1125
+ * @example
1126
+ * // Watch all Transfer events
1127
+ * const unwatch = contract.watch.Transfer((event) => {
1128
+ * console.log('Transfer:', event);
1129
+ * });
1130
+ *
1131
+ * // Stop watching
1132
+ * unwatch();
1133
+ */
1134
+ get watch() {
1135
+ return {
1136
+ /**
1137
+ * Watch SetMinter events
1138
+ * @param callback Function to call when event is emitted
1139
+ * @param filter Optional filter for indexed parameters
1140
+ * @returns Unwatch function to stop listening
1141
+ */
1142
+ SetMinter: (callback: (event: { minter: `0x${string}` }) => void, filter?: { minter?: `0x${string}` | `0x${string}`[] | null }) => {
1143
+ return this.publicClient.watchContractEvent({
1144
+ address: this.contractAddress,
1145
+ abi: DarkEnergyCrystalsAbi,
1146
+ eventName: 'SetMinter',
1147
+ args: filter as any,
1148
+ onLogs: (logs: any[]) => {
1149
+ logs.forEach((log: any) => {
1150
+ callback(log.args as any);
1151
+ });
1152
+ },
1153
+ }) as () => void;
1154
+ },
1155
+ /**
1156
+ * Watch LockCrystals events
1157
+ * @param callback Function to call when event is emitted
1158
+ * @param filter Optional filter for indexed parameters
1159
+ * @returns Unwatch function to stop listening
1160
+ */
1161
+ LockCrystals: (callback: (event: { holder: `0x${string}`; amount: bigint; steemAddr: string }) => void, filter?: { holder?: `0x${string}` | `0x${string}`[] | null; amount?: bigint | bigint[] | null }) => {
1162
+ return this.publicClient.watchContractEvent({
1163
+ address: this.contractAddress,
1164
+ abi: DarkEnergyCrystalsAbi,
1165
+ eventName: 'LockCrystals',
1166
+ args: filter as any,
1167
+ onLogs: (logs: any[]) => {
1168
+ logs.forEach((log: any) => {
1169
+ callback(log.args as any);
1170
+ });
1171
+ },
1172
+ }) as () => void;
1173
+ },
1174
+ /**
1175
+ * Watch OwnershipTransferred events
1176
+ * @param callback Function to call when event is emitted
1177
+ * @param filter Optional filter for indexed parameters
1178
+ * @returns Unwatch function to stop listening
1179
+ */
1180
+ OwnershipTransferred: (callback: (event: { previousOwner: `0x${string}`; newOwner: `0x${string}` }) => void, filter?: { previousOwner?: `0x${string}` | `0x${string}`[] | null; newOwner?: `0x${string}` | `0x${string}`[] | null }) => {
1181
+ return this.publicClient.watchContractEvent({
1182
+ address: this.contractAddress,
1183
+ abi: DarkEnergyCrystalsAbi,
1184
+ eventName: 'OwnershipTransferred',
1185
+ args: filter as any,
1186
+ onLogs: (logs: any[]) => {
1187
+ logs.forEach((log: any) => {
1188
+ callback(log.args as any);
1189
+ });
1190
+ },
1191
+ }) as () => void;
1192
+ },
1193
+ /**
1194
+ * Watch Transfer events
1195
+ * @param callback Function to call when event is emitted
1196
+ * @param filter Optional filter for indexed parameters
1197
+ * @returns Unwatch function to stop listening
1198
+ */
1199
+ 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 }) => {
1200
+ return this.publicClient.watchContractEvent({
1201
+ address: this.contractAddress,
1202
+ abi: DarkEnergyCrystalsAbi,
1203
+ eventName: 'Transfer',
1204
+ args: filter as any,
1205
+ onLogs: (logs: any[]) => {
1206
+ logs.forEach((log: any) => {
1207
+ callback(log.args as any);
1208
+ });
1209
+ },
1210
+ }) as () => void;
1211
+ },
1212
+ /**
1213
+ * Watch Approval events
1214
+ * @param callback Function to call when event is emitted
1215
+ * @param filter Optional filter for indexed parameters
1216
+ * @returns Unwatch function to stop listening
1217
+ */
1218
+ 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 }) => {
1219
+ return this.publicClient.watchContractEvent({
1220
+ address: this.contractAddress,
1221
+ abi: DarkEnergyCrystalsAbi,
1222
+ eventName: 'Approval',
1223
+ args: filter as any,
1224
+ onLogs: (logs: any[]) => {
1225
+ logs.forEach((log: any) => {
1226
+ callback(log.args as any);
1227
+ });
1228
+ },
1229
+ }) as () => void;
1230
+ }
1231
+ };
1232
+ }
1233
+ }