Skip to content

WalletUiAccountContextProvider

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.

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

This example shows how you could use the provider.

import { WalletUiAccountContextProvider } from '@wallet-ui/react';
function MyApp({ children }) {
return <WalletUiAccountContextProvider>{children}</WalletUiAccountContextProvider>;
}