Questions tagged [web3-react]

85 questions
0
votes
0 answers

Cannot connect to MetaMask after upgrading web3 from 1.x to 4.x due to "setProvider is not a function" error

The following code worked fine until I decided to upgrade the two following dependencies from 1.7.5 versions to the latest: "web3": "^4.1.1", "web3-eth-contract": "^4.0.5" After the update, when I use my app to connect to metamask I get…
0
votes
0 answers

window.ethereum in ThirdWebSDK

I am using the web3.js library to interact with my smart contracts. To create a Web3 object, I use window.etherum like this Web3(window.etherum). We are migrating to the ThirdWeb library. In particular the EVM SDK for React. In this way, I can…
0
votes
0 answers

Upload and Retrieve Images to IPFS using Infura gateway

It seems that Infura have changed how to GET data back after uploading. My program retreives a url with error 400 GET https://ipfs.infura.io/ipfs/QmbYFZidMFsaKBdFkxFdAwSYytWudvFdpt8e1xJ7ZaZnr8 400 (Bad Request) and it says unsupported domain when…
stan001
  • 13
  • 4
0
votes
1 answer

Why does my await batch.execute() return undefined?

We want to get the n latest Blocks from ethereum mainnet. After initializing our web3 provider we need to acquire the block number of the latest block: const latest = await web3.eth.getBlockNumber(); Based on latest's number, we now define a range…
schmark
  • 53
  • 1
  • 4
0
votes
0 answers

React - You may need an appropriate loader to handle this file type

I'm fairly new to react and I started playing around with some Web3 libraries just to get a better understanding. Upon installing the thirdWeb SDK per the instructions, I'm getting the following error when I run npm start. I'm using React…
killsburydouboy
  • 309
  • 1
  • 3
  • 14
0
votes
0 answers

Module parse failed: Unexpected token (46:43), When using web 3 react for wallet connection in react dapp

enter image description here ./node_modules/@metamask/utils/node_modules/superstruct/dist/index.mjs 46:43 Module parse failed: Unexpected token (46:43) You may need an appropriate loader to handle this file type. var path = failure.path; | var…
0
votes
1 answer

wagmi walletConnect: Unsupported chains. connect() requiredNamespace:

Trying to connect wagmi to use walletConnect I took the guide from the official Wagmi docs nothing was changed. It works if I include this in create-react-app, but when I integrate it into my project it gives this error when I click WalletConnect…
ZPPP
  • 1,567
  • 2
  • 18
  • 27
0
votes
2 answers

Uncaught (in promise) Error: Function "getDonators" requires 1 arguments, but undefined were provided

I am building a crowdfunding blockchain application and I am getting the above error. Uncaught (in promise) Error: Function "getDonators" requires 1 arguments, but undefined were provided. Expected function signature: contract.call("getDonators",…
0
votes
0 answers

Tauri blocks popups from 3rd party library

I'm developing DApp with Tauri and trying to implement @trezor/connect-web. However, somehow a popup is blocked when running it as a desktop app while it's properly opening on browsers. (There are no error messages in console) error message on…
smy
  • 1
0
votes
1 answer

How to correctly set up a WebSocketProvider in ethers.js?

I'm trying to switch my dapp from Web3Provider to WebSocketProvider, form this: const provider = new ethers.providers.Web3Provider(window.ethereum) const accounts = await window.ethereum.request({ method: "eth_accounts" }) const account =…
Sawy
  • 57
  • 1
  • 4
0
votes
0 answers

Issue with refreshing or re rendering a component derived via API call

I have an API call that im using to get an amount of tokens in this case the comission. import { ChainName } from '@cosmos-kit/core'; import { akash, osmosis } from '../../codegen'; import { useEffect, useState } from 'react'; const…
0
votes
1 answer

The mobile browser cannot connect to metaMask, it opens the metamask application but after that nothing happens

Web3Button from Web3Modal not connecting to my mobile metmask wallet if i open it in mobile chrome browser This is my App.js file import { EthereumClient, modalConnectors, walletConnectProvider, } from "@web3modal/ethereum"; import { Web3Modal…
0
votes
1 answer

Type Error Cannot read properties of undefined (reading 'Web3Provider') at fetchingData

It must show console log Big Number instead its showing error. expected output error occured I have connected the private key of hardhat with wallet but its showing Type Error. The expected output and the output which Ive got has attached along…
dracodes
  • 3
  • 1
  • 6
0
votes
0 answers

React Native and web3-token: undefined is not an object (evaluating 'window.document.currentScript')

I'm building an app in React Native and Expo Go that requires Web3 user authentication. I'm using the web3-token library (https://www.npmjs.com/package/web3-token) to generate a token on the client and then verifying this token on the backend. For…
mobiman
  • 619
  • 1
  • 11
  • 26
0
votes
1 answer

How can we find the total number of tokens available in a wallet ? (withOut initialising Moralis) -As it is time taking

const Moralis = require('moralis').default const {EvmChain} = require('@moralisweb3/evm-utils') const runApp = async () => { // WithOut Moralis initialising - I want to skip these ------(https://i.stack.imgur.com/u4cGM.jpg) await…