ccxt 4.1.4 → 4.1.5

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
@@ -214,13 +214,13 @@ console.log(version, Object.keys(exchanges));
214
214
 
215
215
  All-in-one browser bundle (dependencies included), served from a CDN of your choice:
216
216
 
217
- * jsDelivr: https://cdn.jsdelivr.net/npm/ccxt@4.1.4/dist/ccxt.browser.js
218
- * unpkg: https://unpkg.com/ccxt@4.1.4/dist/ccxt.browser.js
217
+ * jsDelivr: https://cdn.jsdelivr.net/npm/ccxt@4.1.5/dist/ccxt.browser.js
218
+ * unpkg: https://unpkg.com/ccxt@4.1.5/dist/ccxt.browser.js
219
219
 
220
220
  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.
221
221
 
222
222
  ```HTML
223
- <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/ccxt@4.1.4/dist/ccxt.browser.js"></script>
223
+ <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/ccxt@4.1.5/dist/ccxt.browser.js"></script>
224
224
  ```
225
225
 
226
226
  Creates a global `ccxt` object:
@@ -86613,7 +86613,7 @@ class coinex extends _abstract_coinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
86613
86613
  // message: 'OK'
86614
86614
  // }
86615
86615
  //
86616
- return this.safeNumber(response, 'data');
86616
+ return this.safeInteger(response, 'data');
86617
86617
  }
86618
86618
  async fetchOrderBook(symbol, limit = 20, params = {}) {
86619
86619
  /**
@@ -94069,7 +94069,6 @@ class coinsph extends _abstract_coinsph_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
94069
94069
  const quoteId = this.safeString(market, 'quoteAsset');
94070
94070
  const base = this.safeCurrencyCode(baseId);
94071
94071
  const quote = this.safeCurrencyCode(quoteId);
94072
- const isActive = this.safeString(market, 'status') === 'TRADING';
94073
94072
  const limits = this.indexBy(this.safeValue(market, 'filters'), 'filterType');
94074
94073
  const amountLimits = this.safeValue(limits, 'LOT_SIZE', {});
94075
94074
  const priceLimits = this.safeValue(limits, 'PRICE_FILTER', {});
@@ -94089,7 +94088,7 @@ class coinsph extends _abstract_coinsph_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
94089
94088
  'swap': false,
94090
94089
  'future': false,
94091
94090
  'option': false,
94092
- 'active': isActive,
94091
+ 'active': this.safeStringLower(market, 'status') === 'trading',
94093
94092
  'contract': false,
94094
94093
  'linear': undefined,
94095
94094
  'inverse': undefined,
@@ -141430,11 +141429,7 @@ class kraken extends _abstract_kraken_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
141430
141429
  else {
141431
141430
  direction = 'in';
141432
141431
  }
141433
- const time = this.safeNumber(item, 'time');
141434
- let timestamp = undefined;
141435
- if (time !== undefined) {
141436
- timestamp = this.parseToInt(time * 1000);
141437
- }
141432
+ const timestamp = this.safeIntegerProduct(item, 'time', 1000);
141438
141433
  return {
141439
141434
  'info': item,
141440
141435
  'id': id,
@@ -151893,16 +151888,19 @@ class kucoinfutures extends _abstract_kucoinfutures_js__WEBPACK_IMPORTED_MODULE_
151893
151888
  /* harmony import */ var _abstract_kuna_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4722);
151894
151889
  /* harmony import */ var _base_errors_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(6689);
151895
151890
  /* harmony import */ var _base_functions_number_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(9292);
151896
- /* harmony import */ var _static_dependencies_noble_hashes_sha256_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(1372);
151891
+ /* harmony import */ var _static_dependencies_noble_hashes_sha256_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1372);
151892
+ /* harmony import */ var _static_dependencies_noble_hashes_sha512_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(7110);
151897
151893
  // ---------------------------------------------------------------------------
151898
151894
 
151899
151895
 
151900
151896
 
151901
151897
 
151898
+
151902
151899
  // ---------------------------------------------------------------------------
151903
151900
  /**
151904
151901
  * @class kuna
151905
151902
  * @extends Exchange
151903
+ * @description Use the public-key as your apiKey
151906
151904
  */
151907
151905
  class kuna extends _abstract_kuna_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
151908
151906
  describe() {
@@ -151960,6 +151958,7 @@ class kuna extends _abstract_kuna_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
151960
151958
  'api': {
151961
151959
  'xreserve': 'https://api.xreserve.fund',
151962
151960
  'v3': 'https://api.kuna.io',
151961
+ 'v4': 'https://api.kuna.io',
151963
151962
  'public': 'https://kuna.io',
151964
151963
  'private': 'https://kuna.io', // v2
151965
151964
  },
@@ -151978,6 +151977,54 @@ class kuna extends _abstract_kuna_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
151978
151977
  'delegate-transfer': 1,
151979
151978
  },
151980
151979
  },
151980
+ 'v4': {
151981
+ 'private': {
151982
+ 'get': {
151983
+ 'me': 1,
151984
+ 'getBalance': 1,
151985
+ 'active': 1,
151986
+ 'order/history': 1,
151987
+ 'order/private/{id}/trades': 1,
151988
+ 'order/details/{id}?withTrades={withTrades}': 1,
151989
+ 'trade/history': 1,
151990
+ 'transaction/{hash}': 1,
151991
+ 'deposit/preRequest': 1,
151992
+ 'deposit/crypto/address': 1,
151993
+ 'deposit/crypto/getMerchantAddress': 1,
151994
+ 'deposit/history': 1,
151995
+ 'deposit/details/{depositId}': 1,
151996
+ 'withdraw/preRequest': 1,
151997
+ 'withdraw/history': 1,
151998
+ 'withdraw/details/{withdrawId}': 1,
151999
+ 'kuna-code/{id}': 1,
152000
+ 'kuna-code/{code}/check': 1,
152001
+ 'kuna-code/issued-by-me': 1,
152002
+ 'kuna-code/redeemed-by-me': 1,
152003
+ },
152004
+ 'post': {
152005
+ 'order/create': 1,
152006
+ 'order/cancel': 1,
152007
+ 'order/cancel/multi': 1,
152008
+ 'deposit/crypto/generateAddress': 1,
152009
+ 'deposit/crypto/generateMerchantAddress': 1,
152010
+ 'withdraw/create': 1,
152011
+ 'kuna-code': 1,
152012
+ },
152013
+ 'put': {
152014
+ 'kuna-code/redeem': 1,
152015
+ },
152016
+ },
152017
+ 'public': {
152018
+ 'get': {
152019
+ 'timestamp': 1,
152020
+ 'fees': 1,
152021
+ 'currencies?type={type}': 1,
152022
+ 'markets/getAll': 1,
152023
+ 'markets/tickers?pairs={pairs}': 1,
152024
+ 'order/book/{pairs}': 1,
152025
+ },
152026
+ },
152027
+ },
151981
152028
  'v3': {
151982
152029
  'public': {
151983
152030
  'get': {
@@ -152185,6 +152232,9 @@ class kuna extends _abstract_kuna_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
152185
152232
  '2002': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.InsufficientFunds,
152186
152233
  '2003': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.OrderNotFound,
152187
152234
  },
152235
+ 'options': {
152236
+ // 'account': 'pro' // Only for pro accounts
152237
+ },
152188
152238
  });
152189
152239
  }
152190
152240
  async fetchTime(params = {}) {
@@ -152741,20 +152791,53 @@ class kuna extends _abstract_kuna_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
152741
152791
  let url = undefined;
152742
152792
  if (Array.isArray(api)) {
152743
152793
  const [version, access] = api;
152744
- url = this.urls['api'][version] + '/' + version + '/' + this.implodeParams(path, params);
152745
- if (access === 'public') {
152746
- if (method === 'GET') {
152747
- if (Object.keys(params).length) {
152748
- url += '?' + this.urlencode(params);
152794
+ if (version === 'v3') {
152795
+ url = this.urls['api'][version] + '/' + version + '/' + this.implodeParams(path, params);
152796
+ if (access === 'public') {
152797
+ if (method === 'GET') {
152798
+ if (Object.keys(params).length) {
152799
+ url += '?' + this.urlencode(params);
152800
+ }
152801
+ }
152802
+ else if ((method === 'POST') || (method === 'PUT')) {
152803
+ headers = { 'Content-Type': 'application/json' };
152804
+ body = this.json(params);
152749
152805
  }
152750
152806
  }
152751
- else if ((method === 'POST') || (method === 'PUT')) {
152752
- headers = { 'Content-Type': 'application/json' };
152753
- body = this.json(params);
152807
+ else if (access === 'private') {
152808
+ throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.NotSupported(this.id + ' private v3 API is not supported yet');
152754
152809
  }
152755
152810
  }
152756
- else if (access === 'private') {
152757
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.NotSupported(this.id + ' private v3 API is not supported yet');
152811
+ else if (version === 'v4') {
152812
+ const splitPath = path.split('/');
152813
+ const splitPathLength = splitPath.length;
152814
+ let urlPath = '';
152815
+ if ((splitPathLength > 1) && (splitPath[0] !== 'kuna-code')) {
152816
+ let pathTail = '';
152817
+ for (let i = 1; i < splitPathLength; i++) {
152818
+ pathTail += splitPath[i];
152819
+ }
152820
+ urlPath = '/' + version + '/' + splitPath[0] + '/' + access + '/' + this.implodeParams(pathTail, params);
152821
+ }
152822
+ else {
152823
+ urlPath = '/' + version + '/' + access + '/' + this.implodeParams(path, params);
152824
+ }
152825
+ url = this.urls['api'][version] + urlPath;
152826
+ if (access === 'private') {
152827
+ const nonce = this.nonce();
152828
+ const auth = urlPath + nonce + this.json(params);
152829
+ headers = {
152830
+ 'content-type': 'application/json',
152831
+ 'accept': 'application/json',
152832
+ 'nonce': nonce,
152833
+ 'public-key': this.apiKey,
152834
+ 'signature': this.hmac(this.encode(auth), this.encode(this.secret), _static_dependencies_noble_hashes_sha512_js__WEBPACK_IMPORTED_MODULE_3__/* .sha384 */ .iC, 'hex'),
152835
+ };
152836
+ const account = this.safeString(this.options, 'account');
152837
+ if (account === 'pro') {
152838
+ headers['account'] = 'pro';
152839
+ }
152840
+ }
152758
152841
  }
152759
152842
  }
152760
152843
  else {
@@ -152777,7 +152860,7 @@ class kuna extends _abstract_kuna_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
152777
152860
  'tonce': nonce,
152778
152861
  }, params));
152779
152862
  const auth = method + '|' + request + '|' + queryInner;
152780
- const signed = this.hmac(this.encode(auth), this.encode(this.secret), _static_dependencies_noble_hashes_sha256_js__WEBPACK_IMPORTED_MODULE_3__/* .sha256 */ .J);
152863
+ const signed = this.hmac(this.encode(auth), this.encode(this.secret), _static_dependencies_noble_hashes_sha256_js__WEBPACK_IMPORTED_MODULE_4__/* .sha256 */ .J);
152781
152864
  const suffix = query + '&signature=' + signed;
152782
152865
  if (method === 'GET') {
152783
152866
  url += '?' + suffix;
@@ -198051,6 +198134,11 @@ class bitfinex2 extends _bitfinex2_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
198051
198134
 
198052
198135
 
198053
198136
  // ---------------------------------------------------------------------------
198137
+ /**
198138
+ * @class bitget
198139
+ * @extends Exchange
198140
+ * @description watching delivery future markets is not yet implemented (perpertual future / swap is implemented)
198141
+ */
198054
198142
  class bitget extends _bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
198055
198143
  describe() {
198056
198144
  return this.deepExtend(super.describe(), {
@@ -198123,10 +198211,10 @@ class bitget extends _bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
198123
198211
  }
198124
198212
  else {
198125
198213
  if (!sandboxMode) {
198126
- return market['id'].replace('_UMCBL', '');
198214
+ return market['id'].replace('_UMCBL', '').replace('_DMCBL', '').replace('_CMCBL', '');
198127
198215
  }
198128
198216
  else {
198129
- return market['id'].replace('_SUMCBL', '');
198217
+ return market['id'].replace('_SUMCBL', '').replace('_SDMCBL', '').replace('_SCMCBL', '');
198130
198218
  }
198131
198219
  }
198132
198220
  }
@@ -198138,15 +198226,24 @@ class bitget extends _bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
198138
198226
  const sandboxMode = this.safeValue(this.options, 'sandboxMode', false);
198139
198227
  let marketId = this.safeString(arg, 'instId');
198140
198228
  if (instType === 'sp') {
198141
- marketId += '_SPBL';
198229
+ marketId = marketId + '_SPBL';
198142
198230
  }
198143
198231
  else {
198144
- if (!sandboxMode) {
198145
- marketId += '_UMCBL';
198232
+ let extension = sandboxMode ? '_S' : '_';
198233
+ const splitByUSDT = marketId.split('USDT');
198234
+ const splitByPERP = marketId.split('PERP');
198235
+ const splitByUSDTLength = splitByUSDT.length;
198236
+ const splitByPERPLength = splitByPERP.length;
198237
+ if (splitByUSDTLength > 1) {
198238
+ extension += 'UMCBL';
198239
+ }
198240
+ else if (splitByPERPLength > 1) {
198241
+ extension += 'CMCBL';
198146
198242
  }
198147
198243
  else {
198148
- marketId += '_SUMCBL';
198244
+ extension += 'DMCBL';
198149
198245
  }
198246
+ marketId = marketId + extension;
198150
198247
  }
198151
198248
  return marketId;
198152
198249
  }
@@ -198649,6 +198746,8 @@ class bitget extends _bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
198649
198746
  * @method
198650
198747
  * @name bitget#watchTrades
198651
198748
  * @description get the list of most recent trades for a particular symbol
198749
+ * @see https://bitgetlimited.github.io/apidoc/en/spot/#trades-channel
198750
+ * @see https://bitgetlimited.github.io/apidoc/en/mix/#trades-channel
198652
198751
  * @param {string} symbol unified symbol of the market to fetch trades for
198653
198752
  * @param {int} [since] timestamp in ms of the earliest trade to fetch
198654
198753
  * @param {int} [limit] the maximum amount of trades to fetch
@@ -274069,7 +274168,7 @@ SOFTWARE.
274069
274168
 
274070
274169
  //-----------------------------------------------------------------------------
274071
274170
  // this is updated by vss.js when building
274072
- const version = '4.1.4';
274171
+ const version = '4.1.5';
274073
274172
  _src_base_Exchange_js__WEBPACK_IMPORTED_MODULE_0__/* .Exchange.ccxtVersion */ .e.ccxtVersion = version;
274074
274173
  //-----------------------------------------------------------------------------
274075
274174