@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,18 +1,16 @@
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 delegation = _command_1.program
8
- .command("delegation")
9
- .description("delegation contract");
10
- delegation
11
- .command("roles")
12
- .description("get delegation contract roles info")
13
- .argument("<address>", "delegation contract address")
1
+ import { program } from '../command/index.js';
2
+ import { getDelegationContract, getStakingVaultContract } from '../contracts/index.js';
3
+ import { callWriteMethod, callReadMethod } from '../utils/index.js';
4
+ import { getBaseInfo } from '../features/index.js';
5
+ const delegation = program
6
+ .command('delegation')
7
+ .description('delegation contract');
8
+ delegation
9
+ .command('roles')
10
+ .description('get delegation contract roles info')
11
+ .argument('<address>', 'delegation contract address')
14
12
  .action(async (address) => {
15
- const contract = (0, _contracts_1.getDelegationContract)(address);
13
+ const contract = getDelegationContract(address);
16
14
  try {
17
15
  const CURATOR_ROLE = await contract.read.CURATOR_ROLE();
18
16
  const NODE_OPERATOR_MANAGER_ROLE = await contract.read.NODE_OPERATOR_MANAGER_ROLE();
@@ -44,86 +42,86 @@ delegation
44
42
  }
45
43
  catch (err) {
46
44
  if (err instanceof Error) {
47
- console.log("Error when getting roles:\n", err.message);
45
+ console.info('Error when getting roles:\n', err.message);
48
46
  }
49
47
  }
50
48
  });
51
49
  delegation
52
- .command("base-info")
53
- .description("get delegation base info")
54
- .argument("<address>", "delegation address")
50
+ .command('base-info')
51
+ .description('get delegation base info')
52
+ .argument('<address>', 'delegation address')
55
53
  .action(async (address) => {
56
- const contract = (0, _contracts_1.getDelegationContract)(address);
57
- await (0, _features_1.getBaseInfo)(contract);
54
+ const contract = getDelegationContract(address);
55
+ await getBaseInfo(contract);
58
56
  });
59
57
  delegation
60
- .command("voting-lifetime")
58
+ .command('voting-lifetime')
61
59
  .description("get committee's voting lifetime period")
62
- .argument("<address>", "delegation contract address")
60
+ .argument('<address>', 'delegation contract address')
63
61
  .action(async (address) => {
64
- const contract = (0, _contracts_1.getDelegationContract)(address);
65
- await (0, _utils_1.callReadMethod)(contract, "voteLifetime");
62
+ const contract = getDelegationContract(address);
63
+ await callReadMethod(contract, 'voteLifetime');
66
64
  });
67
65
  delegation
68
- .command("is-healthy")
69
- .description("get vault healthy info")
70
- .argument("<address>", "vault address")
66
+ .command('is-healthy')
67
+ .description('get vault healthy info')
68
+ .argument('<address>', 'vault address')
71
69
  .action(async (address) => {
72
- const contract = (0, _contracts_1.getDelegationContract)(address);
70
+ const contract = getDelegationContract(address);
73
71
  try {
74
72
  const valuation = await contract.read.valuation();
75
73
  const curatorUnclaimedFee = await contract.read.curatorUnclaimedFee();
76
74
  const nodeOperatorUnclaimedFee = await contract.read.nodeOperatorUnclaimedFee();
77
75
  const minted = await contract.read.sharesMinted();
78
76
  const { vault } = await contract.read.vaultSocket();
79
- const vaultContract = (0, _contracts_1.getStakingVaultContract)(vault);
77
+ const vaultContract = getStakingVaultContract(vault);
80
78
  const locked = await vaultContract.read.locked();
81
79
  const reserved = locked + curatorUnclaimedFee + nodeOperatorUnclaimedFee;
82
80
  const valuationPerc = (valuation / (reserved + minted)) * 100n;
83
81
  const isHealthy = valuationPerc >= 100n;
84
82
  console.table({
85
- "Vault Healthy": isHealthy,
83
+ 'Vault Healthy': isHealthy,
86
84
  Valuation: valuation,
87
- "Curator Unclaimed Fee": curatorUnclaimedFee,
88
- "Node Operator Unclaimed Fee": nodeOperatorUnclaimedFee,
85
+ 'Curator Unclaimed Fee': curatorUnclaimedFee,
86
+ 'Node Operator Unclaimed Fee': nodeOperatorUnclaimedFee,
89
87
  Minted: minted,
90
88
  Reserved: reserved,
91
89
  });
92
90
  }
93
91
  catch (err) {
94
92
  if (err instanceof Error) {
95
- console.log("Error when getting info:\n", err.message);
93
+ console.info('Error when getting info:\n', err.message);
96
94
  }
97
95
  }
98
96
  });
99
97
  delegation
100
- .command("voting-info")
101
- .description("get committee votes")
102
- .argument("<address>", "delegation contract address")
103
- .argument("<callId>", "voting id")
104
- .argument("<role>", "role that voted")
98
+ .command('voting-info')
99
+ .description('get committee votes')
100
+ .argument('<address>', 'delegation contract address')
101
+ .argument('<callId>', 'voting id')
102
+ .argument('<role>', 'role that voted')
105
103
  .action(async (address, callId, role) => {
106
- const contract = (0, _contracts_1.getDelegationContract)(address);
107
- await (0, _utils_1.callReadMethod)(contract, "votings", [callId, role]);
104
+ const contract = getDelegationContract(address);
105
+ await callReadMethod(contract, 'votings', [callId, role]);
108
106
  });
109
107
  delegation
110
- .command("cf")
111
- .description("Curator fee in basis points")
112
- .argument("<address>", "delegation contract address")
108
+ .command('cf')
109
+ .description('Curator fee in basis points')
110
+ .argument('<address>', 'delegation contract address')
113
111
  .action(async (address) => {
114
- const contract = (0, _contracts_1.getDelegationContract)(address);
115
- await (0, _utils_1.callReadMethod)(contract, "curatorFeeBP");
112
+ const contract = getDelegationContract(address);
113
+ await callReadMethod(contract, 'curatorFeeBP');
116
114
  });
117
115
  delegation
118
- .command("cf-report")
119
- .description("The last report for which curator fee was claimed. Updated on each claim.")
120
- .argument("<address>", "delegation contract address")
116
+ .command('cf-report')
117
+ .description('The last report for which curator fee was claimed. Updated on each claim.')
118
+ .argument('<address>', 'delegation contract address')
121
119
  .action(async (address) => {
122
- const contract = (0, _contracts_1.getDelegationContract)(address);
123
- await (0, _utils_1.callReadMethod)(contract, "curatorFeeClaimedReport");
120
+ const contract = getDelegationContract(address);
121
+ await callReadMethod(contract, 'curatorFeeClaimedReport');
124
122
  });
125
123
  delegation
126
- .command("cf-unclaimed")
124
+ .command('cf-unclaimed')
127
125
  .description(`Returns the accumulated unclaimed curator fee in ether,
128
126
  calculated as: U = (R * F) / T
129
127
  where:
@@ -131,55 +129,55 @@ delegation
131
129
  - R is the StakingVault rewards accrued since the last curator fee claim;
132
130
  - F is curatorFeeBP
133
131
  - T is the total basis points, 10,000.`)
134
- .argument("<address>", "delegation contract address")
132
+ .argument('<address>', 'delegation contract address')
135
133
  .action(async (address) => {
136
- const contract = (0, _contracts_1.getDelegationContract)(address);
137
- await (0, _utils_1.callReadMethod)(contract, "curatorUnclaimedFee");
134
+ const contract = getDelegationContract(address);
135
+ await callReadMethod(contract, 'curatorUnclaimedFee');
138
136
  });
139
137
  delegation
140
- .command("cf-set")
141
- .description("sets the curator fee")
142
- .argument("<address>", "delegation contract address")
143
- .argument("<newCuratorFee>", "curator fee in basis points")
138
+ .command('cf-set')
139
+ .description('sets the curator fee')
140
+ .argument('<address>', 'delegation contract address')
141
+ .argument('<newCuratorFee>', 'curator fee in basis points')
144
142
  .action(async (address, newCuratorFee) => {
145
- const contract = (0, _contracts_1.getDelegationContract)(address);
146
- (0, _utils_1.callWriteMethod)(contract, "setCuratorFeeBP", [BigInt(newCuratorFee)]);
143
+ const contract = getDelegationContract(address);
144
+ await callWriteMethod(contract, 'setCuratorFeeBP', [BigInt(newCuratorFee)]);
147
145
  });
148
146
  delegation
149
- .command("cf-claim")
150
- .description("claims the curator fee")
151
- .argument("<address>", "delegation contract address")
152
- .argument("<recipient>", "address to which the curator fee will be sent")
147
+ .command('cf-claim')
148
+ .description('claims the curator fee')
149
+ .argument('<address>', 'delegation contract address')
150
+ .argument('<recipient>', 'address to which the curator fee will be sent')
153
151
  .action(async (address, recipient) => {
154
- const contract = (0, _contracts_1.getDelegationContract)(address);
155
- (0, _utils_1.callWriteMethod)(contract, "claimCuratorFee", [recipient]);
152
+ const contract = getDelegationContract(address);
153
+ await callWriteMethod(contract, 'claimCuratorFee', [recipient]);
156
154
  });
157
155
  delegation
158
- .command("nof")
159
- .description("Node operator fee in basis points")
160
- .argument("<address>", "delegation contract address")
156
+ .command('nof')
157
+ .description('Node operator fee in basis points')
158
+ .argument('<address>', 'delegation contract address')
161
159
  .action(async (address) => {
162
- const contract = (0, _contracts_1.getDelegationContract)(address);
160
+ const contract = getDelegationContract(address);
163
161
  try {
164
162
  const nodeOperatorFeeBP = await contract.read.nodeOperatorFeeBP();
165
- console.table({ "Node Operator Fee BP:": nodeOperatorFeeBP });
163
+ console.table({ 'Node Operator Fee BP:': nodeOperatorFeeBP });
166
164
  }
167
165
  catch (err) {
168
166
  if (err instanceof Error) {
169
- console.log("Error when getting Node Operator Fee BP:\n", err.message);
167
+ console.info('Error when getting Node Operator Fee BP:\n', err.message);
170
168
  }
171
169
  }
172
170
  });
173
171
  delegation
174
- .command("nof-report")
175
- .description("The last report for which node operator fee was claimed. Updated on each claim.")
176
- .argument("<address>", "delegation contract address")
172
+ .command('nof-report')
173
+ .description('The last report for which node operator fee was claimed. Updated on each claim.')
174
+ .argument('<address>', 'delegation contract address')
177
175
  .action(async (address) => {
178
- const contract = (0, _contracts_1.getDelegationContract)(address);
179
- await (0, _utils_1.callReadMethod)(contract, "nodeOperatorUnclaimedFee");
176
+ const contract = getDelegationContract(address);
177
+ await callReadMethod(contract, 'nodeOperatorFeeClaimedReport');
180
178
  });
181
179
  delegation
182
- .command("nof-unclaimed")
180
+ .command('nof-unclaimed')
183
181
  .description(`Returns the accumulated unclaimed node operator fee in ether,
184
182
  calculated as: U = (R * F) / T
185
183
  where:
@@ -187,46 +185,46 @@ delegation
187
185
  - R is the StakingVault rewards accrued since the last node operator fee claim;
188
186
  - F is nodeOperatorFeeBP
189
187
  - T is the total basis points, 10,000.`)
190
- .argument("<address>", "delegation contract address")
188
+ .argument('<address>', 'delegation contract address')
191
189
  .action(async (address) => {
192
- const contract = (0, _contracts_1.getDelegationContract)(address);
193
- await (0, _utils_1.callReadMethod)(contract, "nodeOperatorUnclaimedFee");
190
+ const contract = getDelegationContract(address);
191
+ await callReadMethod(contract, 'nodeOperatorUnclaimedFee');
194
192
  });
195
193
  delegation
196
- .command("nof-set")
197
- .description("sets the node operator fee")
198
- .argument("<address>", "delegation contract address")
199
- .argument("<newNodeOperatorFeeBP>", "The new node operator fee in basis points")
194
+ .command('nof-set')
195
+ .description('sets the node operator fee')
196
+ .argument('<address>', 'delegation contract address')
197
+ .argument('<newNodeOperatorFeeBP>', 'The new node operator fee in basis points')
200
198
  .action(async (address, newNodeOperatorFeeBP) => {
201
- const contract = (0, _contracts_1.getDelegationContract)(address);
202
- (0, _utils_1.callWriteMethod)(contract, "setNodeOperatorFeeBP", [
199
+ const contract = getDelegationContract(address);
200
+ await callWriteMethod(contract, 'setNodeOperatorFeeBP', [
203
201
  BigInt(newNodeOperatorFeeBP),
204
202
  ]);
205
203
  });
206
204
  delegation
207
- .command("nof-claim")
208
- .description("claims the node operator fee")
209
- .argument("<address>", "delegation contract address")
210
- .argument("<recipient>", "address to which the node operator fee will be sent")
205
+ .command('nof-claim')
206
+ .description('claims the node operator fee')
207
+ .argument('<address>', 'delegation contract address')
208
+ .argument('<recipient>', 'address to which the node operator fee will be sent')
211
209
  .action(async (address, recipient) => {
212
- const contract = (0, _contracts_1.getDelegationContract)(address);
213
- (0, _utils_1.callWriteMethod)(contract, "claimNodeOperatorFee", [recipient]);
210
+ const contract = getDelegationContract(address);
211
+ await callWriteMethod(contract, 'claimNodeOperatorFee', [recipient]);
214
212
  });
215
213
  delegation
216
- .command("unreserved")
217
- .description("returns the unreserved amount of ether")
218
- .argument("<address>", "delegation contract address")
214
+ .command('unreserved')
215
+ .description('returns the unreserved amount of ether')
216
+ .argument('<address>', 'delegation contract address')
219
217
  .action(async (address) => {
220
- const contract = (0, _contracts_1.getDelegationContract)(address);
221
- await (0, _utils_1.callReadMethod)(contract, "unreserved");
218
+ const contract = getDelegationContract(address);
219
+ await callReadMethod(contract, 'unreserved');
222
220
  });
223
221
  delegation
224
- .command("vc")
225
- .description("returns the voting committee")
226
- .argument("<address>", "delegation contract address")
222
+ .command('vc')
223
+ .description('returns the voting committee')
224
+ .argument('<address>', 'delegation contract address')
227
225
  .action(async (address) => {
228
- const contract = (0, _contracts_1.getDelegationContract)(address);
229
- const committeeList = await (0, _utils_1.callReadMethod)(contract, "votingCommittee");
226
+ const contract = getDelegationContract(address);
227
+ const committeeList = await callReadMethod(contract, 'votingCommittee');
230
228
  const committee = {
231
229
  CURATOR_ROLE: committeeList[0],
232
230
  NODE_OPERATOR_MANAGER_ROLE: committeeList[1],
@@ -234,372 +232,350 @@ delegation
234
232
  console.table({ committee });
235
233
  });
236
234
  delegation
237
- .command("fund")
238
- .description("funds the StakingVault with ether")
239
- .argument("<address>", "delegation contract address")
240
- .argument("<ether>", "ether to fund")
235
+ .command('fund')
236
+ .description('funds the StakingVault with ether')
237
+ .argument('<address>', 'delegation contract address')
238
+ .argument('<ether>', 'ether to fund')
241
239
  .action(async (address, ether) => {
242
- const contract = (0, _contracts_1.getDelegationContract)(address);
243
- await (0, _utils_1.callWriteMethod)(contract, "fund", [], BigInt(ether));
240
+ const contract = getDelegationContract(address);
241
+ await callWriteMethod(contract, 'fund', [], BigInt(ether));
244
242
  });
245
243
  delegation
246
- .command("withdraw")
247
- .description("withdraws ether from the StakingVault")
248
- .argument("<address>", "delegation contract address")
249
- .argument("<recipient>", "address to which the ether will be sent")
250
- .argument("<ether>", "ether to found")
244
+ .command('withdraw')
245
+ .description('withdraws ether from the StakingVault')
246
+ .argument('<address>', 'delegation contract address')
247
+ .argument('<recipient>', 'address to which the ether will be sent')
248
+ .argument('<ether>', 'ether to found')
251
249
  .action(async (address, recipient, ether) => {
252
- const contract = (0, _contracts_1.getDelegationContract)(address);
253
- await (0, _utils_1.callWriteMethod)(contract, "withdraw", [recipient, BigInt(ether)]);
250
+ const contract = getDelegationContract(address);
251
+ await callWriteMethod(contract, 'withdraw', [recipient, BigInt(ether)]);
254
252
  });
255
253
  delegation
256
- .command("mint")
257
- .description("mints shares for a given recipient")
258
- .argument("<address>", "delegation contract address")
259
- .argument("<recipient>", "address to which the ether will be sent")
260
- .argument("<amountOfShares>", "amount of shares to mint")
261
- .action(async (address, recipient, amountOfShares) => {
262
- const contract = (0, _contracts_1.getDelegationContract)(address);
263
- (0, _utils_1.callWriteMethod)(contract, "mintShares", [
264
- recipient,
265
- BigInt(amountOfShares),
266
- ]);
267
- });
268
- delegation
269
- .command("burn")
270
- .description("burns shares for a given recipient")
271
- .argument("<address>", "delegation contract address")
272
- .argument("<amountOfShares>", "amount of shares to mint")
273
- .action(async (address, amountOfShares) => {
274
- const contract = (0, _contracts_1.getDelegationContract)(address);
275
- (0, _utils_1.callWriteMethod)(contract, "burnShares", [BigInt(amountOfShares)]);
276
- });
277
- delegation
278
- .command("rebalance")
279
- .description("rebalances the StakingVault with a given amount of ether")
280
- .argument("<address>", "delegation contract address")
281
- .argument("<ether>", "amount of ether to rebalance with")
254
+ .command('rebalance')
255
+ .description('rebalances the StakingVault with a given amount of ether')
256
+ .argument('<address>', 'delegation contract address')
257
+ .argument('<ether>', 'amount of ether to rebalance with')
282
258
  .action(async (address, ether) => {
283
- const contract = (0, _contracts_1.getDelegationContract)(address);
284
- await (0, _utils_1.callWriteMethod)(contract, "rebalanceVault", [BigInt(ether)]);
259
+ const contract = getDelegationContract(address);
260
+ await callWriteMethod(contract, 'rebalanceVault', [BigInt(ether)]);
285
261
  });
286
262
  delegation
287
- .command("set-vote-lt")
288
- .description("sets the vote lifetime")
289
- .argument("<address>", "delegation contract address")
290
- .argument("<newVoteLifetime>", "new vote lifetime in seconds")
263
+ .command('set-vote-lt')
264
+ .description('sets the vote lifetime')
265
+ .argument('<address>', 'delegation contract address')
266
+ .argument('<newVoteLifetime>', 'new vote lifetime in seconds')
291
267
  .action(async (address, newVoteLifetime) => {
292
- const contract = (0, _contracts_1.getDelegationContract)(address);
293
- (0, _utils_1.callWriteMethod)(contract, "setVoteLifetime", [BigInt(newVoteLifetime)]);
268
+ const contract = getDelegationContract(address);
269
+ await callWriteMethod(contract, 'setVoteLifetime', [
270
+ BigInt(newVoteLifetime),
271
+ ]);
294
272
  });
273
+ // TODO: test without voting
295
274
  delegation
296
- .command("t-ownership")
297
- .description("transfers the ownership of the StakingVault")
298
- .argument("<address>", "delegation contract address")
299
- .argument("<newOwner>", "address to which the ownership will be transferred")
275
+ .command('t-ownership')
276
+ .description('transfers the ownership of the StakingVault')
277
+ .argument('<address>', 'delegation contract address')
278
+ .argument('<newOwner>', 'address to which the ownership will be transferred')
300
279
  .action(async (address, newOwner) => {
301
- const contract = (0, _contracts_1.getDelegationContract)(address);
302
- await (0, _utils_1.callWriteMethod)(contract, "transferStakingVaultOwnership", [
280
+ const contract = getDelegationContract(address);
281
+ await callWriteMethod(contract, 'transferStakingVaultOwnership', [
303
282
  newOwner,
304
283
  ]);
305
284
  });
306
285
  delegation
307
- .command("disconnect")
308
- .description("voluntarily disconnects a StakingVault from VaultHub")
309
- .argument("<address>", "delegation contract address")
286
+ .command('disconnect')
287
+ .description('voluntarily disconnects a StakingVault from VaultHub')
288
+ .argument('<address>', 'delegation contract address')
310
289
  .action(async (address) => {
311
- const contract = (0, _contracts_1.getDelegationContract)(address);
312
- (0, _utils_1.callWriteMethod)(contract, "voluntaryDisconnect", []);
290
+ const contract = getDelegationContract(address);
291
+ await callWriteMethod(contract, 'voluntaryDisconnect', []);
313
292
  });
314
293
  delegation
315
- .command("deposit-pause")
316
- .description("Pauses deposits to beacon chain from the StakingVault.")
317
- .argument("<address>", "delegation contract address")
294
+ .command('deposit-pause')
295
+ .description('Pauses deposits to beacon chain from the StakingVault.')
296
+ .argument('<address>', 'delegation contract address')
318
297
  .action(async (address) => {
319
- const contract = (0, _contracts_1.getDelegationContract)(address);
320
- await (0, _utils_1.callWriteMethod)(contract, "pauseBeaconChainDeposits", []);
298
+ const contract = getDelegationContract(address);
299
+ await callWriteMethod(contract, 'pauseBeaconChainDeposits', []);
321
300
  });
322
301
  delegation
323
- .command("deposit-resume")
324
- .description("Resumes deposits to beacon chain from the StakingVault.")
325
- .argument("<address>", "delegation contract address")
302
+ .command('deposit-resume')
303
+ .description('Resumes deposits to beacon chain from the StakingVault.')
304
+ .argument('<address>', 'delegation contract address')
326
305
  .action(async (address) => {
327
- const contract = (0, _contracts_1.getDelegationContract)(address);
328
- await (0, _utils_1.callWriteMethod)(contract, "resumeBeaconChainDeposits", []);
306
+ const contract = getDelegationContract(address);
307
+ await callWriteMethod(contract, 'resumeBeaconChainDeposits', []);
329
308
  });
330
309
  delegation
331
- .command("vault")
332
- .description("vault info")
333
- .argument("<address>", "delegation address")
310
+ .command('vault')
311
+ .description('vault info')
312
+ .argument('<address>', 'delegation address')
334
313
  .action(async (address) => {
335
- const contract = (0, _contracts_1.getDelegationContract)(address);
336
- await (0, _utils_1.callReadMethod)(contract, "vaultSocket");
314
+ const contract = getDelegationContract(address);
315
+ await callReadMethod(contract, 'vaultSocket');
337
316
  });
338
317
  delegation
339
- .command("s-limit")
340
- .description("shares limit")
341
- .argument("<address>", "delegation address")
318
+ .command('s-limit')
319
+ .description('shares limit')
320
+ .argument('<address>', 'delegation address')
342
321
  .action(async (address) => {
343
- const contract = (0, _contracts_1.getDelegationContract)(address);
344
- await (0, _utils_1.callReadMethod)(contract, "shareLimit");
322
+ const contract = getDelegationContract(address);
323
+ await callReadMethod(contract, 'shareLimit');
345
324
  });
346
325
  delegation
347
- .command("s-minted")
348
- .description("shares minted")
349
- .argument("<address>", "delegation address")
326
+ .command('s-minted')
327
+ .description('shares minted')
328
+ .argument('<address>', 'delegation address')
350
329
  .action(async (address) => {
351
- const contract = (0, _contracts_1.getDelegationContract)(address);
352
- await (0, _utils_1.callReadMethod)(contract, "sharesMinted");
330
+ const contract = getDelegationContract(address);
331
+ await callReadMethod(contract, 'sharesMinted');
353
332
  });
354
333
  delegation
355
- .command("reserve-ratio")
356
- .description("vault reserve ratio of the vault")
357
- .argument("<address>", "delegation address")
334
+ .command('reserve-ratio')
335
+ .description('vault reserve ratio of the vault')
336
+ .argument('<address>', 'delegation address')
358
337
  .action(async (address) => {
359
- const contract = (0, _contracts_1.getDelegationContract)(address);
360
- await (0, _utils_1.callReadMethod)(contract, "reserveRatioBP");
338
+ const contract = getDelegationContract(address);
339
+ await callReadMethod(contract, 'reserveRatioBP');
361
340
  });
362
341
  delegation
363
- .command("t-reserve-ratio")
364
- .description("threshold reserve ratio of the vault")
365
- .argument("<address>", "delegation address")
342
+ .command('t-reserve-ratio')
343
+ .description('threshold reserve ratio of the vault')
344
+ .argument('<address>', 'delegation address')
366
345
  .action(async (address) => {
367
- const contract = (0, _contracts_1.getDelegationContract)(address);
368
- await (0, _utils_1.callReadMethod)(contract, "thresholdReserveRatioBP");
346
+ const contract = getDelegationContract(address);
347
+ await callReadMethod(contract, 'thresholdReserveRatioBP');
369
348
  });
370
349
  delegation
371
- .command("t-fee")
372
- .description("treasury fee basis points")
373
- .argument("<address>", "delegation address")
350
+ .command('t-fee')
351
+ .description('treasury fee basis points')
352
+ .argument('<address>', 'delegation address')
374
353
  .action(async (address) => {
375
- const contract = (0, _contracts_1.getDelegationContract)(address);
376
- await (0, _utils_1.callReadMethod)(contract, "treasuryFee");
354
+ const contract = getDelegationContract(address);
355
+ await callReadMethod(contract, 'treasuryFee');
377
356
  });
378
357
  delegation
379
- .command("valuation")
380
- .description("valuation of the vault in ether")
381
- .argument("<address>", "delegation address")
358
+ .command('valuation')
359
+ .description('valuation of the vault in ether')
360
+ .argument('<address>', 'delegation address')
382
361
  .action(async (address) => {
383
- const contract = (0, _contracts_1.getDelegationContract)(address);
384
- await (0, _utils_1.callReadMethod)(contract, "valuation");
362
+ const contract = getDelegationContract(address);
363
+ await callReadMethod(contract, 'valuation');
385
364
  });
386
365
  delegation
387
- .command("t-shares")
388
- .description("total of shares that can be minted on the vault")
389
- .argument("<address>", "delegation address")
366
+ .command('t-shares')
367
+ .description('total of shares that can be minted on the vault')
368
+ .argument('<address>', 'delegation address')
390
369
  .action(async (address) => {
391
- const contract = (0, _contracts_1.getDelegationContract)(address);
392
- await (0, _utils_1.callReadMethod)(contract, "totalMintableShares");
370
+ const contract = getDelegationContract(address);
371
+ await callReadMethod(contract, 'totalMintableShares');
393
372
  });
394
373
  delegation
395
- .command("get-shares")
396
- .description("maximum number of shares that can be minted with deposited ether")
397
- .argument("<address>", "delegation address")
398
- .argument("<ether>", "amount of ether to be funded")
374
+ .command('get-shares')
375
+ .description('maximum number of shares that can be minted with deposited ether')
376
+ .argument('<address>', 'delegation address')
377
+ .argument('<ether>', 'amount of ether to be funded')
399
378
  .action(async (address, ether) => {
400
- const contract = (0, _contracts_1.getDelegationContract)(address);
401
- await (0, _utils_1.callReadMethod)(contract, "projectedNewMintableShares", [
379
+ const contract = getDelegationContract(address);
380
+ await callReadMethod(contract, 'projectedNewMintableShares', [
402
381
  BigInt(ether),
403
382
  ]);
404
383
  });
405
384
  delegation
406
- .command("withdrawable-eth")
407
- .description("amount of ether that can be withdrawn from the staking vault")
408
- .argument("<address>", "delegation address")
385
+ .command('withdrawable-eth')
386
+ .description('amount of ether that can be withdrawn from the staking vault')
387
+ .argument('<address>', 'delegation address')
409
388
  .action(async (address) => {
410
- const contract = (0, _contracts_1.getDelegationContract)(address);
411
- await (0, _utils_1.callReadMethod)(contract, "withdrawableEther");
412
- });
413
- // TODO: test without voting
414
- delegation
415
- .command("ownership")
416
- .description("transfers ownership of the staking vault to a new owner")
417
- .argument("<address>", "delegation address")
418
- .argument("<newOwner>", "address of the new owner")
419
- .action(async (address, newOwner) => {
420
- const contract = (0, _contracts_1.getDelegationContract)(address);
421
- await (0, _utils_1.callWriteMethod)(contract, "transferStakingVaultOwnership", [
422
- newOwner,
423
- ]);
389
+ const contract = getDelegationContract(address);
390
+ await callReadMethod(contract, 'withdrawableEther');
424
391
  });
425
392
  delegation
426
- .command("fund-weth")
427
- .description("funds the staking vault with wrapped ether")
428
- .argument("<address>", "delegation address")
429
- .argument("<wethAmount>", "amount of weth to be funded")
393
+ .command('fund-weth')
394
+ .description('funds the staking vault with wrapped ether')
395
+ .argument('<address>', 'delegation address')
396
+ .argument('<wethAmount>', 'amount of weth to be funded')
430
397
  .action(async (address, wethAmount) => {
431
- const contract = (0, _contracts_1.getDelegationContract)(address);
432
- await (0, _utils_1.callWriteMethod)(contract, "fundWeth", [BigInt(wethAmount)]);
398
+ const contract = getDelegationContract(address);
399
+ await callWriteMethod(contract, 'fundWeth', [BigInt(wethAmount)]);
433
400
  });
434
401
  delegation
435
- .command("withdraw-weth")
436
- .description("withdraws stETH tokens from the staking vault to wrapped ether")
437
- .argument("<address>", "delegation address")
438
- .argument("<recipient>", "address of the recipient")
439
- .argument("<ether>", "amount of ether to withdraw")
402
+ .command('withdraw-weth')
403
+ .description('withdraws stETH tokens from the staking vault to wrapped ether')
404
+ .argument('<address>', 'delegation address')
405
+ .argument('<recipient>', 'address of the recipient')
406
+ .argument('<ether>', 'amount of ether to withdraw')
440
407
  .action(async (address, recipient, ether) => {
441
- const contract = (0, _contracts_1.getDelegationContract)(address);
442
- await (0, _utils_1.callWriteMethod)(contract, "withdrawWETH", [recipient, BigInt(ether)]);
408
+ const contract = getDelegationContract(address);
409
+ await callWriteMethod(contract, 'withdrawWETH', [recipient, BigInt(ether)]);
443
410
  });
444
411
  delegation
445
- .command("exit")
446
- .description("requests the exit of a validator from the staking vault")
447
- .argument("<address>", "delegation address")
448
- .argument("<validatorPubKey>", "public key of the validator to exit")
412
+ .command('exit')
413
+ .description('requests the exit of a validator from the staking vault')
414
+ .argument('<address>', 'delegation address')
415
+ .argument('<validatorPubKey>', 'public key of the validator to exit')
449
416
  .action(async (address, validatorPubKey) => {
450
- const contract = (0, _contracts_1.getDelegationContract)(address);
451
- await (0, _utils_1.callWriteMethod)(contract, "requestValidatorExit", [validatorPubKey]);
417
+ const contract = getDelegationContract(address);
418
+ await callWriteMethod(contract, 'requestValidatorExit', [validatorPubKey]);
452
419
  });
453
420
  delegation
454
- .command("mint-shares")
455
- .description("mints stETH tokens backed by the vault to a recipient")
456
- .argument("<address>", "delegation address")
457
- .argument("<recipient>", "address of the recipient")
458
- .argument("<amountOfShares>", "amount of shares to mint")
421
+ .command('mint-shares')
422
+ .description('mints stETH tokens backed by the vault to a recipient')
423
+ .argument('<address>', 'delegation address')
424
+ .argument('<recipient>', 'address of the recipient')
425
+ .argument('<amountOfShares>', 'amount of shares to mint')
459
426
  .action(async (address, recipient, amountOfShares) => {
460
- const contract = (0, _contracts_1.getDelegationContract)(address);
461
- await (0, _utils_1.callWriteMethod)(contract, "mintShares", [
427
+ const contract = getDelegationContract(address);
428
+ await callWriteMethod(contract, 'mintShares', [
462
429
  recipient,
463
430
  BigInt(amountOfShares),
464
431
  ]);
465
432
  });
466
433
  delegation
467
- .command("mint-steth")
468
- .description("mints stETH tokens backed by the vault to a recipient")
469
- .argument("<address>", "delegation address")
470
- .argument("<recipient>", "address of the recipient")
471
- .argument("<amountOfShares>", "amount of shares to mint")
434
+ .command('mint-steth')
435
+ .description('mints stETH tokens backed by the vault to a recipient')
436
+ .argument('<address>', 'delegation address')
437
+ .argument('<recipient>', 'address of the recipient')
438
+ .argument('<amountOfShares>', 'amount of shares to mint')
472
439
  .action(async (address, recipient, amountOfShares) => {
473
- const contract = (0, _contracts_1.getDelegationContract)(address);
474
- await (0, _utils_1.callWriteMethod)(contract, "mintStETH", [
440
+ const contract = getDelegationContract(address);
441
+ await callWriteMethod(contract, 'mintStETH', [
475
442
  recipient,
476
443
  BigInt(amountOfShares),
477
444
  ]);
478
445
  });
479
446
  delegation
480
- .command("mint-wsteth")
481
- .description("mints wstETH tokens backed by the vault to a recipient")
482
- .argument("<address>", "delegation address")
483
- .argument("<recipient>", "address of the recipient")
484
- .argument("<tokens>", "amount of tokens to mint")
447
+ .command('mint-wsteth')
448
+ .description('mints wstETH tokens backed by the vault to a recipient')
449
+ .argument('<address>', 'delegation address')
450
+ .argument('<recipient>', 'address of the recipient')
451
+ .argument('<tokens>', 'amount of tokens to mint')
485
452
  .action(async (address, recipient, tokens) => {
486
- const contract = (0, _contracts_1.getDelegationContract)(address);
487
- await (0, _utils_1.callWriteMethod)(contract, "mintWstETH", [recipient, BigInt(tokens)]);
453
+ const contract = getDelegationContract(address);
454
+ await callWriteMethod(contract, 'mintWstETH', [recipient, BigInt(tokens)]);
488
455
  });
489
456
  delegation
490
- .command("burn-shares")
491
- .description("Burns stETH shares from the sender backed by the vault. Expects corresponding amount of stETH approved to this contract")
492
- .argument("<address>", "delegation address")
493
- .argument("<amountOfShares>", "amount of shares to burn")
457
+ .command('burn-shares')
458
+ .description('Burns stETH shares from the sender backed by the vault. Expects corresponding amount of stETH approved to this contract')
459
+ .argument('<address>', 'delegation address')
460
+ .argument('<amountOfShares>', 'amount of shares to burn')
494
461
  .action(async (address, amountOfShares) => {
495
- const contract = (0, _contracts_1.getDelegationContract)(address);
496
- (0, _utils_1.callWriteMethod)(contract, "burnShares", [BigInt(amountOfShares)]);
462
+ const contract = getDelegationContract(address);
463
+ await callWriteMethod(contract, 'burnShares', [BigInt(amountOfShares)]);
497
464
  });
498
465
  delegation
499
- .command("burn-steth")
500
- .description("Burns stETH shares from the sender backed by the vault. Expects stETH amount approved to this contract.")
501
- .argument("<address>", "delegation address")
502
- .argument("<amountOfShares>", "amount of shares to burn")
466
+ .command('burn-steth')
467
+ .description('Burns stETH shares from the sender backed by the vault. Expects stETH amount approved to this contract.')
468
+ .argument('<address>', 'delegation address')
469
+ .argument('<amountOfShares>', 'amount of shares to burn')
503
470
  .action(async (address, amountOfShares) => {
504
- const contract = (0, _contracts_1.getDelegationContract)(address);
505
- (0, _utils_1.callWriteMethod)(contract, "burnStETH", [BigInt(amountOfShares)]);
471
+ const contract = getDelegationContract(address);
472
+ await callWriteMethod(contract, 'burnStETH', [BigInt(amountOfShares)]);
506
473
  });
507
474
  delegation
508
- .command("burn-wsteth")
509
- .description("burn wstETH tokens from the sender backed by the vault")
510
- .argument("<address>", "delegation address")
511
- .argument("<tokens>", "amount of wstETH tokens to burn")
475
+ .command('burn-wsteth')
476
+ .description('burn wstETH tokens from the sender backed by the vault')
477
+ .argument('<address>', 'delegation address')
478
+ .argument('<tokens>', 'amount of wstETH tokens to burn')
512
479
  .action(async (address, tokens) => {
513
- const contract = (0, _contracts_1.getDelegationContract)(address);
514
- (0, _utils_1.callWriteMethod)(contract, "burnWstETH", [BigInt(tokens)]);
480
+ const contract = getDelegationContract(address);
481
+ await callWriteMethod(contract, 'burnWstETH', [BigInt(tokens)]);
515
482
  });
516
483
  delegation
517
- .command("burn-shares-permit")
518
- .description("Burns stETH tokens (in shares) backed by the vault from the sender using permit (with value in stETH).")
519
- .argument("<address>", "delegation address")
520
- .argument("<tokens>", "amount of stETH tokens to burn")
521
- .argument("<permitJSON>", "JSON data required for the stETH.permit() method to set the allowance")
484
+ .command('burn-shares-permit')
485
+ .description('Burns stETH tokens (in shares) backed by the vault from the sender using permit (with value in stETH).')
486
+ .argument('<address>', 'delegation address')
487
+ .argument('<tokens>', 'amount of stETH tokens to burn')
488
+ .argument('<permitJSON>', 'JSON data required for the stETH.permit() method to set the allowance')
522
489
  .action(async (address, tokens, permitJSON) => {
523
490
  const permit = JSON.parse(permitJSON);
524
- const contract = (0, _contracts_1.getDelegationContract)(address);
525
- (0, _utils_1.callWriteMethod)(contract, "burnSharesWithPermit", [BigInt(tokens), permit]);
491
+ const contract = getDelegationContract(address);
492
+ await callWriteMethod(contract, 'burnSharesWithPermit', [
493
+ BigInt(tokens),
494
+ permit,
495
+ ]);
526
496
  });
527
497
  delegation
528
- .command("burn-steth-permit")
529
- .description("Burns stETH tokens backed by the vault from the sender using permit.")
530
- .argument("<address>", "delegation address")
531
- .argument("<tokens>", "amount of stETH tokens to burn")
532
- .argument("<permitJSON>", "JSON data required for the stETH.permit() method to set the allowance")
498
+ .command('burn-steth-permit')
499
+ .description('Burns stETH tokens backed by the vault from the sender using permit.')
500
+ .argument('<address>', 'delegation address')
501
+ .argument('<tokens>', 'amount of stETH tokens to burn')
502
+ .argument('<permitJSON>', 'JSON data required for the stETH.permit() method to set the allowance')
533
503
  .action(async (address, tokens, permitJSON) => {
534
504
  const permit = JSON.parse(permitJSON);
535
- const contract = (0, _contracts_1.getDelegationContract)(address);
536
- (0, _utils_1.callWriteMethod)(contract, "burnStETHWithPermit", [BigInt(tokens), permit]);
505
+ const contract = getDelegationContract(address);
506
+ await callWriteMethod(contract, 'burnStETHWithPermit', [
507
+ BigInt(tokens),
508
+ permit,
509
+ ]);
537
510
  });
538
511
  delegation
539
- .command("burn-wsteth-permit")
540
- .description("burn wstETH tokens from the sender backed by the vault using EIP-2612 Permit")
541
- .argument("<address>", "delegation address")
542
- .argument("<tokens>", "amount of wstETH tokens to burn")
543
- .argument("<permitJSON>", "JSON data required for the wstETH.permit() method to set the allowance")
512
+ .command('burn-wsteth-permit')
513
+ .description('burn wstETH tokens from the sender backed by the vault using EIP-2612 Permit')
514
+ .argument('<address>', 'delegation address')
515
+ .argument('<tokens>', 'amount of wstETH tokens to burn')
516
+ .argument('<permitJSON>', 'JSON data required for the wstETH.permit() method to set the allowance')
544
517
  .action(async (address, tokens, permitJSON) => {
545
518
  const permit = JSON.parse(permitJSON);
546
- const contract = (0, _contracts_1.getDelegationContract)(address);
547
- (0, _utils_1.callWriteMethod)(contract, "burnWstETHWithPermit", [BigInt(tokens), permit]);
519
+ const contract = getDelegationContract(address);
520
+ await callWriteMethod(contract, 'burnWstETHWithPermit', [
521
+ BigInt(tokens),
522
+ permit,
523
+ ]);
548
524
  });
549
525
  delegation
550
- .command("recover-erc20")
551
- .description("recovers ERC20 tokens or ether from the delegation contract to sender")
552
- .argument("<address>", "delegation address")
553
- .argument("<token>", "Address of the token to recover or 0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee for ether")
554
- .argument("<recipient>", "Address of the recovery recipient")
555
- .argument("<amount>", "amount of ether to recover")
526
+ .command('recover-erc20')
527
+ .description('recovers ERC20 tokens or ether from the delegation contract to sender')
528
+ .argument('<address>', 'delegation address')
529
+ .argument('<token>', 'Address of the token to recover or 0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee for ether')
530
+ .argument('<recipient>', 'Address of the recovery recipient')
531
+ .argument('<amount>', 'amount of ether to recover')
556
532
  .action(async (address, token, recipient, amount) => {
557
- const contract = (0, _contracts_1.getDelegationContract)(address);
558
- (0, _utils_1.callWriteMethod)(contract, "recoverERC20", [
533
+ const contract = getDelegationContract(address);
534
+ await callWriteMethod(contract, 'recoverERC20', [
559
535
  token,
560
536
  recipient,
561
537
  BigInt(amount),
562
538
  ]);
563
539
  });
564
540
  delegation
565
- .command("recover-erc721")
566
- .description("Transfers a given token_id of an ERC721-compatible NFT (defined by the token contract address)")
567
- .argument("<address>", "delegation address")
568
- .argument("<token>", "an ERC721-compatible token")
569
- .argument("<tokenId>", "token id to recover")
570
- .argument("<recipient>", "Address of the recovery recipient")
541
+ .command('recover-erc721')
542
+ .description('Transfers a given token_id of an ERC721-compatible NFT (defined by the token contract address)')
543
+ .argument('<address>', 'delegation address')
544
+ .argument('<token>', 'an ERC721-compatible token')
545
+ .argument('<tokenId>', 'token id to recover')
546
+ .argument('<recipient>', 'Address of the recovery recipient')
571
547
  .action(async (address, token, tokenId, recipient) => {
572
- const contract = (0, _contracts_1.getDelegationContract)(address);
573
- await (0, _utils_1.callWriteMethod)(contract, "recoverERC721", [
548
+ const contract = getDelegationContract(address);
549
+ await callWriteMethod(contract, 'recoverERC721', [
574
550
  token,
575
551
  BigInt(tokenId),
576
552
  recipient,
577
553
  ]);
578
554
  });
579
555
  delegation
580
- .command("role-grant")
581
- .description("Mass-revokes multiple roles from multiple accounts.")
582
- .argument("<address>", "delegation address")
583
- .argument("<roleAssignmentJSON>", "JSON array of role assignments")
556
+ .command('role-grant')
557
+ .description('Mass-revokes multiple roles from multiple accounts.')
558
+ .argument('<address>', 'delegation address')
559
+ .argument('<roleAssignmentJSON>', 'JSON array of role assignments')
584
560
  .action(async (address, roleAssignmentJSON) => {
585
- const contract = (0, _contracts_1.getDelegationContract)(address);
561
+ const contract = getDelegationContract(address);
586
562
  const payload = JSON.parse(roleAssignmentJSON);
587
563
  if (!Array.isArray(payload)) {
588
- throw new Error("the 2nd argument should be an array of role assignments");
564
+ throw new Error('the 2nd argument should be an array of role assignments');
589
565
  }
590
- await (0, _utils_1.callWriteMethod)(contract, "grantRoles", [payload]);
566
+ await callWriteMethod(contract, 'grantRoles', [payload]);
591
567
  });
592
568
  delegation
593
- .command("role-revoke")
594
- .description("Resumes beacon chain deposits on the staking vault.")
595
- .argument("<address>", "delegation address")
596
- .argument("<roleAssignmentJSON>", "JSON array of role assignments")
569
+ .command('role-revoke')
570
+ .description('Resumes beacon chain deposits on the staking vault.')
571
+ .argument('<address>', 'delegation address')
572
+ .argument('<roleAssignmentJSON>', 'JSON array of role assignments')
597
573
  .action(async (address, roleAssignmentJSON) => {
598
- const contract = (0, _contracts_1.getDelegationContract)(address);
574
+ const contract = getDelegationContract(address);
599
575
  const payload = JSON.parse(roleAssignmentJSON);
600
576
  if (!Array.isArray(payload)) {
601
- throw new Error("the 2nd argument should be an array of role assignments");
577
+ throw new Error('the 2nd argument should be an array of role assignments');
602
578
  }
603
- await (0, _utils_1.callWriteMethod)(contract, "revokeRoles", [payload]);
579
+ await callWriteMethod(contract, 'revokeRoles', [payload]);
604
580
  });
605
581
  //# sourceMappingURL=delegation.js.map