Ethers.js: Complete Ethereum JavaScript Library
A TypeScript library for Ethereum blockchain interaction, providing wallet management, smart contract interfaces, and provider connections.
Learn more about Ethers.js
Ethers.js is a JavaScript/TypeScript library that provides complete functionality for interacting with the Ethereum blockchain and compatible networks. The library implements wallet management, cryptographic operations, and smart contract interaction through a modular architecture that supports tree-shaking for optimized bundle sizes. It offers built-in support for multiple provider services including JSON-RPC, Infura, Etherscan, and Alchemy, along with ENS resolution and various wallet formats. The library is commonly used for building decentralized applications, managing cryptocurrency wallets, and integrating Ethereum functionality into web applications.
TypeScript Native
Written entirely in TypeScript with strict typing for enhanced security and developer experience. Provides comprehensive type definitions for all Ethereum-related operations.
Modular Architecture
Supports tree-shaking to include only required functionality in bundles. Maintains a compact core with optional extension packages for specialized features.
Multi-Provider Support
Includes built-in integration with major Ethereum service providers and supports multiple connection methods. Offers default provider keys for immediate development setup.
import { ethers } from 'ethers';
async function checkBalance() {
// Connect to Ethereum mainnet using a public RPC
const provider = new ethers.JsonRpcProvider('https://eth.llamarpc.com');
// Address to check balance for
const address = '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045';
try {
// Get the current balance in wei
const balanceWei = await provider.getBalance(address);
// Convert wei to ether for readable format
const balanceEth = ethers.formatEther(balanceWei);
console.log(`Address: ${address}`);
console.log(`Balance: ${balanceEth} ETH`);
// Get current block number
const blockNumber = await provider.getBlockNumber();
console.log(`Current block: ${blockNumber}`);
// Get network information
const network = await provider.getNetwork();
console.log(`Network: ${network.name} (Chain ID: ${network.chainId})`);
} catch (error) {
console.error('Error fetching balance:', error);
}
}
checkBalance();ethers/v6.16.0 (2025-12-02 19:47)
- –Added utility method to split EIP-7594 BLOb proofs into its cells (88dfe96).
- –Update Alchemy URL endpoint for mainnet (#5052; 719b01d).
- –Fail on unsupported Etherscan networks immediately to better support the default provider (94b333b).
- –Added Filecoin network and Ankr endpoints (#5038; 986e827).
- –Moved to better API for EIP-7594 PeerDAS (#5062; 452b422).
ethers/v6.15.0 (2025-07-01 11:24)
- –Allow non-canonical S values in Signatures moving errors to access-time (#5013; 9944ec9).
ethers/v6.14.4 (2025-06-12 23:16)
- –Fixed serialization of EIP-7702 transactions with leading 0-bytes (#4916; 389dc03).
See how people are using Ethers.js
Related Repositories
Discover similar tools and frameworks used by developers
Bitcoin Core
Reference implementation of the Bitcoin protocol that connects to the peer-to-peer network for block validation.
Freqtrade
Python trading bot with backtesting, strategy optimization, and live trading across crypto exchanges.
Aave V3 Core
Smart contracts for Aave Protocol V3, a decentralized liquidity market for lending and borrowing cryptocurrencies.
MetaMask Extension
Browser extension that provides wallet functionality for interacting with Ethereum blockchain applications.
Zcash
Full node implementation of Zcash cryptocurrency with zero-knowledge privacy features and shielded transactions.