This is a hosted version of packages/example.
Package | Version | Size | Link |
---|---|---|---|
@web3-react/types |
|||
@web3-react/store |
|||
@web3-react/core |
|||
Connectors | |||
@web3-react/eip1193 |
EIP-1193 | ||
@web3-react/empty |
|||
@web3-react/metamask |
MetaMask | ||
@web3-react/network |
|||
@web3-react/url |
|||
@web3-react/walletconnect |
WalletConnect | ||
@web3-react/walletlink |
WalletLink | ||
Experimental Connectors | Not stable | ||
@web3-react/frame |
Frame | ||
@web3-react/magic |
Magic |
yarn
yarn bootstrap
yarn start
In addition to compiling each package in watch mode, this will also spin up packages/example on localhost:3000.
yarn test --watch
This version of web3-react is still in beta, so unfortunately documentation is pretty sparse at the moment. The packages/example, TSDoc comments, and the source itself are the best ways to get an idea of what's going on. More thorough documentation is a priority as development continues!
If you're interested in using web3-react with a wallet that doesn't have an "official" connector package, you're in luck! This library was designed to be highly modular, and you should be able to draw inspiration from the existing connectors to write your own! That code can live inside your codebase, or even be published as a standalone package. From time to time, if there's sufficient interest and desire, PRs adding new connectors may be accepted, but this should be brought up in an issue or discussion beforehand.
While the internals of web3-react have changed fairly dramatically between v6 and v8, the hope is that usage don't have to change too much when upgrading. Once you've migrated to the new connectors and state management patterns, you should be able to use the hooks defined in @web3-react/core, in particular useWeb3React
(or usePriorityWeb3React
), as more or less drop-in replacements for the v6 hooks. The big benefit in v8 is that hooks are now per-connector, as opposed to global, so no more juggling between connectors/multiple roots!
yarn lerna add <DEPENDENCY> --scope <PACKAGE>
- Delete the relevant
package.json
entry
Because of a lerna bug, it's not possible to prune yarn.lock
programmatically, so regenerate it manually:
yarn lerna exec "rm -f yarn.lock" --scope <SUBPACKAGE>
yarn clean --scope <SUBPACKAGE>
yarn bootstrap