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