Get started with ethers CDN
MIT licensed
Decentralized, open-source platforms for Ethereum smart contracts and apps.
Tags:- ethers
- ethereum
- wallet
- eth
Stable version
Copied!
How to start using ethers CDN
// Import Ethers.js library
const ethers = typeof window.ethers !== 'undefined' ? window.ethers : require('ethers');
// Set up provider (e.g., Infura)
const provider = new ethers.providers.JsonRpcProvider('https://mainnet.infura.io/v3/your-project-id');
// Set up wallet
const wallet = new ethers.Wallet('your-private-key', provider);
// Get account balance
async function getBalance() {
const balance = await wallet.getBalance();
console.log('Account balance:', ethers.utils.formatEther(balance));
}
// Call the function
getBalance();
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
All versions
4.0.49
5.1.2
5.1.3
5.1.4
5.2.0
5.3.0
5.3.1
5.4.0
5.4.1
5.4.2
5.4.3
5.4.4
5.4.5
5.4.6
5.4.7
5.5.0
5.5.1
5.5.2
5.5.3
5.5.4
5.6.0
5.6.1
5.6.2
5.6.3
5.6.4
5.6.5
5.6.6
5.6.7
5.6.8
5.6.9
5.7.0
5.7.1
5.7.2
6.0.0
6.0.0-beta-exports.0
6.0.0-beta-exports.1
6.0.0-beta-exports.10
6.0.0-beta-exports.11
6.0.0-beta-exports.12
6.0.0-beta-exports.13
6.0.0-beta-exports.14
6.0.0-beta-exports.15
6.0.0-beta-exports.16
6.0.0-beta-exports.2
6.0.0-beta-exports.3
6.0.0-beta-exports.4
6.0.0-beta-exports.5
6.0.0-beta-exports.6
6.0.0-beta-exports.7
6.0.0-beta-exports.8
6.0.0-beta-exports.9
6.0.0-beta.1
6.0.0-beta.2
6.0.0-beta.3
6.0.0-beta.4
6.0.0-beta.5
6.0.0-beta.6
6.0.0-beta.7
6.0.0-beta.8
6.0.0-beta.9
6.0.1
6.0.2
6.0.3
6.0.4
6.0.5
6.0.6
6.0.7
6.0.8
6.1.0
6.10.0
6.11.0
6.11.1
6.12.0
6.12.0-beta.1
6.12.1
6.12.2
6.13.0
6.13.1
6.13.2
6.13.3
*** 6.13.4
6.2.0
6.2.1
6.2.2
6.2.3
6.3.0
6.4.0
6.4.1
6.4.2
6.5.0
6.5.1
6.6.0
6.6.1
6.6.2
6.6.3
6.6.4
6.6.5
6.6.6
6.6.7
6.7.0
6.7.1
6.8.0
6.8.1
6.9.0
6.9.1
6.9.2