hashgraph / hedera-wallet-connect

This package is a messaging relay between decentralized applications and wallets in Hedera network based on Wallet Connect relays.
Apache License 2.0
7 stars 15 forks source link

Unable to use the signer to execute transactions in a create react dapp #186

Closed a-ridley closed 2 weeks ago

a-ridley commented 2 weeks ago

Describe the bug A clear and concise description of what the bug is.

I am upgrading the CRA hedera template to use the hedera wallet connect signer, and whenever I try to complete a transaction, I get an error message. It occurs in the file walletConnectClient.tsx on line 71: const txResult = await transferHBARTransaction.executeWithSigner(this.signer);

ERROR:

Uncaught runtime errors:
×
ERROR
Error executing transaction or query: 
{
  "txError": {},
  "queryError": {
    "name": "Error",
    "message": "(BUG) Query.fromBytes() not implemented for type getByKey",
    "stack": "Error: (BUG) Query.fromBytes() not implemented for type getByKey\n    at vr.fromBytes (http://localhost:3000/static/js/bundle.js:68098:28)\n    at SA._tryExecuteQueryRequest (http://localhost:3000/static/js/bundle.js:96271:20)\n    at SA.call (http://localhost:3000/static/js/bundle.js:96292:26)\n    at async WalletConnectWallet.transferHBAR (http://localhost:3000/static/js/bundle.js:2111:22)\n    at async onClick (http://localhost:3000/static/js/bundle.js:1440:26)"
  }
}
Error: Error executing transaction or query: 
{
  "txError": {},
  "queryError": {
    "name": "Error",
    "message": "(BUG) Query.fromBytes() not implemented for type getByKey",
    "stack": "Error: (BUG) Query.fromBytes() not implemented for type getByKey\n    at vr.fromBytes (http://localhost:3000/static/js/bundle.js:68098:28)\n    at SA._tryExecuteQueryRequest (http://localhost:3000/static/js/bundle.js:96271:20)\n    at SA.call (http://localhost:3000/static/js/bundle.js:96292:26)\n    at async WalletConnectWallet.transferHBAR (http://localhost:3000/static/js/bundle.js:2111:22)\n    at async onClick (http://localhost:3000/static/js/bundle.js:1440:26)"
  }
}
    at SA.call (http://localhost:3000/static/js/bundle.js:96294:13)
    at async WalletConnectWallet.transferHBAR (http://localhost:3000/static/js/bundle.js:2111:22)
    at async onClick (http://localhost:3000/static/js/bundle.js:1440:26)

I followed the documentation to use the signer, but to no avail. Hoping more can get uncovered 🙏

To Reproduce Steps to reproduce the behavior:

  1. Open the following project in vscode usewalletconnectsigner.zip
  2. npm i
  3. npm run start
  4. Click on the connect button in the upper right
  5. Copy the connection string
  6. Paste it to any hedera wallet
  7. pase an account id in the to address
  8. click the button with the arrow to start a transfer transaction of 1 test HBAR.
  9. Observe the following error

Expected behavior A clear and concise description of what you expected to happen.

I expect to be able to use the wallet connects signer to freeze and execute the transfer transaction to transfer 1 test HBAR.

Screenshots If applicable, add screenshots to help explain your problem. image

Desktop (please complete the following information):

Additional context Add any other context about the problem here.

a-ridley commented 2 weeks ago

This issue is no longer reproducible or occurring. Therefore I will close it.