import { Result } from 'neverthrow'; type QRParserErrorCode = "INVALID_QR" | "INVALID_CURRENCY" | "INVALID_AMOUNT" | "FETCH_FAILED"; declare class QRParserError extends Error { readonly code: QRParserErrorCode; readonly cause?: unknown; readonly context?: Record; constructor(message: string, options: { code: QRParserErrorCode; cause?: unknown; context?: Record; }); } /** * All supported currency symbols. Single source of truth for the SDK. * * Lives alongside the country metadata so that adding a currency is a * single-folder operation: drop a new file in `currencies/.ts`, add it * to this map, and both `COUNTRY_OPTIONS` and `ZodCurrencySchema` pick it up. */ declare const CURRENCY: { readonly IDR: "IDR"; readonly INR: "INR"; readonly BRL: "BRL"; readonly ARS: "ARS"; readonly MEX: "MEX"; readonly VEN: "VEN"; readonly BOB: "BOB"; readonly EUR: "EUR"; readonly NGN: "NGN"; readonly USD: "USD"; readonly COP: "COP"; readonly CUP: "CUP"; readonly ECU: "ECU"; readonly PEN: "PEN"; readonly PHP: "PHP"; }; /** Union of supported currency codes. */ type CurrencyCode = (typeof CURRENCY)[keyof typeof CURRENCY]; /** Currencies that support QR parsing — derived from countries where PAY is not disabled. */ declare const SUPPORTED_QR_CURRENCIES: readonly CurrencyCode[]; type SupportedCurrency = (typeof SUPPORTED_QR_CURRENCIES)[number]; /** Single-object params for `parseQR`. */ interface ParseQRParams { readonly qrData: string; readonly currency: SupportedCurrency; /** Exchange rate: 1 USDC = `sellPrice` fiat. */ readonly sellPrice: number; /** Required for dynamic PIX (BRL) QRs to bypass CORS on the bank endpoint. */ readonly proxyUrl?: string; /** Forwarded to `proxyUrl` for tracing / correlation. */ readonly orderId?: string; } interface ParsedQR { paymentAddress: string; amount?: { usdc: number; fiat: number; }; } type ParseResult = Result; /** * Parses a QR string for the given currency and returns the extracted payment data. * * This dispatcher is `async` because dynamic PIX (BRL) QRs store the amount * behind a location URL pointing at the issuing bank's PIX endpoint. The SDK * resolves that URL via a CORS-bypassing proxy (see `proxyUrl`), which returns * a signed JWT whose `valor.original` field holds the amount. All other parsers * (UPI, QRIS, QR Ph, MercadoPago, PagoMovil, Transfermóvil) and static PIX are synchronous and * resolve immediately. * * When the country has `validateQr` (PEN, VEN, BOB), Scan & Pay must pass the * same check as SELL upload — not a looser envelope. */ declare function parseQR(params: ParseQRParams): Promise; /** * Same envelope as SELL upload: opaque `base64?merchantId=NNNN` (blob ≥ 40). * Prefer `validateVenezuelanQr` from `@p2pdotme/sdk/country`; this alias stays * for `@p2pdotme/sdk/qr-parsers` callers. */ declare function isPagoMovilQr(qrData: string): boolean; export { type ParseQRParams, type ParseResult, type ParsedQR, QRParserError, type QRParserErrorCode, type SupportedCurrency, isPagoMovilQr, parseQR };