Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Transaction erroneously retries when "insufficient funds for fee" with WAGMI+Viem+Wallet Connect+Fireblocks #5488

Open
alexwalchli opened this issue Nov 6, 2024 · 1 comment
Labels
type: bug Something isn't working

Comments

@alexwalchli
Copy link

Describe the bug
When connected with Fireblocks to an app that uses WAGMI/Viem, attempting to make a contract call when not having sufficient ETH for the network fee results in 3 retry attempts. If the transaction is cancelled in Fireblocks the retries will stop with a standard user rejected error.

Either the error thrown by Wallet Connect is wrong, or Viem should interpret the error better and not attempt to retry. Given Wallet Connect interprets the error from Fireblocks as an "UnknownRpcError" when it is in fact known (insufficient fees), I figured I'd start here.

Package versions
"viem": "2.21.41",
"wagmi": "2.12.26",
"@dynamic-labs/ethereum": "^3.5.1",
"@dynamic-labs/sdk-react-core": "^3.5.1",
"@dynamic-labs/wagmi-connector": "^3.5.1",

Looks like dynamic is currently using @WalletConnect[email protected]

To Reproduce

  1. Connect to an app with the above combination (Wallet Connect through to Fireblocks).
  2. Attempt any transaction that will require more ETH than the wallet contains.
  3. Watch the transaction appear in Fireblocks, result in an insufficient funds for fee error.
  4. You will then note that the transaction appears again in Fireblocks, until after the 3rd retry or if you cancel.
    image

Expected behavior
I would not expect the transaction to retry at all.

Screenshots
Error throw by Wallet Connect and being handled by Viem in buildRequest.js. Note that is is "UnknownRpcError", "Session settlement failed.".
image

@alexwalchli alexwalchli added the type: bug Something isn't working label Nov 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant