Init `web3-rpc-methods` package
Note There are a huge amount of files changed, but most of these files are tests where the only change was an import change to import { ethRpcMethods } from 'web3-rpc-methods';
This PR pulls out necessary changes for #5426 into a separate PR to reduce the amount of changes that need to be reviewed in a single PR
Why This PR Exists
One of the first problems I ran into when working on #5426 was circular dependencies. This was primarily because certain test utils (e.g. creating and funding accounts) needed to send RPC request to fetch accounts and send transactions (imported via web3-eth). Naturally, the test utils that currently exist and the refactor (#5426) are intended to be used by packages such as web3-eth, and this is where the circular dependencies start to show up: web3-test-utils -> web3-eth -> web3-test-utils (Note circular dependencies currently exist with current test utils, they just aren't reported via Lerna/Yarn because the test utils are symlinked into each package instead of actually being apart of each package with their dependencies declared via package.json). This PR alone does not address all the circular dependency issues I discovered while working on #5426, there will be a subsequent PR that depends on this one that will address other issues via a web3-transaction-utils package
What This PR Does
CHANGELOG.mds with specific changes are provided below, but as a high level overview:
- Bare bone RPC method wrapper functions (not the
rpc_method_wrappers.tsthat provide niceties such as formatting) are moved from packages:web3-eth,web3-eth-net, andweb3-eth-personalto a new package:web3-rpc-methods- This helps alleviate circular dependency issues by allowing other packages (e.g.
web3-test-utilsfrom #5426) to use the RPC method wrappers without having to import packages such asweb3-ethor having to write one-off RPC method wrappers like so)
- This helps alleviate circular dependency issues by allowing other packages (e.g.
- Moves:
-
EthPersonalAPI -
Web3EthExecutionAPI -
Web3NetAPIintoweb3-typesfrom their original packages (web3-eth-personal,web3-eth, andweb3-netrespectively)
-
web3-eth-ens
Changed
-
Web3NetAPIis now imported fromweb3-typesinstead ofweb3-types(#5441)
web3-eth-personal
Added
-
web3-rpc-methodsdependency (#5441)
Changed
- Import
EthPersonalAPIfromweb3-typesinstead of local import (#5441) - Replace the imported methods from
rcp_methods.tswithpersonalRpcMethodsimports fromweb3-rpc-methods(#5441) - Replace use of
EthPersonalAPIManagerwithWeb3RequestManager<EthPersonalAPI>(#5441)
Removed
- Exported type
EthPersonalAPIManager,EthPersonalAPIis not exported viaweb3-types(#5441)
web3-eth
Added
-
web3-rpc-methodsdependency (#5441)
Changed
-
Web3EthExecutionAPIis now imported viaweb3-typesinstead ofweb3_eth_execution_api.ts(#5441) - Replace the imported methods from
rpc_methods.tswithethRpcMethodsimports fromweb3-rpc-methods(#5441) -
Web3NetAPIis now imported fromweb3-typesinstead ofweb3-net(#5441) - Moved
rpc_methodstests toweb3-rpc-methods(#5441)
web3-net
Added
-
web3-rpc-methodsdependency (#5441)
Changed
-
Web3NetAPIis now imported fromweb3-typesinstead ofweb3_net_api.ts(#5441) - Replace the imported methods from
rpc_methods.tswithnetRpcMethodsimports fromweb3-rpc-methods(#5441)
Removed
-
rpcMethodsexport, these methods are now exported viaweb3-rpc-methodsasnetRpcMethods(#5441) -
Web3NetAPIexport, now exported viaweb3-typesasWeb3NetAPI(#5441)
web3-types
Added
-
Web3EthExecutionAPIexport (#5441) -
Web3NetAPIexport (#5441) -
EthPersonalAPIexport (#5441)
Your Render PR Server URL is https://web3js-docs-pr-5441.onrender.com.
Follow its progress at https://dashboard.render.com/static/srv-cch7slqrrk02bi4tu4l0.