ccxt 4.1.33 → 4.1.34

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.33/dist/ccxt.browser.js
214
- * unpkg: https://unpkg.com/ccxt@4.1.33/dist/ccxt.browser.js
213
+ * jsDelivr: https://cdn.jsdelivr.net/npm/ccxt@4.1.34/dist/ccxt.browser.js
214
+ * unpkg: https://unpkg.com/ccxt@4.1.34/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.33/dist/ccxt.browser.js"></script>
219
+ <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/ccxt@4.1.34/dist/ccxt.browser.js"></script>
220
220
  ```
221
221
 
222
222
  Creates a global `ccxt` object:
@@ -21401,13 +21401,13 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
21401
21401
  * @description cancel multiple orders
21402
21402
  * @see https://binance-docs.github.io/apidocs/futures/en/#cancel-multiple-orders-trade
21403
21403
  * @see https://binance-docs.github.io/apidocs/delivery/en/#cancel-multiple-orders-trade
21404
- * @param {[string]} ids order ids
21404
+ * @param {string[]} ids order ids
21405
21405
  * @param {string} [symbol] unified market symbol
21406
21406
  * @param {object} [params] extra parameters specific to the bingx api endpoint
21407
21407
  *
21408
21408
  * EXCHANGE SPECIFIC PARAMETERS
21409
- * @param {[string]} [params.origClientOrderIdList] max length 10 e.g. ["my_id_1","my_id_2"], encode the double quotes. No space after comma
21410
- * @param {[int]} [params.recvWindow]
21409
+ * @param {string[]} [params.origClientOrderIdList] max length 10 e.g. ["my_id_1","my_id_2"], encode the double quotes. No space after comma
21410
+ * @param {int[]} [params.recvWindow]
21411
21411
  * @returns {object} an list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
21412
21412
  */
21413
21413
  this.checkRequiredSymbol('cancelOrders', symbol);
@@ -38720,7 +38720,7 @@ class bitforex extends _abstract_bitforex_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
38720
38720
  * @method
38721
38721
  * @name bitforex#fetchOrder
38722
38722
  * @description fetches information on an order made by the user
38723
- * @see
38723
+ * @see https://apidoc.bitforex.com/#order-information-user_data
38724
38724
  * @param {string} symbol unified symbol of the market the order was made in
38725
38725
  * @param {object} [params] extra parameters specific to the bitforex api endpoint
38726
38726
  * @returns {object} An [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
@@ -111066,7 +111066,7 @@ class digifinex extends _abstract_digifinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["
111066
111066
  'fetchDeposits': true,
111067
111067
  'fetchDepositWithdrawFee': 'emulated',
111068
111068
  'fetchDepositWithdrawFees': true,
111069
- 'fetchFundingHistory': false,
111069
+ 'fetchFundingHistory': true,
111070
111070
  'fetchFundingRate': true,
111071
111071
  'fetchFundingRateHistory': true,
111072
111072
  'fetchFundingRates': false,
@@ -114843,6 +114843,72 @@ class digifinex extends _abstract_digifinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["
114843
114843
  }
114844
114844
  return depositWithdrawFees;
114845
114845
  }
114846
+ async fetchFundingHistory(symbol = undefined, since = undefined, limit = undefined, params = {}) {
114847
+ /**
114848
+ * @method
114849
+ * @name digifinex#fetchFundingHistory
114850
+ * @description fetch the history of funding payments paid and received on this account
114851
+ * @see https://docs.digifinex.com/en-ww/swap/v2/rest.html#funding-fee
114852
+ * @param {string} [symbol] unified market symbol
114853
+ * @param {int} [since] the earliest time in ms to fetch funding history for
114854
+ * @param {int} [limit] the maximum number of funding history structures to retrieve
114855
+ * @param {object} [params] extra parameters specific to the digifinex api endpoint
114856
+ * @param {int} [params.until] timestamp in ms of the latest funding payment
114857
+ * @returns {object} a [funding history structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#funding-history-structure}
114858
+ */
114859
+ await this.loadMarkets();
114860
+ let request = {};
114861
+ [request, params] = this.handleUntilOption('end_timestamp', request, params);
114862
+ let market = undefined;
114863
+ if (symbol !== undefined) {
114864
+ market = this.market(symbol);
114865
+ request['instrument_id'] = market['id'];
114866
+ }
114867
+ if (limit !== undefined) {
114868
+ request['limit'] = limit;
114869
+ }
114870
+ if (since !== undefined) {
114871
+ request['start_timestamp'] = since;
114872
+ }
114873
+ const response = await this.privateSwapGetAccountFundingFee(this.extend(request, params));
114874
+ //
114875
+ // {
114876
+ // "code": 0,
114877
+ // "data": [
114878
+ // {
114879
+ // "instrument_id": "BTCUSDTPERP",
114880
+ // "currency": "USDT",
114881
+ // "amount": "-0.000342814",
114882
+ // "timestamp": 1698768009440
114883
+ // }
114884
+ // ]
114885
+ // }
114886
+ //
114887
+ const data = this.safeValue(response, 'data', []);
114888
+ return this.parseIncomes(data, market, since, limit);
114889
+ }
114890
+ parseIncome(income, market = undefined) {
114891
+ //
114892
+ // {
114893
+ // "instrument_id": "BTCUSDTPERP",
114894
+ // "currency": "USDT",
114895
+ // "amount": "-0.000342814",
114896
+ // "timestamp": 1698768009440
114897
+ // }
114898
+ //
114899
+ const marketId = this.safeString(income, 'instrument_id');
114900
+ const currencyId = this.safeString(income, 'currency');
114901
+ const timestamp = this.safeInteger(income, 'timestamp');
114902
+ return {
114903
+ 'info': income,
114904
+ 'symbol': this.safeSymbol(marketId, market, undefined, 'swap'),
114905
+ 'code': this.safeCurrencyCode(currencyId),
114906
+ 'timestamp': timestamp,
114907
+ 'datetime': this.iso8601(timestamp),
114908
+ 'id': undefined,
114909
+ 'amount': this.safeNumber(income, 'amount'),
114910
+ };
114911
+ }
114846
114912
  sign(path, api = [], method = 'GET', params = {}, headers = undefined, body = undefined) {
114847
114913
  const signed = api[0] === 'private';
114848
114914
  const endpoint = api[1];
@@ -148836,12 +148902,12 @@ class krakenfutures extends _abstract_krakenfutures_js__WEBPACK_IMPORTED_MODULE_
148836
148902
  * @name krakenfutures#cancelOrders
148837
148903
  * @description cancel multiple orders
148838
148904
  * @see https://docs.futures.kraken.com/#http-api-trading-v3-api-order-management-batch-order-management
148839
- * @param {[string]} ids order ids
148905
+ * @param {string[]} ids order ids
148840
148906
  * @param {string} [symbol] unified market symbol
148841
148907
  * @param {object} [params] extra parameters specific to the bingx api endpoint
148842
148908
  *
148843
148909
  * EXCHANGE SPECIFIC PARAMETERS
148844
- * @param {[string]} [params.clientOrderIds] max length 10 e.g. ["my_id_1","my_id_2"]
148910
+ * @param {string[]} [params.clientOrderIds] max length 10 e.g. ["my_id_1","my_id_2"]
148845
148911
  * @returns {object} an list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
148846
148912
  */
148847
148913
  await this.loadMarkets();
@@ -204083,7 +204149,7 @@ class bitget extends _bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
204083
204149
  const instType = market['spot'] ? 'sp' : 'mc';
204084
204150
  let channel = 'books';
204085
204151
  let incrementalFeed = true;
204086
- if ((limit === 5) || (limit === 15)) {
204152
+ if ((limit === 1) || (limit === 5) || (limit === 15)) {
204087
204153
  channel += limit.toString();
204088
204154
  incrementalFeed = false;
204089
204155
  }
@@ -217501,7 +217567,7 @@ class coinex extends _coinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
217501
217567
  * @param {int|undefined} limit the maximum amount of candles to fetch
217502
217568
  * @param {object} params extra parameters specific to the coinex api endpoint
217503
217569
  * @param {int|undefined} params.end the end time for spot markets, this.seconds () is set as default
217504
- * @returns {[[int]]} A list of candles ordered as timestamp, open, high, low, close, volume
217570
+ * @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume
217505
217571
  */
217506
217572
  await this.loadMarkets();
217507
217573
  const market = this.market(symbol);
@@ -222875,9 +222941,8 @@ class hitbtc extends _hitbtc_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
222875
222941
  * @ignore
222876
222942
  * @method
222877
222943
  * @param {string} name websocket endpoint name
222878
- * @param {[string]} [symbols] unified CCXT symbol(s)
222944
+ * @param {string[]} [symbols] unified CCXT symbol(s)
222879
222945
  * @param {object} [params] extra parameters specific to the hitbtc api
222880
- * @returns
222881
222946
  */
222882
222947
  await this.loadMarkets();
222883
222948
  const url = this.urls['api']['ws']['public'];
@@ -222900,7 +222965,6 @@ class hitbtc extends _hitbtc_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
222900
222965
  * @param {string} name websocket endpoint name
222901
222966
  * @param {string} [symbol] unified CCXT symbol
222902
222967
  * @param {object} [params] extra parameters specific to the hitbtc api
222903
- * @returns
222904
222968
  */
222905
222969
  await this.loadMarkets();
222906
222970
  await this.authenticate();
@@ -223354,7 +223418,7 @@ class hitbtc extends _hitbtc_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
223354
223418
  * @param {int} [since] not used by hitbtc watchOHLCV
223355
223419
  * @param {int} [limit] 0 – 1000, default value = 0 (no history returned)
223356
223420
  * @param {object} [params] extra parameters specific to the hitbtc api endpoint
223357
- * @returns {[[int]]} A list of candles ordered as timestamp, open, high, low, close, volume
223421
+ * @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume
223358
223422
  */
223359
223423
  const period = this.safeString(this.timeframes, timeframe, timeframe);
223360
223424
  const name = 'candles/' + period;
@@ -223466,7 +223530,7 @@ class hitbtc extends _hitbtc_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
223466
223530
  * @param {int} [since] timestamp in ms of the earliest order to fetch
223467
223531
  * @param {int} [limit] the maximum amount of orders to fetch
223468
223532
  * @param {object} [params] extra parameters specific to the hitbtc api endpoint
223469
- * @returns {[object]} a list of [order structures]{@link https://docs.ccxt.com/en/latest/manual.html#order-structure}
223533
+ * @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/en/latest/manual.html#order-structure}
223470
223534
  */
223471
223535
  await this.loadMarkets();
223472
223536
  let marketType = undefined;
@@ -223698,7 +223762,7 @@ class hitbtc extends _hitbtc_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
223698
223762
  *
223699
223763
  * EXCHANGE SPECIFIC PARAMETERS
223700
223764
  * @param {string} [params.mode] 'updates' or 'batches' (default), 'updates' = messages arrive after balance updates, 'batches' = messages arrive at equal intervals if there were any updates
223701
- * @returns {[object]} a list of [balance structures]{@link https://docs.ccxt.com/#/?id=balance-structure}
223765
+ * @returns {object[]} a list of [balance structures]{@link https://docs.ccxt.com/#/?id=balance-structure}
223702
223766
  */
223703
223767
  await this.loadMarkets();
223704
223768
  let type = undefined;
@@ -267964,6 +268028,7 @@ class woo extends _abstract_woo_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
267964
268028
  },
267965
268029
  },
267966
268030
  'options': {
268031
+ 'sandboxMode': false,
267967
268032
  'createMarketBuyOrderRequiresPrice': true,
267968
268033
  // these network aliases require manual mapping here
267969
268034
  'network-aliases-for-tokens': {
@@ -269870,14 +269935,17 @@ class woo extends _abstract_woo_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
269870
269935
  else {
269871
269936
  this.checkRequiredCredentials();
269872
269937
  if (method === 'POST' && (path === 'algo/order' || path === 'order')) {
269873
- const applicationId = 'bc830de7-50f3-460b-9ee0-f430f83f9dad';
269874
- const brokerId = this.safeString(this.options, 'brokerId', applicationId);
269875
- const isStop = path.indexOf('algo') > -1;
269876
- if (isStop) {
269877
- params['brokerId'] = brokerId;
269878
- }
269879
- else {
269880
- params['broker_id'] = brokerId;
269938
+ const isSandboxMode = this.safeValue(this.options, 'sandboxMode', false);
269939
+ if (!isSandboxMode) {
269940
+ const applicationId = 'bc830de7-50f3-460b-9ee0-f430f83f9dad';
269941
+ const brokerId = this.safeString(this.options, 'brokerId', applicationId);
269942
+ const isStop = path.indexOf('algo') > -1;
269943
+ if (isStop) {
269944
+ params['brokerId'] = brokerId;
269945
+ }
269946
+ else {
269947
+ params['broker_id'] = brokerId;
269948
+ }
269881
269949
  }
269882
269950
  params = this.keysort(params);
269883
269951
  }
@@ -270333,6 +270401,10 @@ class woo extends _abstract_woo_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
270333
270401
  // if it was not returned according to above options, then return the first network of currency
270334
270402
  return this.safeValue(networkKeys, 0);
270335
270403
  }
270404
+ setSandboxMode(enable) {
270405
+ super.setSandboxMode(enable);
270406
+ this.options['sandboxMode'] = enable;
270407
+ }
270336
270408
  }
270337
270409
 
270338
270410
 
@@ -279882,7 +279954,7 @@ SOFTWARE.
279882
279954
 
279883
279955
  //-----------------------------------------------------------------------------
279884
279956
  // this is updated by vss.js when building
279885
- const version = '4.1.33';
279957
+ const version = '4.1.34';
279886
279958
  _src_base_Exchange_js__WEBPACK_IMPORTED_MODULE_0__/* .Exchange.ccxtVersion */ .e.ccxtVersion = version;
279887
279959
  //-----------------------------------------------------------------------------
279888
279960