Wallet UI LogoWallet UI

WalletUiAccountContextProvider

The provider for the WalletUiAccountContext.

The WalletUiAccountContextProvider is a React context provider that manages the state of the selected wallet account. It also handles saving and retrieving the selected wallet from local storage.

This component is used internally by the main WalletUi provider and you probably won't need to use it directly.

Props

NameTypeDescription
childrenReact.ReactNodeThe content to render.
clusterSolanaClusterThe currently selected Solana cluster.
storageStorageAccountThe storage to use for persisting the account.

Example

This example shows how you could use the provider.

import { WalletUiAccountContextProvider } from '@wallet-ui/react';

function MyApp({ children }) {
    return <WalletUiAccountContextProvider>{children}</WalletUiAccountContextProvider>;
}

On this page