docs: added documentation changes

This commit is contained in:
Richard Moore 2023-02-02 20:53:12 -05:00
parent c80fcddf50
commit 962ee4e95a
11 changed files with 79 additions and 79 deletions

View File

@ -41,7 +41,8 @@ operations required to interact with the Ethereum Blockchain.
- customer usage metrics
_definition: **Networks:**
``homestead``, ``ropsten``, ``rinkeby``, ``goerli`` and ``kovan``.
``homestead``, ``goerli``, ``sepolia``, ``matic``. ``maticmum``, ``arbitrum``,
``arbitrum-goerli``, ``optimism`` and ``optimism-goerli``.
_subsection: INFURA @NOTE<(see the [[InfuraProvider]])> @<api-keys--infura>
@ -61,9 +62,8 @@ interaction with standard tools versatile, simple and straightforward.
- access to archive data (requires paid upgrade)
_definition: **Networks:**
``homestead``, ``ropsten``, ``rinkeby``, ``goerli``, ``kovan``, ``matic``,
``maticmum``, ``optimism``, ``optimism-kovan``, ``arbitrum`` and
``arbitrum-rinkeby``.
``homestead``, ``goerli``, ``sepolia``, ``matic``. ``maticmum``, ``arbitrum``,
``arbitrum-goerli``, ``optimism`` and ``optimism-goerli``.
_subsection: Alchemy @NOTE<(see the [[AlchemyProvider]])> @<api-keys--alchemy>
@ -85,9 +85,8 @@ with debugging.
- access to advanced debugging trace and revert reason APIs
_definition: **Networks:**
``homestead``, ``ropsten``, ``rinkeby``, ``goerli``, ``kovan``, ``matic``,
``maticmum``, ``optimism``, ``optimism-kovan``, ``arbitrum`` and
``arbitrum-rinkeby``.
``homestead``, ``goerli``, ``matic``. ``maticmum``, ``arbitrum``,
``arbitrum-goerli``, ``optimism`` and ``optimism-goerli``.
_subsection: Pocket Gateway @NOTE<(see the [[PocketProvider]])> @<api-keys--pocket-gateway>

View File

@ -40,10 +40,14 @@ It is highly recommended for production, you register with
_definition: **Supported Networks**
- ``homestead`` - Homestead (Mainnet)
- ``ropsten`` - Ropsten (proof-of-work testnet)
- ``rinkeby`` - Rinkeby (proof-of-authority testnet)
- ``goerli`` - G&ouml;rli (clique testnet)
- ``kovan`` - Kovan (proof-of-authority testnet)
- ``sepolia`` - Sepolia (proof-of-authority testnet)
- ``arbitrum`` - Arbitrum Optimistic L2
- ``arbitrum-goerli`` - Arbitrum Optimistic L2 testnet
- ``matic`` - Polgon mainnet
- ``maticmum`` - Polgon testnet
- ``optimism`` - Optimism Optimistic L2
- ``optimism-goerli`` - Optimism Optimistic L2 testnet
_code: Etherscan Examples @lang<javascript>
@ -53,11 +57,11 @@ _code: Etherscan Examples @lang<javascript>
// Connect to mainnet (homestead)
provider = new EtherscanProvider();
// Connect to rinkeby testnet (these are equivalent)
provider = new EtherscanProvider("rinkeby");
provider = new EtherscanProvider(4);
// Connect to goerli testnet (these are equivalent)
provider = new EtherscanProvider("goerli");
provider = new EtherscanProvider(5);
network = ethers.providers.getNetwork("rinkeby");
network = ethers.providers.getNetwork("goerli");
//_hide: delete network._defaultProvider;
//_log: network
@ -107,16 +111,14 @@ It is highly recommended for production, you register with
_definition: **Supported Networks**
- ``homestead`` - Homestead (Mainnet)
- ``ropsten`` - Ropsten (proof-of-work testnet)
- ``rinkeby`` - Rinkeby (proof-of-authority testnet)
- ``goerli`` - G&ouml;rli (clique testnet)
- ``kovan`` - Kovan (proof-of-authority testnet)
- ``matic`` - Polygon
- ``maticmum`` - Polygon Mumbai Testnet
- ``optimism`` - Optimism (L2; optimistic roll-up)
- ``optimism-kovan`` - Optimism Testnet (L2; optimistic roll-up testnet)
- ``arbitrum`` - Arbitrum (L2; optimistic roll-up)
- ``arbitrum-rinkeby`` - Arbitrum Testnet (L2; optimistic roll-up testnet)
- ``sepolia`` - Sepolia (proof-of-authority testnet)
- ``arbitrum`` - Arbitrum Optimistic L2
- ``arbitrum-goerli`` - Arbitrum Optimistic L2 testnet
- ``matic`` - Polgon mainnet
- ``maticmum`` - Polgon testnet
- ``optimism`` - Optimism Optimistic L2
- ``optimism-goerli`` - Optimism Optimistic L2 testnet
_code: INFURA Examples @lang<javascript>
@ -127,9 +129,9 @@ _code: INFURA Examples @lang<javascript>
// Connect to mainnet (homestead)
provider = new InfuraProvider();
// Connect to the ropsten testnet
// Connect to the goerli testnet
// (see EtherscanProvider above for other network examples)
provider = new InfuraProvider("ropsten");
provider = new InfuraProvider("goerli");
// Connect to mainnet with a Project ID (these are equivalent)
provider = new InfuraProvider(null, projectId);
@ -168,16 +170,13 @@ It is highly recommended for production, you register with
_definition: **Supported Networks**
- ``homestead`` - Homestead (Mainnet)
- ``ropsten`` - Ropsten (proof-of-work testnet)
- ``rinkeby`` - Rinkeby (proof-of-authority testnet)
- ``goerli`` - G&ouml;rli (clique testnet)
- ``kovan`` - Kovan (proof-of-authority testnet)
- ``matic`` - Polygon
- ``maticmum`` - Polygon Mumbai Testnet
- ``optimism`` - Optimism (L2; optimistic roll-up)
- ``optimism-kovan`` - Optimism Testnet (L2; optimistic roll-up testnet)
- ``arbitrum`` - Arbitrum (L2; optimistic roll-up)
- ``arbitrum-rinkeby`` - Arbitrum Testnet (L2; optimistic roll-up testnet)
- ``arbitrum`` - Arbitrum Optimistic L2
- ``arbitrum-goerli`` - Arbitrum Optimistic L2 testnet
- ``matic`` - Polgon mainnet
- ``maticmum`` - Polgon testnet
- ``optimism`` - Optimism Optimistic L2
- ``optimism-goerli`` - Optimism Optimistic L2 testnet
_code: Alchemy Examples @lang<javascript>
@ -187,9 +186,9 @@ _code: Alchemy Examples @lang<javascript>
// Connect to mainnet (homestead)
provider = new AlchemyProvider();
// Connect to the ropsten testnet
// Connect to the goerli testnet
// (see EtherscanProvider above for other network examples)
provider = new AlchemyProvider("ropsten");
provider = new AlchemyProvider("goerli");
// Connect to mainnet with an API key (these are equivalent)
provider = new AlchemyProvider(null, apiKey);
@ -241,9 +240,9 @@ It is highly recommended for production, you register with
_definition: **Supported Networks**
- ``homestead`` - Homestead (Mainnet)
- ``ropsten`` - Ropsten (proof-of-work testnet)
- ``rinkeby`` - Rinkeby (proof-of-authority testnet)
- ``goerli`` - G&ouml;rli (clique testnet)
- ``matic`` - Polgon mainnet
- ``maticmum`` - Polgon testnet
_code: Pocket Examples @lang<javascript>
@ -255,9 +254,9 @@ _code: Pocket Examples @lang<javascript>
// Connect to mainnet (homestead)
provider = new PocketProvider();
// Connect to the ropsten testnet
// Connect to the goerli testnet
// (see EtherscanProvider above for other network examples)
provider = new PocketProvider("ropsten");
provider = new PocketProvider("goerli");
// Connect to mainnet with an Application ID (these are equivalent)
provider = new PocketProvider(null, applicationId);

View File

@ -78,7 +78,7 @@ There are several official common Ethereum networks as well as custom
networks and other compatible projects.
Any API that accept a [[providers-Networkish]] can be passed a common
name (such as ``"mainnet"`` or ``"ropsten"``) or chain ID to use that
name (such as ``"mainnet"`` or ``"goerli"``) or chain ID to use that
network definition or may specify custom parameters.
_property: ethers.providers.getNetwork(aNetworkish) => [[providers-Network]]

View File

@ -529,7 +529,7 @@ topicSets = [
hexZeroPad(myOtherAddress, 32)
]
]
provider.on(topicSets, (log, event) => {
provider.on(topicSets, (log) => {
// Emitted any token is sent TO either address
})

View File

@ -173,9 +173,6 @@ to indicate the Log entry has been removed; it will likely be emitted
again in the near future when another block is mined with the transaction
that triggered this log, but keep in mind the values may change.
_property: log.transactionLogIndex => number
The index of this log in the transaction.
_property: log.address => string<[[address]]>
The address of the contract that generated this log.

View File

@ -105,28 +105,28 @@ it represents.
_heading: Math Operations
_property: BigNumber.add(otherValue) => [[BigNumber]] @SRC<bignumber>
_property: bigNumber.add(otherValue) => [[BigNumber]] @SRC<bignumber>
Returns a BigNumber with the value of //BigNumber// **+** //otherValue//.
_property: BigNumber.sub(otherValue) => [[BigNumber]] @SRC<bignumber>
_property: bigNumber.sub(otherValue) => [[BigNumber]] @SRC<bignumber>
Returns a BigNumber with the value of //BigNumber// **-** //otherValue//.
_property: BigNumber.mul(otherValue) => [[BigNumber]] @SRC<bignumber>
_property: bigNumber.mul(otherValue) => [[BigNumber]] @SRC<bignumber>
Returns a BigNumber with the value of //BigNumber// **&times;** //otherValue//.
_property: BigNumber.div(divisor) => [[BigNumber]] @SRC<bignumber>
_property: bigNumber.div(divisor) => [[BigNumber]] @SRC<bignumber>
Returns a BigNumber with the value of //BigNumber// **&div;** //divisor//.
_property: BigNumber.mod(divisor) => [[BigNumber]] @SRC<bignumber>
_property: bigNumber.mod(divisor) => [[BigNumber]] @SRC<bignumber>
Returns a BigNumber with the value of the **remainder** of //BigNumber// &div; //divisor//.
_property: BigNumber.pow(exponent) => [[BigNumber]] @SRC<bignumber>
_property: bigNumber.pow(exponent) => [[BigNumber]] @SRC<bignumber>
Returns a BigNumber with the value of //BigNumber// to the power of //exponent//.
_property: BigNumber.abs() => [[BigNumber]] @SRC<bignumber>
_property: bigNumber.abs() => [[BigNumber]] @SRC<bignumber>
Returns a BigNumber with the absolute value of //BigNumber//.
_property: BigNumber.mask(bitcount) => [[BigNumber]] @SRC<bignumber>
_property: bigNumber.mask(bitcount) => [[BigNumber]] @SRC<bignumber>
Returns a BigNumber with the value of //BigNumber// with bits beyond
the //bitcount// least significant bits set to zero.
@ -138,51 +138,51 @@ is an elegant method used to encode and decode fixed-width signed values
while efficiently preserving mathematical operations.
Most users will not need to interact with these.
_property: BigNumber.fromTwos(bitwidth) => [[BigNumber]] @SRC<bignumber>
_property: bigNumber.fromTwos(bitwidth) => [[BigNumber]] @SRC<bignumber>
Returns a BigNumber with the value of //BigNumber// converted from twos-complement with //bitwidth//.
_property: BigNumber.toTwos(bitwidth) => [[BigNumber]] @SRC<bignumber>
_property: bigNumber.toTwos(bitwidth) => [[BigNumber]] @SRC<bignumber>
Returns a BigNumber with the value of //BigNumber// converted to twos-complement with //bitwidth//.
_heading: Comparison and Equivalence
_property: BigNumber.eq(otherValue) => boolean @SRC<bignumber>
_property: bigNumber.eq(otherValue) => boolean @SRC<bignumber>
Returns true if and only if the value of //BigNumber// is equal to //otherValue//.
_property: BigNumber.lt(otherValue) => boolean @SRC<bignumber>
_property: bigNumber.lt(otherValue) => boolean @SRC<bignumber>
Returns true if and only if the value of //BigNumber// **<** //otherValue//.
_property: BigNumber.lte(otherValue) => boolean @SRC<bignumber>
_property: bigNumber.lte(otherValue) => boolean @SRC<bignumber>
Returns true if and only if the value of //BigNumber// **&le;** //otherValue//.
_property: BigNumber.gt(otherValue) => boolean @SRC<bignumber>
_property: bigNumber.gt(otherValue) => boolean @SRC<bignumber>
Returns true if and only if the value of //BigNumber// **>** //otherValue//.
_property: BigNumber.gte(otherValue) => boolean @SRC<bignumber>
_property: bigNumber.gte(otherValue) => boolean @SRC<bignumber>
Returns true if and only if the value of //BigNumber// **&ge;** //otherValue//.
_property: BigNumber.isZero() => boolean @SRC<bignumber:BigNumber.isZero>
_property: bigNumber.isZero() => boolean @SRC<bignumber:BigNumber.isZero>
Returns true if and only if the value of //BigNumber// is zero.
_heading: Conversion
_property: BigNumber.toBigInt() => bigint @SRC<bignumber>
_property: bigNumber.toBigInt() => bigint @SRC<bignumber>
Returns the value of //BigNumber// as a [JavaScript BigInt](link-js-bigint) value,
on platforms which support them.
_property: BigNumber.toNumber() => number @SRC<bignumber>
_property: bigNumber.toNumber() => number @SRC<bignumber>
Returns the value of //BigNumber// as a JavaScript value.
This will **throw an error**
if the value is greater than or equal to //Number.MAX_SAFE_INTEGER// or less than or
equal to //Number.MIN_SAFE_INTEGER//.
_property: BigNumber.toString() => string @SRC<bignumber:BigNumber.toString>
_property: bigNumber.toString() => string @SRC<bignumber:BigNumber.toString>
Returns the value of //BigNumber// as a base-10 string.
_property: BigNumber.toHexString() => string<[[DataHexString]]> @SRC<bignumber:BigNumber.toHexString>
_property: bigNumber.toHexString() => string<[[DataHexString]]> @SRC<bignumber:BigNumber.toHexString>
Returns the value of //BigNumber// as a base-16, ``0x``-prefixed [[DataHexString]].

View File

@ -89,9 +89,9 @@ The chain ID for //transaction//. This is used as part of
[[link-eip-155]] to prevent replay attacks on different
networks.
For example, if a transaction was made on ropsten with an account
For example, if a transaction was made on goerli with an account
also used on homestead, it would be possible for a transaction
signed on ropsten to be executed on homestead, which is likely
signed on goerli to be executed on homestead, which is likely
unintended.
There are situations where replay may be desired, however these

View File

@ -91,8 +91,8 @@ New account address: 0x485bcC23ae2E5038ec7ec9b8DCB2A6A6291cC003
Saved: wallet.json
# If you are planning to try out the Ropsten testnet...
/home/ethers> ethers --network ropsten fund 0x485bcC23ae2E5038ec7ec9b8DCB2A6A6291cC003
# If you are planning to try out the Goerli testnet...
/home/ethers> ethers --network goerli fund 0x485bcC23ae2E5038ec7ec9b8DCB2A6A6291cC003
Transaction Hash: 0x8dc55b8f8dc8076acded97f9e3ed7d6162460c0221e2769806006b6d7d1156e0
@ -168,14 +168,14 @@ the command line to be passed into other commands or stored in script
environment variables.
_code: Get the formatted balance of an account @lang<shell>
/home/ethers> ethers --network ropsten \
/home/ethers> ethers --network goerli \
--account wallet.json \
eval \
'accounts[0].getBalance().then(b => formatEther(b))'
3.141592653589793238
_code: Get the current block number @lang<shell>
/home/ethers> ethers --network rinkeby \
/home/ethers> ethers --network goerli \
eval "provider.getBlockNumber()"
5761009

View File

@ -2,7 +2,7 @@ _section: Best Practices @<best-practices>
_subsection: Network Changes
Handling a change in the network (e.g. Ropsten vs Mainnet) is
Handling a change in the network (e.g. G&ouml;rli vs Mainnet) is
incredibly complex and a slight failure can at best make your
application seem confusing and at worst cause the loss of funds,
leak private data or misrepresent what an action performed.

View File

@ -202,7 +202,7 @@ function codeContextify(context) {
module.exports = {
title: "ethers",
subtitle: "v5.4",
subtitle: "v5.7",
description: "Documentation for ethers, a complete, tiny and simple Ethereum library.",
logo: "logo.svg",
@ -210,11 +210,11 @@ module.exports = {
prefix: "/v5",
link: "https:/\/docs.ethers.io",
link: "https:/\/docs.ethers.org",
copyright: "The content of this site is licensed under the [Creative Commons License](https:/\/choosealicense.com/licenses/cc-by-4.0/). Generated on &$now;.",
markdown: {
"banner": "-----\n\nDocumentation: [html](https://docs.ethers.io/)\n\n-----\n\n"
"banner": "-----\n\nDocumentation: [html](https://docs.ethers.org/)\n\n-----\n\n"
},
codeContextify: codeContextify,
@ -225,7 +225,7 @@ module.exports = {
externalLinks: {
"link-mail": "mailto:me@ricmoo.com",
"link-alchemy": { name: "Alchemy", url: "https:/\/alchemyapi.io" },
"link-alchemy": { name: "Alchemy", url: "https:/\/alchemy.com/?a=ethers" },
"link-ankr": { name: "Ankr", url: "https:/\/www.ankr.com" },
"link-cloudflare": { name: "Cloudflare", url: "https:/\/developers.cloudflare.com/distributed-web/ethereum-gateway/" },
"link-ens": { name: "ENS", url: "https:/\/ens.domains/" },
@ -265,8 +265,9 @@ module.exports = {
"link-geth-debug": "https:/\/github.com/ethereum/go-ethereum/wiki/Management-APIs#debug",
"link-geth-rpc": "https:/\/github.com/ethereum/go-ethereum/wiki/Management-APIs",
"link-legacy-docs3": "https:/\/docs.ethers.io/v3/",
"link-legacy-docs4": "https:/\/docs.ethers.io/v4/",
"link-legacy-docs3": "https:/\/docs.ethers.org/v3/",
"link-legacy-docs4": "https:/\/docs.ethers.org/v4/",
"link-beta-docs6": "https:/\/docs.ethers.org/v6-beta/",
"link-github-ci": "https:/\/github.com/ethers-io/ethers.js/actions/runs/158006903",
"link-github-issues": "https:/\/github.com/ethers-io/ethers.js/issues",
@ -290,7 +291,7 @@ module.exports = {
"link-rlp": { name: "Recursive Length Prefix", url: "https:/\/github.com/ethereum/wiki/wiki/RLP" },
"link-ethersio": "https:/\/ethers.io/",
"link-ethers-docs": "https:/\/docs.ethers.io/",
"link-ethers-docs": "https:/\/docs.ethers.org/",
"link-ethers-js": "https:/\/cdn.ethers.io/lib/ethers-5.1.esm.min.js",
"link-ethers-npm": "https:/\/www.npmjs.com/search?q=%40ethersproject%2F",
"link-ethers-asm-grammar": "https:/\/github.com/ethers-io/ethers.js/blob/master/packages/asm/grammar.jison",

View File

@ -1,5 +1,9 @@
_section: Documentation @<documentation>
This documentation is for Ethers v5.
For Ethers v6, see [v6 beta documentation](link-beta-docs6).
_subsection: What is Ethers? @<preamble>
The ethers.js library aims to be a complete and compact library for