mirror of
https://github.com/neynarxyz/create-farcaster-mini-app.git
synced 2025-11-16 08:08:56 -05:00
Move constants
This commit is contained in:
parent
2d259d22b0
commit
e0ca42169b
@ -1,23 +1,13 @@
|
|||||||
import { NextResponse } from 'next/server';
|
import { NextResponse } from 'next/server';
|
||||||
import { getNeynarClient } from '~/lib/neynar';
|
import { getNeynarClient } from '~/lib/neynar';
|
||||||
import { mnemonicToAccount } from 'viem/accounts';
|
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 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) {
|
export async function POST(request: Request) {
|
||||||
const body = await request.json();
|
const body = await request.json();
|
||||||
|
|
||||||
|
|||||||
@ -20,19 +20,19 @@ export const APP_URL = process.env.NEXT_PUBLIC_URL!;
|
|||||||
* The name of the mini app as displayed to users.
|
* The name of the mini app as displayed to users.
|
||||||
* Used in titles, headers, and app store listings.
|
* 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.
|
* A brief description of the mini app's functionality.
|
||||||
* Used in app store listings and metadata.
|
* 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.
|
* The primary category for the mini app.
|
||||||
* Used for app store categorization and discovery.
|
* 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.
|
* Tags associated with the mini app.
|
||||||
@ -63,14 +63,14 @@ export const APP_SPLASH_URL = `${APP_URL}/splash.png`;
|
|||||||
* Background color for the splash screen.
|
* Background color for the splash screen.
|
||||||
* Used as fallback when splash image is loading.
|
* Used as fallback when splash image is loading.
|
||||||
*/
|
*/
|
||||||
export const APP_SPLASH_BACKGROUND_COLOR = "#f7f7f7";
|
export const APP_SPLASH_BACKGROUND_COLOR = '#f7f7f7';
|
||||||
|
|
||||||
// --- UI Configuration ---
|
// --- UI Configuration ---
|
||||||
/**
|
/**
|
||||||
* Text displayed on the main action button.
|
* Text displayed on the main action button.
|
||||||
* Used for the primary call-to-action in the mini app.
|
* 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 ---
|
// --- Integration Configuration ---
|
||||||
/**
|
/**
|
||||||
@ -80,7 +80,8 @@ export const APP_BUTTON_TEXT = 'Launch NSK';
|
|||||||
* Neynar webhook endpoint. Otherwise, falls back to a local webhook
|
* Neynar webhook endpoint. Otherwise, falls back to a local webhook
|
||||||
* endpoint for development and testing.
|
* 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`
|
? `https://api.neynar.com/f/app/${process.env.NEYNAR_CLIENT_ID}/event`
|
||||||
: `${APP_URL}/api/webhook`;
|
: `${APP_URL}/api/webhook`;
|
||||||
|
|
||||||
@ -101,3 +102,19 @@ export const USE_WALLET = true;
|
|||||||
* Useful for privacy-conscious users or development environments.
|
* Useful for privacy-conscious users or development environments.
|
||||||
*/
|
*/
|
||||||
export const ANALYTICS_ENABLED = true;
|
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' },
|
||||||
|
];
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user