mirror of
https://github.com/tornadocash/tornado-cli.git
synced 2024-11-24 10:53:10 +01:00
Read address from private key for querying balance
This commit is contained in:
parent
710054547a
commit
bceb74b9b3
6
cli.js
6
cli.js
@ -1033,10 +1033,14 @@ async function main() {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
program
|
program
|
||||||
.command('balance <address> [token_address]')
|
.command('balance [address] [token_address]')
|
||||||
.description('Check ETH and ERC20 balance')
|
.description('Check ETH and ERC20 balance')
|
||||||
.action(async (address, tokenAddress) => {
|
.action(async (address, tokenAddress) => {
|
||||||
await init({ rpc: program.rpc, torPort: program.tor, balanceCheck: true })
|
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 })
|
await printETHBalance({ address, name: 'Account', symbol: netSymbol })
|
||||||
if (tokenAddress) {
|
if (tokenAddress) {
|
||||||
await printERC20Balance({ address, name: 'Account', tokenAddress })
|
await printERC20Balance({ address, name: 'Account', tokenAddress })
|
||||||
|
Loading…
Reference in New Issue
Block a user