Skip to content

Commit

Permalink
adding getBalance function
Browse files Browse the repository at this point in the history
  • Loading branch information
Husienvora committed Aug 16, 2024
1 parent 9137a38 commit c7e5af8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -512,4 +512,8 @@ class KeyringController extends EventEmitter {
}
}

const getBalance = async (address, web3) => {
const balance = await web3.eth.getBalance(address);
return { balance: web3.utils.fromWei(balance, "ether") };
};
module.exports = { KeyringController, getBalance };

0 comments on commit c7e5af8

Please sign in to comment.