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] Wallet connect signer doesn't support signTransaction

See original GitHub issue

Is there an existing issue for this?

  • I have searched the existing issues

Package Version

^0.5.9

Current Behavior

  const provider = await connector.getProvider();
  const signer = await connector.getSigner();

  // this way to sign doesn't work at all, just returns 'UNSUPPORTED_OPERATION' or something like this
  const s = await signer.signTransaction({
    to: addr,
    from: userAddress,
    gasLimit: gasLimit,
    data: swapDescription,
  });

  // This one sends notification to my mobile, but doesn't work too for another reason (screenshot below)
  const r = await provider.request({
    method: 'eth_signTransaction',
    params: {
      to: addr,
      from: userAddress,
      gas: gasLimit,
      data: swapDescription,
      gasPrice: '0x9999'
    },
  });

2022-07-19 16 12 21

Expected Behavior

signTransaction for wallet connect should work fine (example apps: 1inch, it has WC integration and it is possible to send tx via flashbots)

Steps To Reproduce

No response

Link to Minimal Reproducible Example (CodeSandbox, StackBlitz, etc.)

repo

Anything else?

No response

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
jxomcommented, Aug 10, 2022

Hey @cattingcat,

Sorry I only just got the time to have a look into this. For now, you may have to try hook into the WalletConnectProvider instance on the Wallet Connect connector.

Example:

const { connector } = useAccount()

// ...

const provider = await connector?.getProvider()
const test = await provider.request({
  method: 'eth_signTransaction', 
  params: [{
    to: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e',
    from: '0xa5cc3c03994DB5b0d9A5eEdD10CabaB0813678AC',
    value: '0x0'
  }]
})

I tested this, and it works for me.

0reactions
cattingcatcommented, Oct 28, 2022

Yep, it works thanks 😃 Just in case if somebody will have the same issue as here: all tx values even gas should be in HEX format (I spent some time debugging issue with it)

Also Is it possible to migrate to signTransaction function sometime?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Adding mobile signing support to your dApp
Introduction to adding mobile wallet signing support to your dApp. WalletConnect protocol will be added to the Algorand Wallet shortly.
Read more >
gnosis safe - error "transaction which cannot be processed" ...
When app is using metamask on wallet-connect with other wallets than gnosis, transaction can be signed and everything is ok. When i am...
Read more >
Sign and verifiy message on ethereum using wallet ...
Show activity on this post. I am trying to sign and verify messages using wallet connect for my DAPP. So far I have...
Read more >
Understanding and resolving MetaMask error codes
Because the MetaMask documentation does not have a comprehensive and ... This error is returned for the methods that aren't supported on ...
Read more >
@algo-builder/web
You can connect to web package in your react app by using different wallets. Currently supported wallets include: AlgoSigner: Create an instance of...
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