.. | ||
api-providers | ||
jsonrpc-provider | ||
other | ||
provider | ||
types | ||
index.html | ||
README.md |
Providers
Default Provider
ethers . getDefaultProvider( [ network , [ options ] ] ) => Provider
Returns a new Provider, backed by multiple services, connected to network. Is no network is provided, homestead (i.e. mainnet) is used.
The network may also be a URL to connect to, such as http://localhost:8545
or wss://example.com
.
The options is an object, with the following properties:
Option Properties
Note: API Keys
It is highly recommended for production services that to acquire and specify an API Key for each sercice.
The default API Keys used by ethers are shared across all users, so services may throttle all services that are using the default API Keys during periods of load without realizing it.
Many services also have monitoring and usage metrics, which are only available if an API Key is specified. This allows tracking how many requests are being sent and which methods are being used the most.
Some services also provide additional paid features, which are only available when specifying an API Key.
Networks
Custom ENS Contract
const network = {
name: "dev",
chianId: 1337,
ensAddress: customEnsAddress
};