ccxt 4.1.23 → 4.1.24

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/README.md CHANGED
@@ -210,13 +210,13 @@ console.log(version, Object.keys(exchanges));
210
210
 
211
211
  All-in-one browser bundle (dependencies included), served from a CDN of your choice:
212
212
 
213
- * jsDelivr: https://cdn.jsdelivr.net/npm/ccxt@4.1.23/dist/ccxt.browser.js
214
- * unpkg: https://unpkg.com/ccxt@4.1.23/dist/ccxt.browser.js
213
+ * jsDelivr: https://cdn.jsdelivr.net/npm/ccxt@4.1.24/dist/ccxt.browser.js
214
+ * unpkg: https://unpkg.com/ccxt@4.1.24/dist/ccxt.browser.js
215
215
 
216
216
  CDNs are not updated in real-time and may have delays. Defaulting to the most recent version without specifying the version number is not recommended. Please, keep in mind that we are not responsible for the correct operation of those CDN servers.
217
217
 
218
218
  ```HTML
219
- <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/ccxt@4.1.23/dist/ccxt.browser.js"></script>
219
+ <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/ccxt@4.1.24/dist/ccxt.browser.js"></script>
220
220
  ```
221
221
 
222
222
  Creates a global `ccxt` object:
@@ -16288,7 +16288,6 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
16288
16288
  'v1': 'https://testnet.binance.vision/api/v1',
16289
16289
  },
16290
16290
  'api': {
16291
- 'wapi': 'https://api.binance.com/wapi/v3',
16292
16291
  'sapi': 'https://api.binance.com/sapi/v1',
16293
16292
  'sapiV2': 'https://api.binance.com/sapi/v2',
16294
16293
  'sapiV3': 'https://api.binance.com/sapi/v3',
@@ -16732,27 +16731,6 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
16732
16731
  'sub-account/assets': 0.40002, // Weight(UID): 60 => cost = 0.006667 * 60 = 0.40002
16733
16732
  },
16734
16733
  },
16735
- // deprecated
16736
- 'wapi': {
16737
- 'post': {
16738
- 'withdraw': 1,
16739
- 'sub-account/transfer': 1,
16740
- },
16741
- 'get': {
16742
- 'depositHistory': 1,
16743
- 'withdrawHistory': 1,
16744
- 'depositAddress': 1,
16745
- 'accountStatus': 1,
16746
- 'systemStatus': 1,
16747
- 'apiTradingStatus': 1,
16748
- 'userAssetDribbletLog': 1,
16749
- 'tradeFee': 1,
16750
- 'assetDetail': 1,
16751
- 'sub-account/list': 1,
16752
- 'sub-account/transfer/history': 1,
16753
- 'sub-account/assets': 1,
16754
- },
16755
- },
16756
16734
  'dapiPublic': {
16757
16735
  'get': {
16758
16736
  'ping': 1,
@@ -16866,6 +16844,7 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
16866
16844
  },
16867
16845
  'fapiData': {
16868
16846
  'get': {
16847
+ 'delivery-price': 1,
16869
16848
  'openInterestHist': 1,
16870
16849
  'topLongShortAccountRatio': 1,
16871
16850
  'topLongShortPositionRatio': 1,
@@ -24546,9 +24525,6 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
24546
24525
  }
24547
24526
  let url = this.urls['api'][api];
24548
24527
  url += '/' + path;
24549
- if (api === 'wapi') {
24550
- url += '.html';
24551
- }
24552
24528
  if (path === 'historicalTrades') {
24553
24529
  if (this.apiKey) {
24554
24530
  headers = {
@@ -24575,7 +24551,7 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
24575
24551
  throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.AuthenticationError(this.id + ' userDataStream endpoint requires `apiKey` credential');
24576
24552
  }
24577
24553
  }
24578
- else if ((api === 'private') || (api === 'eapiPrivate') || (api === 'sapi' && path !== 'system/status') || (api === 'sapiV2') || (api === 'sapiV3') || (api === 'sapiV4') || (api === 'wapi' && path !== 'systemStatus') || (api === 'dapiPrivate') || (api === 'dapiPrivateV2') || (api === 'fapiPrivate') || (api === 'fapiPrivateV2') || (api === 'papi')) {
24554
+ else if ((api === 'private') || (api === 'eapiPrivate') || (api === 'sapi' && path !== 'system/status') || (api === 'sapiV2') || (api === 'sapiV3') || (api === 'sapiV4') || (api === 'dapiPrivate') || (api === 'dapiPrivateV2') || (api === 'fapiPrivate') || (api === 'fapiPrivateV2') || (api === 'papi')) {
24579
24555
  this.checkRequiredCredentials();
24580
24556
  if (method === 'POST' && ((path === 'order') || (path === 'sor/order'))) {
24581
24557
  // inject in implicit API calls
@@ -24637,7 +24613,7 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
24637
24613
  headers = {
24638
24614
  'X-MBX-APIKEY': this.apiKey,
24639
24615
  };
24640
- if ((method === 'GET') || (method === 'DELETE') || (api === 'wapi')) {
24616
+ if ((method === 'GET') || (method === 'DELETE')) {
24641
24617
  url += '?' + query;
24642
24618
  }
24643
24619
  else {
@@ -24673,7 +24649,6 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
24673
24649
  if (response === undefined) {
24674
24650
  return undefined; // fallback to default error handler
24675
24651
  }
24676
- // check success value for wapi endpoints
24677
24652
  // response in format {'msg': 'The coin does not exist.', 'success': true/false}
24678
24653
  const success = this.safeValue(response, 'success', true);
24679
24654
  if (!success) {
@@ -24764,7 +24739,7 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
24764
24739
  async request(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined, config = {}, context = {}) {
24765
24740
  const response = await this.fetch2(path, api, method, params, headers, body, config);
24766
24741
  // a workaround for {"code":-2015,"msg":"Invalid API-key, IP, or permissions for action."}
24767
- if ((api === 'private') || (api === 'wapi')) {
24742
+ if (api === 'private') {
24768
24743
  this.options['hasAlreadyAuthenticatedSuccessfully'] = true;
24769
24744
  }
24770
24745
  return response;
@@ -47927,7 +47902,7 @@ class bitmart extends _abstract_bitmart_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
47927
47902
  '7': 'canceling',
47928
47903
  '8': 'canceled',
47929
47904
  'new': 'open',
47930
- 'partially_filled': 'filled',
47905
+ 'partially_filled': 'open',
47931
47906
  'filled': 'filled',
47932
47907
  'partially_canceled': 'canceled',
47933
47908
  },
@@ -146241,6 +146216,7 @@ class krakenfutures extends _abstract_krakenfutures_js__WEBPACK_IMPORTED_MODULE_
146241
146216
  'option': false,
146242
146217
  'cancelAllOrders': true,
146243
146218
  'cancelOrder': true,
146219
+ 'cancelOrders': true,
146244
146220
  'createMarketOrder': false,
146245
146221
  'createOrder': true,
146246
146222
  'editOrder': true,
@@ -147171,6 +147147,70 @@ class krakenfutures extends _abstract_krakenfutures_js__WEBPACK_IMPORTED_MODULE_
147171
147147
  }
147172
147148
  return this.extend({ 'info': response }, order);
147173
147149
  }
147150
+ async cancelOrders(ids, symbol = undefined, params = {}) {
147151
+ /**
147152
+ * @method
147153
+ * @name krakenfutures#cancelOrders
147154
+ * @description cancel multiple orders
147155
+ * @see https://docs.futures.kraken.com/#http-api-trading-v3-api-order-management-batch-order-management
147156
+ * @param {[string]} ids order ids
147157
+ * @param {string} [symbol] unified market symbol
147158
+ * @param {object} [params] extra parameters specific to the bingx api endpoint
147159
+ *
147160
+ * EXCHANGE SPECIFIC PARAMETERS
147161
+ * @param {[string]} [params.clientOrderIds] max length 10 e.g. ["my_id_1","my_id_2"]
147162
+ * @returns {object} an list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
147163
+ */
147164
+ await this.loadMarkets();
147165
+ const orders = [];
147166
+ const clientOrderIds = this.safeValue(params, 'clientOrderIds', []);
147167
+ const clientOrderIdsLength = clientOrderIds.length;
147168
+ if (clientOrderIdsLength > 0) {
147169
+ for (let i = 0; i < clientOrderIds.length; i++) {
147170
+ orders.push({ 'order': 'cancel', 'cliOrdId': clientOrderIds[i] });
147171
+ }
147172
+ }
147173
+ else {
147174
+ for (let i = 0; i < ids.length; i++) {
147175
+ orders.push({ 'order': 'cancel', 'order_id': ids[i] });
147176
+ }
147177
+ }
147178
+ const request = {
147179
+ 'batchOrder': orders,
147180
+ };
147181
+ const response = await this.privatePostBatchorder(this.extend(request, params));
147182
+ // {
147183
+ // result: 'success',
147184
+ // serverTime: '2023-10-23T16:36:51.327Z',
147185
+ // batchStatus: [
147186
+ // {
147187
+ // status: 'cancelled',
147188
+ // order_id: '101c2327-f12e-45f2-8445-7502b87afc0b',
147189
+ // orderEvents: [
147190
+ // {
147191
+ // uid: '101c2327-f12e-45f2-8445-7502b87afc0b',
147192
+ // order: {
147193
+ // orderId: '101c2327-f12e-45f2-8445-7502b87afc0b',
147194
+ // cliOrdId: null,
147195
+ // type: 'lmt',
147196
+ // symbol: 'PF_LTCUSD',
147197
+ // side: 'buy',
147198
+ // quantity: '0.10000000000',
147199
+ // filled: '0E-11',
147200
+ // limitPrice: '50.00000000000',
147201
+ // reduceOnly: false,
147202
+ // timestamp: '2023-10-20T10:29:13.005Z',
147203
+ // lastUpdateTimestamp: '2023-10-20T10:29:13.005Z'
147204
+ // },
147205
+ // type: 'CANCEL'
147206
+ // }
147207
+ // ]
147208
+ // }
147209
+ // ]
147210
+ // }
147211
+ const batchStatus = this.safeValue(response, 'batchStatus', []);
147212
+ return this.parseOrders(batchStatus);
147213
+ }
147174
147214
  async cancelAllOrders(symbol = undefined, params = {}) {
147175
147215
  /**
147176
147216
  * @method
@@ -148357,7 +148397,11 @@ class krakenfutures extends _abstract_krakenfutures_js__WEBPACK_IMPORTED_MODULE_
148357
148397
  params = this.omit(params, this.extractParams(path));
148358
148398
  let query = endpoint;
148359
148399
  let postData = '';
148360
- if (Object.keys(params).length) {
148400
+ if (path === 'batchorder') {
148401
+ postData = 'json=' + this.json(params);
148402
+ body = postData;
148403
+ }
148404
+ else if (Object.keys(params).length) {
148361
148405
  postData = this.urlencode(params);
148362
148406
  query += '?' + postData;
148363
148407
  }
@@ -148372,7 +148416,8 @@ class krakenfutures extends _abstract_krakenfutures_js__WEBPACK_IMPORTED_MODULE_
148372
148416
  const secret = this.base64ToBinary(this.secret); // 3
148373
148417
  const signature = this.hmac(hash, secret, _static_dependencies_noble_hashes_sha512_js__WEBPACK_IMPORTED_MODULE_5__/* .sha512 */ .o, 'base64'); // 4-5
148374
148418
  headers = {
148375
- 'Content-Type': 'application/json',
148419
+ 'Content-Type': 'application/x-www-form-urlencoded',
148420
+ 'Accept': 'application/json',
148376
148421
  'APIKey': this.apiKey,
148377
148422
  'Authent': signature,
148378
148423
  };
@@ -277701,7 +277746,7 @@ SOFTWARE.
277701
277746
 
277702
277747
  //-----------------------------------------------------------------------------
277703
277748
  // this is updated by vss.js when building
277704
- const version = '4.1.23';
277749
+ const version = '4.1.24';
277705
277750
  _src_base_Exchange_js__WEBPACK_IMPORTED_MODULE_0__/* .Exchange.ccxtVersion */ .e.ccxtVersion = version;
277706
277751
  //-----------------------------------------------------------------------------
277707
277752