mirror of
https://github.com/neynarxyz/create-farcaster-mini-app.git
synced 2025-12-09 10:52:32 -05:00
Revert "Merge pull request #15 from neynarxyz/shreyas-formatting"
This reverts commitb1fdfc19a9, reversing changes made tob9e2087bd8.
This commit is contained in:
@@ -10,7 +10,7 @@ export async function GET() {
|
||||
console.error('Error fetching nonce:', error);
|
||||
return NextResponse.json(
|
||||
{ error: 'Failed to fetch nonce' },
|
||||
{ status: 500 },
|
||||
{ status: 500 }
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ export async function GET(request: Request) {
|
||||
if (!message || !signature) {
|
||||
return NextResponse.json(
|
||||
{ error: 'Message and signature are required' },
|
||||
{ status: 400 },
|
||||
{ status: 400 }
|
||||
);
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ export async function GET(request: Request) {
|
||||
console.error('Error in session-signers API:', error);
|
||||
return NextResponse.json(
|
||||
{ error: 'Failed to fetch signers' },
|
||||
{ status: 500 },
|
||||
{ status: 500 }
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ export async function POST() {
|
||||
console.error('Error fetching signer:', error);
|
||||
return NextResponse.json(
|
||||
{ error: 'Failed to fetch signer' },
|
||||
{ status: 500 },
|
||||
{ status: 500 }
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -22,7 +22,7 @@ export async function GET(request: Request) {
|
||||
if (!signerUuid) {
|
||||
return NextResponse.json(
|
||||
{ error: 'signerUuid is required' },
|
||||
{ status: 400 },
|
||||
{ status: 400 }
|
||||
);
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ export async function GET(request: Request) {
|
||||
console.error('Error fetching signed key:', error);
|
||||
return NextResponse.json(
|
||||
{ error: 'Failed to fetch signed key' },
|
||||
{ status: 500 },
|
||||
{ status: 500 }
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { NextResponse } from 'next/server';
|
||||
import { getNeynarClient } from '~/lib/neynar';
|
||||
import { mnemonicToAccount } from 'viem/accounts';
|
||||
import {
|
||||
SIGNED_KEY_REQUEST_TYPE,
|
||||
SIGNED_KEY_REQUEST_VALIDATOR_EIP_712_DOMAIN,
|
||||
} from '~/lib/constants';
|
||||
import { getNeynarClient } from '~/lib/neynar';
|
||||
|
||||
const postRequiredFields = ['signerUuid', 'publicKey'];
|
||||
|
||||
@@ -16,7 +16,7 @@ export async function POST(request: Request) {
|
||||
if (!body[field]) {
|
||||
return NextResponse.json(
|
||||
{ error: `${field} is required` },
|
||||
{ status: 400 },
|
||||
{ status: 400 }
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -26,7 +26,7 @@ export async function POST(request: Request) {
|
||||
if (redirectUrl && typeof redirectUrl !== 'string') {
|
||||
return NextResponse.json(
|
||||
{ error: 'redirectUrl must be a string' },
|
||||
{ status: 400 },
|
||||
{ status: 400 }
|
||||
);
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ export async function POST(request: Request) {
|
||||
if (!seedPhrase) {
|
||||
return NextResponse.json(
|
||||
{ error: 'App configuration missing (SEED_PHRASE or FID)' },
|
||||
{ status: 500 },
|
||||
{ status: 500 }
|
||||
);
|
||||
}
|
||||
|
||||
@@ -85,7 +85,7 @@ export async function POST(request: Request) {
|
||||
console.error('Error registering signed key:', error);
|
||||
return NextResponse.json(
|
||||
{ error: 'Failed to register signed key' },
|
||||
{ status: 500 },
|
||||
{ status: 500 }
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ export async function GET(request: Request) {
|
||||
{
|
||||
error: `${param} parameter is required`,
|
||||
},
|
||||
{ status: 400 },
|
||||
{ status: 400 }
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -32,7 +32,7 @@ export async function GET(request: Request) {
|
||||
console.error('Error fetching signers:', error);
|
||||
return NextResponse.json(
|
||||
{ error: 'Failed to fetch signers' },
|
||||
{ status: 500 },
|
||||
{ status: 500 }
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,12 +8,15 @@ export async function POST(request: Request) {
|
||||
const { token } = await request.json();
|
||||
|
||||
if (!token) {
|
||||
return NextResponse.json({ error: 'Token is required' }, { status: 400 });
|
||||
return NextResponse.json(
|
||||
{ error: 'Token is required' },
|
||||
{ status: 400 }
|
||||
);
|
||||
}
|
||||
|
||||
// Get domain from environment or request
|
||||
const domain = process.env.NEXT_PUBLIC_URL
|
||||
? new URL(process.env.NEXT_PUBLIC_URL).hostname
|
||||
const domain = process.env.NEXT_PUBLIC_URL
|
||||
? new URL(process.env.NEXT_PUBLIC_URL).hostname
|
||||
: request.headers.get('host') || 'localhost';
|
||||
|
||||
try {
|
||||
@@ -32,7 +35,10 @@ export async function POST(request: Request) {
|
||||
} catch (e) {
|
||||
if (e instanceof Errors.InvalidTokenError) {
|
||||
console.info('Invalid token:', e.message);
|
||||
return NextResponse.json({ error: 'Invalid token' }, { status: 401 });
|
||||
return NextResponse.json(
|
||||
{ error: 'Invalid token' },
|
||||
{ status: 401 }
|
||||
);
|
||||
}
|
||||
throw e;
|
||||
}
|
||||
@@ -40,7 +46,7 @@ export async function POST(request: Request) {
|
||||
console.error('Token validation error:', error);
|
||||
return NextResponse.json(
|
||||
{ error: 'Internal server error' },
|
||||
{ status: 500 },
|
||||
{ status: 500 }
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,21 +4,18 @@ export async function GET(request: Request) {
|
||||
const apiKey = process.env.NEYNAR_API_KEY;
|
||||
const { searchParams } = new URL(request.url);
|
||||
const fid = searchParams.get('fid');
|
||||
|
||||
|
||||
if (!apiKey) {
|
||||
return NextResponse.json(
|
||||
{
|
||||
error:
|
||||
'Neynar API key is not configured. Please add NEYNAR_API_KEY to your environment variables.',
|
||||
},
|
||||
{ status: 500 },
|
||||
{ error: 'Neynar API key is not configured. Please add NEYNAR_API_KEY to your environment variables.' },
|
||||
{ status: 500 }
|
||||
);
|
||||
}
|
||||
|
||||
if (!fid) {
|
||||
return NextResponse.json(
|
||||
{ error: 'FID parameter is required' },
|
||||
{ status: 400 },
|
||||
{ status: 400 }
|
||||
);
|
||||
}
|
||||
|
||||
@@ -27,28 +24,23 @@ export async function GET(request: Request) {
|
||||
`https://api.neynar.com/v2/farcaster/user/best_friends?fid=${fid}&limit=3`,
|
||||
{
|
||||
headers: {
|
||||
'x-api-key': apiKey,
|
||||
"x-api-key": apiKey,
|
||||
},
|
||||
},
|
||||
}
|
||||
);
|
||||
|
||||
if (!response.ok) {
|
||||
throw new Error(`Neynar API error: ${response.statusText}`);
|
||||
}
|
||||
|
||||
const { users } = (await response.json()) as {
|
||||
users: { user: { fid: number; username: string } }[];
|
||||
};
|
||||
const { users } = await response.json() as { users: { user: { fid: number; username: string } }[] };
|
||||
|
||||
return NextResponse.json({ bestFriends: users });
|
||||
} catch (error) {
|
||||
console.error('Failed to fetch best friends:', error);
|
||||
return NextResponse.json(
|
||||
{
|
||||
error:
|
||||
'Failed to fetch best friends. Please check your Neynar API key and try again.',
|
||||
},
|
||||
{ status: 500 },
|
||||
{ error: 'Failed to fetch best friends. Please check your Neynar API key and try again.' },
|
||||
{ status: 500 }
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
import { ImageResponse } from 'next/og';
|
||||
import { NextRequest } from 'next/server';
|
||||
import { getNeynarUser } from '~/lib/neynar';
|
||||
import { ImageResponse } from "next/og";
|
||||
import { NextRequest } from "next/server";
|
||||
import { getNeynarUser } from "~/lib/neynar";
|
||||
|
||||
export const dynamic = 'force-dynamic';
|
||||
|
||||
@@ -15,24 +15,16 @@ export async function GET(request: NextRequest) {
|
||||
<div tw="flex h-full w-full flex-col justify-center items-center relative bg-primary">
|
||||
{user?.pfp_url && (
|
||||
<div tw="flex w-96 h-96 rounded-full overflow-hidden mb-8 border-8 border-white">
|
||||
<img
|
||||
src={user.pfp_url}
|
||||
alt="Profile"
|
||||
tw="w-full h-full object-cover"
|
||||
/>
|
||||
<img src={user.pfp_url} alt="Profile" tw="w-full h-full object-cover" />
|
||||
</div>
|
||||
)}
|
||||
<h1 tw="text-8xl text-white">
|
||||
{user?.display_name
|
||||
? `Hello from ${user.display_name ?? user.username}!`
|
||||
: 'Hello!'}
|
||||
</h1>
|
||||
<h1 tw="text-8xl text-white">{user?.display_name ? `Hello from ${user.display_name ?? user.username}!` : 'Hello!'}</h1>
|
||||
<p tw="text-5xl mt-4 text-white opacity-80">Powered by Neynar 🪐</p>
|
||||
</div>
|
||||
),
|
||||
{
|
||||
width: 1200,
|
||||
height: 800,
|
||||
},
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,9 @@
|
||||
import { NextRequest } from 'next/server';
|
||||
import { notificationDetailsSchema } from '@farcaster/miniapp-sdk';
|
||||
import { z } from 'zod';
|
||||
import { setUserNotificationDetails } from '~/lib/kv';
|
||||
import { sendNeynarMiniAppNotification } from '~/lib/neynar';
|
||||
import { sendMiniAppNotification } from '~/lib/notifs';
|
||||
import { notificationDetailsSchema } from "@farcaster/miniapp-sdk";
|
||||
import { NextRequest } from "next/server";
|
||||
import { z } from "zod";
|
||||
import { setUserNotificationDetails } from "~/lib/kv";
|
||||
import { sendMiniAppNotification } from "~/lib/notifs";
|
||||
import { sendNeynarMiniAppNotification } from "~/lib/neynar";
|
||||
|
||||
const requestSchema = z.object({
|
||||
fid: z.number(),
|
||||
@@ -13,8 +13,7 @@ const requestSchema = z.object({
|
||||
export async function POST(request: NextRequest) {
|
||||
// If Neynar is enabled, we don't need to store notification details
|
||||
// as they will be managed by Neynar's system
|
||||
const neynarEnabled =
|
||||
process.env.NEYNAR_API_KEY && process.env.NEYNAR_CLIENT_ID;
|
||||
const neynarEnabled = process.env.NEYNAR_API_KEY && process.env.NEYNAR_CLIENT_ID;
|
||||
|
||||
const requestJson = await request.json();
|
||||
const requestBody = requestSchema.safeParse(requestJson);
|
||||
@@ -22,7 +21,7 @@ export async function POST(request: NextRequest) {
|
||||
if (requestBody.success === false) {
|
||||
return Response.json(
|
||||
{ success: false, errors: requestBody.error.errors },
|
||||
{ status: 400 },
|
||||
{ status: 400 }
|
||||
);
|
||||
}
|
||||
|
||||
@@ -30,29 +29,27 @@ export async function POST(request: NextRequest) {
|
||||
if (!neynarEnabled) {
|
||||
await setUserNotificationDetails(
|
||||
Number(requestBody.data.fid),
|
||||
requestBody.data.notificationDetails,
|
||||
requestBody.data.notificationDetails
|
||||
);
|
||||
}
|
||||
|
||||
// Use appropriate notification function based on Neynar status
|
||||
const sendNotification = neynarEnabled
|
||||
? sendNeynarMiniAppNotification
|
||||
: sendMiniAppNotification;
|
||||
const sendNotification = neynarEnabled ? sendNeynarMiniAppNotification : sendMiniAppNotification;
|
||||
const sendResult = await sendNotification({
|
||||
fid: Number(requestBody.data.fid),
|
||||
title: 'Test notification',
|
||||
body: 'Sent at ' + new Date().toISOString(),
|
||||
title: "Test notification",
|
||||
body: "Sent at " + new Date().toISOString(),
|
||||
});
|
||||
|
||||
if (sendResult.state === 'error') {
|
||||
if (sendResult.state === "error") {
|
||||
return Response.json(
|
||||
{ success: false, error: sendResult.error },
|
||||
{ status: 500 },
|
||||
{ status: 500 }
|
||||
);
|
||||
} else if (sendResult.state === 'rate_limit') {
|
||||
} else if (sendResult.state === "rate_limit") {
|
||||
return Response.json(
|
||||
{ success: false, error: 'Rate limited' },
|
||||
{ status: 429 },
|
||||
{ success: false, error: "Rate limited" },
|
||||
{ status: 429 }
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,32 +1,29 @@
|
||||
import { NextResponse } from 'next/server';
|
||||
import { NeynarAPIClient } from '@neynar/nodejs-sdk';
|
||||
import { NextResponse } from 'next/server';
|
||||
|
||||
export async function GET(request: Request) {
|
||||
const apiKey = process.env.NEYNAR_API_KEY;
|
||||
const { searchParams } = new URL(request.url);
|
||||
const fids = searchParams.get('fids');
|
||||
|
||||
|
||||
if (!apiKey) {
|
||||
return NextResponse.json(
|
||||
{
|
||||
error:
|
||||
'Neynar API key is not configured. Please add NEYNAR_API_KEY to your environment variables.',
|
||||
},
|
||||
{ status: 500 },
|
||||
{ error: 'Neynar API key is not configured. Please add NEYNAR_API_KEY to your environment variables.' },
|
||||
{ status: 500 }
|
||||
);
|
||||
}
|
||||
|
||||
if (!fids) {
|
||||
return NextResponse.json(
|
||||
{ error: 'FIDs parameter is required' },
|
||||
{ status: 400 },
|
||||
{ status: 400 }
|
||||
);
|
||||
}
|
||||
|
||||
try {
|
||||
const neynar = new NeynarAPIClient({ apiKey });
|
||||
const fidsArray = fids.split(',').map(fid => parseInt(fid.trim()));
|
||||
|
||||
|
||||
const { users } = await neynar.fetchBulkUsers({
|
||||
fids: fidsArray,
|
||||
});
|
||||
@@ -35,11 +32,8 @@ export async function GET(request: Request) {
|
||||
} catch (error) {
|
||||
console.error('Failed to fetch users:', error);
|
||||
return NextResponse.json(
|
||||
{
|
||||
error:
|
||||
'Failed to fetch users. Please check your Neynar API key and try again.',
|
||||
},
|
||||
{ status: 500 },
|
||||
{ error: 'Failed to fetch users. Please check your Neynar API key and try again.' },
|
||||
{ status: 500 }
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,21 +1,20 @@
|
||||
import { NextRequest } from 'next/server';
|
||||
import {
|
||||
ParseWebhookEvent,
|
||||
parseWebhookEvent,
|
||||
verifyAppKeyWithNeynar,
|
||||
} from '@farcaster/miniapp-node';
|
||||
import { APP_NAME } from '~/lib/constants';
|
||||
} from "@farcaster/miniapp-node";
|
||||
import { NextRequest } from "next/server";
|
||||
import { APP_NAME } from "~/lib/constants";
|
||||
import {
|
||||
deleteUserNotificationDetails,
|
||||
setUserNotificationDetails,
|
||||
} from '~/lib/kv';
|
||||
import { sendMiniAppNotification } from '~/lib/notifs';
|
||||
} from "~/lib/kv";
|
||||
import { sendMiniAppNotification } from "~/lib/notifs";
|
||||
|
||||
export async function POST(request: NextRequest) {
|
||||
// If Neynar is enabled, we don't need to handle webhooks here
|
||||
// as they will be handled by Neynar's webhook endpoint
|
||||
const neynarEnabled =
|
||||
process.env.NEYNAR_API_KEY && process.env.NEYNAR_CLIENT_ID;
|
||||
const neynarEnabled = process.env.NEYNAR_API_KEY && process.env.NEYNAR_CLIENT_ID;
|
||||
if (neynarEnabled) {
|
||||
return Response.json({ success: true });
|
||||
}
|
||||
@@ -29,24 +28,24 @@ export async function POST(request: NextRequest) {
|
||||
const error = e as ParseWebhookEvent.ErrorType;
|
||||
|
||||
switch (error.name) {
|
||||
case 'VerifyJsonFarcasterSignature.InvalidDataError':
|
||||
case 'VerifyJsonFarcasterSignature.InvalidEventDataError':
|
||||
case "VerifyJsonFarcasterSignature.InvalidDataError":
|
||||
case "VerifyJsonFarcasterSignature.InvalidEventDataError":
|
||||
// The request data is invalid
|
||||
return Response.json(
|
||||
{ success: false, error: error.message },
|
||||
{ status: 400 },
|
||||
{ status: 400 }
|
||||
);
|
||||
case 'VerifyJsonFarcasterSignature.InvalidAppKeyError':
|
||||
case "VerifyJsonFarcasterSignature.InvalidAppKeyError":
|
||||
// The app key is invalid
|
||||
return Response.json(
|
||||
{ success: false, error: error.message },
|
||||
{ status: 401 },
|
||||
{ status: 401 }
|
||||
);
|
||||
case 'VerifyJsonFarcasterSignature.VerifyAppKeyError':
|
||||
case "VerifyJsonFarcasterSignature.VerifyAppKeyError":
|
||||
// Internal error verifying the app key (caller may want to try again)
|
||||
return Response.json(
|
||||
{ success: false, error: error.message },
|
||||
{ status: 500 },
|
||||
{ status: 500 }
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -57,33 +56,33 @@ export async function POST(request: NextRequest) {
|
||||
// Only handle notifications if Neynar is not enabled
|
||||
// When Neynar is enabled, notifications are handled through their webhook
|
||||
switch (event.event) {
|
||||
case 'frame_added':
|
||||
case "frame_added":
|
||||
if (event.notificationDetails) {
|
||||
await setUserNotificationDetails(fid, event.notificationDetails);
|
||||
await sendMiniAppNotification({
|
||||
fid,
|
||||
title: `Welcome to ${APP_NAME}`,
|
||||
body: 'Mini app is now added to your client',
|
||||
body: "Mini app is now added to your client",
|
||||
});
|
||||
} else {
|
||||
await deleteUserNotificationDetails(fid);
|
||||
}
|
||||
break;
|
||||
|
||||
case 'frame_removed':
|
||||
case "frame_removed":
|
||||
await deleteUserNotificationDetails(fid);
|
||||
break;
|
||||
|
||||
case 'notifications_enabled':
|
||||
case "notifications_enabled":
|
||||
await setUserNotificationDetails(fid, event.notificationDetails);
|
||||
await sendMiniAppNotification({
|
||||
fid,
|
||||
title: `Welcome to ${APP_NAME}`,
|
||||
body: 'Notifications are now enabled',
|
||||
body: "Notifications are now enabled",
|
||||
});
|
||||
break;
|
||||
|
||||
case 'notifications_disabled':
|
||||
case "notifications_disabled":
|
||||
await deleteUserNotificationDetails(fid);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
'use client';
|
||||
"use client";
|
||||
|
||||
import dynamic from 'next/dynamic';
|
||||
import { APP_NAME } from '~/lib/constants';
|
||||
import dynamic from "next/dynamic";
|
||||
import { APP_NAME } from "~/lib/constants";
|
||||
|
||||
// note: dynamic import is required for components that use the Frame SDK
|
||||
const AppComponent = dynamic(() => import('~/components/App'), {
|
||||
const AppComponent = dynamic(() => import("~/components/App"), {
|
||||
ssr: false,
|
||||
});
|
||||
|
||||
export default function App(
|
||||
{ title }: { title?: string } = { title: APP_NAME },
|
||||
{ title }: { title?: string } = { title: APP_NAME }
|
||||
) {
|
||||
return <AppComponent title={title} />;
|
||||
}
|
||||
|
||||
@@ -62,11 +62,11 @@ body {
|
||||
.container {
|
||||
@apply mx-auto max-w-md px-4;
|
||||
}
|
||||
|
||||
|
||||
.container-wide {
|
||||
@apply mx-auto max-w-lg px-4;
|
||||
}
|
||||
|
||||
|
||||
.container-narrow {
|
||||
@apply mx-auto max-w-sm px-4;
|
||||
}
|
||||
@@ -75,7 +75,7 @@ body {
|
||||
.card {
|
||||
@apply bg-white dark:bg-gray-800 rounded-lg border border-gray-200 dark:border-gray-700 shadow-sm;
|
||||
}
|
||||
|
||||
|
||||
.card-primary {
|
||||
@apply bg-primary/10 border-primary/20;
|
||||
}
|
||||
@@ -84,15 +84,15 @@ body {
|
||||
.btn {
|
||||
@apply inline-flex items-center justify-center rounded-lg px-4 py-2 text-sm font-medium transition-colors focus:outline-none focus:ring-2 focus:ring-offset-2 disabled:opacity-50 disabled:pointer-events-none;
|
||||
}
|
||||
|
||||
|
||||
.btn-primary {
|
||||
@apply bg-primary text-white hover:bg-primary-dark focus:ring-primary;
|
||||
}
|
||||
|
||||
|
||||
.btn-secondary {
|
||||
@apply bg-secondary text-gray-900 hover:bg-gray-200 focus:ring-gray-500 dark:bg-secondary-dark dark:text-gray-100 dark:hover:bg-gray-600;
|
||||
}
|
||||
|
||||
|
||||
.btn-outline {
|
||||
@apply border border-gray-300 bg-transparent hover:bg-gray-50 focus:ring-gray-500 dark:border-gray-600 dark:hover:bg-gray-800;
|
||||
}
|
||||
@@ -106,7 +106,7 @@ body {
|
||||
.spinner {
|
||||
@apply animate-spin rounded-full border-2 border-gray-300 border-t-primary;
|
||||
}
|
||||
|
||||
|
||||
.spinner-primary {
|
||||
@apply animate-spin rounded-full border-2 border-white border-t-transparent;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import type { Metadata } from 'next';
|
||||
import '~/app/globals.css';
|
||||
import { Providers } from '~/app/providers';
|
||||
import { APP_NAME, APP_DESCRIPTION } from '~/lib/constants';
|
||||
import type { Metadata } from "next";
|
||||
|
||||
import "~/app/globals.css";
|
||||
import { Providers } from "~/app/providers";
|
||||
import { APP_NAME, APP_DESCRIPTION } from "~/lib/constants";
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: APP_NAME,
|
||||
@@ -12,7 +13,7 @@ export default async function RootLayout({
|
||||
children,
|
||||
}: Readonly<{
|
||||
children: React.ReactNode;
|
||||
}>) {
|
||||
}>) {
|
||||
return (
|
||||
<html lang="en">
|
||||
<body>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Metadata } from 'next';
|
||||
import { APP_NAME, APP_DESCRIPTION, APP_OG_IMAGE_URL } from '~/lib/constants';
|
||||
import { getMiniAppEmbedMetadata } from '~/lib/utils';
|
||||
import App from './app';
|
||||
import { Metadata } from "next";
|
||||
import App from "./app";
|
||||
import { APP_NAME, APP_DESCRIPTION, APP_OG_IMAGE_URL } from "~/lib/constants";
|
||||
import { getMiniAppEmbedMetadata } from "~/lib/utils";
|
||||
|
||||
export const revalidate = 300;
|
||||
|
||||
@@ -14,11 +14,11 @@ export async function generateMetadata(): Promise<Metadata> {
|
||||
images: [APP_OG_IMAGE_URL],
|
||||
},
|
||||
other: {
|
||||
'fc:frame': JSON.stringify(getMiniAppEmbedMetadata()),
|
||||
"fc:frame": JSON.stringify(getMiniAppEmbedMetadata()),
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
export default function Home() {
|
||||
return <App />;
|
||||
return (<App />);
|
||||
}
|
||||
|
||||
@@ -9,10 +9,14 @@ const WagmiProvider = dynamic(
|
||||
() => import('~/components/providers/WagmiProvider'),
|
||||
{
|
||||
ssr: false,
|
||||
},
|
||||
}
|
||||
);
|
||||
|
||||
export function Providers({ children }: { children: React.ReactNode }) {
|
||||
export function Providers({
|
||||
children,
|
||||
}: {
|
||||
children: React.ReactNode;
|
||||
}) {
|
||||
const solanaEndpoint =
|
||||
process.env.SOLANA_RPC_ENDPOINT || 'https://solana-rpc.publicnode.com';
|
||||
return (
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { redirect } from 'next/navigation';
|
||||
import type { Metadata } from 'next';
|
||||
import { APP_URL, APP_NAME, APP_DESCRIPTION } from '~/lib/constants';
|
||||
import { getMiniAppEmbedMetadata } from '~/lib/utils';
|
||||
import type { Metadata } from "next";
|
||||
import { redirect } from "next/navigation";
|
||||
import { APP_URL, APP_NAME, APP_DESCRIPTION } from "~/lib/constants";
|
||||
import { getMiniAppEmbedMetadata } from "~/lib/utils";
|
||||
export const revalidate = 300;
|
||||
|
||||
// This is an example of how to generate a dynamically generated share page based on fid:
|
||||
@@ -23,12 +23,12 @@ export async function generateMetadata({
|
||||
images: [imageUrl],
|
||||
},
|
||||
other: {
|
||||
'fc:frame': JSON.stringify(getMiniAppEmbedMetadata(imageUrl)),
|
||||
"fc:frame": JSON.stringify(getMiniAppEmbedMetadata(imageUrl)),
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
export default function SharePage() {
|
||||
// redirect to home page
|
||||
redirect('/');
|
||||
redirect("/");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user