import { clusterApiUrl } from "@solana/web3.js";
import "dotenv/config";
/**
* RPC URL for Solana network connection,
* prioritizes custom URL from environment variables
*/
export const RPC_URL =
process.env.SOLANA_RPC_URL || clusterApiUrl("mainnet-beta");
/**
* Known Solana program IDs with their respective names
* Using const assertion to ensure type safety and readonly properties
*/
export const KNOWN_PROGRAMS = {
// DEXs and Swap Programs
RAYDIUM_SWAP: "675kPX9MHTjS2zt1qfr1NYHuzeLXfQM9H24wFSUt1Mp8",
ORCA_SWAP: "9W959DqEETiGZocYWCQPaJ6sBmUzgfxXfqGeTEdp3aQP",
JUPITER_AGGREGATOR: "JUP6LkbZbjS1jKKwapdHNy74zcZ3tLUZoi5QNyVTaV4",
SERUM_DEX_V3: "9xQeWvG816bUx9EPjHmaT23yvVM2ZWbrrpZb9PusVFin",
FLUXBEAM: "FLUXubRmkEi2q6K3Y9kBPg9248ggaZVsoSFhtJHSrm1X",
// Staking and Lending
MARINADE_STAKING: "MarBmsSgKXdrN1egZf5sqe1TMai9K1rChYNDJgjq7aD",
SOLEND: "So1endDq2YkqhipRh3WViPa8hdiSpxWy6z3Z6tMCpAo",
MANGO_MARKETS: "mv3ekLzLbnVPNxjSKvqBpU3ZeZXPQdEC3bp5MDEBG68",
// Core Solana Programs
TOKEN_PROGRAM: "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",
ASSOCIATED_TOKEN_PROGRAM: "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",
METAPLEX: "metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s",
} as const;
/**
* Standard emoji mappings for transaction types
* Using semantically meaningful and widely supported emojis
*/
export const TYPE_EMOJI = {
Transfer: "โ๏ธ", // Upward-right arrow indicating outgoing transfer
Swap: "๐", // Clockwise vertical arrows for swap/exchange
Mint: "โจ", // Sparkles for creation
Staking: "๐", // Pushpin for locking tokens in staking
Trading: "๐", // Chart with upward trend for trading activity
Lending: "๐ฆ", // Bank for lending operations
Liquidity: "๐ง", // Water droplet for liquidity provision
Other: "๐น", // Small blue diamond for other activities
} as const;
/**
* Risk level indicators with color-coded emojis
* Following accessibility standards with meaningful symbols
*/
export const RISK_EMOJI = {
conservative: "๐ข", // Green circle for low risk
moderate: "๐ ", // Orange circle for medium risk
aggressive: "๐ด", // Red circle for high risk
} as const;
/**
* Protocol brand emojis for visual identification
* Maps protocol identifiers to representative emojis
*/
export const PROTOCOL_EMOJI = {
RAYDIUM_SWAP: "โ๏ธ", // Sun for Raydium
ORCA_SWAP: "๐", // Whale for Orca
JUPITER_AGGREGATOR: "๐ช", // Planet for Jupiter
MARINADE_STAKING: "๐งช", // Test tube for Marinade
SOLEND: "๐ต", // Dollar bill for Solend
MANGO_MARKETS: "๐ฅญ", // Mango for Mango Markets
FLUXBEAM: "โก", // Lightning for FluxBeam
Aggregate: "๐", // Bar chart for aggregate stats
} as const;
/**
* Time period constants in milliseconds for efficient date calculations
*/
export const TIME_PERIODS = {
ONE_MINUTE: 60 * 1000,
ONE_HOUR: 60 * 60 * 1000,
ONE_DAY: 24 * 60 * 60 * 1000,
ONE_WEEK: 7 * 24 * 60 * 60 * 1000,
ONE_MONTH: 30 * 24 * 60 * 60 * 1000,
} as const;