# WalletProvider

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>
    );
};
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://aleo-hooks.gitbook.io/aleo-hooks/walletprovider.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
