(walletAddress: string)
| 116 | * @returns |
| 117 | */ |
| 118 | export const getCurrentBalanceDisplay = async (walletAddress: string): Promise<string> => { |
| 119 | |
| 120 | // --- Unfortunate check we must do --- |
| 121 | if (ethersProvider === null) return ""; |
| 122 | |
| 123 | // balance (in Wei): { BigNumber: "182826475815887608" } |
| 124 | const balance: ethers.BigNumber = await ethersProvider.getBalance(walletAddress); |
| 125 | |
| 126 | // --- Return the amount in Eth as a string representation --- |
| 127 | return ethers.utils.formatEther(balance); |
| 128 | } |
| 129 | |
| 130 | export const connectWallet = async () => { |
| 131 | // --- Checks to see if the user's browser has Metamask enabled... |
nothing calls this directly
no outgoing calls
no test coverage detected