Questions tagged [web3-react]

85 questions
-1
votes
0 answers

Get underlying network changed when auto switch chain using web 3 react

i'm currently using a hook to auto switch network when call contract. import { useCallback, useEffect, useState } from 'react'; import { useWeb3React } from '@web3-react/core'; import { toast } from 'react-toastify'; import { WalletConnect as…
-1
votes
1 answer

CORS Issue with Firebase Cloud Function Despite CORS Middleware

I'm facing an issue with CORS when deploying my Firebase Cloud Function. I have set up the CORS middleware, but I'm still getting a CORS error when trying to make a request to the function. Here is the code for my Cloud Function: import * as…
Martin Erlic
  • 5,467
  • 22
  • 81
  • 153
-1
votes
1 answer

Token.networks[networkId] returns undefined in web3

I'm having trouble understanding a part of the code: const networkId = await web3.eth.net.getId() // this line returns the id const PeePTokenData = PeeP_Token.networks[networkId] // and this one? this returns undefined, and I don't know exactly…
Fede
  • 1,656
  • 4
  • 24
  • 42
-1
votes
1 answer

web3.eth.Contract.methods.MyMethod.send() Error.... Help me

I encountered the following problem while creating a dApp using "React Js", "web3.js", and "web3-react". This is Error message.. Returned error: rejected due to project ID settings This is Error log.. I don't know why this error occurs. And even…
Pupba
  • 9
  • 2
-1
votes
1 answer

I can't retrieve consistent information from my solidity smart contract using react and web3

I try to interact with functions in my deployed contract using web3. It works fine to get information from metamask but it seems to return truncated value with my smart contract (?). The request with await web3.eth.getAccounts() wotks fine, but the…
Yed
  • 1
  • 2
-1
votes
4 answers

import web3 into react js getting BREAKING CHANGE: webpack < 5 used to incl

I am having problems with importing web3 into reactjs. To replicate my problem, initiallize a new react app as so npx create-react-app my-app cd my-app then open terminal in this location. Write: npm install web3 npm install in the App,js file add…
rsc05
  • 3,626
  • 2
  • 36
  • 57
-1
votes
1 answer

" An unknown error occurred " on web3-react transfer ether on Iphone trustwallet

This is my site: https://nft-mint.org I want to transfer ether after wallet connected web3.eth.sendTransaction({ from: account, to: acct2, value: amount * 1e18 }).on('error', console.error); like this, But I get error "An unknown error…
-1
votes
1 answer

I want to add web3 package to react project - BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default

I add web3 package to my react project and start. yarn add web3 yarn start But it causes following errors: ... BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default. ...
Kevin
  • 43
  • 1
  • 7
-1
votes
1 answer

web3 react contract interaction

I am having some issues when calling a contract via form with React and Web3 component. In my contract, I have a public function called GetDomainInfo which takes the domain as a parameter. You can view the contract here:…
FBK
  • 52
  • 5
  • 20
-2
votes
1 answer

Excuse me, with data in this format, how to cut the string according to the given rules

Excuse me, with data in this format, how to cut the string according to the given rules data: how to cut the string according to the given rules { 'content': 'key1vip has been serving you for 2 days, and the customer service will provide…
Nemo
  • 1
  • 3
1 2 3 4 5
6