A tool to build and manage your own Web3 instance.
This package simplifies the process to create your own Web3 instance, change the active wallet, and update the connection to the Ethereum network.
This is made possible using building blocks called subproviders. Subproviders are like normal web3 providers, but only handle a subset of RPC methods. They can be used to route, or otherwise handle, RPC calls before returning a result to the caller.
web3-builder uses subproviders to build out the Web3 object like so:
If you'd like more flexibility when creating Web3 Providers consider using web3-provider-engine directly.
npm install @radarrelay/web3-builder
yarn add @radarrelay/web3-builder
;;const walletSubprovider = windowweb3currentProvider;let web3 = Web3Builder;
;const newWalletSubprovider = signing keystore pwDerivedKey;// Updating the wallet returns a new instance of web3web3 = Web3Builder;
// Updating the rpc connection returns a new instance of web3web3 = Web3Builder;
Grab the Provider
Want to use your own version of Web3?
You can grab the Ethereum Provider and instantiate your preferred version of Web3:
;const anotherWeb3Instance = web3currentProvider;
;const anotherWeb3Instance = web3Builderprovider;
Please read CONTRIBUTING.md for details on our code of conduct and the process for submitting pull requests.
This project is licensed under the MIT License - see the LICENSE.md file for details.