ccxt 4.2.41 → 4.2.43

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.2.41/dist/ccxt.browser.js
214
- * unpkg: https://unpkg.com/ccxt@4.2.41/dist/ccxt.browser.js
213
+ * jsDelivr: https://cdn.jsdelivr.net/npm/ccxt@4.2.43/dist/ccxt.browser.js
214
+ * unpkg: https://unpkg.com/ccxt@4.2.43/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.2.41/dist/ccxt.browser.js"></script>
219
+ <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/ccxt@4.2.43/dist/ccxt.browser.js"></script>
220
220
  ```
221
221
 
222
222
  Creates a global `ccxt` object:
@@ -8975,6 +8975,15 @@ class Exchange {
8975
8975
  async setPositionMode(hedged, symbol = undefined, params = {}) {
8976
8976
  throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__.NotSupported(this.id + ' setPositionMode() is not supported yet');
8977
8977
  }
8978
+ async addMargin(symbol, amount, params = {}) {
8979
+ throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__.NotSupported(this.id + ' addMargin() is not supported yet');
8980
+ }
8981
+ async reduceMargin(symbol, amount, params = {}) {
8982
+ throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__.NotSupported(this.id + ' reduceMargin() is not supported yet');
8983
+ }
8984
+ async setMargin(symbol, amount, params = {}) {
8985
+ throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__.NotSupported(this.id + ' setMargin() is not supported yet');
8986
+ }
8978
8987
  async setMarginMode(marginMode, symbol = undefined, params = {}) {
8979
8988
  throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__.NotSupported(this.id + ' setMarginMode() is not supported yet');
8980
8989
  }
@@ -24200,8 +24209,9 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
24200
24209
  * @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [availble parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
24201
24210
  * @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
24202
24211
  */
24203
- const orders = await this.fetchOrders(symbol, since, limit, params);
24204
- return this.filterBy(orders, 'status', 'closed');
24212
+ const orders = await this.fetchOrders(symbol, since, undefined, params);
24213
+ const filteredOrders = this.filterBy(orders, 'status', 'closed');
24214
+ return this.filterBySinceLimit(filteredOrders, since, limit);
24205
24215
  }
24206
24216
  async fetchCanceledOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
24207
24217
  /**
@@ -46879,7 +46889,10 @@ class bitget extends _abstract_bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
46879
46889
  await this.loadMarkets();
46880
46890
  const networkCode = this.safeString2(params, 'chain', 'network');
46881
46891
  params = this.omit(params, 'network');
46882
- const networkId = this.networkCodeToId(networkCode, code);
46892
+ let networkId = undefined;
46893
+ if (networkCode !== undefined) {
46894
+ networkId = this.networkCodeToId(networkCode, code);
46895
+ }
46883
46896
  const currency = this.currency(code);
46884
46897
  const request = {
46885
46898
  'coin': currency['code'],
@@ -46918,11 +46931,15 @@ class bitget extends _abstract_bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
46918
46931
  const currencyId = this.safeString(depositAddress, 'coin');
46919
46932
  const networkId = this.safeString(depositAddress, 'chain');
46920
46933
  const parsedCurrency = this.safeCurrencyCode(currencyId, currency);
46934
+ let network = undefined;
46935
+ if (networkId !== undefined) {
46936
+ network = this.networkIdToCode(networkId, parsedCurrency);
46937
+ }
46921
46938
  return {
46922
46939
  'currency': parsedCurrency,
46923
46940
  'address': this.safeString(depositAddress, 'address'),
46924
46941
  'tag': this.safeString(depositAddress, 'tag'),
46925
- 'network': this.networkIdToCode(networkId, parsedCurrency),
46942
+ 'network': network,
46926
46943
  'info': depositAddress,
46927
46944
  };
46928
46945
  }
@@ -65817,28 +65834,20 @@ class bitrue extends _abstract_bitrue_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
65817
65834
  this.checkAddress(address);
65818
65835
  await this.loadMarkets();
65819
65836
  const currency = this.currency(code);
65820
- let chainName = this.safeString2(params, 'network', 'chainName');
65821
- if (chainName === undefined) {
65822
- const networks = this.safeValue(currency, 'networks', {});
65823
- const optionsNetworks = this.safeValue(this.options, 'networks', {});
65824
- let network = this.safeStringUpper(params, 'network'); // this line allows the user to specify either ERC20 or ETH
65825
- network = this.safeString(optionsNetworks, network, network);
65826
- const networkEntry = this.safeValue(networks, network, {});
65827
- chainName = this.safeString(networkEntry, 'id'); // handle ERC20>ETH alias
65828
- if (chainName === undefined) {
65829
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ArgumentsRequired(this.id + ' withdraw() requires a network parameter or a chainName parameter');
65830
- }
65831
- params = this.omit(params, 'network');
65832
- }
65833
65837
  const request = {
65834
- 'coin': currency['id'].toUpperCase(),
65838
+ 'coin': currency['id'],
65835
65839
  'amount': amount,
65836
65840
  'addressTo': address,
65837
- 'chainName': chainName, // 'ERC20', 'TRC20', 'SOL'
65841
+ // 'chainName': chainName, // 'ERC20', 'TRC20', 'SOL'
65838
65842
  // 'addressMark': '', // mark of address
65839
65843
  // 'addrType': '', // type of address
65840
65844
  // 'tag': tag,
65841
65845
  };
65846
+ let networkCode = undefined;
65847
+ [networkCode, params] = this.handleNetworkCodeAndParams(params);
65848
+ if (networkCode !== undefined) {
65849
+ request['chainName'] = this.networkCodeToId(networkCode);
65850
+ }
65842
65851
  if (tag !== undefined) {
65843
65852
  request['tag'] = tag;
65844
65853
  }
@@ -124444,7 +124453,10 @@ class digifinex extends _abstract_digifinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["
124444
124453
  const minFoundPrecision = _base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise */ .O.stringMin(feeString, _base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise */ .O.stringMin(minDepositString, minWithdrawString));
124445
124454
  const precision = this.parseNumber(minFoundPrecision);
124446
124455
  const networkId = this.safeString(currency, 'chain');
124447
- const networkCode = this.networkIdToCode(networkId);
124456
+ let networkCode = undefined;
124457
+ if (networkId !== undefined) {
124458
+ networkCode = this.networkIdToCode(networkId);
124459
+ }
124448
124460
  const network = {
124449
124461
  'info': currency,
124450
124462
  'id': networkId,
@@ -132660,7 +132672,10 @@ class gate extends _abstract_gate_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
132660
132672
  const currency = parts[0];
132661
132673
  const code = this.safeCurrencyCode(currency);
132662
132674
  const networkId = this.safeString(entry, 'chain');
132663
- const networkCode = this.networkIdToCode(networkId, code);
132675
+ let networkCode = undefined;
132676
+ if (networkId !== undefined) {
132677
+ networkCode = this.networkIdToCode(networkId, code);
132678
+ }
132664
132679
  const delisted = this.safeValue(entry, 'delisted');
132665
132680
  const withdrawDisabled = this.safeBool(entry, 'withdraw_disabled', false);
132666
132681
  const depositDisabled = this.safeBool(entry, 'deposit_disabled', false);
@@ -138476,7 +138491,10 @@ class gemini extends _abstract_gemini_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
138476
138491
  const precision = this.parseNumber(this.parsePrecision(this.safeString(currency, 5)));
138477
138492
  const networks = {};
138478
138493
  const networkId = this.safeString(currency, 9);
138479
- const networkCode = this.networkIdToCode(networkId);
138494
+ let networkCode = undefined;
138495
+ if (networkId !== undefined) {
138496
+ networkCode = this.networkIdToCode(networkId);
138497
+ }
138480
138498
  if (networkCode !== undefined) {
138481
138499
  networks[networkCode] = {
138482
138500
  'info': currency,
@@ -187086,7 +187104,10 @@ class mexc extends _abstract_mexc_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
187086
187104
  'coin': currency['id'],
187087
187105
  };
187088
187106
  const networkCode = this.safeString(params, 'network');
187089
- const networkId = this.networkCodeToId(networkCode, code);
187107
+ let networkId = undefined;
187108
+ if (networkCode !== undefined) {
187109
+ networkId = this.networkCodeToId(networkCode, code);
187110
+ }
187090
187111
  if (networkId !== undefined) {
187091
187112
  request['network'] = networkId;
187092
187113
  }
@@ -212241,7 +212262,10 @@ class phemex extends _abstract_phemex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
212241
212262
  const currency = this.currency(code);
212242
212263
  let networkCode = undefined;
212243
212264
  [networkCode, params] = this.handleNetworkCodeAndParams(params);
212244
- let networkId = this.networkCodeToId(networkCode);
212265
+ let networkId = undefined;
212266
+ if (networkCode !== undefined) {
212267
+ networkId = this.networkCodeToId(networkCode);
212268
+ }
212245
212269
  const stableCoins = this.safeValue(this.options, 'stableCoins');
212246
212270
  if (networkId === undefined) {
212247
212271
  if (!(this.inArray(code, stableCoins))) {
@@ -213038,7 +213062,10 @@ class poloniex extends _abstract_poloniex_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
213038
213062
  const code = this.safeCurrencyCode(id);
213039
213063
  const name = this.safeString(currency, 'name');
213040
213064
  const networkId = this.safeString(currency, 'blockchain');
213041
- const networkCode = this.networkIdToCode(networkId, code);
213065
+ let networkCode = undefined;
213066
+ if (networkId !== undefined) {
213067
+ networkCode = this.networkIdToCode(networkId, code);
213068
+ }
213042
213069
  const delisted = this.safeValue(currency, 'delisted');
213043
213070
  const walletEnabled = this.safeString(currency, 'walletState') === 'ENABLED';
213044
213071
  const depositEnabled = this.safeString(currency, 'walletDepositState') === 'ENABLED';
@@ -221107,7 +221134,7 @@ class binanceus extends _binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] *
221107
221134
  // eslint-disable-next-line new-cap
221108
221135
  const restInstance = new _binanceus_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z();
221109
221136
  const restDescribe = restInstance.describe();
221110
- const extended = this.deepExtend(super.describe(), restDescribe);
221137
+ const extended = this.deepExtend(restDescribe, super.describe());
221111
221138
  return this.deepExtend(extended, {
221112
221139
  'id': 'binanceus',
221113
221140
  'name': 'Binance US',
@@ -244978,7 +245005,7 @@ class hitbtc extends _hitbtc_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
244978
245005
  await this.loadMarkets();
244979
245006
  await this.authenticate();
244980
245007
  const url = this.urls['api']['ws']['private'];
244981
- const messageHash = this.nonce();
245008
+ const messageHash = this.nonce().toString();
244982
245009
  const subscribe = {
244983
245010
  'method': name,
244984
245011
  'params': params,
@@ -264597,7 +264624,7 @@ class poloniex extends _poloniex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] *
264597
264624
  * @returns {object} data from the websocket stream
264598
264625
  */
264599
264626
  const url = this.urls['api']['ws']['private'];
264600
- const messageHash = this.nonce();
264627
+ const messageHash = this.nonce().toString();
264601
264628
  const subscribe = {
264602
264629
  'id': messageHash,
264603
264630
  'event': name,
@@ -305255,7 +305282,7 @@ SOFTWARE.
305255
305282
 
305256
305283
  //-----------------------------------------------------------------------------
305257
305284
  // this is updated by vss.js when building
305258
- const version = '4.2.41';
305285
+ const version = '4.2.43';
305259
305286
  _src_base_Exchange_js__WEBPACK_IMPORTED_MODULE_0__/* .Exchange */ .e.ccxtVersion = version;
305260
305287
  //-----------------------------------------------------------------------------
305261
305288