import * as hyperliquid from '@nktkas/hyperliquid'; import { OrderResponse } from '@nktkas/hyperliquid/api/exchange'; export type TimeInForce = 'Gtc' | 'Ioc' | 'Alo'; export interface PerpTradeParams { symbol: string; price: string; size: string; isLong: boolean; /** * Reduce-only flag. If true, order will only reduce existing position. * Use this to close positions - the order will only fill up to the position size. * @default false */ reduceOnly?: boolean; /** * Order type configuration. * - For limit orders: specify { type: 'limit', tif: 'Gtc' | 'Ioc' | 'Alo' } * - For market orders: specify { type: 'market' } * @default { type: 'limit', tif: 'Gtc' } */ orderType?: { type: 'limit'; tif: TimeInForce; } | { type: 'market'; }; /** * Leverage configuration. * Required parameter - must specify leverage (1-10x) and margin type. */ leverage: { leverage: number; isCross: boolean; }; /** * Builder fee configuration. * Applies to both long and short orders for perpetuals. * Fee is specified in tenths of basis points (e.g., 10 = 0.01% = 1 basis point). * Maximum builder fee is 0.1% (100 tenths of basis points) for perps. * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#builder-codes */ builderFee?: { builderAddress: string; feeInTenthsOfBps: number; }; } export type PerpOrderResult = PerpOrderResultSuccess | PerpOrderResultFailure; export interface PerpOrderResultSuccess { status: 'success'; orderResult: OrderResponse; } export interface PerpOrderResultFailure { status: 'error'; error: string; } /** * Execute a perpetual trade on Hyperliquid */ export declare function executePerpOrder({ transport, pkpPublicKey, params, useTestnet, }: { transport: hyperliquid.HttpTransport; pkpPublicKey: string; params: PerpTradeParams; useTestnet?: boolean; }): Promise; //# sourceMappingURL=execute-perp-order.d.ts.map