diff --git a/frontend/src/app/providers.tsx b/frontend/src/app/providers.tsx index b08491f..b642bc6 100644 --- a/frontend/src/app/providers.tsx +++ b/frontend/src/app/providers.tsx @@ -22,6 +22,7 @@ export function Providers({ children }: { children: React.ReactNode }) { return ( + {children} diff --git a/frontend/src/components/RegisterEnokiWallets.tsx b/frontend/src/components/RegisterEnokiWallets.tsx index 455d721..291c6d3 100644 --- a/frontend/src/components/RegisterEnokiWallets.tsx +++ b/frontend/src/components/RegisterEnokiWallets.tsx @@ -2,23 +2,25 @@ import { useSuiClientContext } from "@mysten/dapp-kit"; import { isEnokiNetwork, registerEnokiWallets } from "@mysten/enoki"; +import { SuiClient, getFullnodeUrl } from "@mysten/sui/client"; import { useEffect } from "react"; export function RegisterEnokiWallets() { - const { client, network } = useSuiClientContext(); + // We force Testnet for Enoki as per requirement, even if app is on Mainnet + const enokiNetwork = "testnet"; + + // Create a dedicated client for Enoki on Testnet + const enokiClient = new SuiClient({ url: getFullnodeUrl(enokiNetwork) }); useEffect(() => { - if (!isEnokiNetwork(network)) { - console.log("Enoki: Current network is not supported", network); - return; - } - + // We skip the isEnokiNetwork check since we are forcing a supported network (testnet) + const apiKey = process.env.NEXT_PUBLIC_ENOKI_API_KEY; if (!apiKey || apiKey.startsWith("YOUR_")) { console.error("Enoki: Invalid API Key configuration. Please check your .env.local file."); } - console.log("Enoki: Registering wallets for network", network); + console.log("Enoki: Registering wallets for network", enokiNetwork); const { unregister } = registerEnokiWallets({ apiKey: process.env.NEXT_PUBLIC_ENOKI_API_KEY || "YOUR_PUBLIC_ENOKI_API_KEY", @@ -33,12 +35,12 @@ export function RegisterEnokiWallets() { clientId: process.env.NEXT_PUBLIC_TWITCH_CLIENT_ID || "YOUR_TWITCH_CLIENT_ID", }, }, - client, - network, + client: enokiClient, + network: enokiNetwork, }); return unregister; - }, [client, network]); + }, []); return null; } diff --git a/frontend/src/components/WalletModal.tsx b/frontend/src/components/WalletModal.tsx index 2e13bd9..5e40a9c 100644 --- a/frontend/src/components/WalletModal.tsx +++ b/frontend/src/components/WalletModal.tsx @@ -110,10 +110,13 @@ export function WalletModal({ isOpen }: WalletModalProps) { {/* Connect Button */} -
+
+

+ ⚠ Social Logins (Google, etc.) available on Testnet only +

{/* Bottom Info */}