You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
//// connect to XVerse walletconst{ address, allAccounts, isConnected }=useAppKitAccount({namespace: ChainNamespace.bip122});useEffect(()=>{console.log(address);// ✔️ shows connected addressconsole.log(allAccounts);// ✔️ shows all connected addressesvoidwalletProvider?.getAccountAddresses().then((a)=>{console.log({ a });// ✔️ shows all connected address});},[address,allAccounts]);///// Go to XVerse extensions, change from account1 to account2useEffect(()=>{console.log(address);// ✔️ shows new connected addressconsole.log(allAccounts);// 𝗫 shows OLD addresses for the connected provider = state not updatedvoidwalletProvider?.getAccountAddresses().then((a)=>{console.log({ a });// ✔️ shows NEW addresses});},[address,allAccounts]);
Phantom wallet:
//// connect to Phantom walletconst{ address, allAccounts, isConnected }=useAppKitAccount({namespace: ChainNamespace.bip122});const{ walletProvider }=useAppKitProvider<BitcoinConnector>(namespace);useEffect(()=>{console.log(address);// ✔️ shows connected addressconsole.log(allAccounts);// ✔️ shows all connected addressesvoidwalletProvider?.getAccountAddresses().then((a)=>{console.log({ a });// ✔️ shows all connected addresses});},[address,allAccounts]);///// Go to Phantom extensions, change from account1 to account2useEffect(()=>{// actually, not triggered at allconsole.log(address);// 𝗫 shows OLD addressesconsole.log(allAccounts);// 𝗫 shows OLD addressesesvoidwalletProvider?.getAccountAddresses().then((a)=>{console.log({ a });// 𝗫 shows OLD addresses});},[address,allAccounts]);// Page reload resolves
There is unfortunately another bug with XVerse, in which although the wallet is clearly installed and ready to use, it is not identified by appkit. Happened to me and different colleagues and double checked on different platforms.
Here is the a video for Phantom.
Screen.Recording.2025-04-08.at.10.56.17.mp4
Here is also a current workaround, how I deal with account changes:
Link to minimal reproducible example
https://stackblitz.com/edit/github-r4vuagsg?file=src%2FApp.tsx
Summary
XVerse wallet:
Phantom wallet:
List of related npm package versions
Node.js Version
22.8.0
Package Manager
yarn 3.7.0
The text was updated successfully, but these errors were encountered: