[bug] Solana WalletConnectProvider
not emitting accountsChanged
events
#3183
Labels
WalletConnectProvider
not emitting accountsChanged
events
#3183
Link to minimal reproducible example
https://github.com/gcangussu/wallet-connect-provider-missing-events?tab=readme-ov-file#accountschanged-bug-repro
Summary
Expected behavior
From a wallet connected with WalletConnect, we can change the current selected Solana account on a dapp.
Technically, when receiving a "WalletConnect"
accountsChanged
event, the Solana'sWalletConnectProvider
must emit a "Solana"accountsChanged
event (defined by its provider interface) with the first account from the original event as the payload. The difference from the events is that the "WalletConnect"accountsChanged
event has an array of strings representing account addresses, and the "Solana"accountsChanged
event is just a singlePublicKey
representing a single account that should be the current selected account.Here is where the Solana's chain adapter handles it, expecting an
accountsChanged
with a singlePublicKey
as parameter.For an example of this being done correctly by a provider in another context see the implementation on Solana's
WalletStandardProvider
.Actual behavior
There is no
accountsChanged
event being emitted by the Solana'sWalletConnectProvider
. Consequently, we cannot change the current selected Solana account from the wallet when connected to a dapp by WalletConnect.Notice that this works fine when
The problem is just with the Solana adapter with the underlying WalletConnect provider. So (1) shows that the Solana chain adapter is handling the accountsChanged event correctly (i.e. the problem is in the provider probably), and (2) that other chains adapters and WalletConnect providers are handling it correctly.
Affected
List of related npm package versions
@reown/appkit-adapter-solana <= 1.2.0 (as of written)
The text was updated successfully, but these errors were encountered: