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