@lidofinance/lsv-cli 1.0.0-alpha.7 → 1.0.0-alpha.8
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.
- package/README.md +217 -1
- package/dist/abi/Dashboard.js +1383 -0
- package/dist/abi/Dashboard.js.map +1 -0
- package/dist/abi/Delegation.js +1658 -0
- package/dist/abi/Delegation.js.map +1 -0
- package/dist/abi/LidoLocator.js +388 -0
- package/dist/abi/LidoLocator.js.map +1 -0
- package/dist/abi/StEth.js +496 -0
- package/dist/abi/StEth.js.map +1 -0
- package/dist/abi/StakingVault.js +786 -0
- package/dist/abi/StakingVault.js.map +1 -0
- package/dist/abi/TokenManager.js +759 -0
- package/dist/abi/TokenManager.js.map +1 -0
- package/dist/abi/VaultFactory.js +229 -0
- package/dist/abi/VaultFactory.js.map +1 -0
- package/dist/abi/VaultHub.js +923 -586
- package/dist/abi/VaultHub.js.map +1 -1
- package/dist/abi/Voting.js +887 -0
- package/dist/abi/Voting.js.map +1 -0
- package/dist/abi/index.js +26 -0
- package/dist/abi/index.js.map +1 -0
- package/dist/command/index.js +16 -0
- package/dist/command/index.js.map +1 -1
- package/dist/configs/constants.js +6 -0
- package/dist/configs/constants.js.map +1 -0
- package/dist/configs/deployed.js +118 -24
- package/dist/configs/deployed.js.map +1 -1
- package/dist/configs/envs.js +24 -16
- package/dist/configs/envs.js.map +1 -1
- package/dist/configs/index.js +1 -0
- package/dist/configs/index.js.map +1 -1
- package/dist/configs/utils.js +32 -0
- package/dist/configs/utils.js.map +1 -0
- package/dist/contracts/dashboard.js +19 -0
- package/dist/contracts/dashboard.js.map +1 -0
- package/dist/contracts/delegation.js +19 -0
- package/dist/contracts/delegation.js.map +1 -0
- package/dist/contracts/index.js +8 -0
- package/dist/contracts/index.js.map +1 -1
- package/dist/contracts/locator.js +20 -0
- package/dist/contracts/locator.js.map +1 -0
- package/dist/contracts/steth.js +19 -0
- package/dist/contracts/steth.js.map +1 -0
- package/dist/contracts/token-manager.js +20 -0
- package/dist/contracts/token-manager.js.map +1 -0
- package/dist/contracts/vault-factory.js +22 -0
- package/dist/contracts/vault-factory.js.map +1 -0
- package/dist/contracts/vault-hub.js +10 -8
- package/dist/contracts/vault-hub.js.map +1 -1
- package/dist/contracts/vault.js +18 -0
- package/dist/contracts/vault.js.map +1 -0
- package/dist/contracts/voting.js +22 -0
- package/dist/contracts/voting.js.map +1 -0
- package/dist/features/advanced-config.js +21 -0
- package/dist/features/advanced-config.js.map +1 -0
- package/dist/features/index.js +20 -0
- package/dist/features/index.js.map +1 -0
- package/dist/features/token-manager.js +6 -0
- package/dist/features/token-manager.js.map +1 -0
- package/dist/features/vault-factory.js +36 -0
- package/dist/features/vault-factory.js.map +1 -0
- package/dist/features/voting.js +136 -0
- package/dist/features/voting.js.map +1 -0
- package/dist/programs/config.js +33 -0
- package/dist/programs/config.js.map +1 -0
- package/dist/programs/dashboard.js +688 -0
- package/dist/programs/dashboard.js.map +1 -0
- package/dist/programs/delegation.js +539 -0
- package/dist/programs/delegation.js.map +1 -0
- package/dist/programs/index.js +5 -0
- package/dist/programs/index.js.map +1 -1
- package/dist/programs/vault-factory.js +84 -0
- package/dist/programs/vault-factory.js.map +1 -0
- package/dist/programs/vault-hub.js +331 -116
- package/dist/programs/vault-hub.js.map +1 -1
- package/dist/programs/vault.js +378 -0
- package/dist/programs/vault.js.map +1 -0
- package/dist/programs/voting.js +53 -0
- package/dist/programs/voting.js.map +1 -0
- package/dist/providers/wallet.js +20 -18
- package/dist/providers/wallet.js.map +1 -1
- package/dist/types/common.js +3 -0
- package/dist/types/common.js.map +1 -0
- package/dist/types/config.js +3 -0
- package/dist/types/config.js.map +1 -0
- package/dist/types/index.js +19 -0
- package/dist/types/index.js.map +1 -0
- package/dist/utils/data-validators.js +51 -0
- package/dist/utils/data-validators.js.map +1 -0
- package/dist/utils/index.js +3 -0
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/resolve-path.js +13 -0
- package/dist/utils/resolve-path.js.map +1 -0
- package/dist/utils/sleep.js +8 -0
- package/dist/utils/sleep.js.map +1 -0
- package/package.json +7 -3
|
@@ -0,0 +1,688 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const _command_1 = require("../command");
|
|
4
|
+
const _contracts_1 = require("../contracts");
|
|
5
|
+
const _providers_1 = require("../providers");
|
|
6
|
+
const _configs_1 = require("../configs");
|
|
7
|
+
const dashboard = _command_1.program.command("dashboard").description("dashboard contract");
|
|
8
|
+
dashboard
|
|
9
|
+
.command("info")
|
|
10
|
+
.description("get dashboard base info")
|
|
11
|
+
.argument("<address>", "dashboard address")
|
|
12
|
+
.action(async (address) => {
|
|
13
|
+
const contract = (0, _contracts_1.getDashboardContract)(address);
|
|
14
|
+
try {
|
|
15
|
+
const steth = await contract.read.STETH();
|
|
16
|
+
const wsteth = await contract.read.WSTETH();
|
|
17
|
+
const weth = await contract.read.WETH();
|
|
18
|
+
const isInit = await contract.read.initialized();
|
|
19
|
+
const vault = await contract.read.stakingVault();
|
|
20
|
+
const payload = {
|
|
21
|
+
steth,
|
|
22
|
+
wsteth,
|
|
23
|
+
weth,
|
|
24
|
+
vault,
|
|
25
|
+
isInit,
|
|
26
|
+
};
|
|
27
|
+
console.table(Object.entries(payload));
|
|
28
|
+
}
|
|
29
|
+
catch (err) {
|
|
30
|
+
if (err instanceof Error) {
|
|
31
|
+
console.log('Error when getting info:\n', err.message);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
dashboard
|
|
36
|
+
.command("committee")
|
|
37
|
+
.description("voting committee info")
|
|
38
|
+
.argument("<address>", "dashboard address")
|
|
39
|
+
.action(async (address) => {
|
|
40
|
+
try {
|
|
41
|
+
const contract = (0, _contracts_1.getDashboardContract)(address);
|
|
42
|
+
const votingCommittee = await contract.read.votingCommittee();
|
|
43
|
+
console.table(votingCommittee);
|
|
44
|
+
}
|
|
45
|
+
catch (err) {
|
|
46
|
+
if (err instanceof Error) {
|
|
47
|
+
console.log('Error when getting voting committee info:\n', err.message);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
dashboard
|
|
52
|
+
.command("vault")
|
|
53
|
+
.description("vault info")
|
|
54
|
+
.argument("<address>", "dashboard address")
|
|
55
|
+
.action(async (address) => {
|
|
56
|
+
try {
|
|
57
|
+
const contract = (0, _contracts_1.getDashboardContract)(address);
|
|
58
|
+
const vaultInfo = await contract.read.vaultSocket();
|
|
59
|
+
console.table(Object.values(vaultInfo));
|
|
60
|
+
}
|
|
61
|
+
catch (err) {
|
|
62
|
+
if (err instanceof Error) {
|
|
63
|
+
console.log('Error when getting vault info:\n', err.message);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
dashboard
|
|
68
|
+
.command("s-limit")
|
|
69
|
+
.description("shares limit")
|
|
70
|
+
.argument("<address>", "dashboard address")
|
|
71
|
+
.action(async (address) => {
|
|
72
|
+
const contract = (0, _contracts_1.getDashboardContract)(address);
|
|
73
|
+
try {
|
|
74
|
+
const shareLimit = await contract.read.shareLimit();
|
|
75
|
+
console.table({ 'Share limit': shareLimit });
|
|
76
|
+
}
|
|
77
|
+
catch (err) {
|
|
78
|
+
if (err instanceof Error) {
|
|
79
|
+
console.log('Error when getting share limit:\n', err.message);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
dashboard
|
|
84
|
+
.command("s-minted")
|
|
85
|
+
.description("shares minted")
|
|
86
|
+
.argument("<address>", "dashboard address")
|
|
87
|
+
.action(async (address) => {
|
|
88
|
+
const contract = (0, _contracts_1.getDashboardContract)(address);
|
|
89
|
+
try {
|
|
90
|
+
const sharesMinted = await contract.read.sharesMinted();
|
|
91
|
+
console.table({ 'Share minted': sharesMinted });
|
|
92
|
+
}
|
|
93
|
+
catch (err) {
|
|
94
|
+
if (err instanceof Error) {
|
|
95
|
+
console.log('Error when getting shares minted:\n', err.message);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
dashboard
|
|
100
|
+
.command("reserve-ratio")
|
|
101
|
+
.description("vault reserve ratio of the vault")
|
|
102
|
+
.argument("<address>", "dashboard address")
|
|
103
|
+
.action(async (address) => {
|
|
104
|
+
const contract = (0, _contracts_1.getDashboardContract)(address);
|
|
105
|
+
try {
|
|
106
|
+
const reserveRatio = await contract.read.reserveRatioBP();
|
|
107
|
+
console.table({ 'Reserve ratio BP': reserveRatio });
|
|
108
|
+
}
|
|
109
|
+
catch (err) {
|
|
110
|
+
if (err instanceof Error) {
|
|
111
|
+
console.log('Error when getting reserve ratio:\n', err.message);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
dashboard
|
|
116
|
+
.command("t-reserve-ratio")
|
|
117
|
+
.description("threshold reserve ratio of the vault")
|
|
118
|
+
.argument("<address>", "dashboard address")
|
|
119
|
+
.action(async (address) => {
|
|
120
|
+
const contract = (0, _contracts_1.getDashboardContract)(address);
|
|
121
|
+
try {
|
|
122
|
+
const thresholdReserveRatio = await contract.read.thresholdReserveRatioBP();
|
|
123
|
+
console.table({ 'Threshold reserve ratio BP': thresholdReserveRatio });
|
|
124
|
+
}
|
|
125
|
+
catch (err) {
|
|
126
|
+
if (err instanceof Error) {
|
|
127
|
+
console.log('Error when getting threshold reserve ratio:\n', err.message);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
});
|
|
131
|
+
dashboard
|
|
132
|
+
.command("t-fee")
|
|
133
|
+
.description("treasury fee basis points")
|
|
134
|
+
.argument("<address>", "dashboard address")
|
|
135
|
+
.action(async (address) => {
|
|
136
|
+
const contract = (0, _contracts_1.getDashboardContract)(address);
|
|
137
|
+
try {
|
|
138
|
+
const treasuryFee = await contract.read.treasuryFee();
|
|
139
|
+
console.table({ 'Treasury fee': treasuryFee });
|
|
140
|
+
}
|
|
141
|
+
catch (err) {
|
|
142
|
+
if (err instanceof Error) {
|
|
143
|
+
console.log('Error when getting treasury fee:\n', err.message);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
});
|
|
147
|
+
dashboard
|
|
148
|
+
.command("valuation")
|
|
149
|
+
.description("valuation of the vault in ether")
|
|
150
|
+
.argument("<address>", "dashboard address")
|
|
151
|
+
.action(async (address) => {
|
|
152
|
+
const contract = (0, _contracts_1.getDashboardContract)(address);
|
|
153
|
+
try {
|
|
154
|
+
const valuation = await contract.read.valuation();
|
|
155
|
+
console.table({ Valuation: valuation });
|
|
156
|
+
}
|
|
157
|
+
catch (err) {
|
|
158
|
+
if (err instanceof Error) {
|
|
159
|
+
console.log('Error when getting valuation of the vault in ether:\n', err.message);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
});
|
|
163
|
+
dashboard
|
|
164
|
+
.command("t-shares")
|
|
165
|
+
.description("total of shares that can be minted on the vault")
|
|
166
|
+
.argument("<address>", "dashboard address")
|
|
167
|
+
.action(async (address) => {
|
|
168
|
+
const contract = (0, _contracts_1.getDashboardContract)(address);
|
|
169
|
+
try {
|
|
170
|
+
const totalMintableShares = await contract.read.totalMintableShares();
|
|
171
|
+
console.table({ 'Total mintable shares': totalMintableShares });
|
|
172
|
+
}
|
|
173
|
+
catch (err) {
|
|
174
|
+
if (err instanceof Error) {
|
|
175
|
+
console.log('Error when getting total of shares that can be minted on the vault:\n', err.message);
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
});
|
|
179
|
+
dashboard
|
|
180
|
+
.command("get-shares")
|
|
181
|
+
.description("maximum number of shares that can be minted with deposited ether")
|
|
182
|
+
.argument("<address>", "dashboard address")
|
|
183
|
+
.argument("<ether>", "amount of ether to be funded")
|
|
184
|
+
.action(async (address, ether) => {
|
|
185
|
+
const contract = (0, _contracts_1.getDashboardContract)(address);
|
|
186
|
+
try {
|
|
187
|
+
const mintableShares = await contract.read.projectedNewMintableShares([BigInt(ether)]);
|
|
188
|
+
console.table({ 'Mintable shares': mintableShares });
|
|
189
|
+
}
|
|
190
|
+
catch (err) {
|
|
191
|
+
if (err instanceof Error) {
|
|
192
|
+
console.log('Error when getting maximum number of shares that can be minted with deposited ether:\n', err.message);
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
});
|
|
196
|
+
dashboard
|
|
197
|
+
.command("withdrawable-eth")
|
|
198
|
+
.description("amount of ether that can be withdrawn from the staking vault")
|
|
199
|
+
.argument("<address>", "dashboard address")
|
|
200
|
+
.action(async (address) => {
|
|
201
|
+
const contract = (0, _contracts_1.getDashboardContract)(address);
|
|
202
|
+
try {
|
|
203
|
+
const withdrawableEther = await contract.read.withdrawableEther();
|
|
204
|
+
console.table({ 'Withdrawable ether': withdrawableEther });
|
|
205
|
+
}
|
|
206
|
+
catch (err) {
|
|
207
|
+
if (err instanceof Error) {
|
|
208
|
+
console.log('Error when getting amount of ether that can be withdrawn from the staking vault:\n', err.message);
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
});
|
|
212
|
+
// TODO: test without voting
|
|
213
|
+
dashboard
|
|
214
|
+
.command("ownership")
|
|
215
|
+
.description("transfers ownership of the staking vault to a new owner")
|
|
216
|
+
.argument("<address>", "dashboard address")
|
|
217
|
+
.argument("<newOwner>", "address of the new owner")
|
|
218
|
+
.action(async (address, newOwner) => {
|
|
219
|
+
const contract = (0, _contracts_1.getDashboardContract)(address);
|
|
220
|
+
try {
|
|
221
|
+
const tx = await contract.write.transferStakingVaultOwnership([newOwner], {
|
|
222
|
+
account: (0, _providers_1.getAccount)(),
|
|
223
|
+
chain: (0, _configs_1.getChain)(),
|
|
224
|
+
});
|
|
225
|
+
console.table({ Transaction: tx });
|
|
226
|
+
}
|
|
227
|
+
catch (err) {
|
|
228
|
+
if (err instanceof Error) {
|
|
229
|
+
console.log('Error when transferring ownership of the staking vault to a new owner:\n', err.message);
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
});
|
|
233
|
+
dashboard
|
|
234
|
+
.command("disconnect")
|
|
235
|
+
.description("disconnects the staking vault from the vault hub")
|
|
236
|
+
.argument("<address>", "dashboard address")
|
|
237
|
+
.action(async (address) => {
|
|
238
|
+
const contract = (0, _contracts_1.getDashboardContract)(address);
|
|
239
|
+
try {
|
|
240
|
+
const tx = await contract.write.voluntaryDisconnect({
|
|
241
|
+
account: (0, _providers_1.getAccount)(),
|
|
242
|
+
chain: (0, _configs_1.getChain)(),
|
|
243
|
+
});
|
|
244
|
+
console.table({ Transaction: tx });
|
|
245
|
+
}
|
|
246
|
+
catch (err) {
|
|
247
|
+
if (err instanceof Error) {
|
|
248
|
+
console.log('Error when disconnecting the staking vault from the vault hub:\n', err.message);
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
});
|
|
252
|
+
dashboard
|
|
253
|
+
.command("fund")
|
|
254
|
+
.description("funds the staking vault with ether")
|
|
255
|
+
.argument("<address>", "dashboard address")
|
|
256
|
+
.argument("<ether>", "amount of ether to be funded")
|
|
257
|
+
.action(async (address, ether) => {
|
|
258
|
+
const contract = (0, _contracts_1.getDashboardContract)(address);
|
|
259
|
+
try {
|
|
260
|
+
const tx = await contract.write.fund({
|
|
261
|
+
account: (0, _providers_1.getAccount)(),
|
|
262
|
+
chain: (0, _configs_1.getChain)(),
|
|
263
|
+
value: BigInt(ether),
|
|
264
|
+
});
|
|
265
|
+
console.table({ Transaction: tx });
|
|
266
|
+
}
|
|
267
|
+
catch (err) {
|
|
268
|
+
if (err instanceof Error) {
|
|
269
|
+
console.log('Error when funding:\n', err.message);
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
});
|
|
273
|
+
dashboard
|
|
274
|
+
.command("fund-weth")
|
|
275
|
+
.description("funds the staking vault with wrapped ether")
|
|
276
|
+
.argument("<address>", "dashboard address")
|
|
277
|
+
.argument("<wethAmount>", "amount of weth to be funded")
|
|
278
|
+
.action(async (address, wethAmount) => {
|
|
279
|
+
const contract = (0, _contracts_1.getDashboardContract)(address);
|
|
280
|
+
try {
|
|
281
|
+
const tx = await contract.write.fundWeth([BigInt(wethAmount)], {
|
|
282
|
+
account: (0, _providers_1.getAccount)(),
|
|
283
|
+
chain: (0, _configs_1.getChain)(),
|
|
284
|
+
});
|
|
285
|
+
console.table({ Transaction: tx });
|
|
286
|
+
}
|
|
287
|
+
catch (err) {
|
|
288
|
+
if (err instanceof Error) {
|
|
289
|
+
console.log('Error when funding weth:\n', err.message);
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
});
|
|
293
|
+
dashboard
|
|
294
|
+
.command("withdraw")
|
|
295
|
+
.description("withdraws ether from the staking vault to a recipient")
|
|
296
|
+
.argument("<address>", "dashboard address")
|
|
297
|
+
.argument("<recipient>", "address of the recipient")
|
|
298
|
+
.argument("<ether>", "amount of ether to withdraw")
|
|
299
|
+
.action(async (address, recipient, ether) => {
|
|
300
|
+
const contract = (0, _contracts_1.getDashboardContract)(address);
|
|
301
|
+
try {
|
|
302
|
+
const tx = await contract.write.withdraw([recipient, BigInt(ether)], {
|
|
303
|
+
account: (0, _providers_1.getAccount)(),
|
|
304
|
+
chain: (0, _configs_1.getChain)(),
|
|
305
|
+
});
|
|
306
|
+
console.table({ Transaction: tx });
|
|
307
|
+
}
|
|
308
|
+
catch (err) {
|
|
309
|
+
if (err instanceof Error) {
|
|
310
|
+
console.log('Error when withdrawing:\n', err.message);
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
});
|
|
314
|
+
dashboard
|
|
315
|
+
.command("withdraw-weth")
|
|
316
|
+
.description("withdraws stETH tokens from the staking vault to wrapped ether")
|
|
317
|
+
.argument("<address>", "dashboard address")
|
|
318
|
+
.argument("<recipient>", "address of the recipient")
|
|
319
|
+
.argument("<ether>", "amount of ether to withdraw")
|
|
320
|
+
.action(async (address, recipient, ether) => {
|
|
321
|
+
const contract = (0, _contracts_1.getDashboardContract)(address);
|
|
322
|
+
try {
|
|
323
|
+
const tx = await contract.write.withdrawWETH([recipient, BigInt(ether)], {
|
|
324
|
+
account: (0, _providers_1.getAccount)(),
|
|
325
|
+
chain: (0, _configs_1.getChain)(),
|
|
326
|
+
});
|
|
327
|
+
console.table({ Transaction: tx });
|
|
328
|
+
}
|
|
329
|
+
catch (err) {
|
|
330
|
+
if (err instanceof Error) {
|
|
331
|
+
console.log('Error when withdrawing weth:\n', err.message);
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
});
|
|
335
|
+
dashboard
|
|
336
|
+
.command("exit")
|
|
337
|
+
.description("requests the exit of a validator from the staking vault")
|
|
338
|
+
.argument("<address>", "dashboard address")
|
|
339
|
+
.argument("<validatorPubKey>", "public key of the validator to exit")
|
|
340
|
+
.action(async (address, validatorPubKey) => {
|
|
341
|
+
const contract = (0, _contracts_1.getDashboardContract)(address);
|
|
342
|
+
try {
|
|
343
|
+
const tx = await contract.write.requestValidatorExit([validatorPubKey], {
|
|
344
|
+
account: (0, _providers_1.getAccount)(),
|
|
345
|
+
chain: (0, _configs_1.getChain)(),
|
|
346
|
+
});
|
|
347
|
+
console.table({ Transaction: tx });
|
|
348
|
+
}
|
|
349
|
+
catch (err) {
|
|
350
|
+
if (err instanceof Error) {
|
|
351
|
+
console.log('Error when requesting the exit of a validator from the staking vault:\n', err.message);
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
});
|
|
355
|
+
dashboard
|
|
356
|
+
.command("mint-shares")
|
|
357
|
+
.description("mints stETH tokens backed by the vault to a recipient")
|
|
358
|
+
.argument("<address>", "dashboard address")
|
|
359
|
+
.argument("<recipient>", "address of the recipient")
|
|
360
|
+
.argument("<amountOfShares>", "amount of shares to mint")
|
|
361
|
+
.action(async (address, recipient, amountOfShares) => {
|
|
362
|
+
const contract = (0, _contracts_1.getDashboardContract)(address);
|
|
363
|
+
try {
|
|
364
|
+
const tx = await contract.write.mintShares([recipient, BigInt(amountOfShares)], {
|
|
365
|
+
account: (0, _providers_1.getAccount)(),
|
|
366
|
+
chain: (0, _configs_1.getChain)(),
|
|
367
|
+
});
|
|
368
|
+
console.table({ Transaction: tx });
|
|
369
|
+
}
|
|
370
|
+
catch (err) {
|
|
371
|
+
if (err instanceof Error) {
|
|
372
|
+
console.log('Error when minting shares:\n', err.message);
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
});
|
|
376
|
+
dashboard
|
|
377
|
+
.command("mint-steth")
|
|
378
|
+
.description("mints stETH tokens backed by the vault to a recipient")
|
|
379
|
+
.argument("<address>", "dashboard address")
|
|
380
|
+
.argument("<recipient>", "address of the recipient")
|
|
381
|
+
.argument("<amountOfShares>", "amount of shares to mint")
|
|
382
|
+
.action(async (address, recipient, amountOfShares) => {
|
|
383
|
+
const contract = (0, _contracts_1.getDashboardContract)(address);
|
|
384
|
+
try {
|
|
385
|
+
const tx = await contract.write.mintStETH([recipient, BigInt(amountOfShares)], {
|
|
386
|
+
account: (0, _providers_1.getAccount)(),
|
|
387
|
+
chain: (0, _configs_1.getChain)(),
|
|
388
|
+
});
|
|
389
|
+
console.table({ Transaction: tx });
|
|
390
|
+
}
|
|
391
|
+
catch (err) {
|
|
392
|
+
if (err instanceof Error) {
|
|
393
|
+
console.log('Error when minting stETH:\n', err.message);
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
});
|
|
397
|
+
dashboard
|
|
398
|
+
.command("mint-wsteth")
|
|
399
|
+
.description("mints wstETH tokens backed by the vault to a recipient")
|
|
400
|
+
.argument("<address>", "dashboard address")
|
|
401
|
+
.argument("<recipient>", "address of the recipient")
|
|
402
|
+
.argument("<tokens>", "amount of tokens to mint")
|
|
403
|
+
.action(async (address, recipient, tokens) => {
|
|
404
|
+
const contract = (0, _contracts_1.getDashboardContract)(address);
|
|
405
|
+
try {
|
|
406
|
+
const tx = await contract.write.mintWstETH([recipient, BigInt(tokens)], {
|
|
407
|
+
account: (0, _providers_1.getAccount)(),
|
|
408
|
+
chain: (0, _configs_1.getChain)(),
|
|
409
|
+
});
|
|
410
|
+
console.table({ Transaction: tx });
|
|
411
|
+
}
|
|
412
|
+
catch (err) {
|
|
413
|
+
if (err instanceof Error) {
|
|
414
|
+
console.log('Error when minting wstETH:\n', err.message);
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
});
|
|
418
|
+
dashboard
|
|
419
|
+
.command("burn-shares")
|
|
420
|
+
.description("Burns stETH shares from the sender backed by the vault. Expects corresponding amount of stETH approved to this contract")
|
|
421
|
+
.argument("<address>", "dashboard address")
|
|
422
|
+
.argument("<amountOfShares>", "amount of shares to burn")
|
|
423
|
+
.action(async (address, amountOfShares) => {
|
|
424
|
+
const contract = (0, _contracts_1.getDashboardContract)(address);
|
|
425
|
+
try {
|
|
426
|
+
const tx = await contract.write.burnShares([BigInt(amountOfShares)], {
|
|
427
|
+
account: (0, _providers_1.getAccount)(),
|
|
428
|
+
chain: (0, _configs_1.getChain)(),
|
|
429
|
+
});
|
|
430
|
+
console.table({ Transaction: tx });
|
|
431
|
+
}
|
|
432
|
+
catch (err) {
|
|
433
|
+
if (err instanceof Error) {
|
|
434
|
+
console.log('Error when burning shares:\n', err.message);
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
});
|
|
438
|
+
dashboard
|
|
439
|
+
.command("burn-steth")
|
|
440
|
+
.description("Burns stETH shares from the sender backed by the vault. Expects stETH amount approved to this contract.")
|
|
441
|
+
.argument("<address>", "dashboard address")
|
|
442
|
+
.argument("<amountOfShares>", "amount of shares to burn")
|
|
443
|
+
.action(async (address, amountOfShares) => {
|
|
444
|
+
const contract = (0, _contracts_1.getDashboardContract)(address);
|
|
445
|
+
try {
|
|
446
|
+
const tx = await contract.write.burnStETH([BigInt(amountOfShares)], {
|
|
447
|
+
account: (0, _providers_1.getAccount)(),
|
|
448
|
+
chain: (0, _configs_1.getChain)(),
|
|
449
|
+
});
|
|
450
|
+
console.table({ Transaction: tx });
|
|
451
|
+
}
|
|
452
|
+
catch (err) {
|
|
453
|
+
if (err instanceof Error) {
|
|
454
|
+
console.log('Error when burning stETH:\n', err.message);
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
});
|
|
458
|
+
dashboard
|
|
459
|
+
.command("burn-wsteth")
|
|
460
|
+
.description("burn wstETH tokens from the sender backed by the vault")
|
|
461
|
+
.argument("<address>", "dashboard address")
|
|
462
|
+
.argument("<tokens>", "amount of wstETH tokens to burn")
|
|
463
|
+
.action(async (address, tokens) => {
|
|
464
|
+
const contract = (0, _contracts_1.getDashboardContract)(address);
|
|
465
|
+
try {
|
|
466
|
+
const tx = await contract.write.burnWstETH([BigInt(tokens)], {
|
|
467
|
+
account: (0, _providers_1.getAccount)(),
|
|
468
|
+
chain: (0, _configs_1.getChain)(),
|
|
469
|
+
});
|
|
470
|
+
console.table({ Transaction: tx });
|
|
471
|
+
}
|
|
472
|
+
catch (err) {
|
|
473
|
+
if (err instanceof Error) {
|
|
474
|
+
console.log('Error when burning wstETH:\n', err.message);
|
|
475
|
+
}
|
|
476
|
+
}
|
|
477
|
+
});
|
|
478
|
+
dashboard
|
|
479
|
+
.command("burn-shares-permit")
|
|
480
|
+
.description("Burns stETH tokens (in shares) backed by the vault from the sender using permit (with value in stETH).")
|
|
481
|
+
.argument("<address>", "dashboard address")
|
|
482
|
+
.argument("<tokens>", "amount of stETH tokens to burn")
|
|
483
|
+
.argument("<permitJSON>", "JSON data required for the stETH.permit() method to set the allowance")
|
|
484
|
+
.action(async (address, tokens, permitJSON) => {
|
|
485
|
+
const permit = JSON.parse(permitJSON);
|
|
486
|
+
const contract = (0, _contracts_1.getDashboardContract)(address);
|
|
487
|
+
try {
|
|
488
|
+
const tx = await contract.write.burnSharesWithPermit([BigInt(tokens), permit], {
|
|
489
|
+
account: (0, _providers_1.getAccount)(),
|
|
490
|
+
chain: (0, _configs_1.getChain)(),
|
|
491
|
+
});
|
|
492
|
+
console.table({ Transaction: tx });
|
|
493
|
+
}
|
|
494
|
+
catch (err) {
|
|
495
|
+
if (err instanceof Error) {
|
|
496
|
+
console.log('Error when burning stETH (in shares) using permit:\n', err.message);
|
|
497
|
+
}
|
|
498
|
+
}
|
|
499
|
+
});
|
|
500
|
+
dashboard
|
|
501
|
+
.command("burn-steth-permit")
|
|
502
|
+
.description("Burns stETH tokens backed by the vault from the sender using permit.")
|
|
503
|
+
.argument("<address>", "dashboard address")
|
|
504
|
+
.argument("<tokens>", "amount of stETH tokens to burn")
|
|
505
|
+
.argument("<permitJSON>", "JSON data required for the stETH.permit() method to set the allowance")
|
|
506
|
+
.action(async (address, tokens, permitJSON) => {
|
|
507
|
+
const permit = JSON.parse(permitJSON);
|
|
508
|
+
const contract = (0, _contracts_1.getDashboardContract)(address);
|
|
509
|
+
try {
|
|
510
|
+
const tx = await contract.write.burnStETHWithPermit([BigInt(tokens), permit], {
|
|
511
|
+
account: (0, _providers_1.getAccount)(),
|
|
512
|
+
chain: (0, _configs_1.getChain)(),
|
|
513
|
+
});
|
|
514
|
+
console.table({ Transaction: tx });
|
|
515
|
+
}
|
|
516
|
+
catch (err) {
|
|
517
|
+
if (err instanceof Error) {
|
|
518
|
+
console.log('Error when burning stETH using permit:\n', err.message);
|
|
519
|
+
}
|
|
520
|
+
}
|
|
521
|
+
});
|
|
522
|
+
dashboard
|
|
523
|
+
.command("burn-wsteth-permit")
|
|
524
|
+
.description("burn wstETH tokens from the sender backed by the vault using EIP-2612 Permit")
|
|
525
|
+
.argument("<address>", "dashboard address")
|
|
526
|
+
.argument("<tokens>", "amount of wstETH tokens to burn")
|
|
527
|
+
.argument("<permitJSON>", "JSON data required for the wstETH.permit() method to set the allowance")
|
|
528
|
+
.action(async (address, tokens, permitJSON) => {
|
|
529
|
+
const permit = JSON.parse(permitJSON);
|
|
530
|
+
const contract = (0, _contracts_1.getDashboardContract)(address);
|
|
531
|
+
try {
|
|
532
|
+
const tx = await contract.write.burnWstETHWithPermit([BigInt(tokens), permit], {
|
|
533
|
+
account: (0, _providers_1.getAccount)(),
|
|
534
|
+
chain: (0, _configs_1.getChain)(),
|
|
535
|
+
});
|
|
536
|
+
console.table({ Transaction: tx });
|
|
537
|
+
}
|
|
538
|
+
catch (err) {
|
|
539
|
+
if (err instanceof Error) {
|
|
540
|
+
console.log('Error when burning wstETH using permit:\n', err.message);
|
|
541
|
+
}
|
|
542
|
+
}
|
|
543
|
+
});
|
|
544
|
+
dashboard
|
|
545
|
+
.command("rebalance")
|
|
546
|
+
.description("rebalance the vault by transferring ether")
|
|
547
|
+
.argument("<address>", "dashboard address")
|
|
548
|
+
.argument("<ether>", "amount of ether to rebalance")
|
|
549
|
+
.action(async (address, ether) => {
|
|
550
|
+
const contract = (0, _contracts_1.getDashboardContract)(address);
|
|
551
|
+
try {
|
|
552
|
+
const tx = await contract.write.rebalanceVault([BigInt(ether)], {
|
|
553
|
+
account: (0, _providers_1.getAccount)(),
|
|
554
|
+
chain: (0, _configs_1.getChain)(),
|
|
555
|
+
});
|
|
556
|
+
console.table({ Transaction: tx });
|
|
557
|
+
}
|
|
558
|
+
catch (err) {
|
|
559
|
+
if (err instanceof Error) {
|
|
560
|
+
console.log('Error when rebalancing:\n', err.message);
|
|
561
|
+
}
|
|
562
|
+
}
|
|
563
|
+
});
|
|
564
|
+
dashboard
|
|
565
|
+
.command("recover-erc20")
|
|
566
|
+
.description("recovers ERC20 tokens or ether from the dashboard contract to sender")
|
|
567
|
+
.argument("<address>", "dashboard address")
|
|
568
|
+
.argument("<token>", "Address of the token to recover or 0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee for ether")
|
|
569
|
+
.argument("<recipient>", "Address of the recovery recipient")
|
|
570
|
+
.argument("<amount>", "amount of ether to recover")
|
|
571
|
+
.action(async (address, token, recipient, amount) => {
|
|
572
|
+
const contract = (0, _contracts_1.getDashboardContract)(address);
|
|
573
|
+
try {
|
|
574
|
+
const tx = await contract.write.recoverERC20([token, recipient, BigInt(amount)], {
|
|
575
|
+
account: (0, _providers_1.getAccount)(),
|
|
576
|
+
chain: (0, _configs_1.getChain)(),
|
|
577
|
+
});
|
|
578
|
+
console.table({ Transaction: tx });
|
|
579
|
+
}
|
|
580
|
+
catch (err) {
|
|
581
|
+
if (err instanceof Error) {
|
|
582
|
+
console.log('Error when recovering:\n', err.message);
|
|
583
|
+
}
|
|
584
|
+
}
|
|
585
|
+
});
|
|
586
|
+
dashboard
|
|
587
|
+
.command("recover-erc721")
|
|
588
|
+
.description("Transfers a given token_id of an ERC721-compatible NFT (defined by the token contract address)")
|
|
589
|
+
.argument("<address>", "dashboard address")
|
|
590
|
+
.argument("<token>", "an ERC721-compatible token")
|
|
591
|
+
.argument("<tokenId>", "token id to recover")
|
|
592
|
+
.argument("<recipient>", "Address of the recovery recipient")
|
|
593
|
+
.action(async (address, token, tokenId, recipient) => {
|
|
594
|
+
const contract = (0, _contracts_1.getDashboardContract)(address);
|
|
595
|
+
try {
|
|
596
|
+
const tx = await contract.write.recoverERC721([token, BigInt(tokenId), recipient], {
|
|
597
|
+
account: (0, _providers_1.getAccount)(),
|
|
598
|
+
chain: (0, _configs_1.getChain)(),
|
|
599
|
+
});
|
|
600
|
+
console.table({ Transaction: tx });
|
|
601
|
+
}
|
|
602
|
+
catch (err) {
|
|
603
|
+
if (err instanceof Error) {
|
|
604
|
+
console.log('Error when recovering:\n', err.message);
|
|
605
|
+
}
|
|
606
|
+
}
|
|
607
|
+
});
|
|
608
|
+
dashboard
|
|
609
|
+
.command("deposit-pause")
|
|
610
|
+
.description("Pauses beacon chain deposits on the staking vault.")
|
|
611
|
+
.argument("<address>", "dashboard address")
|
|
612
|
+
.action(async (address) => {
|
|
613
|
+
const contract = (0, _contracts_1.getDashboardContract)(address);
|
|
614
|
+
try {
|
|
615
|
+
const tx = await contract.write.pauseBeaconChainDeposits({
|
|
616
|
+
account: (0, _providers_1.getAccount)(),
|
|
617
|
+
chain: (0, _configs_1.getChain)(),
|
|
618
|
+
});
|
|
619
|
+
console.table({ Transaction: tx });
|
|
620
|
+
}
|
|
621
|
+
catch (err) {
|
|
622
|
+
if (err instanceof Error) {
|
|
623
|
+
console.log('Error when pausing deposit:\n', err.message);
|
|
624
|
+
}
|
|
625
|
+
}
|
|
626
|
+
});
|
|
627
|
+
dashboard
|
|
628
|
+
.command("deposit-resume")
|
|
629
|
+
.description("Mass-grants multiple roles to multiple accounts.")
|
|
630
|
+
.argument("<address>", "dashboard address")
|
|
631
|
+
.action(async (address) => {
|
|
632
|
+
const contract = (0, _contracts_1.getDashboardContract)(address);
|
|
633
|
+
try {
|
|
634
|
+
const tx = await contract.write.resumeBeaconChainDeposits({
|
|
635
|
+
account: (0, _providers_1.getAccount)(),
|
|
636
|
+
chain: (0, _configs_1.getChain)(),
|
|
637
|
+
});
|
|
638
|
+
console.table({ Transaction: tx });
|
|
639
|
+
}
|
|
640
|
+
catch (err) {
|
|
641
|
+
if (err instanceof Error) {
|
|
642
|
+
console.log('Error when resuming deposit:\n', err.message);
|
|
643
|
+
}
|
|
644
|
+
}
|
|
645
|
+
});
|
|
646
|
+
dashboard
|
|
647
|
+
.command("role-grant")
|
|
648
|
+
.description("Mass-revokes multiple roles from multiple accounts.")
|
|
649
|
+
.argument("<address>", "dashboard address")
|
|
650
|
+
.argument("<roleAssignment>", "JSON array of role assignments")
|
|
651
|
+
.action(async (address, roleAssignment) => {
|
|
652
|
+
const contract = (0, _contracts_1.getDashboardContract)(address);
|
|
653
|
+
const payload = JSON.parse(roleAssignment);
|
|
654
|
+
try {
|
|
655
|
+
const tx = await contract.write.grantRoles([payload], {
|
|
656
|
+
account: (0, _providers_1.getAccount)(),
|
|
657
|
+
chain: (0, _configs_1.getChain)(),
|
|
658
|
+
});
|
|
659
|
+
console.table({ Transaction: tx });
|
|
660
|
+
}
|
|
661
|
+
catch (err) {
|
|
662
|
+
if (err instanceof Error) {
|
|
663
|
+
console.log('Error when granting role:\n', err.message);
|
|
664
|
+
}
|
|
665
|
+
}
|
|
666
|
+
});
|
|
667
|
+
dashboard
|
|
668
|
+
.command("role-revoke")
|
|
669
|
+
.description("Resumes beacon chain deposits on the staking vault.")
|
|
670
|
+
.argument("<address>", "dashboard address")
|
|
671
|
+
.argument("<roleAssignment>", "JSON array of role assignments")
|
|
672
|
+
.action(async (address, roleAssignment) => {
|
|
673
|
+
const contract = (0, _contracts_1.getDashboardContract)(address);
|
|
674
|
+
const payload = JSON.parse(roleAssignment);
|
|
675
|
+
try {
|
|
676
|
+
const tx = await contract.write.revokeRoles([payload], {
|
|
677
|
+
account: (0, _providers_1.getAccount)(),
|
|
678
|
+
chain: (0, _configs_1.getChain)(),
|
|
679
|
+
});
|
|
680
|
+
console.table({ Transaction: tx });
|
|
681
|
+
}
|
|
682
|
+
catch (err) {
|
|
683
|
+
if (err instanceof Error) {
|
|
684
|
+
console.log('Error when revoking role:\n', err.message);
|
|
685
|
+
}
|
|
686
|
+
}
|
|
687
|
+
});
|
|
688
|
+
//# sourceMappingURL=dashboard.js.map
|