import { ApiAccount, ApiFundingRates, ApiHistoricalFundingRates, ApiIndexPrice, ApiMarketMessage, ApiMarketName, ApiOptions, ApiOrder, ApiOrderOnOrderbook, ApiSide, BigNumberable, SignedOrder, address } from '../lib/types'; import { Orders } from './Orders'; export declare class Api { private endpoint; private perpetualOrders; private timeout; constructor(perpetualOrders: Orders, apiOptions?: ApiOptions); placePerpetualOrder({ order: { side, amount, price, maker, taker, expiration, limitFee, salt, }, market, fillOrKill, postOnly, clientId, cancelId, cancelAmountOnRevert, }: { order: { side: ApiSide; amount: BigNumberable; price: BigNumberable; maker: address; taker: address; expiration: BigNumberable; limitFee?: BigNumberable; salt?: BigNumberable; }; market: ApiMarketName; fillOrKill?: boolean; postOnly?: boolean; clientId?: string; cancelId?: string; cancelAmountOnRevert?: boolean; }): Promise<{ order: ApiOrder; }>; /** * Creates but does not place a signed perpetualOrder */ createPerpetualOrder({ market, side, amount, price, maker, taker, expiration, postOnly, limitFee, salt, }: { market: ApiMarketName; side: ApiSide; amount: BigNumberable; price: BigNumberable; maker: address; taker: address; expiration: BigNumberable; postOnly: boolean; limitFee?: BigNumberable; salt?: BigNumberable; }): Promise; /** * Submits an already signed perpetualOrder */ submitPerpetualOrder({ order, market, fillOrKill, postOnly, cancelId, clientId, cancelAmountOnRevert, }: { order: SignedOrder; market: ApiMarketName; fillOrKill?: boolean; postOnly?: boolean; cancelId?: string; clientId?: string; cancelAmountOnRevert?: boolean; }): Promise<{ order: ApiOrder; }>; cancelOrder({ orderId, maker, }: { orderId: string; maker: address; }): Promise<{ order: ApiOrder; }>; getMarkets(): Promise<{ markets: ApiMarketMessage[]; }>; getAccountBalances({ accountOwner, }: { accountOwner: address; }): Promise; getOrderbook({ market, }: { market: ApiMarketName; }): Promise<{ bids: ApiOrderOnOrderbook[]; asks: ApiOrderOnOrderbook[]; }>; /** * Get the current and predicted funding rates. * * IMPORTANT: The `current` value returned by this function is not active until it has been mined * on-chain, which may not happen for some period of time after the start of the hour. To get the * funding rate that is currently active on-chain, use the getMarkets() function. * * The `current` rate is updated each hour, on the hour. The `predicted` rate is updated each * minute, on the minute, and may be null if no premiums have been calculated since the last * funding rate update. * * Params: * - markets (optional): Limit results to the specified markets. */ getFundingRates({ markets, }?: { markets?: ApiMarketName[]; }): Promise<{ [market: string]: ApiFundingRates; }>; /** * Get historical funding rates. The most recent funding rates are returned first. * * Params: * - markets (optional): Limit results to the specified markets. * - limit (optional): The maximum number of funding rates. The default, and maximum, is 100. * - startingBefore (optional): Return funding rates effective before this date. */ getHistoricalFundingRates({ markets, limit, startingBefore, }?: { markets?: ApiMarketName[]; limit?: number; startingBefore?: Date; }): Promise<{ [market: string]: ApiHistoricalFundingRates; }>; /** * Get the index price used in the funding rate calculation. * * Params: * - markets (optional): Limit results to the specified markets. */ getFundingIndexPrice({ markets, }?: { markets?: ApiMarketName[]; }): Promise<{ [market: string]: ApiIndexPrice; }>; private axiosRequest; }