Read address from private key for querying balance

This commit is contained in:
Ayanami 2022-01-24 21:50:58 +09:00
parent 710054547a
commit bceb74b9b3
No known key found for this signature in database
GPG Key ID: 0CABDF03077D92E4

6
cli.js

@ -1033,10 +1033,14 @@ async function main() {
})
})
program
.command('balance <address> [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 })