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 matchinguse… 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 againstgetWalletAccounts(), 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 withgetSelectedWalletAccount(). 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 throwsWalletAccountNotSelectedErrorotherwise, so you can prompt the user to reselect/reconnect before the signing call fails.
See also
- Connected wallets management (Building UI) — build the full wallet manager
- Connecting external wallets (Building UI) — add a new wallet
- Wallet authentication — connect and verify wallets
- Network management — switch and validate networks