Documentation
Complete technical guide for developers and users
Overview
Chainyze is a Next.js 14 application built with TypeScript and Tailwind CSS. It provides multi-chain wallet analytics through a clean, responsive web interface.
Main Features
Tech Stack
Next.js 14 (App Router)
TypeScript
Tailwind CSS
Recharts
date-fns
Vercel / Cloudflare Pages
Configuration
๐ Chains Config
Chain definitions are located in lib/config/chains.ts. Each chain includes: id, label, chainId, nativeToken, explorerUrl, and optional RPC URL.
๐ Environment Variables
CHAINYZE_DEMO_MODE - Enable/disable demo modeCHAINYZE_DEFAULT_CHAIN - Default chain (e.g., "ethereum")CHAINYZE_ETH_API_KEY - Ethereum API keyCHAINYZE_POLY_API_KEY - Polygon API keyCHAINYZE_ARB_API_KEY - Arbitrum API keyCHAINYZE_BASE_API_KEY - Base API keyCHAINYZE_BSC_API_KEY - BSC API keyCHAINYZE_OPTIMISM_API_KEY - Optimism API keyCHAINYZE_AVALANCHE_API_KEY - Avalanche API keyCHAINYZE_ZKSYNC_API_KEY - zkSync Era API keyCHAINYZE_SCROLL_API_KEY - Scroll API keyCHAINYZE_LINEA_API_KEY - Linea API keyCHAINYZE_BLAST_API_KEY - Blast API keyCHAINYZE_MANTLE_API_KEY - Mantle API keyCHAINYZE_CELO_API_KEY - Celo API keyCHAINYZE_GNOSIS_API_KEY - Gnosis API keyCHAINYZE_MOONBEAM_API_KEY - Moonbeam API keyCHAINYZE_FANTOM_API_KEY - Fantom API keyPattern: CHAINYZE_{CHAIN}_API_KEY for additional chains๐ฎ Demo Mode
Demo mode is automatically enabled if no API keys are configured. It uses deterministic mock data from lib/utils/mockData.ts.
Data Providers
The API layer is structured to support multiple providers. Current implementation uses mock data, but the structure is ready for integration with providers like:
To integrate a provider:
- Extend the base provider interface in
lib/api/providers/base.ts - Update API functions in
lib/api/to use your provider - Add API keys to environment variables
Note: Consider rate limits and implement caching for production use.
Extending the App
๐Adding a New Chain
- Add chain definition to lib/config/chains.ts
- API key detection is automatic - no code changes needed
- Add API key environment variable following pattern: CHAINYZE_{CHAIN}_API_KEY
๐Adding a New Panel
- Create a new component in components/wallet/
- Add it to the wallet page layout
- Follow the existing pattern of Card-based components
โ ๏ธModifying Risk Scoring
- Edit lib/utils/risk.ts
- The computeRiskScore() function contains all heuristics
- Adjust thresholds and scoring logic as needed
Monetization
AdSense placeholder divs are included with specific IDs for easy integration:
ad-hero-topTop of home page
ad-sidebarSidebar on home page
ad-footerFooter area
Replace AdPlaceholder components with your AdSense script. High-engagement pages (wallet analyzer, docs) are ideal for monetization.