Documentation

What is Ethers?

The ethers.js library aims to be a complete and compact library for interacting with the Ethereum Blockchain and its ecosystem. It was originally designed for use with ethers.io and has since expanded into a much more general-purpose library.

Features

Developer Documentation

Getting Started
Installing
Importing
Common Terminology
Connecting to Ethereum: Metamask
Contracts
Signing Messages
Ethereum Basics
Events
Solidity Topics
Logs and Filtering
Gas
Gas Price
Gas Limit
Security
Key Derivation Functions
Application Programming Interface
Providers
Provider
Accounts Methods
Blocks Methods
Ethereum Naming Service (ENS) Methods
Logs Methods
Network Status Methods
Transactions Methods
Event Emitter Methods
Inspection Methods
JsonRpcProvider
JsonRpcSigner
JsonRpcUncheckedSigner
Node-Specific Methods
API Providers
EtherscanProvider
InfuraProvider
AlchemyProvider
CloudflareProvider
Other Providers
FallbackProvider
IpcProvider
UrlJsonRpcProvider
Web3Provider
WebSocketProvider
Types
BlockTag
Network
Block
Events and Logs
Transactions
Signers
Signer
Wallet
VoidSigner
ExternallyOwnedAccount
Contract Interaction
Contract
Creating Instances
Properties
Methods
Events
Meta-Class
ContractFactory
Creating Instances
Properties
Methods
Example: ERC-20 Contract
Connecting to a Contract
Properties
Methods
Events
Meta-Class Methods
Meta-Class Filters
Utilities
Application Binary Interface
AbiCoder
Creating Instance
Coding Methods
ABI Formats
Human-Readable ABI
Solidity JSON ABI
Fragments
Formats
Fragment
ConstructorFragment
EventFragment
FunctionFragment
ParamType
Interface
Creating Instances
Properties
Formatting
Fragment Access
Signature and Topic Hashes
Encoding Data
Decoding Data
Parsing
Types
Specifying Fragments
Addresses
Address Formats
Converting and Verifying
Derivation
Contracts Addresses
BigNumber
Types
Creating Instances
Methods
Notes
Byte Manipulation
Types
Inspection
Converting between Arrays and Hexstrings
Array Manipulation
Hexstring Manipulation
Signature Conversion
Random Bytes
Constants
Bytes
Strings
BigNumber
Display Logic and Input
Units
Functions
Encoding Utilities
Base58
Base64
Recursive-Length Prefix
FixedNumber
Creating Instances
Properties
Methods
FixedFormat
Hashing Algorithms
Cryptographic Hash Functions
HMAC
Hashing Helpers
Solidity Hashing Algorithms
HD Wallet
Types
HDNode
Other Functions
Logging
Logger
Errors
Log Levels
Property Utilities
Signing Key
Other Functions
Strings
Bytes32String
UTF-8 Strings
UnicodeNormalizationForm
Custom UTF-8 Error Handling
Transactions
Types
Functions
Web Utilities
Wordlists
Wordlist
Languages
Other Libraries
Assembly
Ethers ASM Dialect
Opcodes
Labels
Literals
Comments
Scopes
Data Segment
Links
Stack Placeholders
Evaluation and Excution
Utilities
Assembler
Disassembler
Opcode
Abstract Syntax Tree
Types
Nodes
Hardware Wallets
LedgerSigner
Experimental
BrainWallet
EIP1193Bridge
NonceManager
Command Line Interfaces
Sandbox Utility
Help
Examples
Assembler
Help
Example Input Files
Assembler Examples
Disassembler Examples
Ethereum Naming Service
Help
Examples
TypeScript
Help
Examples
Making Your Own
CLI
Plugin
ArgParser
Cookbook
Migration Guide
Migration: From Web3.js
Providers
Signers
Contracts
Numbers
Utilities
Migration: From Ethers v4
BigNumber
Contracts
Errors
Interface
Wallet
Testing
Supported Platforms
Test Suites
Test Suite API
Schemas
Contributing and Hacking
Building
Making your changes
Documentation
Flatworm Docs
Fragments
Markdown
Code
Tables
Configuration
Extensions
License and Copyright

Legacy Documentation

This section will be kept up to date, linking to documentation of older versions of the library.