Questions tagged [wagmi]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
1 answer
18 views

How to auto redirect user to metamask for confirm the transaction in mobile with wallet connect(rainbowkit & wagmi)

in my dapp i'm using rainbowkit for connection, dapp working perfectly in desktop but in mobile when i connect my dapp with wallet-connect option, i have to go manually in metamask to confirm the ...
  • 11
1 vote
0 answers
36 views

How to pass dynamic arguments to usePrepareContractWrite in Wagmi?

I have to pass token amount as argument on a function call. The amount is dynamic and coming from a text box when a user click button (for partial amount submission). There is another button that ...
0 votes
2 answers
65 views

Using Wagmi Core and Wagmi React together

I am using React Wagmi Hooks in my dapp to manage wallet connection. However, when it comes to reading or writing some contract functions it is not really practical to use the hooks. The reason I don'...
2 votes
2 answers
40 views

Two wagmi's usePrepareContractWrite( ) in a single React functional component

There are two different functions in my smart contract which I want to connect to two separate buttons on my user interface. The component is function-based. So according to wagmi's documentation, I ...
0 votes
0 answers
50 views

Wagmi React hooks - caching

I wonder if someone use Wagmi hooks for Ethereum and it's caching mechanism. Since docs doesn't say much about it (Wagmi docs) can somebody explain me how it acutualy works? If i use useContractRead ...
  • 101
1 vote
1 answer
43 views

Error: invalid BigNumber value (argument="value", value=null, code=INVALID_ARGUMENT, version=bignumber/5.7.0)

Within my front end part, I am using Wagmi's usePrepareContractWrite and useContractWrite hooks to execute a function of my smart contract. The function demands a uint argument. Therefore my '...
0 votes
1 answer
30 views

Why are Wagmi priority fees on Polygon Mumbai always 50gwei

I've noticed that all my transactions (see example) when using wagmi have 50gwei for priority fees in polygon mumbai. Where is this hardcoded value coming from? If wagmi uses ethers behind the scenes, ...
0 votes
1 answer
57 views

Signatures created in metamask with ledger is being rejected by ECDSA.recover

Some context. The frontend right now is using wagmi under the hood, we are using the signMessageAsync method to generate a signature. Code is below const { signMessageAsync } = useSignMessage() ...
1 vote
0 answers
34 views

How can I programatically add a chain to a wallet?

Trying to implement a function which switches chains to a supported chain with wagmi gives me issues on mobile. I'm working on a project where I need to approve a transaction on a respective chain. ...
0 votes
0 answers
15 views

MetaMask android application gets minimized

I am developing a dapp. It has a Web3Modal connect button and a button that triggers a transaction(using wagmi). When I open it in the MetaMask's built-in browser and connect, the MetaMask app gets ...
1 vote
1 answer
149 views

wagmi useContractWrite response not including event parameters

I am using wagmi useContractWrite hook to execute a smart contract function and would like to capture the response from the function emitted through an event. The event seems to be captured under data....
0 votes
2 answers
90 views

Failing to trying to approve contract using ethers.js (CALL_EXCEPTION or cannot estimate gas)

I am having trouble calling a simple ERC-20 approve function from the front end on the Arbitrum network. Any insight is greatly appreciated. I will outline my code below. I am retrieving the provider ...
  • 3
0 votes
2 answers
62 views

Can I connect an address and sign a transaction from nodejs without a browser in Wagmi core

I'm building a nestjs backend and I want to execute a write transaction to the contract as the contract owner, I couldn't find anyway to connect my address and sign the transaction programmatically to ...
  • 103
0 votes
1 answer
192 views

Wagmi usePrepareContractWrite is not a function

I was following a youtube tutorial for RainbowKit and Wagmi then i stumble upon this problem. " Unhandled Runtime Error TypeError: (0 , wagmi__WEBPACK_IMPORTED_MODULE_6__.usePrepareContractWrite) ...
  • 1
0 votes
1 answer
114 views

wagmi TypeError: zustand_vanilla__WEBPACK_IMPORTED_MODULE_1___default(...) is not a function

I'm on wagmi 0.6.8. I get this error when doing import { WagmiConfig, createClient, configureChains, defaultChains, chain } from 'wagmi' const { chains, provider, webSocketProvider } = ...
0 votes
1 answer
35 views

setState is not working

This is a function where I try to pin an NFT metadata on IPFS and then store the URL in a state variable called tokenUrl. Once the pinning process is done, I need my related state variable to be ...
0 votes
1 answer
229 views

How to dynamically pass argument to useContractRead()?

I am trying to pass an argument to the hook based on the user input. The flow will be => user types the number in the input field => value stored in the state => state value passed as an ...
1 vote
1 answer
193 views

Wagmi useWaitForTransaction not waiting long enough?

I'm using wagmi react hooks to create a custom hook that handles token allowance and approvals. it returns an object with the allowances of two tokens for a given pool, and functions to approve each ...
0 votes
1 answer
272 views

Wagmi useSigner hook doesn't work when url has a query parameter in a Next JS project

I am trying to use the useSigner hook from wagmi. My project is a Next JS project and I am using the rainbow kit button to connect. If I am at a page with a url like localhost:3000 the signer loads at ...
1 vote
1 answer
280 views

WAGMI useWaitForTransaction not running

I'm trying to make the useWaitForTransaction to run to change state of my application from submitting to success or failure, but it's not running. It's odd because it runs if I hard code my hash to '...
0 votes
1 answer
250 views

Minting with Wagmi

I am using Wagmi hooks in my dapp. Also, I have utilized RainbowKit for wallet connection. Now, I am trying to use Wagmi to execute the mint function of my smart contract. As shown, it takes three ...
1 vote
0 answers
328 views

Value' does not exist in type 'Overrides & { from?: `0x${string}`

I have next app with typescript template and using wagmi (https://www.npmjs.com/package/wagmi) package I am trying to send ether to the contract function Code const { config } = ...
0 votes
0 answers
100 views

How do I call a hook on each element in an array of contractAddresses?

So I'm trying to get a wallet's balances for a bunch of different ERC-20 contracts. Calling the ERC20 contract addresses from the etherscan api and then I'm trying to use the wagmi hook useBalance to ...
0 votes
1 answer
23 views

If a call to contract B depends on some state in contract A, can I send both transactions in the same block?

Here's the general interaction: I have a dApp that allows a user to mint a VolcanoNFT in two ways: either by sending 0.001 ETH, or by "sending" an ERC-20 token called LAVACOIN. For payment ...
  • 101
1 vote
1 answer
557 views

WAGMI useContractWrite() hook unresponsive/not working

I've been trying to write to a contract on a local blockchain (Anvil from Foundry) but running the write() function (running it after submitting a form write?.()) does not work. Tried to disable the ...
1 vote
2 answers
882 views

Wagmi can't read function: Error: invalid address or ENS name (argument="name", value=true, code=INVALID_ARGUMENT, version=contracts/5.7.0

Hello everyone, I use wagmi with rainbowkit and I wanna check wallet address status with function "isApprovedForAll" response will be true or false, but I got undefined and error everytime ...
0 votes
1 answer
486 views

How to pull info of a protocol's data using useContractRead hook of wagmi?

I need to get data on all transactions on an L2 protocol. I'm using the useContractRead hook. const contractRead = useContractRead({ address: address, abi: ContractABI, functionName: '...
  • 138
0 votes
0 answers
29 views

Grab browser variable for local handling for token gated redirect

I cannot seem to understand why the browser returns the correct wallet address but in terminal it is undefined and I cannot handle it for other things. I want to take the current address from either ...
0 votes
1 answer
156 views

What is the difference between 'watch' and 'cacheOnBlock' in the WAGMI library

I'm using WAGMI in a web app and I'm seeing some slowness in having read values updated in my app when the blockchain state changes. Looking at the docs, I see two potentially relevant options in the ...
1 vote
1 answer
72 views

example of HD Wallet injection into RainbowKit

I want to test my DApp which uses RainbowKit and WAGMI. I figured that the easiest way would be to use an HDWalletProvider and use it in the createClient function. I was unable to find an example. ...
  • 2,113
2 votes
0 answers
219 views

RainbowKit does not work with MetaMask on iOS [closed]

Current Behavior On iOS, when I tap "connect wallet", the "Connect a Wallet" overlay, I click "Metamask" and it directs me to the iOS App Store. Expected Behavior When I ...
0 votes
1 answer
552 views

Can't return address from JsonRpcSigner from wagmi to pass into parameter view function

Trying to pass the connected wallet address into one of my view functions, but cannot get the address from the JSON object is there something I am missing here? Using wagmi to get signer from the ...
0 votes
1 answer
122 views

handling complex return values with - useContractRead - TypeError: Converting circular structure to JSON

I am having a hard time handling the return values from useContractRead if my function is not a simple string or number: Code with useContractRead in two different ways (both returning this error): ...
3 votes
2 answers
909 views

Passing dynamic arguments to usePrepareContractWrite in Wagmi

Working with usePrepareContractWrite Dealing with the logical flow const { config: contractWriteConfig } = usePrepareContractWrite({ ...contractConfig, functionName: 'mint', args: [...
  • 31
3 votes
1 answer
1k views

Populating the write args with wagmi usePrepareContractWrite

I am using wagmi usePrepareContractWriteand write to write to my contract. I am allowing the user to upload fields and create an NFT. Is there a way to set the args in the write function? For example ...
1 vote
1 answer
549 views

wagmi - useContractWrite - eth_call - Transaction reverted: function selector was not recognized, but sendRawTransaction going through

Trying to do a contract interaction, rainbowkit/metamask is connected to my local host rpc from hardhat, I am having problems completing a transaction... Am I doing something wrong here? Metamask ...
3 votes
2 answers
860 views

Front End: Transfer (send) your NFTs (ERC-721) using Ethers.js or Wagmi.sh

I'm a front-end dev getting my feet wet in the crypto nft space. I built a simple site for displaying all the NFTs in your wallet. Users can connect to the page using Rainbowkit (built on top of WAGMI,...
  • 165
1 vote
1 answer
2k views

How to pass arguments in useContractWrite wagmi

this is the mint function of my contract and I want to pass the quantity argument, please help me with that. my current code :- const { writeAsync: mint, error: mintError } = useContractWrite({ ......
0 votes
2 answers
2k views

How to get provider using rainbowkit wallet if connected via walletconnect or coinbase

I'm using rainbowkit wallet which offers various wallet options such as walletconnect and coinbase. My question is, if I'm connected via metamask then my web3 instance can use window.ethereum as ...
  • 1,054