import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js"; import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.js"; import * as core from "../../../../core/index.js"; import * as Whop from "../../../index.js"; export declare namespace SwapsClient { type Options = BaseClientOptions; interface RequestOptions extends BaseRequestOptions { } } /** * A Swap converts value between supported tokens, chains, or wallet destinations, or between fiat currencies at the mid-market rate, for an account or user. A swap quote previews the expected output, fees, and approval requirements before you create the swap. * * Use the Swaps API to quote a conversion, create the swap, list recent swaps, and retrieve a swap's status until it completes. */ export declare class SwapsClient { protected readonly _options: NormalizedClientOptionsWithAuth; constructor(options?: SwapsClient.Options); /** * Lists the completed or pending swaps for an account or user — currently only the most recent one. * * @param {Whop.ListSwapsRequest} request * @param {SwapsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Whop.ForbiddenError} * @throws {@link errors.WhopError} * @throws {@link errors.WhopTimeoutError} * * @example * await client.swaps.list() */ list(request?: Whop.ListSwapsRequest, requestOptions?: SwapsClient.RequestOptions): core.HttpResponsePromise; private __list; /** * Swaps one token for another in an account or user's wallet, or converts between their fiat balances at the mid-market rate. Crypto swaps finish in the background — retrieve the swap to follow its status. * * @param {Whop.CreateSwapsRequest} request * @param {SwapsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Whop.BadRequestError} * @throws {@link Whop.ForbiddenError} * @throws {@link Whop.ConflictError} * @throws {@link errors.WhopError} * @throws {@link errors.WhopTimeoutError} * * @example * await client.swaps.create({ * from_token: "usd", * to_token: "cad" * }) */ create(request: Whop.CreateSwapsRequest, requestOptions?: SwapsClient.RequestOptions): core.HttpResponsePromise; private __create; /** * Previews the price of a swap before you create it. Fiat pairs quote the mid-market rate — the same rate creating the swap fills at. No funds move, nothing is saved, and no authentication is required. * * @param {Whop.CreateQuoteSwapsRequest} request * @param {SwapsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Whop.BadRequestError} * @throws {@link Whop.ConflictError} * @throws {@link errors.WhopError} * @throws {@link errors.WhopTimeoutError} * * @example * await client.swaps.createQuote({ * amount: "100", * from_token: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", * to_token: "0x1b64b9025eebb9a6239575df9ea4b9ac46d4d193" * }) */ createQuote(request: Whop.CreateQuoteSwapsRequest, requestOptions?: SwapsClient.RequestOptions): core.HttpResponsePromise; private __createQuote; /** * Retrieves a swap and its status. Poll it after creating a crypto swap, which finishes in the background. * * @param {Whop.RetrieveSwapsRequest} request * @param {SwapsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Whop.BadRequestError} * @throws {@link Whop.ForbiddenError} * @throws {@link Whop.NotFoundError} * @throws {@link errors.WhopError} * @throws {@link errors.WhopTimeoutError} * * @example * await client.swaps.retrieve({ * id: "id" * }) */ retrieve(request: Whop.RetrieveSwapsRequest, requestOptions?: SwapsClient.RequestOptions): core.HttpResponsePromise; private __retrieve; }