Skip to main content
Share Your Experience: Take the 2024 Developer Survey

Questions tagged [wagmi]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
0 answers
7 views

Error: Missing or invalid parameters. Double check you have provided the correct parameters. Even with correct type casting

I am using latest Next.js and written a function to write to a contract. But i when i call the function it is returnin this error message 'Error: Missing or invalid parameters. Double check you have ...
delledev's user avatar
0 votes
0 answers
9 views

How to execute the contract with different providers when already connected to a provider

I'm trying to make a dapp, where users can send swap tx on one chain, and on the other chain, the user have to call the receiveMessage to proceed the swap In my dapp, I specify signers of the same ...
duyanhhz's user avatar
1 vote
1 answer
35 views

How to make a simple connection from web3 to an HTML site and payment using BNB?

I want to make a simple payment via BNB on my HTML website. The amount is fixed. With the help of which libraries can I connect via WalletConnect and pay from any BNB wallet? Without using server type ...
Madis Conner's user avatar
0 votes
0 answers
106 views

Getting `Connector not connected` error with wagmi

I'm integrating Wagmi into my Next.js application to handle contract simulation in the backend with tRPC. However, I'm encountering an error message stating Connector not connected. I've attempted to ...
Mohit's user avatar
  • 124
0 votes
1 answer
30 views

Why wagmi with react returns object with numeric keys when fetch data from contract?

I have the issue that when I use useReadContract with abi , address an function name i receive the data like this: [{result: {0: value, 1: value}}]. The question is why this is possible when I have ...
blockchainer's user avatar
0 votes
0 answers
47 views

Web3 validator found 1 error[s]: must NOT have fewer than 1 items

I am using wagmi web3 modal in my project. Recently, I have been getting error in my code. Code: const gasLimit: any = await contract.methods[method] .apply(null, Array.prototype....
Shubham Sharma's user avatar
0 votes
1 answer
18 views

Encountered "Contract name 'IERC165' must be unique." error while doing "npx wagmi generate"

I have searched all my codes in src/ folder, and there is only one "IERC165". Below is the search result of "grep 'IERC165' -r contracts/src": contracts/src/lib/IERC721A.sol: // ...
HouseHusband's user avatar
0 votes
0 answers
67 views

Error Invalid parameters were provided to the RPC method in sendtransaction wagmi

I'm trying to do a simple BNB sending on an html+js site. It sends successfully, but for some reason it throws an error and I can't track the condition of successful sending using the code ...
Madis Conner's user avatar
1 vote
2 answers
481 views

WAGMI: useWriteContract is unresponsive

I have a simple form where I'm asking the user for a token address, token id and it's price. On submitting these values I want to call a function on my smart contract for which I'm using wagmi's ...
Sam Hawkz's user avatar
1 vote
1 answer
106 views

wagmi error write() undefined

Hi all I think I am getting lost with my code. I am using WalletConnect for the modal. import React, { useEffect, useState } from "react"; import { View, Text, ActivityIndicator, ...
Agustin Gonzalez Ribas's user avatar
0 votes
0 answers
23 views

Need help with Session Management for Decentralized Nextjs app using wagmi Library

Please find github gist to the source code. where i have implemented Wallet connection using WagmiProvider. I dont want to repeat adding WagmiProvider to all the pages in my application, instead i ...
gtrharish's user avatar
1 vote
0 answers
148 views

How to I solve fetch has been blocked by CORS policy when fetch data from contract

I'm trying to fetch campaign data and display it to the user. I'm using Nextjs in the front-end and solidity & hardhat in the back-end. The contract data seems to be fetched but when being ...
Kihiu's user avatar
  • 11
0 votes
0 answers
556 views

Error : Cannot read properties of null (reading 'useContext') in frontend

import contracts from '../RPSLS.sol/RPSLSFinal.json' import { ChangeEvent, useContext, useEffect, useRef, useState } from 'react'; import { useNavigate, useLocation } from 'react-router-dom'; import { ...
Indul's user avatar
  • 29
0 votes
1 answer
1k views

How to use useReadContract in callback wagmi?

Hello I doing project web3 and i use wagmi. When i get listTokenUrl, after i want call each item to read tokenUri, but have error "Error: React Hook "useContractRead" may be executed ...
Anh Tuấn Lê's user avatar
2 votes
0 answers
412 views

ContractFunctionExecutionError: The contract function "createCommitment" returned no data ("0x")

I am using WalletConnect's Web3Modal together with Wagmi. I am trying to use the hook provided by Wagmi -- usePrepareContractWrite and useContractWrite. Here is their documentation I applied the code ...
0xNike's user avatar
  • 23
0 votes
0 answers
28 views

Swap Box and Token modal stopped rendering on the browser

Originally, it was a swap built on Ethereum fetching token quotes & prices via api. That version functions as intended Now, I am working implementing conditional logic to fect the token list and ...
Dorian_Gallo's user avatar
0 votes
0 answers
63 views

Getting error during setup when doing "npm i wagmi viem"

npm ERR! ERESOLVE unable to resolve dependency tree npm ERR! npm ERR! While resolving: [email protected] npm ERR! Found: [email protected] npm ERR! node_modules/typescript npm ERR! typescript@"^4....
Indul's user avatar
  • 29
0 votes
0 answers
48 views

useWagmi and Nuxt3 mint function not working

I have provided here (https://stackblitz.com/edit/github-cgbkrw?file=pages%2Fhello.vue) a stackblitz recreation of the issue (although stackblitz seems to have trouble with the useWagmi module). This ...
Meltxx's user avatar
  • 13
2 votes
1 answer
1k views

How to get receipt in wagmi / viem for a transaction issued with Safe on walletconnect?

Our dapp is using wagmi 1.4 / viem 1.15 and a plain httpProvider. I'm connecting it to a Safe (1/1) using WalletConnect v2. When I dispatch a contract transaction, viem yields a transaction response ...
elmariachi's user avatar
0 votes
1 answer
133 views

Deployed a contract using Remix need to access the abi and function whie developing frontend

I have deployed one of my contracts using remix, I have also used the oppenzeplin imports, and while trying to verify I could not cause it could not detect the imports. So I went with making a front ...
kaushik choudhury's user avatar
0 votes
1 answer
325 views

How do I get Wagmi useWaitForTransaction to wait for Metamask (running on Hardhat)?

I am using Wagmi's useWaitForTransaction together with Metamask, running on local Hardhat node. When I sign a transaction it almost immediately returns successful on the front end, but on Metamask it ...
holangun's user avatar
0 votes
0 answers
440 views

Wagmi write contract

I have this code here import React from 'react'; import { usePrepareContractWrite, useContractWrite } from 'wagmi'; import lottoABI from './lottoABI.json'; import { parseEther } from 'viem'; // Your ...
Joe Code's user avatar
0 votes
0 answers
158 views

ABI encoding params/values length mismatch usePrepareContractWrite

I am using wagmi-react hooks to write contract data. Everything works fine with the useContractWrite() but having this issue when using usePrepareContractWrite() ABI encoding params/values length ...
Sagar Atalatti's user avatar
0 votes
1 answer
486 views

write is not a function from useContractWrite

I am getting this error in runtime when using usePrepareContractWrite my code is as follows from the wagmi documentation: const { config } = usePrepareContractWrite({ address: "...
Sagar Atalatti's user avatar
2 votes
0 answers
766 views

WebSocket connection failed for host: wss://relay.walletconnect.com

My project is using wagmi and walletconnect. But I got this error: WebSocket connection failed for host: wss://relay.walletconnect.com. How can I reproduce this and how to fix it? Thank you
Chase Nguyen's user avatar
1 vote
0 answers
162 views

Walletconnect v2 don't work in ios trustwallet, but work in andriod. Why is this happening?

sing Wagmi and walletconnect v2 sdk to implement sending USDC tokens from a wallet to a specific wallet. Everything works on Android on trustwallet and metamask wallets But on ios metamask sending ...
Madis Conner's user avatar
1 vote
0 answers
243 views

#Wagmi: TypeError: x.replace is not a function after migration from 0.X to 1.X.X

Same code I didn't change a thing. Only a few things in wagconfig to make the migration but the rest should work. I have this error using: const { config, error } = usePrepareContractWrite({...data}) ...
Mentasuave01's user avatar
2 votes
1 answer
884 views

wagmi - Error handling for writeContract action using Vanilla JS?

I am using wagmi to interact with my contract ABI using Vanilla JS and having a hard time finding documentation specifically for Vanilla. I've got everything working, but have been unable to figure ...
user13286's user avatar
  • 123
2 votes
1 answer
540 views

Event triggered multiple times - wagmi - watchAccount

I've created a Dapp that uses react, web3modal and some functions from wagmi. What I'm trying to achieve is the following: User clicks button for connecting wallet -> web3modal is displayed -> ...
Radu Moraru's user avatar
0 votes
0 answers
84 views

Safe Wallet with WalletConnect get me an error with waitForTransaction()

When I call a writing function with my multisig Safe Wallet, I got an error when I call waitForTransaction() function: "TransactionNotFoundError: Transaction with hash "0x396...5add475ab&...
Jeje's user avatar
  • 1
0 votes
1 answer
242 views

Problem on wagmi safe connector SDK

I am getting an error while confirming the transaction by gnosis wallet ... it works perfectly fine while confirming transactions with another wallet like metamask... I am using Wagmi, and currently, ...
Anup Adhikari's user avatar
1 vote
0 answers
638 views

Wallet connect doesnt sign message with signTypedData

Hello i have a simple next js project. When i click the button i want to sign the message with my wallet. I use wallet connect which is my main problem. The code works perfectly with injected provider ...
Furkan Sezal's user avatar
2 votes
2 answers
1k views

Wagmi "useAccount" connector is undefined after refreshing page using next.js

I am using WAGMI and the Rainbowkit connector for my Dapp. After deploying it on production, I have encountered a strange problem. Sometimes, after refreshing the page or opening it in a new tab, the &...
Nightcrawler's user avatar
2 votes
2 answers
4k views

what is the right way to read from the contract? using wagmi.sh

So I am using the package wagmi.sh and via that I am writing to a very simple contract called the counter program that increments the value by 1 each time I call the function. Now I am able to ...
kaushik choudhury's user avatar
0 votes
0 answers
275 views

Unable to get the Read data or write data using Wagmi sh

So here is the react code and its a simple Counter program. Deployed on the below address. I have put both the solidity part as well as React code // SPDX-License-Identifier: MIT contract ...
kaushik choudhury's user avatar
0 votes
1 answer
575 views

Ethers.js solidityPackedKeccak256 to bytes32

I have a commit-reveal pattern implemented in my Solidity smart contract. I use the keccak256 encryption function to secure the player's commitment. How can I convert the return value of ...
Mila A's user avatar
  • 1,229
0 votes
0 answers
547 views

Wagmi throws "Cannot Decode Zero Data" Error when using useContractRead

I am using wagmi with next 13, and trying to call "view" function in my contract. The function in my contract: function getAllGrids() public view returns (address[] memory) { return ...
Arham S C's user avatar
0 votes
2 answers
1k views

How to call useContractRead of wagmi in diferents places of React Component

I have created a handler to try to use the wagmi getter function call. const handleContractReadCurrentDuel = () => { const { data: duel } = useContractRead({ address: ...
Fernando López's user avatar
0 votes
0 answers
1k views

Websocket connection fails for safe app after wagmi and walletconnect upgrade

We have upgraded our application to wagmi 0.12.0 and walletconnect 2.7.8 with it. Now the websocket connections are failing when using it as a safe app: "Uncaught (in promise) Error: ...
szmizorsz's user avatar
0 votes
0 answers
23 views

I am trying to reproduce the exception caused by metamask

The purpose of obtaining this image is to aid in my attempts to reproduce the issue. Additionally, I am curious to know if anyone within the community has encountered a similar situation before.
Shubham Gupta's user avatar
0 votes
1 answer
450 views

Type error in wagmi's usePrepareContractWrite for value

I have next app with typescript and using wagmi (https://www.npmjs.com/package/wagmi) package to work with smart contracts. I am trying to prepare contract write using usePrepareContractWrite and need ...
user122142's user avatar
3 votes
0 answers
785 views

Randomly getting errors on Wagmi useWaitForTransaction and useContractWrite hooks

I'm using a Wagmi library in my ReactJS application and one specific hook(s) are randomly throwing errors. Sometimes it's not an error and the task executes fine, or it's throwing one of 2 errors ...
Nika Khachiashvili's user avatar
0 votes
0 answers
21 views

How am I supposed to store user account details data in a decentralized manner?

I'm building an NFT marketplace app where creators can mint NFTs based on some external images, and users can buy those to support the creators. I need to support user account details storage. I'll ...
Mila A's user avatar
  • 1,229
0 votes
1 answer
72 views

Is it possible for sendTransaction to return an empty hash from MetaMask while isSuccess is true

Our app is using React + Wagmi + prepare hooks. One MetaMask user had an issue where their transaction completed successfully, but DoThisThing was never called. Code is simplified, but wondering if ...
netdragonx's user avatar
0 votes
1 answer
355 views

Smart Contract's ABI has uint256, but I get error `Type 'number' is not assignable to type 'BigNumber'

This is the first time I work with web3 api, so I am totally lost. I use wagmi hook with react, trying to call a function from smart contract: const id = 1; const index = 1; const { data, error, ...
MrOwl's user avatar
  • 3
0 votes
0 answers
996 views

wagmi useContractRead is giving error and data together

I am trying to simply read smart contract data by calling an external view function getOwner which returns an ethereum address using wagmi hook useContractRead. I found that I am getting both the ...
saditya's user avatar
  • 11
1 vote
0 answers
456 views

How to interact with proxy contract with ethers and wagmi

I have an upgradable proxy contract that points to a specific contract. This is the contract in mumbai polygonscan => https://mumbai.polygonscan.com/address/...
Murat's user avatar
  • 11
1 vote
1 answer
1k views

Wagmi useContractWrite, add Arguments to pass to function

Hey im trying to use wagmi to write this function to a smart contract inside my application, it’s for purchasing tickets and is a payable Function: buyEntry(uint256 _raffleId,uint256 _id,address ...
Newb's user avatar
  • 11
0 votes
1 answer
112 views

How to use the connected wallet in getNftsForOwner for Alchemy SDK function?

I'm using a combination of Thirdweb and Alchemy SDK to fetch all nfts in a connected wallet. Every example I've come across for Alchemy's getNftsForOwner function has the wallet address placed in the ...
Miles Donald's user avatar
0 votes
1 answer
226 views

why i cannot access Mumbai polygon

I want to access Mumbai polygon. I'm using wagmi with this config const { chains } = configureChains( [polygonMumbai], [publicProvider()], ) but in provider i see only mainnet How should i config it ...
Mary Reznik's user avatar