@binance/derivatives-trading-options
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.
1 lines • 354 kB
Source Map (JSON)
{"version":3,"file":"index.mjs","names":["localVarQueryParameter: Record<string, unknown>","localVarBodyParameter: Record<string, unknown>","_timeUnit: TimeUnit | undefined","localVarQueryParameter: Record<string, unknown>","localVarBodyParameter: Record<string, unknown>","_timeUnit: TimeUnit | undefined","localVarQueryParameter: Record<string, unknown>","localVarBodyParameter: Record<string, unknown>","_timeUnit: TimeUnit | undefined","localVarQueryParameter: Record<string, unknown>","localVarBodyParameter: Record<string, unknown>","_timeUnit: TimeUnit | undefined","localVarQueryParameter: Record<string, unknown>","localVarBodyParameter: Record<string, unknown>","_timeUnit: TimeUnit | undefined","localVarQueryParameter: Record<string, unknown>","localVarBodyParameter: Record<string, unknown>","_timeUnit: TimeUnit | undefined","DERIVATIVES_TRADING_OPTIONS_REST_API_PROD_URL","DERIVATIVES_TRADING_OPTIONS_WS_STREAMS_PROD_URL"],"sources":["../package.json","../src/rest-api/types/place-multiple-orders-orders-parameter-inner.ts","../src/rest-api/modules/account-api.ts","../src/rest-api/modules/market-data-api.ts","../src/rest-api/modules/market-maker-block-trade-api.ts","../src/rest-api/modules/market-maker-endpoints-api.ts","../src/rest-api/modules/trade-api.ts","../src/rest-api/modules/user-data-streams-api.ts","../src/rest-api/rest-api.ts","../src/rest-api/index.ts","../src/websocket-streams/modules/market-api.ts","../src/websocket-streams/modules/public-api.ts","../src/websocket-streams/websocket-streams-connection.ts","../src/websocket-streams/websocket-streams.ts","../src/websocket-streams/index.ts","../src/derivatives-trading-options.ts"],"sourcesContent":["{\n \"name\": \"@binance/derivatives-trading-options\",\n \"description\": \"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.\",\n \"version\": \"15.0.7\",\n \"main\": \"./dist/index.js\",\n \"module\": \"./dist/index.mjs\",\n \"types\": \"./dist/index.d.ts\",\n \"exports\": {\n \".\": {\n \"require\": \"./dist/index.js\",\n \"import\": \"./dist/index.mjs\"\n }\n },\n \"scripts\": {\n \"prepublishOnly\": \"npm run build\",\n \"build\": \"npm run clean && tsdown\",\n \"typecheck\": \"tsc --noEmit\",\n \"clean\": \"rm -rf dist\",\n \"test\": \"npx jest --maxWorkers=4 --bail\",\n \"test:watch\": \"npx jest --watch\",\n \"format\": \"npx prettier --ignore-path .prettierignore --write .\",\n \"lint\": \"npx eslint '**/*.ts' --fix\"\n },\n \"keywords\": [\n \"Binance\",\n \"API\",\n \"Derivatives\",\n \"Futures\",\n \"Coin-M\",\n \"Connector\",\n \"REST\",\n \"WebSocket\",\n \"Trading\"\n ],\n \"author\": \"Binance\",\n \"license\": \"MIT\",\n \"files\": [\n \"dist\"\n ],\n \"devDependencies\": {\n \"@types/jest\": \"^29.5.4\",\n \"@types/node\": \"^20.17.24\",\n \"eslint\": \"8.57.0\",\n \"jest\": \"^29.6.4\",\n \"json-with-bigint\": \"^3.4.4\",\n \"prettier\": \"^3.3.3\",\n \"ts-jest\": \"^29.1.1\",\n \"ts-node\": \"^10.9.1\",\n \"tsdown\": \"^0.16.5\",\n \"typescript\": \"^5.7.2\",\n \"typescript-eslint\": \"^8.24.0\"\n },\n \"dependencies\": {\n \"@binance/common\": \"2.3.14\",\n \"@types/ws\": \"^8.5.5\",\n \"axios\": \"^1.7.4\",\n \"ws\": \"^8.17.1\"\n }\n}\n","/* tslint:disable */\n\n/**\n * Binance Derivatives Trading Options REST API\n *\n * OpenAPI Specification for the Binance Derivatives Trading Options REST API\n *\n * The version of the OpenAPI document: 1.0.0\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\n\n/**\n *\n * @export\n * @interface PlaceMultipleOrdersOrdersParameterInner\n */\nexport interface PlaceMultipleOrdersOrdersParameterInner {\n /**\n *\n * @type {string}\n * @memberof PlaceMultipleOrdersOrdersParameterInner\n */\n symbol?: string;\n /**\n *\n * @type {string}\n * @memberof PlaceMultipleOrdersOrdersParameterInner\n */\n side?: PlaceMultipleOrdersOrdersParameterInnerSideEnum;\n /**\n *\n * @type {string}\n * @memberof PlaceMultipleOrdersOrdersParameterInner\n */\n type?: PlaceMultipleOrdersOrdersParameterInnerTypeEnum;\n /**\n *\n * @type {string}\n * @memberof PlaceMultipleOrdersOrdersParameterInner\n */\n quantity?: string;\n /**\n *\n * @type {string}\n * @memberof PlaceMultipleOrdersOrdersParameterInner\n */\n price?: string;\n /**\n *\n * @type {string}\n * @memberof PlaceMultipleOrdersOrdersParameterInner\n */\n timeInForce?: PlaceMultipleOrdersOrdersParameterInnerTimeInForceEnum;\n /**\n *\n * @type {string}\n * @memberof PlaceMultipleOrdersOrdersParameterInner\n */\n reduceOnly?: string;\n /**\n *\n * @type {string}\n * @memberof PlaceMultipleOrdersOrdersParameterInner\n */\n postOnly?: string;\n /**\n *\n * @type {string}\n * @memberof PlaceMultipleOrdersOrdersParameterInner\n */\n newOrderRespType?: PlaceMultipleOrdersOrdersParameterInnerNewOrderRespTypeEnum;\n /**\n *\n * @type {string}\n * @memberof PlaceMultipleOrdersOrdersParameterInner\n */\n clientOrderId?: string;\n /**\n *\n * @type {string}\n * @memberof PlaceMultipleOrdersOrdersParameterInner\n */\n isMmp?: string;\n /**\n *\n * @type {string}\n * @memberof PlaceMultipleOrdersOrdersParameterInner\n */\n selfTradePreventionMode?: PlaceMultipleOrdersOrdersParameterInnerSelfTradePreventionModeEnum;\n}\n\nexport const PlaceMultipleOrdersOrdersParameterInnerSideEnum = {\n BUY: 'BUY',\n SELL: 'SELL',\n} as const;\n\nexport type PlaceMultipleOrdersOrdersParameterInnerSideEnum =\n (typeof PlaceMultipleOrdersOrdersParameterInnerSideEnum)[keyof typeof PlaceMultipleOrdersOrdersParameterInnerSideEnum];\nexport const PlaceMultipleOrdersOrdersParameterInnerTypeEnum = {\n LIMIT: 'LIMIT',\n} as const;\n\nexport type PlaceMultipleOrdersOrdersParameterInnerTypeEnum =\n (typeof PlaceMultipleOrdersOrdersParameterInnerTypeEnum)[keyof typeof PlaceMultipleOrdersOrdersParameterInnerTypeEnum];\nexport const PlaceMultipleOrdersOrdersParameterInnerTimeInForceEnum = {\n GTC: 'GTC',\n IOC: 'IOC',\n FOK: 'FOK',\n GTX: 'GTX',\n} as const;\n\nexport type PlaceMultipleOrdersOrdersParameterInnerTimeInForceEnum =\n (typeof PlaceMultipleOrdersOrdersParameterInnerTimeInForceEnum)[keyof typeof PlaceMultipleOrdersOrdersParameterInnerTimeInForceEnum];\nexport const PlaceMultipleOrdersOrdersParameterInnerNewOrderRespTypeEnum = {\n ACK: 'ACK',\n RESULT: 'RESULT',\n} as const;\n\nexport type PlaceMultipleOrdersOrdersParameterInnerNewOrderRespTypeEnum =\n (typeof PlaceMultipleOrdersOrdersParameterInnerNewOrderRespTypeEnum)[keyof typeof PlaceMultipleOrdersOrdersParameterInnerNewOrderRespTypeEnum];\nexport const PlaceMultipleOrdersOrdersParameterInnerSelfTradePreventionModeEnum = {\n EXPIRE_TAKER: 'EXPIRE_TAKER',\n EXPIRE_BOTH: 'EXPIRE_BOTH',\n EXPIRE_MAKER: 'EXPIRE_MAKER',\n} as const;\n\nexport type PlaceMultipleOrdersOrdersParameterInnerSelfTradePreventionModeEnum =\n (typeof PlaceMultipleOrdersOrdersParameterInnerSelfTradePreventionModeEnum)[keyof typeof PlaceMultipleOrdersOrdersParameterInnerSelfTradePreventionModeEnum];\n","/**\n * Binance Derivatives Trading Options REST API\n *\n * OpenAPI Specification for the Binance Derivatives Trading Options REST API\n *\n * The version of the OpenAPI document: 1.0.0\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\n\nimport {\n ConfigurationRestAPI,\n TimeUnit,\n RestApiResponse,\n assertParamExists,\n sendRequest,\n type RequestArgs,\n} from '@binance/common';\nimport type { AccountFundingFlowResponse, OptionMarginAccountInformationResponse } from '../types';\n\n/**\n * AccountApi - axios parameter creator\n */\nconst AccountApiAxiosParamCreator = function (configuration: ConfigurationRestAPI) {\n return {\n /**\n * Query account funding flows.\n *\n *\n * Only support querying data in the past 3 months\n *\n * Weight: 1\n *\n * @summary Account Funding Flow (USER_DATA)\n * @param {string} currency Asset type, only support USDT as of now\n * @param {number | bigint} [recordId] Return the recordId and subsequent data, the latest data is returned by default, e.g 100000\n * @param {number | bigint} [startTime] Start Time, e.g 1593511200000\n * @param {number | bigint} [endTime] End Time, e.g 1593512200000\n * @param {number | bigint} [limit] Number of result sets returned Default:100 Max:1000\n * @param {number | bigint} [recvWindow]\n *\n * @throws {RequiredError}\n */\n accountFundingFlow: async (\n currency: string,\n recordId?: number | bigint,\n startTime?: number | bigint,\n endTime?: number | bigint,\n limit?: number | bigint,\n recvWindow?: number | bigint\n ): Promise<RequestArgs> => {\n // verify required parameter 'currency' is not null or undefined\n assertParamExists('accountFundingFlow', 'currency', currency);\n\n const localVarQueryParameter: Record<string, unknown> = {};\n const localVarBodyParameter: Record<string, unknown> = {};\n\n if (currency !== undefined && currency !== null) {\n localVarQueryParameter['currency'] = currency;\n }\n if (recordId !== undefined && recordId !== null) {\n localVarQueryParameter['recordId'] = recordId;\n }\n if (startTime !== undefined && startTime !== null) {\n localVarQueryParameter['startTime'] = startTime;\n }\n if (endTime !== undefined && endTime !== null) {\n localVarQueryParameter['endTime'] = endTime;\n }\n if (limit !== undefined && limit !== null) {\n localVarQueryParameter['limit'] = limit;\n }\n if (recvWindow !== undefined && recvWindow !== null) {\n localVarQueryParameter['recvWindow'] = recvWindow;\n }\n\n let _timeUnit: TimeUnit | undefined;\n if ('timeUnit' in configuration) _timeUnit = configuration.timeUnit as TimeUnit;\n\n return {\n endpoint: '/eapi/v1/bill',\n method: 'GET',\n queryParams: localVarQueryParameter,\n bodyParams: localVarBodyParameter,\n timeUnit: _timeUnit,\n };\n },\n /**\n * Get current account information.\n *\n * Weight: 3\n *\n * @summary Option Margin Account Information (USER_DATA)\n * @param {number | bigint} [recvWindow]\n *\n * @throws {RequiredError}\n */\n optionMarginAccountInformation: async (\n recvWindow?: number | bigint\n ): Promise<RequestArgs> => {\n const localVarQueryParameter: Record<string, unknown> = {};\n const localVarBodyParameter: Record<string, unknown> = {};\n\n if (recvWindow !== undefined && recvWindow !== null) {\n localVarQueryParameter['recvWindow'] = recvWindow;\n }\n\n let _timeUnit: TimeUnit | undefined;\n if ('timeUnit' in configuration) _timeUnit = configuration.timeUnit as TimeUnit;\n\n return {\n endpoint: '/eapi/v1/marginAccount',\n method: 'GET',\n queryParams: localVarQueryParameter,\n bodyParams: localVarBodyParameter,\n timeUnit: _timeUnit,\n };\n },\n };\n};\n\n/**\n * AccountApi - interface\n * @interface AccountApi\n */\nexport interface AccountApiInterface {\n /**\n * Query account funding flows.\n *\n *\n * Only support querying data in the past 3 months\n *\n * Weight: 1\n *\n * @summary Account Funding Flow (USER_DATA)\n * @param {AccountFundingFlowRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof AccountApiInterface\n */\n accountFundingFlow(\n requestParameters: AccountFundingFlowRequest\n ): Promise<RestApiResponse<AccountFundingFlowResponse>>;\n /**\n * Get current account information.\n *\n * Weight: 3\n *\n * @summary Option Margin Account Information (USER_DATA)\n * @param {OptionMarginAccountInformationRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof AccountApiInterface\n */\n optionMarginAccountInformation(\n requestParameters?: OptionMarginAccountInformationRequest\n ): Promise<RestApiResponse<OptionMarginAccountInformationResponse>>;\n}\n\n/**\n * Request parameters for accountFundingFlow operation in AccountApi.\n * @interface AccountFundingFlowRequest\n */\nexport interface AccountFundingFlowRequest {\n /**\n * Asset type, only support USDT as of now\n * @type {string}\n * @memberof AccountApiAccountFundingFlow\n */\n readonly currency: string;\n\n /**\n * Return the recordId and subsequent data, the latest data is returned by default, e.g 100000\n * @type {number | bigint}\n * @memberof AccountApiAccountFundingFlow\n */\n readonly recordId?: number | bigint;\n\n /**\n * Start Time, e.g 1593511200000\n * @type {number | bigint}\n * @memberof AccountApiAccountFundingFlow\n */\n readonly startTime?: number | bigint;\n\n /**\n * End Time, e.g 1593512200000\n * @type {number | bigint}\n * @memberof AccountApiAccountFundingFlow\n */\n readonly endTime?: number | bigint;\n\n /**\n * Number of result sets returned Default:100 Max:1000\n * @type {number | bigint}\n * @memberof AccountApiAccountFundingFlow\n */\n readonly limit?: number | bigint;\n\n /**\n *\n * @type {number | bigint}\n * @memberof AccountApiAccountFundingFlow\n */\n readonly recvWindow?: number | bigint;\n}\n\n/**\n * Request parameters for optionMarginAccountInformation operation in AccountApi.\n * @interface OptionMarginAccountInformationRequest\n */\nexport interface OptionMarginAccountInformationRequest {\n /**\n *\n * @type {number | bigint}\n * @memberof AccountApiOptionMarginAccountInformation\n */\n readonly recvWindow?: number | bigint;\n}\n\n/**\n * AccountApi - object-oriented interface\n * @class AccountApi\n */\nexport class AccountApi implements AccountApiInterface {\n private readonly configuration: ConfigurationRestAPI;\n private localVarAxiosParamCreator;\n\n constructor(configuration: ConfigurationRestAPI) {\n this.configuration = configuration;\n this.localVarAxiosParamCreator = AccountApiAxiosParamCreator(configuration);\n }\n\n /**\n * Query account funding flows.\n *\n *\n * Only support querying data in the past 3 months\n *\n * Weight: 1\n *\n * @summary Account Funding Flow (USER_DATA)\n * @param {AccountFundingFlowRequest} requestParameters Request parameters.\n * @returns {Promise<RestApiResponse<AccountFundingFlowResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof AccountApi\n * @see {@link https://developers.binance.com/docs/derivatives/options-trading/account/Account-Funding-Flow Binance API Documentation}\n */\n public async accountFundingFlow(\n requestParameters: AccountFundingFlowRequest\n ): Promise<RestApiResponse<AccountFundingFlowResponse>> {\n const localVarAxiosArgs = await this.localVarAxiosParamCreator.accountFundingFlow(\n requestParameters?.currency,\n requestParameters?.recordId,\n requestParameters?.startTime,\n requestParameters?.endTime,\n requestParameters?.limit,\n requestParameters?.recvWindow\n );\n return sendRequest<AccountFundingFlowResponse>(\n this.configuration,\n localVarAxiosArgs.endpoint,\n localVarAxiosArgs.method,\n localVarAxiosArgs.queryParams,\n localVarAxiosArgs.bodyParams,\n localVarAxiosArgs?.timeUnit,\n { isSigned: true }\n );\n }\n\n /**\n * Get current account information.\n *\n * Weight: 3\n *\n * @summary Option Margin Account Information (USER_DATA)\n * @param {OptionMarginAccountInformationRequest} requestParameters Request parameters.\n * @returns {Promise<RestApiResponse<OptionMarginAccountInformationResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof AccountApi\n * @see {@link https://developers.binance.com/docs/derivatives/options-trading/account/Option-Margin-Account-Information Binance API Documentation}\n */\n public async optionMarginAccountInformation(\n requestParameters: OptionMarginAccountInformationRequest = {}\n ): Promise<RestApiResponse<OptionMarginAccountInformationResponse>> {\n const localVarAxiosArgs =\n await this.localVarAxiosParamCreator.optionMarginAccountInformation(\n requestParameters?.recvWindow\n );\n return sendRequest<OptionMarginAccountInformationResponse>(\n this.configuration,\n localVarAxiosArgs.endpoint,\n localVarAxiosArgs.method,\n localVarAxiosArgs.queryParams,\n localVarAxiosArgs.bodyParams,\n localVarAxiosArgs?.timeUnit,\n { isSigned: true }\n );\n }\n}\n","/**\n * Binance Derivatives Trading Options REST API\n *\n * OpenAPI Specification for the Binance Derivatives Trading Options REST API\n *\n * The version of the OpenAPI document: 1.0.0\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\n\nimport {\n ConfigurationRestAPI,\n TimeUnit,\n RestApiResponse,\n assertParamExists,\n sendRequest,\n type RequestArgs,\n} from '@binance/common';\nimport type {\n CheckServerTimeResponse,\n ExchangeInformationResponse,\n HistoricalExerciseRecordsResponse,\n IndexPriceResponse,\n KlineCandlestickDataResponse,\n OpenInterestResponse,\n OptionMarkPriceResponse,\n OrderBookResponse,\n RecentBlockTradesListResponse,\n RecentTradesListResponse,\n Ticker24hrPriceChangeStatisticsResponse,\n} from '../types';\n\n/**\n * MarketDataApi - axios parameter creator\n */\nconst MarketDataApiAxiosParamCreator = function (configuration: ConfigurationRestAPI) {\n return {\n /**\n * Test connectivity to the Rest API and get the current server time.\n *\n * Weight: 1\n *\n * @summary Check Server Time\n *\n * @throws {RequiredError}\n */\n checkServerTime: async (): Promise<RequestArgs> => {\n const localVarQueryParameter: Record<string, unknown> = {};\n const localVarBodyParameter: Record<string, unknown> = {};\n\n let _timeUnit: TimeUnit | undefined;\n if ('timeUnit' in configuration) _timeUnit = configuration.timeUnit as TimeUnit;\n\n return {\n endpoint: '/eapi/v1/time',\n method: 'GET',\n queryParams: localVarQueryParameter,\n bodyParams: localVarBodyParameter,\n timeUnit: _timeUnit,\n };\n },\n /**\n * Current exchange trading rules and symbol information\n *\n * Weight: 1\n *\n * @summary Exchange Information\n *\n * @throws {RequiredError}\n */\n exchangeInformation: async (): Promise<RequestArgs> => {\n const localVarQueryParameter: Record<string, unknown> = {};\n const localVarBodyParameter: Record<string, unknown> = {};\n\n let _timeUnit: TimeUnit | undefined;\n if ('timeUnit' in configuration) _timeUnit = configuration.timeUnit as TimeUnit;\n\n return {\n endpoint: '/eapi/v1/exchangeInfo',\n method: 'GET',\n queryParams: localVarQueryParameter,\n bodyParams: localVarBodyParameter,\n timeUnit: _timeUnit,\n };\n },\n /**\n * Get historical exercise records.\n * REALISTIC_VALUE_STRICKEN -> Exercised\n * EXTRINSIC_VALUE_EXPIRED -> Expired OTM\n *\n * Weight: 3\n *\n * @summary Historical Exercise Records\n * @param {string} [underlying] underlying, e.g BTCUSDT\n * @param {number | bigint} [startTime] Start Time, e.g 1593511200000\n * @param {number | bigint} [endTime] End Time, e.g 1593512200000\n * @param {number | bigint} [limit] Number of result sets returned Default:100 Max:1000\n *\n * @throws {RequiredError}\n */\n historicalExerciseRecords: async (\n underlying?: string,\n startTime?: number | bigint,\n endTime?: number | bigint,\n limit?: number | bigint\n ): Promise<RequestArgs> => {\n const localVarQueryParameter: Record<string, unknown> = {};\n const localVarBodyParameter: Record<string, unknown> = {};\n\n if (underlying !== undefined && underlying !== null) {\n localVarQueryParameter['underlying'] = underlying;\n }\n if (startTime !== undefined && startTime !== null) {\n localVarQueryParameter['startTime'] = startTime;\n }\n if (endTime !== undefined && endTime !== null) {\n localVarQueryParameter['endTime'] = endTime;\n }\n if (limit !== undefined && limit !== null) {\n localVarQueryParameter['limit'] = limit;\n }\n\n let _timeUnit: TimeUnit | undefined;\n if ('timeUnit' in configuration) _timeUnit = configuration.timeUnit as TimeUnit;\n\n return {\n endpoint: '/eapi/v1/exerciseHistory',\n method: 'GET',\n queryParams: localVarQueryParameter,\n bodyParams: localVarBodyParameter,\n timeUnit: _timeUnit,\n };\n },\n /**\n * Get spot index price for option underlying.\n *\n * Weight: 1\n *\n * @summary Index Price\n * @param {string} underlying Option underlying, e.g BTCUSDT\n *\n * @throws {RequiredError}\n */\n indexPrice: async (underlying: string): Promise<RequestArgs> => {\n // verify required parameter 'underlying' is not null or undefined\n assertParamExists('indexPrice', 'underlying', underlying);\n\n const localVarQueryParameter: Record<string, unknown> = {};\n const localVarBodyParameter: Record<string, unknown> = {};\n\n if (underlying !== undefined && underlying !== null) {\n localVarQueryParameter['underlying'] = underlying;\n }\n\n let _timeUnit: TimeUnit | undefined;\n if ('timeUnit' in configuration) _timeUnit = configuration.timeUnit as TimeUnit;\n\n return {\n endpoint: '/eapi/v1/index',\n method: 'GET',\n queryParams: localVarQueryParameter,\n bodyParams: localVarBodyParameter,\n timeUnit: _timeUnit,\n };\n },\n /**\n * Kline/candlestick bars for an option symbol.\n * Klines are uniquely identified by their open time.\n *\n * If startTime and endTime are not sent, the most recent klines are returned.\n *\n * Weight: 1\n *\n * @summary Kline/Candlestick Data\n * @param {string} symbol Option trading pair, e.g BTC-200730-9000-C\n * @param {string} interval Time interval\n * @param {number | bigint} [startTime] Start Time, e.g 1593511200000\n * @param {number | bigint} [endTime] End Time, e.g 1593512200000\n * @param {number | bigint} [limit] Number of result sets returned Default:100 Max:1000\n *\n * @throws {RequiredError}\n */\n klineCandlestickData: async (\n symbol: string,\n interval: string,\n startTime?: number | bigint,\n endTime?: number | bigint,\n limit?: number | bigint\n ): Promise<RequestArgs> => {\n // verify required parameter 'symbol' is not null or undefined\n assertParamExists('klineCandlestickData', 'symbol', symbol);\n // verify required parameter 'interval' is not null or undefined\n assertParamExists('klineCandlestickData', 'interval', interval);\n\n const localVarQueryParameter: Record<string, unknown> = {};\n const localVarBodyParameter: Record<string, unknown> = {};\n\n if (symbol !== undefined && symbol !== null) {\n localVarQueryParameter['symbol'] = symbol;\n }\n if (interval !== undefined && interval !== null) {\n localVarQueryParameter['interval'] = interval;\n }\n if (startTime !== undefined && startTime !== null) {\n localVarQueryParameter['startTime'] = startTime;\n }\n if (endTime !== undefined && endTime !== null) {\n localVarQueryParameter['endTime'] = endTime;\n }\n if (limit !== undefined && limit !== null) {\n localVarQueryParameter['limit'] = limit;\n }\n\n let _timeUnit: TimeUnit | undefined;\n if ('timeUnit' in configuration) _timeUnit = configuration.timeUnit as TimeUnit;\n\n return {\n endpoint: '/eapi/v1/klines',\n method: 'GET',\n queryParams: localVarQueryParameter,\n bodyParams: localVarBodyParameter,\n timeUnit: _timeUnit,\n };\n },\n /**\n * Get open interest for specific underlying asset on specific expiration date.\n *\n * Weight: 0\n *\n * @summary Open Interest\n * @param {string} underlyingAsset underlying asset, e.g ETH/BTC\n * @param {string} expiration expiration date, e.g 221225\n *\n * @throws {RequiredError}\n */\n openInterest: async (underlyingAsset: string, expiration: string): Promise<RequestArgs> => {\n // verify required parameter 'underlyingAsset' is not null or undefined\n assertParamExists('openInterest', 'underlyingAsset', underlyingAsset);\n // verify required parameter 'expiration' is not null or undefined\n assertParamExists('openInterest', 'expiration', expiration);\n\n const localVarQueryParameter: Record<string, unknown> = {};\n const localVarBodyParameter: Record<string, unknown> = {};\n\n if (underlyingAsset !== undefined && underlyingAsset !== null) {\n localVarQueryParameter['underlyingAsset'] = underlyingAsset;\n }\n if (expiration !== undefined && expiration !== null) {\n localVarQueryParameter['expiration'] = expiration;\n }\n\n let _timeUnit: TimeUnit | undefined;\n if ('timeUnit' in configuration) _timeUnit = configuration.timeUnit as TimeUnit;\n\n return {\n endpoint: '/eapi/v1/openInterest',\n method: 'GET',\n queryParams: localVarQueryParameter,\n bodyParams: localVarBodyParameter,\n timeUnit: _timeUnit,\n };\n },\n /**\n * Option mark price and greek info.\n *\n * Weight: 5\n *\n * @summary Option Mark Price\n * @param {string} [symbol] Option trading pair, e.g BTC-200730-9000-C\n *\n * @throws {RequiredError}\n */\n optionMarkPrice: async (symbol?: string): Promise<RequestArgs> => {\n const localVarQueryParameter: Record<string, unknown> = {};\n const localVarBodyParameter: Record<string, unknown> = {};\n\n if (symbol !== undefined && symbol !== null) {\n localVarQueryParameter['symbol'] = symbol;\n }\n\n let _timeUnit: TimeUnit | undefined;\n if ('timeUnit' in configuration) _timeUnit = configuration.timeUnit as TimeUnit;\n\n return {\n endpoint: '/eapi/v1/mark',\n method: 'GET',\n queryParams: localVarQueryParameter,\n bodyParams: localVarBodyParameter,\n timeUnit: _timeUnit,\n };\n },\n /**\n * Check orderbook depth on specific symbol\n *\n * Weight: limit | weight\n * ------------ | ------------\n * 5, 10, 20, 50 | 1\n * 100 | 5\n * 500 | 10\n * 1000 | 20\n *\n * @summary Order Book\n * @param {string} symbol Option trading pair, e.g BTC-200730-9000-C\n * @param {number | bigint} [limit] Number of result sets returned Default:100 Max:1000\n *\n * @throws {RequiredError}\n */\n orderBook: async (symbol: string, limit?: number | bigint): Promise<RequestArgs> => {\n // verify required parameter 'symbol' is not null or undefined\n assertParamExists('orderBook', 'symbol', symbol);\n\n const localVarQueryParameter: Record<string, unknown> = {};\n const localVarBodyParameter: Record<string, unknown> = {};\n\n if (symbol !== undefined && symbol !== null) {\n localVarQueryParameter['symbol'] = symbol;\n }\n if (limit !== undefined && limit !== null) {\n localVarQueryParameter['limit'] = limit;\n }\n\n let _timeUnit: TimeUnit | undefined;\n if ('timeUnit' in configuration) _timeUnit = configuration.timeUnit as TimeUnit;\n\n return {\n endpoint: '/eapi/v1/depth',\n method: 'GET',\n queryParams: localVarQueryParameter,\n bodyParams: localVarBodyParameter,\n timeUnit: _timeUnit,\n };\n },\n /**\n * Get recent block trades\n *\n * Weight: 5\n *\n * @summary Recent Block Trades List\n * @param {string} [symbol] Option trading pair, e.g BTC-200730-9000-C\n * @param {number | bigint} [limit] Number of result sets returned Default:100 Max:1000\n *\n * @throws {RequiredError}\n */\n recentBlockTradesList: async (\n symbol?: string,\n limit?: number | bigint\n ): Promise<RequestArgs> => {\n const localVarQueryParameter: Record<string, unknown> = {};\n const localVarBodyParameter: Record<string, unknown> = {};\n\n if (symbol !== undefined && symbol !== null) {\n localVarQueryParameter['symbol'] = symbol;\n }\n if (limit !== undefined && limit !== null) {\n localVarQueryParameter['limit'] = limit;\n }\n\n let _timeUnit: TimeUnit | undefined;\n if ('timeUnit' in configuration) _timeUnit = configuration.timeUnit as TimeUnit;\n\n return {\n endpoint: '/eapi/v1/blockTrades',\n method: 'GET',\n queryParams: localVarQueryParameter,\n bodyParams: localVarBodyParameter,\n timeUnit: _timeUnit,\n };\n },\n /**\n * Get recent market trades\n *\n * Weight: 5\n *\n * @summary Recent Trades List\n * @param {string} symbol Option trading pair, e.g BTC-200730-9000-C\n * @param {number | bigint} [limit] Number of result sets returned Default:100 Max:1000\n *\n * @throws {RequiredError}\n */\n recentTradesList: async (symbol: string, limit?: number | bigint): Promise<RequestArgs> => {\n // verify required parameter 'symbol' is not null or undefined\n assertParamExists('recentTradesList', 'symbol', symbol);\n\n const localVarQueryParameter: Record<string, unknown> = {};\n const localVarBodyParameter: Record<string, unknown> = {};\n\n if (symbol !== undefined && symbol !== null) {\n localVarQueryParameter['symbol'] = symbol;\n }\n if (limit !== undefined && limit !== null) {\n localVarQueryParameter['limit'] = limit;\n }\n\n let _timeUnit: TimeUnit | undefined;\n if ('timeUnit' in configuration) _timeUnit = configuration.timeUnit as TimeUnit;\n\n return {\n endpoint: '/eapi/v1/trades',\n method: 'GET',\n queryParams: localVarQueryParameter,\n bodyParams: localVarBodyParameter,\n timeUnit: _timeUnit,\n };\n },\n /**\n * Test connectivity to the Rest API.\n *\n * Weight: 1\n *\n * @summary Test Connectivity\n *\n * @throws {RequiredError}\n */\n testConnectivity: async (): Promise<RequestArgs> => {\n const localVarQueryParameter: Record<string, unknown> = {};\n const localVarBodyParameter: Record<string, unknown> = {};\n\n let _timeUnit: TimeUnit | undefined;\n if ('timeUnit' in configuration) _timeUnit = configuration.timeUnit as TimeUnit;\n\n return {\n endpoint: '/eapi/v1/ping',\n method: 'GET',\n queryParams: localVarQueryParameter,\n bodyParams: localVarBodyParameter,\n timeUnit: _timeUnit,\n };\n },\n /**\n * 24 hour rolling window price change statistics.\n *\n * Weight: 5\n *\n * @summary 24hr Ticker Price Change Statistics\n * @param {string} [symbol] Option trading pair, e.g BTC-200730-9000-C\n *\n * @throws {RequiredError}\n */\n ticker24hrPriceChangeStatistics: async (symbol?: string): Promise<RequestArgs> => {\n const localVarQueryParameter: Record<string, unknown> = {};\n const localVarBodyParameter: Record<string, unknown> = {};\n\n if (symbol !== undefined && symbol !== null) {\n localVarQueryParameter['symbol'] = symbol;\n }\n\n let _timeUnit: TimeUnit | undefined;\n if ('timeUnit' in configuration) _timeUnit = configuration.timeUnit as TimeUnit;\n\n return {\n endpoint: '/eapi/v1/ticker',\n method: 'GET',\n queryParams: localVarQueryParameter,\n bodyParams: localVarBodyParameter,\n timeUnit: _timeUnit,\n };\n },\n };\n};\n\n/**\n * MarketDataApi - interface\n * @interface MarketDataApi\n */\nexport interface MarketDataApiInterface {\n /**\n * Test connectivity to the Rest API and get the current server time.\n *\n * Weight: 1\n *\n * @summary Check Server Time\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof MarketDataApiInterface\n */\n checkServerTime(): Promise<RestApiResponse<CheckServerTimeResponse>>;\n /**\n * Current exchange trading rules and symbol information\n *\n * Weight: 1\n *\n * @summary Exchange Information\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof MarketDataApiInterface\n */\n exchangeInformation(): Promise<RestApiResponse<ExchangeInformationResponse>>;\n /**\n * Get historical exercise records.\n * REALISTIC_VALUE_STRICKEN -> Exercised\n * EXTRINSIC_VALUE_EXPIRED -> Expired OTM\n *\n * Weight: 3\n *\n * @summary Historical Exercise Records\n * @param {HistoricalExerciseRecordsRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof MarketDataApiInterface\n */\n historicalExerciseRecords(\n requestParameters?: HistoricalExerciseRecordsRequest\n ): Promise<RestApiResponse<HistoricalExerciseRecordsResponse>>;\n /**\n * Get spot index price for option underlying.\n *\n * Weight: 1\n *\n * @summary Index Price\n * @param {IndexPriceRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof MarketDataApiInterface\n */\n indexPrice(requestParameters: IndexPriceRequest): Promise<RestApiResponse<IndexPriceResponse>>;\n /**\n * Kline/candlestick bars for an option symbol.\n * Klines are uniquely identified by their open time.\n *\n * If startTime and endTime are not sent, the most recent klines are returned.\n *\n * Weight: 1\n *\n * @summary Kline/Candlestick Data\n * @param {KlineCandlestickDataRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof MarketDataApiInterface\n */\n klineCandlestickData(\n requestParameters: KlineCandlestickDataRequest\n ): Promise<RestApiResponse<KlineCandlestickDataResponse>>;\n /**\n * Get open interest for specific underlying asset on specific expiration date.\n *\n * Weight: 0\n *\n * @summary Open Interest\n * @param {OpenInterestRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof MarketDataApiInterface\n */\n openInterest(\n requestParameters: OpenInterestRequest\n ): Promise<RestApiResponse<OpenInterestResponse>>;\n /**\n * Option mark price and greek info.\n *\n * Weight: 5\n *\n * @summary Option Mark Price\n * @param {OptionMarkPriceRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof MarketDataApiInterface\n */\n optionMarkPrice(\n requestParameters?: OptionMarkPriceRequest\n ): Promise<RestApiResponse<OptionMarkPriceResponse>>;\n /**\n * Check orderbook depth on specific symbol\n *\n * Weight: limit | weight\n * ------------ | ------------\n * 5, 10, 20, 50 | 1\n * 100 | 5\n * 500 | 10\n * 1000 | 20\n *\n * @summary Order Book\n * @param {OrderBookRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof MarketDataApiInterface\n */\n orderBook(requestParameters: OrderBookRequest): Promise<RestApiResponse<OrderBookResponse>>;\n /**\n * Get recent block trades\n *\n * Weight: 5\n *\n * @summary Recent Block Trades List\n * @param {RecentBlockTradesListRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof MarketDataApiInterface\n */\n recentBlockTradesList(\n requestParameters?: RecentBlockTradesListRequest\n ): Promise<RestApiResponse<RecentBlockTradesListResponse>>;\n /**\n * Get recent market trades\n *\n * Weight: 5\n *\n * @summary Recent Trades List\n * @param {RecentTradesListRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof MarketDataApiInterface\n */\n recentTradesList(\n requestParameters: RecentTradesListRequest\n ): Promise<RestApiResponse<RecentTradesListResponse>>;\n /**\n * Test connectivity to the Rest API.\n *\n * Weight: 1\n *\n * @summary Test Connectivity\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof MarketDataApiInterface\n */\n testConnectivity(): Promise<RestApiResponse<void>>;\n /**\n * 24 hour rolling window price change statistics.\n *\n * Weight: 5\n *\n * @summary 24hr Ticker Price Change Statistics\n * @param {Ticker24hrPriceChangeStatisticsRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof MarketDataApiInterface\n */\n ticker24hrPriceChangeStatistics(\n requestParameters?: Ticker24hrPriceChangeStatisticsRequest\n ): Promise<RestApiResponse<Ticker24hrPriceChangeStatisticsResponse>>;\n}\n\n/**\n * Request parameters for historicalExerciseRecords operation in MarketDataApi.\n * @interface HistoricalExerciseRecordsRequest\n */\nexport interface HistoricalExerciseRecordsRequest {\n /**\n * underlying, e.g BTCUSDT\n * @type {string}\n * @memberof MarketDataApiHistoricalExerciseRecords\n */\n readonly underlying?: string;\n\n /**\n * Start Time, e.g 1593511200000\n * @type {number | bigint}\n * @memberof MarketDataApiHistoricalExerciseRecords\n */\n readonly startTime?: number | bigint;\n\n /**\n * End Time, e.g 1593512200000\n * @type {number | bigint}\n * @memberof MarketDataApiHistoricalExerciseRecords\n */\n readonly endTime?: number | bigint;\n\n /**\n * Number of result sets returned Default:100 Max:1000\n * @type {number | bigint}\n * @memberof MarketDataApiHistoricalExerciseRecords\n */\n readonly limit?: number | bigint;\n}\n\n/**\n * Request parameters for indexPrice operation in MarketDataApi.\n * @interface IndexPriceRequest\n */\nexport interface IndexPriceRequest {\n /**\n * Option underlying, e.g BTCUSDT\n * @type {string}\n * @memberof MarketDataApiIndexPrice\n */\n readonly underlying: string;\n}\n\n/**\n * Request parameters for klineCandlestickData operation in MarketDataApi.\n * @interface KlineCandlestickDataRequest\n */\nexport interface KlineCandlestickDataRequest {\n /**\n * Option trading pair, e.g BTC-200730-9000-C\n * @type {string}\n * @memberof MarketDataApiKlineCandlestickData\n */\n readonly symbol: string;\n\n /**\n * Time interval\n * @type {string}\n * @memberof MarketDataApiKlineCandlestickData\n */\n readonly interval: string;\n\n /**\n * Start Time, e.g 1593511200000\n * @type {number | bigint}\n * @memberof MarketDataApiKlineCandlestickData\n */\n readonly startTime?: number | bigint;\n\n /**\n * End Time, e.g 1593512200000\n * @type {number | bigint}\n * @memberof MarketDataApiKlineCandlestickData\n */\n readonly endTime?: number | bigint;\n\n /**\n * Number of result sets returned Default:100 Max:1000\n * @type {number | bigint}\n * @memberof MarketDataApiKlineCandlestickData\n */\n readonly limit?: number | bigint;\n}\n\n/**\n * Request parameters for openInterest operation in MarketDataApi.\n * @interface OpenInterestRequest\n */\nexport interface OpenInterestRequest {\n /**\n * underlying asset, e.g ETH/BTC\n * @type {string}\n * @memberof MarketDataApiOpenInterest\n */\n readonly underlyingAsset: string;\n\n /**\n * expiration date, e.g 221225\n * @type {string}\n * @memberof MarketDataApiOpenInterest\n */\n readonly expiration: string;\n}\n\n/**\n * Request parameters for optionMarkPrice operation in MarketDataApi.\n * @interface OptionMarkPriceRequest\n */\nexport interface OptionMarkPriceRequest {\n /**\n * Option trading pair, e.g BTC-200730-9000-C\n * @type {string}\n * @memberof MarketDataApiOptionMarkPrice\n */\n readonly symbol?: string;\n}\n\n/**\n * Request parameters for orderBook operation in MarketDataApi.\n * @interface OrderBookRequest\n */\nexport interface OrderBookRequest {\n /**\n * Option trading pair, e.g BTC-200730-9000-C\n * @type {string}\n * @memberof MarketDataApiOrderBook\n */\n readonly symbol: string;\n\n /**\n * Number of result sets returned Default:100 Max:1000\n * @type {number | bigint}\n * @memberof MarketDataApiOrderBook\n */\n readonly limit?: number | bigint;\n}\n\n/**\n * Request parameters for recentBlockTradesList operation in MarketDataApi.\n * @interface RecentBlockTradesListRequest\n */\nexport interface RecentBlockTradesListRequest {\n /**\n * Option trading pair, e.g BTC-200730-9000-C\n * @type {string}\n * @memberof MarketDataApiRecentBlockTradesList\n */\n readonly symbol?: string;\n\n /**\n * Number of result sets returned Default:100 Max:1000\n * @type {number | bigint}\n * @memberof MarketDataApiRecentBlockTradesList\n */\n readonly limit?: number | bigint;\n}\n\n/**\n * Request parameters for recentTradesList operation in MarketDataApi.\n * @interface RecentTradesListRequest\n */\nexport interface RecentTradesListRequest {\n /**\n * Option trading pair, e.g BTC-200730-9000-C\n * @type {string}\n * @memberof MarketDataApiRecentTradesList\n */\n readonly symbol: string;\n\n /**\n * Number of result sets returned Default:100 Max:1000\n * @type {number | bigint}\n * @memberof MarketDataApiRecentTradesList\n */\n readonly limit?: number | bigint;\n}\n\n/**\n * Request parameters for ticker24hrPriceChangeStatistics operation in MarketDataApi.\n * @interface Ticker24hrPriceChangeStatisticsRequest\n */\nexport interface Ticker24hrPriceChangeStatisticsRequest {\n /**\n * Option trading pair, e.g BTC-200730-9000-C\n * @type {string}\n * @memberof MarketDataApiTicker24hrPriceChangeStatistics\n */\n readonly symbol?: string;\n}\n\n/**\n * MarketDataApi - object-oriented interface\n * @class MarketDataApi\n */\nexport class MarketDataApi implements MarketDataApiInterface {\n private readonly configuration: ConfigurationRestAPI;\n private localVarAxiosParamCreator;\n\n constructor(configuration: ConfigurationRestAPI) {\n this.configuration = configuration;\n this.localVarAxiosParamCreator = MarketDataApiAxiosParamCreator(configuration);\n }\n\n /**\n * Test connectivity to the Rest API and get the current server time.\n *\n * Weight: 1\n *\n * @summary Check Server Time\n * @returns {Promise<RestApiResponse<CheckServerTimeR