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

WalletConnect Unauthorized Error When Extending Viem Client for OP-Stack Transactions #3370

Open
1 task done
danielsimao opened this issue Feb 20, 2025 · 0 comments
Open
1 task done

Comments

@danielsimao
Copy link
Contributor

Check existing issues

Viem Version

latest

Current Behavior

When using viem with wagmi to interact with OP-Stack and extending the client with walletActionsL1(), everything works fine when conducting transactions directly with the extended wallet client.

However, when connecting via WalletConnect (e.g., MetaMask or TrustWallet), attempting to execute a bridge transaction fails with the following error:

`TransactionExecutionError: The requested method and/or account has not been authorized by the user.

Request Arguments:
chain: Sepolia (id: 11155111)
from: 0x97632B3760460A623E068CC70aBF11D5fA99Be5f
to: 0xBAAf3BAfdbd660380938b27d21c31bB7D072a799
value: 0.00000000000001 ETH
data: 0xe9e05c4200000000000000000000000097632b3760460a623e068cc70abf11d5fa99be5f00000000000000000000000000000000000000000000000000000000000027100000000000000000000000000000000000000000000000000000000000005208000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000000
gas: 63214

Details: The requested account and/or method has not been authorized by the user.
Version: [email protected]
at getTransactionError (getTransactionError.js:18:12)
at sendTransaction (sendTransaction.js:141:105)
at async Object.mutationFn (page.tsx:407:29)Caused by: UnauthorizedProviderError: The requested method and/or account has not been authorized by the user.
`

Expected Behavior

  • The transaction should proceed without an authorization error after connecting via WalletConnect.
  • The extended wallet client should function the same way as with direct wallet connections.

Steps To Reproduce

I've set up a wagmi/next playground with an OP-Stack section reproducing the issue:
🔗 GitHub Repository

  1. Connect using WalletConnect (e.g., MetaMask or TrustWallet).
  2. Attempt to execute a bridge transaction via the extended client.
  3. Observe the error message related to unauthorized account/method.

Link to Minimal Reproducible Example

https://github.com/danielsimao/wagmi/blob/chore/playground-op-stack/playgrounds/next/src/app/page.tsx

Anything else?

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant