JSONify balance resp

This commit is contained in:
Oskar Thoren 2021-02-24 12:14:11 +08:00
parent ae750fbd42
commit 79c678da2e
No known key found for this signature in database
GPG Key ID: B2ECCFD3BC2EF77E
1 changed files with 3 additions and 1 deletions

View File

@ -20,7 +20,9 @@ task("balance", "Prints an account's balance")
const account = web3.utils.toChecksumAddress(taskArgs.account);
const balance = await web3.eth.getBalance(account);
console.log(web3.utils.fromWei(balance, "ether"), "ETH");
var bal = web3.utils.fromWei(balance, "ether");
var resp = {"balance": bal}; // In ETH
console.log(JSON.stringify(resp));
});
task("setupSwap", "Setup Swap")