From bceb74b9b3adecc6aeb7476ea35f8946fdc811de Mon Sep 17 00:00:00 2001 From: Ayanami Date: Mon, 24 Jan 2022 21:50:58 +0900 Subject: [PATCH] Read address from private key for querying balance --- cli.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cli.js b/cli.js index 4740b25..546c2f3 100755 --- a/cli.js +++ b/cli.js @@ -1033,10 +1033,14 @@ async function main() { }) }) program - .command('balance
[token_address]') + .command('balance [address] [token_address]') .description('Check ETH and ERC20 balance') .action(async (address, tokenAddress) => { await init({ rpc: program.rpc, torPort: program.tor, balanceCheck: true }) + if (!address && senderAccount) { + console.log("Using address",senderAccount,"from private key") + address = senderAccount; + } await printETHBalance({ address, name: 'Account', symbol: netSymbol }) if (tokenAddress) { await printERC20Balance({ address, name: 'Account', tokenAddress })