ccxt 4.0.84 → 4.0.86

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
@@ -215,13 +215,13 @@ console.log(version, Object.keys(exchanges));
215
215
 
216
216
  All-in-one browser bundle (dependencies included), served from a CDN of your choice:
217
217
 
218
- * jsDelivr: https://cdn.jsdelivr.net/npm/ccxt@4.0.84/dist/ccxt.browser.js
219
- * unpkg: https://unpkg.com/ccxt@4.0.84/dist/ccxt.browser.js
218
+ * jsDelivr: https://cdn.jsdelivr.net/npm/ccxt@4.0.86/dist/ccxt.browser.js
219
+ * unpkg: https://unpkg.com/ccxt@4.0.86/dist/ccxt.browser.js
220
220
 
221
221
  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.
222
222
 
223
223
  ```HTML
224
- <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/ccxt@4.0.84/dist/ccxt.browser.js"></script>
224
+ <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/ccxt@4.0.86/dist/ccxt.browser.js"></script>
225
225
  ```
226
226
 
227
227
  Creates a global `ccxt` object:
@@ -39658,6 +39658,8 @@ class bitget extends _abstract_bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
39658
39658
  /**
39659
39659
  * @method
39660
39660
  * @name bitget#fetchBalance
39661
+ * @see https://bitgetlimited.github.io/apidoc/en/spot/#get-account-assets
39662
+ * @see https://bitgetlimited.github.io/apidoc/en/mix/#get-account-list
39661
39663
  * @description query for balance and get the amount of funds available for trading or funds locked in orders
39662
39664
  * @param {object} [params] extra parameters specific to the bitget api endpoint
39663
39665
  * @returns {object} a [balance structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#balance-structure}
@@ -39722,13 +39724,32 @@ class bitget extends _abstract_bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
39722
39724
  parseBalance(balance) {
39723
39725
  const result = { 'info': balance };
39724
39726
  //
39727
+ // spot
39728
+ //
39729
+ // {
39730
+ // coinId: '1',
39731
+ // coinName: 'BTC',
39732
+ // available: '0.00099900',
39733
+ // frozen: '0.00000000',
39734
+ // lock: '0.00000000',
39735
+ // uTime: '1661595535000'
39736
+ // }
39737
+ //
39738
+ // swap
39739
+ //
39725
39740
  // {
39726
- // coinId: '1',
39727
- // coinName: 'BTC',
39728
- // available: '0.00099900',
39729
- // frozen: '0.00000000',
39730
- // lock: '0.00000000',
39731
- // uTime: '1661595535000'
39741
+ // marginCoin: 'BTC',
39742
+ // locked: '0.00001948',
39743
+ // available: '0.00006622',
39744
+ // crossMaxAvailable: '0.00004674',
39745
+ // fixedMaxAvailable: '0.00004674',
39746
+ // maxTransferOut: '0.00004674',
39747
+ // equity: '0.00006622',
39748
+ // usdtEquity: '1.734307497491',
39749
+ // btcEquity: '0.000066229058',
39750
+ // crossRiskRate: '0.066308887072',
39751
+ // unrealizedPL: '0',
39752
+ // bonus: '0'
39732
39753
  // }
39733
39754
  //
39734
39755
  for (let i = 0; i < balance.length; i++) {
@@ -39736,10 +39757,12 @@ class bitget extends _abstract_bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
39736
39757
  const currencyId = this.safeString2(entry, 'coinName', 'marginCoin');
39737
39758
  const code = this.safeCurrencyCode(currencyId);
39738
39759
  const account = this.account();
39760
+ const spotAccountFree = this.safeString(entry, 'available');
39761
+ const contractAccountFree = this.safeString(entry, 'maxTransferOut');
39762
+ account['free'] = (contractAccountFree !== undefined) ? contractAccountFree : spotAccountFree;
39739
39763
  const frozen = this.safeString(entry, 'frozen');
39740
39764
  const locked = this.safeString2(entry, 'lock', 'locked');
39741
39765
  account['used'] = _base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise.stringAdd */ .O.stringAdd(frozen, locked);
39742
- account['free'] = this.safeString(entry, 'available');
39743
39766
  result[code] = account;
39744
39767
  }
39745
39768
  return this.safeBalance(result);
@@ -152301,11 +152324,18 @@ class kucoinfutures extends _abstract_kucoinfutures_js__WEBPACK_IMPORTED_MODULE_
152301
152324
  'leverage': 1,
152302
152325
  };
152303
152326
  const [triggerPrice, stopLossPrice, takeProfitPrice] = this.handleTriggerPrices(params);
152327
+ const triggerPriceTypes = {
152328
+ 'mark': 'MP',
152329
+ 'last': 'TP',
152330
+ 'index': 'IP',
152331
+ };
152332
+ const triggerPriceType = this.safeString(params, 'triggerPriceType', 'mark');
152333
+ const triggerPriceTypeValue = this.safeString(triggerPriceTypes, triggerPriceType, triggerPriceType);
152304
152334
  params = this.omit(params, ['stopLossPrice', 'takeProfitPrice', 'triggerPrice', 'stopPrice']);
152305
152335
  if (triggerPrice) {
152306
152336
  request['stop'] = (side === 'buy') ? 'up' : 'down';
152307
152337
  request['stopPrice'] = this.priceToPrecision(symbol, triggerPrice);
152308
- request['stopPriceType'] = 'MP';
152338
+ request['stopPriceType'] = triggerPriceTypeValue;
152309
152339
  }
152310
152340
  else if (stopLossPrice || takeProfitPrice) {
152311
152341
  if (stopLossPrice) {
@@ -152317,7 +152347,7 @@ class kucoinfutures extends _abstract_kucoinfutures_js__WEBPACK_IMPORTED_MODULE_
152317
152347
  request['stopPrice'] = this.priceToPrecision(symbol, takeProfitPrice);
152318
152348
  }
152319
152349
  request['reduceOnly'] = true;
152320
- request['stopPriceType'] = 'MP';
152350
+ request['stopPriceType'] = triggerPriceTypeValue;
152321
152351
  }
152322
152352
  const uppercaseType = type.toUpperCase();
152323
152353
  const timeInForce = this.safeStringUpper(params, 'timeInForce');
@@ -155037,41 +155067,47 @@ class latoken extends _abstract_latoken_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
155037
155067
  }
155038
155068
  parseTicker(ticker, market = undefined) {
155039
155069
  //
155040
- // {
155041
- // "symbol":"620f2019-33c0-423b-8a9d-cde4d7f8ef7f/0c3a106d-bde3-4c13-a26e-3fd2394529e5",
155042
- // "baseCurrency":"620f2019-33c0-423b-8a9d-cde4d7f8ef7f",
155043
- // "quoteCurrency":"0c3a106d-bde3-4c13-a26e-3fd2394529e5",
155044
- // "volume24h":"76411867.852585600000000000",
155045
- // "volume7d":"637809926.759451100000000000",
155046
- // "change24h":"2.5300",
155047
- // "change7d":"5.1300",
155048
- // "lastPrice":"4426.9"
155049
- // }
155070
+ // {
155071
+ // symbol: '92151d82-df98-4d88-9a4d-284fa9eca49f/0c3a106d-bde3-4c13-a26e-3fd2394529e5',
155072
+ // baseCurrency: '92151d82-df98-4d88-9a4d-284fa9eca49f',
155073
+ // quoteCurrency: '0c3a106d-bde3-4c13-a26e-3fd2394529e5',
155074
+ // volume24h: '165723597.189022176000000000',
155075
+ // volume7d: '934505768.625109571000000000',
155076
+ // change24h: '0.0200',
155077
+ // change7d: '-6.4200',
155078
+ // amount24h: '6438.457663100000000000',
155079
+ // amount7d: '35657.785013800000000000',
155080
+ // lastPrice: '25779.16',
155081
+ // lastQuantity: '0.248403300000000000',
155082
+ // bestBid: '25778.74',
155083
+ // bestBidQuantity: '0.6520232',
155084
+ // bestAsk: '25779.17',
155085
+ // bestAskQuantity: '0.4956043',
155086
+ // updateTimestamp: '1693965231406'
155087
+ // }
155050
155088
  //
155051
155089
  const marketId = this.safeString(ticker, 'symbol');
155052
- const symbol = this.safeSymbol(marketId, market);
155053
155090
  const last = this.safeString(ticker, 'lastPrice');
155054
- const change = this.safeString(ticker, 'change24h');
155055
- const timestamp = this.nonce();
155091
+ const timestamp = this.safeInteger(ticker, 'updateTimestamp');
155056
155092
  return this.safeTicker({
155057
- 'symbol': symbol,
155093
+ 'symbol': this.safeSymbol(marketId, market),
155058
155094
  'timestamp': timestamp,
155059
155095
  'datetime': this.iso8601(timestamp),
155060
- 'low': this.safeString(ticker, 'low'),
155061
- 'high': this.safeString(ticker, 'high'),
155062
- 'bid': undefined,
155063
- 'bidVolume': undefined,
155064
- 'ask': undefined,
155065
- 'askVolume': undefined,
155096
+ 'low': undefined,
155097
+ 'high': undefined,
155098
+ 'bid': this.safeString(ticker, 'bestBid'),
155099
+ 'bidVolume': this.safeString(ticker, 'bestBidQuantity'),
155100
+ 'ask': this.safeString(ticker, 'bestAsk'),
155101
+ 'askVolume': this.safeString(ticker, 'bestAskQuantity'),
155066
155102
  'vwap': undefined,
155067
155103
  'open': undefined,
155068
155104
  'close': last,
155069
155105
  'last': last,
155070
155106
  'previousClose': undefined,
155071
- 'change': change,
155072
- 'percentage': undefined,
155107
+ 'change': undefined,
155108
+ 'percentage': this.safeString(ticker, 'change24h'),
155073
155109
  'average': undefined,
155074
- 'baseVolume': undefined,
155110
+ 'baseVolume': this.safeString(ticker, 'amount24h'),
155075
155111
  'quoteVolume': this.safeString(ticker, 'volume24h'),
155076
155112
  'info': ticker,
155077
155113
  }, market);
@@ -155093,16 +155129,24 @@ class latoken extends _abstract_latoken_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
155093
155129
  };
155094
155130
  const response = await this.publicGetTickerBaseQuote(this.extend(request, params));
155095
155131
  //
155096
- // {
155097
- // "symbol":"620f2019-33c0-423b-8a9d-cde4d7f8ef7f/0c3a106d-bde3-4c13-a26e-3fd2394529e5",
155098
- // "baseCurrency":"620f2019-33c0-423b-8a9d-cde4d7f8ef7f",
155099
- // "quoteCurrency":"0c3a106d-bde3-4c13-a26e-3fd2394529e5",
155100
- // "volume24h":"76411867.852585600000000000",
155101
- // "volume7d":"637809926.759451100000000000",
155102
- // "change24h":"2.5300",
155103
- // "change7d":"5.1300",
155104
- // "lastPrice":"4426.9"
155105
- // }
155132
+ // {
155133
+ // symbol: '92151d82-df98-4d88-9a4d-284fa9eca49f/0c3a106d-bde3-4c13-a26e-3fd2394529e5',
155134
+ // baseCurrency: '92151d82-df98-4d88-9a4d-284fa9eca49f',
155135
+ // quoteCurrency: '0c3a106d-bde3-4c13-a26e-3fd2394529e5',
155136
+ // volume24h: '165723597.189022176000000000',
155137
+ // volume7d: '934505768.625109571000000000',
155138
+ // change24h: '0.0200',
155139
+ // change7d: '-6.4200',
155140
+ // amount24h: '6438.457663100000000000',
155141
+ // amount7d: '35657.785013800000000000',
155142
+ // lastPrice: '25779.16',
155143
+ // lastQuantity: '0.248403300000000000',
155144
+ // bestBid: '25778.74',
155145
+ // bestBidQuantity: '0.6520232',
155146
+ // bestAsk: '25779.17',
155147
+ // bestAskQuantity: '0.4956043',
155148
+ // updateTimestamp: '1693965231406'
155149
+ // }
155106
155150
  //
155107
155151
  return this.parseTicker(response, market);
155108
155152
  }
@@ -155118,18 +155162,26 @@ class latoken extends _abstract_latoken_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
155118
155162
  await this.loadMarkets();
155119
155163
  const response = await this.publicGetTicker(params);
155120
155164
  //
155121
- // [
155122
- // {
155123
- // "symbol":"DASH/BTC",
155124
- // "baseCurrency":"ed75c263-4ab9-494b-8426-031dab1c7cc1",
155125
- // "quoteCurrency":"92151d82-df98-4d88-9a4d-284fa9eca49f",
155126
- // "volume24h":"1.977753278000000000",
155127
- // "volume7d":"18.964342670000000000",
155128
- // "change24h":"-1.4800",
155129
- // "change7d":"-5.5200",
155130
- // "lastPrice":"0.003066"
155131
- // },
155132
- // ]
155165
+ // [
155166
+ // {
155167
+ // symbol: '92151d82-df98-4d88-9a4d-284fa9eca49f/0c3a106d-bde3-4c13-a26e-3fd2394529e5',
155168
+ // baseCurrency: '92151d82-df98-4d88-9a4d-284fa9eca49f',
155169
+ // quoteCurrency: '0c3a106d-bde3-4c13-a26e-3fd2394529e5',
155170
+ // volume24h: '165723597.189022176000000000',
155171
+ // volume7d: '934505768.625109571000000000',
155172
+ // change24h: '0.0200',
155173
+ // change7d: '-6.4200',
155174
+ // amount24h: '6438.457663100000000000',
155175
+ // amount7d: '35657.785013800000000000',
155176
+ // lastPrice: '25779.16',
155177
+ // lastQuantity: '0.248403300000000000',
155178
+ // bestBid: '25778.74',
155179
+ // bestBidQuantity: '0.6520232',
155180
+ // bestAsk: '25779.17',
155181
+ // bestAskQuantity: '0.4956043',
155182
+ // updateTimestamp: '1693965231406'
155183
+ // }
155184
+ // ]
155133
155185
  //
155134
155186
  return this.parseTickers(response, symbols);
155135
155187
  }
@@ -195796,7 +195848,17 @@ class binance extends _binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
195796
195848
  client.resolve(result, messageHash);
195797
195849
  if (event === 'bookTicker') {
195798
195850
  // watch bookTickers
195799
- client.resolve([result], '!' + 'bookTicker@arr');
195851
+ client.resolve(result, '!' + 'bookTicker@arr');
195852
+ const messageHashes = this.findMessageHashes(client, 'tickers::');
195853
+ for (let i = 0; i < messageHashes.length; i++) {
195854
+ const messageHash = messageHashes[i];
195855
+ const parts = messageHash.split('::');
195856
+ const symbolsString = parts[1];
195857
+ const symbols = symbolsString.split(',');
195858
+ if (this.inArray(symbol, symbols)) {
195859
+ client.resolve(result, messageHash);
195860
+ }
195861
+ }
195800
195862
  }
195801
195863
  }
195802
195864
  handleTickers(client, message) {
@@ -273642,7 +273704,7 @@ SOFTWARE.
273642
273704
 
273643
273705
  //-----------------------------------------------------------------------------
273644
273706
  // this is updated by vss.js when building
273645
- const version = '4.0.84';
273707
+ const version = '4.0.86';
273646
273708
  _src_base_Exchange_js__WEBPACK_IMPORTED_MODULE_0__/* .Exchange.ccxtVersion */ .e.ccxtVersion = version;
273647
273709
  //-----------------------------------------------------------------------------
273648
273710