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