원클릭으로
coin-integration
// Add new external coin/token data API integrations. Use when: integrating DexScreener, PumpFun, CoinGecko, or any new blockchain data API. Covers fetch patterns, response types, caching, error handling, and chain mapping.
// Add new external coin/token data API integrations. Use when: integrating DexScreener, PumpFun, CoinGecko, or any new blockchain data API. Covers fetch patterns, response types, caching, error handling, and chain mapping.
Machine-readable project skill file for Memescope Monday — a community-driven memecoin discovery and voting platform.
Create new Next.js API route handlers with rate limiting, auth, and validation. Use when: adding REST endpoints, webhook handlers, public API routes, or authenticated API routes. Covers GET/POST handlers, rate limiting with Redis, Zod validation, and error responses.
Add or modify database tables, columns, enums, and relations in Drizzle ORM. Use when: adding new tables, adding columns to existing tables, creating indexes, defining relations, or running migrations. Covers the full workflow: schema edit → generate → migrate.
Scaffold React components using shadcn/ui and project patterns. Use when: creating new UI components, feature components, client components with interactivity, or server components for data display. Covers props, imports, Tailwind styling, and optimistic updates.
Create new server actions following Memescope Monday patterns. Use when: adding data mutations, server-side fetches, authenticated operations, or new app/actions/ files. Handles session checks, Drizzle queries, revalidation, and error returns.
| name | coin-integration |
| description | Add new external coin/token data API integrations. Use when: integrating DexScreener, PumpFun, CoinGecko, or any new blockchain data API. Covers fetch patterns, response types, caching, error handling, and chain mapping. |
| argument-hint | Describe the integration (e.g., 'add Birdeye API for Solana token data') |
Add external blockchain/token data API integrations in lib/coin-data/.
lib/coin-data/ (e.g., birdeye.ts)// lib/coin-data/my-api.ts
const MY_API_BASE = "https://api.example.com/v1"
// Response types
interface MyApiTokenData {
address: string
symbol: string
name: string
priceUsd: number
marketCap: number
volume24h: number
holders: number
}
// Chain identifier mapping (APIs use different chain names)
const CHAIN_MAP: Record<string, string> = {
solana: "solana",
base: "base",
bnb: "bsc",
ethereum: "ethereum",
}
// Main fetch function
export async function getTokenData(
chain: string,
contractAddress: string,
): Promise<MyApiTokenData | null> {
const apiChain = CHAIN_MAP[chain]
if (!apiChain) return null
try {
const headers: Record<string, string> = {
accept: "application/json",
}
// Optional API key from env
const apiKey = process.env.MY_API_KEY
if (apiKey) headers["X-API-Key"] = apiKey
const res = await fetch(
`${MY_API_BASE}/tokens/${apiChain}/${contractAddress}`,
{
headers,
next: { revalidate: 60 }, // ISR cache: 60 seconds
},
)
if (!res.ok) return null
return await res.json()
} catch (error) {
console.error("MyAPI fetch failed:", error)
return null // Graceful degradation — never throw
}
}
// URL builder for embeds/links
export function getMyApiUrl(chain: string, contractAddress: string): string {
const apiChain = CHAIN_MAP[chain] || "solana"
return `https://example.com/${apiChain}/${contractAddress}`
}
lib/coin-data/<api-name>.tsnull or [] on failure (graceful degradation)console.error("ApiName fetch failed:", error)next: { revalidate: N } in fetch optionsprocess.env — add optional header if key existssolana, base, bnb, ethereum) to API-specific identifierslib/constants.ts)dexscreener.ts, coingecko.ts, pumpfun.ts