import { useState } from "react"; import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "@/components/ui/collapsible"; import { Button } from "@/components/ui/button"; import { ChevronDown, ChevronUp, Shield, Check, X, ExternalLink, AlertTriangle } from "lucide-react"; interface ExchangeGuide { name: string; color: string; url: string; permissions: { name: string; enabled: boolean; reason: string }[]; steps: string[]; warning: string; } const exchangeGuides: ExchangeGuide[] = [ { name: "Binance", color: "text-warning", url: "https://www.binance.com/en/my/settings/api-management", permissions: [ { name: "Enable Reading", enabled: true, reason: "Required to check balances" }, { name: "Enable Spot & Margin Trading", enabled: true, reason: "Required to execute trades" }, { name: "Enable Withdrawals", enabled: false, reason: "NEVER enable - we don't need withdrawal access" }, { name: "Enable Futures", enabled: false, reason: "Not required for spot trading" }, ], steps: [ "Log in to Binance and go to API Management", "Click 'Create API' and complete 2FA verification", "Name your API key (e.g., 'AUREON Trading')", "Enable only 'Reading' and 'Spot & Margin Trading'", "Add IP whitelist for extra security (optional)", "Copy your API Key and Secret Key" ], warning: "Your Secret Key is only shown once. Save it securely!" }, { name: "Kraken", color: "text-primary", url: "https://www.kraken.com/u/security/api", permissions: [ { name: "Query Funds", enabled: true, reason: "Required to check balances" }, { name: "Query Open Orders & Trades", enabled: true, reason: "Required to track positions" }, { name: "Create & Modify Orders", enabled: true, reason: "Required to execute trades" }, { name: "Cancel/Close Orders", enabled: true, reason: "Required for position management" }, { name: "Withdraw Funds", enabled: false, reason: "NEVER enable - security risk" }, ], steps: [ "Log in to Kraken and go to Security → API", "Click 'Add Key'", "Set key description (e.g., 'AUREON')", "Select only trading-related permissions", "Complete 2FA verification", "Copy your API Key and Private Key" ], warning: "Private Key is only shown once during creation." }, { name: "Alpaca", color: "text-success", url: "https://app.alpaca.markets/brokerage/dashboard/overview", permissions: [ { name: "Trading", enabled: true, reason: "Required for stock trades" }, { name: "Account", enabled: true, reason: "Required to check positions" }, ], steps: [ "Log in to Alpaca Dashboard", "Go to Paper Trading or Live Trading section", "Click 'View API Keys'", "Generate new API key pair", "Copy API Key ID and Secret Key" ], warning: "Start with Paper Trading to test before going live." }, { name: "Capital.com", color: "text-primary", url: "https://capital.com/trading/platform", permissions: [ { name: "API Access", enabled: true, reason: "Required for CFD trading" }, ], steps: [ "Log in to Capital.com", "Go to Settings → API", "Generate API credentials", "Note your account identifier (email)", "Copy API Key" ], warning: "CFD trading involves significant risk. Only trade what you can afford to lose." } ]; export function APIKeySecurityGuide() { const [isOpen, setIsOpen] = useState(false); const [expandedExchange, setExpandedExchange] = useState(null); return (

Follow these guides to create secure API keys for each exchange. NEVER enable withdrawal permissions.

{exchangeGuides.map((guide) => ( setExpandedExchange(open ? guide.name : null)} > {/* Permissions */}

Required Permissions:

{guide.permissions.map((perm) => (
{perm.enabled ? ( ) : ( )}
{perm.name} — {perm.reason}
))}
{/* Steps */}

Setup Steps:

    {guide.steps.map((step, i) => (
  1. {step}
  2. ))}
{/* Warning */}
{guide.warning}
{/* Link */} Open {guide.name} API Settings
))}
); }