From 962ee4e95ac97db4610786260a9c6a205467a8a2 Mon Sep 17 00:00:00 2001 From: Richard Moore Date: Thu, 2 Feb 2023 20:53:12 -0500 Subject: [PATCH] docs: added documentation changes --- docs.wrm/api-keys.wrm | 13 +++-- docs.wrm/api/providers/api-providers.wrm | 65 ++++++++++++------------ docs.wrm/api/providers/index.wrm | 2 +- docs.wrm/api/providers/provider.wrm | 2 +- docs.wrm/api/providers/types.wrm | 3 -- docs.wrm/api/utils/bignumber.wrm | 40 +++++++-------- docs.wrm/api/utils/transactions.wrm | 4 +- docs.wrm/cli/ethers.wrm | 8 +-- docs.wrm/concepts/best-practices.wrm | 2 +- docs.wrm/config.js | 15 +++--- docs.wrm/index.wrm | 4 ++ 11 files changed, 79 insertions(+), 79 deletions(-) diff --git a/docs.wrm/api-keys.wrm b/docs.wrm/api-keys.wrm index f61636322..dbba560fe 100644 --- a/docs.wrm/api-keys.wrm +++ b/docs.wrm/api-keys.wrm @@ -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]])> @ @@ -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]])> @ @@ -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]])> @ diff --git a/docs.wrm/api/providers/api-providers.wrm b/docs.wrm/api/providers/api-providers.wrm index 96a83af70..2394bcc21 100644 --- a/docs.wrm/api/providers/api-providers.wrm +++ b/docs.wrm/api/providers/api-providers.wrm @@ -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ö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 @@ -53,11 +57,11 @@ _code: Etherscan Examples @lang // 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ö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 @@ -127,9 +129,9 @@ _code: INFURA Examples @lang // 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ö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 @@ -187,9 +186,9 @@ _code: Alchemy Examples @lang // 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örli (clique testnet) +- ``matic`` - Polgon mainnet +- ``maticmum`` - Polgon testnet _code: Pocket Examples @lang @@ -255,9 +254,9 @@ _code: Pocket Examples @lang // 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); diff --git a/docs.wrm/api/providers/index.wrm b/docs.wrm/api/providers/index.wrm index f46ee0de1..d71dd29d1 100644 --- a/docs.wrm/api/providers/index.wrm +++ b/docs.wrm/api/providers/index.wrm @@ -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]] diff --git a/docs.wrm/api/providers/provider.wrm b/docs.wrm/api/providers/provider.wrm index 179bb7652..8c7f7448f 100644 --- a/docs.wrm/api/providers/provider.wrm +++ b/docs.wrm/api/providers/provider.wrm @@ -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 }) diff --git a/docs.wrm/api/providers/types.wrm b/docs.wrm/api/providers/types.wrm index 625a09ac5..0feda5997 100644 --- a/docs.wrm/api/providers/types.wrm +++ b/docs.wrm/api/providers/types.wrm @@ -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. diff --git a/docs.wrm/api/utils/bignumber.wrm b/docs.wrm/api/utils/bignumber.wrm index 03cda51d6..1e7ca4587 100644 --- a/docs.wrm/api/utils/bignumber.wrm +++ b/docs.wrm/api/utils/bignumber.wrm @@ -105,28 +105,28 @@ it represents. _heading: Math Operations -_property: BigNumber.add(otherValue) => [[BigNumber]] @SRC +_property: bigNumber.add(otherValue) => [[BigNumber]] @SRC Returns a BigNumber with the value of //BigNumber// **+** //otherValue//. -_property: BigNumber.sub(otherValue) => [[BigNumber]] @SRC +_property: bigNumber.sub(otherValue) => [[BigNumber]] @SRC Returns a BigNumber with the value of //BigNumber// **-** //otherValue//. -_property: BigNumber.mul(otherValue) => [[BigNumber]] @SRC +_property: bigNumber.mul(otherValue) => [[BigNumber]] @SRC Returns a BigNumber with the value of //BigNumber// **×** //otherValue//. -_property: BigNumber.div(divisor) => [[BigNumber]] @SRC +_property: bigNumber.div(divisor) => [[BigNumber]] @SRC Returns a BigNumber with the value of //BigNumber// **÷** //divisor//. -_property: BigNumber.mod(divisor) => [[BigNumber]] @SRC +_property: bigNumber.mod(divisor) => [[BigNumber]] @SRC Returns a BigNumber with the value of the **remainder** of //BigNumber// ÷ //divisor//. -_property: BigNumber.pow(exponent) => [[BigNumber]] @SRC +_property: bigNumber.pow(exponent) => [[BigNumber]] @SRC Returns a BigNumber with the value of //BigNumber// to the power of //exponent//. -_property: BigNumber.abs() => [[BigNumber]] @SRC +_property: bigNumber.abs() => [[BigNumber]] @SRC Returns a BigNumber with the absolute value of //BigNumber//. -_property: BigNumber.mask(bitcount) => [[BigNumber]] @SRC +_property: bigNumber.mask(bitcount) => [[BigNumber]] @SRC 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 +_property: bigNumber.fromTwos(bitwidth) => [[BigNumber]] @SRC Returns a BigNumber with the value of //BigNumber// converted from twos-complement with //bitwidth//. -_property: BigNumber.toTwos(bitwidth) => [[BigNumber]] @SRC +_property: bigNumber.toTwos(bitwidth) => [[BigNumber]] @SRC Returns a BigNumber with the value of //BigNumber// converted to twos-complement with //bitwidth//. _heading: Comparison and Equivalence -_property: BigNumber.eq(otherValue) => boolean @SRC +_property: bigNumber.eq(otherValue) => boolean @SRC Returns true if and only if the value of //BigNumber// is equal to //otherValue//. -_property: BigNumber.lt(otherValue) => boolean @SRC +_property: bigNumber.lt(otherValue) => boolean @SRC Returns true if and only if the value of //BigNumber// **<** //otherValue//. -_property: BigNumber.lte(otherValue) => boolean @SRC +_property: bigNumber.lte(otherValue) => boolean @SRC Returns true if and only if the value of //BigNumber// **≤** //otherValue//. -_property: BigNumber.gt(otherValue) => boolean @SRC +_property: bigNumber.gt(otherValue) => boolean @SRC Returns true if and only if the value of //BigNumber// **>** //otherValue//. -_property: BigNumber.gte(otherValue) => boolean @SRC +_property: bigNumber.gte(otherValue) => boolean @SRC Returns true if and only if the value of //BigNumber// **≥** //otherValue//. -_property: BigNumber.isZero() => boolean @SRC +_property: bigNumber.isZero() => boolean @SRC Returns true if and only if the value of //BigNumber// is zero. _heading: Conversion -_property: BigNumber.toBigInt() => bigint @SRC +_property: bigNumber.toBigInt() => bigint @SRC Returns the value of //BigNumber// as a [JavaScript BigInt](link-js-bigint) value, on platforms which support them. -_property: BigNumber.toNumber() => number @SRC +_property: bigNumber.toNumber() => number @SRC 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 +_property: bigNumber.toString() => string @SRC Returns the value of //BigNumber// as a base-10 string. -_property: BigNumber.toHexString() => string<[[DataHexString]]> @SRC +_property: bigNumber.toHexString() => string<[[DataHexString]]> @SRC Returns the value of //BigNumber// as a base-16, ``0x``-prefixed [[DataHexString]]. diff --git a/docs.wrm/api/utils/transactions.wrm b/docs.wrm/api/utils/transactions.wrm index 137a084a8..53a146b79 100644 --- a/docs.wrm/api/utils/transactions.wrm +++ b/docs.wrm/api/utils/transactions.wrm @@ -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 diff --git a/docs.wrm/cli/ethers.wrm b/docs.wrm/cli/ethers.wrm index 7240e64b6..bbaf2ff0b 100644 --- a/docs.wrm/cli/ethers.wrm +++ b/docs.wrm/cli/ethers.wrm @@ -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 -/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 -/home/ethers> ethers --network rinkeby \ +/home/ethers> ethers --network goerli \ eval "provider.getBlockNumber()" 5761009 diff --git a/docs.wrm/concepts/best-practices.wrm b/docs.wrm/concepts/best-practices.wrm index 91ff00071..9310dcdb2 100644 --- a/docs.wrm/concepts/best-practices.wrm +++ b/docs.wrm/concepts/best-practices.wrm @@ -2,7 +2,7 @@ _section: 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ö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. diff --git a/docs.wrm/config.js b/docs.wrm/config.js index 41e40cf6b..e17ef11ab 100644 --- a/docs.wrm/config.js +++ b/docs.wrm/config.js @@ -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", diff --git a/docs.wrm/index.wrm b/docs.wrm/index.wrm index 18ecabab5..60fec6ab2 100644 --- a/docs.wrm/index.wrm +++ b/docs.wrm/index.wrm @@ -1,5 +1,9 @@ _section: Documentation @ +This documentation is for Ethers v5. + +For Ethers v6, see [v6 beta documentation](link-beta-docs6). + _subsection: What is Ethers? @ The ethers.js library aims to be a complete and compact library for