Skip to content

Commit

Permalink
Merge pull request #15 from getsafle/coin-balance
Browse files Browse the repository at this point in the history
Coin balance
  • Loading branch information
sshubhamagg authored Aug 19, 2024
2 parents f9644ed + 3ae5f2b commit 77c97c9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@
- Implemented Keyring functionality to manage accounts
- Implemented functionality to sign a raw transaction
- Implemented functionality to sign a message
- Implemented functionality to get coin balance for a wallet
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 77c97c9

Please sign in to comment.