diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..9caa6f0 --- /dev/null +++ b/.env.example @@ -0,0 +1,6 @@ +FAL_AI_KEY= + +NEXT_PUBLIC_MTM_TOKEN_MINT=97RggLo3zV5kFGYW4yoQTxr4Xkz4Vg2WPHzNYXXWpump +NEXT_PUBLIC_PAYMENT_RECEIVER_ADDRESS=FFDx3SdAEeXrp6BTmStB4BDHpctGsaasZq4FFcowRobY +NEXT_PUBLIC_SOLANA_RPC_URL=https://young-radial-orb.solana-mainnet.quiknode.pro/67612b364664616c29514e551bf5de38447ca3d4 +NEXT_PUBLIC_SOLANA_WEBSOCKET_URL=wss://young-radial-orb.solana-mainnet.quiknode.pro/67612b364664616c29514e551bf5de38447ca3d4 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..42fc8c0 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +node_modules +.next + +.env diff --git a/src/app/page.tsx b/src/app/page.tsx index 755f1f9..bbcfb5f 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -15,7 +15,7 @@ const Page: React.FC = (): React.ReactElement => { type: null }) - const handleConnect = async (walletType: WalletType): Promise => { + const handleConnect = async (walletType: WalletType): Promise => { try { const newWalletState = await connectWallet(walletType) setWalletState(newWalletState) @@ -29,11 +29,13 @@ const Page: React.FC = (): React.ReactElement => { } } - const handleFluxGeneration = (modelId: string, cost: number) => { return async (prompt: string): Promise => { - if (!walletState.connected || !walletState.publicKey || !window.solflare) { - return { error: 'Wallet not connected' } + const type = walletState.type; + if (!walletState.connected || !walletState.publicKey || + (type === 'phantom' && !window.phantom) || + (type === 'solflare' && !window.solflare)) { + return { error: 'Wallet not connected' } } // Process payment first @@ -63,7 +65,7 @@ const Page: React.FC = (): React.ReactElement => {

Use MTM to generate memes

- + { onGenerate={handleFluxGeneration(model.modelId, model.cost)} /> ))} - + {/* Coming Soon Card */}
@@ -98,12 +100,11 @@ const Page: React.FC = (): React.ReactElement => { TBD
-