From 79c678da2e3894dac6d31347702de4bdace2f7d2 Mon Sep 17 00:00:00 2001 From: Oskar Thoren Date: Wed, 24 Feb 2021 12:14:11 +0800 Subject: [PATCH] JSONify balance resp --- hardhat.config.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hardhat.config.js b/hardhat.config.js index ccbd396..2d15a07 100644 --- a/hardhat.config.js +++ b/hardhat.config.js @@ -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")