@gitmyabi-stg/ebtc 0.0.1

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