> ## Documentation Index
> Fetch the complete documentation index at: https://www.dynamic.xyz/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Using connected wallets

> The React SDK managed the wallet list, wallet selection, and connection prompts for you. In the JavaScript SDK you read the wallet accounts with functions and build the management UI yourself.

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)](/docs/javascript/building-ui/connected-wallets-management) 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

| React SDK                    | JavaScript SDK                                   |
| ---------------------------- | ------------------------------------------------ |
| `useUserWallets()`           | `getWalletAccounts()` / `useGetWalletAccounts()` |
| `isAuthenticatedWithAWallet` | `isWalletAccountVerified(walletAccount)`         |

`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.

| React SDK (widget wallet-list menu)    | JavaScript SDK (you call)                                                                  |
| -------------------------------------- | ------------------------------------------------------------------------------------------ |
| Remove / unlink a wallet               | `removeWalletAccount()` / `useRemoveWalletAccount()`                                       |
| Verify (prove ownership of) a wallet   | `verifyWalletAccount()` / `useVerifyWalletAccount()`                                       |
| Set the active / primary wallet        | `setSelectedWalletAccount()` (no hook)                                                     |
| Bring a wallet in from another user    | `transferWalletAccount()` / `useTransferWalletAccount()`                                   |
| Check a wallet is ready before signing | `assertWalletAccountSigningAvailability()` / `useAssertWalletAccountSigningAvailability()` |

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

* [Connected wallets management (Building UI)](/docs/javascript/building-ui/connected-wallets-management) — build the full wallet manager
* [Connecting external wallets (Building UI)](/docs/javascript/building-ui/connecting-external-wallets) — add a new wallet
* [Wallet authentication](/docs/javascript/migrating-from-react/wallet-authentication) — connect and verify wallets
* Network management — switch and validate networks
