UNPKG

@binance/spot

Version:

Official Binance Spot Connector - A lightweight library that provides a convenient interface to Binance's Spot REST API, WebSocket API and WebSocket Streams.

1 lines 928 kB
{"version":3,"file":"index.mjs","names":["localVarQueryParameter: Record<string, unknown>","localVarBodyParameter: Record<string, unknown>","_timeUnit: TimeUnit | undefined","AccountApi","localVarQueryParameter: Record<string, unknown>","localVarBodyParameter: Record<string, unknown>","_timeUnit: TimeUnit | undefined","GeneralApi","ExchangeInfoSymbolStatusEnum","ExecutionRulesSymbolStatusEnum","localVarQueryParameter: Record<string, unknown>","localVarBodyParameter: Record<string, unknown>","_timeUnit: TimeUnit | undefined","MarketApi","DepthSymbolStatusEnum","KlinesIntervalEnum","ReferencePriceCalculationSymbolStatusEnum","TickerWindowSizeEnum","TickerTypeEnum","TickerSymbolStatusEnum","Ticker24hrTypeEnum","Ticker24hrSymbolStatusEnum","TickerPriceSymbolStatusEnum","TickerTradingDayTypeEnum","TickerTradingDaySymbolStatusEnum","UiKlinesIntervalEnum","localVarQueryParameter: Record<string, unknown>","localVarBodyParameter: Record<string, unknown>","_timeUnit: TimeUnit | undefined","TradeApi","OrderCancelReplaceSideEnum","OrderCancelReplaceTypeEnum","OrderCancelReplaceCancelReplaceModeEnum","OrderCancelReplaceTimeInForceEnum","OrderCancelReplaceNewOrderRespTypeEnum","OrderCancelReplaceSelfTradePreventionModeEnum","OrderCancelReplaceCancelRestrictionsEnum","OrderCancelReplaceOrderRateLimitExceededModeEnum","OrderCancelReplacePegPriceTypeEnum","OrderCancelReplacePegOffsetTypeEnum","OrderTestSideEnum","OrderTestTypeEnum","OrderTestTimeInForceEnum","OrderTestNewOrderRespTypeEnum","OrderTestSelfTradePreventionModeEnum","OrderTestPegPriceTypeEnum","OrderTestPegOffsetTypeEnum","SorOrderTestSideEnum","SorOrderTestTypeEnum","SorOrderTestTimeInForceEnum","SorOrderTestNewOrderRespTypeEnum","SorOrderTestSelfTradePreventionModeEnum","AccountApi","GeneralApi","MarketApi","TradeApi","SPOT_REST_API_PROD_URL","SPOT_WS_API_PROD_URL","SPOT_WS_STREAMS_PROD_URL"],"sources":["../package.json","../src/rest-api/modules/account-api.ts","../src/rest-api/modules/general-api.ts","../src/rest-api/modules/market-api.ts","../src/rest-api/modules/trade-api.ts","../src/rest-api/rest-api.ts","../src/rest-api/index.ts","../src/websocket-api/modules/account-api.ts","../src/websocket-api/modules/auth-api.ts","../src/websocket-api/modules/general-api.ts","../src/websocket-api/modules/market-api.ts","../src/websocket-api/modules/trade-api.ts","../src/websocket-api/modules/user-data-stream-api.ts","../src/websocket-api/websocket-api-connection.ts","../src/websocket-api/websocket-api.ts","../src/websocket-api/index.ts","../src/websocket-streams/modules/web-socket-streams-api.ts","../src/websocket-streams/websocket-streams-connection.ts","../src/websocket-streams/websocket-streams.ts","../src/websocket-streams/index.ts","../src/spot.ts"],"sourcesContent":["{\n \"name\": \"@binance/spot\",\n \"description\": \"Official Binance Spot Connector - A lightweight library that provides a convenient interface to Binance's Spot REST API, WebSocket API and WebSocket Streams.\",\n \"version\": \"31.0.1\",\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 \"Spot\",\n \"Connector\",\n \"REST\",\n \"WebSocket\",\n \"Trading\"\n ],\n \"author\": \"Binance\",\n \"license\": \"MIT\",\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"https://github.com/binance/binance-connector-js.git\"\n },\n \"bugs\": {\n \"url\": \"https://github.com/binance/binance-connector-js/issues\"\n },\n \"homepage\": \"https://github.com/binance/binance-connector-js#readme\",\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","/**\n * Binance Spot REST API\n *\n * OpenAPI Specifications for the Binance Spot REST API\n *\n * API documents:\n * - [Github rest-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md)\n * - [General API information for rest-api on website](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-api-information)\n *\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 AccountCommissionResponse,\n AllOrderListResponse,\n AllOrdersResponse,\n GetAccountResponse,\n GetOpenOrdersResponse,\n GetOrderListResponse,\n GetOrderResponse,\n MyAllocationsResponse,\n MyFiltersResponse,\n MyPreventedMatchesResponse,\n MyTradesResponse,\n OpenOrderListResponse,\n OrderAmendmentsResponse,\n RateLimitOrderResponse,\n} from '../types';\n\n/**\n * AccountApi - axios parameter creator\n */\nconst AccountApiAxiosParamCreator = function (configuration: ConfigurationRestAPI) {\n return {\n /**\n * Get current account commission rates.\n * Weight: 20\n *\n * @summary Query Commission Rates\n * @param {string} symbol\n *\n * @throws {RequiredError}\n */\n accountCommission: async (symbol: string): Promise<RequestArgs> => {\n // verify required parameter 'symbol' is not null or undefined\n assertParamExists('accountCommission', '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\n let _timeUnit: TimeUnit | undefined;\n if ('timeUnit' in configuration) _timeUnit = configuration.timeUnit as TimeUnit;\n\n return {\n endpoint: '/api/v3/account/commission',\n method: 'GET',\n queryParams: localVarQueryParameter,\n bodyParams: localVarBodyParameter,\n timeUnit: _timeUnit,\n };\n },\n /**\n * Retrieves all order lists based on provided optional parameters.\n *\n * Note that the time between `startTime` and `endTime` can't be longer than 24 hours.\n * Weight: 20\n *\n * @summary Query all Order lists\n * @param {number | bigint} [fromId] ID to get aggregate trades from INCLUSIVE.\n * @param {number | bigint} [startTime] Timestamp in ms to get aggregate trades from INCLUSIVE.\n * @param {number | bigint} [endTime] Timestamp in ms to get aggregate trades until INCLUSIVE.\n * @param {number} [limit] Default: 500; Maximum: 1000.\n * @param {number} [recvWindow] The value cannot be greater than `60000`. <br> Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified.\n *\n * @throws {RequiredError}\n */\n allOrderList: async (\n fromId?: number | bigint,\n startTime?: number | bigint,\n endTime?: number | bigint,\n limit?: number,\n recvWindow?: number\n ): Promise<RequestArgs> => {\n const localVarQueryParameter: Record<string, unknown> = {};\n const localVarBodyParameter: Record<string, unknown> = {};\n\n if (fromId !== undefined && fromId !== null) {\n localVarQueryParameter['fromId'] = fromId;\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: '/api/v3/allOrderList',\n method: 'GET',\n queryParams: localVarQueryParameter,\n bodyParams: localVarBodyParameter,\n timeUnit: _timeUnit,\n };\n },\n /**\n * Get all account orders; active, canceled, or filled.\n * Weight: 20\n *\n * @summary All orders\n * @param {string} symbol\n * @param {number | bigint} [orderId]\n * @param {number | bigint} [startTime] Timestamp in ms to get aggregate trades from INCLUSIVE.\n * @param {number | bigint} [endTime] Timestamp in ms to get aggregate trades until INCLUSIVE.\n * @param {number} [limit] Default: 500; Maximum: 1000.\n * @param {number} [recvWindow] The value cannot be greater than `60000`. <br> Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified.\n *\n * @throws {RequiredError}\n */\n allOrders: async (\n symbol: string,\n orderId?: number | bigint,\n startTime?: number | bigint,\n endTime?: number | bigint,\n limit?: number,\n recvWindow?: number\n ): Promise<RequestArgs> => {\n // verify required parameter 'symbol' is not null or undefined\n assertParamExists('allOrders', '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 (orderId !== undefined && orderId !== null) {\n localVarQueryParameter['orderId'] = orderId;\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: '/api/v3/allOrders',\n method: 'GET',\n queryParams: localVarQueryParameter,\n bodyParams: localVarBodyParameter,\n timeUnit: _timeUnit,\n };\n },\n /**\n * Get current account information.\n * Weight: 20\n *\n * @summary Account information\n * @param {boolean} [omitZeroBalances] When set to `true`, emits only the non-zero balances of an account. <br>Default value: `false`\n * @param {number} [recvWindow] The value cannot be greater than `60000`. <br> Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified.\n *\n * @throws {RequiredError}\n */\n getAccount: async (\n omitZeroBalances?: boolean,\n recvWindow?: number\n ): Promise<RequestArgs> => {\n const localVarQueryParameter: Record<string, unknown> = {};\n const localVarBodyParameter: Record<string, unknown> = {};\n\n if (omitZeroBalances !== undefined && omitZeroBalances !== null) {\n localVarQueryParameter['omitZeroBalances'] = omitZeroBalances;\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: '/api/v3/account',\n method: 'GET',\n queryParams: localVarQueryParameter,\n bodyParams: localVarBodyParameter,\n timeUnit: _timeUnit,\n };\n },\n /**\n * Get all open orders on a symbol. **Careful** when accessing this with no symbol.\n * Weight: 6 for a single symbol; **80** when the symbol parameter is omitted\n *\n * @summary Current open orders\n * @param {string} [symbol] Symbol to query\n * @param {number} [recvWindow] The value cannot be greater than `60000`. <br> Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified.\n *\n * @throws {RequiredError}\n */\n getOpenOrders: async (symbol?: string, recvWindow?: number): 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 (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: '/api/v3/openOrders',\n method: 'GET',\n queryParams: localVarQueryParameter,\n bodyParams: localVarBodyParameter,\n timeUnit: _timeUnit,\n };\n },\n /**\n * Check an order's status.\n * Weight: 4\n *\n * @summary Query order\n * @param {string} symbol\n * @param {number | bigint} [orderId]\n * @param {string} [origClientOrderId]\n * @param {number} [recvWindow] The value cannot be greater than `60000`. <br> Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified.\n *\n * @throws {RequiredError}\n */\n getOrder: async (\n symbol: string,\n orderId?: number | bigint,\n origClientOrderId?: string,\n recvWindow?: number\n ): Promise<RequestArgs> => {\n // verify required parameter 'symbol' is not null or undefined\n assertParamExists('getOrder', '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 (orderId !== undefined && orderId !== null) {\n localVarQueryParameter['orderId'] = orderId;\n }\n if (origClientOrderId !== undefined && origClientOrderId !== null) {\n localVarQueryParameter['origClientOrderId'] = origClientOrderId;\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: '/api/v3/order',\n method: 'GET',\n queryParams: localVarQueryParameter,\n bodyParams: localVarBodyParameter,\n timeUnit: _timeUnit,\n };\n },\n /**\n * Retrieves a specific order list based on provided optional parameters.\n * Weight: 4\n *\n * @summary Query Order list\n * @param {number | bigint} [orderListId] Either `orderListId` or `listClientOrderId` must be provided\n * @param {string} [origClientOrderId]\n * @param {number} [recvWindow] The value cannot be greater than `60000`. <br> Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified.\n *\n * @throws {RequiredError}\n */\n getOrderList: async (\n orderListId?: number | bigint,\n origClientOrderId?: string,\n recvWindow?: number\n ): Promise<RequestArgs> => {\n const localVarQueryParameter: Record<string, unknown> = {};\n const localVarBodyParameter: Record<string, unknown> = {};\n\n if (orderListId !== undefined && orderListId !== null) {\n localVarQueryParameter['orderListId'] = orderListId;\n }\n if (origClientOrderId !== undefined && origClientOrderId !== null) {\n localVarQueryParameter['origClientOrderId'] = origClientOrderId;\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: '/api/v3/orderList',\n method: 'GET',\n queryParams: localVarQueryParameter,\n bodyParams: localVarBodyParameter,\n timeUnit: _timeUnit,\n };\n },\n /**\n * Retrieves allocations resulting from SOR order placement.\n * Weight: 20\n *\n * @summary Query Allocations\n * @param {string} symbol\n * @param {number | bigint} [startTime] Timestamp in ms to get aggregate trades from INCLUSIVE.\n * @param {number | bigint} [endTime] Timestamp in ms to get aggregate trades until INCLUSIVE.\n * @param {number} [fromAllocationId]\n * @param {number} [limit] Default: 500; Maximum: 1000.\n * @param {number | bigint} [orderId]\n * @param {number} [recvWindow] The value cannot be greater than `60000`. <br> Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified.\n *\n * @throws {RequiredError}\n */\n myAllocations: async (\n symbol: string,\n startTime?: number | bigint,\n endTime?: number | bigint,\n fromAllocationId?: number,\n limit?: number,\n orderId?: number | bigint,\n recvWindow?: number\n ): Promise<RequestArgs> => {\n // verify required parameter 'symbol' is not null or undefined\n assertParamExists('myAllocations', '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 (startTime !== undefined && startTime !== null) {\n localVarQueryParameter['startTime'] = startTime;\n }\n if (endTime !== undefined && endTime !== null) {\n localVarQueryParameter['endTime'] = endTime;\n }\n if (fromAllocationId !== undefined && fromAllocationId !== null) {\n localVarQueryParameter['fromAllocationId'] = fromAllocationId;\n }\n if (limit !== undefined && limit !== null) {\n localVarQueryParameter['limit'] = limit;\n }\n if (orderId !== undefined && orderId !== null) {\n localVarQueryParameter['orderId'] = orderId;\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: '/api/v3/myAllocations',\n method: 'GET',\n queryParams: localVarQueryParameter,\n bodyParams: localVarBodyParameter,\n timeUnit: _timeUnit,\n };\n },\n /**\n * Retrieves the list of [filters](filters.md) relevant to an account on a given symbol. This is the only endpoint that shows if an account has `MAX_ASSET` filters applied to it.\n * Weight: 40\n *\n * @summary Query relevant filters\n * @param {string} symbol\n * @param {number} [recvWindow] The value cannot be greater than `60000`. <br> Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified.\n *\n * @throws {RequiredError}\n */\n myFilters: async (symbol: string, recvWindow?: number): Promise<RequestArgs> => {\n // verify required parameter 'symbol' is not null or undefined\n assertParamExists('myFilters', '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 (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: '/api/v3/myFilters',\n method: 'GET',\n queryParams: localVarQueryParameter,\n bodyParams: localVarBodyParameter,\n timeUnit: _timeUnit,\n };\n },\n /**\n * Displays the list of orders that were expired due to STP.\n *\n * These are the combinations supported:\n *\n * `symbol` + `preventedMatchId`\n * `symbol` + `orderId`\n * `symbol` + `orderId` + `fromPreventedMatchId` (`limit` will default to 500)\n * `symbol` + `orderId` + `fromPreventedMatchId` + `limit`\n * Weight: Case | Weight\n * ---- | -----\n * If `symbol` is invalid | 2\n * Querying by `preventedMatchId` | 2\n * Querying by `orderId` | 20\n *\n * @summary Query Prevented Matches\n * @param {string} symbol\n * @param {number | bigint} [preventedMatchId]\n * @param {number | bigint} [orderId]\n * @param {number | bigint} [fromPreventedMatchId]\n * @param {number} [limit] Default: 500; Maximum: 1000.\n * @param {number} [recvWindow] The value cannot be greater than `60000`. <br> Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified.\n *\n * @throws {RequiredError}\n */\n myPreventedMatches: async (\n symbol: string,\n preventedMatchId?: number | bigint,\n orderId?: number | bigint,\n fromPreventedMatchId?: number | bigint,\n limit?: number,\n recvWindow?: number\n ): Promise<RequestArgs> => {\n // verify required parameter 'symbol' is not null or undefined\n assertParamExists('myPreventedMatches', '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 (preventedMatchId !== undefined && preventedMatchId !== null) {\n localVarQueryParameter['preventedMatchId'] = preventedMatchId;\n }\n if (orderId !== undefined && orderId !== null) {\n localVarQueryParameter['orderId'] = orderId;\n }\n if (fromPreventedMatchId !== undefined && fromPreventedMatchId !== null) {\n localVarQueryParameter['fromPreventedMatchId'] = fromPreventedMatchId;\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: '/api/v3/myPreventedMatches',\n method: 'GET',\n queryParams: localVarQueryParameter,\n bodyParams: localVarBodyParameter,\n timeUnit: _timeUnit,\n };\n },\n /**\n * Get trades for a specific account and symbol.\n * Weight: Condition| Weight|\n * ---| ---\n * |Without orderId|20|\n * |With orderId|5|\n *\n * @summary Account trade list\n * @param {string} symbol\n * @param {number | bigint} [orderId]\n * @param {number | bigint} [startTime] Timestamp in ms to get aggregate trades from INCLUSIVE.\n * @param {number | bigint} [endTime] Timestamp in ms to get aggregate trades until INCLUSIVE.\n * @param {number | bigint} [fromId] ID to get aggregate trades from INCLUSIVE.\n * @param {number} [limit] Default: 500; Maximum: 1000.\n * @param {number} [recvWindow] The value cannot be greater than `60000`. <br> Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified.\n *\n * @throws {RequiredError}\n */\n myTrades: async (\n symbol: string,\n orderId?: number | bigint,\n startTime?: number | bigint,\n endTime?: number | bigint,\n fromId?: number | bigint,\n limit?: number,\n recvWindow?: number\n ): Promise<RequestArgs> => {\n // verify required parameter 'symbol' is not null or undefined\n assertParamExists('myTrades', '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 (orderId !== undefined && orderId !== null) {\n localVarQueryParameter['orderId'] = orderId;\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 (fromId !== undefined && fromId !== null) {\n localVarQueryParameter['fromId'] = fromId;\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: '/api/v3/myTrades',\n method: 'GET',\n queryParams: localVarQueryParameter,\n bodyParams: localVarBodyParameter,\n timeUnit: _timeUnit,\n };\n },\n /**\n *\n * Weight: 6\n *\n * @summary Query Open Order lists\n * @param {number} [recvWindow] The value cannot be greater than `60000`. <br> Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified.\n *\n * @throws {RequiredError}\n */\n openOrderList: async (recvWindow?: number): 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: '/api/v3/openOrderList',\n method: 'GET',\n queryParams: localVarQueryParameter,\n bodyParams: localVarBodyParameter,\n timeUnit: _timeUnit,\n };\n },\n /**\n * Queries all amendments of a single order.\n * Weight: 4\n *\n * @summary Query Order Amendments\n * @param {string} symbol\n * @param {number | bigint} orderId\n * @param {number | bigint} [fromExecutionId]\n * @param {number | bigint} [limit] Default: 500; Maximum: 1000\n * @param {number} [recvWindow] The value cannot be greater than `60000`. <br> Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified.\n *\n * @throws {RequiredError}\n */\n orderAmendments: async (\n symbol: string,\n orderId: number | bigint,\n fromExecutionId?: number | bigint,\n limit?: number | bigint,\n recvWindow?: number\n ): Promise<RequestArgs> => {\n // verify required parameter 'symbol' is not null or undefined\n assertParamExists('orderAmendments', 'symbol', symbol);\n // verify required parameter 'orderId' is not null or undefined\n assertParamExists('orderAmendments', 'orderId', orderId);\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 (orderId !== undefined && orderId !== null) {\n localVarQueryParameter['orderId'] = orderId;\n }\n if (fromExecutionId !== undefined && fromExecutionId !== null) {\n localVarQueryParameter['fromExecutionId'] = fromExecutionId;\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: '/api/v3/order/amendments',\n method: 'GET',\n queryParams: localVarQueryParameter,\n bodyParams: localVarBodyParameter,\n timeUnit: _timeUnit,\n };\n },\n /**\n * Displays the user's unfilled order count for all intervals.\n * Weight: 40\n *\n * @summary Query Unfilled Order Count\n * @param {number} [recvWindow] The value cannot be greater than `60000`. <br> Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified.\n *\n * @throws {RequiredError}\n */\n rateLimitOrder: async (recvWindow?: number): 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: '/api/v3/rateLimit/order',\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 * Get current account commission rates.\n * Weight: 20\n *\n * @summary Query Commission Rates\n * @param {AccountCommissionRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof AccountApiInterface\n */\n accountCommission(\n requestParameters: AccountCommissionRequest\n ): Promise<RestApiResponse<AccountCommissionResponse>>;\n /**\n * Retrieves all order lists based on provided optional parameters.\n *\n * Note that the time between `startTime` and `endTime` can't be longer than 24 hours.\n * Weight: 20\n *\n * @summary Query all Order lists\n * @param {AllOrderListRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof AccountApiInterface\n */\n allOrderList(\n requestParameters?: AllOrderListRequest\n ): Promise<RestApiResponse<AllOrderListResponse>>;\n /**\n * Get all account orders; active, canceled, or filled.\n * Weight: 20\n *\n * @summary All orders\n * @param {AllOrdersRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof AccountApiInterface\n */\n allOrders(requestParameters: AllOrdersRequest): Promise<RestApiResponse<AllOrdersResponse>>;\n /**\n * Get current account information.\n * Weight: 20\n *\n * @summary Account information\n * @param {GetAccountRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof AccountApiInterface\n */\n getAccount(requestParameters?: GetAccountRequest): Promise<RestApiResponse<GetAccountResponse>>;\n /**\n * Get all open orders on a symbol. **Careful** when accessing this with no symbol.\n * Weight: 6 for a single symbol; **80** when the symbol parameter is omitted\n *\n * @summary Current open orders\n * @param {GetOpenOrdersRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof AccountApiInterface\n */\n getOpenOrders(\n requestParameters?: GetOpenOrdersRequest\n ): Promise<RestApiResponse<GetOpenOrdersResponse>>;\n /**\n * Check an order's status.\n * Weight: 4\n *\n * @summary Query order\n * @param {GetOrderRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof AccountApiInterface\n */\n getOrder(requestParameters: GetOrderRequest): Promise<RestApiResponse<GetOrderResponse>>;\n /**\n * Retrieves a specific order list based on provided optional parameters.\n * Weight: 4\n *\n * @summary Query Order list\n * @param {GetOrderListRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof AccountApiInterface\n */\n getOrderList(\n requestParameters?: GetOrderListRequest\n ): Promise<RestApiResponse<GetOrderListResponse>>;\n /**\n * Retrieves allocations resulting from SOR order placement.\n * Weight: 20\n *\n * @summary Query Allocations\n * @param {MyAllocationsRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof AccountApiInterface\n */\n myAllocations(\n requestParameters: MyAllocationsRequest\n ): Promise<RestApiResponse<MyAllocationsResponse>>;\n /**\n * Retrieves the list of [filters](filters.md) relevant to an account on a given symbol. This is the only endpoint that shows if an account has `MAX_ASSET` filters applied to it.\n * Weight: 40\n *\n * @summary Query relevant filters\n * @param {MyFiltersRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof AccountApiInterface\n */\n myFilters(requestParameters: MyFiltersRequest): Promise<RestApiResponse<MyFiltersResponse>>;\n /**\n * Displays the list of orders that were expired due to STP.\n *\n * These are the combinations supported:\n *\n * `symbol` + `preventedMatchId`\n * `symbol` + `orderId`\n * `symbol` + `orderId` + `fromPreventedMatchId` (`limit` will default to 500)\n * `symbol` + `orderId` + `fromPreventedMatchId` + `limit`\n * Weight: Case | Weight\n * ---- | -----\n * If `symbol` is invalid | 2\n * Querying by `preventedMatchId` | 2\n * Querying by `orderId` | 20\n *\n * @summary Query Prevented Matches\n * @param {MyPreventedMatchesRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof AccountApiInterface\n */\n myPreventedMatches(\n requestParameters: MyPreventedMatchesRequest\n ): Promise<RestApiResponse<MyPreventedMatchesResponse>>;\n /**\n * Get trades for a specific account and symbol.\n * Weight: Condition| Weight|\n * ---| ---\n * |Without orderId|20|\n * |With orderId|5|\n *\n * @summary Account trade list\n * @param {MyTradesRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof AccountApiInterface\n */\n myTrades(requestParameters: MyTradesRequest): Promise<RestApiResponse<MyTradesResponse>>;\n /**\n *\n * Weight: 6\n *\n * @summary Query Open Order lists\n * @param {OpenOrderListRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof AccountApiInterface\n */\n openOrderList(\n requestParameters?: OpenOrderListRequest\n ): Promise<RestApiResponse<OpenOrderListResponse>>;\n /**\n * Queries all amendments of a single order.\n * Weight: 4\n *\n * @summary Query Order Amendments\n * @param {OrderAmendmentsRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof AccountApiInterface\n */\n orderAmendments(\n requestParameters: OrderAmendmentsRequest\n ): Promise<RestApiResponse<OrderAmendmentsResponse>>;\n /**\n * Displays the user's unfilled order count for all intervals.\n * Weight: 40\n *\n * @summary Query Unfilled Order Count\n * @param {RateLimitOrderRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof AccountApiInterface\n */\n rateLimitOrder(\n requestParameters?: RateLimitOrderRequest\n ): Promise<RestApiResponse<RateLimitOrderResponse>>;\n}\n\n/**\n * Request parameters for accountCommission operation in AccountApi.\n * @interface AccountCommissionRequest\n */\nexport interface AccountCommissionRequest {\n /**\n *\n * @type {string}\n * @memberof AccountApiAccountCommission\n */\n readonly symbol: string;\n}\n\n/**\n * Request parameters for allOrderList operation in AccountApi.\n * @interface AllOrderListRequest\n */\nexport interface AllOrderListRequest {\n /**\n * ID to get aggregate trades from INCLUSIVE.\n * @type {number | bigint}\n * @memberof AccountApiAllOrderList\n */\n readonly fromId?: number | bigint;\n\n /**\n * Timestamp in ms to get aggregate trades from INCLUSIVE.\n * @type {number | bigint}\n * @memberof AccountApiAllOrderList\n */\n readonly startTime?: number | bigint;\n\n /**\n * Timestamp in ms to get aggregate trades until INCLUSIVE.\n * @type {number | bigint}\n * @memberof AccountApiAllOrderList\n */\n readonly endTime?: number | bigint;\n\n /**\n * Default: 500; Maximum: 1000.\n * @type {number}\n * @memberof AccountApiAllOrderList\n */\n readonly limit?: number;\n\n /**\n * The value cannot be greater than `60000`. <br> Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified.\n * @type {number}\n * @memberof AccountApiAllOrderList\n */\n readonly recvWindow?: number;\n}\n\n/**\n * Request parameters for allOrders operation in AccountApi.\n * @interface AllOrdersRequest\n */\nexport interface AllOrdersRequest {\n /**\n *\n * @type {string}\n * @memberof AccountApiAllOrders\n */\n readonly symbol: string;\n\n /**\n *\n * @type {number | bigint}\n * @memberof AccountApiAllOrders\n */\n readonly orderId?: number | bigint;\n\n /**\n * Timestamp in ms to get aggregate trades from INCLUSIVE.\n * @type {number | bigint}\n * @memberof AccountApiAllOrders\n */\n readonly startTime?: number | bigint;\n\n /**\n * Timestamp in ms to get aggregate trades until INCLUSIVE.\n * @type {number | bigint}\n * @memberof AccountApiAllOrders\n */\n readonly endTime?: number | bigint;\n\n /**\n * Default: 500; Maximum: 1000.\n * @type {number}\n * @memberof AccountApiAllOrders\n */\n readonly limit?: number;\n\n /**\n * The value cannot be greater than `60000`. <br> Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified.\n * @type {number}\n * @memberof AccountApiAllOrders\n */\n readonly recvWindow?: number;\n}\n\n/**\n * Request parameters for getAccount operation in AccountApi.\n * @interface GetAccountRequest\n */\nexport interface GetAccountRequest {\n /**\n * When set to `true`, emits only the non-zero balances of an account. <br>Default value: `false`\n * @type {boolean}\n * @memberof AccountApiGetAccount\n */\n readonly omitZeroBalances?: boolean;\n\n /**\n * The value cannot be greater than `60000`. <br> Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified.\n * @type {number}\n * @memberof AccountApiGetAccount\n */\n readonly recvWindow?: number;\n}\n\n/**\n * Request parameters for getOpenOrders operation in AccountApi.\n * @interface GetOpenOrdersRequest\n */\nexport interface GetOpenOrdersRequest {\n /**\n * Symbol to query\n * @type {string}\n * @memberof AccountApiGetOpenOrders\n */\n readonly symbol?: string;\n\n /**\n * The value cannot be greater than `60000`. <br> Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified.\n * @type {number}\n * @memberof AccountApiGetOpenOrders\n */\n readonly recvWindow?: number;\n}\n\n/**\n * Request parameters for getOrder operation in AccountApi.\n * @interface GetOrderRequest\n */\nexport interface GetOrderRequest {\n /**\n *\n * @type {string}\n * @memberof AccountApiGetOrder\n */\n readonly symbol: string;\n\n /**\n *\n * @type {number | bigint}\n * @memberof AccountApiGetOrder\n */\n readonly orderId?: number | bigint;\n\n /**\n *\n * @type {string}\n * @memberof AccountApiGetOrder\n */\n readonly origClientOrderId?: string;\n\n /**\n * The value cannot be greater than `60000`. <br> Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified.\n * @type {number}\n * @memberof AccountApiGetOrder\n */\n readonly recvWindow?: number;\n}\n\n/**\n * Request parameters for getOrderList operation in AccountApi.\n * @interface GetOrderListRequest\n */\nexport interface GetOrderListRequest {\n /**\n * Either `orderListId` or `listClientOrderId` must be provided\n * @type {number | bigint}\n * @memberof AccountApiGetOrderList\n */\n readonly orderListId?: number | bigint;\n\n /**\n *\n * @type {string}\n * @memberof AccountApiGetOrderList\n */\n readonly origClientOrderId?: string;\n\n /**\n * The value cannot be greater than `60000`. <br> Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified.\n * @type {number}\n * @memberof AccountApiGetOrderList\n */\n readonly recvWindow?: number;\n}\n\n/**\n * Request parameters for myAllocations operation in AccountApi.\n * @interface MyAllocationsRequest\n */\nexport interface MyAllocationsRequest {\n /**\n *\n * @type {string}\n * @memberof AccountApiMyAllocations\n */\n readonly symbol: string;\n\n /**\n * Timestamp in ms to get aggregate trades from INCLUSIVE.\n * @type {number | bigint}\n * @memberof AccountApiMyAllocations\n */\n readonly startTime?: number | bigint;\n\n /**\n * Timestamp in ms to get aggregate trades until INCLUSIVE.\n * @type {number | bigint}\n