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