feat: add script to sweep all ETH balance to a new wallet
This commit is contained in:
parent
c94d767f0b
commit
c16e0ea776
4 changed files with 145 additions and 11 deletions
|
|
@ -158,7 +158,8 @@ function run () {
|
|||
const validateAnswers = async (answers) => {
|
||||
if (_.size(answers) > 2) return { message: `Please insert a maximum of two coins to install.`, isValid: false }
|
||||
return getBlockchainSyncStatus(cryptos)
|
||||
.then(blockchainStatuses => {
|
||||
.then(_blockchainStatuses => {
|
||||
const blockchainStatuses = _.filter(it => it !== 'disconnected', _blockchainStatuses)
|
||||
const result = _.reduce((acc, value) => ({ ...acc, [value]: _.isNil(acc[value]) ? 1 : acc[value] + 1 }), {}, _.values(blockchainStatuses))
|
||||
if (_.size(answers) + result.syncing > 2) {
|
||||
return { message: `Installing these coins would pass the 2 parallel blockchain synchronization limit. Please try again with fewer coins or try again later.`, isValid: false }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue