Skip to main content
The React SDK kept a live list of the user’s wallets, tracked which one your app acted on, fired connector events, and rendered the multi-wallet prompts. The JavaScript SDK exposes the same data through functions (and matching React hooks) and leaves the UI — and the choice of which wallet to act on — to you. Building the wallet manager (rendering the list, removing a wallet, keeping the selected wallet in your own state, error handling) is the same in any JavaScript SDK app, so it isn’t repeated here: Connected wallets management (Building UI) covers it with full code. This page is the React→JavaScript translation plus what the widget used to do for you that’s now yours.

Reading the wallet list

getWalletAccounts() returns every connected wallet as a WalletAccount (with address, walletProviderKey, chain, and a verifiedCredentialId that’s non-null once ownership is proven, among other fields). Key difference from React: the SDK does not track a “current” wallet — your app picks which wallet it acts on and stores that choice in your own state, passing the selected WalletAccount into each operation. useGetWalletAccounts() re-renders on connect/verify/removal, so the list stays current.

Wallet actions

The React SDK exposed these as menu items on each wallet in the widget. In the JavaScript SDK each is a function (most with a matching use… hook) you wire into your own manager. All of these take the { walletAccount } you read from getWalletAccounts(), except transferWalletAccount — a wallet that currently belongs to another user is claimed by passing its walletProviderKey (the user reconnects and re-signs to prove ownership), not a WalletAccount.

Reacting to wallet events

useWalletConnectorEvent becomes onWalletProviderEvent() (or the useOnWalletProviderEvent() hook). Read the walletProviderKey off any WalletAccount in your list to subscribe per connected wallet. The events are accountsChanged ({ addresses }), networkChanged ({ networkId }), and disconnected. onWalletProviderEvent returns an unsubscribe function; the hook cleans up automatically.

What the widget did that’s now yours

The React widget rendered these automatically; in the JavaScript SDK they’re small pieces of code you own on top of the functions above.
  • The “new wallet detected” prompt — gone. A connected provider can switch to an address the user hasn’t linked, so listen for accountsChanged, compare the addresses against getWalletAccounts(), and prompt when you see one you don’t know.
  • Tracking the active wallet — record your app’s choice with setSelectedWalletAccount({ walletAccount }) (persisted server-side for verified wallets, so it survives reloads) and read it back with getSelectedWalletAccount(). The SDK stores the selection but only the wagmi integration acts on it.
  • Guarding a signing call — before you sign, call assertWalletAccountSigningAvailability({ walletAccount }). It resolves when the provider still has the wallet active and throws WalletAccountNotSelectedError otherwise, so you can prompt the user to reselect/reconnect before the signing call fails.

See also

Last modified on July 23, 2026