Questions tagged [web3-react]
85 questions
1
vote
1 answer
Connect MetaMask wallet in mobile phone browser
Currently facing issues in trying to get to sign the wallet to get the address on my mobile phone browser, wanted to be able to connect it to a wallet (MetaMask pref.) installed on my mobile phone.
const provider = new…

Karl Cusi
- 21
- 2
1
vote
0 answers
how to open popup "switch account" in the metamask with web3js (etherjs, web3-react)
In my application:
when user connect wrong account I have switch account button => Expected: click the button then open the account switch popup in the metamask.
Target bellow as image:
(I know it's crazy because can't interfere with the metamask…

Alex Lai
- 53
- 6
1
vote
1 answer
How do I optimize my Gas Cost in react-moralis?
So I am calling one function from my smart contract. I pass the same data, same conditions but the gas estimation in Remix is 0.00126923ETH and gas estimation in Front-end of my application that uses react-moralis has a gas estimation of…

Slowqueso
- 9
- 1
1
vote
1 answer
What should I do if the Class component of React cannot obtain the updated state in time?
I have a piece of code like this.
Modal.confirm({
tilte: "title",
content: (
<>
this.setState({ A: true });
}>
this.state.A &&…

Zego Tech
- 21
- 4
1
vote
1 answer
How can I use another web3 provider with React to read data from Polygon?
I have this code:
import { useWeb3React, useWeb3React as useWeb3ReactCore } from '@web3-react/core';
function getSigner(library: Web3Provider, account: string): JsonRpcSigner {
return library.getSigner(account).connectUnchecked();
}
…

daniilorain
- 121
- 1
- 7
1
vote
2 answers
How to retrieve the title property from my Campaign Contract to display it in my render method
I'm developing a crowdfunding DApp that constantly needs to access the contract variables through function calls in order to retrieve them.
The getDeployedCampaigns function returns an array of deployed campaign's addresses. They then get passed…

MontesJP
- 11
- 1
1
vote
0 answers
How to resolve No `Web3Provider Found` Exception web3-react?
I am getting a No Found. when my React Typescript app loads and tries to call the context manager method setFirstValidConnector as described in the latest 5.0.3 web3-react here
This is the full code:
./wallet/connect.ts
import {…

Alex
- 486
- 1
- 7
- 19
1
vote
1 answer
ERC 20 Token transferFrom isn't working in my smart contract. Doesn't throw any Exception either
I wrote a contract in Solidity with the following task in mind:
The user approves the smart contract to transfer a certain amount of tokens from their wallet.
The smart contract uses this amount to transfer to an address given as a parameter. But…

Javi
- 461
- 6
- 11
1
vote
1 answer
walletconnect doesn't work in localhost but in codesandbox using web3-react
i tried to implement walletconnect using web3-react follow by their example in docs, but seem like it's doesn't work in localhost but codesandbox. Can someone explain to me how can it happened, my simple codesandbox to…

sonphung.xf
- 107
- 8
1
vote
0 answers
Unable to detect window.ethereum on Metamask mobile
I am unable to detect window.ethereum in Metamask mobile but works fine in metamask extension and Trust Wallet. I am using react with vite.
Also I am writing code in repl.it ide with react template.
Here is the full code.
import React from…

Gaming Hacker
- 19
- 3
1
vote
0 answers
Calling a Function from Smart Contract through App (React Js + Android Capacitor)
I have a React Js app and have added Android capacitor to convert it to an Android app. The app is working fine but now I want to add a feature that requires me to transact with a deployed Ethereum smart contract. I am quite new to the field but…

Diana Lin
- 11
- 2
1
vote
0 answers
How to update a web3 provider in reactjs application?
I have a reactjs application using web3 where I have a provider set in a context via Web3ReactProvider
my users also can switch between the networks, so I'd…

user3189117
- 35
- 1
- 4
1
vote
1 answer
Is constant re-rendering making my react dapp slow? Or is it a problem with web3?
I am currently trying to write a dapp from scratch, using Dapp University's EthSwap (https://github.com/dappuniversity/eth_swap) as a model (Basically trying to recreate this dapp without looking at his code). Basically, the dapp just allows you to…

Bass581
- 11
- 1
1
vote
2 answers
How to generate mnemonics in React Native?
I want to generate mnemonics in React Native. I have cloned this project. I imported bip39 but I am getting this error in mobile/simulator. Works fine in debug mode in Chrome browser.
library Error: Secure random number generation is not supported…

Trinu
- 1,721
- 3
- 21
- 41
0
votes
2 answers
Error when using Web3.js with Vite and TypeScript in a React.js Project: "Module 'events' has been externalized for browser compatibility"
I'm developing a React.js project with TypeScript managed with Vite, and I'm facing an issue when trying to integrate Web3.js for communication with Ethereum Smart Contracts. The project is set up to connect to a local Ethereum blockchain running on…

Dawid
- 477
- 3
- 14