import type { ActivateOptions, ActivationActionValue, ActivationResult, ActivationStatus, ActivationStatusV2, ActiveActivation, CountryInfo, CryptoWallet, FindPricesParams, GetBalanceOptions, GetNumberParams, GrizzlySmsOptions, NumberStock, NumbersStatusParams, OrderedNumber, OrderedNumberV2, PriceQuote, PricesByCountry, PricesV2, PricesV3, ReceivedCode, ReceivedMessage, RentHistory, RentNumberParams, RentPhone, RentPrice, RentPricesParams, RentStatus, ServiceInfo, SetStatusResult, WaitForCodeOptions, WaitForMessageOptions, WalletParams } from "./types.js"; /** * Client for the Grizzly SMS activation API (`handler_api.php`). * * @example * ```ts * const sms = new GrizzlySms(process.env.GRIZZLY_API_KEY!); * const balance = await sms.getBalance(); * ``` */ export declare class GrizzlySms { private readonly apiKey; private readonly http; private readonly retries; private readonly retryDelayMs; private readonly retryMutations; /** * @param options API key string, or settings from the Grizzly profile. * * @example * ```ts * const sms = new GrizzlySms({ apiKey: process.env.GRIZZLY_API_KEY! }); * ``` */ constructor(options: GrizzlySmsOptions | string); /** * Low-level `handler_api.php` call. Use it for actions added after this * client was published. Known error strings are still thrown. * * @example * ```ts * const raw = await sms.call("getBalance"); * ``` */ call(action: string, params?: Record): Promise; /** * Account balance in USD. * * @example * ```ts * const balance = await sms.getBalance(); * ``` */ getBalance(options?: GetBalanceOptions): Promise; /** * Order a number. `country` may be `"any"` or omitted. * * @example * ```ts * const ordered = await sms.getNumber({ service: "tg", country: "any" }); * ``` */ getNumber(params: GetNumberParams): Promise; /** * Order a number and return price, currency, and activation timestamps. * * @example * ```ts * const ordered = await sms.getNumberV2({ service: "tg", country: 12 }); * ``` */ getNumberV2(params: GetNumberParams): Promise; /** * Change an activation status. Prefer {@link ready}, {@link complete}, and * {@link cancel} for the documented codes. * * @example * ```ts * await sms.setStatus(activationId, ActivationAction.Complete); * ``` */ setStatus(activationId: string | number, status: ActivationActionValue | number, forward?: string | number | boolean): Promise; /** * Tell the service that the SMS was sent to the number (`status=1`). * * @example * ```ts * await sms.ready(activationId); * ``` */ ready(activationId: string | number): Promise; /** * Ask for another code on the same number (`status=3`). * * @example * ```ts * await sms.requestAnotherCode(activationId); * ``` */ requestAnotherCode(activationId: string | number): Promise; /** * Finish the activation (`status=6`). * * @example * ```ts * await sms.complete(activationId); * ``` */ complete(activationId: string | number): Promise; /** * Cancel the activation. Pass `-1` to use the alternate cancel code from * the docs; the default is `8`. * * @example * ```ts * await sms.cancel(activationId); * ``` */ cancel(activationId: string | number, status?: 8 | -1): Promise; /** * Current activation status. `STATUS_OK` includes the SMS code. * * @example * ```ts * const status = await sms.getStatus(activationId); * ``` */ getStatus(activationId: string | number): Promise; /** * Activation status as JSON, including SMS and call payloads. * * @example * ```ts * const status = await sms.getStatusV2(activationId); * ``` */ getStatusV2(activationId: string | number): Promise; /** * Poll until a code arrives, the activation is cancelled, or the timeout * elapses. `STATUS_WAIT_RESEND` keeps waiting: call `complete()` when your * app has requested the SMS again. * * @example * ```ts * const received = await sms.waitForCode(activationId, { timeoutMs: 120_000 }); * ``` */ waitForCode(activationId: string | number, options?: WaitForCodeOptions): Promise; /** * Poll `getStatusV2` until an SMS or call payload contains a code. * * @example * ```ts * const message = await sms.waitForMessage(activationId, { timeoutMs: 120_000 }); * ``` */ waitForMessage(activationId: string | number, options?: WaitForMessageOptions): Promise; /** * Order with `getNumberV2`, optionally mark the number ready, and wait for a code. * Ordering spends balance. Set `cancelOnTimeout` to release the number on timeout. * * @example * ```ts * const result = await sms.activate( * { service: "tg", country: 12, maxPrice: 1 }, * { timeoutMs: 120_000, cancelOnTimeout: true }, * ); * ``` */ activate(params: GetNumberParams, options?: ActivateOptions): Promise; /** * Prices grouped by country, then service. * * @example * ```ts * const prices = await sms.getPrices({ service: "tg" }); * ``` */ getPrices(params?: { service?: string; country?: string | number; }): Promise; /** * Price buckets: country, service, then price string to available count. * * @example * ```ts * const prices = await sms.getPricesV2({ service: "tg", country: 0 }); * ``` */ getPricesV2(params?: { service?: string; country?: string | number; }): Promise; /** * Prices with per-provider offers. * * @example * ```ts * const prices = await sms.getPricesV3({ service: "tg", country: 0 }); * ``` */ getPricesV3(params?: { service?: string; country?: string | number; }): Promise; /** * `getPrices` flattened and sorted by cost. One request replaces scanning * every country code by hand. * * @example * ```ts * const quotes = await sms.findPrices({ service: "tg", minCount: 10, maxPrice: 1 }); * ``` */ findPrices(params?: FindPricesParams): Promise; /** * Service catalog (`getServicesList`). * * @example * ```ts * const services = await sms.getServices(); * ``` */ getServices(): Promise; /** * Country catalog. * * @example * ```ts * const countries = await sms.getCountries(); * ``` */ getCountries(): Promise; /** * Activations that are still open on the account. * * @example * ```ts * const active = await sms.getActiveActivations(); * ``` */ getActiveActivations(): Promise; /** * Available count per service from `getNumbersStatus`. * Keys look like `tg_0` (service, then redirect or operator suffix). * * @example * ```ts * const stock = await sms.getNumbersStatus({ country: 0 }); * ``` */ getNumbersStatus(params?: NumbersStatusParams): Promise; /** * Rent a number for several hours (`getRentNumber`). The documented minimum is 4 hours. * * @example * ```ts * const rented = await sms.getRentNumber({ service: "tg", country: 0, rentTime: 4 }); * ``` */ getRentNumber(params: RentNumberParams): Promise; /** * Extend a rental (`continueRentNumber`). * * @example * ```ts * const rented = await sms.continueRent(rentId, 4); * ``` */ continueRent(id: string | number, rentTime: number): Promise; /** * SMS received during a rental (`getRentStatus`). * * @example * ```ts * const status = await sms.getRentStatus(rentId); * ``` */ getRentStatus(id: string | number): Promise; /** * Finish (`1`) or cancel (`2`) a rental (`setRentStatus`). * * @example * ```ts * await sms.setRentStatus(rentId, RentAction.Finish); * ``` */ setRentStatus(id: string | number, status: number): Promise<"success">; /** * Finish a rental (`setRentStatus` status `1`). * * @example * ```ts * await sms.finishRent(rentId); * ``` */ finishRent(id: string | number): Promise<"success">; /** * Cancel a rental (`setRentStatus` status `2`). * * @example * ```ts * await sms.cancelRent(rentId); * ``` */ cancelRent(id: string | number): Promise<"success">; /** * Past extensions of a rental (`getRentHistory`). * * @example * ```ts * const history = await sms.getRentHistory(rentId); * ``` */ getRentHistory(id: string | number): Promise; /** * Rental prices (`getRentPrices`). * * @example * ```ts * const prices = await sms.getRentPrices({ service: "tg", country: 0, rentTime: 4 }); * ``` */ getRentPrices(params?: RentPricesParams): Promise; /** * Static deposit address. The documented sample is `coin=usdt` and * `network=tron`. Amounts from 50 USD are credited automatically. * * @example * ```ts * const wallet = await sms.getWallet({ coin: "usdt", network: "tron" }); * ``` */ getWallet(params?: WalletParams): Promise; private request; private attemptsFor; private cancelFailedWait; private jsonAction; } //# sourceMappingURL=client.d.ts.map