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