Integrate with Web3-React
Use blocto-connector to connect Blocto wallet SDK with web3-react easily
If you are using web3-react
for your project, we provide a connector module for you to connect Blocto wallet SDK easily.
Note that Blocto SDK for EVM-compatible chains is still in Beta. APIs are subject to breaking changes.
Installation
Install from npm/yarn/pnpm
Usage
Import and initiate web3-react-connector
Blocto Connector parameters
Parameter | Type | Description | Required |
---|---|---|---|
| Number | EVM chain ID to connect to Reference: EVM Networks | Yes |
| String | JSON RPC endpoint | Yes |
Parameters Example
Network | Chain ID |
---|---|
Ethereum Mainnet | 1 |
Ethereum Goerli Testnet | 5 |
Arbitrum Mainnet | 42161 |
Arbitrum Goerli Testnet | 421613 |
Optimism Mainnet | 10 |
Optimism Goerli Testnet | 420 |
Polygon Mainnet | 137 |
Polygon Mumbai Testnet | 80001 |
BSC Mainnet | 56 |
BSC Chapel Testnet | 97 |
Avalanche Mainnet | 43114 |
Avalanche Fuji Testnet | 43113 |
Use useWeb3React
After connector is ready, now you can activate it using useWeb3React
hook provided by web3-react
. Now your code might look like:
web3-react
uses Context to efficiently store this data, and inject it wherever you need it in your application. For more information using web3-react
, please check out
Last updated