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