mirror of
https://github.com/neynarxyz/create-farcaster-mini-app.git
synced 2025-12-09 02:42:30 -05:00
Correct formating imports
This commit is contained in:
@@ -11,14 +11,14 @@ export async function GET(request: Request) {
|
||||
error:
|
||||
'Neynar API key is not configured. Please add NEYNAR_API_KEY to your environment variables.',
|
||||
},
|
||||
{ status: 500 }
|
||||
{ status: 500 },
|
||||
);
|
||||
}
|
||||
|
||||
if (!fid) {
|
||||
return NextResponse.json(
|
||||
{ error: 'FID parameter is required' },
|
||||
{ status: 400 }
|
||||
{ status: 400 },
|
||||
);
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ export async function GET(request: Request) {
|
||||
headers: {
|
||||
'x-api-key': apiKey,
|
||||
},
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
if (!response.ok) {
|
||||
@@ -48,7 +48,7 @@ export async function GET(request: Request) {
|
||||
error:
|
||||
'Failed to fetch best friends. Please check your Neynar API key and try again.',
|
||||
},
|
||||
{ status: 500 }
|
||||
{ status: 500 },
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,6 +33,6 @@ export async function GET(request: NextRequest) {
|
||||
{
|
||||
width: 1200,
|
||||
height: 800,
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { notificationDetailsSchema } from '@farcaster/frame-sdk';
|
||||
import { NextRequest } from 'next/server';
|
||||
import { notificationDetailsSchema } from '@farcaster/frame-sdk';
|
||||
import { z } from 'zod';
|
||||
import { setUserNotificationDetails } from '~/lib/kv';
|
||||
import { sendMiniAppNotification } from '~/lib/notifs';
|
||||
import { sendNeynarMiniAppNotification } from '~/lib/neynar';
|
||||
import { sendMiniAppNotification } from '~/lib/notifs';
|
||||
|
||||
const requestSchema = z.object({
|
||||
fid: z.number(),
|
||||
@@ -22,7 +22,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,7 +30,7 @@ export async function POST(request: NextRequest) {
|
||||
if (!neynarEnabled) {
|
||||
await setUserNotificationDetails(
|
||||
Number(requestBody.data.fid),
|
||||
requestBody.data.notificationDetails
|
||||
requestBody.data.notificationDetails,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -47,12 +47,12 @@ export async function POST(request: NextRequest) {
|
||||
if (sendResult.state === 'error') {
|
||||
return Response.json(
|
||||
{ success: false, error: sendResult.error },
|
||||
{ status: 500 }
|
||||
{ status: 500 },
|
||||
);
|
||||
} else if (sendResult.state === 'rate_limit') {
|
||||
return Response.json(
|
||||
{ success: false, error: 'Rate limited' },
|
||||
{ status: 429 }
|
||||
{ status: 429 },
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { NeynarAPIClient } from '@neynar/nodejs-sdk';
|
||||
import { NextResponse } from 'next/server';
|
||||
import { NeynarAPIClient } from '@neynar/nodejs-sdk';
|
||||
|
||||
export async function GET(request: Request) {
|
||||
const apiKey = process.env.NEYNAR_API_KEY;
|
||||
@@ -12,14 +12,14 @@ export async function GET(request: Request) {
|
||||
error:
|
||||
'Neynar API key is not configured. Please add NEYNAR_API_KEY to your environment variables.',
|
||||
},
|
||||
{ status: 500 }
|
||||
{ status: 500 },
|
||||
);
|
||||
}
|
||||
|
||||
if (!fids) {
|
||||
return NextResponse.json(
|
||||
{ error: 'FIDs parameter is required' },
|
||||
{ status: 400 }
|
||||
{ status: 400 },
|
||||
);
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ export async function GET(request: Request) {
|
||||
error:
|
||||
'Failed to fetch users. Please check your Neynar API key and try again.',
|
||||
},
|
||||
{ status: 500 }
|
||||
{ status: 500 },
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { NextRequest } from 'next/server';
|
||||
import {
|
||||
ParseWebhookEvent,
|
||||
parseWebhookEvent,
|
||||
verifyAppKeyWithNeynar,
|
||||
} from '@farcaster/frame-node';
|
||||
import { NextRequest } from 'next/server';
|
||||
import { APP_NAME } from '~/lib/constants';
|
||||
import {
|
||||
deleteUserNotificationDetails,
|
||||
@@ -34,19 +34,19 @@ export async function POST(request: NextRequest) {
|
||||
// The request data is invalid
|
||||
return Response.json(
|
||||
{ success: false, error: error.message },
|
||||
{ status: 400 }
|
||||
{ status: 400 },
|
||||
);
|
||||
case 'VerifyJsonFarcasterSignature.InvalidAppKeyError':
|
||||
// The app key is invalid
|
||||
return Response.json(
|
||||
{ success: false, error: error.message },
|
||||
{ status: 401 }
|
||||
{ status: 401 },
|
||||
);
|
||||
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 },
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ const AppComponent = dynamic(() => import('~/components/App'), {
|
||||
});
|
||||
|
||||
export default function App(
|
||||
{ title }: { title?: string } = { title: APP_NAME }
|
||||
{ title }: { title?: string } = { title: APP_NAME },
|
||||
) {
|
||||
return <AppComponent title={title} />;
|
||||
}
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import type { Metadata } from 'next';
|
||||
|
||||
import { getSession } from '~/auth';
|
||||
import '~/app/globals.css';
|
||||
import { Providers } from '~/app/providers';
|
||||
import { getSession } from '~/auth';
|
||||
import { APP_NAME, APP_DESCRIPTION } from '~/lib/constants';
|
||||
|
||||
export const metadata: Metadata = {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
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';
|
||||
import App from './app';
|
||||
|
||||
export const revalidate = 300;
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
'use client';
|
||||
|
||||
import dynamic from 'next/dynamic';
|
||||
import { MiniAppProvider } from '@neynar/react';
|
||||
import type { Session } from 'next-auth';
|
||||
import { SessionProvider } from 'next-auth/react';
|
||||
import { MiniAppProvider } from '@neynar/react';
|
||||
import { SafeFarcasterSolanaProvider } from '~/components/providers/SafeFarcasterSolanaProvider';
|
||||
import { ANALYTICS_ENABLED } from '~/lib/constants';
|
||||
|
||||
@@ -11,7 +11,7 @@ const WagmiProvider = dynamic(
|
||||
() => import('~/components/providers/WagmiProvider'),
|
||||
{
|
||||
ssr: false,
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
export function Providers({
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { Metadata } from 'next';
|
||||
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';
|
||||
export const revalidate = 300;
|
||||
|
||||
Reference in New Issue
Block a user