diff --git a/src/app/api/auth/signer/signed_key/route.ts b/src/app/api/auth/signer/signed_key/route.ts index de4c414..d7a3df8 100644 --- a/src/app/api/auth/signer/signed_key/route.ts +++ b/src/app/api/auth/signer/signed_key/route.ts @@ -1,23 +1,13 @@ 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'; const postRequiredFields = ['signerUuid', 'publicKey']; -const SIGNED_KEY_REQUEST_VALIDATOR_EIP_712_DOMAIN = { - name: 'Farcaster SignedKeyRequestValidator', - version: '1', - chainId: 10, - verifyingContract: - '0x00000000fc700472606ed4fa22623acf62c60553' as `0x${string}`, -}; - -const SIGNED_KEY_REQUEST_TYPE = [ - { name: 'requestFid', type: 'uint256' }, - { name: 'key', type: 'bytes' }, - { name: 'deadline', type: 'uint256' }, -]; - export async function POST(request: Request) { const body = await request.json(); diff --git a/src/lib/constants.ts b/src/lib/constants.ts index 6c980be..7a7661b 100644 --- a/src/lib/constants.ts +++ b/src/lib/constants.ts @@ -1,10 +1,10 @@ /** * Application constants and configuration values. - * + * * This file contains all the configuration constants used throughout the mini app. * These values are either sourced from environment variables or hardcoded and provide * configuration for the app's appearance, behavior, and integration settings. - * + * * NOTE: This file is automatically updated by the init script. * Manual changes may be overwritten during project initialization. */ @@ -20,19 +20,19 @@ export const APP_URL = process.env.NEXT_PUBLIC_URL!; * The name of the mini app as displayed to users. * Used in titles, headers, and app store listings. */ -export const APP_NAME = 'Starter Kit'; +export const APP_NAME = 'shreyas-testing-mini-app'; /** * A brief description of the mini app's functionality. * Used in app store listings and metadata. */ -export const APP_DESCRIPTION = 'A demo of the Neynar Starter Kit'; +export const APP_DESCRIPTION = 'A Farcaster mini app created with Neynar'; /** * The primary category for the mini app. * Used for app store categorization and discovery. */ -export const APP_PRIMARY_CATEGORY = 'developer-tools'; +export const APP_PRIMARY_CATEGORY = ''; /** * Tags associated with the mini app. @@ -63,30 +63,31 @@ export const APP_SPLASH_URL = `${APP_URL}/splash.png`; * Background color for the splash screen. * Used as fallback when splash image is loading. */ -export const APP_SPLASH_BACKGROUND_COLOR = "#f7f7f7"; +export const APP_SPLASH_BACKGROUND_COLOR = '#f7f7f7'; // --- UI Configuration --- /** * Text displayed on the main action button. * Used for the primary call-to-action in the mini app. */ -export const APP_BUTTON_TEXT = 'Launch NSK'; +export const APP_BUTTON_TEXT = 'Launch Mini App'; // --- Integration Configuration --- /** * Webhook URL for receiving events from Neynar. - * + * * If Neynar API key and client ID are configured, uses the official * Neynar webhook endpoint. Otherwise, falls back to a local webhook * endpoint for development and testing. */ -export const APP_WEBHOOK_URL = process.env.NEYNAR_API_KEY && process.env.NEYNAR_CLIENT_ID +export const APP_WEBHOOK_URL = + process.env.NEYNAR_API_KEY && process.env.NEYNAR_CLIENT_ID ? `https://api.neynar.com/f/app/${process.env.NEYNAR_CLIENT_ID}/event` : `${APP_URL}/api/webhook`; /** * Flag to enable/disable wallet functionality. - * + * * When true, wallet-related components and features are rendered. * When false, wallet functionality is completely hidden from the UI. * Useful for mini apps that don't require wallet integration. @@ -95,9 +96,25 @@ export const USE_WALLET = true; /** * Flag to enable/disable analytics tracking. - * + * * When true, usage analytics are collected and sent to Neynar. * When false, analytics collection is disabled. * Useful for privacy-conscious users or development environments. */ export const ANALYTICS_ENABLED = true; + +// PLEASE DO NOT UPDATE THIS +export const SIGNED_KEY_REQUEST_VALIDATOR_EIP_712_DOMAIN = { + name: 'Farcaster SignedKeyRequestValidator', + version: '1', + chainId: 10, + verifyingContract: + '0x00000000fc700472606ed4fa22623acf62c60553' as `0x${string}`, +}; + +// PLEASE DO NOT UPDATE THIS +export const SIGNED_KEY_REQUEST_TYPE = [ + { name: 'requestFid', type: 'uint256' }, + { name: 'key', type: 'bytes' }, + { name: 'deadline', type: 'uint256' }, +];