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