@lidofinance/lsv-cli 1.0.0-alpha.10 → 1.0.0-alpha.11
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/dist/abi/Dashboard.js +1 -4
- package/dist/abi/Dashboard.js.map +1 -1
- package/dist/abi/Delegation.js +1 -4
- package/dist/abi/Delegation.js.map +1 -1
- package/dist/abi/LidoLocator.js +1 -4
- package/dist/abi/LidoLocator.js.map +1 -1
- package/dist/abi/StEth.js +1 -4
- package/dist/abi/StEth.js.map +1 -1
- package/dist/abi/StakingVault.js +1 -4
- package/dist/abi/StakingVault.js.map +1 -1
- package/dist/abi/TokenManager.js +1 -4
- package/dist/abi/TokenManager.js.map +1 -1
- package/dist/abi/VaultFactory.js +1 -4
- package/dist/abi/VaultFactory.js.map +1 -1
- package/dist/abi/VaultHub.js +1 -4
- package/dist/abi/VaultHub.js.map +1 -1
- package/dist/abi/Voting.js +1 -4
- package/dist/abi/Voting.js.map +1 -1
- package/dist/abi/index.js +9 -25
- package/dist/abi/index.js.map +1 -1
- package/dist/command/index.js +5 -8
- package/dist/command/index.js.map +1 -1
- package/dist/configs/constants.js +2 -5
- package/dist/configs/constants.js.map +1 -1
- package/dist/configs/deployed.js +63 -96
- package/dist/configs/deployed.js.map +1 -1
- package/dist/configs/envs.js +9 -45
- package/dist/configs/envs.js.map +1 -1
- package/dist/configs/index.js +3 -19
- package/dist/configs/index.js.map +1 -1
- package/dist/configs/utils.js +10 -16
- package/dist/configs/utils.js.map +1 -1
- package/dist/contracts/dashboard.js +7 -11
- package/dist/contracts/dashboard.js.map +1 -1
- package/dist/contracts/delegation.js +7 -11
- package/dist/contracts/delegation.js.map +1 -1
- package/dist/contracts/index.js +9 -25
- package/dist/contracts/index.js.map +1 -1
- package/dist/contracts/locator.js +11 -15
- package/dist/contracts/locator.js.map +1 -1
- package/dist/contracts/steth.js +11 -15
- package/dist/contracts/steth.js.map +1 -1
- package/dist/contracts/token-manager.js +11 -15
- package/dist/contracts/token-manager.js.map +1 -1
- package/dist/contracts/vault-factory.js +11 -15
- package/dist/contracts/vault-factory.js.map +1 -1
- package/dist/contracts/vault-hub.js +12 -16
- package/dist/contracts/vault-hub.js.map +1 -1
- package/dist/contracts/vault.js +9 -13
- package/dist/contracts/vault.js.map +1 -1
- package/dist/contracts/voting.js +11 -15
- package/dist/contracts/voting.js.map +1 -1
- package/dist/features/advanced-config.js +7 -12
- package/dist/features/advanced-config.js.map +1 -1
- package/dist/features/dashboard-delegation.js +3 -7
- package/dist/features/dashboard-delegation.js.map +1 -1
- package/dist/features/index.js +4 -20
- package/dist/features/index.js.map +1 -1
- package/dist/features/token-manager.js +5 -4
- package/dist/features/token-manager.js.map +1 -1
- package/dist/features/vault-factory.js +15 -22
- package/dist/features/vault-factory.js.map +1 -1
- package/dist/features/voting.js +49 -52
- package/dist/features/voting.js.map +1 -1
- package/dist/index.js +3 -5
- package/dist/index.js.map +1 -1
- package/dist/programs/config.js +12 -14
- package/dist/programs/config.js.map +1 -1
- package/dist/programs/dashboard.js +218 -220
- package/dist/programs/dashboard.js.map +1 -1
- package/dist/programs/delegation.js +319 -343
- package/dist/programs/delegation.js.map +1 -1
- package/dist/programs/index.js +6 -22
- package/dist/programs/index.js.map +1 -1
- package/dist/programs/vault-factory.js +41 -38
- package/dist/programs/vault-factory.js.map +1 -1
- package/dist/programs/vault-hub.js +130 -126
- package/dist/programs/vault-hub.js.map +1 -1
- package/dist/programs/vault.js +141 -136
- package/dist/programs/vault.js.map +1 -1
- package/dist/programs/voting.js +32 -30
- package/dist/programs/voting.js.map +1 -1
- package/dist/providers/index.js +1 -17
- package/dist/providers/index.js.map +1 -1
- package/dist/providers/wallet.js +18 -24
- package/dist/providers/wallet.js.map +1 -1
- package/dist/types/common.js +1 -2
- package/dist/types/config.js +1 -2
- package/dist/types/index.js +2 -18
- package/dist/types/index.js.map +1 -1
- package/dist/utils/call-contract.js +9 -14
- package/dist/utils/call-contract.js.map +1 -1
- package/dist/utils/data-validators.js +12 -15
- package/dist/utils/data-validators.js.map +1 -1
- package/dist/utils/error-handler.js +3 -7
- package/dist/utils/error-handler.js.map +1 -1
- package/dist/utils/get-value.js +5 -11
- package/dist/utils/get-value.js.map +1 -1
- package/dist/utils/index.js +6 -22
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/resolve-path.js +9 -12
- package/dist/utils/resolve-path.js.map +1 -1
- package/dist/utils/sleep.js +1 -5
- package/dist/utils/sleep.js.map +1 -1
- package/package.json +38 -3
|
@@ -1,362 +1,360 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
.
|
|
10
|
-
dashboard
|
|
11
|
-
.
|
|
12
|
-
.description("get dashboard base info")
|
|
13
|
-
.argument("<address>", "dashboard address")
|
|
1
|
+
import { program } from '../command/index.js';
|
|
2
|
+
import { getDashboardContract } from '../contracts/index.js';
|
|
3
|
+
import { callWriteMethod, callReadMethod } from '../utils/index.js';
|
|
4
|
+
import { getBaseInfo } from '../features/index.js';
|
|
5
|
+
const dashboard = program
|
|
6
|
+
.command('dashboard')
|
|
7
|
+
.description('dashboard contract');
|
|
8
|
+
dashboard
|
|
9
|
+
.command('info')
|
|
10
|
+
.description('get dashboard base info')
|
|
11
|
+
.argument('<address>', 'dashboard address')
|
|
14
12
|
.action(async (address) => {
|
|
15
|
-
const contract =
|
|
16
|
-
await
|
|
13
|
+
const contract = getDashboardContract(address);
|
|
14
|
+
await getBaseInfo(contract);
|
|
17
15
|
});
|
|
18
16
|
dashboard
|
|
19
|
-
.command(
|
|
20
|
-
.description(
|
|
21
|
-
.argument(
|
|
17
|
+
.command('committee')
|
|
18
|
+
.description('voting committee info')
|
|
19
|
+
.argument('<address>', 'dashboard address')
|
|
22
20
|
.action(async (address) => {
|
|
23
|
-
const contract =
|
|
24
|
-
await
|
|
21
|
+
const contract = getDashboardContract(address);
|
|
22
|
+
await callReadMethod(contract, 'votingCommittee');
|
|
25
23
|
});
|
|
26
24
|
dashboard
|
|
27
|
-
.command(
|
|
28
|
-
.description(
|
|
29
|
-
.argument(
|
|
25
|
+
.command('vault')
|
|
26
|
+
.description('vault info')
|
|
27
|
+
.argument('<address>', 'dashboard address')
|
|
30
28
|
.action(async (address) => {
|
|
31
|
-
const contract =
|
|
32
|
-
await
|
|
29
|
+
const contract = getDashboardContract(address);
|
|
30
|
+
await callReadMethod(contract, 'vaultSocket');
|
|
33
31
|
});
|
|
34
32
|
dashboard
|
|
35
|
-
.command(
|
|
36
|
-
.description(
|
|
37
|
-
.argument(
|
|
33
|
+
.command('s-limit')
|
|
34
|
+
.description('shares limit')
|
|
35
|
+
.argument('<address>', 'dashboard address')
|
|
38
36
|
.action(async (address) => {
|
|
39
|
-
const contract =
|
|
40
|
-
await
|
|
37
|
+
const contract = getDashboardContract(address);
|
|
38
|
+
await callReadMethod(contract, 'shareLimit');
|
|
41
39
|
});
|
|
42
40
|
dashboard
|
|
43
|
-
.command(
|
|
44
|
-
.description(
|
|
45
|
-
.argument(
|
|
41
|
+
.command('s-minted')
|
|
42
|
+
.description('shares minted')
|
|
43
|
+
.argument('<address>', 'dashboard address')
|
|
46
44
|
.action(async (address) => {
|
|
47
|
-
const contract =
|
|
48
|
-
await
|
|
45
|
+
const contract = getDashboardContract(address);
|
|
46
|
+
await callReadMethod(contract, 'sharesMinted');
|
|
49
47
|
});
|
|
50
48
|
dashboard
|
|
51
|
-
.command(
|
|
52
|
-
.description(
|
|
53
|
-
.argument(
|
|
49
|
+
.command('reserve-ratio')
|
|
50
|
+
.description('vault reserve ratio of the vault')
|
|
51
|
+
.argument('<address>', 'dashboard address')
|
|
54
52
|
.action(async (address) => {
|
|
55
|
-
const contract =
|
|
56
|
-
await
|
|
53
|
+
const contract = getDashboardContract(address);
|
|
54
|
+
await callReadMethod(contract, 'reserveRatioBP');
|
|
57
55
|
});
|
|
58
56
|
dashboard
|
|
59
|
-
.command(
|
|
60
|
-
.description(
|
|
61
|
-
.argument(
|
|
57
|
+
.command('t-reserve-ratio')
|
|
58
|
+
.description('threshold reserve ratio of the vault')
|
|
59
|
+
.argument('<address>', 'dashboard address')
|
|
62
60
|
.action(async (address) => {
|
|
63
|
-
const contract =
|
|
64
|
-
await
|
|
61
|
+
const contract = getDashboardContract(address);
|
|
62
|
+
await callReadMethod(contract, 'thresholdReserveRatioBP');
|
|
65
63
|
});
|
|
66
64
|
dashboard
|
|
67
|
-
.command(
|
|
68
|
-
.description(
|
|
69
|
-
.argument(
|
|
65
|
+
.command('t-fee')
|
|
66
|
+
.description('treasury fee basis points')
|
|
67
|
+
.argument('<address>', 'dashboard address')
|
|
70
68
|
.action(async (address) => {
|
|
71
|
-
const contract =
|
|
72
|
-
await
|
|
69
|
+
const contract = getDashboardContract(address);
|
|
70
|
+
await callReadMethod(contract, 'treasuryFee');
|
|
73
71
|
});
|
|
74
72
|
dashboard
|
|
75
|
-
.command(
|
|
76
|
-
.description(
|
|
77
|
-
.argument(
|
|
73
|
+
.command('valuation')
|
|
74
|
+
.description('valuation of the vault in ether')
|
|
75
|
+
.argument('<address>', 'dashboard address')
|
|
78
76
|
.action(async (address) => {
|
|
79
|
-
const contract =
|
|
80
|
-
await
|
|
77
|
+
const contract = getDashboardContract(address);
|
|
78
|
+
await callReadMethod(contract, 'valuation');
|
|
81
79
|
});
|
|
82
80
|
dashboard
|
|
83
|
-
.command(
|
|
84
|
-
.description(
|
|
85
|
-
.argument(
|
|
81
|
+
.command('t-shares')
|
|
82
|
+
.description('total of shares that can be minted on the vault')
|
|
83
|
+
.argument('<address>', 'dashboard address')
|
|
86
84
|
.action(async (address) => {
|
|
87
|
-
const contract =
|
|
88
|
-
await
|
|
85
|
+
const contract = getDashboardContract(address);
|
|
86
|
+
await callReadMethod(contract, 'totalMintableShares');
|
|
89
87
|
});
|
|
90
88
|
dashboard
|
|
91
|
-
.command(
|
|
92
|
-
.description(
|
|
93
|
-
.argument(
|
|
94
|
-
.argument(
|
|
89
|
+
.command('get-shares')
|
|
90
|
+
.description('maximum number of shares that can be minted with deposited ether')
|
|
91
|
+
.argument('<address>', 'dashboard address')
|
|
92
|
+
.argument('<ether>', 'amount of ether to be funded')
|
|
95
93
|
.action(async (address, ether) => {
|
|
96
|
-
const contract =
|
|
97
|
-
await
|
|
94
|
+
const contract = getDashboardContract(address);
|
|
95
|
+
await callReadMethod(contract, 'projectedNewMintableShares', [
|
|
98
96
|
BigInt(ether),
|
|
99
97
|
]);
|
|
100
98
|
});
|
|
101
99
|
dashboard
|
|
102
|
-
.command(
|
|
103
|
-
.description(
|
|
104
|
-
.argument(
|
|
100
|
+
.command('withdrawable-eth')
|
|
101
|
+
.description('amount of ether that can be withdrawn from the staking vault')
|
|
102
|
+
.argument('<address>', 'dashboard address')
|
|
105
103
|
.action(async (address) => {
|
|
106
|
-
const contract =
|
|
107
|
-
await
|
|
104
|
+
const contract = getDashboardContract(address);
|
|
105
|
+
await callReadMethod(contract, 'withdrawableEther');
|
|
108
106
|
});
|
|
109
107
|
// TODO: test without voting
|
|
110
108
|
dashboard
|
|
111
|
-
.command(
|
|
112
|
-
.description(
|
|
113
|
-
.argument(
|
|
114
|
-
.argument(
|
|
109
|
+
.command('ownership')
|
|
110
|
+
.description('transfers ownership of the staking vault to a new owner')
|
|
111
|
+
.argument('<address>', 'dashboard address')
|
|
112
|
+
.argument('<newOwner>', 'address of the new owner')
|
|
115
113
|
.action(async (address, newOwner) => {
|
|
116
|
-
const contract =
|
|
117
|
-
await
|
|
114
|
+
const contract = getDashboardContract(address);
|
|
115
|
+
await callWriteMethod(contract, 'transferStakingVaultOwnership', [
|
|
118
116
|
newOwner,
|
|
119
117
|
]);
|
|
120
118
|
});
|
|
121
119
|
dashboard
|
|
122
|
-
.command(
|
|
123
|
-
.description(
|
|
124
|
-
.argument(
|
|
120
|
+
.command('disconnect')
|
|
121
|
+
.description('disconnects the staking vault from the vault hub')
|
|
122
|
+
.argument('<address>', 'dashboard address')
|
|
125
123
|
.action(async (address) => {
|
|
126
|
-
const contract =
|
|
127
|
-
await
|
|
124
|
+
const contract = getDashboardContract(address);
|
|
125
|
+
await callWriteMethod(contract, 'voluntaryDisconnect', []);
|
|
128
126
|
});
|
|
129
127
|
dashboard
|
|
130
|
-
.command(
|
|
131
|
-
.description(
|
|
132
|
-
.argument(
|
|
133
|
-
.argument(
|
|
128
|
+
.command('fund')
|
|
129
|
+
.description('funds the staking vault with ether')
|
|
130
|
+
.argument('<address>', 'dashboard address')
|
|
131
|
+
.argument('<ether>', 'amount of ether to be funded')
|
|
134
132
|
.action(async (address, ether) => {
|
|
135
|
-
const contract =
|
|
136
|
-
await
|
|
133
|
+
const contract = getDashboardContract(address);
|
|
134
|
+
await callWriteMethod(contract, 'fund', [], BigInt(ether));
|
|
137
135
|
});
|
|
138
136
|
dashboard
|
|
139
|
-
.command(
|
|
140
|
-
.description(
|
|
141
|
-
.argument(
|
|
142
|
-
.argument(
|
|
137
|
+
.command('fund-weth')
|
|
138
|
+
.description('funds the staking vault with wrapped ether')
|
|
139
|
+
.argument('<address>', 'dashboard address')
|
|
140
|
+
.argument('<wethAmount>', 'amount of weth to be funded')
|
|
143
141
|
.action(async (address, wethAmount) => {
|
|
144
|
-
const contract =
|
|
145
|
-
await
|
|
142
|
+
const contract = getDashboardContract(address);
|
|
143
|
+
await callWriteMethod(contract, 'fundWeth', [BigInt(wethAmount)]);
|
|
146
144
|
});
|
|
147
145
|
dashboard
|
|
148
|
-
.command(
|
|
149
|
-
.description(
|
|
150
|
-
.argument(
|
|
151
|
-
.argument(
|
|
152
|
-
.argument(
|
|
146
|
+
.command('withdraw')
|
|
147
|
+
.description('withdraws ether from the staking vault to a recipient')
|
|
148
|
+
.argument('<address>', 'dashboard address')
|
|
149
|
+
.argument('<recipient>', 'address of the recipient')
|
|
150
|
+
.argument('<ether>', 'amount of ether to withdraw')
|
|
153
151
|
.action(async (address, recipient, ether) => {
|
|
154
|
-
const contract =
|
|
155
|
-
await
|
|
152
|
+
const contract = getDashboardContract(address);
|
|
153
|
+
await callWriteMethod(contract, 'withdraw', [recipient, BigInt(ether)]);
|
|
156
154
|
});
|
|
157
155
|
dashboard
|
|
158
|
-
.command(
|
|
159
|
-
.description(
|
|
160
|
-
.argument(
|
|
161
|
-
.argument(
|
|
162
|
-
.argument(
|
|
156
|
+
.command('withdraw-weth')
|
|
157
|
+
.description('withdraws stETH tokens from the staking vault to wrapped ether')
|
|
158
|
+
.argument('<address>', 'dashboard address')
|
|
159
|
+
.argument('<recipient>', 'address of the recipient')
|
|
160
|
+
.argument('<ether>', 'amount of ether to withdraw')
|
|
163
161
|
.action(async (address, recipient, ether) => {
|
|
164
|
-
const contract =
|
|
165
|
-
await
|
|
162
|
+
const contract = getDashboardContract(address);
|
|
163
|
+
await callWriteMethod(contract, 'withdrawWETH', [recipient, BigInt(ether)]);
|
|
166
164
|
});
|
|
167
165
|
dashboard
|
|
168
|
-
.command(
|
|
169
|
-
.description(
|
|
170
|
-
.argument(
|
|
171
|
-
.argument(
|
|
166
|
+
.command('exit')
|
|
167
|
+
.description('requests the exit of a validator from the staking vault')
|
|
168
|
+
.argument('<address>', 'dashboard address')
|
|
169
|
+
.argument('<validatorPubKey>', 'public key of the validator to exit')
|
|
172
170
|
.action(async (address, validatorPubKey) => {
|
|
173
|
-
const contract =
|
|
174
|
-
await
|
|
171
|
+
const contract = getDashboardContract(address);
|
|
172
|
+
await callWriteMethod(contract, 'requestValidatorExit', [validatorPubKey]);
|
|
175
173
|
});
|
|
176
174
|
dashboard
|
|
177
|
-
.command(
|
|
178
|
-
.description(
|
|
179
|
-
.argument(
|
|
180
|
-
.argument(
|
|
181
|
-
.argument(
|
|
175
|
+
.command('mint-shares')
|
|
176
|
+
.description('mints stETH tokens backed by the vault to a recipient')
|
|
177
|
+
.argument('<address>', 'dashboard address')
|
|
178
|
+
.argument('<recipient>', 'address of the recipient')
|
|
179
|
+
.argument('<amountOfShares>', 'amount of shares to mint')
|
|
182
180
|
.action(async (address, recipient, amountOfShares) => {
|
|
183
|
-
const contract =
|
|
184
|
-
await
|
|
181
|
+
const contract = getDashboardContract(address);
|
|
182
|
+
await callWriteMethod(contract, 'mintShares', [
|
|
185
183
|
recipient,
|
|
186
184
|
BigInt(amountOfShares),
|
|
187
185
|
]);
|
|
188
186
|
});
|
|
189
187
|
dashboard
|
|
190
|
-
.command(
|
|
191
|
-
.description(
|
|
192
|
-
.argument(
|
|
193
|
-
.argument(
|
|
194
|
-
.argument(
|
|
188
|
+
.command('mint-steth')
|
|
189
|
+
.description('mints stETH tokens backed by the vault to a recipient')
|
|
190
|
+
.argument('<address>', 'dashboard address')
|
|
191
|
+
.argument('<recipient>', 'address of the recipient')
|
|
192
|
+
.argument('<amountOfShares>', 'amount of shares to mint')
|
|
195
193
|
.action(async (address, recipient, amountOfShares) => {
|
|
196
|
-
const contract =
|
|
197
|
-
await
|
|
194
|
+
const contract = getDashboardContract(address);
|
|
195
|
+
await callWriteMethod(contract, 'mintStETH', [
|
|
198
196
|
recipient,
|
|
199
197
|
BigInt(amountOfShares),
|
|
200
198
|
]);
|
|
201
199
|
});
|
|
202
200
|
dashboard
|
|
203
|
-
.command(
|
|
204
|
-
.description(
|
|
205
|
-
.argument(
|
|
206
|
-
.argument(
|
|
207
|
-
.argument(
|
|
201
|
+
.command('mint-wsteth')
|
|
202
|
+
.description('mints wstETH tokens backed by the vault to a recipient')
|
|
203
|
+
.argument('<address>', 'dashboard address')
|
|
204
|
+
.argument('<recipient>', 'address of the recipient')
|
|
205
|
+
.argument('<tokens>', 'amount of tokens to mint')
|
|
208
206
|
.action(async (address, recipient, tokens) => {
|
|
209
|
-
const contract =
|
|
210
|
-
await
|
|
207
|
+
const contract = getDashboardContract(address);
|
|
208
|
+
await callWriteMethod(contract, 'mintWstETH', [recipient, BigInt(tokens)]);
|
|
211
209
|
});
|
|
212
210
|
dashboard
|
|
213
|
-
.command(
|
|
214
|
-
.description(
|
|
215
|
-
.argument(
|
|
216
|
-
.argument(
|
|
211
|
+
.command('burn-shares')
|
|
212
|
+
.description('Burns stETH shares from the sender backed by the vault. Expects corresponding amount of stETH approved to this contract')
|
|
213
|
+
.argument('<address>', 'dashboard address')
|
|
214
|
+
.argument('<amountOfShares>', 'amount of shares to burn')
|
|
217
215
|
.action(async (address, amountOfShares) => {
|
|
218
|
-
const contract =
|
|
219
|
-
await
|
|
216
|
+
const contract = getDashboardContract(address);
|
|
217
|
+
await callWriteMethod(contract, 'burnShares', [BigInt(amountOfShares)]);
|
|
220
218
|
});
|
|
221
219
|
dashboard
|
|
222
|
-
.command(
|
|
223
|
-
.description(
|
|
224
|
-
.argument(
|
|
225
|
-
.argument(
|
|
220
|
+
.command('burn-steth')
|
|
221
|
+
.description('Burns stETH shares from the sender backed by the vault. Expects stETH amount approved to this contract.')
|
|
222
|
+
.argument('<address>', 'dashboard address')
|
|
223
|
+
.argument('<amountOfShares>', 'amount of shares to burn')
|
|
226
224
|
.action(async (address, amountOfShares) => {
|
|
227
|
-
const contract =
|
|
228
|
-
await
|
|
225
|
+
const contract = getDashboardContract(address);
|
|
226
|
+
await callWriteMethod(contract, 'burnStETH', [BigInt(amountOfShares)]);
|
|
229
227
|
});
|
|
230
228
|
dashboard
|
|
231
|
-
.command(
|
|
232
|
-
.description(
|
|
233
|
-
.argument(
|
|
234
|
-
.argument(
|
|
229
|
+
.command('burn-wsteth')
|
|
230
|
+
.description('burn wstETH tokens from the sender backed by the vault')
|
|
231
|
+
.argument('<address>', 'dashboard address')
|
|
232
|
+
.argument('<tokens>', 'amount of wstETH tokens to burn')
|
|
235
233
|
.action(async (address, tokens) => {
|
|
236
|
-
const contract =
|
|
237
|
-
await
|
|
234
|
+
const contract = getDashboardContract(address);
|
|
235
|
+
await callWriteMethod(contract, 'burnWstETH', [BigInt(tokens)]);
|
|
238
236
|
});
|
|
239
237
|
dashboard
|
|
240
|
-
.command(
|
|
241
|
-
.description(
|
|
242
|
-
.argument(
|
|
243
|
-
.argument(
|
|
244
|
-
.argument(
|
|
238
|
+
.command('burn-shares-permit')
|
|
239
|
+
.description('Burns stETH tokens (in shares) backed by the vault from the sender using permit (with value in stETH).')
|
|
240
|
+
.argument('<address>', 'dashboard address')
|
|
241
|
+
.argument('<tokens>', 'amount of stETH tokens to burn')
|
|
242
|
+
.argument('<permitJSON>', 'JSON data required for the stETH.permit() method to set the allowance')
|
|
245
243
|
.action(async (address, tokens, permitJSON) => {
|
|
246
244
|
const permit = JSON.parse(permitJSON);
|
|
247
|
-
const contract =
|
|
248
|
-
await
|
|
245
|
+
const contract = getDashboardContract(address);
|
|
246
|
+
await callWriteMethod(contract, 'burnSharesWithPermit', [
|
|
249
247
|
BigInt(tokens),
|
|
250
248
|
permit,
|
|
251
249
|
]);
|
|
252
250
|
});
|
|
253
251
|
dashboard
|
|
254
|
-
.command(
|
|
255
|
-
.description(
|
|
256
|
-
.argument(
|
|
257
|
-
.argument(
|
|
258
|
-
.argument(
|
|
252
|
+
.command('burn-steth-permit')
|
|
253
|
+
.description('Burns stETH tokens backed by the vault from the sender using permit.')
|
|
254
|
+
.argument('<address>', 'dashboard address')
|
|
255
|
+
.argument('<tokens>', 'amount of stETH tokens to burn')
|
|
256
|
+
.argument('<permitJSON>', 'JSON data required for the stETH.permit() method to set the allowance')
|
|
259
257
|
.action(async (address, tokens, permitJSON) => {
|
|
260
258
|
const permit = JSON.parse(permitJSON);
|
|
261
|
-
const contract =
|
|
262
|
-
await
|
|
259
|
+
const contract = getDashboardContract(address);
|
|
260
|
+
await callWriteMethod(contract, 'burnStETHWithPermit', [
|
|
263
261
|
BigInt(tokens),
|
|
264
262
|
permit,
|
|
265
263
|
]);
|
|
266
264
|
});
|
|
267
265
|
dashboard
|
|
268
|
-
.command(
|
|
269
|
-
.description(
|
|
270
|
-
.argument(
|
|
271
|
-
.argument(
|
|
272
|
-
.argument(
|
|
266
|
+
.command('burn-wsteth-permit')
|
|
267
|
+
.description('burn wstETH tokens from the sender backed by the vault using EIP-2612 Permit')
|
|
268
|
+
.argument('<address>', 'dashboard address')
|
|
269
|
+
.argument('<tokens>', 'amount of wstETH tokens to burn')
|
|
270
|
+
.argument('<permitJSON>', 'JSON data required for the wstETH.permit() method to set the allowance')
|
|
273
271
|
.action(async (address, tokens, permitJSON) => {
|
|
274
272
|
const permit = JSON.parse(permitJSON);
|
|
275
|
-
const contract =
|
|
276
|
-
await
|
|
273
|
+
const contract = getDashboardContract(address);
|
|
274
|
+
await callWriteMethod(contract, 'burnWstETHWithPermit', [
|
|
277
275
|
BigInt(tokens),
|
|
278
276
|
permit,
|
|
279
277
|
]);
|
|
280
278
|
});
|
|
281
279
|
dashboard
|
|
282
|
-
.command(
|
|
283
|
-
.description(
|
|
284
|
-
.argument(
|
|
285
|
-
.argument(
|
|
280
|
+
.command('rebalance')
|
|
281
|
+
.description('rebalance the vault by transferring ether')
|
|
282
|
+
.argument('<address>', 'dashboard address')
|
|
283
|
+
.argument('<ether>', 'amount of ether to rebalance')
|
|
286
284
|
.action(async (address, ether) => {
|
|
287
|
-
const contract =
|
|
288
|
-
await
|
|
285
|
+
const contract = getDashboardContract(address);
|
|
286
|
+
await callWriteMethod(contract, 'rebalanceVault', [BigInt(ether)]);
|
|
289
287
|
});
|
|
290
288
|
dashboard
|
|
291
|
-
.command(
|
|
292
|
-
.description(
|
|
293
|
-
.argument(
|
|
294
|
-
.argument(
|
|
295
|
-
.argument(
|
|
296
|
-
.argument(
|
|
289
|
+
.command('recover-erc20')
|
|
290
|
+
.description('recovers ERC20 tokens or ether from the dashboard contract to sender')
|
|
291
|
+
.argument('<address>', 'dashboard address')
|
|
292
|
+
.argument('<token>', 'Address of the token to recover or 0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee for ether')
|
|
293
|
+
.argument('<recipient>', 'Address of the recovery recipient')
|
|
294
|
+
.argument('<amount>', 'amount of ether to recover')
|
|
297
295
|
.action(async (address, token, recipient, amount) => {
|
|
298
|
-
const contract =
|
|
299
|
-
await
|
|
296
|
+
const contract = getDashboardContract(address);
|
|
297
|
+
await callWriteMethod(contract, 'recoverERC20', [
|
|
300
298
|
token,
|
|
301
299
|
recipient,
|
|
302
300
|
BigInt(amount),
|
|
303
301
|
]);
|
|
304
302
|
});
|
|
305
303
|
dashboard
|
|
306
|
-
.command(
|
|
307
|
-
.description(
|
|
308
|
-
.argument(
|
|
309
|
-
.argument(
|
|
310
|
-
.argument(
|
|
311
|
-
.argument(
|
|
304
|
+
.command('recover-erc721')
|
|
305
|
+
.description('Transfers a given token_id of an ERC721-compatible NFT (defined by the token contract address)')
|
|
306
|
+
.argument('<address>', 'dashboard address')
|
|
307
|
+
.argument('<token>', 'an ERC721-compatible token')
|
|
308
|
+
.argument('<tokenId>', 'token id to recover')
|
|
309
|
+
.argument('<recipient>', 'Address of the recovery recipient')
|
|
312
310
|
.action(async (address, token, tokenId, recipient) => {
|
|
313
|
-
const contract =
|
|
314
|
-
await
|
|
311
|
+
const contract = getDashboardContract(address);
|
|
312
|
+
await callWriteMethod(contract, 'recoverERC721', [
|
|
315
313
|
token,
|
|
316
314
|
BigInt(tokenId),
|
|
317
315
|
recipient,
|
|
318
316
|
]);
|
|
319
317
|
});
|
|
320
318
|
dashboard
|
|
321
|
-
.command(
|
|
322
|
-
.description(
|
|
323
|
-
.argument(
|
|
319
|
+
.command('deposit-pause')
|
|
320
|
+
.description('Pauses beacon chain deposits on the staking vault.')
|
|
321
|
+
.argument('<address>', 'dashboard address')
|
|
324
322
|
.action(async (address) => {
|
|
325
|
-
const contract =
|
|
326
|
-
await
|
|
323
|
+
const contract = getDashboardContract(address);
|
|
324
|
+
await callWriteMethod(contract, 'pauseBeaconChainDeposits', []);
|
|
327
325
|
});
|
|
328
326
|
dashboard
|
|
329
|
-
.command(
|
|
330
|
-
.description(
|
|
331
|
-
.argument(
|
|
327
|
+
.command('deposit-resume')
|
|
328
|
+
.description('Mass-grants multiple roles to multiple accounts.')
|
|
329
|
+
.argument('<address>', 'dashboard address')
|
|
332
330
|
.action(async (address) => {
|
|
333
|
-
const contract =
|
|
334
|
-
await
|
|
331
|
+
const contract = getDashboardContract(address);
|
|
332
|
+
await callWriteMethod(contract, 'resumeBeaconChainDeposits', []);
|
|
335
333
|
});
|
|
336
334
|
dashboard
|
|
337
|
-
.command(
|
|
338
|
-
.description(
|
|
339
|
-
.argument(
|
|
340
|
-
.argument(
|
|
335
|
+
.command('role-grant')
|
|
336
|
+
.description('Mass-revokes multiple roles from multiple accounts.')
|
|
337
|
+
.argument('<address>', 'dashboard address')
|
|
338
|
+
.argument('<roleAssignmentJSON>', 'JSON array of role assignments')
|
|
341
339
|
.action(async (address, roleAssignmentJSON) => {
|
|
342
|
-
const contract =
|
|
340
|
+
const contract = getDashboardContract(address);
|
|
343
341
|
const payload = JSON.parse(roleAssignmentJSON);
|
|
344
342
|
if (!Array.isArray(payload)) {
|
|
345
|
-
throw new Error(
|
|
343
|
+
throw new Error('the 2nd argument should be an array of role assignments');
|
|
346
344
|
}
|
|
347
|
-
await
|
|
345
|
+
await callWriteMethod(contract, 'grantRoles', [payload]);
|
|
348
346
|
});
|
|
349
347
|
dashboard
|
|
350
|
-
.command(
|
|
351
|
-
.description(
|
|
352
|
-
.argument(
|
|
353
|
-
.argument(
|
|
348
|
+
.command('role-revoke')
|
|
349
|
+
.description('Resumes beacon chain deposits on the staking vault.')
|
|
350
|
+
.argument('<address>', 'dashboard address')
|
|
351
|
+
.argument('<roleAssignmentJSON>', 'JSON array of role assignments')
|
|
354
352
|
.action(async (address, roleAssignmentJSON) => {
|
|
355
|
-
const contract =
|
|
353
|
+
const contract = getDashboardContract(address);
|
|
356
354
|
const payload = JSON.parse(roleAssignmentJSON);
|
|
357
355
|
if (!Array.isArray(payload)) {
|
|
358
|
-
throw new Error(
|
|
356
|
+
throw new Error('the 2nd argument should be an array of role assignments');
|
|
359
357
|
}
|
|
360
|
-
await
|
|
358
|
+
await callWriteMethod(contract, 'revokeRoles', [payload]);
|
|
361
359
|
});
|
|
362
360
|
//# sourceMappingURL=dashboard.js.map
|