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

# Wallet

> An object containing the attributes about the user wallets.

<Card title="Recommended: JavaScript SDK with React Hooks" icon="react" color="#4779FE">
  For new React apps, we recommend the JavaScript SDK with React Hooks (`@dynamic-labs-sdk/react-hooks`) instead of the legacy React SDK documented here. The JS SDK comes with many benefits such as a much smaller bundle size and other optimizations. Use the [React quickstart (JavaScript SDK)](/javascript/reference/react-quickstart) to get started.
</Card>

### Props

| Field                                           | Description                                                                                             |
| ----------------------------------------------- | ------------------------------------------------------------------------------------------------------- |
| additionalAddresses: WalletAdditionalAddress\[] | Additional addresses associated to the wallet (e.g. ordinals and payment addresses for bitcoin wallets) |
| address: string                                 | Public address of the connected wallet                                                                  |
| chain: string                                   | Current BlockChain name (e.g: 'ETH', 'SOL', 'BTC', etc)                                                 |
| connector: WalletConnector                      | The wallet connector object                                                                             |
| id: string                                      | The wallet's unique id (matches thw wallet verified credential on connect-anf-sign)                     |
| isAuthenticated: boolean                        | True if the user is authenticated, otherwise it's false                                                 |
| key: string                                     | The wallet key (e.g. metamask, phantom, etc)                                                            |

### Methods

| Method                                                                | Description                                                                                                          |
| --------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- |
| getBalance(): Promise\<string \| undefined>                           | Retrieves the balance of the wallet.                                                                                 |
| getNameService(): Promise\<NameServiceData \| undefined>              | Retrieves the name service data associated with the wallet.                                                          |
| isConnected(): Promise\<boolean>                                      | If the wallet is connected.                                                                                          |
| proveOwnership(messageToSign: string): Promise\<string\ \| undefined> | Proves ownership of the wallet by signing a message.                                                                 |
| signMessage(messageToSign: string): Promise\<string\ \| undefined>    | Signs a message using the wallet.                                                                                    |
| switchNetwork(networkChainId: number \| string): Promise\<void>       | Switches the network that the wallet is connected to.                                                                |
| sync(): Promise\<void>                                                | Prompts the user to reconnect the wallet if not connected and only resolves when the wallet is connected and active. |
