export declare const GET_RETRY_MAX_ATTEMPTS = 3; /** * Whether a failed request should be retried, given the method that was * used and how the request failed. GET/HEAD only. Retries on network * errors (no response at all: timeout, connection reset, DNS failure) and * 5xx server errors. Never retries 4xx: 401/402/404 are not transient, and * 429 retried blindly would actively fight the server's own rate limiter. */ export declare function shouldRetryGet(params: { method: string; status: number | undefined; hasResponse: boolean; attemptsSoFar: number; }): boolean; /** Exponential backoff delay before retry attempt number `attemptNumber` (1-indexed). */ export declare function getRetryDelayMs(attemptNumber: number): number; export interface Service { code: string; name: string; icon?: string; } export interface Country { iso: string; name: string; flag?: string; } export interface Price { price_usd: number; currency: string; available: boolean; } export interface CatalogCountry { iso: string; name: string; price_usd: number; availability?: 'in_stock' | 'low_stock' | 'out_of_stock' | string; count?: number; } export interface Balance { balance_usd: number; } export interface Profile { id: string; email: string; telegram_linked: boolean; telegram_username?: string; balance_usd: number; total_spent_usd: number; total_credits_usd: number; total_orders: number; active_api_keys: number; created_at: string; } export interface Transaction { id: string; amount: number; type: string; description?: string; order_id?: string; balance_before: number; balance_after: number; created_at: string; } export interface TransactionsPage { count: number; limit: number; offset: number; transactions: Transaction[]; } export interface SmsMessage { content: string; sender?: string; received_at?: string; } export interface Order { order_id: string; phone_number: string; service?: string; country?: string; price?: number; created_at?: string; expires_at?: string; status: string; sms_code?: string; sms_text?: string; messages?: SmsMessage[]; sms_received?: boolean; cancel_available_at?: string; swap_available_at?: string; rules?: { cancel_cooldown_seconds?: number; swap_cooldown_seconds?: number; }; } export interface CancelResult { success: boolean; refunded: boolean; } export interface ProxyCatalogCountry { code: string; name: string; available: boolean; ip_count: number; } export interface ProxyCatalogPoolType { id: string; label: string; price_per_gb: number; countries: ProxyCatalogCountry[]; } export interface ProxyListItem { proxy_id: string; pool_type: string; country_code: string; country_name?: string; gb_total: number; gb_used: number; gb_remaining: number; proxy_host: string; proxy_port: number; proxy_login: string; proxy_password: string; updated_at?: string; created_at?: string; } export interface ProxyPurchaseResult { proxy_id: string; pool_type: string; gb_added: number; gb_remaining: number; country_code: string; proxy_login: string; proxy_password: string; proxy_host: string; proxy_port: number; proxy_port_socks?: number; price: number; balance?: number; } export interface ProxyRotateResult { rotated: boolean; port: number; message: string; } export interface ProxyUsage { gb_used: number; gb_remaining: number; requests: number; updated_at?: string; } export interface ProxyUsageHistoryPoint { date: string; gb: number; requests: number; } export interface ProxyUsageHistoryResult { series: ProxyUsageHistoryPoint[]; totals: { gb: number; requests: number; }; } export interface ProxyTargetingResult { ok: boolean; country_code: string; premium_2x: boolean; } export interface ProxyTestResult { ok: boolean; exit_ip?: string; country_code?: string; country_name?: string; city?: string; region?: string; isp?: string; asn?: string; latency_ms?: number; error?: string; } export interface ProxyLocationItem { code: string; name: string; count: number; } export interface ProxyEndpointResult { proxy_id: string; pool_type: string; host: string; port: number; protocol: 'HTTP' | 'SOCKS5'; session: 'rotating' | 'sticky'; sticky_ttl_minutes?: number; country_code: string; target_by: 'country' | 'state' | 'city' | 'zip' | 'asn'; location_code?: string; premium_2x: boolean; endpoints: string[]; } export interface BrowserSessionResult { id: string; status: string; service_name?: string; country_code?: string; device_mode?: string; with_proxy?: boolean; viewer_url?: string; target_url?: string; order_id?: string; phone_number?: string; timeline?: Array<{ at: string; event: string; detail?: string; }>; } export interface NavigateSessionResult { ok: boolean; status: string; url: string; } export interface RentalPricingTier { rental_type: string; duration_hours: number; duration_label: string; base_price: number; country_code: string; service_id: string; } export interface RentalDurationPrice { duration_hours: number; duration_label: string; price: number; } export interface RentalAvailabilityCountry { country_code: string; country_name: string; flag?: string; available_count: number; pricing: Record; service_count?: number; popular_services?: string[]; min_price_per_day?: number; } export interface RentalFullAccessCountry { country_code: string; country_name: string; flag?: string; available_count: number; pricing: Record; } export interface RentalAvailabilityResult { countries: RentalAvailabilityCountry[]; total_available: number; full_access_countries?: RentalFullAccessCountry[]; provider?: string; } export interface RentalCatalogService { service_id: string; service_name: string; physical_count: number; our_price?: number; base_price?: number; popular: boolean; icon_url?: string; } export interface RentalPriceResult { price: number; duration_hours: number; } export interface Rental { id: string; phone_number: string; rental_type: string; service_id?: string; duration_hours: number; started_at: string; expires_at: string; price: number; auto_renew: boolean; status: string; sms_received: number; sms_forwarded: number; last_sms_at?: string; provider: string; } export interface CreateRentalResult { success: boolean; rental_id: string; phone_number: string; rental_type?: string; service?: string; duration?: string; price?: number; started_at?: string; expires_at: string; auto_renew?: boolean; status?: string; retail_cost?: number; currency?: string; } export interface RentalActionResult { success: boolean; rental_id: string; status?: string; refund?: number; new_expires_at?: string; price?: number; hours_used?: string; message?: string; } export interface RetryOrderResult { success: boolean; order_id: string; message: string; } export interface NumberCheckResult { valid: boolean; e164: string; national?: string; country_code: string; country_name: string; country_prefix?: string; location?: string; carrier?: string; line_type: string; spam_risk: string; cached: boolean; message?: string; } export declare function buildProxyEndpointResult(proxy: ProxyListItem, params: { countryCode: string; targetBy?: 'country' | 'state' | 'city' | 'zip' | 'asn'; locationCode?: string; session?: 'rotating' | 'sticky'; stickyTtlMinutes?: number; count?: number; protocol?: 'HTTP' | 'SOCKS5'; format?: 'host:port:user:pass' | 'user:pass@host:port' | 'curl'; }): ProxyEndpointResult; export declare class VirtualSMSClient implements IVirtualSMSClient { private http; private apiKey?; private baseUrl; constructor(baseUrl: string, apiKey?: string, timeoutSeconds?: number); requireApiKey(): void; listServices(): Promise; listCountries(): Promise; checkPrice(service: string, country: string): Promise; getCatalogCountries(service: string): Promise; getBalance(): Promise; getProfile(): Promise; getTransactions(params?: { type?: string; from?: string; to?: string; limit?: number; offset?: number; }): Promise; createOrder(service: string, country: string): Promise; getOrder(orderId: string): Promise; swapNumber(orderId: string): Promise; cancelOrder(orderId: string): Promise; completeOrder(orderId: string): Promise; listOrders(status?: string): Promise; listProxyCatalog(): Promise; listProxies(): Promise; purchaseProxy(params: { pool_type: string; gb: number; country_code?: string; idempotency_key?: string; }): Promise; rotateProxy(proxyId: string, port?: number): Promise; getProxyUsage(proxyId: string): Promise; getProxyUsageHistory(proxyId: string, range?: '7d' | '30d'): Promise; /** * SetTargeting updates the sub-user's DEFAULT geo-targeting via the * reseller API (persisted server-side, applies to future connections that * don't override it). Country-only is free; cities/asns bill the * customer's own funded GB at 2x on non-premium pools (backend response * carries premium_2x so the caller can warn). Matches * ws-gateway/handlers/proxies.go SetTargeting exactly. Note the backend * does NOT accept state/zip here (only country_code + cities + asns); * state/zip refinement is a per-connection username param only. See * generateProxyEndpoint. */ setProxyTargeting(proxyId: string, params: { countryCode: string; cities?: string[]; asns?: number[]; }): Promise; /** * TestProxy dials out through the proxy and reports the exit IP/country. * It is the only backend-supported use of a per-request `session` param * (rotating|sticky). Matches ws-gateway/handlers/proxies.go TestProxy. * Server-side cooldown (~20s) applies; a 429 surfaces as a thrown Error * via the response interceptor. */ testProxy(proxyId: string, params: { country: string; session?: 'rotating' | 'sticky'; protocol?: 'http' | 'socks5'; }): Promise; /** * GetLocations: public inventory endpoint (no auth, no FEATURE_PROXIES * gate). Backend excludes residential_premium from pool_type here (its * locations API doesn't support it). See * ws-gateway/handlers/proxies.go GetLocations validLocPoolTypes. */ listProxyLocations(params: { poolType: 'residential' | 'mobile' | 'datacenter'; country: string; kind: 'cities' | 'states' | 'asns' | 'zipcodes'; }): Promise; /** * generateProxyEndpoint composes ready-to-use connection string(s). No * backend call. Mirrors the frontend's ProxyEndpointGenerator * (frontend/src/components/my-numbers-v2/ProxyEndpointGenerator.tsx) * buildUsername()/buildEndpoint() exactly: targeting is encoded in the * username at connection time per the per-connection convention in * Vault/Operations/proxy-system.md ยง2: one credential serves every * country/refinement, nothing is purchased or persisted here. Looks up * the proxy's login/password/host/port via listProxies() first. */ generateProxyEndpoint(params: { proxyId: string; countryCode: string; targetBy?: 'country' | 'state' | 'city' | 'zip' | 'asn'; locationCode?: string; session?: 'rotating' | 'sticky'; stickyTtlMinutes?: number; count?: number; protocol?: 'HTTP' | 'SOCKS5'; format?: 'host:port:user:pass' | 'user:pass@host:port' | 'curl'; }): Promise; startManualRegistrationSession(params: { serviceName?: string; country?: string; deviceMode?: 'desktop' | 'mobile'; withProxy?: boolean; targetUrl?: string; orderId?: string; mode?: 'attach' | 'fresh'; }): Promise; prepBrowserSession(sessionId: string, preset: 'generic' | 'telegram', targetUrl?: string): Promise; stopBrowserSession(sessionId: string): Promise; /** Drive an existing (owned) session's address bar to a URL. Runs async server-side, returns 202 immediately. */ navigateBrowserSession(sessionId: string, url: string): Promise; /** Session detail incl. our own proxied viewer_url (never the raw upstream debug URL). */ getBrowserSession(sessionId: string): Promise; getApiKey(): string | undefined; getBaseUrl(): string; listRentalPricing(): Promise; getRentalAvailability(params?: { country?: string; service?: string; type?: 'service' | 'full'; tier?: 'full_access' | 'platform'; }): Promise; listRentalServices(params: { countryCode: string; durationHours?: number; }): Promise; getRentalPrice(params: { service: string; countryCode: string; durationHours: number; }): Promise; /** Full Access tier: local SIM inventory, any service. */ createFullAccessRental(params: { country: string; rentalType: 'service' | 'full'; durationHours: number; service?: string; autoRenew?: boolean; }): Promise; /** * Platform tier: sourced via our global supplier network, locked to one * service per number, durations 1/3/7 days only, 20-minute refund window. * Takes country_code (ISO) and resolves the internal numeric ID itself. * Callers never need to know or pass the numeric ID. */ createPlatformRental(params: { service: string; countryCode: string; durationHours: number; }): Promise; listRentals(status?: string): Promise; getRental(rentalId: string): Promise; extendRental(rentalId: string, durationHours: number): Promise; /** Full refund: only eligible within 20 minutes of purchase and 0 SMS received. Any provider. */ cancelRental(rentalId: string): Promise; /** * Early release with a PARTIAL refund: Full Access (local) tier only, after a * 2h minimum hold. Not "pro-rated": the backend pays * price - MAX(timeValue, servicesBurnedValue) - 10% of price, as store credit * rather than cash. Gated off the default tool surface behind * VIRTUALSMS_ENABLE_RELEASE pending a refund-strategy call (VSMS-486). */ releaseRental(rentalId: string): Promise; /** Ask the current provider to resend the SMS to the SAME number (not a new number; see swapNumber for that). */ retryOrder(orderId: string): Promise; /** Public carrier + line-type lookup for an arbitrary E.164 number. No API key required. */ checkNumber(number: string): Promise; } export interface IVirtualSMSClient { requireApiKey(): void; getApiKey(): string | undefined; getBaseUrl(): string; listServices(): Promise; listCountries(): Promise; checkPrice(service: string, country: string): Promise; getCatalogCountries(service: string): Promise; checkNumber(number: string): Promise; getBalance(): Promise; getProfile(): Promise; getTransactions(params?: { type?: string; from?: string; to?: string; limit?: number; offset?: number; }): Promise; createOrder(service: string, country: string): Promise; getOrder(orderId: string): Promise; swapNumber(orderId: string): Promise; cancelOrder(orderId: string): Promise; completeOrder(orderId: string): Promise; listOrders(status?: string): Promise; listProxyCatalog(): Promise; listProxies(): Promise; purchaseProxy(params: { pool_type: string; gb: number; country_code?: string; idempotency_key?: string; }): Promise; rotateProxy(proxyId: string, port?: number): Promise; getProxyUsage(proxyId: string): Promise; getProxyUsageHistory(proxyId: string, range?: '7d' | '30d'): Promise; setProxyTargeting(proxyId: string, params: { countryCode: string; cities?: string[]; asns?: number[]; }): Promise; testProxy(proxyId: string, params: { country: string; session?: 'rotating' | 'sticky'; protocol?: 'http' | 'socks5'; }): Promise; listProxyLocations(params: { poolType: 'residential' | 'mobile' | 'datacenter'; country: string; kind: 'cities' | 'states' | 'asns' | 'zipcodes'; }): Promise; generateProxyEndpoint(params: { proxyId: string; countryCode: string; targetBy?: 'country' | 'state' | 'city' | 'zip' | 'asn'; locationCode?: string; session?: 'rotating' | 'sticky'; stickyTtlMinutes?: number; count?: number; protocol?: 'HTTP' | 'SOCKS5'; format?: 'host:port:user:pass' | 'user:pass@host:port' | 'curl'; }): Promise; startManualRegistrationSession(params: { serviceName?: string; country?: string; deviceMode?: 'desktop' | 'mobile'; withProxy?: boolean; targetUrl?: string; orderId?: string; mode?: 'attach' | 'fresh'; }): Promise; prepBrowserSession(sessionId: string, preset: 'generic' | 'telegram', targetUrl?: string): Promise; stopBrowserSession(sessionId: string): Promise; navigateBrowserSession(sessionId: string, url: string): Promise; getBrowserSession(sessionId: string): Promise; listRentalPricing(): Promise; getRentalAvailability(params?: { country?: string; service?: string; type?: 'service' | 'full'; tier?: 'full_access' | 'platform'; }): Promise; listRentalServices(params: { countryCode: string; durationHours?: number; }): Promise; getRentalPrice(params: { service: string; countryCode: string; durationHours: number; }): Promise; createFullAccessRental(params: { country: string; rentalType: 'service' | 'full'; durationHours: number; service?: string; autoRenew?: boolean; }): Promise; createPlatformRental(params: { service: string; countryCode: string; durationHours: number; }): Promise; listRentals(status?: string): Promise; getRental(rentalId: string): Promise; extendRental(rentalId: string, durationHours: number): Promise; cancelRental(rentalId: string): Promise; releaseRental(rentalId: string): Promise; retryOrder(orderId: string): Promise; } //# sourceMappingURL=client.d.ts.map