feat: add script to sweep all ETH balance to a new wallet

This commit is contained in:
Sérgio Salgado 2022-06-12 16:10:18 +01:00
parent c94d767f0b
commit c16e0ea776
4 changed files with 145 additions and 11 deletions

View file

@ -59,11 +59,11 @@ function _balance (settings, cryptoCode) {
})
}
function sendCoins (settings, tx) {
function sendCoins (settings, tx, opts) {
return fetchWallet(settings, tx.cryptoCode)
.then(r => {
const feeMultiplier = new BN(configManager.getWalletSettings(tx.cryptoCode, settings.config).feeMultiplier)
return r.wallet.sendCoins(r.account, tx, settings, r.operatorId, feeMultiplier)
return r.wallet.sendCoins(r.account, tx, settings, r.operatorId, feeMultiplier, opts)
.then(res => {
mem.clear(module.exports.balance)
return res