Created
July 14, 2020 21:00
-
-
Save petejkim/dd4f42bc0c3ee8bb07f88bdf5477ef81 to your computer and use it in GitHub Desktop.
Introduction to Building on DeFi with Ethereum and USDC - Part 1 - getBalance.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const ethers = require("ethers"); | |
const wallet = require("./wallet"); | |
const provider = require("./provider"); | |
async function main() { | |
const account = wallet.connect(provider); | |
const balance = await account.getBalance(); | |
console.log(`ETH Balance: ${ethers.utils.formatUnits(balance, 18)}`); | |
} | |
main(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment