@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,1769 @@
1
+ import type { Abi, Address, PublicClient, WalletClient, GetContractReturnType } from 'viem';
2
+ import { getContract } from 'viem';
3
+
4
+ /**
5
+ * ShareToken ABI
6
+ *
7
+ * This ABI is typed using viem's type system for full type safety.
8
+ */
9
+ export const ShareTokenAbi = [
10
+ {
11
+ "inputs": [
12
+ {
13
+ "internalType": "uint8",
14
+ "name": "decimals_",
15
+ "type": "uint8"
16
+ }
17
+ ],
18
+ "stateMutability": "nonpayable",
19
+ "type": "constructor"
20
+ },
21
+ {
22
+ "inputs": [],
23
+ "name": "ExceedsMaxSupply",
24
+ "type": "error"
25
+ },
26
+ {
27
+ "inputs": [],
28
+ "name": "FileUnrecognizedParam",
29
+ "type": "error"
30
+ },
31
+ {
32
+ "inputs": [],
33
+ "name": "InsufficientAllowance",
34
+ "type": "error"
35
+ },
36
+ {
37
+ "inputs": [],
38
+ "name": "InsufficientBalance",
39
+ "type": "error"
40
+ },
41
+ {
42
+ "inputs": [],
43
+ "name": "InvalidAddress",
44
+ "type": "error"
45
+ },
46
+ {
47
+ "inputs": [],
48
+ "name": "InvalidPermit",
49
+ "type": "error"
50
+ },
51
+ {
52
+ "inputs": [],
53
+ "name": "InvalidSigner",
54
+ "type": "error"
55
+ },
56
+ {
57
+ "inputs": [],
58
+ "name": "NotAuthorized",
59
+ "type": "error"
60
+ },
61
+ {
62
+ "inputs": [],
63
+ "name": "NotAuthorizedOrHook",
64
+ "type": "error"
65
+ },
66
+ {
67
+ "inputs": [],
68
+ "name": "PermitExpired",
69
+ "type": "error"
70
+ },
71
+ {
72
+ "inputs": [],
73
+ "name": "RestrictionsFailed",
74
+ "type": "error"
75
+ },
76
+ {
77
+ "inputs": [],
78
+ "name": "Uint128_Overflow",
79
+ "type": "error"
80
+ },
81
+ {
82
+ "anonymous": false,
83
+ "inputs": [
84
+ {
85
+ "indexed": true,
86
+ "internalType": "address",
87
+ "name": "owner",
88
+ "type": "address"
89
+ },
90
+ {
91
+ "indexed": true,
92
+ "internalType": "address",
93
+ "name": "spender",
94
+ "type": "address"
95
+ },
96
+ {
97
+ "indexed": false,
98
+ "internalType": "uint256",
99
+ "name": "value",
100
+ "type": "uint256"
101
+ }
102
+ ],
103
+ "name": "Approval",
104
+ "type": "event"
105
+ },
106
+ {
107
+ "anonymous": false,
108
+ "inputs": [
109
+ {
110
+ "indexed": true,
111
+ "internalType": "address",
112
+ "name": "user",
113
+ "type": "address"
114
+ }
115
+ ],
116
+ "name": "Deny",
117
+ "type": "event"
118
+ },
119
+ {
120
+ "anonymous": false,
121
+ "inputs": [
122
+ {
123
+ "indexed": true,
124
+ "internalType": "bytes32",
125
+ "name": "what",
126
+ "type": "bytes32"
127
+ },
128
+ {
129
+ "indexed": false,
130
+ "internalType": "address",
131
+ "name": "data",
132
+ "type": "address"
133
+ }
134
+ ],
135
+ "name": "File",
136
+ "type": "event"
137
+ },
138
+ {
139
+ "anonymous": false,
140
+ "inputs": [
141
+ {
142
+ "indexed": true,
143
+ "internalType": "bytes32",
144
+ "name": "what",
145
+ "type": "bytes32"
146
+ },
147
+ {
148
+ "indexed": false,
149
+ "internalType": "string",
150
+ "name": "data",
151
+ "type": "string"
152
+ }
153
+ ],
154
+ "name": "File",
155
+ "type": "event"
156
+ },
157
+ {
158
+ "anonymous": false,
159
+ "inputs": [
160
+ {
161
+ "indexed": true,
162
+ "internalType": "address",
163
+ "name": "user",
164
+ "type": "address"
165
+ }
166
+ ],
167
+ "name": "Rely",
168
+ "type": "event"
169
+ },
170
+ {
171
+ "anonymous": false,
172
+ "inputs": [
173
+ {
174
+ "indexed": true,
175
+ "internalType": "address",
176
+ "name": "user",
177
+ "type": "address"
178
+ },
179
+ {
180
+ "indexed": false,
181
+ "internalType": "bytes16",
182
+ "name": "data",
183
+ "type": "bytes16"
184
+ }
185
+ ],
186
+ "name": "SetHookData",
187
+ "type": "event"
188
+ },
189
+ {
190
+ "anonymous": false,
191
+ "inputs": [
192
+ {
193
+ "indexed": true,
194
+ "internalType": "address",
195
+ "name": "from",
196
+ "type": "address"
197
+ },
198
+ {
199
+ "indexed": true,
200
+ "internalType": "address",
201
+ "name": "to",
202
+ "type": "address"
203
+ },
204
+ {
205
+ "indexed": false,
206
+ "internalType": "uint256",
207
+ "name": "value",
208
+ "type": "uint256"
209
+ }
210
+ ],
211
+ "name": "Transfer",
212
+ "type": "event"
213
+ },
214
+ {
215
+ "anonymous": false,
216
+ "inputs": [
217
+ {
218
+ "indexed": true,
219
+ "internalType": "address",
220
+ "name": "asset",
221
+ "type": "address"
222
+ },
223
+ {
224
+ "indexed": false,
225
+ "internalType": "address",
226
+ "name": "vault",
227
+ "type": "address"
228
+ }
229
+ ],
230
+ "name": "VaultUpdate",
231
+ "type": "event"
232
+ },
233
+ {
234
+ "inputs": [],
235
+ "name": "DOMAIN_SEPARATOR",
236
+ "outputs": [
237
+ {
238
+ "internalType": "bytes32",
239
+ "name": "",
240
+ "type": "bytes32"
241
+ }
242
+ ],
243
+ "stateMutability": "view",
244
+ "type": "function"
245
+ },
246
+ {
247
+ "inputs": [],
248
+ "name": "PERMIT_TYPEHASH",
249
+ "outputs": [
250
+ {
251
+ "internalType": "bytes32",
252
+ "name": "",
253
+ "type": "bytes32"
254
+ }
255
+ ],
256
+ "stateMutability": "view",
257
+ "type": "function"
258
+ },
259
+ {
260
+ "inputs": [
261
+ {
262
+ "internalType": "address",
263
+ "name": "",
264
+ "type": "address"
265
+ },
266
+ {
267
+ "internalType": "address",
268
+ "name": "",
269
+ "type": "address"
270
+ }
271
+ ],
272
+ "name": "allowance",
273
+ "outputs": [
274
+ {
275
+ "internalType": "uint256",
276
+ "name": "",
277
+ "type": "uint256"
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": "value",
293
+ "type": "uint256"
294
+ }
295
+ ],
296
+ "name": "approve",
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": "sender",
312
+ "type": "address"
313
+ },
314
+ {
315
+ "internalType": "address",
316
+ "name": "from",
317
+ "type": "address"
318
+ },
319
+ {
320
+ "internalType": "address",
321
+ "name": "to",
322
+ "type": "address"
323
+ },
324
+ {
325
+ "internalType": "uint256",
326
+ "name": "value",
327
+ "type": "uint256"
328
+ }
329
+ ],
330
+ "name": "authTransferFrom",
331
+ "outputs": [
332
+ {
333
+ "internalType": "bool",
334
+ "name": "success",
335
+ "type": "bool"
336
+ }
337
+ ],
338
+ "stateMutability": "nonpayable",
339
+ "type": "function"
340
+ },
341
+ {
342
+ "inputs": [
343
+ {
344
+ "internalType": "address",
345
+ "name": "user",
346
+ "type": "address"
347
+ }
348
+ ],
349
+ "name": "balanceOf",
350
+ "outputs": [
351
+ {
352
+ "internalType": "uint256",
353
+ "name": "",
354
+ "type": "uint256"
355
+ }
356
+ ],
357
+ "stateMutability": "view",
358
+ "type": "function"
359
+ },
360
+ {
361
+ "inputs": [
362
+ {
363
+ "internalType": "address",
364
+ "name": "from",
365
+ "type": "address"
366
+ },
367
+ {
368
+ "internalType": "uint256",
369
+ "name": "value",
370
+ "type": "uint256"
371
+ }
372
+ ],
373
+ "name": "burn",
374
+ "outputs": [],
375
+ "stateMutability": "nonpayable",
376
+ "type": "function"
377
+ },
378
+ {
379
+ "inputs": [
380
+ {
381
+ "internalType": "address",
382
+ "name": "from",
383
+ "type": "address"
384
+ },
385
+ {
386
+ "internalType": "address",
387
+ "name": "to",
388
+ "type": "address"
389
+ },
390
+ {
391
+ "internalType": "uint256",
392
+ "name": "value",
393
+ "type": "uint256"
394
+ }
395
+ ],
396
+ "name": "checkTransferRestriction",
397
+ "outputs": [
398
+ {
399
+ "internalType": "bool",
400
+ "name": "",
401
+ "type": "bool"
402
+ }
403
+ ],
404
+ "stateMutability": "view",
405
+ "type": "function"
406
+ },
407
+ {
408
+ "inputs": [],
409
+ "name": "decimals",
410
+ "outputs": [
411
+ {
412
+ "internalType": "uint8",
413
+ "name": "",
414
+ "type": "uint8"
415
+ }
416
+ ],
417
+ "stateMutability": "view",
418
+ "type": "function"
419
+ },
420
+ {
421
+ "inputs": [
422
+ {
423
+ "internalType": "address",
424
+ "name": "user",
425
+ "type": "address"
426
+ }
427
+ ],
428
+ "name": "deny",
429
+ "outputs": [],
430
+ "stateMutability": "nonpayable",
431
+ "type": "function"
432
+ },
433
+ {
434
+ "inputs": [],
435
+ "name": "deploymentChainId",
436
+ "outputs": [
437
+ {
438
+ "internalType": "uint256",
439
+ "name": "",
440
+ "type": "uint256"
441
+ }
442
+ ],
443
+ "stateMutability": "view",
444
+ "type": "function"
445
+ },
446
+ {
447
+ "inputs": [
448
+ {
449
+ "internalType": "address",
450
+ "name": "from",
451
+ "type": "address"
452
+ },
453
+ {
454
+ "internalType": "address",
455
+ "name": "to",
456
+ "type": "address"
457
+ },
458
+ {
459
+ "internalType": "uint256",
460
+ "name": "value",
461
+ "type": "uint256"
462
+ }
463
+ ],
464
+ "name": "detectTransferRestriction",
465
+ "outputs": [
466
+ {
467
+ "internalType": "uint8",
468
+ "name": "",
469
+ "type": "uint8"
470
+ }
471
+ ],
472
+ "stateMutability": "view",
473
+ "type": "function"
474
+ },
475
+ {
476
+ "inputs": [
477
+ {
478
+ "internalType": "bytes32",
479
+ "name": "what",
480
+ "type": "bytes32"
481
+ },
482
+ {
483
+ "internalType": "string",
484
+ "name": "data",
485
+ "type": "string"
486
+ }
487
+ ],
488
+ "name": "file",
489
+ "outputs": [],
490
+ "stateMutability": "nonpayable",
491
+ "type": "function"
492
+ },
493
+ {
494
+ "inputs": [
495
+ {
496
+ "internalType": "bytes32",
497
+ "name": "what",
498
+ "type": "bytes32"
499
+ },
500
+ {
501
+ "internalType": "address",
502
+ "name": "data",
503
+ "type": "address"
504
+ }
505
+ ],
506
+ "name": "file",
507
+ "outputs": [],
508
+ "stateMutability": "nonpayable",
509
+ "type": "function"
510
+ },
511
+ {
512
+ "inputs": [],
513
+ "name": "hook",
514
+ "outputs": [
515
+ {
516
+ "internalType": "address",
517
+ "name": "",
518
+ "type": "address"
519
+ }
520
+ ],
521
+ "stateMutability": "view",
522
+ "type": "function"
523
+ },
524
+ {
525
+ "inputs": [
526
+ {
527
+ "internalType": "address",
528
+ "name": "user",
529
+ "type": "address"
530
+ }
531
+ ],
532
+ "name": "hookDataOf",
533
+ "outputs": [
534
+ {
535
+ "internalType": "bytes16",
536
+ "name": "",
537
+ "type": "bytes16"
538
+ }
539
+ ],
540
+ "stateMutability": "view",
541
+ "type": "function"
542
+ },
543
+ {
544
+ "inputs": [
545
+ {
546
+ "internalType": "uint8",
547
+ "name": "restrictionCode",
548
+ "type": "uint8"
549
+ }
550
+ ],
551
+ "name": "messageForTransferRestriction",
552
+ "outputs": [
553
+ {
554
+ "internalType": "string",
555
+ "name": "",
556
+ "type": "string"
557
+ }
558
+ ],
559
+ "stateMutability": "pure",
560
+ "type": "function"
561
+ },
562
+ {
563
+ "inputs": [
564
+ {
565
+ "internalType": "address",
566
+ "name": "to",
567
+ "type": "address"
568
+ },
569
+ {
570
+ "internalType": "uint256",
571
+ "name": "value",
572
+ "type": "uint256"
573
+ }
574
+ ],
575
+ "name": "mint",
576
+ "outputs": [],
577
+ "stateMutability": "nonpayable",
578
+ "type": "function"
579
+ },
580
+ {
581
+ "inputs": [],
582
+ "name": "name",
583
+ "outputs": [
584
+ {
585
+ "internalType": "string",
586
+ "name": "",
587
+ "type": "string"
588
+ }
589
+ ],
590
+ "stateMutability": "view",
591
+ "type": "function"
592
+ },
593
+ {
594
+ "inputs": [
595
+ {
596
+ "internalType": "address",
597
+ "name": "",
598
+ "type": "address"
599
+ }
600
+ ],
601
+ "name": "nonces",
602
+ "outputs": [
603
+ {
604
+ "internalType": "uint256",
605
+ "name": "",
606
+ "type": "uint256"
607
+ }
608
+ ],
609
+ "stateMutability": "view",
610
+ "type": "function"
611
+ },
612
+ {
613
+ "inputs": [
614
+ {
615
+ "internalType": "address",
616
+ "name": "owner",
617
+ "type": "address"
618
+ },
619
+ {
620
+ "internalType": "address",
621
+ "name": "spender",
622
+ "type": "address"
623
+ },
624
+ {
625
+ "internalType": "uint256",
626
+ "name": "value",
627
+ "type": "uint256"
628
+ },
629
+ {
630
+ "internalType": "uint256",
631
+ "name": "deadline",
632
+ "type": "uint256"
633
+ },
634
+ {
635
+ "internalType": "bytes",
636
+ "name": "signature",
637
+ "type": "bytes"
638
+ }
639
+ ],
640
+ "name": "permit",
641
+ "outputs": [],
642
+ "stateMutability": "nonpayable",
643
+ "type": "function"
644
+ },
645
+ {
646
+ "inputs": [
647
+ {
648
+ "internalType": "address",
649
+ "name": "owner",
650
+ "type": "address"
651
+ },
652
+ {
653
+ "internalType": "address",
654
+ "name": "spender",
655
+ "type": "address"
656
+ },
657
+ {
658
+ "internalType": "uint256",
659
+ "name": "value",
660
+ "type": "uint256"
661
+ },
662
+ {
663
+ "internalType": "uint256",
664
+ "name": "deadline",
665
+ "type": "uint256"
666
+ },
667
+ {
668
+ "internalType": "uint8",
669
+ "name": "v",
670
+ "type": "uint8"
671
+ },
672
+ {
673
+ "internalType": "bytes32",
674
+ "name": "r",
675
+ "type": "bytes32"
676
+ },
677
+ {
678
+ "internalType": "bytes32",
679
+ "name": "s",
680
+ "type": "bytes32"
681
+ }
682
+ ],
683
+ "name": "permit",
684
+ "outputs": [],
685
+ "stateMutability": "nonpayable",
686
+ "type": "function"
687
+ },
688
+ {
689
+ "inputs": [
690
+ {
691
+ "internalType": "address",
692
+ "name": "user",
693
+ "type": "address"
694
+ }
695
+ ],
696
+ "name": "rely",
697
+ "outputs": [],
698
+ "stateMutability": "nonpayable",
699
+ "type": "function"
700
+ },
701
+ {
702
+ "inputs": [
703
+ {
704
+ "internalType": "address",
705
+ "name": "user",
706
+ "type": "address"
707
+ },
708
+ {
709
+ "internalType": "bytes16",
710
+ "name": "hookData",
711
+ "type": "bytes16"
712
+ }
713
+ ],
714
+ "name": "setHookData",
715
+ "outputs": [],
716
+ "stateMutability": "nonpayable",
717
+ "type": "function"
718
+ },
719
+ {
720
+ "inputs": [
721
+ {
722
+ "internalType": "bytes4",
723
+ "name": "interfaceId",
724
+ "type": "bytes4"
725
+ }
726
+ ],
727
+ "name": "supportsInterface",
728
+ "outputs": [
729
+ {
730
+ "internalType": "bool",
731
+ "name": "",
732
+ "type": "bool"
733
+ }
734
+ ],
735
+ "stateMutability": "pure",
736
+ "type": "function"
737
+ },
738
+ {
739
+ "inputs": [],
740
+ "name": "symbol",
741
+ "outputs": [
742
+ {
743
+ "internalType": "string",
744
+ "name": "",
745
+ "type": "string"
746
+ }
747
+ ],
748
+ "stateMutability": "view",
749
+ "type": "function"
750
+ },
751
+ {
752
+ "inputs": [],
753
+ "name": "totalSupply",
754
+ "outputs": [
755
+ {
756
+ "internalType": "uint256",
757
+ "name": "",
758
+ "type": "uint256"
759
+ }
760
+ ],
761
+ "stateMutability": "view",
762
+ "type": "function"
763
+ },
764
+ {
765
+ "inputs": [
766
+ {
767
+ "internalType": "address",
768
+ "name": "to",
769
+ "type": "address"
770
+ },
771
+ {
772
+ "internalType": "uint256",
773
+ "name": "value",
774
+ "type": "uint256"
775
+ }
776
+ ],
777
+ "name": "transfer",
778
+ "outputs": [
779
+ {
780
+ "internalType": "bool",
781
+ "name": "success",
782
+ "type": "bool"
783
+ }
784
+ ],
785
+ "stateMutability": "nonpayable",
786
+ "type": "function"
787
+ },
788
+ {
789
+ "inputs": [
790
+ {
791
+ "internalType": "address",
792
+ "name": "from",
793
+ "type": "address"
794
+ },
795
+ {
796
+ "internalType": "address",
797
+ "name": "to",
798
+ "type": "address"
799
+ },
800
+ {
801
+ "internalType": "uint256",
802
+ "name": "value",
803
+ "type": "uint256"
804
+ }
805
+ ],
806
+ "name": "transferFrom",
807
+ "outputs": [
808
+ {
809
+ "internalType": "bool",
810
+ "name": "success",
811
+ "type": "bool"
812
+ }
813
+ ],
814
+ "stateMutability": "nonpayable",
815
+ "type": "function"
816
+ },
817
+ {
818
+ "inputs": [
819
+ {
820
+ "internalType": "address",
821
+ "name": "asset",
822
+ "type": "address"
823
+ },
824
+ {
825
+ "internalType": "address",
826
+ "name": "vault_",
827
+ "type": "address"
828
+ }
829
+ ],
830
+ "name": "updateVault",
831
+ "outputs": [],
832
+ "stateMutability": "nonpayable",
833
+ "type": "function"
834
+ },
835
+ {
836
+ "inputs": [
837
+ {
838
+ "internalType": "address",
839
+ "name": "asset",
840
+ "type": "address"
841
+ }
842
+ ],
843
+ "name": "vault",
844
+ "outputs": [
845
+ {
846
+ "internalType": "address",
847
+ "name": "",
848
+ "type": "address"
849
+ }
850
+ ],
851
+ "stateMutability": "view",
852
+ "type": "function"
853
+ },
854
+ {
855
+ "inputs": [
856
+ {
857
+ "internalType": "address",
858
+ "name": "",
859
+ "type": "address"
860
+ }
861
+ ],
862
+ "name": "wards",
863
+ "outputs": [
864
+ {
865
+ "internalType": "uint256",
866
+ "name": "",
867
+ "type": "uint256"
868
+ }
869
+ ],
870
+ "stateMutability": "view",
871
+ "type": "function"
872
+ }
873
+ ] as const satisfies Abi;
874
+
875
+ /**
876
+ * Type-safe ABI for ShareToken
877
+ */
878
+ export type ShareTokenAbi = typeof ShareTokenAbi;
879
+
880
+ /**
881
+ * Contract instance type for ShareToken
882
+ */
883
+ // Use any for contract type to avoid complex viem type issues
884
+ // The runtime behavior is type-safe through viem's ABI typing
885
+ export type ShareTokenContract = any;
886
+
887
+ /**
888
+ * ShareToken Contract Class
889
+ *
890
+ * Provides a class-based API similar to TypeChain for interacting with the contract.
891
+ *
892
+ * @example
893
+ * ```typescript
894
+ * import { createPublicClient, createWalletClient, http } from 'viem';
895
+ * import { mainnet } from 'viem/chains';
896
+ * import { ShareToken } from 'ShareToken';
897
+ *
898
+ * const publicClient = createPublicClient({ chain: mainnet, transport: http() });
899
+ * const walletClient = createWalletClient({ chain: mainnet, transport: http() });
900
+ *
901
+ * const contract = new ShareToken('0x...', { publicClient, walletClient });
902
+ *
903
+ * // Read functions
904
+ * const result = await contract.balanceOf('0x...');
905
+ *
906
+ * // Write functions
907
+ * const hash = await contract.transfer('0x...', 1000n);
908
+ *
909
+ * // Simulate transactions (dry-run)
910
+ * const simulation = await contract.simulate.transfer('0x...', 1000n);
911
+ * console.log('Gas estimate:', simulation.request.gas);
912
+ *
913
+ * // Watch events
914
+ * const unwatch = contract.watch.Transfer((event) => {
915
+ * console.log('Transfer event:', event);
916
+ * });
917
+ * ```
918
+ */
919
+ export class ShareToken {
920
+ private contract: ShareTokenContract;
921
+ private contractAddress: Address;
922
+ private publicClient: PublicClient;
923
+
924
+ constructor(
925
+ address: Address,
926
+ clients: {
927
+ publicClient: PublicClient;
928
+ walletClient?: WalletClient;
929
+ }
930
+ ) {
931
+ this.contractAddress = address;
932
+ this.publicClient = clients.publicClient;
933
+ this.contract = getContract({
934
+ address,
935
+ abi: ShareTokenAbi,
936
+ client: {
937
+ public: clients.publicClient,
938
+ wallet: clients.walletClient,
939
+ },
940
+ });
941
+ }
942
+
943
+ /**
944
+ * Get the contract address
945
+ */
946
+ get address(): Address {
947
+ return this.contractAddress;
948
+ }
949
+
950
+ /**
951
+ * Get the underlying viem contract instance.
952
+ */
953
+ getContract(): ShareTokenContract {
954
+ return this.contract;
955
+ }
956
+
957
+ /**
958
+ * DOMAIN_SEPARATOR
959
+ * view
960
+ */
961
+ async DOMAIN_SEPARATOR(): Promise<`0x${string}`> {
962
+ return this.contract.read.DOMAIN_SEPARATOR() as Promise<`0x${string}`>;
963
+ }
964
+
965
+ /**
966
+ * PERMIT_TYPEHASH
967
+ * view
968
+ */
969
+ async PERMIT_TYPEHASH(): Promise<`0x${string}`> {
970
+ return this.contract.read.PERMIT_TYPEHASH() as Promise<`0x${string}`>;
971
+ }
972
+
973
+ /**
974
+ * allowance
975
+ * view
976
+ */
977
+ async allowance(arg0: `0x${string}`, arg1: `0x${string}`): Promise<bigint> {
978
+ return this.contract.read.allowance([arg0, arg1] as const) as Promise<bigint>;
979
+ }
980
+
981
+ /**
982
+ * balanceOf
983
+ * view
984
+ */
985
+ async balanceOf(user: `0x${string}`): Promise<bigint> {
986
+ return this.contract.read.balanceOf([user] as const) as Promise<bigint>;
987
+ }
988
+
989
+ /**
990
+ * checkTransferRestriction
991
+ * view
992
+ */
993
+ async checkTransferRestriction(from: `0x${string}`, to: `0x${string}`, value: bigint): Promise<boolean> {
994
+ return this.contract.read.checkTransferRestriction([from, to, value] as const) as Promise<boolean>;
995
+ }
996
+
997
+ /**
998
+ * decimals
999
+ * view
1000
+ */
1001
+ async decimals(): Promise<bigint> {
1002
+ return this.contract.read.decimals() as Promise<bigint>;
1003
+ }
1004
+
1005
+ /**
1006
+ * deploymentChainId
1007
+ * view
1008
+ */
1009
+ async deploymentChainId(): Promise<bigint> {
1010
+ return this.contract.read.deploymentChainId() as Promise<bigint>;
1011
+ }
1012
+
1013
+ /**
1014
+ * detectTransferRestriction
1015
+ * view
1016
+ */
1017
+ async detectTransferRestriction(from: `0x${string}`, to: `0x${string}`, value: bigint): Promise<bigint> {
1018
+ return this.contract.read.detectTransferRestriction([from, to, value] as const) as Promise<bigint>;
1019
+ }
1020
+
1021
+ /**
1022
+ * hook
1023
+ * view
1024
+ */
1025
+ async hook(): Promise<`0x${string}`> {
1026
+ return this.contract.read.hook() as Promise<`0x${string}`>;
1027
+ }
1028
+
1029
+ /**
1030
+ * hookDataOf
1031
+ * view
1032
+ */
1033
+ async hookDataOf(user: `0x${string}`): Promise<`0x${string}`> {
1034
+ return this.contract.read.hookDataOf([user] as const) as Promise<`0x${string}`>;
1035
+ }
1036
+
1037
+ /**
1038
+ * messageForTransferRestriction
1039
+ * pure
1040
+ */
1041
+ async messageForTransferRestriction(restrictionCode: bigint): Promise<string> {
1042
+ return this.contract.read.messageForTransferRestriction([restrictionCode] as const) as Promise<string>;
1043
+ }
1044
+
1045
+ /**
1046
+ * name
1047
+ * view
1048
+ */
1049
+ async name(): Promise<string> {
1050
+ return this.contract.read.name() as Promise<string>;
1051
+ }
1052
+
1053
+ /**
1054
+ * nonces
1055
+ * view
1056
+ */
1057
+ async nonces(arg0: `0x${string}`): Promise<bigint> {
1058
+ return this.contract.read.nonces([arg0] as const) as Promise<bigint>;
1059
+ }
1060
+
1061
+ /**
1062
+ * supportsInterface
1063
+ * pure
1064
+ */
1065
+ async supportsInterface(interfaceId: `0x${string}`): Promise<boolean> {
1066
+ return this.contract.read.supportsInterface([interfaceId] as const) as Promise<boolean>;
1067
+ }
1068
+
1069
+ /**
1070
+ * symbol
1071
+ * view
1072
+ */
1073
+ async symbol(): Promise<string> {
1074
+ return this.contract.read.symbol() as Promise<string>;
1075
+ }
1076
+
1077
+ /**
1078
+ * totalSupply
1079
+ * view
1080
+ */
1081
+ async totalSupply(): Promise<bigint> {
1082
+ return this.contract.read.totalSupply() as Promise<bigint>;
1083
+ }
1084
+
1085
+ /**
1086
+ * vault
1087
+ * view
1088
+ */
1089
+ async vault(asset: `0x${string}`): Promise<`0x${string}`> {
1090
+ return this.contract.read.vault([asset] as const) as Promise<`0x${string}`>;
1091
+ }
1092
+
1093
+ /**
1094
+ * wards
1095
+ * view
1096
+ */
1097
+ async wards(arg0: `0x${string}`): Promise<bigint> {
1098
+ return this.contract.read.wards([arg0] as const) as Promise<bigint>;
1099
+ }
1100
+
1101
+ /**
1102
+ * approve
1103
+ * nonpayable
1104
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1105
+ */
1106
+ async approve(spender: `0x${string}`, value: bigint, options?: {
1107
+ accessList?: import('viem').AccessList;
1108
+ authorizationList?: import('viem').AuthorizationList;
1109
+ chain?: import('viem').Chain | null;
1110
+ dataSuffix?: `0x${string}`;
1111
+ gas?: bigint;
1112
+ gasPrice?: bigint;
1113
+ maxFeePerGas?: bigint;
1114
+ maxPriorityFeePerGas?: bigint;
1115
+ nonce?: number;
1116
+ value?: bigint;
1117
+ }): Promise<`0x${string}`> {
1118
+ if (!this.contract.write) {
1119
+ throw new Error('Wallet client is required for write operations');
1120
+ }
1121
+ return this.contract.write.approve([spender, value] as const, options) as Promise<`0x${string}`>;
1122
+ }
1123
+
1124
+ /**
1125
+ * authTransferFrom
1126
+ * nonpayable
1127
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1128
+ */
1129
+ async authTransferFrom(sender: `0x${string}`, from: `0x${string}`, to: `0x${string}`, value: bigint, options?: {
1130
+ accessList?: import('viem').AccessList;
1131
+ authorizationList?: import('viem').AuthorizationList;
1132
+ chain?: import('viem').Chain | null;
1133
+ dataSuffix?: `0x${string}`;
1134
+ gas?: bigint;
1135
+ gasPrice?: bigint;
1136
+ maxFeePerGas?: bigint;
1137
+ maxPriorityFeePerGas?: bigint;
1138
+ nonce?: number;
1139
+ value?: bigint;
1140
+ }): Promise<`0x${string}`> {
1141
+ if (!this.contract.write) {
1142
+ throw new Error('Wallet client is required for write operations');
1143
+ }
1144
+ return this.contract.write.authTransferFrom([sender, from, to, value] as const, options) as Promise<`0x${string}`>;
1145
+ }
1146
+
1147
+ /**
1148
+ * burn
1149
+ * nonpayable
1150
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1151
+ */
1152
+ async burn(from: `0x${string}`, value: bigint, options?: {
1153
+ accessList?: import('viem').AccessList;
1154
+ authorizationList?: import('viem').AuthorizationList;
1155
+ chain?: import('viem').Chain | null;
1156
+ dataSuffix?: `0x${string}`;
1157
+ gas?: bigint;
1158
+ gasPrice?: bigint;
1159
+ maxFeePerGas?: bigint;
1160
+ maxPriorityFeePerGas?: bigint;
1161
+ nonce?: number;
1162
+ value?: bigint;
1163
+ }): Promise<`0x${string}`> {
1164
+ if (!this.contract.write) {
1165
+ throw new Error('Wallet client is required for write operations');
1166
+ }
1167
+ return this.contract.write.burn([from, value] as const, options) as Promise<`0x${string}`>;
1168
+ }
1169
+
1170
+ /**
1171
+ * deny
1172
+ * nonpayable
1173
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1174
+ */
1175
+ async deny(user: `0x${string}`, options?: {
1176
+ accessList?: import('viem').AccessList;
1177
+ authorizationList?: import('viem').AuthorizationList;
1178
+ chain?: import('viem').Chain | null;
1179
+ dataSuffix?: `0x${string}`;
1180
+ gas?: bigint;
1181
+ gasPrice?: bigint;
1182
+ maxFeePerGas?: bigint;
1183
+ maxPriorityFeePerGas?: bigint;
1184
+ nonce?: number;
1185
+ value?: bigint;
1186
+ }): Promise<`0x${string}`> {
1187
+ if (!this.contract.write) {
1188
+ throw new Error('Wallet client is required for write operations');
1189
+ }
1190
+ return this.contract.write.deny([user] as const, options) as Promise<`0x${string}`>;
1191
+ }
1192
+
1193
+ async file(what: `0x${string}`, data: string, options?: {
1194
+ accessList?: import('viem').AccessList;
1195
+ authorizationList?: import('viem').AuthorizationList;
1196
+ chain?: import('viem').Chain | null;
1197
+ dataSuffix?: `0x${string}`;
1198
+ gas?: bigint;
1199
+ gasPrice?: bigint;
1200
+ maxFeePerGas?: bigint;
1201
+ maxPriorityFeePerGas?: bigint;
1202
+ nonce?: number;
1203
+ value?: bigint;
1204
+ }): Promise<`0x${string}`>;
1205
+ async file(what: `0x${string}`, data: `0x${string}`, options?: {
1206
+ accessList?: import('viem').AccessList;
1207
+ authorizationList?: import('viem').AuthorizationList;
1208
+ chain?: import('viem').Chain | null;
1209
+ dataSuffix?: `0x${string}`;
1210
+ gas?: bigint;
1211
+ gasPrice?: bigint;
1212
+ maxFeePerGas?: bigint;
1213
+ maxPriorityFeePerGas?: bigint;
1214
+ nonce?: number;
1215
+ value?: bigint;
1216
+ }): Promise<`0x${string}`>;
1217
+ async file(...args: any[]): Promise<`0x${string}`> {
1218
+ if (!this.contract.write) {
1219
+ throw new Error('Wallet client is required for write operations');
1220
+ }
1221
+ return this.contract.write.file(args as any) as Promise<`0x${string}`>;
1222
+ }
1223
+
1224
+ /**
1225
+ * mint
1226
+ * nonpayable
1227
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1228
+ */
1229
+ async mint(to: `0x${string}`, value: bigint, options?: {
1230
+ accessList?: import('viem').AccessList;
1231
+ authorizationList?: import('viem').AuthorizationList;
1232
+ chain?: import('viem').Chain | null;
1233
+ dataSuffix?: `0x${string}`;
1234
+ gas?: bigint;
1235
+ gasPrice?: bigint;
1236
+ maxFeePerGas?: bigint;
1237
+ maxPriorityFeePerGas?: bigint;
1238
+ nonce?: number;
1239
+ value?: bigint;
1240
+ }): Promise<`0x${string}`> {
1241
+ if (!this.contract.write) {
1242
+ throw new Error('Wallet client is required for write operations');
1243
+ }
1244
+ return this.contract.write.mint([to, value] as const, options) as Promise<`0x${string}`>;
1245
+ }
1246
+
1247
+ async permit(owner: `0x${string}`, spender: `0x${string}`, value: bigint, deadline: bigint, signature: `0x${string}`, options?: {
1248
+ accessList?: import('viem').AccessList;
1249
+ authorizationList?: import('viem').AuthorizationList;
1250
+ chain?: import('viem').Chain | null;
1251
+ dataSuffix?: `0x${string}`;
1252
+ gas?: bigint;
1253
+ gasPrice?: bigint;
1254
+ maxFeePerGas?: bigint;
1255
+ maxPriorityFeePerGas?: bigint;
1256
+ nonce?: number;
1257
+ value?: bigint;
1258
+ }): Promise<`0x${string}`>;
1259
+ async permit(owner: `0x${string}`, spender: `0x${string}`, value: bigint, deadline: bigint, v: bigint, r: `0x${string}`, s: `0x${string}`, options?: {
1260
+ accessList?: import('viem').AccessList;
1261
+ authorizationList?: import('viem').AuthorizationList;
1262
+ chain?: import('viem').Chain | null;
1263
+ dataSuffix?: `0x${string}`;
1264
+ gas?: bigint;
1265
+ gasPrice?: bigint;
1266
+ maxFeePerGas?: bigint;
1267
+ maxPriorityFeePerGas?: bigint;
1268
+ nonce?: number;
1269
+ value?: bigint;
1270
+ }): Promise<`0x${string}`>;
1271
+ async permit(...args: any[]): Promise<`0x${string}`> {
1272
+ if (!this.contract.write) {
1273
+ throw new Error('Wallet client is required for write operations');
1274
+ }
1275
+ return this.contract.write.permit(args as any) as Promise<`0x${string}`>;
1276
+ }
1277
+
1278
+ /**
1279
+ * rely
1280
+ * nonpayable
1281
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1282
+ */
1283
+ async rely(user: `0x${string}`, options?: {
1284
+ accessList?: import('viem').AccessList;
1285
+ authorizationList?: import('viem').AuthorizationList;
1286
+ chain?: import('viem').Chain | null;
1287
+ dataSuffix?: `0x${string}`;
1288
+ gas?: bigint;
1289
+ gasPrice?: bigint;
1290
+ maxFeePerGas?: bigint;
1291
+ maxPriorityFeePerGas?: bigint;
1292
+ nonce?: number;
1293
+ value?: bigint;
1294
+ }): Promise<`0x${string}`> {
1295
+ if (!this.contract.write) {
1296
+ throw new Error('Wallet client is required for write operations');
1297
+ }
1298
+ return this.contract.write.rely([user] as const, options) as Promise<`0x${string}`>;
1299
+ }
1300
+
1301
+ /**
1302
+ * setHookData
1303
+ * nonpayable
1304
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1305
+ */
1306
+ async setHookData(user: `0x${string}`, hookData: `0x${string}`, options?: {
1307
+ accessList?: import('viem').AccessList;
1308
+ authorizationList?: import('viem').AuthorizationList;
1309
+ chain?: import('viem').Chain | null;
1310
+ dataSuffix?: `0x${string}`;
1311
+ gas?: bigint;
1312
+ gasPrice?: bigint;
1313
+ maxFeePerGas?: bigint;
1314
+ maxPriorityFeePerGas?: bigint;
1315
+ nonce?: number;
1316
+ value?: bigint;
1317
+ }): Promise<`0x${string}`> {
1318
+ if (!this.contract.write) {
1319
+ throw new Error('Wallet client is required for write operations');
1320
+ }
1321
+ return this.contract.write.setHookData([user, hookData] as const, options) as Promise<`0x${string}`>;
1322
+ }
1323
+
1324
+ /**
1325
+ * transfer
1326
+ * nonpayable
1327
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1328
+ */
1329
+ async transfer(to: `0x${string}`, value: bigint, options?: {
1330
+ accessList?: import('viem').AccessList;
1331
+ authorizationList?: import('viem').AuthorizationList;
1332
+ chain?: import('viem').Chain | null;
1333
+ dataSuffix?: `0x${string}`;
1334
+ gas?: bigint;
1335
+ gasPrice?: bigint;
1336
+ maxFeePerGas?: bigint;
1337
+ maxPriorityFeePerGas?: bigint;
1338
+ nonce?: number;
1339
+ value?: bigint;
1340
+ }): Promise<`0x${string}`> {
1341
+ if (!this.contract.write) {
1342
+ throw new Error('Wallet client is required for write operations');
1343
+ }
1344
+ return this.contract.write.transfer([to, value] as const, options) as Promise<`0x${string}`>;
1345
+ }
1346
+
1347
+ /**
1348
+ * transferFrom
1349
+ * nonpayable
1350
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1351
+ */
1352
+ async transferFrom(from: `0x${string}`, to: `0x${string}`, value: bigint, options?: {
1353
+ accessList?: import('viem').AccessList;
1354
+ authorizationList?: import('viem').AuthorizationList;
1355
+ chain?: import('viem').Chain | null;
1356
+ dataSuffix?: `0x${string}`;
1357
+ gas?: bigint;
1358
+ gasPrice?: bigint;
1359
+ maxFeePerGas?: bigint;
1360
+ maxPriorityFeePerGas?: bigint;
1361
+ nonce?: number;
1362
+ value?: bigint;
1363
+ }): Promise<`0x${string}`> {
1364
+ if (!this.contract.write) {
1365
+ throw new Error('Wallet client is required for write operations');
1366
+ }
1367
+ return this.contract.write.transferFrom([from, to, value] as const, options) as Promise<`0x${string}`>;
1368
+ }
1369
+
1370
+ /**
1371
+ * updateVault
1372
+ * nonpayable
1373
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1374
+ */
1375
+ async updateVault(asset: `0x${string}`, vault_: `0x${string}`, options?: {
1376
+ accessList?: import('viem').AccessList;
1377
+ authorizationList?: import('viem').AuthorizationList;
1378
+ chain?: import('viem').Chain | null;
1379
+ dataSuffix?: `0x${string}`;
1380
+ gas?: bigint;
1381
+ gasPrice?: bigint;
1382
+ maxFeePerGas?: bigint;
1383
+ maxPriorityFeePerGas?: bigint;
1384
+ nonce?: number;
1385
+ value?: bigint;
1386
+ }): Promise<`0x${string}`> {
1387
+ if (!this.contract.write) {
1388
+ throw new Error('Wallet client is required for write operations');
1389
+ }
1390
+ return this.contract.write.updateVault([asset, vault_] as const, options) as Promise<`0x${string}`>;
1391
+ }
1392
+
1393
+
1394
+
1395
+ /**
1396
+ * Simulate contract write operations (dry-run without sending transaction)
1397
+ *
1398
+ * @example
1399
+ * const result = await contract.simulate.transfer('0x...', 1000n);
1400
+ * console.log('Gas estimate:', result.request.gas);
1401
+ * console.log('Would succeed:', result.result);
1402
+ */
1403
+ get simulate() {
1404
+ const contract = this.contract;
1405
+ if (!contract.simulate) {
1406
+ throw new Error('Public client is required for simulation');
1407
+ }
1408
+ return {
1409
+ /**
1410
+ * Simulate approve
1411
+ * Returns gas estimate and result without sending transaction
1412
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1413
+ */
1414
+ async approve(spender: `0x${string}`, value: bigint, options?: {
1415
+ accessList?: import('viem').AccessList;
1416
+ authorizationList?: import('viem').AuthorizationList;
1417
+ chain?: import('viem').Chain | null;
1418
+ dataSuffix?: `0x${string}`;
1419
+ gas?: bigint;
1420
+ gasPrice?: bigint;
1421
+ maxFeePerGas?: bigint;
1422
+ maxPriorityFeePerGas?: bigint;
1423
+ nonce?: number;
1424
+ value?: bigint;
1425
+ }): Promise<boolean> {
1426
+ return contract.simulate.approve([spender, value] as const, options) as Promise<boolean>;
1427
+ },
1428
+ /**
1429
+ * Simulate authTransferFrom
1430
+ * Returns gas estimate and result without sending transaction
1431
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1432
+ */
1433
+ async authTransferFrom(sender: `0x${string}`, from: `0x${string}`, to: `0x${string}`, value: bigint, options?: {
1434
+ accessList?: import('viem').AccessList;
1435
+ authorizationList?: import('viem').AuthorizationList;
1436
+ chain?: import('viem').Chain | null;
1437
+ dataSuffix?: `0x${string}`;
1438
+ gas?: bigint;
1439
+ gasPrice?: bigint;
1440
+ maxFeePerGas?: bigint;
1441
+ maxPriorityFeePerGas?: bigint;
1442
+ nonce?: number;
1443
+ value?: bigint;
1444
+ }): Promise<boolean> {
1445
+ return contract.simulate.authTransferFrom([sender, from, to, value] as const, options) as Promise<boolean>;
1446
+ },
1447
+ /**
1448
+ * Simulate burn
1449
+ * Returns gas estimate and result without sending transaction
1450
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1451
+ */
1452
+ async burn(from: `0x${string}`, value: bigint, options?: {
1453
+ accessList?: import('viem').AccessList;
1454
+ authorizationList?: import('viem').AuthorizationList;
1455
+ chain?: import('viem').Chain | null;
1456
+ dataSuffix?: `0x${string}`;
1457
+ gas?: bigint;
1458
+ gasPrice?: bigint;
1459
+ maxFeePerGas?: bigint;
1460
+ maxPriorityFeePerGas?: bigint;
1461
+ nonce?: number;
1462
+ value?: bigint;
1463
+ }): Promise<void> {
1464
+ return contract.simulate.burn([from, value] as const, options) as Promise<void>;
1465
+ },
1466
+ /**
1467
+ * Simulate deny
1468
+ * Returns gas estimate and result without sending transaction
1469
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1470
+ */
1471
+ async deny(user: `0x${string}`, options?: {
1472
+ accessList?: import('viem').AccessList;
1473
+ authorizationList?: import('viem').AuthorizationList;
1474
+ chain?: import('viem').Chain | null;
1475
+ dataSuffix?: `0x${string}`;
1476
+ gas?: bigint;
1477
+ gasPrice?: bigint;
1478
+ maxFeePerGas?: bigint;
1479
+ maxPriorityFeePerGas?: bigint;
1480
+ nonce?: number;
1481
+ value?: bigint;
1482
+ }): Promise<void> {
1483
+ return contract.simulate.deny([user] as const, options) as Promise<void>;
1484
+ },
1485
+ /**
1486
+ * Simulate file
1487
+ * Returns gas estimate and result without sending transaction
1488
+ * Supports multiple overloads: (bytes32, string), (bytes32, address)
1489
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1490
+ */
1491
+ async file(...args: any[]): Promise<any> {
1492
+ return contract.simulate.file(args as any) as Promise<any>;
1493
+ },
1494
+ /**
1495
+ * Simulate mint
1496
+ * Returns gas estimate and result without sending transaction
1497
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1498
+ */
1499
+ async mint(to: `0x${string}`, value: bigint, options?: {
1500
+ accessList?: import('viem').AccessList;
1501
+ authorizationList?: import('viem').AuthorizationList;
1502
+ chain?: import('viem').Chain | null;
1503
+ dataSuffix?: `0x${string}`;
1504
+ gas?: bigint;
1505
+ gasPrice?: bigint;
1506
+ maxFeePerGas?: bigint;
1507
+ maxPriorityFeePerGas?: bigint;
1508
+ nonce?: number;
1509
+ value?: bigint;
1510
+ }): Promise<void> {
1511
+ return contract.simulate.mint([to, value] as const, options) as Promise<void>;
1512
+ },
1513
+ /**
1514
+ * Simulate permit
1515
+ * Returns gas estimate and result without sending transaction
1516
+ * Supports multiple overloads: (address, address, uint256, uint256, bytes), (address, address, uint256, uint256, uint8, bytes32, bytes32)
1517
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1518
+ */
1519
+ async permit(...args: any[]): Promise<any> {
1520
+ return contract.simulate.permit(args as any) as Promise<any>;
1521
+ },
1522
+ /**
1523
+ * Simulate rely
1524
+ * Returns gas estimate and result without sending transaction
1525
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1526
+ */
1527
+ async rely(user: `0x${string}`, options?: {
1528
+ accessList?: import('viem').AccessList;
1529
+ authorizationList?: import('viem').AuthorizationList;
1530
+ chain?: import('viem').Chain | null;
1531
+ dataSuffix?: `0x${string}`;
1532
+ gas?: bigint;
1533
+ gasPrice?: bigint;
1534
+ maxFeePerGas?: bigint;
1535
+ maxPriorityFeePerGas?: bigint;
1536
+ nonce?: number;
1537
+ value?: bigint;
1538
+ }): Promise<void> {
1539
+ return contract.simulate.rely([user] as const, options) as Promise<void>;
1540
+ },
1541
+ /**
1542
+ * Simulate setHookData
1543
+ * Returns gas estimate and result without sending transaction
1544
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1545
+ */
1546
+ async setHookData(user: `0x${string}`, hookData: `0x${string}`, options?: {
1547
+ accessList?: import('viem').AccessList;
1548
+ authorizationList?: import('viem').AuthorizationList;
1549
+ chain?: import('viem').Chain | null;
1550
+ dataSuffix?: `0x${string}`;
1551
+ gas?: bigint;
1552
+ gasPrice?: bigint;
1553
+ maxFeePerGas?: bigint;
1554
+ maxPriorityFeePerGas?: bigint;
1555
+ nonce?: number;
1556
+ value?: bigint;
1557
+ }): Promise<void> {
1558
+ return contract.simulate.setHookData([user, hookData] as const, options) as Promise<void>;
1559
+ },
1560
+ /**
1561
+ * Simulate transfer
1562
+ * Returns gas estimate and result without sending transaction
1563
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1564
+ */
1565
+ async transfer(to: `0x${string}`, value: bigint, options?: {
1566
+ accessList?: import('viem').AccessList;
1567
+ authorizationList?: import('viem').AuthorizationList;
1568
+ chain?: import('viem').Chain | null;
1569
+ dataSuffix?: `0x${string}`;
1570
+ gas?: bigint;
1571
+ gasPrice?: bigint;
1572
+ maxFeePerGas?: bigint;
1573
+ maxPriorityFeePerGas?: bigint;
1574
+ nonce?: number;
1575
+ value?: bigint;
1576
+ }): Promise<boolean> {
1577
+ return contract.simulate.transfer([to, value] as const, options) as Promise<boolean>;
1578
+ },
1579
+ /**
1580
+ * Simulate transferFrom
1581
+ * Returns gas estimate and result without sending transaction
1582
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1583
+ */
1584
+ async transferFrom(from: `0x${string}`, to: `0x${string}`, value: bigint, options?: {
1585
+ accessList?: import('viem').AccessList;
1586
+ authorizationList?: import('viem').AuthorizationList;
1587
+ chain?: import('viem').Chain | null;
1588
+ dataSuffix?: `0x${string}`;
1589
+ gas?: bigint;
1590
+ gasPrice?: bigint;
1591
+ maxFeePerGas?: bigint;
1592
+ maxPriorityFeePerGas?: bigint;
1593
+ nonce?: number;
1594
+ value?: bigint;
1595
+ }): Promise<boolean> {
1596
+ return contract.simulate.transferFrom([from, to, value] as const, options) as Promise<boolean>;
1597
+ },
1598
+ /**
1599
+ * Simulate updateVault
1600
+ * Returns gas estimate and result without sending transaction
1601
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1602
+ */
1603
+ async updateVault(asset: `0x${string}`, vault_: `0x${string}`, options?: {
1604
+ accessList?: import('viem').AccessList;
1605
+ authorizationList?: import('viem').AuthorizationList;
1606
+ chain?: import('viem').Chain | null;
1607
+ dataSuffix?: `0x${string}`;
1608
+ gas?: bigint;
1609
+ gasPrice?: bigint;
1610
+ maxFeePerGas?: bigint;
1611
+ maxPriorityFeePerGas?: bigint;
1612
+ nonce?: number;
1613
+ value?: bigint;
1614
+ }): Promise<void> {
1615
+ return contract.simulate.updateVault([asset, vault_] as const, options) as Promise<void>;
1616
+ }
1617
+ };
1618
+ }
1619
+
1620
+ /**
1621
+ * Watch contract events
1622
+ *
1623
+ * @example
1624
+ * // Watch all Transfer events
1625
+ * const unwatch = contract.watch.Transfer((event) => {
1626
+ * console.log('Transfer:', event);
1627
+ * });
1628
+ *
1629
+ * // Stop watching
1630
+ * unwatch();
1631
+ */
1632
+ get watch() {
1633
+ return {
1634
+ /**
1635
+ * Watch Approval events
1636
+ * @param callback Function to call when event is emitted
1637
+ * @param filter Optional filter for indexed parameters
1638
+ * @returns Unwatch function to stop listening
1639
+ */
1640
+ Approval: (callback: (event: { owner: `0x${string}`; spender: `0x${string}`; value: bigint }) => void, filter?: { owner?: `0x${string}` | `0x${string}`[] | null; spender?: `0x${string}` | `0x${string}`[] | null }) => {
1641
+ return this.publicClient.watchContractEvent({
1642
+ address: this.contractAddress,
1643
+ abi: ShareTokenAbi,
1644
+ eventName: 'Approval',
1645
+ args: filter as any,
1646
+ onLogs: (logs: any[]) => {
1647
+ logs.forEach((log: any) => {
1648
+ callback(log.args as any);
1649
+ });
1650
+ },
1651
+ }) as () => void;
1652
+ },
1653
+ /**
1654
+ * Watch Deny events
1655
+ * @param callback Function to call when event is emitted
1656
+ * @param filter Optional filter for indexed parameters
1657
+ * @returns Unwatch function to stop listening
1658
+ */
1659
+ Deny: (callback: (event: { user: `0x${string}` }) => void, filter?: { user?: `0x${string}` | `0x${string}`[] | null }) => {
1660
+ return this.publicClient.watchContractEvent({
1661
+ address: this.contractAddress,
1662
+ abi: ShareTokenAbi,
1663
+ eventName: 'Deny',
1664
+ args: filter as any,
1665
+ onLogs: (logs: any[]) => {
1666
+ logs.forEach((log: any) => {
1667
+ callback(log.args as any);
1668
+ });
1669
+ },
1670
+ }) as () => void;
1671
+ },
1672
+ /**
1673
+ * Watch File events
1674
+ * @param callback Function to call when event is emitted
1675
+ * @param filter Optional filter for indexed parameters
1676
+ * @returns Unwatch function to stop listening
1677
+ */
1678
+ File: (callback: (event: { what: `0x${string}`; data: `0x${string}` }) => void, filter?: { what?: `0x${string}` | `0x${string}`[] | null }) => {
1679
+ return this.publicClient.watchContractEvent({
1680
+ address: this.contractAddress,
1681
+ abi: ShareTokenAbi,
1682
+ eventName: 'File',
1683
+ args: filter as any,
1684
+ onLogs: (logs: any[]) => {
1685
+ logs.forEach((log: any) => {
1686
+ callback(log.args as any);
1687
+ });
1688
+ },
1689
+ }) as () => void;
1690
+ },
1691
+ /**
1692
+ * Watch Rely events
1693
+ * @param callback Function to call when event is emitted
1694
+ * @param filter Optional filter for indexed parameters
1695
+ * @returns Unwatch function to stop listening
1696
+ */
1697
+ Rely: (callback: (event: { user: `0x${string}` }) => void, filter?: { user?: `0x${string}` | `0x${string}`[] | null }) => {
1698
+ return this.publicClient.watchContractEvent({
1699
+ address: this.contractAddress,
1700
+ abi: ShareTokenAbi,
1701
+ eventName: 'Rely',
1702
+ args: filter as any,
1703
+ onLogs: (logs: any[]) => {
1704
+ logs.forEach((log: any) => {
1705
+ callback(log.args as any);
1706
+ });
1707
+ },
1708
+ }) as () => void;
1709
+ },
1710
+ /**
1711
+ * Watch SetHookData events
1712
+ * @param callback Function to call when event is emitted
1713
+ * @param filter Optional filter for indexed parameters
1714
+ * @returns Unwatch function to stop listening
1715
+ */
1716
+ SetHookData: (callback: (event: { user: `0x${string}`; data: `0x${string}` }) => void, filter?: { user?: `0x${string}` | `0x${string}`[] | null }) => {
1717
+ return this.publicClient.watchContractEvent({
1718
+ address: this.contractAddress,
1719
+ abi: ShareTokenAbi,
1720
+ eventName: 'SetHookData',
1721
+ args: filter as any,
1722
+ onLogs: (logs: any[]) => {
1723
+ logs.forEach((log: any) => {
1724
+ callback(log.args as any);
1725
+ });
1726
+ },
1727
+ }) as () => void;
1728
+ },
1729
+ /**
1730
+ * Watch Transfer events
1731
+ * @param callback Function to call when event is emitted
1732
+ * @param filter Optional filter for indexed parameters
1733
+ * @returns Unwatch function to stop listening
1734
+ */
1735
+ Transfer: (callback: (event: { from: `0x${string}`; to: `0x${string}`; value: bigint }) => void, filter?: { from?: `0x${string}` | `0x${string}`[] | null; to?: `0x${string}` | `0x${string}`[] | null }) => {
1736
+ return this.publicClient.watchContractEvent({
1737
+ address: this.contractAddress,
1738
+ abi: ShareTokenAbi,
1739
+ eventName: 'Transfer',
1740
+ args: filter as any,
1741
+ onLogs: (logs: any[]) => {
1742
+ logs.forEach((log: any) => {
1743
+ callback(log.args as any);
1744
+ });
1745
+ },
1746
+ }) as () => void;
1747
+ },
1748
+ /**
1749
+ * Watch VaultUpdate events
1750
+ * @param callback Function to call when event is emitted
1751
+ * @param filter Optional filter for indexed parameters
1752
+ * @returns Unwatch function to stop listening
1753
+ */
1754
+ VaultUpdate: (callback: (event: { asset: `0x${string}`; vault: `0x${string}` }) => void, filter?: { asset?: `0x${string}` | `0x${string}`[] | null }) => {
1755
+ return this.publicClient.watchContractEvent({
1756
+ address: this.contractAddress,
1757
+ abi: ShareTokenAbi,
1758
+ eventName: 'VaultUpdate',
1759
+ args: filter as any,
1760
+ onLogs: (logs: any[]) => {
1761
+ logs.forEach((log: any) => {
1762
+ callback(log.args as any);
1763
+ });
1764
+ },
1765
+ }) as () => void;
1766
+ }
1767
+ };
1768
+ }
1769
+ }