diff --git a/public/external/logo/coinpaprika.ico b/public/external/logo/coinpaprika.ico new file mode 100644 index 0000000..8771f82 Binary files /dev/null and b/public/external/logo/coinpaprika.ico differ diff --git a/src/components/sections/CommunitySection.tsx b/src/components/sections/CommunitySection.tsx index c650089..6baa476 100644 --- a/src/components/sections/CommunitySection.tsx +++ b/src/components/sections/CommunitySection.tsx @@ -78,6 +78,7 @@ const exchangesData: ColumnData = { items: [ { label: 'nonKYC CCX/BTC', url: 'https://nonkyc.io/market/CCX_BTC' }, { label: 'nonKYC CCX/USDT', url: 'https://nonkyc.io/market/CCX_USDT' }, + { label: 'nonlogs CCX/USDT', url: 'https://nonlogs.io/trade/CCX-USDT' }, ], }; @@ -127,6 +128,14 @@ const bscData: ColumnData = { label: 'PancakeSwap - wCCX/USDT', url: 'https://pancakeswap.finance/swap?inputCurrency=0x55d398326f99059fF775485246999027B3197955&outputCurrency=0x988c11625472340b7b36ff1534893780e0d8d841', }, + { + label: 'MEXC DEX - wCCX/BNB', + url: 'https://www.mexc.com/dex/trade?pair_ca=0x523d5d8ae2f38dd2d8900eb195c132ff19bf6d18&chain_id=56&token_ca=0x988c11625472340b7b36ff1534893780e0d8d841', + }, + { + label: 'KyberSwap - wCCX/BNB', + url: 'https://kyberswap.com/swap/bnb/-to-0x988c11625472340b7b36ff1534893780e0d8d841', + }, ], }; diff --git a/src/components/sections/CryptoWidgetSection.tsx b/src/components/sections/CryptoWidgetSection.tsx index 9dc360e..5a840f1 100644 --- a/src/components/sections/CryptoWidgetSection.tsx +++ b/src/components/sections/CryptoWidgetSection.tsx @@ -1,27 +1,35 @@ import { useEffect, useState } from 'react'; import { appConfig } from '@/config/app.config'; -interface CoinGeckoPrice { +interface PriceData { usd: number; usd_24h_change: number; + source: 'coingecko' | 'coinpaprika'; } export function CryptoWidgetSection() { - const [price, setPrice] = useState(null); + const [price, setPrice] = useState(null); const [loading, setLoading] = useState(true); const [error, setError] = useState(false); useEffect(() => { - // Fetch price from CoinGecko API + // Fetch price from CoinGecko API (primary) or CoinPaprika (fallback) const fetchPrice = async () => { try { - // Try common Conceal Network coin IDs - const coinIds = ['conceal-network', 'conceal', 'ccx']; + // Try CoinGecko first + const coinIds = ['conceal', 'conceal-network']; + let coingeckoSuccess = false; for (const coinId of coinIds) { try { const response = await fetch( - `https://api.coingecko.com/api/v3/simple/price?ids=${coinId}&vs_currencies=usd&include_24hr_change=true` + `https://api.coingecko.com/api/v3/simple/price?ids=${coinId}&vs_currencies=usd&include_24hr_change=true`, + { + mode: 'cors', + headers: { + Accept: 'application/json', + }, + } ); if (response.ok) { @@ -30,26 +38,58 @@ export function CryptoWidgetSection() { setPrice({ usd: data[coinId].usd, usd_24h_change: data[coinId].usd_24h_change || 0, + source: 'coingecko', }); setLoading(false); setError(false); + coingeckoSuccess = true; return; } } else if (response.status === 429) { - // Rate limited - wait longer before retry - console.warn('CoinGecko API rate limited'); - setError(true); - setLoading(false); - return; + // Rate limited - will try fallback + console.warn('CoinGecko API rate limited, trying fallback...'); + break; } } catch (err) { - console.error(`Error fetching price for ${coinId}:`, err); + // CORS or network error - will try fallback + console.warn(`CoinGecko failed for ${coinId}, trying fallback...`); } } - // If none worked, set error - setError(true); - setLoading(false); + // If CoinGecko failed, try CoinPaprika as fallback + if (!coingeckoSuccess) { + try { + // CoinPaprika API - ticker ID is ccx-conceal + const response = await fetch('https://api.coinpaprika.com/v1/tickers/ccx-conceal', { + mode: 'cors', + headers: { + Accept: 'application/json', + }, + }); + + if (response.ok) { + const data = await response.json(); + if (data.quotes?.USD) { + setPrice({ + usd: data.quotes.USD.price, + usd_24h_change: data.quotes.USD.percent_change_24h || 0, + source: 'coinpaprika', + }); + setLoading(false); + setError(false); + return; + } + } + } catch (err) { + console.error('CoinPaprika API failed:', err); + } + } + + // If both APIs failed, set error + if (!coingeckoSuccess) { + setError(true); + setLoading(false); + } } catch (err) { console.error('Error in fetchPrice:', err); setError(true); @@ -132,14 +172,26 @@ export function CryptoWidgetSection() {
Data provided by - - CoinGecko - + {price.source === 'coingecko' ? ( + + CoinGecko + + ) : ( + + CoinPaprika{' '} + CoinPaprika + + )}
diff --git a/src/components/sections/HeroSection.tsx b/src/components/sections/HeroSection.tsx index caa1205..6eca52e 100644 --- a/src/components/sections/HeroSection.tsx +++ b/src/components/sections/HeroSection.tsx @@ -56,16 +56,16 @@ export function HeroSection({ onMount }: HeroSectionProps) { {/* Call-to-action buttons */}
diff --git a/src/components/sections/MarketsSection.tsx b/src/components/sections/MarketsSection.tsx index 6bd7a3a..4edb65d 100644 --- a/src/components/sections/MarketsSection.tsx +++ b/src/components/sections/MarketsSection.tsx @@ -1,6 +1,13 @@ import { Button } from '@/components/ui/Button'; import { SectionHeading } from '@/components/ui/SectionHeading'; +const exchanges = [ + { label: 'nonKYC BTC/CCX', href: 'https://nonkyc.io/market/CCX_BTC' }, + { label: 'nonKYC USDT/CCX', href: 'https://nonkyc.io/market/CCX_USDT' }, + { label: 'Nonlogs USDT/CCX', href: 'https://nonlogs.io/trade/CCX-USDT' }, + // { label: 'AnonEx USDT/CCX', href: 'https://anonex.io/market/CCX_USDT' }, +]; + export function MarketsSection() { return ( <> @@ -15,33 +22,18 @@ export function MarketsSection() {
Buy CCX} title="Markets" />
- - - + {exchanges.map((exchange) => ( + + ))}
@@ -108,6 +100,24 @@ export function MarketsSection() { Bakeryswap + + 0 && sectionRect.top < window.innerHeight; - + if (!isSectionVisible) { // Reset all scales if section is not visible const resetScales = new Map(); @@ -289,8 +291,8 @@ export function RoadmapSection() { // Map distance to scale: 1.22 at center, 1.0 at maxDistance const normalizedDistance = Math.min(1, distanceFromCenter / maxDistance); - const scale = 1.0 + (0.22 * (1 - normalizedDistance)); // 1.6 at center, 1.0 at maxDistance - + const scale = 1.0 + 0.22 * (1 - normalizedDistance); // 1.6 at center, 1.0 at maxDistance + newScales.set(index, scale); }); @@ -311,7 +313,11 @@ export function RoadmapSection() { }, []); return ( -
+
{/* Background image */}
)} - {item.description && — {item.url ? {item.description} : item.description}} + {item.description && ( + + {' '} + —{' '} + {item.url ? ( + + {item.description} + + ) : ( + item.description + )} + + )}