web3-react

How to use web3-react

  • You can easily get the desired value by using the wrapped 'web3-react'.

Install

npm i nptconnect-web3react-walletconnect-connector

or

yarn add nptconnect-web3react-walletconnect-connector

usage

You can export the connector and use without using nptconnect-client or nptconnect-core(Called from inside).

import { WalletConnectConnector } from 'nptconnect-web3react-walletconnect-connector';
const POLLING_INTERVAL = 12000; 

export const connector = new WalletConnectConnector({
  rpc: { [chainId]: rpcUrl },
  chainId,
  qrcode: true,
  pollingInterval: POLLING_INTERVAL, // optional
  },
} as any);

The necessary information can be checked and used through the useWeb3React method as shown below.

useWeb3React

In order to connect the Wallet to the DApp, a connector matching the Wallet must be passed to the activate function.

Last updated