@gitmyabi/clevcvx 1.0.0

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