Skip to content

tmlewin04/tea_OSS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 

Repository files navigation

tea_OSS

Tea_OSS const Web3 = require('web3'); const { gweiToEther } = require('ftm-gas-convert');

// Function to check Ethereum wallet balance async function checkBalance(walletAddress, providerUrl) { const web3 = new Web3(providerUrl); try { const gweiValue = 1000000000; // 1 Gwei const etherValue = gweiToEther(gweiValue); console.log(etherValue); // Output: 1 Ether

    const balance = await web3.eth.getBalance(walletAddress);
    return web3.utils.fromWei(balance, 'ether');
} catch (error) {
    throw new Error(`Error while fetching balance: ${error.message}`);
}

}

// Exporting the function module.exports = { checkBalance };

About

Tea_OSS

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published