anza-xyz / wallet-adapter

Modular TypeScript wallet adapters and components for Solana applications.
https://anza-xyz.github.io/wallet-adapter/
Apache License 2.0
1.44k stars 906 forks source link

Sending transaction with devnet connection does not work with Solflare wallet #957

Closed ZYJLiu closed 1 month ago

ZYJLiu commented 2 months ago

Describe the bug Sending a transaction to Solflare wallet does not work with devnet connection. When a transaction is sent, the connection switches to mainnet which results in an error from Solflare wallet. Both the wallet and frontend connection are set to devnet, and the transaction works as expected when using Phantom wallet.

To Reproduce

  1. Set connection on both frontend and Solflare to devnet
  2. Use @solana/wallet-adapter-solflare to connect to Solflare wallet
  3. Send a transaction, which results in the "Network Mismatch" error from the wallet.

Expected behavior Successfully send a transaction with devnet connection

Screenshots CleanShot 2024-05-02 at 15 35 17

Desktop:

mcintyre94 commented 1 month ago

Please can you provide source code and a link to view your repro of this?

ZYJLiu commented 1 month ago

Here is the repo, and here is the wallet adapter setup in the repo.

mcintyre94 commented 1 month ago

Got it thanks, this looks like a Solflare bug. It can also be reproduced on https://anza-xyz.github.io/wallet-adapter/example which sends transactions on devnet.

I've reported it to Solflare and they tell me it'll be fixed in their extension in the next release. I'll close this issue because there's nothing we can do in wallet-adapter.