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