UNPKG

@binance/derivatives-trading-coin-futures

Version:

Official Binance Derivatives Trading (COIN-M Futures) Connector - A lightweight library that provides a convenient interface to Binance's COINN-M Futures REST API, WebSocket API and WebSocket Streams.

2,026 lines (2,023 loc) 614 kB
import { BadRequestError, ConfigurationRestAPI, ConfigurationWebsocketAPI, ConfigurationWebsocketStreams, ConnectorClientError, DERIVATIVES_TRADING_COIN_FUTURES_REST_API_PROD_URL, DERIVATIVES_TRADING_COIN_FUTURES_REST_API_TESTNET_URL, DERIVATIVES_TRADING_COIN_FUTURES_WS_API_PROD_URL, DERIVATIVES_TRADING_COIN_FUTURES_WS_API_TESTNET_URL, DERIVATIVES_TRADING_COIN_FUTURES_WS_STREAMS_PROD_URL, DERIVATIVES_TRADING_COIN_FUTURES_WS_STREAMS_TESTNET_URL, ForbiddenError, NetworkError, NotFoundError, RateLimitBanError, RequiredError, RestApiResponse, ServerError, TooManyRequestsError, UnauthorizedError, WebsocketAPIBase, WebsocketApiResponse, WebsocketSendMsgOptions, WebsocketStream, WebsocketStreamsBase } from "@binance/common"; //#region src/rest-api/types/account-information-response-assets-inner.d.ts /** * Futures (COIN-M) REST API * * Access market data, manage accounts, and trade COIN-M perpetual and delivery futures. * * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ /** * * @export * @interface AccountInformationResponseAssetsInner */ interface AccountInformationResponseAssetsInner { /** * asset name * @type {string} * @memberof AccountInformationResponseAssetsInner */ asset?: string; /** * total wallet balance * @type {string} * @memberof AccountInformationResponseAssetsInner */ walletBalance?: string; /** * unrealized profit or loss * @type {string} * @memberof AccountInformationResponseAssetsInner */ unrealizedProfit?: string; /** * margin balance * @type {string} * @memberof AccountInformationResponseAssetsInner */ marginBalance?: string; /** * maintenance margin * @type {string} * @memberof AccountInformationResponseAssetsInner */ maintMargin?: string; /** * total intial margin required with the latest mark price * @type {string} * @memberof AccountInformationResponseAssetsInner */ initialMargin?: string; /** * positions margin required with the latest mark price * @type {string} * @memberof AccountInformationResponseAssetsInner */ positionInitialMargin?: string; /** * open orders intial margin required with the latest mark price * @type {string} * @memberof AccountInformationResponseAssetsInner */ openOrderInitialMargin?: string; /** * maximum amount for transfer out * @type {string} * @memberof AccountInformationResponseAssetsInner */ maxWithdrawAmount?: string; /** * wallet balance for crossed margin * @type {string} * @memberof AccountInformationResponseAssetsInner */ crossWalletBalance?: string; /** * total unrealized profit or loss of crossed positions * @type {string} * @memberof AccountInformationResponseAssetsInner */ crossUnPnl?: string; /** * available margin balance * @type {string} * @memberof AccountInformationResponseAssetsInner */ availableBalance?: string; /** * update time * @type {number | bigint} * @memberof AccountInformationResponseAssetsInner */ updateTime?: number | bigint; } //#endregion //#region src/rest-api/types/account-information-response-positions-inner.d.ts /** * Futures (COIN-M) REST API * * Access market data, manage accounts, and trade COIN-M perpetual and delivery futures. * * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ /** * * @export * @interface AccountInformationResponsePositionsInner */ interface AccountInformationResponsePositionsInner { /** * Trading symbol * @type {string} * @memberof AccountInformationResponsePositionsInner */ symbol?: string; /** * position amount * @type {string} * @memberof AccountInformationResponsePositionsInner */ positionAmt?: string; /** * total intial margin required with the latest mark price * @type {string} * @memberof AccountInformationResponsePositionsInner */ initialMargin?: string; /** * maintenance margin * @type {string} * @memberof AccountInformationResponsePositionsInner */ maintMargin?: string; /** * unrealized profit or loss * @type {string} * @memberof AccountInformationResponsePositionsInner */ unrealizedProfit?: string; /** * positions margin required with the latest mark price * @type {string} * @memberof AccountInformationResponsePositionsInner */ positionInitialMargin?: string; /** * open orders intial margin required with the latest mark price * @type {string} * @memberof AccountInformationResponsePositionsInner */ openOrderInitialMargin?: string; /** * Leverage value. * @type {string} * @memberof AccountInformationResponsePositionsInner */ leverage?: string; /** * Whether isolated margin mode is enabled. * @type {boolean} * @memberof AccountInformationResponsePositionsInner */ isolated?: boolean; /** * Position side * @type {string} * @memberof AccountInformationResponsePositionsInner */ positionSide?: string; /** * Position entry price. * @type {string} * @memberof AccountInformationResponsePositionsInner */ entryPrice?: string; /** * break-even price * @type {string} * @memberof AccountInformationResponsePositionsInner */ breakEvenPrice?: string; /** * maximum quantity of base asset * @type {string} * @memberof AccountInformationResponsePositionsInner */ maxQty?: string; /** * update time * @type {number | bigint} * @memberof AccountInformationResponsePositionsInner */ updateTime?: number | bigint; /** * Notional value. * @type {string} * @memberof AccountInformationResponsePositionsInner */ notionalValue?: string; } //#endregion //#region src/rest-api/types/account-information-response.d.ts /** * * @export * @interface AccountInformationResponse */ interface AccountInformationResponse$1 { /** * Supported assets. * @type {Array<AccountInformationResponseAssetsInner>} * @memberof AccountInformationResponse */ assets?: Array<AccountInformationResponseAssetsInner>; /** * Position list. * @type {Array<AccountInformationResponsePositionsInner>} * @memberof AccountInformationResponse */ positions?: Array<AccountInformationResponsePositionsInner>; /** * Whether deposits are enabled. * @type {boolean} * @memberof AccountInformationResponse */ canDeposit?: boolean; /** * Whether trading is enabled. * @type {boolean} * @memberof AccountInformationResponse */ canTrade?: boolean; /** * Whether withdrawals are enabled. * @type {boolean} * @memberof AccountInformationResponse */ canWithdraw?: boolean; /** * Fee tier level. * @type {number | bigint} * @memberof AccountInformationResponse */ feeTier?: number | bigint; /** * update time * @type {number | bigint} * @memberof AccountInformationResponse */ updateTime?: number | bigint; } //#endregion //#region src/rest-api/types/account-trade-list-response-inner.d.ts /** * Futures (COIN-M) REST API * * Access market data, manage accounts, and trade COIN-M perpetual and delivery futures. * * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ /** * * @export * @interface AccountTradeListResponseInner */ interface AccountTradeListResponseInner { /** * Trading symbol * @type {string} * @memberof AccountTradeListResponseInner */ symbol?: string; /** * positionId * @type {number | bigint} * @memberof AccountTradeListResponseInner */ id?: number | bigint; /** * Sub-order ID * @type {number | bigint} * @memberof AccountTradeListResponseInner */ orderId?: number | bigint; /** * Pair * @type {string} * @memberof AccountTradeListResponseInner */ pair?: string; /** * Trading side * @type {string} * @memberof AccountTradeListResponseInner */ side?: string; /** * Latest token price. * @type {string} * @memberof AccountTradeListResponseInner */ price?: string; /** * Quantity. * @type {string} * @memberof AccountTradeListResponseInner */ qty?: string; /** * Realized PnL. * @type {string} * @memberof AccountTradeListResponseInner */ realizedPnl?: string; /** * Margin asset. * @type {string} * @memberof AccountTradeListResponseInner */ marginAsset?: string; /** * Base asset quantity. * @type {string} * @memberof AccountTradeListResponseInner */ baseQty?: string; /** * Transaction Fee (in Crypto) * @type {string} * @memberof AccountTradeListResponseInner */ commission?: string; /** * Commission asset. * @type {string} * @memberof AccountTradeListResponseInner */ commissionAsset?: string; /** * Time * @type {number | bigint} * @memberof AccountTradeListResponseInner */ time?: number | bigint; /** * Position side * @type {string} * @memberof AccountTradeListResponseInner */ positionSide?: string; /** * Whether the trade is a buy side for the account. * @type {boolean} * @memberof AccountTradeListResponseInner */ buyer?: boolean; /** * Whether the account is maker in this trade. * @type {boolean} * @memberof AccountTradeListResponseInner */ maker?: boolean; } //#endregion //#region src/rest-api/types/account-trade-list-response.d.ts /** * * @export * @interface AccountTradeListResponse */ interface AccountTradeListResponse extends Array<AccountTradeListResponseInner> {} //#endregion //#region src/rest-api/types/all-orders-response-inner.d.ts /** * Futures (COIN-M) REST API * * Access market data, manage accounts, and trade COIN-M perpetual and delivery futures. * * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ /** * * @export * @interface AllOrdersResponseInner */ interface AllOrdersResponseInner { /** * Average execution price * @type {string} * @memberof AllOrdersResponseInner */ avgPrice?: string; /** * Client order ID. * @type {string} * @memberof AllOrdersResponseInner */ clientOrderId?: string; /** * Cumulative base asset amount. * @type {string} * @memberof AllOrdersResponseInner */ cumBase?: string; /** * Executed quantity * @type {string} * @memberof AllOrdersResponseInner */ executedQty?: string; /** * Sub-order ID * @type {number | bigint} * @memberof AllOrdersResponseInner */ orderId?: number | bigint; /** * Original order quantity * @type {string} * @memberof AllOrdersResponseInner */ origQty?: string; /** * Original order type. * @type {string} * @memberof AllOrdersResponseInner */ origType?: string; /** * Latest token price. * @type {string} * @memberof AllOrdersResponseInner */ price?: string; /** * Whether the order is reduce-only. * @type {boolean} * @memberof AllOrdersResponseInner */ reduceOnly?: boolean; /** * Trading side * @type {string} * @memberof AllOrdersResponseInner */ side?: string; /** * Position side * @type {string} * @memberof AllOrdersResponseInner */ positionSide?: string; /** * Enum:completed,processing * @type {string} * @memberof AllOrdersResponseInner */ status?: string; /** * please ignore when order type is TRAILING_STOP_MARKET * @type {string} * @memberof AllOrdersResponseInner */ stopPrice?: string; /** * if Close-All * @type {boolean} * @memberof AllOrdersResponseInner */ closePosition?: boolean; /** * Trading symbol * @type {string} * @memberof AllOrdersResponseInner */ symbol?: string; /** * Pair * @type {string} * @memberof AllOrdersResponseInner */ pair?: string; /** * Time * @type {number | bigint} * @memberof AllOrdersResponseInner */ time?: number | bigint; /** * Time in force * @type {string} * @memberof AllOrdersResponseInner */ timeInForce?: string; /** * Order type. * @type {string} * @memberof AllOrdersResponseInner */ type?: string; /** * activation price, only return with TRAILING_STOP_MARKET order * @type {string} * @memberof AllOrdersResponseInner */ activatePrice?: string; /** * callback rate, only return with TRAILING_STOP_MARKET order * @type {string} * @memberof AllOrdersResponseInner */ priceRate?: string; /** * update time * @type {number | bigint} * @memberof AllOrdersResponseInner */ updateTime?: number | bigint; /** * Stop trigger price type. * @type {string} * @memberof AllOrdersResponseInner */ workingType?: string; /** * if conditional order trigger is protected * @type {boolean} * @memberof AllOrdersResponseInner */ priceProtect?: boolean; /** * price match mode * @type {string} * @memberof AllOrdersResponseInner */ priceMatch?: string; /** * self trading preventation mode * @type {string} * @memberof AllOrdersResponseInner */ selfTradePreventionMode?: string; } //#endregion //#region src/rest-api/types/all-orders-response.d.ts /** * * @export * @interface AllOrdersResponse */ interface AllOrdersResponse extends Array<AllOrdersResponseInner> {} //#endregion //#region src/rest-api/types/auto-cancel-all-open-orders-response.d.ts /** * Futures (COIN-M) REST API * * Access market data, manage accounts, and trade COIN-M perpetual and delivery futures. * * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ /** * * @export * @interface AutoCancelAllOpenOrdersResponse */ interface AutoCancelAllOpenOrdersResponse { /** * Trading symbol * @type {string} * @memberof AutoCancelAllOpenOrdersResponse */ symbol?: string; /** * Countdown cancellation time in milliseconds. * @type {string} * @memberof AutoCancelAllOpenOrdersResponse */ countdownTime?: string; } //#endregion //#region src/rest-api/types/basis-response-inner.d.ts /** * Futures (COIN-M) REST API * * Access market data, manage accounts, and trade COIN-M perpetual and delivery futures. * * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ /** * * @export * @interface BasisResponseInner */ interface BasisResponseInner { /** * index price * @type {string} * @memberof BasisResponseInner */ indexPrice?: string; /** * Contract type. * @type {string} * @memberof BasisResponseInner */ contractType?: string; /** * Basis rate. * @type {string} * @memberof BasisResponseInner */ basisRate?: string; /** * Futures price. * @type {string} * @memberof BasisResponseInner */ futuresPrice?: string; /** * Annualized basis rate. * @type {string} * @memberof BasisResponseInner */ annualizedBasisRate?: string; /** * Basis value. * @type {string} * @memberof BasisResponseInner */ basis?: string; /** * Pair * @type {string} * @memberof BasisResponseInner */ pair?: string; /** * Timestamp in milliseconds. * @type {number | bigint} * @memberof BasisResponseInner */ timestamp?: number | bigint; } //#endregion //#region src/rest-api/types/basis-response.d.ts /** * * @export * @interface BasisResponse */ interface BasisResponse extends Array<BasisResponseInner> {} //#endregion //#region src/rest-api/types/cancel-all-open-orders-response.d.ts /** * Futures (COIN-M) REST API * * Access market data, manage accounts, and trade COIN-M perpetual and delivery futures. * * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ /** * * @export * @interface CancelAllOpenOrdersResponse */ interface CancelAllOpenOrdersResponse { /** * API response code. \"000000\" indicates success. * @type {number | bigint} * @memberof CancelAllOpenOrdersResponse */ code?: number | bigint; /** * Message details. * @type {string} * @memberof CancelAllOpenOrdersResponse */ msg?: string; } //#endregion //#region src/rest-api/types/cancel-multiple-orders-response-inner.d.ts /** * Futures (COIN-M) REST API * * Access market data, manage accounts, and trade COIN-M perpetual and delivery futures. * * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ /** * * @export * @interface CancelMultipleOrdersResponseInner */ interface CancelMultipleOrdersResponseInner { /** * Client order ID. * @type {string} * @memberof CancelMultipleOrdersResponseInner */ clientOrderId?: string; /** * Cumulative filled quantity. * @type {string} * @memberof CancelMultipleOrdersResponseInner */ cumQty?: string; /** * Executed quantity * @type {string} * @memberof CancelMultipleOrdersResponseInner */ executedQty?: string; /** * Sub-order ID * @type {number | bigint} * @memberof CancelMultipleOrdersResponseInner */ orderId?: number | bigint; /** * Original order quantity * @type {string} * @memberof CancelMultipleOrdersResponseInner */ origQty?: string; /** * Latest token price. * @type {string} * @memberof CancelMultipleOrdersResponseInner */ price?: string; /** * Whether the order is reduce-only. * @type {boolean} * @memberof CancelMultipleOrdersResponseInner */ reduceOnly?: boolean; /** * Trading side * @type {string} * @memberof CancelMultipleOrdersResponseInner */ side?: string; /** * Position side * @type {string} * @memberof CancelMultipleOrdersResponseInner */ positionSide?: string; /** * Enum:completed,processing * @type {string} * @memberof CancelMultipleOrdersResponseInner */ status?: string; /** * please ignore when order type is TRAILING_STOP_MARKET * @type {string} * @memberof CancelMultipleOrdersResponseInner */ stopPrice?: string; /** * if Close-All * @type {boolean} * @memberof CancelMultipleOrdersResponseInner */ closePosition?: boolean; /** * Trading symbol * @type {string} * @memberof CancelMultipleOrdersResponseInner */ symbol?: string; /** * Pair * @type {string} * @memberof CancelMultipleOrdersResponseInner */ pair?: string; /** * Time in force * @type {string} * @memberof CancelMultipleOrdersResponseInner */ timeInForce?: string; /** * Original order type. * @type {string} * @memberof CancelMultipleOrdersResponseInner */ origType?: string; /** * Order type. * @type {string} * @memberof CancelMultipleOrdersResponseInner */ type?: string; /** * activation price, only return with TRAILING_STOP_MARKET order * @type {string} * @memberof CancelMultipleOrdersResponseInner */ activatePrice?: string; /** * callback rate, only return with TRAILING_STOP_MARKET order * @type {string} * @memberof CancelMultipleOrdersResponseInner */ priceRate?: string; /** * Stop trigger price type. * @type {string} * @memberof CancelMultipleOrdersResponseInner */ workingType?: string; /** * if conditional order trigger is protected * @type {boolean} * @memberof CancelMultipleOrdersResponseInner */ priceProtect?: boolean; /** * price match mode * @type {string} * @memberof CancelMultipleOrdersResponseInner */ priceMatch?: string; /** * self trading preventation mode * @type {string} * @memberof CancelMultipleOrdersResponseInner */ selfTradePreventionMode?: string; /** * update time * @type {number | bigint} * @memberof CancelMultipleOrdersResponseInner */ updateTime?: number | bigint; /** * API response code. \"000000\" indicates success. * @type {number | bigint} * @memberof CancelMultipleOrdersResponseInner */ code?: number | bigint; /** * Message details. * @type {string} * @memberof CancelMultipleOrdersResponseInner */ msg?: string; } //#endregion //#region src/rest-api/types/cancel-multiple-orders-response.d.ts /** * * @export * @interface CancelMultipleOrdersResponse */ interface CancelMultipleOrdersResponse extends Array<CancelMultipleOrdersResponseInner> {} //#endregion //#region src/rest-api/types/cancel-order-response.d.ts /** * Futures (COIN-M) REST API * * Access market data, manage accounts, and trade COIN-M perpetual and delivery futures. * * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ /** * * @export * @interface CancelOrderResponse */ interface CancelOrderResponse$1 { /** * Client order ID. * @type {string} * @memberof CancelOrderResponse */ clientOrderId?: string; /** * Cumulative filled quantity. * @type {string} * @memberof CancelOrderResponse */ cumQty?: string; /** * Executed quantity * @type {string} * @memberof CancelOrderResponse */ executedQty?: string; /** * Sub-order ID * @type {number | bigint} * @memberof CancelOrderResponse */ orderId?: number | bigint; /** * Original order quantity * @type {string} * @memberof CancelOrderResponse */ origQty?: string; /** * Latest token price. * @type {string} * @memberof CancelOrderResponse */ price?: string; /** * Whether the order is reduce-only. * @type {boolean} * @memberof CancelOrderResponse */ reduceOnly?: boolean; /** * Trading side * @type {string} * @memberof CancelOrderResponse */ side?: string; /** * Position side * @type {string} * @memberof CancelOrderResponse */ positionSide?: string; /** * Enum:completed,processing * @type {string} * @memberof CancelOrderResponse */ status?: string; /** * please ignore when order type is TRAILING_STOP_MARKET * @type {string} * @memberof CancelOrderResponse */ stopPrice?: string; /** * if Close-All * @type {boolean} * @memberof CancelOrderResponse */ closePosition?: boolean; /** * Trading symbol * @type {string} * @memberof CancelOrderResponse */ symbol?: string; /** * Pair * @type {string} * @memberof CancelOrderResponse */ pair?: string; /** * Time in force * @type {string} * @memberof CancelOrderResponse */ timeInForce?: string; /** * Original order type. * @type {string} * @memberof CancelOrderResponse */ origType?: string; /** * Order type. * @type {string} * @memberof CancelOrderResponse */ type?: string; /** * activation price, only return with TRAILING_STOP_MARKET order * @type {string} * @memberof CancelOrderResponse */ activatePrice?: string; /** * callback rate, only return with TRAILING_STOP_MARKET order * @type {string} * @memberof CancelOrderResponse */ priceRate?: string; /** * update time * @type {number | bigint} * @memberof CancelOrderResponse */ updateTime?: number | bigint; /** * Stop trigger price type. * @type {string} * @memberof CancelOrderResponse */ workingType?: string; /** * if conditional order trigger is protected * @type {boolean} * @memberof CancelOrderResponse */ priceProtect?: boolean; /** * price match mode * @type {string} * @memberof CancelOrderResponse */ priceMatch?: string; /** * self trading preventation mode * @type {string} * @memberof CancelOrderResponse */ selfTradePreventionMode?: string; } //#endregion //#region src/rest-api/types/change-initial-leverage-response.d.ts /** * Futures (COIN-M) REST API * * Access market data, manage accounts, and trade COIN-M perpetual and delivery futures. * * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ /** * * @export * @interface ChangeInitialLeverageResponse */ interface ChangeInitialLeverageResponse { /** * Leverage value. * @type {number | bigint} * @memberof ChangeInitialLeverageResponse */ leverage?: number | bigint; /** * maximum quantity of base asset * @type {string} * @memberof ChangeInitialLeverageResponse */ maxQty?: string; /** * Trading symbol * @type {string} * @memberof ChangeInitialLeverageResponse */ symbol?: string; } //#endregion //#region src/rest-api/types/change-margin-type-response.d.ts /** * Futures (COIN-M) REST API * * Access market data, manage accounts, and trade COIN-M perpetual and delivery futures. * * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ /** * * @export * @interface ChangeMarginTypeResponse */ interface ChangeMarginTypeResponse { /** * API response code. \"000000\" indicates success. * @type {number | bigint} * @memberof ChangeMarginTypeResponse */ code?: number | bigint; /** * Message details. * @type {string} * @memberof ChangeMarginTypeResponse */ msg?: string; } //#endregion //#region src/rest-api/types/change-position-mode-response.d.ts /** * Futures (COIN-M) REST API * * Access market data, manage accounts, and trade COIN-M perpetual and delivery futures. * * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ /** * * @export * @interface ChangePositionModeResponse */ interface ChangePositionModeResponse { /** * API response code. \"000000\" indicates success. * @type {number | bigint} * @memberof ChangePositionModeResponse */ code?: number | bigint; /** * Message details. * @type {string} * @memberof ChangePositionModeResponse */ msg?: string; } //#endregion //#region src/rest-api/types/check-server-time-response.d.ts /** * Futures (COIN-M) REST API * * Access market data, manage accounts, and trade COIN-M perpetual and delivery futures. * * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ /** * * @export * @interface CheckServerTimeResponse */ interface CheckServerTimeResponse { /** * Ignore please. If you want to check current server time, please check via \"GET /dapi/v1/time\" * @type {number | bigint} * @memberof CheckServerTimeResponse */ serverTime?: number | bigint; } //#endregion //#region src/rest-api/types/compressed-aggregate-trades-list-response-inner.d.ts /** * Futures (COIN-M) REST API * * Access market data, manage accounts, and trade COIN-M perpetual and delivery futures. * * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ /** * * @export * @interface CompressedAggregateTradesListResponseInner */ interface CompressedAggregateTradesListResponseInner { /** * Aggregate tradeId * @type {number | bigint} * @memberof CompressedAggregateTradesListResponseInner */ a?: number | bigint; /** * Price * @type {string} * @memberof CompressedAggregateTradesListResponseInner */ p?: string; /** * Quantity * @type {string} * @memberof CompressedAggregateTradesListResponseInner */ q?: string; /** * First tradeId * @type {number | bigint} * @memberof CompressedAggregateTradesListResponseInner */ f?: number | bigint; /** * Last tradeId * @type {number | bigint} * @memberof CompressedAggregateTradesListResponseInner */ l?: number | bigint; /** * Timestamp * @type {number | bigint} * @memberof CompressedAggregateTradesListResponseInner */ T?: number | bigint; /** * Was the buyer the maker? * @type {boolean} * @memberof CompressedAggregateTradesListResponseInner */ m?: boolean; } //#endregion //#region src/rest-api/types/compressed-aggregate-trades-list-response.d.ts /** * * @export * @interface CompressedAggregateTradesListResponse */ interface CompressedAggregateTradesListResponse extends Array<CompressedAggregateTradesListResponseInner> {} //#endregion //#region src/rest-api/types/continuous-contract-kline-candlestick-data-item-inner.d.ts /** * Futures (COIN-M) REST API * * Access market data, manage accounts, and trade COIN-M perpetual and delivery futures. * * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ /** * @type ContinuousContractKlineCandlestickDataItemInner */ type ContinuousContractKlineCandlestickDataItemInner = number | string; //#endregion //#region src/rest-api/types/continuous-contract-kline-candlestick-data-item.d.ts /** * * @export * @interface ContinuousContractKlineCandlestickDataItem */ interface ContinuousContractKlineCandlestickDataItem extends Array<ContinuousContractKlineCandlestickDataItemInner> {} //#endregion //#region src/rest-api/types/continuous-contract-kline-candlestick-data-response.d.ts /** * * @export * @interface ContinuousContractKlineCandlestickDataResponse */ interface ContinuousContractKlineCandlestickDataResponse extends Array<ContinuousContractKlineCandlestickDataItem> {} //#endregion //#region src/rest-api/types/current-all-open-orders-response.d.ts /** * * @export * @interface CurrentAllOpenOrdersResponse */ interface CurrentAllOpenOrdersResponse extends Array<AllOrdersResponseInner> {} //#endregion //#region src/rest-api/types/exchange-information-response-rate-limits-inner.d.ts /** * Futures (COIN-M) REST API * * Access market data, manage accounts, and trade COIN-M perpetual and delivery futures. * * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ /** * * @export * @interface ExchangeInformationResponseRateLimitsInner */ interface ExchangeInformationResponseRateLimitsInner { /** * Rate limit interval. * @type {string} * @memberof ExchangeInformationResponseRateLimitsInner */ interval?: string; /** * Rate limit interval multiplier. * @type {number | bigint} * @memberof ExchangeInformationResponseRateLimitsInner */ intervalNum?: number | bigint; /** * Maximum allowed orders for this rule. * @type {number | bigint} * @memberof ExchangeInformationResponseRateLimitsInner */ limit?: number | bigint; /** * Rate limit type. * @type {string} * @memberof ExchangeInformationResponseRateLimitsInner */ rateLimitType?: string; } //#endregion //#region src/rest-api/types/exchange-information-response-symbols-inner-filters-inner.d.ts /** * Futures (COIN-M) REST API * * Access market data, manage accounts, and trade COIN-M perpetual and delivery futures. * * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ /** * * @export * @interface ExchangeInformationResponseSymbolsInnerFiltersInner */ interface ExchangeInformationResponseSymbolsInnerFiltersInner { /** * Filter type. * @type {string} * @memberof ExchangeInformationResponseSymbolsInnerFiltersInner */ filterType?: string; /** * Maximum price. * @type {string} * @memberof ExchangeInformationResponseSymbolsInnerFiltersInner */ maxPrice?: string; /** * Minimum price. * @type {string} * @memberof ExchangeInformationResponseSymbolsInnerFiltersInner */ minPrice?: string; /** * Tick size. * @type {string} * @memberof ExchangeInformationResponseSymbolsInnerFiltersInner */ tickSize?: string; /** * maximum quantity of base asset * @type {string} * @memberof ExchangeInformationResponseSymbolsInnerFiltersInner */ maxQty?: string; /** * Minimum quantity. * @type {string} * @memberof ExchangeInformationResponseSymbolsInnerFiltersInner */ minQty?: string; /** * Step size. * @type {string} * @memberof ExchangeInformationResponseSymbolsInnerFiltersInner */ stepSize?: string; /** * Maximum allowed orders for this rule. * @type {number | bigint} * @memberof ExchangeInformationResponseSymbolsInnerFiltersInner */ limit?: number | bigint; /** * Upper multiplier bound. * @type {string} * @memberof ExchangeInformationResponseSymbolsInnerFiltersInner */ multiplierUp?: string; /** * Lower multiplier bound. * @type {string} * @memberof ExchangeInformationResponseSymbolsInnerFiltersInner */ multiplierDown?: string; /** * Multiplier decimal precision. * @type {string} * @memberof ExchangeInformationResponseSymbolsInnerFiltersInner */ multiplierDecimal?: string; } //#endregion //#region src/rest-api/types/exchange-information-response-symbols-inner.d.ts /** * * @export * @interface ExchangeInformationResponseSymbolsInner */ interface ExchangeInformationResponseSymbolsInner { /** * Trading filters and constraints. * @type {Array<ExchangeInformationResponseSymbolsInnerFiltersInner>} * @memberof ExchangeInformationResponseSymbolsInner */ filters?: Array<ExchangeInformationResponseSymbolsInnerFiltersInner>; /** * Supported order types. * @type {Array<string>} * @memberof ExchangeInformationResponseSymbolsInner */ orderTypes?: Array<string>; /** * Time in force * @type {Array<string>} * @memberof ExchangeInformationResponseSymbolsInner */ timeInForce?: Array<string>; /** * liquidation fee rate * @type {string} * @memberof ExchangeInformationResponseSymbolsInner */ liquidationFee?: string; /** * the max price difference rate( from mark price) a market order can make * @type {string} * @memberof ExchangeInformationResponseSymbolsInner */ marketTakeBound?: string; /** * Trading symbol * @type {string} * @memberof ExchangeInformationResponseSymbolsInner */ symbol?: string; /** * Pair * @type {string} * @memberof ExchangeInformationResponseSymbolsInner */ pair?: string; /** * Contract type. * @type {string} * @memberof ExchangeInformationResponseSymbolsInner */ contractType?: string; /** * Delivery timestamp. * @type {number | bigint} * @memberof ExchangeInformationResponseSymbolsInner */ deliveryDate?: number | bigint; /** * Onboard timestamp. * @type {number | bigint} * @memberof ExchangeInformationResponseSymbolsInner */ onboardDate?: number | bigint; /** * Contract status. * @type {string} * @memberof ExchangeInformationResponseSymbolsInner */ contractStatus?: string; /** * Contract size. * @type {number | bigint} * @memberof ExchangeInformationResponseSymbolsInner */ contractSize?: number | bigint; /** * Quote asset symbol. * @type {string} * @memberof ExchangeInformationResponseSymbolsInner */ quoteAsset?: string; /** * Base asset symbol. * @type {string} * @memberof ExchangeInformationResponseSymbolsInner */ baseAsset?: string; /** * Margin asset. * @type {string} * @memberof ExchangeInformationResponseSymbolsInner */ marginAsset?: string; /** * please do not use it as tickSize * @type {number | bigint} * @memberof ExchangeInformationResponseSymbolsInner */ pricePrecision?: number | bigint; /** * please do not use it as stepSize * @type {number | bigint} * @memberof ExchangeInformationResponseSymbolsInner */ quantityPrecision?: number | bigint; /** * Base asset precision. * @type {number | bigint} * @memberof ExchangeInformationResponseSymbolsInner */ baseAssetPrecision?: number | bigint; /** * Quote asset precision. * @type {number | bigint} * @memberof ExchangeInformationResponseSymbolsInner */ quotePrecision?: number | bigint; /** * ignore * @type {number | bigint} * @memberof ExchangeInformationResponseSymbolsInner */ equalQtyPrecision?: number | bigint; /** * threshold for algo order with \"priceProtect\" * @type {string} * @memberof ExchangeInformationResponseSymbolsInner */ triggerProtect?: string; /** * ignore * @type {string} * @memberof ExchangeInformationResponseSymbolsInner */ maintMarginPercent?: string; /** * ignore * @type {string} * @memberof ExchangeInformationResponseSymbolsInner */ requiredMarginPercent?: string; /** * Underlying asset type. * @type {string} * @memberof ExchangeInformationResponseSymbolsInner */ underlyingType?: string; /** * Underlying asset sub-type. * @type {Array<string>} * @memberof ExchangeInformationResponseSymbolsInner */ underlyingSubType?: Array<string>; } //#endregion //#region src/rest-api/types/exchange-information-response.d.ts /** * * @export * @interface ExchangeInformationResponse */ interface ExchangeInformationResponse { /** * Exchange filters. * @type {Array<string>} * @memberof ExchangeInformationResponse */ exchangeFilters?: Array<string>; /** * Rate limit definitions. * @type {Array<ExchangeInformationResponseRateLimitsInner>} * @memberof ExchangeInformationResponse */ rateLimits?: Array<ExchangeInformationResponseRateLimitsInner>; /** * Ignore please. If you want to check current server time, please check via \"GET /dapi/v1/time\" * @type {number | bigint} * @memberof ExchangeInformationResponse */ serverTime?: number | bigint; /** * Supported trading symbols. * @type {Array<ExchangeInformationResponseSymbolsInner>} * @memberof ExchangeInformationResponse */ symbols?: Array<ExchangeInformationResponseSymbolsInner>; /** * Timezone of market data. * @type {string} * @memberof ExchangeInformationResponse */ timezone?: string; } //#endregion //#region src/rest-api/types/futures-account-balance-response-inner.d.ts /** * Futures (COIN-M) REST API * * Access market data, manage accounts, and trade COIN-M perpetual and delivery futures. * * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ /** * * @export * @interface FuturesAccountBalanceResponseInner */ interface FuturesAccountBalanceResponseInner { /** * unique account code * @type {string} * @memberof FuturesAccountBalanceResponseInner */ accountAlias?: string; /** * asset name * @type {string} * @memberof FuturesAccountBalanceResponseInner */ asset?: string; /** * Account balance. * @type {string} * @memberof FuturesAccountBalanceResponseInner */ balance?: string; /** * Available amount for withdrawal. * @type {string} * @memberof FuturesAccountBalanceResponseInner */ withdrawAvailable?: string; /** * wallet balance for crossed margin * @type {string} * @memberof FuturesAccountBalanceResponseInner */ crossWalletBalance?: string; /** * total unrealized profit or loss of crossed positions * @type {string} * @memberof FuturesAccountBalanceResponseInner */ crossUnPnl?: string; /** * available margin balance * @type {string} * @memberof FuturesAccountBalanceResponseInner */ availableBalance?: string; /** * update time * @type {number | bigint} * @memberof FuturesAccountBalanceResponseInner */ updateTime?: number | bigint; } //#endregion //#region src/rest-api/types/futures-account-balance-response.d.ts /** * * @export * @interface FuturesAccountBalanceResponse */ interface FuturesAccountBalanceResponse$1 extends Array<FuturesAccountBalanceResponseInner> {} //#endregion //#region src/rest-api/types/get-current-position-mode-response.d.ts /** * Futures (COIN-M) REST API * * Access market data, manage accounts, and trade COIN-M perpetual and delivery futures. * * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ /** * * @export * @interface GetCurrentPositionModeResponse */ interface GetCurrentPositionModeResponse { /** * Whether dual-side position mode is enabled. * @type {boolean} * @memberof GetCurrentPositionModeResponse */ dualSidePosition?: boolean; } //#endregion //#region src/rest-api/types/get-download-id-for-futures-order-history-response.d.ts /** * Futures (COIN-M) REST API * * Access market data, manage accounts, and trade COIN-M perpetual and delivery futures. * * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ /** * * @export * @interface GetDownloadIdForFuturesOrderHistoryResponse */ interface GetDownloadIdForFuturesOrderHistoryResponse { /** * Average time taken for data download in the past 30 days * @type {number | bigint} * @memberof GetDownloadIdForFuturesOrderHistoryResponse */ avgCostTimestampOfLast30d?: number | bigint; /** * Download task ID. * @type {string} * @memberof GetDownloadIdForFuturesOrderHistoryResponse */ downloadId?: string; } //#endregion //#region src/rest-api/types/get-download-id-for-futures-trade-history-response.d.ts /** * Futures (COIN-M) REST API * * Access market data, manage accounts, and trade COIN-M perpetual and delivery futures. * * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ /** * * @export * @interface GetDownloadIdForFuturesTradeHistoryResponse */ interface GetDownloadIdForFuturesTradeHistoryResponse { /** * Average time taken for data download in the past 30 days * @type {number | bigint} * @memberof GetDownloadIdForFuturesTradeHistoryResponse */ avgCostTimestampOfLast30d?: number | bigint; /** * Download task ID. * @type {string} * @memberof GetDownloadIdForFuturesTradeHistoryResponse */ downloadId?: string; } //#endregion //#region src/rest-api/types/get-download-id-for-futures-transaction-history-response.d.ts /** * Futures (COIN-M) REST API * * Access market data, manage accounts, and trade COIN-M perpetual and delivery futures. * * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ /** * * @export * @interface GetDownloadIdForFuturesTransactionHistoryResponse */ interface GetDownloadIdForFuturesTransactionHistoryResponse { /** * Average time taken for data download in the past 30 days * @type {number | bigint} * @memberof GetDownloadIdForFuturesTransactionHistoryResponse */ avgCostTimestampOfLast30d?: number | bigint; /** * Download task ID. * @type {string} * @memberof GetDownloadIdForFuturesTransactionHistoryResponse */ downloadId?: string; } //#endregion //#region src/rest-api/types/get-funding-rate-history-of-perpetual-futures-response-inner.d.ts /** * Futures (COIN-M) REST API * * Access market data, manage accounts, and trade COIN-M perpetual and delivery futures. * * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ /** * * @export * @interface GetFundingRateHistoryOfPerpetualFuturesResponseInner */ interface GetFundingRateHistoryOfPerpetualFuturesResponseInner { /** * Trading symbol * @type {string} * @memberof GetFundingRateHistoryOfPerpetualFuturesResponseInner */ symbol?: string; /** * Funding time. * @type {number | bigint} * @memberof GetFundingRateHistoryOfPerpetualFuturesResponseInner */ fundingTime?: number | bigint; /** * Funding rate. * @type {string} * @memberof GetFundingRateHistoryOfPerpetualFuturesResponseInner */ fundingRate?: string; } //#endregion //#region src/rest-api/types/get-funding-rate-history-of-perpetual-futures-response.d.ts /** * * @export * @interface GetFundingRateHistoryOfPerpetualFuturesResponse */ interface GetFundingRateHistoryOfPerpetualFuturesResponse extends Array<GetFundingRateHistoryOfPerpetualFuturesResponseInner> {} //#endregion //#region src/rest-api/types/get-funding-rate-info-response-inner.d.ts /** * Futures (COIN-M) REST API * * Access market data, manage accounts, and trade COIN-M perpetual and delivery futures. * * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ /** * * @export * @interface GetFundingRateInfoResponseInner */ interface GetFundingRateInfoResponseInner { /** * Trading symbol * @type {string} * @memberof GetFundingRateInfoResponseInner */ symbol?: string; /** * Adjusted funding rate cap. * @type {string} * @memberof GetFundingRateInfoResponseInner */ adjustedFundingRateCap?: string; /** * Adjusted funding rate floor. * @type {string} * @memberof GetFundingRateInfoResponseInner */ adjustedFundingRateFloor?: string; /** * Funding interval in hours. * @type {number | bigint} * @memberof GetFundingRateInfoResponseInner */ fundingIntervalHours?: number | bigint; /** * Disclaimer text. * @type {boolean} * @memberof GetFundingRateInfoResponseInner */ disclaimer?: boolean; } //#endregion //#region src/rest-api/types/get-funding-rate-info-response.d.ts /** * * @export * @interface GetFundingRateInfoResponse */ interface GetFundingRateInfoResponse extends Array<GetFundingRateInfoResponseInner> {} //#endregion //#region src/rest-api/types/get-futures-order-history-download-link-by-id-response.d.ts /** * Futures (COIN-M) REST API * * Access market data, manage accounts, and trade COIN-M perpetual and delivery futures. * * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ /** * * @export * @interface GetFuturesOrderHistoryDownloadLinkByIdResponse */ interface GetFuturesOrderHistoryDownloadLinkByIdResponse { /** * Download task ID. * @type {string} * @memberof GetFuturesOrderHistoryDownloadLinkByIdResponse */ downloadId?: string; /** * Enum:completed,processing * @type {string} * @memberof GetFuturesOrderHistoryDownloadLinkByIdResponse */ status?: string; /** * The link is mapped to download id * @type {string} * @memberof GetFuturesOrderHistoryDownloadLinkByIdResponse */ url?: string; /** * ignore * @type {boolean} * @memberof GetFuturesOrderHistoryDownloadLinkByIdResponse */ notified?: boolean; /** * The link would expire after this timestamp * @type {number | bigint} * @memberof GetFuturesOrderHistoryDownloadLinkByIdResponse */ expirationTimestamp?: number | bigint; /** * Whether the record is expired. * @type {string} * @memberof GetFuturesOrderHistoryDownloadLinkByIdResponse */ isExpired?: string; } //#endregion //#region src/rest-api/types/get-futures-trade-download-link-by-id-response.d.ts /** * Futures (COIN-M) REST API * * Access market data, manage accounts, and trade COIN-M perpetual and delivery futures. * * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ /** * * @export * @interface GetFut