question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[bug] WalletConnect Transaction promises not returning

See original GitHub issue

Is there an existing issue for this?

  • I have searched the existing issues

Package Version

0.2.1

Current Behavior

I am using the package in my next.js application.

When I send transactions to a wallet connected with WalletConnect, the transaction promise never returns.

In the following code snippet, the transaction is picked up by the wallet and will successfully send, but the notifications aren’t displayed and the receipt isn’t logged.

I tried this with multiple wallets (Metamask and Valora) and neither of them work. Metamask works as expected.

  const setStorage = async (values) => {
    let tx = await contract.store(values.number);

    notification.open({
      message: "Updating Storage",
      description: `Contract storage updating to: ${values.number}`,
    });

    let receipt = await tx.wait();
    console.log("receipt", receipt);
}

Expected Behavior

I expect the transaction promise to resolve when it is sent by the wallet.

Steps To Reproduce

No response

Anything else?

No response

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:3
  • Comments:54 (11 by maintainers)

github_iconTop GitHub Comments

2reactions
critesjoshcommented, Feb 7, 2022

@maxx6262 i am able to connect using the testnet wallet and Valora. I am testing on this site

1reaction
octavioamucommented, Apr 7, 2022

Got it to work with chainId: chain.id in case somebody find it useful but still using env variable to force rinkeby wagmi 0.3.0-next.13

import { chain, defaultChains } from 'wagmi'
import { InjectedConnector } from 'wagmi/connectors/injected'
import { WalletConnectConnector } from 'wagmi/connectors/walletConnect'
import { CoinbaseWalletConnector } from 'wagmi/connectors/coinbaseWallet'

const infuraId = process.env.NEXT_PUBLIC_INFURA_ID
const env = process.env.NODE_ENV
const chains = defaultChains
const defaultChain =  env === "development" ? chain.rinkeby : chain.mainnet

const connectors = ({ chainId }) => {
  const chain = chains.find((x) => x.id === chainId) ?? defaultChain
  const rpcUrl = chain.rpcUrls.infura
      ? `${chain.rpcUrls.infura}/${infuraId}`
      : typeof chain.rpcUrls.default === 'string'
      ? chain.rpcUrls.default
      : chain.rpcUrls.default[0]

  return [
    new InjectedConnector({
      chains,
      options: { shimDisconnect: true },
    }),
    new WalletConnectConnector({
      options: {
        qrcode: true,
        chainId: chain.id,
        rpc: {
          [chain.id]: rpcUrl,
        },
      },
    }),
    new CoinbaseWalletConnector({
      options: {
        appName: 'My wagmi app',
        chainId: chain.id,
        jsonRpcUrl: rpcUrl,
      },
    }),
  ]
}

export default connectors;
Read more comments on GitHub >

github_iconTop Results From Across the Web

[bug] WalletConnect Transaction promises not returning - Gitcoin
I am using the package in my next.js application. When I send transactions to a wallet connected with WalletConnect, the transaction promise never...
Read more >
@walletconnect/web3-provider not rejecting the promise on ...
It has to be noted that EIP-1193 exists. This standard says when user rejects request, the Provider should return the status code of...
Read more >
Gnosis Safe WalletConnect app not returning anything from ...
Our dApp allows for connections via WalletConnect and using other wallets through it, seem to fire/resolve the promises correctly.
Read more >
WalletConnect error while integration in ReactJS - Uncaught ...
WalletConnect error while integration in ReactJS - Uncaught (in promise) TypeError: this.send is not a function.
Read more >
transactionGroup: [0] had zero Group but was submitted in a ...
Hi, I am trying to post a group transaction but receive this error. I am using WalletConnect to connect the wallet and to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found