import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.mjs"; import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.mjs"; import * as core from "../../../../core/index.mjs"; import * as Whop from "../../../index.mjs"; import { MarketsClient } from "../resources/markets/client/Client.mjs"; export declare namespace TradesClient { type Options = BaseClientOptions; interface RequestOptions extends BaseRequestOptions { } } /** * A Trade is one request on an account's or user's Whop-managed wallet. An `order` places one order from the trading balance, bridging the USDT0 it needs from the wallet first when the balance is short. A `close` closes the whole position in one market; when the account is then flat, a `withdraw` trade sends the trading balance back to the wallet. A `deposit` or `withdraw` moves money between the wallet and the trading balance. Orders trade Hyperliquid perpetuals and spot pairs priced in USDC. * * Use the Trades API to list the markets you can trade, place orders, close positions and move funds, and follow each trade until it finishes. Trades run in the background; an order that bridged money in and does not fill sends that money back to the wallet, and `funds_location` says where the money is. * * The trading API, including `include_trading` on accounts and users, is in beta. It can change without a new API version date. */ export declare class TradesClient { protected readonly _options: NormalizedClientOptionsWithAuth; protected _markets: MarketsClient | undefined; constructor(options?: TradesClient.Options); get markets(): MarketsClient; /** * Lists trades you can access, newest first. User credentials see their own trades and those of accounts they belong to, including connected accounts; account credentials see their account and its connected accounts. * * @param {Whop.ListTradesRequest} request * @param {TradesClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Whop.BadRequestError} * @throws {@link Whop.UnauthorizedError} * @throws {@link Whop.ForbiddenError} * @throws {@link errors.WhopError} * @throws {@link errors.WhopTimeoutError} * * @example * await client.trades.list() */ list(request?: Whop.ListTradesRequest, requestOptions?: TradesClient.RequestOptions): Promise>; /** * Places an order, closes a perpetual position, or deposits to or withdraws from the trading balance, from the Whop-managed wallet of an account or user. Answers `201` with the trade in `pending`; it runs in the background, so read it with `GET /trades/:id` until its `status` is `completed`, `failed` or `in_review`. Trades run alongside each other, except a second order on one market at a different leverage, which answers `409`. A retry with the same `Idempotency-Key` returns the same trade. * * @param {Whop.CreateTradesRequest} request * @param {TradesClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Whop.BadRequestError} * @throws {@link Whop.UnauthorizedError} * @throws {@link Whop.ForbiddenError} * @throws {@link Whop.ConflictError} * @throws {@link Whop.ServiceUnavailableError} * @throws {@link errors.WhopError} * @throws {@link errors.WhopTimeoutError} * * @example * await client.trades.create({ * account_id: "biz_xxxxxxxxxxxxxx", * type: "close" * }) */ create(request: Whop.CreateTradesRequest, requestOptions?: TradesClient.RequestOptions): core.HttpResponsePromise; private __create; /** * Retrieves a trade. Read it until its `status` is `completed`, `failed` or `in_review`. * * @param {Whop.RetrieveTradesRequest} request * @param {TradesClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Whop.UnauthorizedError} * @throws {@link Whop.ForbiddenError} * @throws {@link Whop.NotFoundError} * @throws {@link errors.WhopError} * @throws {@link errors.WhopTimeoutError} * * @example * await client.trades.retrieve({ * id: "id" * }) */ retrieve(request: Whop.RetrieveTradesRequest, requestOptions?: TradesClient.RequestOptions): core.HttpResponsePromise; private __retrieve; }