# neiro-currencies API Base URL: https://price.neiropay.app Version: 2.4.1 ## Quick Reference **Get token amount for fiat payment:** GET /convert?pair={FIAT}-{TOKEN}&input={amount} → Use response.token.baseUnits for on-chain transfer **Display fiat value of token:** GET /convert?pair={TOKEN}-{FIAT}&input={amount} → Use response.fiat.amount for UI display ## Endpoints ### GET /health Health check (no rate limit). ### GET /supported-currencies List tokens, fiats, and valid pairs. ### GET /price?pairs=NEIRO-USDC,NEIRO-USD,SOL-USDC Get exchange rates. Omit pairs for all defaults. ### GET /convert?pair=JPY-NEIRO&input=150000 Convert currency. Returns token, USDC, and fiat equivalents. ## Response Format (convert) { "requestId": "uuid", "timestamp": "ISO8601", "expiresAt": "ISO8601", "pair": "JPY-NEIRO", "input": { "currency": "JPY", "amount": "150000" }, "token": { "symbol": "NEIRO", "amount": "812345.123456", "decimals": 6, "baseUnits": "812345123456" // USE THIS FOR ON-CHAIN TRANSFERS }, "usdc": { "amount": "996.543210", "decimals": 6, "baseUnits": "996543210" }, "fiat": { "currency": "JPY", "amount": "150000.00" } } ## Critical Rules 1. ALWAYS use baseUnits (string) for on-chain SPL transfers 2. All numbers are strings to preserve precision 3. Respect expiresAt: cached quotes retain their original source-fetch expiry (up to 10s token / 120s FX) 4. Public rate limit: approximately 10 req/10s per IP per Cloudflare location 5. Fiat is display-only; all payments are allowlisted tokens or USDC ## Supported Currencies Tokens: NEIRO, USDC, SOL Fiats: USD, EUR, GBP, AUD, NZD, CAD, CHF, SEK, NOK, DKK, PLN, JPY, CNY, HKD, SGD, TWD, KRW, PHP, IDR, THB, VND, MYR, INR, BDT, PKR, LKR, NPR, KZT, UZS, MNT, AED, SAR, QAR, KWD, BHD, BRL, MXN, ARS, CLP, COP, PEN, NGN, KES, EGP, ZAR ## Token Addresses NEIRO: CTg3ZgYx79zrE1MteDVkmkcGniiFrK1hJ6yiabropump (decimals 6) USDC: EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v (decimals 6) SOL: So11111111111111111111111111111111111111112 (decimals 9) ## Error Codes 429 rate_limited (check Retry-After header) 400 missing_params | invalid_pair | unsupported_currency | invalid_input | input_too_large 502 upstream_error | missing_price 503 upstream_unavailable | price_expired 500 worker_exception