/// <amd-module name="file:///home/runner/work/hyperliquid/hyperliquid/src/api/info/_methods/historicalOrders.ts" />
import * as v from "valibot";
import type { FrontendOpenOrder, OrderProcessingStatus } from "./_base/mod.js";
/**
 * Request user historical orders.
 * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#retrieve-a-users-historical-orders
 */
export declare const HistoricalOrdersRequest: v.ObjectSchema<{
    /** Type of request. */
    readonly type: v.LiteralSchema<"historicalOrders", undefined>;
    /** User address. */
    readonly user: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.TransformAction<string, `0x${string}`>]>, v.LengthAction<`0x${string}`, 42, undefined>]>;
}, undefined>;
export type HistoricalOrdersRequest = v.InferOutput<typeof HistoricalOrdersRequest>;
/**
 * Array of frontend orders with current processing status.
 * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#retrieve-a-users-historical-orders
 */
export type HistoricalOrdersResponse = {
    /** Open order with additional display information. */
    order: FrontendOpenOrder;
    /**
     * Order processing status:
     * - `"open"`: Order active and waiting to be filled.
     * - `"filled"`: Order fully executed.
     * - `"canceled"`: Order canceled by the user.
     * - `"triggered"`: Order triggered and awaiting execution.
     * - `"rejected"`: Order rejected by the system.
     * - `"marginCanceled"`: Order canceled due to insufficient margin.
     * - `"vaultWithdrawalCanceled"`: Canceled due to a user withdrawal from vault.
     * - `"openInterestCapCanceled"`: Canceled due to order being too aggressive when open interest was at cap.
     * - `"selfTradeCanceled"`: Canceled due to self-trade prevention.
     * - `"reduceOnlyCanceled"`: Canceled reduced-only order that does not reduce position.
     * - `"siblingFilledCanceled"`: Canceled due to sibling ordering being filled.
     * - `"delistedCanceled"`: Canceled due to asset delisting.
     * - `"liquidatedCanceled"`: Canceled due to liquidation.
     * - `"scheduledCancel"`: Canceled due to exceeding scheduled cancel deadline (dead man's switch).
     * - `"tickRejected"`: Rejected due to invalid tick price.
     * - `"minTradeNtlRejected"`: Rejected due to order notional below minimum.
     * - `"perpMarginRejected"`: Rejected due to insufficient margin.
     * - `"reduceOnlyRejected"`: Rejected due to reduce only.
     * - `"badAloPxRejected"`: Rejected due to post-only immediate match.
     * - `"iocCancelRejected"`: Rejected due to IOC not able to match.
     * - `"badTriggerPxRejected"`: Rejected due to invalid TP/SL price.
     * - `"marketOrderNoLiquidityRejected"`: Rejected due to lack of liquidity for market order.
     * - `"positionIncreaseAtOpenInterestCapRejected"`: Rejected due to open interest cap.
     * - `"positionFlipAtOpenInterestCapRejected"`: Rejected due to open interest cap.
     * - `"tooAggressiveAtOpenInterestCapRejected"`: Rejected due to price too aggressive at open interest cap.
     * - `"openInterestIncreaseRejected"`: Rejected due to open interest cap.
     * - `"insufficientSpotBalanceRejected"`: Rejected due to insufficient spot balance.
     * - `"oracleRejected"`: Rejected due to price too far from oracle.
     * - `"perpMaxPositionRejected"`: Rejected due to exceeding margin tier limit at current leverage.
     */
    status: OrderProcessingStatus;
    /** Timestamp when the status was last updated (in ms since epoch). */
    statusTimestamp: number;
}[];
import type { InfoConfig } from "./_base/mod.js";
/** Request parameters for the {@linkcode historicalOrders} function. */
export type HistoricalOrdersParameters = Omit<v.InferInput<typeof HistoricalOrdersRequest>, "type">;
/**
 * Request user historical orders.
 *
 * @param config General configuration for Info API requests.
 * @param params Parameters specific to the API request.
 * @param signal {@link https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal | AbortSignal} to cancel the request.
 * @return Array of frontend orders with current processing status.
 *
 * @throws {ValidationError} When the request parameters fail validation (before sending).
 * @throws {TransportError} When the transport layer throws an error.
 *
 * @example
 * ```ts
 * import { HttpTransport } from "@nktkas/hyperliquid";
 * import { historicalOrders } from "@nktkas/hyperliquid/api/info";
 *
 * const transport = new HttpTransport(); // or `WebSocketTransport`
 *
 * const data = await historicalOrders({ transport }, {
 *   user: "0x...",
 * });
 * ```
 *
 * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#retrieve-a-users-historical-orders
 */
export declare function historicalOrders(config: InfoConfig, params: HistoricalOrdersParameters, signal?: AbortSignal): Promise<HistoricalOrdersResponse>;
