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