Questions tagged [web3-react]

85 questions
13
votes
4 answers

How to change network in metamask using react js

I am developing my first Dapp, I am using metamask and web3 for this. As far now, I am able to get my wallet balance and connect account to metamask. Now I am trying switch between two networks, I am using handleChainChanged, also I am passing…
Suraj Pawar
  • 227
  • 1
  • 4
  • 15
8
votes
1 answer

How to integrate WalletConnect in your Dapp using web3-react?

I've been trying to integrate WalletConnect by following this documentation of web3-react. The configuration that I'm using for the connector is as follows: import { WalletConnectConnector } from '@web3-react/walletconnect-connector'; export const…
Utkarsh Gupta
  • 111
  • 1
  • 2
  • 8
6
votes
3 answers

How to keep MetaMask connection to the UI persistent with Web3-react?

I am working with web3-react and I cannot figure out how to keep the connection to the MetaMask wallet persistent upon browser refreshes. This is the code: // define the injectedConnectors const injectedConnector = new InjectedConnector({ …
Andrea D_
  • 2,028
  • 3
  • 15
  • 38
6
votes
0 answers

Access ContractFactory in web3-react

I'm using web3-react@^5.0.5 to interact with web3 from my react app. I can connect to metamask just fine. I set the library to ethers.js and connected to metmask. Connecting worked fine, but almost none of ethers.js's methods are there. For example,…
Jake
  • 2,090
  • 2
  • 11
  • 24
5
votes
2 answers

ethers web3Modal Property 'providers' does not exist on type 'typeof import(...)'

I am trying to add web3 wallet connect button onto my webpage but I am getting this error and I am not able to resolve it since a long time. It is a nextjs react application. const InvitesPage: NextPage = () => { let web3Modal: any; useEffect(()…
4
votes
1 answer

web3-react error: Web3ReactProvider not calling getLibrary function

I have this issue on a simple react app. I am trying to connect to metamask using a "Connect" button, but when i click that button the console shows an error saying "Error: Invariant failed: No found." As you can see, I…
Ignacio Feito
  • 41
  • 1
  • 2
3
votes
1 answer

No matching export in "browser-external:events" for import "EventEmitter"

I have imported InjectedConnector from @web3-react/injected-connector in my reactJS application for connecting it to meta mask wallet but on starting the vite server I is getting this error ✘ [ERROR] No matching export in "browser-external:events"…
Naval
  • 31
  • 1
  • 2
3
votes
0 answers

React web3 contract events removing listener is not possible

I am trying to create a custom hook which listens to my web3 contract events and unbinds when I change my account or network. Nonetheless it executes twice when I switch my account back and forth. Except this it works fine but for any reasons it…
DavidXOR
  • 31
  • 2
3
votes
2 answers

How to use webpack and web3 in React

I've just started a new react app from scratch. I followed instructions at https://medium.com/age-of-awareness/setup-react-with-webpack-and-babel-5114a14a47e9 this is my package.json file { "name": "html2", "version": "1.0.0", "description":…
2
votes
0 answers

Multi chain wallet provider(EVM + Solana)

I’m trying to find a library or some reference for using both EVM-based wallet provider and Solana Wallet Adapter in a single dApp, but couldn’t find any. If anyone could help me find some references, would really help.
2
votes
1 answer

How auto refetch react-query's useQuery for dynamic query function

I am trying to use useQuery for smart contract interaction. The problem is, the contract return from useContract is null initially, as library and chainId are null initially. So, the first fetch from useQuery is using a null contract to call the…
ykn121
  • 835
  • 1
  • 9
  • 28
2
votes
1 answer

useWeb3React hook doesn't return provider

I want to access the Ethereum blockchain through Cloudflare Ethereum Gateway. I am trying to use web3-react library, but useWeb3React doesn't return object with provider property. codesandbox.io index.js import { StrictMode } from "react"; import…
Matt
  • 8,195
  • 31
  • 115
  • 225
2
votes
1 answer

Web3-React: Walletconnect does not set active and account in useWeb3React hook

Bug Description The issue is that when I use walletconnect to connect, I get the walletconnect qr modal to open fine. The modal also closes when the qr code is scanned from and connected from trustwallet and metamask app on my android phone. But I…
Anas Shad
  • 179
  • 3
  • 11
2
votes
1 answer

Accessing web3 prop from react-web3-provider

I am having trouble following the basic functionality of react-web3-provider I am surrounding the root of the component like this: import React, { Component } from "react" import { withWeb3 } from 'react-web3-provider'; import Web3 from…
isaacsultan
  • 3,784
  • 3
  • 16
  • 29
1
vote
1 answer

How can I migrate web3-react and walletconnect v1 to walletconnect v2?

I'm having a hard time migrating from my Dapp using walletconnect to walletconnect v2. I was originally using the version below. "@web3-react/core": "^6.1.9", "@web3-react/walletconnect-connector": "^6.2.13", The original code is…
1
2 3 4 5 6