@binance/convert 4.0.3 → 4.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["localVarQueryParameter: Record<string, unknown>","_timeUnit: TimeUnit | undefined","localVarQueryParameter: Record<string, unknown>","_timeUnit: TimeUnit | undefined","ConfigurationRestAPI","CONVERT_REST_API_PROD_URL"],"sources":["../package.json","../src/rest-api/modules/market-data-api.ts","../src/rest-api/modules/trade-api.ts","../src/rest-api/rest-api.ts","../src/rest-api/index.ts","../src/convert.ts"],"sourcesContent":["{\n \"name\": \"@binance/convert\",\n \"description\": \"Official Binance Convert Connector - A lightweight library that provides a convenient interface to Binance's Convert REST API.\",\n \"version\": \"4.0.3\",\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 \"Convert\",\n \"Connector\",\n \"REST\",\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.0.1\",\n \"axios\": \"^1.7.4\"\n }\n}\n","/**\n * Binance Convert REST API\n *\n * OpenAPI Specification for the Binance Convert 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 sendRequest,\n type RequestArgs,\n} from '@binance/common';\nimport type {\n ListAllConvertPairsResponse,\n QueryOrderQuantityPrecisionPerAssetResponse,\n} from '../types';\n\n/**\n * MarketDataApi - axios parameter creator\n */\nconst MarketDataApiAxiosParamCreator = function (configuration: ConfigurationRestAPI) {\n return {\n /**\n * Query for all convertible token pairs and the tokens’ respective upper/lower limits\n *\n * User needs to supply either or both of the input parameter\n * If not defined for both fromAsset and toAsset, only partial token pairs will be returned\n *\n * Weight: 3000(IP)\n *\n * @summary List All Convert Pairs\n * @param {string} [fromAsset] User spends coin\n * @param {string} [toAsset] User receives coin\n *\n * @throws {RequiredError}\n */\n listAllConvertPairs: async (fromAsset?: string, toAsset?: string): Promise<RequestArgs> => {\n const localVarQueryParameter: Record<string, unknown> = {};\n\n if (fromAsset !== undefined && fromAsset !== null) {\n localVarQueryParameter['fromAsset'] = fromAsset;\n }\n\n if (toAsset !== undefined && toAsset !== null) {\n localVarQueryParameter['toAsset'] = toAsset;\n }\n\n let _timeUnit: TimeUnit | undefined;\n if ('timeUnit' in configuration) _timeUnit = configuration.timeUnit as TimeUnit;\n\n return {\n endpoint: '/sapi/v1/convert/exchangeInfo',\n method: 'GET',\n params: localVarQueryParameter,\n timeUnit: _timeUnit,\n };\n },\n /**\n * Query for supported asset’s precision information\n *\n * Weight: 100(IP)\n *\n * @summary Query order quantity precision per asset(USER_DATA)\n * @param {number | bigint} [recvWindow] The value cannot be greater than 60000\n *\n * @throws {RequiredError}\n */\n queryOrderQuantityPrecisionPerAsset: async (\n recvWindow?: number | bigint\n ): Promise<RequestArgs> => {\n const localVarQueryParameter: 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: '/sapi/v1/convert/assetInfo',\n method: 'GET',\n params: localVarQueryParameter,\n timeUnit: _timeUnit,\n };\n },\n };\n};\n\n/**\n * MarketDataApi - interface\n * @interface MarketDataApi\n */\nexport interface MarketDataApiInterface {\n /**\n * Query for all convertible token pairs and the tokens’ respective upper/lower limits\n *\n * User needs to supply either or both of the input parameter\n * If not defined for both fromAsset and toAsset, only partial token pairs will be returned\n *\n * Weight: 3000(IP)\n *\n * @summary List All Convert Pairs\n * @param {ListAllConvertPairsRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof MarketDataApiInterface\n */\n listAllConvertPairs(\n requestParameters?: ListAllConvertPairsRequest\n ): Promise<RestApiResponse<ListAllConvertPairsResponse>>;\n /**\n * Query for supported asset’s precision information\n *\n * Weight: 100(IP)\n *\n * @summary Query order quantity precision per asset(USER_DATA)\n * @param {QueryOrderQuantityPrecisionPerAssetRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof MarketDataApiInterface\n */\n queryOrderQuantityPrecisionPerAsset(\n requestParameters?: QueryOrderQuantityPrecisionPerAssetRequest\n ): Promise<RestApiResponse<QueryOrderQuantityPrecisionPerAssetResponse>>;\n}\n\n/**\n * Request parameters for listAllConvertPairs operation in MarketDataApi.\n * @interface ListAllConvertPairsRequest\n */\nexport interface ListAllConvertPairsRequest {\n /**\n * User spends coin\n * @type {string}\n * @memberof MarketDataApiListAllConvertPairs\n */\n readonly fromAsset?: string;\n\n /**\n * User receives coin\n * @type {string}\n * @memberof MarketDataApiListAllConvertPairs\n */\n readonly toAsset?: string;\n}\n\n/**\n * Request parameters for queryOrderQuantityPrecisionPerAsset operation in MarketDataApi.\n * @interface QueryOrderQuantityPrecisionPerAssetRequest\n */\nexport interface QueryOrderQuantityPrecisionPerAssetRequest {\n /**\n * The value cannot be greater than 60000\n * @type {number | bigint}\n * @memberof MarketDataApiQueryOrderQuantityPrecisionPerAsset\n */\n readonly recvWindow?: number | bigint;\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 * Query for all convertible token pairs and the tokens’ respective upper/lower limits\n *\n * User needs to supply either or both of the input parameter\n * If not defined for both fromAsset and toAsset, only partial token pairs will be returned\n *\n * Weight: 3000(IP)\n *\n * @summary List All Convert Pairs\n * @param {ListAllConvertPairsRequest} requestParameters Request parameters.\n * @returns {Promise<RestApiResponse<ListAllConvertPairsResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof MarketDataApi\n * @see {@link https://developers.binance.com/docs/convert/market-data/ Binance API Documentation}\n */\n public async listAllConvertPairs(\n requestParameters: ListAllConvertPairsRequest = {}\n ): Promise<RestApiResponse<ListAllConvertPairsResponse>> {\n const localVarAxiosArgs = await this.localVarAxiosParamCreator.listAllConvertPairs(\n requestParameters?.fromAsset,\n requestParameters?.toAsset\n );\n return sendRequest<ListAllConvertPairsResponse>(\n this.configuration,\n localVarAxiosArgs.endpoint,\n localVarAxiosArgs.method,\n localVarAxiosArgs.params,\n localVarAxiosArgs?.timeUnit,\n { isSigned: false }\n );\n }\n\n /**\n * Query for supported asset’s precision information\n *\n * Weight: 100(IP)\n *\n * @summary Query order quantity precision per asset(USER_DATA)\n * @param {QueryOrderQuantityPrecisionPerAssetRequest} requestParameters Request parameters.\n * @returns {Promise<RestApiResponse<QueryOrderQuantityPrecisionPerAssetResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof MarketDataApi\n * @see {@link https://developers.binance.com/docs/convert/market-data/Query-order-quantity-precision-per-asset Binance API Documentation}\n */\n public async queryOrderQuantityPrecisionPerAsset(\n requestParameters: QueryOrderQuantityPrecisionPerAssetRequest = {}\n ): Promise<RestApiResponse<QueryOrderQuantityPrecisionPerAssetResponse>> {\n const localVarAxiosArgs =\n await this.localVarAxiosParamCreator.queryOrderQuantityPrecisionPerAsset(\n requestParameters?.recvWindow\n );\n return sendRequest<QueryOrderQuantityPrecisionPerAssetResponse>(\n this.configuration,\n localVarAxiosArgs.endpoint,\n localVarAxiosArgs.method,\n localVarAxiosArgs.params,\n localVarAxiosArgs?.timeUnit,\n { isSigned: true }\n );\n }\n}\n","/**\n * Binance Convert REST API\n *\n * OpenAPI Specification for the Binance Convert 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 AcceptQuoteResponse,\n CancelLimitOrderResponse,\n GetConvertTradeHistoryResponse,\n OrderStatusResponse,\n PlaceLimitOrderResponse,\n QueryLimitOpenOrdersResponse,\n SendQuoteRequestResponse,\n} from '../types';\n\n/**\n * TradeApi - axios parameter creator\n */\nconst TradeApiAxiosParamCreator = function (configuration: ConfigurationRestAPI) {\n return {\n /**\n * Accept the offered quote by quote ID.\n *\n * Weight: 500(UID)\n *\n * @summary Accept Quote (TRADE)\n * @param {string} quoteId\n * @param {number | bigint} [recvWindow] The value cannot be greater than 60000\n *\n * @throws {RequiredError}\n */\n acceptQuote: async (\n quoteId: string,\n recvWindow?: number | bigint\n ): Promise<RequestArgs> => {\n // verify required parameter 'quoteId' is not null or undefined\n assertParamExists('acceptQuote', 'quoteId', quoteId);\n\n const localVarQueryParameter: Record<string, unknown> = {};\n\n if (quoteId !== undefined && quoteId !== null) {\n localVarQueryParameter['quoteId'] = quoteId;\n }\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: '/sapi/v1/convert/acceptQuote',\n method: 'POST',\n params: localVarQueryParameter,\n timeUnit: _timeUnit,\n };\n },\n /**\n * Enable users to cancel a limit order\n *\n * Weight: 200(UID)\n *\n * @summary Cancel limit order (USER_DATA)\n * @param {number | bigint} orderId The orderId from `placeOrder` api\n * @param {number | bigint} [recvWindow] The value cannot be greater than 60000\n *\n * @throws {RequiredError}\n */\n cancelLimitOrder: async (\n orderId: number | bigint,\n recvWindow?: number | bigint\n ): Promise<RequestArgs> => {\n // verify required parameter 'orderId' is not null or undefined\n assertParamExists('cancelLimitOrder', 'orderId', orderId);\n\n const localVarQueryParameter: Record<string, unknown> = {};\n\n if (orderId !== undefined && orderId !== null) {\n localVarQueryParameter['orderId'] = orderId;\n }\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: '/sapi/v1/convert/limit/cancelOrder',\n method: 'POST',\n params: localVarQueryParameter,\n timeUnit: _timeUnit,\n };\n },\n /**\n * Get Convert Trade History\n *\n * The max interval between startTime and endTime is 30 days.\n *\n * Weight: 3000\n *\n * @summary Get Convert Trade History(USER_DATA)\n * @param {number | bigint} startTime\n * @param {number | bigint} endTime\n * @param {number | bigint} [limit] Default 100, Max 1000\n * @param {number | bigint} [recvWindow] The value cannot be greater than 60000\n *\n * @throws {RequiredError}\n */\n getConvertTradeHistory: async (\n startTime: number | bigint,\n endTime: number | bigint,\n limit?: number | bigint,\n recvWindow?: number | bigint\n ): Promise<RequestArgs> => {\n // verify required parameter 'startTime' is not null or undefined\n assertParamExists('getConvertTradeHistory', 'startTime', startTime);\n // verify required parameter 'endTime' is not null or undefined\n assertParamExists('getConvertTradeHistory', 'endTime', endTime);\n\n const localVarQueryParameter: Record<string, unknown> = {};\n\n if (startTime !== undefined && startTime !== null) {\n localVarQueryParameter['startTime'] = startTime;\n }\n\n if (endTime !== undefined && endTime !== null) {\n localVarQueryParameter['endTime'] = endTime;\n }\n\n if (limit !== undefined && limit !== null) {\n localVarQueryParameter['limit'] = limit;\n }\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: '/sapi/v1/convert/tradeFlow',\n method: 'GET',\n params: localVarQueryParameter,\n timeUnit: _timeUnit,\n };\n },\n /**\n * Query order status by order ID.\n *\n * Weight: 100(UID)\n *\n * @summary Order status(USER_DATA)\n * @param {string} [orderId] Either orderId or quoteId is required\n * @param {string} [quoteId] Either orderId or quoteId is required\n *\n * @throws {RequiredError}\n */\n orderStatus: async (orderId?: string, quoteId?: string): Promise<RequestArgs> => {\n const localVarQueryParameter: Record<string, unknown> = {};\n\n if (orderId !== undefined && orderId !== null) {\n localVarQueryParameter['orderId'] = orderId;\n }\n\n if (quoteId !== undefined && quoteId !== null) {\n localVarQueryParameter['quoteId'] = quoteId;\n }\n\n let _timeUnit: TimeUnit | undefined;\n if ('timeUnit' in configuration) _timeUnit = configuration.timeUnit as TimeUnit;\n\n return {\n endpoint: '/sapi/v1/convert/orderStatus',\n method: 'GET',\n params: localVarQueryParameter,\n timeUnit: _timeUnit,\n };\n },\n /**\n * Enable users to place a limit order\n *\n * `baseAsset` or `quoteAsset` can be determined via `exchangeInfo` endpoint.\n * Limit price is defined from `baseAsset` to `quoteAsset`.\n * Either `baseAmount` or `quoteAmount` is used.\n *\n * Weight: 500(UID)\n *\n * @summary Place limit order (USER_DATA)\n * @param {string} baseAsset base asset (use the response `fromIsBase` from `GET /sapi/v1/convert/exchangeInfo` api to check which one is baseAsset )\n * @param {string} quoteAsset quote asset\n * @param {number} limitPrice Symbol limit price (from baseAsset to quoteAsset)\n * @param {string} side `BUY` or `SELL`\n * @param {string} expiredType 1_D, 3_D, 7_D, 30_D (D means day)\n * @param {number} [baseAmount] Base asset amount. (One of `baseAmount` or `quoteAmount` is required)\n * @param {number} [quoteAmount] Quote asset amount. (One of `baseAmount` or `quoteAmount` is required)\n * @param {string} [walletType] It is to choose which wallet of assets. The wallet selection is `SPOT`, `FUNDING` and `EARN`. Combination of wallet is supported i.e. `SPOT_FUNDING`, `FUNDING_EARN`, `SPOT_FUNDING_EARN` or `SPOT_EARN` Default is `SPOT`.\n * @param {number | bigint} [recvWindow] The value cannot be greater than 60000\n *\n * @throws {RequiredError}\n */\n placeLimitOrder: async (\n baseAsset: string,\n quoteAsset: string,\n limitPrice: number,\n side: string,\n expiredType: string,\n baseAmount?: number,\n quoteAmount?: number,\n walletType?: string,\n recvWindow?: number | bigint\n ): Promise<RequestArgs> => {\n // verify required parameter 'baseAsset' is not null or undefined\n assertParamExists('placeLimitOrder', 'baseAsset', baseAsset);\n // verify required parameter 'quoteAsset' is not null or undefined\n assertParamExists('placeLimitOrder', 'quoteAsset', quoteAsset);\n // verify required parameter 'limitPrice' is not null or undefined\n assertParamExists('placeLimitOrder', 'limitPrice', limitPrice);\n // verify required parameter 'side' is not null or undefined\n assertParamExists('placeLimitOrder', 'side', side);\n // verify required parameter 'expiredType' is not null or undefined\n assertParamExists('placeLimitOrder', 'expiredType', expiredType);\n\n const localVarQueryParameter: Record<string, unknown> = {};\n\n if (baseAsset !== undefined && baseAsset !== null) {\n localVarQueryParameter['baseAsset'] = baseAsset;\n }\n\n if (quoteAsset !== undefined && quoteAsset !== null) {\n localVarQueryParameter['quoteAsset'] = quoteAsset;\n }\n\n if (limitPrice !== undefined && limitPrice !== null) {\n localVarQueryParameter['limitPrice'] = limitPrice;\n }\n\n if (baseAmount !== undefined && baseAmount !== null) {\n localVarQueryParameter['baseAmount'] = baseAmount;\n }\n\n if (quoteAmount !== undefined && quoteAmount !== null) {\n localVarQueryParameter['quoteAmount'] = quoteAmount;\n }\n\n if (side !== undefined && side !== null) {\n localVarQueryParameter['side'] = side;\n }\n\n if (walletType !== undefined && walletType !== null) {\n localVarQueryParameter['walletType'] = walletType;\n }\n\n if (expiredType !== undefined && expiredType !== null) {\n localVarQueryParameter['expiredType'] = expiredType;\n }\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: '/sapi/v1/convert/limit/placeOrder',\n method: 'POST',\n params: localVarQueryParameter,\n timeUnit: _timeUnit,\n };\n },\n /**\n * Request a quote for the requested token pairs\n *\n * Weight: 3000(UID)\n *\n * @summary Query limit open orders (USER_DATA)\n * @param {number | bigint} [recvWindow] The value cannot be greater than 60000\n *\n * @throws {RequiredError}\n */\n queryLimitOpenOrders: async (recvWindow?: number | bigint): Promise<RequestArgs> => {\n const localVarQueryParameter: 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: '/sapi/v1/convert/limit/queryOpenOrders',\n method: 'GET',\n params: localVarQueryParameter,\n timeUnit: _timeUnit,\n };\n },\n /**\n * Request a quote for the requested token pairs\n *\n * Either fromAmount or toAmount should be sent\n * `quoteId` will be returned only if you have enough funds to convert\n *\n * Weight: 200(UID)\n *\n * @summary Send Quote Request(USER_DATA)\n * @param {string} fromAsset\n * @param {string} toAsset\n * @param {number} [fromAmount] When specified, it is the amount you will be debited after the conversion\n * @param {number} [toAmount] When specified, it is the amount you will be credited after the conversion\n * @param {string} [walletType] It is to choose which wallet of assets. The wallet selection is `SPOT`, `FUNDING` and `EARN`. Combination of wallet is supported i.e. `SPOT_FUNDING`, `FUNDING_EARN`, `SPOT_FUNDING_EARN` or `SPOT_EARN` Default is `SPOT`.\n * @param {string} [validTime] 10s, 30s, 1m, default 10s\n * @param {number | bigint} [recvWindow] The value cannot be greater than 60000\n *\n * @throws {RequiredError}\n */\n sendQuoteRequest: async (\n fromAsset: string,\n toAsset: string,\n fromAmount?: number,\n toAmount?: number,\n walletType?: string,\n validTime?: string,\n recvWindow?: number | bigint\n ): Promise<RequestArgs> => {\n // verify required parameter 'fromAsset' is not null or undefined\n assertParamExists('sendQuoteRequest', 'fromAsset', fromAsset);\n // verify required parameter 'toAsset' is not null or undefined\n assertParamExists('sendQuoteRequest', 'toAsset', toAsset);\n\n const localVarQueryParameter: Record<string, unknown> = {};\n\n if (fromAsset !== undefined && fromAsset !== null) {\n localVarQueryParameter['fromAsset'] = fromAsset;\n }\n\n if (toAsset !== undefined && toAsset !== null) {\n localVarQueryParameter['toAsset'] = toAsset;\n }\n\n if (fromAmount !== undefined && fromAmount !== null) {\n localVarQueryParameter['fromAmount'] = fromAmount;\n }\n\n if (toAmount !== undefined && toAmount !== null) {\n localVarQueryParameter['toAmount'] = toAmount;\n }\n\n if (walletType !== undefined && walletType !== null) {\n localVarQueryParameter['walletType'] = walletType;\n }\n\n if (validTime !== undefined && validTime !== null) {\n localVarQueryParameter['validTime'] = validTime;\n }\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: '/sapi/v1/convert/getQuote',\n method: 'POST',\n params: localVarQueryParameter,\n timeUnit: _timeUnit,\n };\n },\n };\n};\n\n/**\n * TradeApi - interface\n * @interface TradeApi\n */\nexport interface TradeApiInterface {\n /**\n * Accept the offered quote by quote ID.\n *\n * Weight: 500(UID)\n *\n * @summary Accept Quote (TRADE)\n * @param {AcceptQuoteRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof TradeApiInterface\n */\n acceptQuote(\n requestParameters: AcceptQuoteRequest\n ): Promise<RestApiResponse<AcceptQuoteResponse>>;\n /**\n * Enable users to cancel a limit order\n *\n * Weight: 200(UID)\n *\n * @summary Cancel limit order (USER_DATA)\n * @param {CancelLimitOrderRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof TradeApiInterface\n */\n cancelLimitOrder(\n requestParameters: CancelLimitOrderRequest\n ): Promise<RestApiResponse<CancelLimitOrderResponse>>;\n /**\n * Get Convert Trade History\n *\n * The max interval between startTime and endTime is 30 days.\n *\n * Weight: 3000\n *\n * @summary Get Convert Trade History(USER_DATA)\n * @param {GetConvertTradeHistoryRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof TradeApiInterface\n */\n getConvertTradeHistory(\n requestParameters: GetConvertTradeHistoryRequest\n ): Promise<RestApiResponse<GetConvertTradeHistoryResponse>>;\n /**\n * Query order status by order ID.\n *\n * Weight: 100(UID)\n *\n * @summary Order status(USER_DATA)\n * @param {OrderStatusRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof TradeApiInterface\n */\n orderStatus(\n requestParameters?: OrderStatusRequest\n ): Promise<RestApiResponse<OrderStatusResponse>>;\n /**\n * Enable users to place a limit order\n *\n * `baseAsset` or `quoteAsset` can be determined via `exchangeInfo` endpoint.\n * Limit price is defined from `baseAsset` to `quoteAsset`.\n * Either `baseAmount` or `quoteAmount` is used.\n *\n * Weight: 500(UID)\n *\n * @summary Place limit order (USER_DATA)\n * @param {PlaceLimitOrderRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof TradeApiInterface\n */\n placeLimitOrder(\n requestParameters: PlaceLimitOrderRequest\n ): Promise<RestApiResponse<PlaceLimitOrderResponse>>;\n /**\n * Request a quote for the requested token pairs\n *\n * Weight: 3000(UID)\n *\n * @summary Query limit open orders (USER_DATA)\n * @param {QueryLimitOpenOrdersRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof TradeApiInterface\n */\n queryLimitOpenOrders(\n requestParameters?: QueryLimitOpenOrdersRequest\n ): Promise<RestApiResponse<QueryLimitOpenOrdersResponse>>;\n /**\n * Request a quote for the requested token pairs\n *\n * Either fromAmount or toAmount should be sent\n * `quoteId` will be returned only if you have enough funds to convert\n *\n * Weight: 200(UID)\n *\n * @summary Send Quote Request(USER_DATA)\n * @param {SendQuoteRequestRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof TradeApiInterface\n */\n sendQuoteRequest(\n requestParameters: SendQuoteRequestRequest\n ): Promise<RestApiResponse<SendQuoteRequestResponse>>;\n}\n\n/**\n * Request parameters for acceptQuote operation in TradeApi.\n * @interface AcceptQuoteRequest\n */\nexport interface AcceptQuoteRequest {\n /**\n *\n * @type {string}\n * @memberof TradeApiAcceptQuote\n */\n readonly quoteId: string;\n\n /**\n * The value cannot be greater than 60000\n * @type {number | bigint}\n * @memberof TradeApiAcceptQuote\n */\n readonly recvWindow?: number | bigint;\n}\n\n/**\n * Request parameters for cancelLimitOrder operation in TradeApi.\n * @interface CancelLimitOrderRequest\n */\nexport interface CancelLimitOrderRequest {\n /**\n * The orderId from `placeOrder` api\n * @type {number | bigint}\n * @memberof TradeApiCancelLimitOrder\n */\n readonly orderId: number | bigint;\n\n /**\n * The value cannot be greater than 60000\n * @type {number | bigint}\n * @memberof TradeApiCancelLimitOrder\n */\n readonly recvWindow?: number | bigint;\n}\n\n/**\n * Request parameters for getConvertTradeHistory operation in TradeApi.\n * @interface GetConvertTradeHistoryRequest\n */\nexport interface GetConvertTradeHistoryRequest {\n /**\n *\n * @type {number | bigint}\n * @memberof TradeApiGetConvertTradeHistory\n */\n readonly startTime: number | bigint;\n\n /**\n *\n * @type {number | bigint}\n * @memberof TradeApiGetConvertTradeHistory\n */\n readonly endTime: number | bigint;\n\n /**\n * Default 100, Max 1000\n * @type {number | bigint}\n * @memberof TradeApiGetConvertTradeHistory\n */\n readonly limit?: number | bigint;\n\n /**\n * The value cannot be greater than 60000\n * @type {number | bigint}\n * @memberof TradeApiGetConvertTradeHistory\n */\n readonly recvWindow?: number | bigint;\n}\n\n/**\n * Request parameters for orderStatus operation in TradeApi.\n * @interface OrderStatusRequest\n */\nexport interface OrderStatusRequest {\n /**\n * Either orderId or quoteId is required\n * @type {string}\n * @memberof TradeApiOrderStatus\n */\n readonly orderId?: string;\n\n /**\n * Either orderId or quoteId is required\n * @type {string}\n * @memberof TradeApiOrderStatus\n */\n readonly quoteId?: string;\n}\n\n/**\n * Request parameters for placeLimitOrder operation in TradeApi.\n * @interface PlaceLimitOrderRequest\n */\nexport interface PlaceLimitOrderRequest {\n /**\n * base asset (use the response `fromIsBase` from `GET /sapi/v1/convert/exchangeInfo` api to check which one is baseAsset )\n * @type {string}\n * @memberof TradeApiPlaceLimitOrder\n */\n readonly baseAsset: string;\n\n /**\n * quote asset\n * @type {string}\n * @memberof TradeApiPlaceLimitOrder\n */\n readonly quoteAsset: string;\n\n /**\n * Symbol limit price (from baseAsset to quoteAsset)\n * @type {number}\n * @memberof TradeApiPlaceLimitOrder\n */\n readonly limitPrice: number;\n\n /**\n * `BUY` or `SELL`\n * @type {string}\n * @memberof TradeApiPlaceLimitOrder\n */\n readonly side: string;\n\n /**\n * 1_D, 3_D, 7_D, 30_D (D means day)\n * @type {string}\n * @memberof TradeApiPlaceLimitOrder\n */\n readonly expiredType: string;\n\n /**\n * Base asset amount. (One of `baseAmount` or `quoteAmount` is required)\n * @type {number}\n * @memberof TradeApiPlaceLimitOrder\n */\n readonly baseAmount?: number;\n\n /**\n * Quote asset amount. (One of `baseAmount` or `quoteAmount` is required)\n * @type {number}\n * @memberof TradeApiPlaceLimitOrder\n */\n readonly quoteAmount?: number;\n\n /**\n * It is to choose which wallet of assets. The wallet selection is `SPOT`, `FUNDING` and `EARN`. Combination of wallet is supported i.e. `SPOT_FUNDING`, `FUNDING_EARN`, `SPOT_FUNDING_EARN` or `SPOT_EARN` Default is `SPOT`.\n * @type {string}\n * @memberof TradeApiPlaceLimitOrder\n */\n readonly walletType?: string;\n\n /**\n * The value cannot be greater than 60000\n * @type {number | bigint}\n * @memberof TradeApiPlaceLimitOrder\n */\n readonly recvWindow?: number | bigint;\n}\n\n/**\n * Request parameters for queryLimitOpenOrders operation in TradeApi.\n * @interface QueryLimitOpenOrdersRequest\n */\nexport interface QueryLimitOpenOrdersRequest {\n /**\n * The value cannot be greater than 60000\n * @type {number | bigint}\n * @memberof TradeApiQueryLimitOpenOrders\n */\n readonly recvWindow?: number | bigint;\n}\n\n/**\n * Request parameters for sendQuoteRequest operation in TradeApi.\n * @interface SendQuoteRequestRequest\n */\nexport interface SendQuoteRequestRequest {\n /**\n *\n * @type {string}\n * @memberof TradeApiSendQuoteRequest\n */\n readonly fromAsset: string;\n\n /**\n *\n * @type {string}\n * @memberof TradeApiSendQuoteRequest\n */\n readonly toAsset: string;\n\n /**\n * When specified, it is the amount you will be debited after the conversion\n * @type {number}\n * @memberof TradeApiSendQuoteRequest\n */\n readonly fromAmount?: number;\n\n /**\n * When specified, it is the amount you will be credited after the conversion\n * @type {number}\n * @memberof TradeApiSendQuoteRequest\n */\n readonly toAmount?: number;\n\n /**\n * It is to choose which wallet of assets. The wallet selection is `SPOT`, `FUNDING` and `EARN`. Combination of wallet is supported i.e. `SPOT_FUNDING`, `FUNDING_EARN`, `SPOT_FUNDING_EARN` or `SPOT_EARN` Default is `SPOT`.\n * @type {string}\n * @memberof TradeApiSendQuoteRequest\n */\n readonly walletType?: string;\n\n /**\n * 10s, 30s, 1m, default 10s\n * @type {string}\n * @memberof TradeApiSendQuoteRequest\n */\n readonly validTime?: string;\n\n /**\n * The value cannot be greater than 60000\n * @type {number | bigint}\n * @memberof TradeApiSendQuoteRequest\n */\n readonly recvWindow?: number | bigint;\n}\n\n/**\n * TradeApi - object-oriented interface\n * @class TradeApi\n */\nexport class TradeApi implements TradeApiInterface {\n private readonly configuration: ConfigurationRestAPI;\n private localVarAxiosParamCreator;\n\n constructor(configuration: ConfigurationRestAPI) {\n this.configuration = configuration;\n this.localVarAxiosParamCreator = TradeApiAxiosParamCreator(configuration);\n }\n\n /**\n * Accept the offered quote by quote ID.\n *\n * Weight: 500(UID)\n *\n * @summary Accept Quote (TRADE)\n * @param {AcceptQuoteRequest} requestParameters Request parameters.\n * @returns {Promise<RestApiResponse<AcceptQuoteResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof TradeApi\n * @see {@link https://developers.binance.com/docs/convert/trade/Accept-Quote Binance API Documentation}\n */\n public async acceptQuote(\n requestParameters: AcceptQuoteRequest\n ): Promise<RestApiResponse<AcceptQuoteResponse>> {\n const localVarAxiosArgs = await this.localVarAxiosParamCreator.acceptQuote(\n requestParameters?.quoteId,\n requestParameters?.recvWindow\n );\n return sendRequest<AcceptQuoteResponse>(\n this.configuration,\n localVarAxiosArgs.endpoint,\n localVarAxiosArgs.method,\n localVarAxiosArgs.params,\n localVarAxiosArgs?.timeUnit,\n { isSigned: true }\n );\n }\n\n /**\n * Enable users to cancel a limit order\n *\n * Weight: 200(UID)\n *\n * @summary Cancel limit order (USER_DATA)\n * @param {CancelLimitOrderRequest} requestParameters Request parameters.\n * @returns {Promise<RestApiResponse<CancelLimitOrderResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof TradeApi\n * @see {@link https://developers.binance.com/docs/convert/trade/Cancel-Order Binance API Documentation}\n */\n public async cancelLimitOrder(\n requestParameters: CancelLimitOrderRequest\n ): Promise<RestApiResponse<CancelLimitOrderResponse>> {\n const localVarAxiosArgs = await this.localVarAxiosParamCreator.cancelLimitOrder(\n requestParameters?.orderId,\n requestParameters?.recvWindow\n );\n return sendRequest<CancelLimitOrderResponse>(\n this.configuration,\n localVarAxiosArgs.endpoint,\n localVarAxiosArgs.method,\n localVarAxiosArgs.params,\n localVarAxiosArgs?.timeUnit,\n { isSigned: true }\n );\n }\n\n /**\n * Get Convert Trade History\n *\n * The max interval between startTime and endTime is 30 days.\n *\n * Weight: 3000\n *\n * @summary Get Convert Trade History(USER_DATA)\n * @param {GetConvertTradeHistoryRequest} requestParameters Request parameters.\n * @returns {Promise<RestApiResponse<GetConvertTradeHistoryResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof TradeApi\n * @see {@link https://developers.binance.com/docs/convert/trade/Get-Convert-Trade-History Binance API Documentation}\n */\n public async getConvertTradeHistory(\n requestParameters: GetConvertTradeHistoryRequest\n ): Promise<RestApiResponse<GetConvertTradeHistoryResponse>> {\n const localVarAxiosArgs = await this.localVarAxiosParamCreator.getConvertTradeHistory(\n requestParameters?.startTime,\n requestParameters?.endTime,\n requestParameters?.limit,\n requestParameters?.recvWindow\n );\n return sendRequest<GetConvertTradeHistoryResponse>(\n this.configuration,\n localVarAxiosArgs.endpoint,\n localVarAxiosArgs.method,\n localVarAxiosArgs.params,\n localVarAxiosArgs?.timeUnit,\n { isSigned: true }\n );\n }\n\n /**\n * Query order status by order ID.\n *\n * Weight: 100(UID)\n *\n * @summary Order status(USER_DATA)\n * @param {OrderStatusRequest} requestParameters Request parameters.\n * @returns {Promise<RestApiResponse<OrderStatusResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof TradeApi\n * @see {@link https://developers.binance.com/docs/convert/trade/Order-Status Binance API Documentation}\n */\n public async orderStatus(\n requestParameters: OrderStatusRequest = {}\n ): Promise<RestApiResponse<OrderStatusResponse>> {\n const localVarAxiosArgs = await this.localVarAxiosParamCreator.orderStatus(\n requestParameters?.orderId,\n requestParameters?.quoteId\n );\n return sendRequest<OrderStatusResponse>(\n this.configuration,\n localVarAxiosArgs.endpoint,\n localVarAxiosArgs.method,\n localVarAxiosArgs.params,\n localVarAxiosArgs?.timeUnit,\n { isSigned: true }\n );\n }\n\n /**\n * Enable users to place a limit order\n *\n * `baseAsset` or `quoteAsset` can be determined via `exchangeInfo` endpoint.\n * Limit price is defined from `baseAsset` to `quoteAsset`.\n * Either `baseAmount` or `quoteAmount` is used.\n *\n * Weight: 500(UID)\n *\n * @summary Place limit order (USER_DATA)\n * @param {PlaceLimitOrderRequest} requestParameters Request parameters.\n * @returns {Promise<RestApiResponse<PlaceLimitOrderResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof TradeApi\n * @see {@link https://developers.binance.com/docs/convert/trade/Place-Order Binance API Documentation}\n */\n public async placeLimitOrder(\n requestParameters: PlaceLimitOrderRequest\n ): Promise<RestApiResponse<PlaceLimitOrderResponse>> {\n const localVarAxiosArgs = await this.localVarAxiosParamCreator.placeLimitOrder(\n requestParameters?.baseAsset,\n requestParameters?.quoteAsset,\n requestParameters?.limitPrice,\n requestParameters?.side,\n requestParameters?.expiredType,\n requestParameters?.baseAmount,\n requestParameters?.quoteAmount,\n requestParameters?.walletType,\n requestParameters?.recvWindow\n );\n return sendRequest<PlaceLimitOrderResponse>(\n this.configuration,\n localVarAxiosArgs.endpoint,\n localVarAxiosArgs.method,\n localVarAxiosArgs.params,\n localVarAxiosArgs?.timeUnit,\n { isSigned: true }\n );\n }\n\n /**\n * Request a quote for the requested token pairs\n *\n * Weight: 3000(UID)\n *\n * @summary Query limit open orders (USER_DATA)\n * @param {QueryLimitOpenOrdersRequest} requestParameters Request parameters.\n * @returns {Promise<RestApiResponse<QueryLimitOpenOrdersResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof TradeApi\n * @see {@link https://developers.binance.com/docs/convert/trade/Query-Order Binance API Documentation}\n */\n public async queryLimitOpenOrders(\n requestParameters: QueryLimitOpenOrdersRequest = {}\n ): Promise<RestApiResponse<QueryLimitOpenOrdersResponse>> {\n const localVarAxiosArgs = await this.localVarAxiosParamCreator.queryLimitOpenOrders(\n requestParameters?.recvWindow\n );\n return sendRequest<QueryLimitOpenOrdersResponse>(\n this.configuration,\n localVarAxiosArgs.endpoint,\n localVarAxiosArgs.method,\n localVarAxiosArgs.params,\n localVarAxiosArgs?.timeUnit,\n { isSigned: true }\n );\n }\n\n /**\n * Request a quote for the requested token pairs\n *\n * Either fromAmount or toAmount should be sent\n * `quoteId` will be returned only if you have enough funds to convert\n *\n * Weight: 200(UID)\n *\n * @summary Send Quote Request(USER_DATA)\n * @param {SendQuoteRequestRequest} requestParameters Request parameters.\n * @returns {Promise<RestApiResponse<SendQuoteRequestResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof TradeApi\n * @see {@link https://developers.binance.com/docs/convert/trade/Send-quote-request Binance API Documentation}\n */\n public async sendQuoteRequest(\n requestParameters: SendQuoteRequestRequest\n ): Promise<RestApiResponse<SendQuoteRequestResponse>> {\n const localVarAxiosArgs = await this.localVarAxiosParamCreator.sendQuoteRequest(\n requestParameters?.fromAsset,\n requestParameters?.toAsset,\n requestParameters?.fromAmount,\n requestParameters?.toAmount,\n requestParameters?.walletType,\n requestParameters?.validTime,\n requestParameters?.recvWindow\n );\n return sendRequest<SendQuoteRequestResponse>(\n this.configuration,\n localVarAxiosArgs.endpoint,\n localVarAxiosArgs.method,\n localVarAxiosArgs.params,\n localVarAxiosArgs?.timeUnit,\n { isSigned: true }\n );\n }\n}\n","/**\n * Binance Convert REST API\n *\n * OpenAPI Specification for the Binance Convert 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 { ConfigurationRestAPI, RestApiResponse, sendRequest } from '@binance/common';\nimport { MarketDataApi } from './modules/market-data-api';\nimport { TradeApi } from './modules/trade-api';\n\nimport type {\n ListAllConvertPairsRequest,\n QueryOrderQuantityPrecisionPerAssetRequest,\n} from './modules/market-data-api';\nimport type {\n AcceptQuoteRequest,\n CancelLimitOrderRequest,\n GetConvertTradeHistoryRequest,\n OrderStatusRequest,\n PlaceLimitOrderRequest,\n QueryLimitOpenOrdersRequest,\n SendQuoteRequestRequest,\n} from './modules/trade-api';\n\nimport type {\n ListAllConvertPairsResponse,\n QueryOrderQuantityPrecisionPerAssetResponse,\n} from './types';\nimport type {\n AcceptQuoteResponse,\n CancelLimitOrderResponse,\n GetConvertTradeHistoryResponse,\n OrderStatusResponse,\n PlaceLimitOrderResponse,\n QueryLimitOpenOrdersResponse,\n SendQuoteRequestResponse,\n} from './types';\n\nexport class RestAPI {\n private configuration: ConfigurationRestAPI;\n private marketDataApi: MarketDataApi;\n private tradeApi: TradeApi;\n\n constructor(configuration: ConfigurationRestAPI) {\n this.configuration = configuration;\n this.marketDataApi = new MarketDataApi(configuration);\n this.tradeApi = new TradeApi(configuration);\n }\n\n /**\n * Generic function to send a request.\n * @param endpoint - The API endpoint to call.\n * @param method - HTTP method to use (GET, POST, DELETE, etc.).\n * @param params - Query parameters for the request.\n *\n * @returns A promise resolving to the response data object.\n */\n sendRequest<T>(\n endpoint: string,\n method: 'GET' | 'POST' | 'DELETE' | 'PUT' | 'PATCH',\n params: Record<string, unknown> = {}\n ): Promise<RestApiResponse<T>> {\n return sendRequest<T>(this.configuration, endpoint, method, params, undefined);\n }\n\n /**\n * Generic function to send a signed request.\n * @param endpoint - The API endpoint to call.\n * @param method - HTTP method to use (GET, POST, DELETE, etc.).\n * @param params - Query parameters for the request.\n *\n * @returns A promise resolving to the response data object.\n */\n sendSignedRequest<T>(\n endpoint: string,\n method: 'GET' | 'POST' | 'DELETE' | 'PUT' | 'PATCH',\n params: Record<string, unknown> = {}\n ): Promise<RestApiResponse<T>> {\n return sendRequest<T>(this.configuration, endpoint, method, params, undefined, {\n isSigned: true,\n });\n }\n\n /**\n * Query for all convertible token pairs and the tokens’ respective upper/lower limits\n *\n * User needs to supply either or both of the input parameter\n * If not defined for both fromAsset and toAsset, only partial token pairs will be returned\n *\n * Weight: 3000(IP)\n *\n * @summary List All Convert Pairs\n * @param {ListAllConvertPairsRequest} requestParameters Request parameters.\n *\n * @returns {Promise<RestApiResponse<ListAllConvertPairsResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @see {@link https://developers.binance.com/docs/convert/market-data/ Binance API Documentation}\n */\n listAllConvertPairs(\n requestParameters: ListAllConvertPairsRequest = {}\n ): Promise<RestApiResponse<ListAllConvertPairsResponse>> {\n return this.marketDataApi.listAllConvertPairs(requestParameters);\n }\n\n /**\n * Query for supported asset’s precision information\n *\n * Weight: 100(IP)\n *\n * @summary Query order quantity precision per asset(USER_DATA)\n * @param {QueryOrderQuantityPrecisionPerAssetRequest} requestParameters Request parameters.\n *\n * @returns {Promise<RestApiResponse<QueryOrderQuantityPrecisionPerAssetResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @see {@link https://developers.binance.com/docs/convert/market-data/Query-order-quantity-precision-per-asset Binance API Documentation}\n */\n queryOrderQuantityPrecisionPerAsset(\n requestParameters: QueryOrderQuantityPrecisionPerAssetRequest = {}\n ): Promise<RestApiResponse<QueryOrderQuantityPrecisionPerAssetResponse>> {\n return this.marketDataApi.queryOrderQuantityPrecisionPerAsset(requestParameters);\n }\n\n /**\n * Accept the offered quote by quote ID.\n *\n * Weight: 500(UID)\n *\n * @summary Accept Quote (TRADE)\n * @param {AcceptQuoteRequest} requestParameters Request parameters.\n *\n * @returns {Promise<RestApiResponse<AcceptQuoteResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @see {@link https://developers.binance.com/docs/convert/trade/Accept-Quote Binance API Documentation}\n */\n acceptQuote(\n requestParameters: AcceptQuoteRequest\n ): Promise<RestApiResponse<AcceptQuoteResponse>> {\n return this.tradeApi.acceptQuote(requestParameters);\n }\n\n /**\n * Enable users to cancel a limit order\n *\n * Weight: 200(UID)\n *\n * @summary Cancel limit order (USER_DATA)\n * @param {CancelLimitOrderRequest} requestParameters Request parameters.\n *\n * @returns {Promise<RestApiResponse<CancelLimitOrderResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @see {@link https://developers.binance.com/docs/convert/trade/Cancel-Order Binance API Documentation}\n */\n cancelLimitOrder(\n requestParameters: CancelLimitOrderRequest\n ): Promise<RestApiResponse<CancelLimitOrderResponse>> {\n return this.tradeApi.cancelLimitOrder(requestParameters);\n }\n\n /**\n * Get Convert Trade History\n *\n * The max interval between startTime and endTime is 30 days.\n *\n * Weight: 3000\n *\n * @summary Get Convert Trade History(USER_DATA)\n * @param {GetConvertTradeHistoryRequest} requestParameters Request parameters.\n *\n * @returns {Promise<RestApiResponse<GetConvertTradeHistoryResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @see {@link https://developers.binance.com/docs/convert/trade/Get-Convert-Trade-History Binance API Documentation}\n */\n getConvertTradeHistory(\n requestParameters: GetConvertTradeHistoryRequest\n ): Promise<RestApiResponse<GetConvertTradeHistoryResponse>> {\n return this.tradeApi.getConvertTradeHistory(requestParameters);\n }\n\n /**\n * Query order status by order ID.\n *\n * Weight: 100(UID)\n *\n * @summary Order status(USER_DATA)\n * @param {OrderStatusRequest} requestParameters Request parameters.\n *\n * @returns {Promise<RestApiResponse<OrderStatusResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @see {@link https://developers.binance.com/docs/convert/trade/Order-Status Binance API Documentation}\n */\n orderStatus(\n requestParameters: OrderStatusRequest = {}\n ): Promise<RestApiResponse<OrderStatusResponse>> {\n return this.tradeApi.orderStatus(requestParameters);\n }\n\n /**\n * Enable users to place a limit order\n *\n * `baseAsset` or `quoteAsset` can be determined via `exchangeInfo` endpoint.\n * Limit price is defined from `baseAsset` to `quoteAsset`.\n * Either `baseAmount` or `quoteAmount` is used.\n *\n * Weight: 500(UID)\n *\n * @summary Place limit order (USER_DATA)\n * @param {PlaceLimitOrderRequest} requestParameters Request parameters.\n *\n * @returns {Promise<RestApiResponse<PlaceLimitOrderResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @see {@link https://developers.binance.com/docs/convert/trade/Place-Order Binance API Documentation}\n */\n placeLimitOrder(\n requestParameters: PlaceLimitOrderRequest\n ): Promise<RestApiResponse<PlaceLimitOrderResponse>> {\n return this.tradeApi.placeLimitOrder(requestParameters);\n }\n\n /**\n * Request a quote for the requested token pairs\n *\n * Weight: 3000(UID)\n *\n * @summary Query limit open orders (USER_DATA)\n * @param {QueryLimitOpenOrdersRequest} requestParameters Request parameters.\n *\n * @returns {Promise<RestApiResponse<QueryLimitOpenOrdersResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @see {@link https://developers.binance.com/docs/convert/trade/Query-Order Binance API Documentation}\n */\n queryLimitOpenOrders(\n requestParameters: QueryLimitOpenOrdersRequest = {}\n ): Promise<RestApiResponse<QueryLimitOpenOrdersResponse>> {\n return this.tradeApi.queryLimitOpenOrders(requestParameters);\n }\n\n /**\n * Request a quote for the requested token pairs\n *\n * Either fromAmount or toAmount should be sent\n * `quoteId` will be returned only if you have enough funds to convert\n *\n * Weight: 200(UID)\n *\n * @summary Send Quote Request(USER_DATA)\n * @param {SendQuoteRequestRequest} requestParameters Request parameters.\n *\n * @returns {Promise<RestApiResponse<SendQuoteRequestResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @see {@link https://developers.binance.com/docs/convert/trade/Send-quote-request Binance API Documentation}\n */\n sendQuoteRequest(\n requestParameters: SendQuoteRequestRequest\n ): Promise<RestApiResponse<SendQuoteRequestResponse>> {\n return this.tradeApi.sendQuoteRequest(requestParameters);\n }\n}\n","/**\n * Binance Convert REST API\n *\n * OpenAPI Specification for the Binance Convert 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\nexport * from './types';\nexport * from './modules';\nexport * from './rest-api';\n","import { buildUserAgent, ConfigurationRestAPI, CONVERT_REST_API_PROD_URL } from '@binance/common';\nimport { name, version } from '../package.json';\nimport { RestAPI } from './rest-api';\n\nexport interface ConfigurationConvert {\n configurationRestAPI?: ConfigurationRestAPI;\n}\n\nexport class Convert {\n public restAPI!: RestAPI;\n\n constructor(config: ConfigurationConvert) {\n const userAgent = buildUserAgent(name, version);\n\n if (config?.configurationRestAPI) {\n const configRestAPI = new ConfigurationRestAPI(\n config.configurationRestAPI\n ) as ConfigurationRestAPI & {\n baseOptions: Record<string, unknown>;\n };\n configRestAPI.basePath = configRestAPI.basePath || CONVERT_REST_API_PROD_URL;\n configRestAPI.baseOptions = configRestAPI.baseOptions || {};\n configRestAPI.baseOptions.headers = {\n ...(configRestAPI.baseOptions.headers || {}),\n 'User-Agent': userAgent,\n };\n this.restAPI = new RestAPI(configRestAPI);\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;WACY;cAEG;;;;;;;;;;;;;;;;;;;ACyBf,MAAM,iCAAiC,SAAU,eAAqC;AAClF,QAAO;EAeH,qBAAqB,OAAO,WAAoB,YAA2C;GACvF,MAAMA,yBAAkD,EAAE;AAE1D,OAAI,cAAc,UAAa,cAAc,KACzC,wBAAuB,eAAe;AAG1C,OAAI,YAAY,UAAa,YAAY,KACrC,wBAAuB,aAAa;GAGxC,IAAIC;AACJ,OAAI,cAAc,cAAe,aAAY,cAAc;AAE3D,UAAO;IACH,UAAU;IACV,QAAQ;IACR,QAAQ;IACR,UAAU;IACb;;EAYL,qCAAqC,OACjC,eACuB;GACvB,MAAMD,yBAAkD,EAAE;AAE1D,OAAI,eAAe,UAAa,eAAe,KAC3C,wBAAuB,gBAAgB;GAG3C,IAAIC;AACJ,OAAI,cAAc,cAAe,aAAY,cAAc;AAE3D,UAAO;IACH,UAAU;IACV,QAAQ;IACR,QAAQ;IACR,UAAU;IACb;;EAER;;;;;;AA8EL,IAAa,gBAAb,MAA6D;CAIzD,YAAY,eAAqC;AAC7C,OAAK,gBAAgB;AACrB,OAAK,4BAA4B,+BAA+B,cAAc;;;;;;;;;;;;;;;;;CAkBlF,MAAa,oBACT,oBAAgD,EAAE,EACG;EACrD,MAAM,oBAAoB,MAAM,KAAK,0BAA0B,oBAC3D,mBAAmB,WACnB,mBAAmB,QACtB;AACD,2CACI,KAAK,eACL,kBAAkB,UAClB,kBAAkB,QAClB,kBAAkB,QAClB,mBAAmB,UACnB,EAAE,UAAU,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;;;;;;;;;;;CAelE,YACI,oBAAwC,EAAE,EACG;AAC7C,SAAO,KAAK,SAAS,YAAY,kBAAkB;;;;;;;;;;;;;;;;;;CAmBvD,gBACI,mBACiD;AACjD,SAAO,KAAK,SAAS,gBAAgB,kBAAkB;;;;;;;;;;;;;;CAe3D,qBACI,oBAAiD,EAAE,EACG;AACtD,SAAO,KAAK,SAAS,qBAAqB,kBAAkB;;;;;;;;;;;;;;;;;CAkBhE,iBACI,mBACkD;AAClD,SAAO,KAAK,SAAS,iBAAiB,kBAAkB;;;;;;;;;;;;;;AE7PhE,IAAa,UAAb,MAAqB;CAGjB,YAAY,QAA8B;EACtC,MAAM,iDAA2B,MAAM,QAAQ;AAE/C,MAAI,QAAQ,sBAAsB;GAC9B,MAAM,gBAAgB,IAAIC,sCACtB,OAAO,qBACV;AAGD,iBAAc,WAAW,cAAc,YAAYC;AACnD,iBAAc,cAAc,cAAc,eAAe,EAAE;AAC3D,iBAAc,YAAY,UAAU;IAChC,GAAI,cAAc,YAAY,WAAW,EAAE;IAC3C,cAAc;IACjB;AACD,QAAK,UAAU,IAAI,QAAQ,cAAc"}
1
+ {"version":3,"file":"index.js","names":["localVarQueryParameter: Record<string, unknown>","localVarBodyParameter: Record<string, unknown>","_timeUnit: TimeUnit | undefined","localVarQueryParameter: Record<string, unknown>","localVarBodyParameter: Record<string, unknown>","_timeUnit: TimeUnit | undefined","ConfigurationRestAPI","CONVERT_REST_API_PROD_URL"],"sources":["../package.json","../src/rest-api/modules/market-data-api.ts","../src/rest-api/modules/trade-api.ts","../src/rest-api/rest-api.ts","../src/rest-api/index.ts","../src/convert.ts"],"sourcesContent":["{\n \"name\": \"@binance/convert\",\n \"description\": \"Official Binance Convert Connector - A lightweight library that provides a convenient interface to Binance's Convert REST API.\",\n \"version\": \"4.1.0\",\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 \"Convert\",\n \"Connector\",\n \"REST\",\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.1.0\",\n \"axios\": \"^1.7.4\"\n }\n}\n","/**\n * Binance Convert REST API\n *\n * OpenAPI Specification for the Binance Convert 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 sendRequest,\n type RequestArgs,\n} from '@binance/common';\nimport type {\n ListAllConvertPairsResponse,\n QueryOrderQuantityPrecisionPerAssetResponse,\n} from '../types';\n\n/**\n * MarketDataApi - axios parameter creator\n */\nconst MarketDataApiAxiosParamCreator = function (configuration: ConfigurationRestAPI) {\n return {\n /**\n * Query for all convertible token pairs and the tokens’ respective upper/lower limits\n *\n * User needs to supply either or both of the input parameter\n * If not defined for both fromAsset and toAsset, only partial token pairs will be returned\n *\n * Weight: 3000(IP)\n *\n * @summary List All Convert Pairs\n * @param {string} [fromAsset] User spends coin\n * @param {string} [toAsset] User receives coin\n *\n * @throws {RequiredError}\n */\n listAllConvertPairs: async (fromAsset?: string, toAsset?: string): Promise<RequestArgs> => {\n const localVarQueryParameter: Record<string, unknown> = {};\n const localVarBodyParameter: Record<string, unknown> = {};\n\n if (fromAsset !== undefined && fromAsset !== null) {\n localVarQueryParameter['fromAsset'] = fromAsset;\n }\n if (toAsset !== undefined && toAsset !== null) {\n localVarQueryParameter['toAsset'] = toAsset;\n }\n\n let _timeUnit: TimeUnit | undefined;\n if ('timeUnit' in configuration) _timeUnit = configuration.timeUnit as TimeUnit;\n\n return {\n endpoint: '/sapi/v1/convert/exchangeInfo',\n method: 'GET',\n queryParams: localVarQueryParameter,\n bodyParams: localVarBodyParameter,\n timeUnit: _timeUnit,\n };\n },\n /**\n * Query for supported asset’s precision information\n *\n * Weight: 100(IP)\n *\n * @summary Query order quantity precision per asset(USER_DATA)\n * @param {number | bigint} [recvWindow] The value cannot be greater than 60000\n *\n * @throws {RequiredError}\n */\n queryOrderQuantityPrecisionPerAsset: 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: '/sapi/v1/convert/assetInfo',\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 * Query for all convertible token pairs and the tokens’ respective upper/lower limits\n *\n * User needs to supply either or both of the input parameter\n * If not defined for both fromAsset and toAsset, only partial token pairs will be returned\n *\n * Weight: 3000(IP)\n *\n * @summary List All Convert Pairs\n * @param {ListAllConvertPairsRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof MarketDataApiInterface\n */\n listAllConvertPairs(\n requestParameters?: ListAllConvertPairsRequest\n ): Promise<RestApiResponse<ListAllConvertPairsResponse>>;\n /**\n * Query for supported asset’s precision information\n *\n * Weight: 100(IP)\n *\n * @summary Query order quantity precision per asset(USER_DATA)\n * @param {QueryOrderQuantityPrecisionPerAssetRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof MarketDataApiInterface\n */\n queryOrderQuantityPrecisionPerAsset(\n requestParameters?: QueryOrderQuantityPrecisionPerAssetRequest\n ): Promise<RestApiResponse<QueryOrderQuantityPrecisionPerAssetResponse>>;\n}\n\n/**\n * Request parameters for listAllConvertPairs operation in MarketDataApi.\n * @interface ListAllConvertPairsRequest\n */\nexport interface ListAllConvertPairsRequest {\n /**\n * User spends coin\n * @type {string}\n * @memberof MarketDataApiListAllConvertPairs\n */\n readonly fromAsset?: string;\n\n /**\n * User receives coin\n * @type {string}\n * @memberof MarketDataApiListAllConvertPairs\n */\n readonly toAsset?: string;\n}\n\n/**\n * Request parameters for queryOrderQuantityPrecisionPerAsset operation in MarketDataApi.\n * @interface QueryOrderQuantityPrecisionPerAssetRequest\n */\nexport interface QueryOrderQuantityPrecisionPerAssetRequest {\n /**\n * The value cannot be greater than 60000\n * @type {number | bigint}\n * @memberof MarketDataApiQueryOrderQuantityPrecisionPerAsset\n */\n readonly recvWindow?: number | bigint;\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 * Query for all convertible token pairs and the tokens’ respective upper/lower limits\n *\n * User needs to supply either or both of the input parameter\n * If not defined for both fromAsset and toAsset, only partial token pairs will be returned\n *\n * Weight: 3000(IP)\n *\n * @summary List All Convert Pairs\n * @param {ListAllConvertPairsRequest} requestParameters Request parameters.\n * @returns {Promise<RestApiResponse<ListAllConvertPairsResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof MarketDataApi\n * @see {@link https://developers.binance.com/docs/convert/market-data/ Binance API Documentation}\n */\n public async listAllConvertPairs(\n requestParameters: ListAllConvertPairsRequest = {}\n ): Promise<RestApiResponse<ListAllConvertPairsResponse>> {\n const localVarAxiosArgs = await this.localVarAxiosParamCreator.listAllConvertPairs(\n requestParameters?.fromAsset,\n requestParameters?.toAsset\n );\n return sendRequest<ListAllConvertPairsResponse>(\n this.configuration,\n localVarAxiosArgs.endpoint,\n localVarAxiosArgs.method,\n localVarAxiosArgs.queryParams,\n localVarAxiosArgs.bodyParams,\n localVarAxiosArgs?.timeUnit,\n { isSigned: false }\n );\n }\n\n /**\n * Query for supported asset’s precision information\n *\n * Weight: 100(IP)\n *\n * @summary Query order quantity precision per asset(USER_DATA)\n * @param {QueryOrderQuantityPrecisionPerAssetRequest} requestParameters Request parameters.\n * @returns {Promise<RestApiResponse<QueryOrderQuantityPrecisionPerAssetResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof MarketDataApi\n * @see {@link https://developers.binance.com/docs/convert/market-data/Query-order-quantity-precision-per-asset Binance API Documentation}\n */\n public async queryOrderQuantityPrecisionPerAsset(\n requestParameters: QueryOrderQuantityPrecisionPerAssetRequest = {}\n ): Promise<RestApiResponse<QueryOrderQuantityPrecisionPerAssetResponse>> {\n const localVarAxiosArgs =\n await this.localVarAxiosParamCreator.queryOrderQuantityPrecisionPerAsset(\n requestParameters?.recvWindow\n );\n return sendRequest<QueryOrderQuantityPrecisionPerAssetResponse>(\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 Convert REST API\n *\n * OpenAPI Specification for the Binance Convert 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 AcceptQuoteResponse,\n CancelLimitOrderResponse,\n GetConvertTradeHistoryResponse,\n OrderStatusResponse,\n PlaceLimitOrderResponse,\n QueryLimitOpenOrdersResponse,\n SendQuoteRequestResponse,\n} from '../types';\n\n/**\n * TradeApi - axios parameter creator\n */\nconst TradeApiAxiosParamCreator = function (configuration: ConfigurationRestAPI) {\n return {\n /**\n * Accept the offered quote by quote ID.\n *\n * Weight: 500(UID)\n *\n * @summary Accept Quote (TRADE)\n * @param {string} quoteId\n * @param {number | bigint} [recvWindow] The value cannot be greater than 60000\n *\n * @throws {RequiredError}\n */\n acceptQuote: async (\n quoteId: string,\n recvWindow?: number | bigint\n ): Promise<RequestArgs> => {\n // verify required parameter 'quoteId' is not null or undefined\n assertParamExists('acceptQuote', 'quoteId', quoteId);\n\n const localVarQueryParameter: Record<string, unknown> = {};\n const localVarBodyParameter: Record<string, unknown> = {};\n\n if (quoteId !== undefined && quoteId !== null) {\n localVarQueryParameter['quoteId'] = quoteId;\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: '/sapi/v1/convert/acceptQuote',\n method: 'POST',\n queryParams: localVarQueryParameter,\n bodyParams: localVarBodyParameter,\n timeUnit: _timeUnit,\n };\n },\n /**\n * Enable users to cancel a limit order\n *\n * Weight: 200(UID)\n *\n * @summary Cancel limit order (USER_DATA)\n * @param {number | bigint} orderId The orderId from `placeOrder` api\n * @param {number | bigint} [recvWindow] The value cannot be greater than 60000\n *\n * @throws {RequiredError}\n */\n cancelLimitOrder: async (\n orderId: number | bigint,\n recvWindow?: number | bigint\n ): Promise<RequestArgs> => {\n // verify required parameter 'orderId' is not null or undefined\n assertParamExists('cancelLimitOrder', 'orderId', orderId);\n\n const localVarQueryParameter: Record<string, unknown> = {};\n const localVarBodyParameter: Record<string, unknown> = {};\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: '/sapi/v1/convert/limit/cancelOrder',\n method: 'POST',\n queryParams: localVarQueryParameter,\n bodyParams: localVarBodyParameter,\n timeUnit: _timeUnit,\n };\n },\n /**\n * Get Convert Trade History\n *\n * The max interval between startTime and endTime is 30 days.\n *\n * Weight: 3000\n *\n * @summary Get Convert Trade History(USER_DATA)\n * @param {number | bigint} startTime\n * @param {number | bigint} endTime\n * @param {number | bigint} [limit] Default 100, Max 1000\n * @param {number | bigint} [recvWindow] The value cannot be greater than 60000\n *\n * @throws {RequiredError}\n */\n getConvertTradeHistory: async (\n startTime: number | bigint,\n endTime: number | bigint,\n limit?: number | bigint,\n recvWindow?: number | bigint\n ): Promise<RequestArgs> => {\n // verify required parameter 'startTime' is not null or undefined\n assertParamExists('getConvertTradeHistory', 'startTime', startTime);\n // verify required parameter 'endTime' is not null or undefined\n assertParamExists('getConvertTradeHistory', 'endTime', endTime);\n\n const localVarQueryParameter: Record<string, unknown> = {};\n const localVarBodyParameter: Record<string, unknown> = {};\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: '/sapi/v1/convert/tradeFlow',\n method: 'GET',\n queryParams: localVarQueryParameter,\n bodyParams: localVarBodyParameter,\n timeUnit: _timeUnit,\n };\n },\n /**\n * Query order status by order ID.\n *\n * Weight: 100(UID)\n *\n * @summary Order status(USER_DATA)\n * @param {string} [orderId] Either orderId or quoteId is required\n * @param {string} [quoteId] Either orderId or quoteId is required\n *\n * @throws {RequiredError}\n */\n orderStatus: async (orderId?: string, quoteId?: string): Promise<RequestArgs> => {\n const localVarQueryParameter: Record<string, unknown> = {};\n const localVarBodyParameter: Record<string, unknown> = {};\n\n if (orderId !== undefined && orderId !== null) {\n localVarQueryParameter['orderId'] = orderId;\n }\n if (quoteId !== undefined && quoteId !== null) {\n localVarQueryParameter['quoteId'] = quoteId;\n }\n\n let _timeUnit: TimeUnit | undefined;\n if ('timeUnit' in configuration) _timeUnit = configuration.timeUnit as TimeUnit;\n\n return {\n endpoint: '/sapi/v1/convert/orderStatus',\n method: 'GET',\n queryParams: localVarQueryParameter,\n bodyParams: localVarBodyParameter,\n timeUnit: _timeUnit,\n };\n },\n /**\n * Enable users to place a limit order\n *\n * `baseAsset` or `quoteAsset` can be determined via `exchangeInfo` endpoint.\n * Limit price is defined from `baseAsset` to `quoteAsset`.\n * Either `baseAmount` or `quoteAmount` is used.\n *\n * Weight: 500(UID)\n *\n * @summary Place limit order (USER_DATA)\n * @param {string} baseAsset base asset (use the response `fromIsBase` from `GET /sapi/v1/convert/exchangeInfo` api to check which one is baseAsset )\n * @param {string} quoteAsset quote asset\n * @param {number} limitPrice Symbol limit price (from baseAsset to quoteAsset)\n * @param {string} side `BUY` or `SELL`\n * @param {string} expiredType 1_D, 3_D, 7_D, 30_D (D means day)\n * @param {number} [baseAmount] Base asset amount. (One of `baseAmount` or `quoteAmount` is required)\n * @param {number} [quoteAmount] Quote asset amount. (One of `baseAmount` or `quoteAmount` is required)\n * @param {string} [walletType] It is to choose which wallet of assets. The wallet selection is `SPOT`, `FUNDING` and `EARN`. Combination of wallet is supported i.e. `SPOT_FUNDING`, `FUNDING_EARN`, `SPOT_FUNDING_EARN` or `SPOT_EARN` Default is `SPOT`.\n * @param {number | bigint} [recvWindow] The value cannot be greater than 60000\n *\n * @throws {RequiredError}\n */\n placeLimitOrder: async (\n baseAsset: string,\n quoteAsset: string,\n limitPrice: number,\n side: string,\n expiredType: string,\n baseAmount?: number,\n quoteAmount?: number,\n walletType?: string,\n recvWindow?: number | bigint\n ): Promise<RequestArgs> => {\n // verify required parameter 'baseAsset' is not null or undefined\n assertParamExists('placeLimitOrder', 'baseAsset', baseAsset);\n // verify required parameter 'quoteAsset' is not null or undefined\n assertParamExists('placeLimitOrder', 'quoteAsset', quoteAsset);\n // verify required parameter 'limitPrice' is not null or undefined\n assertParamExists('placeLimitOrder', 'limitPrice', limitPrice);\n // verify required parameter 'side' is not null or undefined\n assertParamExists('placeLimitOrder', 'side', side);\n // verify required parameter 'expiredType' is not null or undefined\n assertParamExists('placeLimitOrder', 'expiredType', expiredType);\n\n const localVarQueryParameter: Record<string, unknown> = {};\n const localVarBodyParameter: Record<string, unknown> = {};\n\n if (baseAsset !== undefined && baseAsset !== null) {\n localVarQueryParameter['baseAsset'] = baseAsset;\n }\n if (quoteAsset !== undefined && quoteAsset !== null) {\n localVarQueryParameter['quoteAsset'] = quoteAsset;\n }\n if (limitPrice !== undefined && limitPrice !== null) {\n localVarQueryParameter['limitPrice'] = limitPrice;\n }\n if (baseAmount !== undefined && baseAmount !== null) {\n localVarQueryParameter['baseAmount'] = baseAmount;\n }\n if (quoteAmount !== undefined && quoteAmount !== null) {\n localVarQueryParameter['quoteAmount'] = quoteAmount;\n }\n if (side !== undefined && side !== null) {\n localVarQueryParameter['side'] = side;\n }\n if (walletType !== undefined && walletType !== null) {\n localVarQueryParameter['walletType'] = walletType;\n }\n if (expiredType !== undefined && expiredType !== null) {\n localVarQueryParameter['expiredType'] = expiredType;\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: '/sapi/v1/convert/limit/placeOrder',\n method: 'POST',\n queryParams: localVarQueryParameter,\n bodyParams: localVarBodyParameter,\n timeUnit: _timeUnit,\n };\n },\n /**\n * Request a quote for the requested token pairs\n *\n * Weight: 3000(UID)\n *\n * @summary Query limit open orders (USER_DATA)\n * @param {number | bigint} [recvWindow] The value cannot be greater than 60000\n *\n * @throws {RequiredError}\n */\n queryLimitOpenOrders: async (recvWindow?: number | bigint): 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: '/sapi/v1/convert/limit/queryOpenOrders',\n method: 'GET',\n queryParams: localVarQueryParameter,\n bodyParams: localVarBodyParameter,\n timeUnit: _timeUnit,\n };\n },\n /**\n * Request a quote for the requested token pairs\n *\n * Either fromAmount or toAmount should be sent\n * `quoteId` will be returned only if you have enough funds to convert\n *\n * Weight: 200(UID)\n *\n * @summary Send Quote Request(USER_DATA)\n * @param {string} fromAsset\n * @param {string} toAsset\n * @param {number} [fromAmount] When specified, it is the amount you will be debited after the conversion\n * @param {number} [toAmount] When specified, it is the amount you will be credited after the conversion\n * @param {string} [walletType] It is to choose which wallet of assets. The wallet selection is `SPOT`, `FUNDING` and `EARN`. Combination of wallet is supported i.e. `SPOT_FUNDING`, `FUNDING_EARN`, `SPOT_FUNDING_EARN` or `SPOT_EARN` Default is `SPOT`.\n * @param {string} [validTime] 10s, 30s, 1m, default 10s\n * @param {number | bigint} [recvWindow] The value cannot be greater than 60000\n *\n * @throws {RequiredError}\n */\n sendQuoteRequest: async (\n fromAsset: string,\n toAsset: string,\n fromAmount?: number,\n toAmount?: number,\n walletType?: string,\n validTime?: string,\n recvWindow?: number | bigint\n ): Promise<RequestArgs> => {\n // verify required parameter 'fromAsset' is not null or undefined\n assertParamExists('sendQuoteRequest', 'fromAsset', fromAsset);\n // verify required parameter 'toAsset' is not null or undefined\n assertParamExists('sendQuoteRequest', 'toAsset', toAsset);\n\n const localVarQueryParameter: Record<string, unknown> = {};\n const localVarBodyParameter: Record<string, unknown> = {};\n\n if (fromAsset !== undefined && fromAsset !== null) {\n localVarQueryParameter['fromAsset'] = fromAsset;\n }\n if (toAsset !== undefined && toAsset !== null) {\n localVarQueryParameter['toAsset'] = toAsset;\n }\n if (fromAmount !== undefined && fromAmount !== null) {\n localVarQueryParameter['fromAmount'] = fromAmount;\n }\n if (toAmount !== undefined && toAmount !== null) {\n localVarQueryParameter['toAmount'] = toAmount;\n }\n if (walletType !== undefined && walletType !== null) {\n localVarQueryParameter['walletType'] = walletType;\n }\n if (validTime !== undefined && validTime !== null) {\n localVarQueryParameter['validTime'] = validTime;\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: '/sapi/v1/convert/getQuote',\n method: 'POST',\n queryParams: localVarQueryParameter,\n bodyParams: localVarBodyParameter,\n timeUnit: _timeUnit,\n };\n },\n };\n};\n\n/**\n * TradeApi - interface\n * @interface TradeApi\n */\nexport interface TradeApiInterface {\n /**\n * Accept the offered quote by quote ID.\n *\n * Weight: 500(UID)\n *\n * @summary Accept Quote (TRADE)\n * @param {AcceptQuoteRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof TradeApiInterface\n */\n acceptQuote(\n requestParameters: AcceptQuoteRequest\n ): Promise<RestApiResponse<AcceptQuoteResponse>>;\n /**\n * Enable users to cancel a limit order\n *\n * Weight: 200(UID)\n *\n * @summary Cancel limit order (USER_DATA)\n * @param {CancelLimitOrderRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof TradeApiInterface\n */\n cancelLimitOrder(\n requestParameters: CancelLimitOrderRequest\n ): Promise<RestApiResponse<CancelLimitOrderResponse>>;\n /**\n * Get Convert Trade History\n *\n * The max interval between startTime and endTime is 30 days.\n *\n * Weight: 3000\n *\n * @summary Get Convert Trade History(USER_DATA)\n * @param {GetConvertTradeHistoryRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof TradeApiInterface\n */\n getConvertTradeHistory(\n requestParameters: GetConvertTradeHistoryRequest\n ): Promise<RestApiResponse<GetConvertTradeHistoryResponse>>;\n /**\n * Query order status by order ID.\n *\n * Weight: 100(UID)\n *\n * @summary Order status(USER_DATA)\n * @param {OrderStatusRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof TradeApiInterface\n */\n orderStatus(\n requestParameters?: OrderStatusRequest\n ): Promise<RestApiResponse<OrderStatusResponse>>;\n /**\n * Enable users to place a limit order\n *\n * `baseAsset` or `quoteAsset` can be determined via `exchangeInfo` endpoint.\n * Limit price is defined from `baseAsset` to `quoteAsset`.\n * Either `baseAmount` or `quoteAmount` is used.\n *\n * Weight: 500(UID)\n *\n * @summary Place limit order (USER_DATA)\n * @param {PlaceLimitOrderRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof TradeApiInterface\n */\n placeLimitOrder(\n requestParameters: PlaceLimitOrderRequest\n ): Promise<RestApiResponse<PlaceLimitOrderResponse>>;\n /**\n * Request a quote for the requested token pairs\n *\n * Weight: 3000(UID)\n *\n * @summary Query limit open orders (USER_DATA)\n * @param {QueryLimitOpenOrdersRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof TradeApiInterface\n */\n queryLimitOpenOrders(\n requestParameters?: QueryLimitOpenOrdersRequest\n ): Promise<RestApiResponse<QueryLimitOpenOrdersResponse>>;\n /**\n * Request a quote for the requested token pairs\n *\n * Either fromAmount or toAmount should be sent\n * `quoteId` will be returned only if you have enough funds to convert\n *\n * Weight: 200(UID)\n *\n * @summary Send Quote Request(USER_DATA)\n * @param {SendQuoteRequestRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof TradeApiInterface\n */\n sendQuoteRequest(\n requestParameters: SendQuoteRequestRequest\n ): Promise<RestApiResponse<SendQuoteRequestResponse>>;\n}\n\n/**\n * Request parameters for acceptQuote operation in TradeApi.\n * @interface AcceptQuoteRequest\n */\nexport interface AcceptQuoteRequest {\n /**\n *\n * @type {string}\n * @memberof TradeApiAcceptQuote\n */\n readonly quoteId: string;\n\n /**\n * The value cannot be greater than 60000\n * @type {number | bigint}\n * @memberof TradeApiAcceptQuote\n */\n readonly recvWindow?: number | bigint;\n}\n\n/**\n * Request parameters for cancelLimitOrder operation in TradeApi.\n * @interface CancelLimitOrderRequest\n */\nexport interface CancelLimitOrderRequest {\n /**\n * The orderId from `placeOrder` api\n * @type {number | bigint}\n * @memberof TradeApiCancelLimitOrder\n */\n readonly orderId: number | bigint;\n\n /**\n * The value cannot be greater than 60000\n * @type {number | bigint}\n * @memberof TradeApiCancelLimitOrder\n */\n readonly recvWindow?: number | bigint;\n}\n\n/**\n * Request parameters for getConvertTradeHistory operation in TradeApi.\n * @interface GetConvertTradeHistoryRequest\n */\nexport interface GetConvertTradeHistoryRequest {\n /**\n *\n * @type {number | bigint}\n * @memberof TradeApiGetConvertTradeHistory\n */\n readonly startTime: number | bigint;\n\n /**\n *\n * @type {number | bigint}\n * @memberof TradeApiGetConvertTradeHistory\n */\n readonly endTime: number | bigint;\n\n /**\n * Default 100, Max 1000\n * @type {number | bigint}\n * @memberof TradeApiGetConvertTradeHistory\n */\n readonly limit?: number | bigint;\n\n /**\n * The value cannot be greater than 60000\n * @type {number | bigint}\n * @memberof TradeApiGetConvertTradeHistory\n */\n readonly recvWindow?: number | bigint;\n}\n\n/**\n * Request parameters for orderStatus operation in TradeApi.\n * @interface OrderStatusRequest\n */\nexport interface OrderStatusRequest {\n /**\n * Either orderId or quoteId is required\n * @type {string}\n * @memberof TradeApiOrderStatus\n */\n readonly orderId?: string;\n\n /**\n * Either orderId or quoteId is required\n * @type {string}\n * @memberof TradeApiOrderStatus\n */\n readonly quoteId?: string;\n}\n\n/**\n * Request parameters for placeLimitOrder operation in TradeApi.\n * @interface PlaceLimitOrderRequest\n */\nexport interface PlaceLimitOrderRequest {\n /**\n * base asset (use the response `fromIsBase` from `GET /sapi/v1/convert/exchangeInfo` api to check which one is baseAsset )\n * @type {string}\n * @memberof TradeApiPlaceLimitOrder\n */\n readonly baseAsset: string;\n\n /**\n * quote asset\n * @type {string}\n * @memberof TradeApiPlaceLimitOrder\n */\n readonly quoteAsset: string;\n\n /**\n * Symbol limit price (from baseAsset to quoteAsset)\n * @type {number}\n * @memberof TradeApiPlaceLimitOrder\n */\n readonly limitPrice: number;\n\n /**\n * `BUY` or `SELL`\n * @type {string}\n * @memberof TradeApiPlaceLimitOrder\n */\n readonly side: string;\n\n /**\n * 1_D, 3_D, 7_D, 30_D (D means day)\n * @type {string}\n * @memberof TradeApiPlaceLimitOrder\n */\n readonly expiredType: string;\n\n /**\n * Base asset amount. (One of `baseAmount` or `quoteAmount` is required)\n * @type {number}\n * @memberof TradeApiPlaceLimitOrder\n */\n readonly baseAmount?: number;\n\n /**\n * Quote asset amount. (One of `baseAmount` or `quoteAmount` is required)\n * @type {number}\n * @memberof TradeApiPlaceLimitOrder\n */\n readonly quoteAmount?: number;\n\n /**\n * It is to choose which wallet of assets. The wallet selection is `SPOT`, `FUNDING` and `EARN`. Combination of wallet is supported i.e. `SPOT_FUNDING`, `FUNDING_EARN`, `SPOT_FUNDING_EARN` or `SPOT_EARN` Default is `SPOT`.\n * @type {string}\n * @memberof TradeApiPlaceLimitOrder\n */\n readonly walletType?: string;\n\n /**\n * The value cannot be greater than 60000\n * @type {number | bigint}\n * @memberof TradeApiPlaceLimitOrder\n */\n readonly recvWindow?: number | bigint;\n}\n\n/**\n * Request parameters for queryLimitOpenOrders operation in TradeApi.\n * @interface QueryLimitOpenOrdersRequest\n */\nexport interface QueryLimitOpenOrdersRequest {\n /**\n * The value cannot be greater than 60000\n * @type {number | bigint}\n * @memberof TradeApiQueryLimitOpenOrders\n */\n readonly recvWindow?: number | bigint;\n}\n\n/**\n * Request parameters for sendQuoteRequest operation in TradeApi.\n * @interface SendQuoteRequestRequest\n */\nexport interface SendQuoteRequestRequest {\n /**\n *\n * @type {string}\n * @memberof TradeApiSendQuoteRequest\n */\n readonly fromAsset: string;\n\n /**\n *\n * @type {string}\n * @memberof TradeApiSendQuoteRequest\n */\n readonly toAsset: string;\n\n /**\n * When specified, it is the amount you will be debited after the conversion\n * @type {number}\n * @memberof TradeApiSendQuoteRequest\n */\n readonly fromAmount?: number;\n\n /**\n * When specified, it is the amount you will be credited after the conversion\n * @type {number}\n * @memberof TradeApiSendQuoteRequest\n */\n readonly toAmount?: number;\n\n /**\n * It is to choose which wallet of assets. The wallet selection is `SPOT`, `FUNDING` and `EARN`. Combination of wallet is supported i.e. `SPOT_FUNDING`, `FUNDING_EARN`, `SPOT_FUNDING_EARN` or `SPOT_EARN` Default is `SPOT`.\n * @type {string}\n * @memberof TradeApiSendQuoteRequest\n */\n readonly walletType?: string;\n\n /**\n * 10s, 30s, 1m, default 10s\n * @type {string}\n * @memberof TradeApiSendQuoteRequest\n */\n readonly validTime?: string;\n\n /**\n * The value cannot be greater than 60000\n * @type {number | bigint}\n * @memberof TradeApiSendQuoteRequest\n */\n readonly recvWindow?: number | bigint;\n}\n\n/**\n * TradeApi - object-oriented interface\n * @class TradeApi\n */\nexport class TradeApi implements TradeApiInterface {\n private readonly configuration: ConfigurationRestAPI;\n private localVarAxiosParamCreator;\n\n constructor(configuration: ConfigurationRestAPI) {\n this.configuration = configuration;\n this.localVarAxiosParamCreator = TradeApiAxiosParamCreator(configuration);\n }\n\n /**\n * Accept the offered quote by quote ID.\n *\n * Weight: 500(UID)\n *\n * @summary Accept Quote (TRADE)\n * @param {AcceptQuoteRequest} requestParameters Request parameters.\n * @returns {Promise<RestApiResponse<AcceptQuoteResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof TradeApi\n * @see {@link https://developers.binance.com/docs/convert/trade/Accept-Quote Binance API Documentation}\n */\n public async acceptQuote(\n requestParameters: AcceptQuoteRequest\n ): Promise<RestApiResponse<AcceptQuoteResponse>> {\n const localVarAxiosArgs = await this.localVarAxiosParamCreator.acceptQuote(\n requestParameters?.quoteId,\n requestParameters?.recvWindow\n );\n return sendRequest<AcceptQuoteResponse>(\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 * Enable users to cancel a limit order\n *\n * Weight: 200(UID)\n *\n * @summary Cancel limit order (USER_DATA)\n * @param {CancelLimitOrderRequest} requestParameters Request parameters.\n * @returns {Promise<RestApiResponse<CancelLimitOrderResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof TradeApi\n * @see {@link https://developers.binance.com/docs/convert/trade/Cancel-Order Binance API Documentation}\n */\n public async cancelLimitOrder(\n requestParameters: CancelLimitOrderRequest\n ): Promise<RestApiResponse<CancelLimitOrderResponse>> {\n const localVarAxiosArgs = await this.localVarAxiosParamCreator.cancelLimitOrder(\n requestParameters?.orderId,\n requestParameters?.recvWindow\n );\n return sendRequest<CancelLimitOrderResponse>(\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 Convert Trade History\n *\n * The max interval between startTime and endTime is 30 days.\n *\n * Weight: 3000\n *\n * @summary Get Convert Trade History(USER_DATA)\n * @param {GetConvertTradeHistoryRequest} requestParameters Request parameters.\n * @returns {Promise<RestApiResponse<GetConvertTradeHistoryResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof TradeApi\n * @see {@link https://developers.binance.com/docs/convert/trade/Get-Convert-Trade-History Binance API Documentation}\n */\n public async getConvertTradeHistory(\n requestParameters: GetConvertTradeHistoryRequest\n ): Promise<RestApiResponse<GetConvertTradeHistoryResponse>> {\n const localVarAxiosArgs = await this.localVarAxiosParamCreator.getConvertTradeHistory(\n requestParameters?.startTime,\n requestParameters?.endTime,\n requestParameters?.limit,\n requestParameters?.recvWindow\n );\n return sendRequest<GetConvertTradeHistoryResponse>(\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 * Query order status by order ID.\n *\n * Weight: 100(UID)\n *\n * @summary Order status(USER_DATA)\n * @param {OrderStatusRequest} requestParameters Request parameters.\n * @returns {Promise<RestApiResponse<OrderStatusResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof TradeApi\n * @see {@link https://developers.binance.com/docs/convert/trade/Order-Status Binance API Documentation}\n */\n public async orderStatus(\n requestParameters: OrderStatusRequest = {}\n ): Promise<RestApiResponse<OrderStatusResponse>> {\n const localVarAxiosArgs = await this.localVarAxiosParamCreator.orderStatus(\n requestParameters?.orderId,\n requestParameters?.quoteId\n );\n return sendRequest<OrderStatusResponse>(\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 * Enable users to place a limit order\n *\n * `baseAsset` or `quoteAsset` can be determined via `exchangeInfo` endpoint.\n * Limit price is defined from `baseAsset` to `quoteAsset`.\n * Either `baseAmount` or `quoteAmount` is used.\n *\n * Weight: 500(UID)\n *\n * @summary Place limit order (USER_DATA)\n * @param {PlaceLimitOrderRequest} requestParameters Request parameters.\n * @returns {Promise<RestApiResponse<PlaceLimitOrderResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof TradeApi\n * @see {@link https://developers.binance.com/docs/convert/trade/Place-Order Binance API Documentation}\n */\n public async placeLimitOrder(\n requestParameters: PlaceLimitOrderRequest\n ): Promise<RestApiResponse<PlaceLimitOrderResponse>> {\n const localVarAxiosArgs = await this.localVarAxiosParamCreator.placeLimitOrder(\n requestParameters?.baseAsset,\n requestParameters?.quoteAsset,\n requestParameters?.limitPrice,\n requestParameters?.side,\n requestParameters?.expiredType,\n requestParameters?.baseAmount,\n requestParameters?.quoteAmount,\n requestParameters?.walletType,\n requestParameters?.recvWindow\n );\n return sendRequest<PlaceLimitOrderResponse>(\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 * Request a quote for the requested token pairs\n *\n * Weight: 3000(UID)\n *\n * @summary Query limit open orders (USER_DATA)\n * @param {QueryLimitOpenOrdersRequest} requestParameters Request parameters.\n * @returns {Promise<RestApiResponse<QueryLimitOpenOrdersResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof TradeApi\n * @see {@link https://developers.binance.com/docs/convert/trade/Query-Order Binance API Documentation}\n */\n public async queryLimitOpenOrders(\n requestParameters: QueryLimitOpenOrdersRequest = {}\n ): Promise<RestApiResponse<QueryLimitOpenOrdersResponse>> {\n const localVarAxiosArgs = await this.localVarAxiosParamCreator.queryLimitOpenOrders(\n requestParameters?.recvWindow\n );\n return sendRequest<QueryLimitOpenOrdersResponse>(\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 * Request a quote for the requested token pairs\n *\n * Either fromAmount or toAmount should be sent\n * `quoteId` will be returned only if you have enough funds to convert\n *\n * Weight: 200(UID)\n *\n * @summary Send Quote Request(USER_DATA)\n * @param {SendQuoteRequestRequest} requestParameters Request parameters.\n * @returns {Promise<RestApiResponse<SendQuoteRequestResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof TradeApi\n * @see {@link https://developers.binance.com/docs/convert/trade/Send-quote-request Binance API Documentation}\n */\n public async sendQuoteRequest(\n requestParameters: SendQuoteRequestRequest\n ): Promise<RestApiResponse<SendQuoteRequestResponse>> {\n const localVarAxiosArgs = await this.localVarAxiosParamCreator.sendQuoteRequest(\n requestParameters?.fromAsset,\n requestParameters?.toAsset,\n requestParameters?.fromAmount,\n requestParameters?.toAmount,\n requestParameters?.walletType,\n requestParameters?.validTime,\n requestParameters?.recvWindow\n );\n return sendRequest<SendQuoteRequestResponse>(\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 Convert REST API\n *\n * OpenAPI Specification for the Binance Convert 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 { ConfigurationRestAPI, RestApiResponse, sendRequest } from '@binance/common';\nimport { MarketDataApi } from './modules/market-data-api';\nimport { TradeApi } from './modules/trade-api';\n\nimport type {\n ListAllConvertPairsRequest,\n QueryOrderQuantityPrecisionPerAssetRequest,\n} from './modules/market-data-api';\nimport type {\n AcceptQuoteRequest,\n CancelLimitOrderRequest,\n GetConvertTradeHistoryRequest,\n OrderStatusRequest,\n PlaceLimitOrderRequest,\n QueryLimitOpenOrdersRequest,\n SendQuoteRequestRequest,\n} from './modules/trade-api';\n\nimport type {\n ListAllConvertPairsResponse,\n QueryOrderQuantityPrecisionPerAssetResponse,\n} from './types';\nimport type {\n AcceptQuoteResponse,\n CancelLimitOrderResponse,\n GetConvertTradeHistoryResponse,\n OrderStatusResponse,\n PlaceLimitOrderResponse,\n QueryLimitOpenOrdersResponse,\n SendQuoteRequestResponse,\n} from './types';\n\nexport class RestAPI {\n private configuration: ConfigurationRestAPI;\n private marketDataApi: MarketDataApi;\n private tradeApi: TradeApi;\n\n constructor(configuration: ConfigurationRestAPI) {\n this.configuration = configuration;\n this.marketDataApi = new MarketDataApi(configuration);\n this.tradeApi = new TradeApi(configuration);\n }\n\n /**\n * Generic function to send a request.\n * @param endpoint - The API endpoint to call.\n * @param method - HTTP method to use (GET, POST, DELETE, etc.).\n * @param queryParams - Query parameters for the request.\n * @param bodyParams - Body parameters for the request.\n *\n * @returns A promise resolving to the response data object.\n */\n sendRequest<T>(\n endpoint: string,\n method: 'GET' | 'POST' | 'DELETE' | 'PUT' | 'PATCH',\n queryParams: Record<string, unknown> = {},\n bodyParams: Record<string, unknown> = {}\n ): Promise<RestApiResponse<T>> {\n return sendRequest<T>(\n this.configuration,\n endpoint,\n method,\n queryParams,\n bodyParams,\n undefined\n );\n }\n\n /**\n * Generic function to send a signed request.\n * @param endpoint - The API endpoint to call.\n * @param method - HTTP method to use (GET, POST, DELETE, etc.).\n * @param queryParams - Query parameters for the request.\n * @param bodyParams - Body parameters for the request.\n *\n * @returns A promise resolving to the response data object.\n */\n sendSignedRequest<T>(\n endpoint: string,\n method: 'GET' | 'POST' | 'DELETE' | 'PUT' | 'PATCH',\n queryParams: Record<string, unknown> = {},\n bodyParams: Record<string, unknown> = {}\n ): Promise<RestApiResponse<T>> {\n return sendRequest<T>(\n this.configuration,\n endpoint,\n method,\n queryParams,\n bodyParams,\n undefined,\n { isSigned: true }\n );\n }\n\n /**\n * Query for all convertible token pairs and the tokens’ respective upper/lower limits\n *\n * User needs to supply either or both of the input parameter\n * If not defined for both fromAsset and toAsset, only partial token pairs will be returned\n *\n * Weight: 3000(IP)\n *\n * @summary List All Convert Pairs\n * @param {ListAllConvertPairsRequest} requestParameters Request parameters.\n *\n * @returns {Promise<RestApiResponse<ListAllConvertPairsResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @see {@link https://developers.binance.com/docs/convert/market-data/ Binance API Documentation}\n */\n listAllConvertPairs(\n requestParameters: ListAllConvertPairsRequest = {}\n ): Promise<RestApiResponse<ListAllConvertPairsResponse>> {\n return this.marketDataApi.listAllConvertPairs(requestParameters);\n }\n\n /**\n * Query for supported asset’s precision information\n *\n * Weight: 100(IP)\n *\n * @summary Query order quantity precision per asset(USER_DATA)\n * @param {QueryOrderQuantityPrecisionPerAssetRequest} requestParameters Request parameters.\n *\n * @returns {Promise<RestApiResponse<QueryOrderQuantityPrecisionPerAssetResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @see {@link https://developers.binance.com/docs/convert/market-data/Query-order-quantity-precision-per-asset Binance API Documentation}\n */\n queryOrderQuantityPrecisionPerAsset(\n requestParameters: QueryOrderQuantityPrecisionPerAssetRequest = {}\n ): Promise<RestApiResponse<QueryOrderQuantityPrecisionPerAssetResponse>> {\n return this.marketDataApi.queryOrderQuantityPrecisionPerAsset(requestParameters);\n }\n\n /**\n * Accept the offered quote by quote ID.\n *\n * Weight: 500(UID)\n *\n * @summary Accept Quote (TRADE)\n * @param {AcceptQuoteRequest} requestParameters Request parameters.\n *\n * @returns {Promise<RestApiResponse<AcceptQuoteResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @see {@link https://developers.binance.com/docs/convert/trade/Accept-Quote Binance API Documentation}\n */\n acceptQuote(\n requestParameters: AcceptQuoteRequest\n ): Promise<RestApiResponse<AcceptQuoteResponse>> {\n return this.tradeApi.acceptQuote(requestParameters);\n }\n\n /**\n * Enable users to cancel a limit order\n *\n * Weight: 200(UID)\n *\n * @summary Cancel limit order (USER_DATA)\n * @param {CancelLimitOrderRequest} requestParameters Request parameters.\n *\n * @returns {Promise<RestApiResponse<CancelLimitOrderResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @see {@link https://developers.binance.com/docs/convert/trade/Cancel-Order Binance API Documentation}\n */\n cancelLimitOrder(\n requestParameters: CancelLimitOrderRequest\n ): Promise<RestApiResponse<CancelLimitOrderResponse>> {\n return this.tradeApi.cancelLimitOrder(requestParameters);\n }\n\n /**\n * Get Convert Trade History\n *\n * The max interval between startTime and endTime is 30 days.\n *\n * Weight: 3000\n *\n * @summary Get Convert Trade History(USER_DATA)\n * @param {GetConvertTradeHistoryRequest} requestParameters Request parameters.\n *\n * @returns {Promise<RestApiResponse<GetConvertTradeHistoryResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @see {@link https://developers.binance.com/docs/convert/trade/Get-Convert-Trade-History Binance API Documentation}\n */\n getConvertTradeHistory(\n requestParameters: GetConvertTradeHistoryRequest\n ): Promise<RestApiResponse<GetConvertTradeHistoryResponse>> {\n return this.tradeApi.getConvertTradeHistory(requestParameters);\n }\n\n /**\n * Query order status by order ID.\n *\n * Weight: 100(UID)\n *\n * @summary Order status(USER_DATA)\n * @param {OrderStatusRequest} requestParameters Request parameters.\n *\n * @returns {Promise<RestApiResponse<OrderStatusResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @see {@link https://developers.binance.com/docs/convert/trade/Order-Status Binance API Documentation}\n */\n orderStatus(\n requestParameters: OrderStatusRequest = {}\n ): Promise<RestApiResponse<OrderStatusResponse>> {\n return this.tradeApi.orderStatus(requestParameters);\n }\n\n /**\n * Enable users to place a limit order\n *\n * `baseAsset` or `quoteAsset` can be determined via `exchangeInfo` endpoint.\n * Limit price is defined from `baseAsset` to `quoteAsset`.\n * Either `baseAmount` or `quoteAmount` is used.\n *\n * Weight: 500(UID)\n *\n * @summary Place limit order (USER_DATA)\n * @param {PlaceLimitOrderRequest} requestParameters Request parameters.\n *\n * @returns {Promise<RestApiResponse<PlaceLimitOrderResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @see {@link https://developers.binance.com/docs/convert/trade/Place-Order Binance API Documentation}\n */\n placeLimitOrder(\n requestParameters: PlaceLimitOrderRequest\n ): Promise<RestApiResponse<PlaceLimitOrderResponse>> {\n return this.tradeApi.placeLimitOrder(requestParameters);\n }\n\n /**\n * Request a quote for the requested token pairs\n *\n * Weight: 3000(UID)\n *\n * @summary Query limit open orders (USER_DATA)\n * @param {QueryLimitOpenOrdersRequest} requestParameters Request parameters.\n *\n * @returns {Promise<RestApiResponse<QueryLimitOpenOrdersResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @see {@link https://developers.binance.com/docs/convert/trade/Query-Order Binance API Documentation}\n */\n queryLimitOpenOrders(\n requestParameters: QueryLimitOpenOrdersRequest = {}\n ): Promise<RestApiResponse<QueryLimitOpenOrdersResponse>> {\n return this.tradeApi.queryLimitOpenOrders(requestParameters);\n }\n\n /**\n * Request a quote for the requested token pairs\n *\n * Either fromAmount or toAmount should be sent\n * `quoteId` will be returned only if you have enough funds to convert\n *\n * Weight: 200(UID)\n *\n * @summary Send Quote Request(USER_DATA)\n * @param {SendQuoteRequestRequest} requestParameters Request parameters.\n *\n * @returns {Promise<RestApiResponse<SendQuoteRequestResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @see {@link https://developers.binance.com/docs/convert/trade/Send-quote-request Binance API Documentation}\n */\n sendQuoteRequest(\n requestParameters: SendQuoteRequestRequest\n ): Promise<RestApiResponse<SendQuoteRequestResponse>> {\n return this.tradeApi.sendQuoteRequest(requestParameters);\n }\n}\n","/**\n * Binance Convert REST API\n *\n * OpenAPI Specification for the Binance Convert 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\nexport * from './types';\nexport * from './modules';\nexport * from './rest-api';\n","import { buildUserAgent, ConfigurationRestAPI, CONVERT_REST_API_PROD_URL } from '@binance/common';\nimport { name, version } from '../package.json';\nimport { RestAPI } from './rest-api';\n\nexport interface ConfigurationConvert {\n configurationRestAPI?: ConfigurationRestAPI;\n}\n\nexport class Convert {\n public restAPI!: RestAPI;\n\n constructor(config: ConfigurationConvert) {\n const userAgent = buildUserAgent(name, version);\n\n if (config?.configurationRestAPI) {\n const configRestAPI = new ConfigurationRestAPI(\n config.configurationRestAPI\n ) as ConfigurationRestAPI & {\n baseOptions: Record<string, unknown>;\n };\n configRestAPI.basePath = configRestAPI.basePath || CONVERT_REST_API_PROD_URL;\n configRestAPI.baseOptions = configRestAPI.baseOptions || {};\n configRestAPI.baseOptions.headers = {\n ...(configRestAPI.baseOptions.headers || {}),\n 'User-Agent': userAgent,\n };\n this.restAPI = new RestAPI(configRestAPI);\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;WACY;cAEG;;;;;;;;;;;;;;;;;;;ACyBf,MAAM,iCAAiC,SAAU,eAAqC;AAClF,QAAO;EAeH,qBAAqB,OAAO,WAAoB,YAA2C;GACvF,MAAMA,yBAAkD,EAAE;GAC1D,MAAMC,wBAAiD,EAAE;AAEzD,OAAI,cAAc,UAAa,cAAc,KACzC,wBAAuB,eAAe;AAE1C,OAAI,YAAY,UAAa,YAAY,KACrC,wBAAuB,aAAa;GAGxC,IAAIC;AACJ,OAAI,cAAc,cAAe,aAAY,cAAc;AAE3D,UAAO;IACH,UAAU;IACV,QAAQ;IACR,aAAa;IACb,YAAY;IACZ,UAAU;IACb;;EAYL,qCAAqC,OACjC,eACuB;GACvB,MAAMF,yBAAkD,EAAE;GAC1D,MAAMC,wBAAiD,EAAE;AAEzD,OAAI,eAAe,UAAa,eAAe,KAC3C,wBAAuB,gBAAgB;GAG3C,IAAIC;AACJ,OAAI,cAAc,cAAe,aAAY,cAAc;AAE3D,UAAO;IACH,UAAU;IACV,QAAQ;IACR,aAAa;IACb,YAAY;IACZ,UAAU;IACb;;EAER;;;;;;AA8EL,IAAa,gBAAb,MAA6D;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OAAO,qBACV;AAGD,iBAAc,WAAW,cAAc,YAAYC;AACnD,iBAAc,cAAc,cAAc,eAAe,EAAE;AAC3D,iBAAc,YAAY,UAAU;IAChC,GAAI,cAAc,YAAY,WAAW,EAAE;IAC3C,cAAc;IACjB;AACD,QAAK,UAAU,IAAI,QAAQ,cAAc"}
package/dist/index.mjs CHANGED
@@ -3,7 +3,7 @@ import { BadRequestError, CONVERT_REST_API_PROD_URL, CONVERT_REST_API_PROD_URL a
3
3
 
4
4
  //#region package.json
5
5
  var name = "@binance/convert";
6
- var version = "4.0.3";
6
+ var version = "4.1.0";
7
7
 
8
8
  //#endregion
9
9
  //#region src/rest-api/modules/market-data-api.ts
@@ -26,6 +26,7 @@ const MarketDataApiAxiosParamCreator = function(configuration) {
26
26
  return {
27
27
  listAllConvertPairs: async (fromAsset, toAsset) => {
28
28
  const localVarQueryParameter = {};
29
+ const localVarBodyParameter = {};
29
30
  if (fromAsset !== void 0 && fromAsset !== null) localVarQueryParameter["fromAsset"] = fromAsset;
30
31
  if (toAsset !== void 0 && toAsset !== null) localVarQueryParameter["toAsset"] = toAsset;
31
32
  let _timeUnit;
@@ -33,19 +34,22 @@ const MarketDataApiAxiosParamCreator = function(configuration) {
33
34
  return {
34
35
  endpoint: "/sapi/v1/convert/exchangeInfo",
35
36
  method: "GET",
36
- params: localVarQueryParameter,
37
+ queryParams: localVarQueryParameter,
38
+ bodyParams: localVarBodyParameter,
37
39
  timeUnit: _timeUnit
38
40
  };
39
41
  },
40
42
  queryOrderQuantityPrecisionPerAsset: async (recvWindow) => {
41
43
  const localVarQueryParameter = {};
44
+ const localVarBodyParameter = {};
42
45
  if (recvWindow !== void 0 && recvWindow !== null) localVarQueryParameter["recvWindow"] = recvWindow;
43
46
  let _timeUnit;
44
47
  if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
45
48
  return {
46
49
  endpoint: "/sapi/v1/convert/assetInfo",
47
50
  method: "GET",
48
- params: localVarQueryParameter,
51
+ queryParams: localVarQueryParameter,
52
+ bodyParams: localVarBodyParameter,
49
53
  timeUnit: _timeUnit
50
54
  };
51
55
  }
@@ -77,7 +81,7 @@ var MarketDataApi = class {
77
81
  */
78
82
  async listAllConvertPairs(requestParameters = {}) {
79
83
  const localVarAxiosArgs = await this.localVarAxiosParamCreator.listAllConvertPairs(requestParameters?.fromAsset, requestParameters?.toAsset);
80
- return sendRequest(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.params, localVarAxiosArgs?.timeUnit, { isSigned: false });
84
+ return sendRequest(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs?.timeUnit, { isSigned: false });
81
85
  }
82
86
  /**
83
87
  * Query for supported asset’s precision information
@@ -93,7 +97,7 @@ var MarketDataApi = class {
93
97
  */
94
98
  async queryOrderQuantityPrecisionPerAsset(requestParameters = {}) {
95
99
  const localVarAxiosArgs = await this.localVarAxiosParamCreator.queryOrderQuantityPrecisionPerAsset(requestParameters?.recvWindow);
96
- return sendRequest(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.params, localVarAxiosArgs?.timeUnit, { isSigned: true });
100
+ return sendRequest(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs?.timeUnit, { isSigned: true });
97
101
  }
98
102
  };
99
103
 
@@ -119,6 +123,7 @@ const TradeApiAxiosParamCreator = function(configuration) {
119
123
  acceptQuote: async (quoteId, recvWindow) => {
120
124
  assertParamExists("acceptQuote", "quoteId", quoteId);
121
125
  const localVarQueryParameter = {};
126
+ const localVarBodyParameter = {};
122
127
  if (quoteId !== void 0 && quoteId !== null) localVarQueryParameter["quoteId"] = quoteId;
123
128
  if (recvWindow !== void 0 && recvWindow !== null) localVarQueryParameter["recvWindow"] = recvWindow;
124
129
  let _timeUnit;
@@ -126,13 +131,15 @@ const TradeApiAxiosParamCreator = function(configuration) {
126
131
  return {
127
132
  endpoint: "/sapi/v1/convert/acceptQuote",
128
133
  method: "POST",
129
- params: localVarQueryParameter,
134
+ queryParams: localVarQueryParameter,
135
+ bodyParams: localVarBodyParameter,
130
136
  timeUnit: _timeUnit
131
137
  };
132
138
  },
133
139
  cancelLimitOrder: async (orderId, recvWindow) => {
134
140
  assertParamExists("cancelLimitOrder", "orderId", orderId);
135
141
  const localVarQueryParameter = {};
142
+ const localVarBodyParameter = {};
136
143
  if (orderId !== void 0 && orderId !== null) localVarQueryParameter["orderId"] = orderId;
137
144
  if (recvWindow !== void 0 && recvWindow !== null) localVarQueryParameter["recvWindow"] = recvWindow;
138
145
  let _timeUnit;
@@ -140,7 +147,8 @@ const TradeApiAxiosParamCreator = function(configuration) {
140
147
  return {
141
148
  endpoint: "/sapi/v1/convert/limit/cancelOrder",
142
149
  method: "POST",
143
- params: localVarQueryParameter,
150
+ queryParams: localVarQueryParameter,
151
+ bodyParams: localVarBodyParameter,
144
152
  timeUnit: _timeUnit
145
153
  };
146
154
  },
@@ -148,6 +156,7 @@ const TradeApiAxiosParamCreator = function(configuration) {
148
156
  assertParamExists("getConvertTradeHistory", "startTime", startTime);
149
157
  assertParamExists("getConvertTradeHistory", "endTime", endTime);
150
158
  const localVarQueryParameter = {};
159
+ const localVarBodyParameter = {};
151
160
  if (startTime !== void 0 && startTime !== null) localVarQueryParameter["startTime"] = startTime;
152
161
  if (endTime !== void 0 && endTime !== null) localVarQueryParameter["endTime"] = endTime;
153
162
  if (limit !== void 0 && limit !== null) localVarQueryParameter["limit"] = limit;
@@ -157,12 +166,14 @@ const TradeApiAxiosParamCreator = function(configuration) {
157
166
  return {
158
167
  endpoint: "/sapi/v1/convert/tradeFlow",
159
168
  method: "GET",
160
- params: localVarQueryParameter,
169
+ queryParams: localVarQueryParameter,
170
+ bodyParams: localVarBodyParameter,
161
171
  timeUnit: _timeUnit
162
172
  };
163
173
  },
164
174
  orderStatus: async (orderId, quoteId) => {
165
175
  const localVarQueryParameter = {};
176
+ const localVarBodyParameter = {};
166
177
  if (orderId !== void 0 && orderId !== null) localVarQueryParameter["orderId"] = orderId;
167
178
  if (quoteId !== void 0 && quoteId !== null) localVarQueryParameter["quoteId"] = quoteId;
168
179
  let _timeUnit;
@@ -170,7 +181,8 @@ const TradeApiAxiosParamCreator = function(configuration) {
170
181
  return {
171
182
  endpoint: "/sapi/v1/convert/orderStatus",
172
183
  method: "GET",
173
- params: localVarQueryParameter,
184
+ queryParams: localVarQueryParameter,
185
+ bodyParams: localVarBodyParameter,
174
186
  timeUnit: _timeUnit
175
187
  };
176
188
  },
@@ -181,6 +193,7 @@ const TradeApiAxiosParamCreator = function(configuration) {
181
193
  assertParamExists("placeLimitOrder", "side", side);
182
194
  assertParamExists("placeLimitOrder", "expiredType", expiredType);
183
195
  const localVarQueryParameter = {};
196
+ const localVarBodyParameter = {};
184
197
  if (baseAsset !== void 0 && baseAsset !== null) localVarQueryParameter["baseAsset"] = baseAsset;
185
198
  if (quoteAsset !== void 0 && quoteAsset !== null) localVarQueryParameter["quoteAsset"] = quoteAsset;
186
199
  if (limitPrice !== void 0 && limitPrice !== null) localVarQueryParameter["limitPrice"] = limitPrice;
@@ -195,19 +208,22 @@ const TradeApiAxiosParamCreator = function(configuration) {
195
208
  return {
196
209
  endpoint: "/sapi/v1/convert/limit/placeOrder",
197
210
  method: "POST",
198
- params: localVarQueryParameter,
211
+ queryParams: localVarQueryParameter,
212
+ bodyParams: localVarBodyParameter,
199
213
  timeUnit: _timeUnit
200
214
  };
201
215
  },
202
216
  queryLimitOpenOrders: async (recvWindow) => {
203
217
  const localVarQueryParameter = {};
218
+ const localVarBodyParameter = {};
204
219
  if (recvWindow !== void 0 && recvWindow !== null) localVarQueryParameter["recvWindow"] = recvWindow;
205
220
  let _timeUnit;
206
221
  if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
207
222
  return {
208
223
  endpoint: "/sapi/v1/convert/limit/queryOpenOrders",
209
224
  method: "GET",
210
- params: localVarQueryParameter,
225
+ queryParams: localVarQueryParameter,
226
+ bodyParams: localVarBodyParameter,
211
227
  timeUnit: _timeUnit
212
228
  };
213
229
  },
@@ -215,6 +231,7 @@ const TradeApiAxiosParamCreator = function(configuration) {
215
231
  assertParamExists("sendQuoteRequest", "fromAsset", fromAsset);
216
232
  assertParamExists("sendQuoteRequest", "toAsset", toAsset);
217
233
  const localVarQueryParameter = {};
234
+ const localVarBodyParameter = {};
218
235
  if (fromAsset !== void 0 && fromAsset !== null) localVarQueryParameter["fromAsset"] = fromAsset;
219
236
  if (toAsset !== void 0 && toAsset !== null) localVarQueryParameter["toAsset"] = toAsset;
220
237
  if (fromAmount !== void 0 && fromAmount !== null) localVarQueryParameter["fromAmount"] = fromAmount;
@@ -227,7 +244,8 @@ const TradeApiAxiosParamCreator = function(configuration) {
227
244
  return {
228
245
  endpoint: "/sapi/v1/convert/getQuote",
229
246
  method: "POST",
230
- params: localVarQueryParameter,
247
+ queryParams: localVarQueryParameter,
248
+ bodyParams: localVarBodyParameter,
231
249
  timeUnit: _timeUnit
232
250
  };
233
251
  }
@@ -256,7 +274,7 @@ var TradeApi = class {
256
274
  */
257
275
  async acceptQuote(requestParameters) {
258
276
  const localVarAxiosArgs = await this.localVarAxiosParamCreator.acceptQuote(requestParameters?.quoteId, requestParameters?.recvWindow);
259
- return sendRequest(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.params, localVarAxiosArgs?.timeUnit, { isSigned: true });
277
+ return sendRequest(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs?.timeUnit, { isSigned: true });
260
278
  }
261
279
  /**
262
280
  * Enable users to cancel a limit order
@@ -272,7 +290,7 @@ var TradeApi = class {
272
290
  */
273
291
  async cancelLimitOrder(requestParameters) {
274
292
  const localVarAxiosArgs = await this.localVarAxiosParamCreator.cancelLimitOrder(requestParameters?.orderId, requestParameters?.recvWindow);
275
- return sendRequest(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.params, localVarAxiosArgs?.timeUnit, { isSigned: true });
293
+ return sendRequest(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs?.timeUnit, { isSigned: true });
276
294
  }
277
295
  /**
278
296
  * Get Convert Trade History
@@ -290,7 +308,7 @@ var TradeApi = class {
290
308
  */
291
309
  async getConvertTradeHistory(requestParameters) {
292
310
  const localVarAxiosArgs = await this.localVarAxiosParamCreator.getConvertTradeHistory(requestParameters?.startTime, requestParameters?.endTime, requestParameters?.limit, requestParameters?.recvWindow);
293
- return sendRequest(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.params, localVarAxiosArgs?.timeUnit, { isSigned: true });
311
+ return sendRequest(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs?.timeUnit, { isSigned: true });
294
312
  }
295
313
  /**
296
314
  * Query order status by order ID.
@@ -306,7 +324,7 @@ var TradeApi = class {
306
324
  */
307
325
  async orderStatus(requestParameters = {}) {
308
326
  const localVarAxiosArgs = await this.localVarAxiosParamCreator.orderStatus(requestParameters?.orderId, requestParameters?.quoteId);
309
- return sendRequest(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.params, localVarAxiosArgs?.timeUnit, { isSigned: true });
327
+ return sendRequest(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs?.timeUnit, { isSigned: true });
310
328
  }
311
329
  /**
312
330
  * Enable users to place a limit order
@@ -326,7 +344,7 @@ var TradeApi = class {
326
344
  */
327
345
  async placeLimitOrder(requestParameters) {
328
346
  const localVarAxiosArgs = await this.localVarAxiosParamCreator.placeLimitOrder(requestParameters?.baseAsset, requestParameters?.quoteAsset, requestParameters?.limitPrice, requestParameters?.side, requestParameters?.expiredType, requestParameters?.baseAmount, requestParameters?.quoteAmount, requestParameters?.walletType, requestParameters?.recvWindow);
329
- return sendRequest(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.params, localVarAxiosArgs?.timeUnit, { isSigned: true });
347
+ return sendRequest(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs?.timeUnit, { isSigned: true });
330
348
  }
331
349
  /**
332
350
  * Request a quote for the requested token pairs
@@ -342,7 +360,7 @@ var TradeApi = class {
342
360
  */
343
361
  async queryLimitOpenOrders(requestParameters = {}) {
344
362
  const localVarAxiosArgs = await this.localVarAxiosParamCreator.queryLimitOpenOrders(requestParameters?.recvWindow);
345
- return sendRequest(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.params, localVarAxiosArgs?.timeUnit, { isSigned: true });
363
+ return sendRequest(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs?.timeUnit, { isSigned: true });
346
364
  }
347
365
  /**
348
366
  * Request a quote for the requested token pairs
@@ -361,7 +379,7 @@ var TradeApi = class {
361
379
  */
362
380
  async sendQuoteRequest(requestParameters) {
363
381
  const localVarAxiosArgs = await this.localVarAxiosParamCreator.sendQuoteRequest(requestParameters?.fromAsset, requestParameters?.toAsset, requestParameters?.fromAmount, requestParameters?.toAmount, requestParameters?.walletType, requestParameters?.validTime, requestParameters?.recvWindow);
364
- return sendRequest(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.params, localVarAxiosArgs?.timeUnit, { isSigned: true });
382
+ return sendRequest(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs?.timeUnit, { isSigned: true });
365
383
  }
366
384
  };
367
385
 
@@ -389,23 +407,25 @@ var RestAPI = class {
389
407
  * Generic function to send a request.
390
408
  * @param endpoint - The API endpoint to call.
391
409
  * @param method - HTTP method to use (GET, POST, DELETE, etc.).
392
- * @param params - Query parameters for the request.
410
+ * @param queryParams - Query parameters for the request.
411
+ * @param bodyParams - Body parameters for the request.
393
412
  *
394
413
  * @returns A promise resolving to the response data object.
395
414
  */
396
- sendRequest(endpoint, method, params = {}) {
397
- return sendRequest(this.configuration, endpoint, method, params, void 0);
415
+ sendRequest(endpoint, method, queryParams = {}, bodyParams = {}) {
416
+ return sendRequest(this.configuration, endpoint, method, queryParams, bodyParams, void 0);
398
417
  }
399
418
  /**
400
419
  * Generic function to send a signed request.
401
420
  * @param endpoint - The API endpoint to call.
402
421
  * @param method - HTTP method to use (GET, POST, DELETE, etc.).
403
- * @param params - Query parameters for the request.
422
+ * @param queryParams - Query parameters for the request.
423
+ * @param bodyParams - Body parameters for the request.
404
424
  *
405
425
  * @returns A promise resolving to the response data object.
406
426
  */
407
- sendSignedRequest(endpoint, method, params = {}) {
408
- return sendRequest(this.configuration, endpoint, method, params, void 0, { isSigned: true });
427
+ sendSignedRequest(endpoint, method, queryParams = {}, bodyParams = {}) {
428
+ return sendRequest(this.configuration, endpoint, method, queryParams, bodyParams, void 0, { isSigned: true });
409
429
  }
410
430
  /**
411
431
  * Query for all convertible token pairs and the tokens’ respective upper/lower limits