2025-02-11 21:52:34 +05:30
|
|
|
'use client';
|
|
|
|
|
|
|
|
import { PrivyProvider } from '@privy-io/react-auth';
|
|
|
|
import { ReactNode , useEffect } from 'react';
|
2025-02-13 21:53:43 +05:30
|
|
|
// Replace this with any of the networks listed at https://github.com/wevm/viem/blob/main/src/chains/index.ts
|
|
|
|
import {bsc} from 'viem/chains';
|
2025-02-11 21:52:34 +05:30
|
|
|
|
|
|
|
export function Providers({ children }: { children: ReactNode }) {
|
|
|
|
useEffect(() => {
|
|
|
|
localStorage.removeItem('privy:embedded-wallet:iframe-ready');
|
|
|
|
localStorage.removeItem('privy:embedded-wallet:ready');
|
|
|
|
}, []);
|
|
|
|
|
|
|
|
return (
|
|
|
|
<PrivyProvider
|
|
|
|
appId={process.env.NEXT_PUBLIC_PRIVY_APP_ID || ''}
|
|
|
|
config={{
|
|
|
|
"appearance": {
|
|
|
|
"accentColor": "#6A6FF5",
|
|
|
|
"theme":"#FFFFFF",
|
|
|
|
"showWalletLoginFirst": false,
|
|
|
|
"logo": "https://auth.privy.io/logos/privy-logo.png",
|
2025-02-13 13:26:24 +00:00
|
|
|
"walletChainType": 'ethereum-only',
|
2025-02-13 14:24:42 +00:00
|
|
|
"walletList": ['metamask', 'wallet_connect', 'coinbase_wallet', 'rabby_wallet', 'cryptocom','safe']
|
2025-02-11 21:52:34 +05:30
|
|
|
},
|
|
|
|
"loginMethods": [
|
|
|
|
"email",
|
|
|
|
"wallet"
|
|
|
|
],
|
|
|
|
"embeddedWallets": {
|
|
|
|
"createOnLogin": "all-users",
|
|
|
|
"requireUserPasswordOnCreate": false,
|
|
|
|
"showWalletUIs": true
|
|
|
|
},
|
|
|
|
"mfa": {
|
|
|
|
"noPromptOnMfaRequired": false
|
2025-02-13 15:57:01 +00:00
|
|
|
},
|
2025-02-13 21:53:43 +05:30
|
|
|
defaultChain: bsc,
|
|
|
|
supportedChains: [bsc]
|
2025-02-11 21:52:34 +05:30
|
|
|
}}
|
|
|
|
>
|
|
|
|
{children}
|
|
|
|
</PrivyProvider>
|
|
|
|
);
|
|
|
|
}
|