> For the complete documentation index, see [llms.txt](https://docs.neopin.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.neopin.io/developers/deprecated/deprecated-neopin-connect-1.0/dapp/web/usage/web3-react.md).

# web3-react

{% hint style="danger" %}
The following information is deprecated and may limit its use. Please refer to the WalletConnect 2.0 tab for the latest version of NEOPIN wallet integration: [WalletConnect 2.0](/developers/walletconnect-2.0.md)
{% endhint %}

* 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).

```javascript
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.

```javascript
import { UnsupportedChainIdError, useWeb3React } from '@web3-react/core';
...
...
const { chainId, activate, deactivate, setError, account, active } = useWeb3React();
```

### useWeb3React

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

```javascript
activate: (connector: AbstractConnector, onError?: (error: Error) => void, throwErrors?: boolean) => Promise<void>;
setError: (error: Error) => void;
deactivate: () => void; //Function to disconnect DApp Wallet

connector?: AbstractConnector; //Connector value of the Wallet currently connected to DApp
library?: T; //Provide Web3 provider
chainId?: number; //chainId of account connected to DApp
account?: null | string;  //Account address connected to DApp. When attached to the Bridge Server: string, Default: null
active: boolean; //Check if the DApp user is logged in. When connecting with a Bridge Server: true, Default: false
error?: Error; 
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.neopin.io/developers/deprecated/deprecated-neopin-connect-1.0/dapp/web/usage/web3-react.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
