Not getting success callback/ receipt with walletconnect with web3.js 1.3.3
Expected behavior
- It should give success callback & receipt if used with WalletConnect
Actual behavior
- After 1.3.x update (tried with 1.3.3 & 1.3.4 rc.1), it is working upto below callback
.on('transactionHash', function(hash){
...
})
on 'receipt' OR below one
.then(function(receipt){
// receipt can also be a new contract instance, when coming from a "contract.deploy({...}).send()"
});
Never gets called but it is working fine with web3.js 1.2.11.
Steps to reproduce the behavior
- Connect wallet by scanning QR code with Metamask mobile or WalletConnect supported wallet app
- Do any contract interaction Txn (using myMethod(123).send)
- See if its calling final success callback with receipt
Logs
Environment
WalletConnect web3 provider: tried 1.3.1 & current latest 1.3.4 Node: 14.15.x web3.js: 1.3.3 & 1.3.4.rc1 OS: Mac OS 11.1
If possible please release new 1.2.x version with Metamask hotfix, if it can't be fixed quickly with 1.3.x
By chance do you have a demo app?
No I don't have demo app, let me know if it is required, will make it tomorrow.
For a sanity check, I tested this locally using ganache-cli by deploying the SimpleStorage.sol contract and submitted a set transaction - I received the transactionHash, the receipt, and the confirmation events
No I don't have demo app, let me know if it is required, will make it tomorrow.
If you could provide a demo app, it would help debugging tremendously
@spacesailor24 Ok will try to make demo, btw I tried approve method of ERC20 contract & wallet was connected using metamask mobile app on Android using Walletconnect QR code, on rinkeby test network.
Btw it is working as expected with metamask browser extension but not with Walletconnect so we downgraded app to 1.2.11.
I am having the same issue with ganache-cli. The contract deploys but the transactionHash is always undefined. The then callback is never called too. The issue is happening on [email protected].
@spacesailor24 Hi, here is the demo app for the issue, please see README for steps, don't forget to set 'REACT_APP_INFURA_ID' in '.env' before connecting. Demo link: https://github.com/aksdevac/wc-web3-demo
I am having the same issue with ganache-cli. The contract deploys but the transactionHash is always undefined. The then callback is never called too. The issue is happening on [email protected].
Could you provide a code snippet of what's not working? I can do the same for code that was working using ganache-cli
Forgot to @ujal ^
@spacesailor24 Hi, here is the demo app for the issue, please see README for steps, don't forget to set 'REACT_APP_INFURA_ID' in '.env' before connecting.
Demo link: https://github.com/aksdevac/wc-web3-demo
Awesome, thank you! I'll be taking a look at this shortly
@spacesailor24
contract.deploy({ data: bytecode }).send({ from: account }, function(err, transactionHash) {
console.log(transactionHash)
}).then(function(newContract) {
console.log(newContract.options.address)
});
@ujal Here is a working example
Thank you for providing the test repo :heart:
It looks like I received the tx hash using [email protected]

Thank you for providing the test repo :heart:
It looks like I received the tx hash using
[email protected]
Yes txHash is received but receipt is never received with 1.3.4 so loading never stops.
Oops I misread! @ujal said the tx hash was never received
I'll have to take a look at it further tomorrow morning, sorry for the inconvenience!
Ok @ujal issue might be different but if you check code he posted, he is not listening for transactionHash event, so may be he didn't checked for it. I was also not listening for transactionHash event before as I can show success only after receipt is received & Receipt also has txHash, txHash event is added just for debugging purpose. Goal is to receive the receipt after transaction is confirmed on blockchain.
I updated my example repo above to include the receipt listeners here
Both .on('receipt', receipt => {...}) and .then(receipt => {...}) work, so my suspicion is a miscommunication between WalletConnect and Web3.js
@pedrouid can you see if @walletconnect/web3-provider is causing this issue?
@spacesailor24 yes there must be some miscommunication but as it was working with web3 1.2.11, I have created an issue here.
it is perfectly working on version 1.2.11 .1.3 version has some issues in getting the receipt hook