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