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