> For the complete documentation index, see [llms.txt](https://aleo-hooks.gitbook.io/aleo-hooks/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://aleo-hooks.gitbook.io/aleo-hooks/walletprovider.md).

# WalletProvider

Top level component for the Aleo Hook library

All compents that will `aleo-hooks` must reside under WalletProvider component.

WalletProvider props:

```typescript
export interface WalletProviderProps {
    children: any;
    wallets: Adapter[]; // list of supported wallet adapters
    decryptPermission?: DecryptPermission; // allow app decrypting data
    programs?: string[]; // programs that app can execute
    network?: WalletAdapterNetwork; // network to connect to
    autoConnect?: boolean; // if true, connect on refresh
    onError?: (error: WalletError) => void; // error callback
    localStorageKey?: string; // key to save a selected wallet in a storage
}
```

<pre class="language-typescript"><code class="lang-typescript"><strong>export declare enum DecryptPermission {
</strong>    NoDecrypt = "NO_DECRYPT",
    UponRequest = "DECRYPT_UPON_REQUEST",
    AutoDecrypt = "AUTO_DECRYPT",
    OnChainHistory = "ON_CHAIN_HISTORY"
}

export declare enum WalletAdapterNetwork {
    Testnet = "testnet3"
}
</code></pre>

```tsx
export const Provider: FC<{ children: React.ReactNode }> = ({
    children,
}) => {
    const wallets = useMemo(
        () => [
            new LeoWalletAdapter({
                appName: 'Leo Wallet',
            }),
        ],
        [],
    );

    return (
        <WalletProvider
            wallets={wallets}
            decryptPermission={DecryptPermission.UponRequest}
            network={WalletAdapterNetwork.Testnet}
            autoConnect
        >
            {children}
        </WalletProvider>
    );
};
```
