@binance/convert 4.0.1 → 4.0.3
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/chunk.mjs +13 -0
- package/dist/index.d.mts +997 -1116
- package/dist/index.d.ts +999 -1116
- package/dist/index.js +641 -850
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +569 -845
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -4
package/dist/index.mjs
CHANGED
|
@@ -1,863 +1,587 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
for (var name2 in all)
|
|
4
|
-
__defProp(target, name2, { get: all[name2], enumerable: true });
|
|
5
|
-
};
|
|
6
|
-
|
|
7
|
-
// src/convert.ts
|
|
8
|
-
import { buildUserAgent, ConfigurationRestAPI as ConfigurationRestAPI4, CONVERT_REST_API_PROD_URL } from "@binance/common";
|
|
1
|
+
import { t as __export } from "./chunk.mjs";
|
|
2
|
+
import { BadRequestError, CONVERT_REST_API_PROD_URL, CONVERT_REST_API_PROD_URL as CONVERT_REST_API_PROD_URL$1, ConfigurationRestAPI, ConnectorClientError, ForbiddenError, NetworkError, NotFoundError, RateLimitBanError, RequiredError, ServerError, TooManyRequestsError, UnauthorizedError, assertParamExists, buildUserAgent, sendRequest } from "@binance/common";
|
|
9
3
|
|
|
10
|
-
|
|
4
|
+
//#region package.json
|
|
11
5
|
var name = "@binance/convert";
|
|
12
|
-
var version = "4.0.
|
|
13
|
-
|
|
14
|
-
// src/rest-api/index.ts
|
|
15
|
-
var rest_api_exports = {};
|
|
16
|
-
__export(rest_api_exports, {
|
|
17
|
-
MarketDataApi: () => MarketDataApi,
|
|
18
|
-
RestAPI: () => RestAPI,
|
|
19
|
-
TradeApi: () => TradeApi
|
|
20
|
-
});
|
|
6
|
+
var version = "4.0.3";
|
|
21
7
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
* @throws {RequiredError}
|
|
68
|
-
*/
|
|
69
|
-
queryOrderQuantityPrecisionPerAsset: async (recvWindow) => {
|
|
70
|
-
const localVarQueryParameter = {};
|
|
71
|
-
if (recvWindow !== void 0 && recvWindow !== null) {
|
|
72
|
-
localVarQueryParameter["recvWindow"] = recvWindow;
|
|
73
|
-
}
|
|
74
|
-
let _timeUnit;
|
|
75
|
-
if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
|
|
76
|
-
return {
|
|
77
|
-
endpoint: "/sapi/v1/convert/assetInfo",
|
|
78
|
-
method: "GET",
|
|
79
|
-
params: localVarQueryParameter,
|
|
80
|
-
timeUnit: _timeUnit
|
|
81
|
-
};
|
|
82
|
-
}
|
|
83
|
-
};
|
|
8
|
+
//#endregion
|
|
9
|
+
//#region src/rest-api/modules/market-data-api.ts
|
|
10
|
+
/**
|
|
11
|
+
* Binance Convert REST API
|
|
12
|
+
*
|
|
13
|
+
* OpenAPI Specification for the Binance Convert REST API
|
|
14
|
+
*
|
|
15
|
+
* The version of the OpenAPI document: 1.0.0
|
|
16
|
+
*
|
|
17
|
+
*
|
|
18
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
19
|
+
* https://openapi-generator.tech
|
|
20
|
+
* Do not edit the class manually.
|
|
21
|
+
*/
|
|
22
|
+
/**
|
|
23
|
+
* MarketDataApi - axios parameter creator
|
|
24
|
+
*/
|
|
25
|
+
const MarketDataApiAxiosParamCreator = function(configuration) {
|
|
26
|
+
return {
|
|
27
|
+
listAllConvertPairs: async (fromAsset, toAsset) => {
|
|
28
|
+
const localVarQueryParameter = {};
|
|
29
|
+
if (fromAsset !== void 0 && fromAsset !== null) localVarQueryParameter["fromAsset"] = fromAsset;
|
|
30
|
+
if (toAsset !== void 0 && toAsset !== null) localVarQueryParameter["toAsset"] = toAsset;
|
|
31
|
+
let _timeUnit;
|
|
32
|
+
if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
|
|
33
|
+
return {
|
|
34
|
+
endpoint: "/sapi/v1/convert/exchangeInfo",
|
|
35
|
+
method: "GET",
|
|
36
|
+
params: localVarQueryParameter,
|
|
37
|
+
timeUnit: _timeUnit
|
|
38
|
+
};
|
|
39
|
+
},
|
|
40
|
+
queryOrderQuantityPrecisionPerAsset: async (recvWindow) => {
|
|
41
|
+
const localVarQueryParameter = {};
|
|
42
|
+
if (recvWindow !== void 0 && recvWindow !== null) localVarQueryParameter["recvWindow"] = recvWindow;
|
|
43
|
+
let _timeUnit;
|
|
44
|
+
if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
|
|
45
|
+
return {
|
|
46
|
+
endpoint: "/sapi/v1/convert/assetInfo",
|
|
47
|
+
method: "GET",
|
|
48
|
+
params: localVarQueryParameter,
|
|
49
|
+
timeUnit: _timeUnit
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
};
|
|
84
53
|
};
|
|
54
|
+
/**
|
|
55
|
+
* MarketDataApi - object-oriented interface
|
|
56
|
+
* @class MarketDataApi
|
|
57
|
+
*/
|
|
85
58
|
var MarketDataApi = class {
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
* @param {QueryOrderQuantityPrecisionPerAssetRequest} requestParameters Request parameters.
|
|
126
|
-
* @returns {Promise<RestApiResponse<QueryOrderQuantityPrecisionPerAssetResponse>>}
|
|
127
|
-
* @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
|
|
128
|
-
* @memberof MarketDataApi
|
|
129
|
-
* @see {@link https://developers.binance.com/docs/convert/market-data/Query-order-quantity-precision-per-asset Binance API Documentation}
|
|
130
|
-
*/
|
|
131
|
-
async queryOrderQuantityPrecisionPerAsset(requestParameters = {}) {
|
|
132
|
-
const localVarAxiosArgs = await this.localVarAxiosParamCreator.queryOrderQuantityPrecisionPerAsset(
|
|
133
|
-
requestParameters?.recvWindow
|
|
134
|
-
);
|
|
135
|
-
return sendRequest(
|
|
136
|
-
this.configuration,
|
|
137
|
-
localVarAxiosArgs.endpoint,
|
|
138
|
-
localVarAxiosArgs.method,
|
|
139
|
-
localVarAxiosArgs.params,
|
|
140
|
-
localVarAxiosArgs?.timeUnit,
|
|
141
|
-
{ isSigned: true }
|
|
142
|
-
);
|
|
143
|
-
}
|
|
59
|
+
constructor(configuration) {
|
|
60
|
+
this.configuration = configuration;
|
|
61
|
+
this.localVarAxiosParamCreator = MarketDataApiAxiosParamCreator(configuration);
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Query for all convertible token pairs and the tokens’ respective upper/lower limits
|
|
65
|
+
*
|
|
66
|
+
* User needs to supply either or both of the input parameter
|
|
67
|
+
* If not defined for both fromAsset and toAsset, only partial token pairs will be returned
|
|
68
|
+
*
|
|
69
|
+
* Weight: 3000(IP)
|
|
70
|
+
*
|
|
71
|
+
* @summary List All Convert Pairs
|
|
72
|
+
* @param {ListAllConvertPairsRequest} requestParameters Request parameters.
|
|
73
|
+
* @returns {Promise<RestApiResponse<ListAllConvertPairsResponse>>}
|
|
74
|
+
* @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
|
|
75
|
+
* @memberof MarketDataApi
|
|
76
|
+
* @see {@link https://developers.binance.com/docs/convert/market-data/ Binance API Documentation}
|
|
77
|
+
*/
|
|
78
|
+
async listAllConvertPairs(requestParameters = {}) {
|
|
79
|
+
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 });
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Query for supported asset’s precision information
|
|
84
|
+
*
|
|
85
|
+
* Weight: 100(IP)
|
|
86
|
+
*
|
|
87
|
+
* @summary Query order quantity precision per asset(USER_DATA)
|
|
88
|
+
* @param {QueryOrderQuantityPrecisionPerAssetRequest} requestParameters Request parameters.
|
|
89
|
+
* @returns {Promise<RestApiResponse<QueryOrderQuantityPrecisionPerAssetResponse>>}
|
|
90
|
+
* @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
|
|
91
|
+
* @memberof MarketDataApi
|
|
92
|
+
* @see {@link https://developers.binance.com/docs/convert/market-data/Query-order-quantity-precision-per-asset Binance API Documentation}
|
|
93
|
+
*/
|
|
94
|
+
async queryOrderQuantityPrecisionPerAsset(requestParameters = {}) {
|
|
95
|
+
const localVarAxiosArgs = await this.localVarAxiosParamCreator.queryOrderQuantityPrecisionPerAsset(requestParameters?.recvWindow);
|
|
96
|
+
return sendRequest(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.params, localVarAxiosArgs?.timeUnit, { isSigned: true });
|
|
97
|
+
}
|
|
144
98
|
};
|
|
145
99
|
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
*
|
|
282
|
-
* `baseAsset` or `quoteAsset` can be determined via `exchangeInfo` endpoint.
|
|
283
|
-
* Limit price is defined from `baseAsset` to `quoteAsset`.
|
|
284
|
-
* Either `baseAmount` or `quoteAmount` is used.
|
|
285
|
-
*
|
|
286
|
-
* Weight: 500(UID)
|
|
287
|
-
*
|
|
288
|
-
* @summary Place limit order (USER_DATA)
|
|
289
|
-
* @param {string} baseAsset base asset (use the response `fromIsBase` from `GET /sapi/v1/convert/exchangeInfo` api to check which one is baseAsset )
|
|
290
|
-
* @param {string} quoteAsset quote asset
|
|
291
|
-
* @param {number} limitPrice Symbol limit price (from baseAsset to quoteAsset)
|
|
292
|
-
* @param {string} side `BUY` or `SELL`
|
|
293
|
-
* @param {string} expiredType 1_D, 3_D, 7_D, 30_D (D means day)
|
|
294
|
-
* @param {number} [baseAmount] Base asset amount. (One of `baseAmount` or `quoteAmount` is required)
|
|
295
|
-
* @param {number} [quoteAmount] Quote asset amount. (One of `baseAmount` or `quoteAmount` is required)
|
|
296
|
-
* @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`.
|
|
297
|
-
* @param {number | bigint} [recvWindow] The value cannot be greater than 60000
|
|
298
|
-
*
|
|
299
|
-
* @throws {RequiredError}
|
|
300
|
-
*/
|
|
301
|
-
placeLimitOrder: async (baseAsset, quoteAsset, limitPrice, side, expiredType, baseAmount, quoteAmount, walletType, recvWindow) => {
|
|
302
|
-
assertParamExists("placeLimitOrder", "baseAsset", baseAsset);
|
|
303
|
-
assertParamExists("placeLimitOrder", "quoteAsset", quoteAsset);
|
|
304
|
-
assertParamExists("placeLimitOrder", "limitPrice", limitPrice);
|
|
305
|
-
assertParamExists("placeLimitOrder", "side", side);
|
|
306
|
-
assertParamExists("placeLimitOrder", "expiredType", expiredType);
|
|
307
|
-
const localVarQueryParameter = {};
|
|
308
|
-
if (baseAsset !== void 0 && baseAsset !== null) {
|
|
309
|
-
localVarQueryParameter["baseAsset"] = baseAsset;
|
|
310
|
-
}
|
|
311
|
-
if (quoteAsset !== void 0 && quoteAsset !== null) {
|
|
312
|
-
localVarQueryParameter["quoteAsset"] = quoteAsset;
|
|
313
|
-
}
|
|
314
|
-
if (limitPrice !== void 0 && limitPrice !== null) {
|
|
315
|
-
localVarQueryParameter["limitPrice"] = limitPrice;
|
|
316
|
-
}
|
|
317
|
-
if (baseAmount !== void 0 && baseAmount !== null) {
|
|
318
|
-
localVarQueryParameter["baseAmount"] = baseAmount;
|
|
319
|
-
}
|
|
320
|
-
if (quoteAmount !== void 0 && quoteAmount !== null) {
|
|
321
|
-
localVarQueryParameter["quoteAmount"] = quoteAmount;
|
|
322
|
-
}
|
|
323
|
-
if (side !== void 0 && side !== null) {
|
|
324
|
-
localVarQueryParameter["side"] = side;
|
|
325
|
-
}
|
|
326
|
-
if (walletType !== void 0 && walletType !== null) {
|
|
327
|
-
localVarQueryParameter["walletType"] = walletType;
|
|
328
|
-
}
|
|
329
|
-
if (expiredType !== void 0 && expiredType !== null) {
|
|
330
|
-
localVarQueryParameter["expiredType"] = expiredType;
|
|
331
|
-
}
|
|
332
|
-
if (recvWindow !== void 0 && recvWindow !== null) {
|
|
333
|
-
localVarQueryParameter["recvWindow"] = recvWindow;
|
|
334
|
-
}
|
|
335
|
-
let _timeUnit;
|
|
336
|
-
if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
|
|
337
|
-
return {
|
|
338
|
-
endpoint: "/sapi/v1/convert/limit/placeOrder",
|
|
339
|
-
method: "POST",
|
|
340
|
-
params: localVarQueryParameter,
|
|
341
|
-
timeUnit: _timeUnit
|
|
342
|
-
};
|
|
343
|
-
},
|
|
344
|
-
/**
|
|
345
|
-
* Request a quote for the requested token pairs
|
|
346
|
-
*
|
|
347
|
-
* Weight: 3000(UID)
|
|
348
|
-
*
|
|
349
|
-
* @summary Query limit open orders (USER_DATA)
|
|
350
|
-
* @param {number | bigint} [recvWindow] The value cannot be greater than 60000
|
|
351
|
-
*
|
|
352
|
-
* @throws {RequiredError}
|
|
353
|
-
*/
|
|
354
|
-
queryLimitOpenOrders: async (recvWindow) => {
|
|
355
|
-
const localVarQueryParameter = {};
|
|
356
|
-
if (recvWindow !== void 0 && recvWindow !== null) {
|
|
357
|
-
localVarQueryParameter["recvWindow"] = recvWindow;
|
|
358
|
-
}
|
|
359
|
-
let _timeUnit;
|
|
360
|
-
if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
|
|
361
|
-
return {
|
|
362
|
-
endpoint: "/sapi/v1/convert/limit/queryOpenOrders",
|
|
363
|
-
method: "GET",
|
|
364
|
-
params: localVarQueryParameter,
|
|
365
|
-
timeUnit: _timeUnit
|
|
366
|
-
};
|
|
367
|
-
},
|
|
368
|
-
/**
|
|
369
|
-
* Request a quote for the requested token pairs
|
|
370
|
-
*
|
|
371
|
-
* Either fromAmount or toAmount should be sent
|
|
372
|
-
* `quoteId` will be returned only if you have enough funds to convert
|
|
373
|
-
*
|
|
374
|
-
* Weight: 200(UID)
|
|
375
|
-
*
|
|
376
|
-
* @summary Send Quote Request(USER_DATA)
|
|
377
|
-
* @param {string} fromAsset
|
|
378
|
-
* @param {string} toAsset
|
|
379
|
-
* @param {number} [fromAmount] When specified, it is the amount you will be debited after the conversion
|
|
380
|
-
* @param {number} [toAmount] When specified, it is the amount you will be credited after the conversion
|
|
381
|
-
* @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`.
|
|
382
|
-
* @param {string} [validTime] 10s, 30s, 1m, default 10s
|
|
383
|
-
* @param {number | bigint} [recvWindow] The value cannot be greater than 60000
|
|
384
|
-
*
|
|
385
|
-
* @throws {RequiredError}
|
|
386
|
-
*/
|
|
387
|
-
sendQuoteRequest: async (fromAsset, toAsset, fromAmount, toAmount, walletType, validTime, recvWindow) => {
|
|
388
|
-
assertParamExists("sendQuoteRequest", "fromAsset", fromAsset);
|
|
389
|
-
assertParamExists("sendQuoteRequest", "toAsset", toAsset);
|
|
390
|
-
const localVarQueryParameter = {};
|
|
391
|
-
if (fromAsset !== void 0 && fromAsset !== null) {
|
|
392
|
-
localVarQueryParameter["fromAsset"] = fromAsset;
|
|
393
|
-
}
|
|
394
|
-
if (toAsset !== void 0 && toAsset !== null) {
|
|
395
|
-
localVarQueryParameter["toAsset"] = toAsset;
|
|
396
|
-
}
|
|
397
|
-
if (fromAmount !== void 0 && fromAmount !== null) {
|
|
398
|
-
localVarQueryParameter["fromAmount"] = fromAmount;
|
|
399
|
-
}
|
|
400
|
-
if (toAmount !== void 0 && toAmount !== null) {
|
|
401
|
-
localVarQueryParameter["toAmount"] = toAmount;
|
|
402
|
-
}
|
|
403
|
-
if (walletType !== void 0 && walletType !== null) {
|
|
404
|
-
localVarQueryParameter["walletType"] = walletType;
|
|
405
|
-
}
|
|
406
|
-
if (validTime !== void 0 && validTime !== null) {
|
|
407
|
-
localVarQueryParameter["validTime"] = validTime;
|
|
408
|
-
}
|
|
409
|
-
if (recvWindow !== void 0 && recvWindow !== null) {
|
|
410
|
-
localVarQueryParameter["recvWindow"] = recvWindow;
|
|
411
|
-
}
|
|
412
|
-
let _timeUnit;
|
|
413
|
-
if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
|
|
414
|
-
return {
|
|
415
|
-
endpoint: "/sapi/v1/convert/getQuote",
|
|
416
|
-
method: "POST",
|
|
417
|
-
params: localVarQueryParameter,
|
|
418
|
-
timeUnit: _timeUnit
|
|
419
|
-
};
|
|
420
|
-
}
|
|
421
|
-
};
|
|
100
|
+
//#endregion
|
|
101
|
+
//#region src/rest-api/modules/trade-api.ts
|
|
102
|
+
/**
|
|
103
|
+
* Binance Convert REST API
|
|
104
|
+
*
|
|
105
|
+
* OpenAPI Specification for the Binance Convert REST API
|
|
106
|
+
*
|
|
107
|
+
* The version of the OpenAPI document: 1.0.0
|
|
108
|
+
*
|
|
109
|
+
*
|
|
110
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
111
|
+
* https://openapi-generator.tech
|
|
112
|
+
* Do not edit the class manually.
|
|
113
|
+
*/
|
|
114
|
+
/**
|
|
115
|
+
* TradeApi - axios parameter creator
|
|
116
|
+
*/
|
|
117
|
+
const TradeApiAxiosParamCreator = function(configuration) {
|
|
118
|
+
return {
|
|
119
|
+
acceptQuote: async (quoteId, recvWindow) => {
|
|
120
|
+
assertParamExists("acceptQuote", "quoteId", quoteId);
|
|
121
|
+
const localVarQueryParameter = {};
|
|
122
|
+
if (quoteId !== void 0 && quoteId !== null) localVarQueryParameter["quoteId"] = quoteId;
|
|
123
|
+
if (recvWindow !== void 0 && recvWindow !== null) localVarQueryParameter["recvWindow"] = recvWindow;
|
|
124
|
+
let _timeUnit;
|
|
125
|
+
if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
|
|
126
|
+
return {
|
|
127
|
+
endpoint: "/sapi/v1/convert/acceptQuote",
|
|
128
|
+
method: "POST",
|
|
129
|
+
params: localVarQueryParameter,
|
|
130
|
+
timeUnit: _timeUnit
|
|
131
|
+
};
|
|
132
|
+
},
|
|
133
|
+
cancelLimitOrder: async (orderId, recvWindow) => {
|
|
134
|
+
assertParamExists("cancelLimitOrder", "orderId", orderId);
|
|
135
|
+
const localVarQueryParameter = {};
|
|
136
|
+
if (orderId !== void 0 && orderId !== null) localVarQueryParameter["orderId"] = orderId;
|
|
137
|
+
if (recvWindow !== void 0 && recvWindow !== null) localVarQueryParameter["recvWindow"] = recvWindow;
|
|
138
|
+
let _timeUnit;
|
|
139
|
+
if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
|
|
140
|
+
return {
|
|
141
|
+
endpoint: "/sapi/v1/convert/limit/cancelOrder",
|
|
142
|
+
method: "POST",
|
|
143
|
+
params: localVarQueryParameter,
|
|
144
|
+
timeUnit: _timeUnit
|
|
145
|
+
};
|
|
146
|
+
},
|
|
147
|
+
getConvertTradeHistory: async (startTime, endTime, limit, recvWindow) => {
|
|
148
|
+
assertParamExists("getConvertTradeHistory", "startTime", startTime);
|
|
149
|
+
assertParamExists("getConvertTradeHistory", "endTime", endTime);
|
|
150
|
+
const localVarQueryParameter = {};
|
|
151
|
+
if (startTime !== void 0 && startTime !== null) localVarQueryParameter["startTime"] = startTime;
|
|
152
|
+
if (endTime !== void 0 && endTime !== null) localVarQueryParameter["endTime"] = endTime;
|
|
153
|
+
if (limit !== void 0 && limit !== null) localVarQueryParameter["limit"] = limit;
|
|
154
|
+
if (recvWindow !== void 0 && recvWindow !== null) localVarQueryParameter["recvWindow"] = recvWindow;
|
|
155
|
+
let _timeUnit;
|
|
156
|
+
if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
|
|
157
|
+
return {
|
|
158
|
+
endpoint: "/sapi/v1/convert/tradeFlow",
|
|
159
|
+
method: "GET",
|
|
160
|
+
params: localVarQueryParameter,
|
|
161
|
+
timeUnit: _timeUnit
|
|
162
|
+
};
|
|
163
|
+
},
|
|
164
|
+
orderStatus: async (orderId, quoteId) => {
|
|
165
|
+
const localVarQueryParameter = {};
|
|
166
|
+
if (orderId !== void 0 && orderId !== null) localVarQueryParameter["orderId"] = orderId;
|
|
167
|
+
if (quoteId !== void 0 && quoteId !== null) localVarQueryParameter["quoteId"] = quoteId;
|
|
168
|
+
let _timeUnit;
|
|
169
|
+
if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
|
|
170
|
+
return {
|
|
171
|
+
endpoint: "/sapi/v1/convert/orderStatus",
|
|
172
|
+
method: "GET",
|
|
173
|
+
params: localVarQueryParameter,
|
|
174
|
+
timeUnit: _timeUnit
|
|
175
|
+
};
|
|
176
|
+
},
|
|
177
|
+
placeLimitOrder: async (baseAsset, quoteAsset, limitPrice, side, expiredType, baseAmount, quoteAmount, walletType, recvWindow) => {
|
|
178
|
+
assertParamExists("placeLimitOrder", "baseAsset", baseAsset);
|
|
179
|
+
assertParamExists("placeLimitOrder", "quoteAsset", quoteAsset);
|
|
180
|
+
assertParamExists("placeLimitOrder", "limitPrice", limitPrice);
|
|
181
|
+
assertParamExists("placeLimitOrder", "side", side);
|
|
182
|
+
assertParamExists("placeLimitOrder", "expiredType", expiredType);
|
|
183
|
+
const localVarQueryParameter = {};
|
|
184
|
+
if (baseAsset !== void 0 && baseAsset !== null) localVarQueryParameter["baseAsset"] = baseAsset;
|
|
185
|
+
if (quoteAsset !== void 0 && quoteAsset !== null) localVarQueryParameter["quoteAsset"] = quoteAsset;
|
|
186
|
+
if (limitPrice !== void 0 && limitPrice !== null) localVarQueryParameter["limitPrice"] = limitPrice;
|
|
187
|
+
if (baseAmount !== void 0 && baseAmount !== null) localVarQueryParameter["baseAmount"] = baseAmount;
|
|
188
|
+
if (quoteAmount !== void 0 && quoteAmount !== null) localVarQueryParameter["quoteAmount"] = quoteAmount;
|
|
189
|
+
if (side !== void 0 && side !== null) localVarQueryParameter["side"] = side;
|
|
190
|
+
if (walletType !== void 0 && walletType !== null) localVarQueryParameter["walletType"] = walletType;
|
|
191
|
+
if (expiredType !== void 0 && expiredType !== null) localVarQueryParameter["expiredType"] = expiredType;
|
|
192
|
+
if (recvWindow !== void 0 && recvWindow !== null) localVarQueryParameter["recvWindow"] = recvWindow;
|
|
193
|
+
let _timeUnit;
|
|
194
|
+
if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
|
|
195
|
+
return {
|
|
196
|
+
endpoint: "/sapi/v1/convert/limit/placeOrder",
|
|
197
|
+
method: "POST",
|
|
198
|
+
params: localVarQueryParameter,
|
|
199
|
+
timeUnit: _timeUnit
|
|
200
|
+
};
|
|
201
|
+
},
|
|
202
|
+
queryLimitOpenOrders: async (recvWindow) => {
|
|
203
|
+
const localVarQueryParameter = {};
|
|
204
|
+
if (recvWindow !== void 0 && recvWindow !== null) localVarQueryParameter["recvWindow"] = recvWindow;
|
|
205
|
+
let _timeUnit;
|
|
206
|
+
if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
|
|
207
|
+
return {
|
|
208
|
+
endpoint: "/sapi/v1/convert/limit/queryOpenOrders",
|
|
209
|
+
method: "GET",
|
|
210
|
+
params: localVarQueryParameter,
|
|
211
|
+
timeUnit: _timeUnit
|
|
212
|
+
};
|
|
213
|
+
},
|
|
214
|
+
sendQuoteRequest: async (fromAsset, toAsset, fromAmount, toAmount, walletType, validTime, recvWindow) => {
|
|
215
|
+
assertParamExists("sendQuoteRequest", "fromAsset", fromAsset);
|
|
216
|
+
assertParamExists("sendQuoteRequest", "toAsset", toAsset);
|
|
217
|
+
const localVarQueryParameter = {};
|
|
218
|
+
if (fromAsset !== void 0 && fromAsset !== null) localVarQueryParameter["fromAsset"] = fromAsset;
|
|
219
|
+
if (toAsset !== void 0 && toAsset !== null) localVarQueryParameter["toAsset"] = toAsset;
|
|
220
|
+
if (fromAmount !== void 0 && fromAmount !== null) localVarQueryParameter["fromAmount"] = fromAmount;
|
|
221
|
+
if (toAmount !== void 0 && toAmount !== null) localVarQueryParameter["toAmount"] = toAmount;
|
|
222
|
+
if (walletType !== void 0 && walletType !== null) localVarQueryParameter["walletType"] = walletType;
|
|
223
|
+
if (validTime !== void 0 && validTime !== null) localVarQueryParameter["validTime"] = validTime;
|
|
224
|
+
if (recvWindow !== void 0 && recvWindow !== null) localVarQueryParameter["recvWindow"] = recvWindow;
|
|
225
|
+
let _timeUnit;
|
|
226
|
+
if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
|
|
227
|
+
return {
|
|
228
|
+
endpoint: "/sapi/v1/convert/getQuote",
|
|
229
|
+
method: "POST",
|
|
230
|
+
params: localVarQueryParameter,
|
|
231
|
+
timeUnit: _timeUnit
|
|
232
|
+
};
|
|
233
|
+
}
|
|
234
|
+
};
|
|
422
235
|
};
|
|
236
|
+
/**
|
|
237
|
+
* TradeApi - object-oriented interface
|
|
238
|
+
* @class TradeApi
|
|
239
|
+
*/
|
|
423
240
|
var TradeApi = class {
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
* @memberof TradeApi
|
|
550
|
-
* @see {@link https://developers.binance.com/docs/convert/trade/Place-Order Binance API Documentation}
|
|
551
|
-
*/
|
|
552
|
-
async placeLimitOrder(requestParameters) {
|
|
553
|
-
const localVarAxiosArgs = await this.localVarAxiosParamCreator.placeLimitOrder(
|
|
554
|
-
requestParameters?.baseAsset,
|
|
555
|
-
requestParameters?.quoteAsset,
|
|
556
|
-
requestParameters?.limitPrice,
|
|
557
|
-
requestParameters?.side,
|
|
558
|
-
requestParameters?.expiredType,
|
|
559
|
-
requestParameters?.baseAmount,
|
|
560
|
-
requestParameters?.quoteAmount,
|
|
561
|
-
requestParameters?.walletType,
|
|
562
|
-
requestParameters?.recvWindow
|
|
563
|
-
);
|
|
564
|
-
return sendRequest2(
|
|
565
|
-
this.configuration,
|
|
566
|
-
localVarAxiosArgs.endpoint,
|
|
567
|
-
localVarAxiosArgs.method,
|
|
568
|
-
localVarAxiosArgs.params,
|
|
569
|
-
localVarAxiosArgs?.timeUnit,
|
|
570
|
-
{ isSigned: true }
|
|
571
|
-
);
|
|
572
|
-
}
|
|
573
|
-
/**
|
|
574
|
-
* Request a quote for the requested token pairs
|
|
575
|
-
*
|
|
576
|
-
* Weight: 3000(UID)
|
|
577
|
-
*
|
|
578
|
-
* @summary Query limit open orders (USER_DATA)
|
|
579
|
-
* @param {QueryLimitOpenOrdersRequest} requestParameters Request parameters.
|
|
580
|
-
* @returns {Promise<RestApiResponse<QueryLimitOpenOrdersResponse>>}
|
|
581
|
-
* @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
|
|
582
|
-
* @memberof TradeApi
|
|
583
|
-
* @see {@link https://developers.binance.com/docs/convert/trade/Query-Order Binance API Documentation}
|
|
584
|
-
*/
|
|
585
|
-
async queryLimitOpenOrders(requestParameters = {}) {
|
|
586
|
-
const localVarAxiosArgs = await this.localVarAxiosParamCreator.queryLimitOpenOrders(
|
|
587
|
-
requestParameters?.recvWindow
|
|
588
|
-
);
|
|
589
|
-
return sendRequest2(
|
|
590
|
-
this.configuration,
|
|
591
|
-
localVarAxiosArgs.endpoint,
|
|
592
|
-
localVarAxiosArgs.method,
|
|
593
|
-
localVarAxiosArgs.params,
|
|
594
|
-
localVarAxiosArgs?.timeUnit,
|
|
595
|
-
{ isSigned: true }
|
|
596
|
-
);
|
|
597
|
-
}
|
|
598
|
-
/**
|
|
599
|
-
* Request a quote for the requested token pairs
|
|
600
|
-
*
|
|
601
|
-
* Either fromAmount or toAmount should be sent
|
|
602
|
-
* `quoteId` will be returned only if you have enough funds to convert
|
|
603
|
-
*
|
|
604
|
-
* Weight: 200(UID)
|
|
605
|
-
*
|
|
606
|
-
* @summary Send Quote Request(USER_DATA)
|
|
607
|
-
* @param {SendQuoteRequestRequest} requestParameters Request parameters.
|
|
608
|
-
* @returns {Promise<RestApiResponse<SendQuoteRequestResponse>>}
|
|
609
|
-
* @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
|
|
610
|
-
* @memberof TradeApi
|
|
611
|
-
* @see {@link https://developers.binance.com/docs/convert/trade/Send-quote-request Binance API Documentation}
|
|
612
|
-
*/
|
|
613
|
-
async sendQuoteRequest(requestParameters) {
|
|
614
|
-
const localVarAxiosArgs = await this.localVarAxiosParamCreator.sendQuoteRequest(
|
|
615
|
-
requestParameters?.fromAsset,
|
|
616
|
-
requestParameters?.toAsset,
|
|
617
|
-
requestParameters?.fromAmount,
|
|
618
|
-
requestParameters?.toAmount,
|
|
619
|
-
requestParameters?.walletType,
|
|
620
|
-
requestParameters?.validTime,
|
|
621
|
-
requestParameters?.recvWindow
|
|
622
|
-
);
|
|
623
|
-
return sendRequest2(
|
|
624
|
-
this.configuration,
|
|
625
|
-
localVarAxiosArgs.endpoint,
|
|
626
|
-
localVarAxiosArgs.method,
|
|
627
|
-
localVarAxiosArgs.params,
|
|
628
|
-
localVarAxiosArgs?.timeUnit,
|
|
629
|
-
{ isSigned: true }
|
|
630
|
-
);
|
|
631
|
-
}
|
|
241
|
+
constructor(configuration) {
|
|
242
|
+
this.configuration = configuration;
|
|
243
|
+
this.localVarAxiosParamCreator = TradeApiAxiosParamCreator(configuration);
|
|
244
|
+
}
|
|
245
|
+
/**
|
|
246
|
+
* Accept the offered quote by quote ID.
|
|
247
|
+
*
|
|
248
|
+
* Weight: 500(UID)
|
|
249
|
+
*
|
|
250
|
+
* @summary Accept Quote (TRADE)
|
|
251
|
+
* @param {AcceptQuoteRequest} requestParameters Request parameters.
|
|
252
|
+
* @returns {Promise<RestApiResponse<AcceptQuoteResponse>>}
|
|
253
|
+
* @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
|
|
254
|
+
* @memberof TradeApi
|
|
255
|
+
* @see {@link https://developers.binance.com/docs/convert/trade/Accept-Quote Binance API Documentation}
|
|
256
|
+
*/
|
|
257
|
+
async acceptQuote(requestParameters) {
|
|
258
|
+
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 });
|
|
260
|
+
}
|
|
261
|
+
/**
|
|
262
|
+
* Enable users to cancel a limit order
|
|
263
|
+
*
|
|
264
|
+
* Weight: 200(UID)
|
|
265
|
+
*
|
|
266
|
+
* @summary Cancel limit order (USER_DATA)
|
|
267
|
+
* @param {CancelLimitOrderRequest} requestParameters Request parameters.
|
|
268
|
+
* @returns {Promise<RestApiResponse<CancelLimitOrderResponse>>}
|
|
269
|
+
* @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
|
|
270
|
+
* @memberof TradeApi
|
|
271
|
+
* @see {@link https://developers.binance.com/docs/convert/trade/Cancel-Order Binance API Documentation}
|
|
272
|
+
*/
|
|
273
|
+
async cancelLimitOrder(requestParameters) {
|
|
274
|
+
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 });
|
|
276
|
+
}
|
|
277
|
+
/**
|
|
278
|
+
* Get Convert Trade History
|
|
279
|
+
*
|
|
280
|
+
* The max interval between startTime and endTime is 30 days.
|
|
281
|
+
*
|
|
282
|
+
* Weight: 3000
|
|
283
|
+
*
|
|
284
|
+
* @summary Get Convert Trade History(USER_DATA)
|
|
285
|
+
* @param {GetConvertTradeHistoryRequest} requestParameters Request parameters.
|
|
286
|
+
* @returns {Promise<RestApiResponse<GetConvertTradeHistoryResponse>>}
|
|
287
|
+
* @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
|
|
288
|
+
* @memberof TradeApi
|
|
289
|
+
* @see {@link https://developers.binance.com/docs/convert/trade/Get-Convert-Trade-History Binance API Documentation}
|
|
290
|
+
*/
|
|
291
|
+
async getConvertTradeHistory(requestParameters) {
|
|
292
|
+
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 });
|
|
294
|
+
}
|
|
295
|
+
/**
|
|
296
|
+
* Query order status by order ID.
|
|
297
|
+
*
|
|
298
|
+
* Weight: 100(UID)
|
|
299
|
+
*
|
|
300
|
+
* @summary Order status(USER_DATA)
|
|
301
|
+
* @param {OrderStatusRequest} requestParameters Request parameters.
|
|
302
|
+
* @returns {Promise<RestApiResponse<OrderStatusResponse>>}
|
|
303
|
+
* @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
|
|
304
|
+
* @memberof TradeApi
|
|
305
|
+
* @see {@link https://developers.binance.com/docs/convert/trade/Order-Status Binance API Documentation}
|
|
306
|
+
*/
|
|
307
|
+
async orderStatus(requestParameters = {}) {
|
|
308
|
+
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 });
|
|
310
|
+
}
|
|
311
|
+
/**
|
|
312
|
+
* Enable users to place a limit order
|
|
313
|
+
*
|
|
314
|
+
* `baseAsset` or `quoteAsset` can be determined via `exchangeInfo` endpoint.
|
|
315
|
+
* Limit price is defined from `baseAsset` to `quoteAsset`.
|
|
316
|
+
* Either `baseAmount` or `quoteAmount` is used.
|
|
317
|
+
*
|
|
318
|
+
* Weight: 500(UID)
|
|
319
|
+
*
|
|
320
|
+
* @summary Place limit order (USER_DATA)
|
|
321
|
+
* @param {PlaceLimitOrderRequest} requestParameters Request parameters.
|
|
322
|
+
* @returns {Promise<RestApiResponse<PlaceLimitOrderResponse>>}
|
|
323
|
+
* @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
|
|
324
|
+
* @memberof TradeApi
|
|
325
|
+
* @see {@link https://developers.binance.com/docs/convert/trade/Place-Order Binance API Documentation}
|
|
326
|
+
*/
|
|
327
|
+
async placeLimitOrder(requestParameters) {
|
|
328
|
+
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 });
|
|
330
|
+
}
|
|
331
|
+
/**
|
|
332
|
+
* Request a quote for the requested token pairs
|
|
333
|
+
*
|
|
334
|
+
* Weight: 3000(UID)
|
|
335
|
+
*
|
|
336
|
+
* @summary Query limit open orders (USER_DATA)
|
|
337
|
+
* @param {QueryLimitOpenOrdersRequest} requestParameters Request parameters.
|
|
338
|
+
* @returns {Promise<RestApiResponse<QueryLimitOpenOrdersResponse>>}
|
|
339
|
+
* @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
|
|
340
|
+
* @memberof TradeApi
|
|
341
|
+
* @see {@link https://developers.binance.com/docs/convert/trade/Query-Order Binance API Documentation}
|
|
342
|
+
*/
|
|
343
|
+
async queryLimitOpenOrders(requestParameters = {}) {
|
|
344
|
+
const localVarAxiosArgs = await this.localVarAxiosParamCreator.queryLimitOpenOrders(requestParameters?.recvWindow);
|
|
345
|
+
return sendRequest(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.params, localVarAxiosArgs?.timeUnit, { isSigned: true });
|
|
346
|
+
}
|
|
347
|
+
/**
|
|
348
|
+
* Request a quote for the requested token pairs
|
|
349
|
+
*
|
|
350
|
+
* Either fromAmount or toAmount should be sent
|
|
351
|
+
* `quoteId` will be returned only if you have enough funds to convert
|
|
352
|
+
*
|
|
353
|
+
* Weight: 200(UID)
|
|
354
|
+
*
|
|
355
|
+
* @summary Send Quote Request(USER_DATA)
|
|
356
|
+
* @param {SendQuoteRequestRequest} requestParameters Request parameters.
|
|
357
|
+
* @returns {Promise<RestApiResponse<SendQuoteRequestResponse>>}
|
|
358
|
+
* @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
|
|
359
|
+
* @memberof TradeApi
|
|
360
|
+
* @see {@link https://developers.binance.com/docs/convert/trade/Send-quote-request Binance API Documentation}
|
|
361
|
+
*/
|
|
362
|
+
async sendQuoteRequest(requestParameters) {
|
|
363
|
+
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 });
|
|
365
|
+
}
|
|
632
366
|
};
|
|
633
367
|
|
|
634
|
-
|
|
635
|
-
|
|
368
|
+
//#endregion
|
|
369
|
+
//#region src/rest-api/rest-api.ts
|
|
370
|
+
/**
|
|
371
|
+
* Binance Convert REST API
|
|
372
|
+
*
|
|
373
|
+
* OpenAPI Specification for the Binance Convert REST API
|
|
374
|
+
*
|
|
375
|
+
* The version of the OpenAPI document: 1.0.0
|
|
376
|
+
*
|
|
377
|
+
*
|
|
378
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
379
|
+
* https://openapi-generator.tech
|
|
380
|
+
* Do not edit the class manually.
|
|
381
|
+
*/
|
|
636
382
|
var RestAPI = class {
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
return this.tradeApi.sendQuoteRequest(requestParameters);
|
|
812
|
-
}
|
|
383
|
+
constructor(configuration) {
|
|
384
|
+
this.configuration = configuration;
|
|
385
|
+
this.marketDataApi = new MarketDataApi(configuration);
|
|
386
|
+
this.tradeApi = new TradeApi(configuration);
|
|
387
|
+
}
|
|
388
|
+
/**
|
|
389
|
+
* Generic function to send a request.
|
|
390
|
+
* @param endpoint - The API endpoint to call.
|
|
391
|
+
* @param method - HTTP method to use (GET, POST, DELETE, etc.).
|
|
392
|
+
* @param params - Query parameters for the request.
|
|
393
|
+
*
|
|
394
|
+
* @returns A promise resolving to the response data object.
|
|
395
|
+
*/
|
|
396
|
+
sendRequest(endpoint, method, params = {}) {
|
|
397
|
+
return sendRequest(this.configuration, endpoint, method, params, void 0);
|
|
398
|
+
}
|
|
399
|
+
/**
|
|
400
|
+
* Generic function to send a signed request.
|
|
401
|
+
* @param endpoint - The API endpoint to call.
|
|
402
|
+
* @param method - HTTP method to use (GET, POST, DELETE, etc.).
|
|
403
|
+
* @param params - Query parameters for the request.
|
|
404
|
+
*
|
|
405
|
+
* @returns A promise resolving to the response data object.
|
|
406
|
+
*/
|
|
407
|
+
sendSignedRequest(endpoint, method, params = {}) {
|
|
408
|
+
return sendRequest(this.configuration, endpoint, method, params, void 0, { isSigned: true });
|
|
409
|
+
}
|
|
410
|
+
/**
|
|
411
|
+
* Query for all convertible token pairs and the tokens’ respective upper/lower limits
|
|
412
|
+
*
|
|
413
|
+
* User needs to supply either or both of the input parameter
|
|
414
|
+
* If not defined for both fromAsset and toAsset, only partial token pairs will be returned
|
|
415
|
+
*
|
|
416
|
+
* Weight: 3000(IP)
|
|
417
|
+
*
|
|
418
|
+
* @summary List All Convert Pairs
|
|
419
|
+
* @param {ListAllConvertPairsRequest} requestParameters Request parameters.
|
|
420
|
+
*
|
|
421
|
+
* @returns {Promise<RestApiResponse<ListAllConvertPairsResponse>>}
|
|
422
|
+
* @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
|
|
423
|
+
* @see {@link https://developers.binance.com/docs/convert/market-data/ Binance API Documentation}
|
|
424
|
+
*/
|
|
425
|
+
listAllConvertPairs(requestParameters = {}) {
|
|
426
|
+
return this.marketDataApi.listAllConvertPairs(requestParameters);
|
|
427
|
+
}
|
|
428
|
+
/**
|
|
429
|
+
* Query for supported asset’s precision information
|
|
430
|
+
*
|
|
431
|
+
* Weight: 100(IP)
|
|
432
|
+
*
|
|
433
|
+
* @summary Query order quantity precision per asset(USER_DATA)
|
|
434
|
+
* @param {QueryOrderQuantityPrecisionPerAssetRequest} requestParameters Request parameters.
|
|
435
|
+
*
|
|
436
|
+
* @returns {Promise<RestApiResponse<QueryOrderQuantityPrecisionPerAssetResponse>>}
|
|
437
|
+
* @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
|
|
438
|
+
* @see {@link https://developers.binance.com/docs/convert/market-data/Query-order-quantity-precision-per-asset Binance API Documentation}
|
|
439
|
+
*/
|
|
440
|
+
queryOrderQuantityPrecisionPerAsset(requestParameters = {}) {
|
|
441
|
+
return this.marketDataApi.queryOrderQuantityPrecisionPerAsset(requestParameters);
|
|
442
|
+
}
|
|
443
|
+
/**
|
|
444
|
+
* Accept the offered quote by quote ID.
|
|
445
|
+
*
|
|
446
|
+
* Weight: 500(UID)
|
|
447
|
+
*
|
|
448
|
+
* @summary Accept Quote (TRADE)
|
|
449
|
+
* @param {AcceptQuoteRequest} requestParameters Request parameters.
|
|
450
|
+
*
|
|
451
|
+
* @returns {Promise<RestApiResponse<AcceptQuoteResponse>>}
|
|
452
|
+
* @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
|
|
453
|
+
* @see {@link https://developers.binance.com/docs/convert/trade/Accept-Quote Binance API Documentation}
|
|
454
|
+
*/
|
|
455
|
+
acceptQuote(requestParameters) {
|
|
456
|
+
return this.tradeApi.acceptQuote(requestParameters);
|
|
457
|
+
}
|
|
458
|
+
/**
|
|
459
|
+
* Enable users to cancel a limit order
|
|
460
|
+
*
|
|
461
|
+
* Weight: 200(UID)
|
|
462
|
+
*
|
|
463
|
+
* @summary Cancel limit order (USER_DATA)
|
|
464
|
+
* @param {CancelLimitOrderRequest} requestParameters Request parameters.
|
|
465
|
+
*
|
|
466
|
+
* @returns {Promise<RestApiResponse<CancelLimitOrderResponse>>}
|
|
467
|
+
* @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
|
|
468
|
+
* @see {@link https://developers.binance.com/docs/convert/trade/Cancel-Order Binance API Documentation}
|
|
469
|
+
*/
|
|
470
|
+
cancelLimitOrder(requestParameters) {
|
|
471
|
+
return this.tradeApi.cancelLimitOrder(requestParameters);
|
|
472
|
+
}
|
|
473
|
+
/**
|
|
474
|
+
* Get Convert Trade History
|
|
475
|
+
*
|
|
476
|
+
* The max interval between startTime and endTime is 30 days.
|
|
477
|
+
*
|
|
478
|
+
* Weight: 3000
|
|
479
|
+
*
|
|
480
|
+
* @summary Get Convert Trade History(USER_DATA)
|
|
481
|
+
* @param {GetConvertTradeHistoryRequest} requestParameters Request parameters.
|
|
482
|
+
*
|
|
483
|
+
* @returns {Promise<RestApiResponse<GetConvertTradeHistoryResponse>>}
|
|
484
|
+
* @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
|
|
485
|
+
* @see {@link https://developers.binance.com/docs/convert/trade/Get-Convert-Trade-History Binance API Documentation}
|
|
486
|
+
*/
|
|
487
|
+
getConvertTradeHistory(requestParameters) {
|
|
488
|
+
return this.tradeApi.getConvertTradeHistory(requestParameters);
|
|
489
|
+
}
|
|
490
|
+
/**
|
|
491
|
+
* Query order status by order ID.
|
|
492
|
+
*
|
|
493
|
+
* Weight: 100(UID)
|
|
494
|
+
*
|
|
495
|
+
* @summary Order status(USER_DATA)
|
|
496
|
+
* @param {OrderStatusRequest} requestParameters Request parameters.
|
|
497
|
+
*
|
|
498
|
+
* @returns {Promise<RestApiResponse<OrderStatusResponse>>}
|
|
499
|
+
* @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
|
|
500
|
+
* @see {@link https://developers.binance.com/docs/convert/trade/Order-Status Binance API Documentation}
|
|
501
|
+
*/
|
|
502
|
+
orderStatus(requestParameters = {}) {
|
|
503
|
+
return this.tradeApi.orderStatus(requestParameters);
|
|
504
|
+
}
|
|
505
|
+
/**
|
|
506
|
+
* Enable users to place a limit order
|
|
507
|
+
*
|
|
508
|
+
* `baseAsset` or `quoteAsset` can be determined via `exchangeInfo` endpoint.
|
|
509
|
+
* Limit price is defined from `baseAsset` to `quoteAsset`.
|
|
510
|
+
* Either `baseAmount` or `quoteAmount` is used.
|
|
511
|
+
*
|
|
512
|
+
* Weight: 500(UID)
|
|
513
|
+
*
|
|
514
|
+
* @summary Place limit order (USER_DATA)
|
|
515
|
+
* @param {PlaceLimitOrderRequest} requestParameters Request parameters.
|
|
516
|
+
*
|
|
517
|
+
* @returns {Promise<RestApiResponse<PlaceLimitOrderResponse>>}
|
|
518
|
+
* @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
|
|
519
|
+
* @see {@link https://developers.binance.com/docs/convert/trade/Place-Order Binance API Documentation}
|
|
520
|
+
*/
|
|
521
|
+
placeLimitOrder(requestParameters) {
|
|
522
|
+
return this.tradeApi.placeLimitOrder(requestParameters);
|
|
523
|
+
}
|
|
524
|
+
/**
|
|
525
|
+
* Request a quote for the requested token pairs
|
|
526
|
+
*
|
|
527
|
+
* Weight: 3000(UID)
|
|
528
|
+
*
|
|
529
|
+
* @summary Query limit open orders (USER_DATA)
|
|
530
|
+
* @param {QueryLimitOpenOrdersRequest} requestParameters Request parameters.
|
|
531
|
+
*
|
|
532
|
+
* @returns {Promise<RestApiResponse<QueryLimitOpenOrdersResponse>>}
|
|
533
|
+
* @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
|
|
534
|
+
* @see {@link https://developers.binance.com/docs/convert/trade/Query-Order Binance API Documentation}
|
|
535
|
+
*/
|
|
536
|
+
queryLimitOpenOrders(requestParameters = {}) {
|
|
537
|
+
return this.tradeApi.queryLimitOpenOrders(requestParameters);
|
|
538
|
+
}
|
|
539
|
+
/**
|
|
540
|
+
* Request a quote for the requested token pairs
|
|
541
|
+
*
|
|
542
|
+
* Either fromAmount or toAmount should be sent
|
|
543
|
+
* `quoteId` will be returned only if you have enough funds to convert
|
|
544
|
+
*
|
|
545
|
+
* Weight: 200(UID)
|
|
546
|
+
*
|
|
547
|
+
* @summary Send Quote Request(USER_DATA)
|
|
548
|
+
* @param {SendQuoteRequestRequest} requestParameters Request parameters.
|
|
549
|
+
*
|
|
550
|
+
* @returns {Promise<RestApiResponse<SendQuoteRequestResponse>>}
|
|
551
|
+
* @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
|
|
552
|
+
* @see {@link https://developers.binance.com/docs/convert/trade/Send-quote-request Binance API Documentation}
|
|
553
|
+
*/
|
|
554
|
+
sendQuoteRequest(requestParameters) {
|
|
555
|
+
return this.tradeApi.sendQuoteRequest(requestParameters);
|
|
556
|
+
}
|
|
813
557
|
};
|
|
814
558
|
|
|
815
|
-
|
|
559
|
+
//#endregion
|
|
560
|
+
//#region src/rest-api/index.ts
|
|
561
|
+
var rest_api_exports = /* @__PURE__ */ __export({
|
|
562
|
+
MarketDataApi: () => MarketDataApi,
|
|
563
|
+
RestAPI: () => RestAPI,
|
|
564
|
+
TradeApi: () => TradeApi
|
|
565
|
+
});
|
|
566
|
+
|
|
567
|
+
//#endregion
|
|
568
|
+
//#region src/convert.ts
|
|
816
569
|
var Convert = class {
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
}
|
|
831
|
-
}
|
|
570
|
+
constructor(config) {
|
|
571
|
+
const userAgent = buildUserAgent(name, version);
|
|
572
|
+
if (config?.configurationRestAPI) {
|
|
573
|
+
const configRestAPI = new ConfigurationRestAPI(config.configurationRestAPI);
|
|
574
|
+
configRestAPI.basePath = configRestAPI.basePath || CONVERT_REST_API_PROD_URL$1;
|
|
575
|
+
configRestAPI.baseOptions = configRestAPI.baseOptions || {};
|
|
576
|
+
configRestAPI.baseOptions.headers = {
|
|
577
|
+
...configRestAPI.baseOptions.headers || {},
|
|
578
|
+
"User-Agent": userAgent
|
|
579
|
+
};
|
|
580
|
+
this.restAPI = new RestAPI(configRestAPI);
|
|
581
|
+
}
|
|
582
|
+
}
|
|
832
583
|
};
|
|
833
584
|
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
CONVERT_REST_API_PROD_URL as CONVERT_REST_API_PROD_URL2,
|
|
837
|
-
ConnectorClientError,
|
|
838
|
-
RequiredError,
|
|
839
|
-
UnauthorizedError,
|
|
840
|
-
ForbiddenError,
|
|
841
|
-
TooManyRequestsError,
|
|
842
|
-
RateLimitBanError,
|
|
843
|
-
ServerError,
|
|
844
|
-
NetworkError,
|
|
845
|
-
NotFoundError,
|
|
846
|
-
BadRequestError
|
|
847
|
-
} from "@binance/common";
|
|
848
|
-
export {
|
|
849
|
-
BadRequestError,
|
|
850
|
-
CONVERT_REST_API_PROD_URL2 as CONVERT_REST_API_PROD_URL,
|
|
851
|
-
ConnectorClientError,
|
|
852
|
-
Convert,
|
|
853
|
-
rest_api_exports as ConvertRestAPI,
|
|
854
|
-
ForbiddenError,
|
|
855
|
-
NetworkError,
|
|
856
|
-
NotFoundError,
|
|
857
|
-
RateLimitBanError,
|
|
858
|
-
RequiredError,
|
|
859
|
-
ServerError,
|
|
860
|
-
TooManyRequestsError,
|
|
861
|
-
UnauthorizedError
|
|
862
|
-
};
|
|
585
|
+
//#endregion
|
|
586
|
+
export { BadRequestError, CONVERT_REST_API_PROD_URL, ConnectorClientError, Convert, rest_api_exports as ConvertRestAPI, ForbiddenError, NetworkError, NotFoundError, RateLimitBanError, RequiredError, ServerError, TooManyRequestsError, UnauthorizedError };
|
|
863
587
|
//# sourceMappingURL=index.mjs.map
|