ccxt 4.2.19 → 4.2.21

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.
Files changed (64) hide show
  1. package/README.md +98 -98
  2. package/dist/ccxt.browser.js +1119 -364
  3. package/dist/ccxt.browser.min.js +6 -6
  4. package/dist/cjs/ccxt.js +1 -1
  5. package/dist/cjs/src/base/Exchange.js +47 -4
  6. package/dist/cjs/src/base/ws/WsClient.js +3 -1
  7. package/dist/cjs/src/binance.js +2 -1
  8. package/dist/cjs/src/binanceus.js +17 -0
  9. package/dist/cjs/src/bingx.js +2 -1
  10. package/dist/cjs/src/bitget.js +25 -31
  11. package/dist/cjs/src/bitteam.js +1 -1
  12. package/dist/cjs/src/bitvavo.js +271 -172
  13. package/dist/cjs/src/blockchaincom.js +3 -1
  14. package/dist/cjs/src/bybit.js +0 -28
  15. package/dist/cjs/src/delta.js +0 -18
  16. package/dist/cjs/src/gate.js +32 -26
  17. package/dist/cjs/src/kucoinfutures.js +9 -9
  18. package/dist/cjs/src/novadax.js +26 -22
  19. package/dist/cjs/src/okx.js +0 -18
  20. package/dist/cjs/src/phemex.js +2 -1
  21. package/dist/cjs/src/pro/bitopro.js +7 -3
  22. package/dist/cjs/src/pro/bitvavo.js +668 -22
  23. package/dist/cjs/src/pro/lbank.js +1 -1
  24. package/js/ccxt.d.ts +1 -1
  25. package/js/ccxt.js +1 -1
  26. package/js/src/abstract/binance.d.ts +1 -0
  27. package/js/src/abstract/binancecoinm.d.ts +1 -0
  28. package/js/src/abstract/binanceus.d.ts +1 -0
  29. package/js/src/abstract/binanceusdm.d.ts +1 -0
  30. package/js/src/abstract/bitpanda.js +11 -0
  31. package/js/src/abstract/gate.d.ts +1 -0
  32. package/js/src/abstract/gateio.d.ts +1 -0
  33. package/js/src/abstract/novadax.d.ts +5 -1
  34. package/js/src/abstract/phemex.d.ts +1 -0
  35. package/js/src/base/Exchange.d.ts +15 -1
  36. package/js/src/base/Exchange.js +47 -4
  37. package/js/src/base/ws/WsClient.js +3 -2
  38. package/js/src/binance.js +2 -1
  39. package/js/src/binanceus.js +17 -0
  40. package/js/src/bingx.js +2 -1
  41. package/js/src/bitget.d.ts +1 -1
  42. package/js/src/bitget.js +25 -31
  43. package/js/src/bitteam.js +1 -1
  44. package/js/src/bitvavo.d.ts +14 -2
  45. package/js/src/bitvavo.js +271 -172
  46. package/js/src/blockchaincom.js +3 -1
  47. package/js/src/bybit.d.ts +0 -1
  48. package/js/src/bybit.js +1 -29
  49. package/js/src/delta.d.ts +0 -1
  50. package/js/src/delta.js +0 -18
  51. package/js/src/gate.d.ts +1 -1
  52. package/js/src/gate.js +32 -26
  53. package/js/src/kucoinfutures.d.ts +6 -6
  54. package/js/src/kucoinfutures.js +9 -9
  55. package/js/src/novadax.js +26 -22
  56. package/js/src/okx.d.ts +0 -1
  57. package/js/src/okx.js +0 -18
  58. package/js/src/phemex.js +2 -1
  59. package/js/src/pro/bitopro.js +7 -3
  60. package/js/src/pro/bitvavo.d.ts +35 -2
  61. package/js/src/pro/bitvavo.js +669 -23
  62. package/js/src/pro/lbank.js +1 -1
  63. package/package.json +1 -1
  64. package/skip-tests.json +2 -1
@@ -7388,16 +7388,19 @@ class Exchange {
7388
7388
  'fetchBorrowInterest': undefined,
7389
7389
  'fetchBorrowRateHistory': undefined,
7390
7390
  'fetchCanceledOrders': undefined,
7391
+ 'fetchCanceledAndClosedOrders': undefined,
7391
7392
  'fetchClosedOrder': undefined,
7392
7393
  'fetchClosedOrders': undefined,
7393
7394
  'fetchCrossBorrowRate': undefined,
7394
7395
  'fetchCrossBorrowRates': undefined,
7395
7396
  'fetchCurrencies': 'emulated',
7397
+ 'fetchCurrenciesWs': 'emulated',
7396
7398
  'fetchDeposit': undefined,
7397
7399
  'fetchDepositAddress': undefined,
7398
7400
  'fetchDepositAddresses': undefined,
7399
7401
  'fetchDepositAddressesByNetwork': undefined,
7400
7402
  'fetchDeposits': undefined,
7403
+ 'fetchDepositsWs': undefined,
7401
7404
  'fetchDepositsWithdrawals': undefined,
7402
7405
  'fetchTransactionFee': undefined,
7403
7406
  'fetchTransactionFees': undefined,
@@ -7415,9 +7418,11 @@ class Exchange {
7415
7418
  'fetchLeverageTiers': undefined,
7416
7419
  'fetchMarketLeverageTiers': undefined,
7417
7420
  'fetchMarkets': true,
7421
+ 'fetchMarketsWs': undefined,
7418
7422
  'fetchMarkOHLCV': undefined,
7419
7423
  'fetchMyTrades': undefined,
7420
7424
  'fetchOHLCV': undefined,
7425
+ 'fetchOHLCVWs': undefined,
7421
7426
  'fetchOpenInterest': undefined,
7422
7427
  'fetchOpenInterestHistory': undefined,
7423
7428
  'fetchOpenOrder': undefined,
@@ -7440,12 +7445,14 @@ class Exchange {
7440
7445
  'fetchTrades': true,
7441
7446
  'fetchTradingFee': undefined,
7442
7447
  'fetchTradingFees': undefined,
7448
+ 'fetchTradingFeesWs': undefined,
7443
7449
  'fetchTradingLimits': undefined,
7444
7450
  'fetchTransactions': undefined,
7445
7451
  'fetchTransfers': undefined,
7446
7452
  'fetchWithdrawAddresses': undefined,
7447
7453
  'fetchWithdrawal': undefined,
7448
7454
  'fetchWithdrawals': undefined,
7455
+ 'fetchWithdrawalsWs': undefined,
7449
7456
  'reduceMargin': undefined,
7450
7457
  'setLeverage': undefined,
7451
7458
  'setMargin': undefined,
@@ -7965,6 +7972,13 @@ class Exchange {
7965
7972
  // and may be changed for consistency later
7966
7973
  return new Promise((resolve, reject) => resolve(this.currencies));
7967
7974
  }
7975
+ fetchCurrenciesWs(params = {}) {
7976
+ // markets are returned as a list
7977
+ // currencies are returned as a dict
7978
+ // this is for historical reasons
7979
+ // and may be changed for consistency later
7980
+ return new Promise((resolve, reject) => resolve(this.currencies));
7981
+ }
7968
7982
  fetchMarkets(params = {}) {
7969
7983
  // markets are returned as a list
7970
7984
  // currencies are returned as a dict
@@ -7972,6 +7986,13 @@ class Exchange {
7972
7986
  // and may be changed for consistency later
7973
7987
  return new Promise((resolve, reject) => resolve(Object.values(this.markets)));
7974
7988
  }
7989
+ fetchMarketsWs(params = {}) {
7990
+ // markets are returned as a list
7991
+ // currencies are returned as a dict
7992
+ // this is for historical reasons
7993
+ // and may be changed for consistency later
7994
+ return new Promise((resolve, reject) => resolve(Object.values(this.markets)));
7995
+ }
7975
7996
  checkRequiredDependencies() {
7976
7997
  return;
7977
7998
  }
@@ -9752,6 +9773,13 @@ class Exchange {
9752
9773
  }
9753
9774
  throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__.NotSupported(this.id + ' fetchOHLCV() is not supported yet' + message);
9754
9775
  }
9776
+ async fetchOHLCVWs(symbol, timeframe = '1m', since = undefined, limit = undefined, params = {}) {
9777
+ let message = '';
9778
+ if (this.has['fetchTradesWs']) {
9779
+ message = '. If you want to build OHLCV candles from trade executions data, visit https://github.com/ccxt/ccxt/tree/master/examples/ and see "build-ohlcv-bars" file';
9780
+ }
9781
+ throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__.NotSupported(this.id + ' fetchOHLCVWs() is not supported yet. Try using fetchOHLCV instead.' + message);
9782
+ }
9755
9783
  async watchOHLCV(symbol, timeframe = '1m', since = undefined, limit = undefined, params = {}) {
9756
9784
  throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__.NotSupported(this.id + ' watchOHLCV() is not supported yet');
9757
9785
  }
@@ -10111,7 +10139,7 @@ class Exchange {
10111
10139
  for (let i = 0; i < response.length; i++) {
10112
10140
  const item = response[i];
10113
10141
  const id = this.safeString(item, marketIdKey);
10114
- const market = this.safeMarket(id, undefined, undefined, this.safeString(this.options, 'defaultType'));
10142
+ const market = this.safeMarket(id, undefined, undefined, 'swap');
10115
10143
  const symbol = market['symbol'];
10116
10144
  const contract = this.safeValue(market, 'contract', false);
10117
10145
  if (contract && ((symbols === undefined) || this.inArray(symbol, symbols))) {
@@ -11080,6 +11108,9 @@ class Exchange {
11080
11108
  }
11081
11109
  throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__.NotSupported(this.id + ' fetchClosedOrders() is not supported yet');
11082
11110
  }
11111
+ async fetchCanceledAndClosedOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
11112
+ throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__.NotSupported(this.id + ' fetchCanceledAndClosedOrders() is not supported yet');
11113
+ }
11083
11114
  async fetchClosedOrdersWs(symbol = undefined, since = undefined, limit = undefined, params = {}) {
11084
11115
  if (this.has['fetchOrdersWs']) {
11085
11116
  const orders = await this.fetchOrdersWs(symbol, since, limit, params);
@@ -11102,9 +11133,6 @@ class Exchange {
11102
11133
  async watchMyTrades(symbol = undefined, since = undefined, limit = undefined, params = {}) {
11103
11134
  throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__.NotSupported(this.id + ' watchMyTrades() is not supported yet');
11104
11135
  }
11105
- async fetchOHLCVWs(symbol, timeframe = '1m', since = undefined, limit = undefined, params = {}) {
11106
- throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__.NotSupported(this.id + ' fetchOHLCVWs() is not supported yet');
11107
- }
11108
11136
  async fetchGreeks(symbol, params = {}) {
11109
11137
  throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__.NotSupported(this.id + ' fetchGreeks() is not supported yet');
11110
11138
  }
@@ -11124,9 +11152,15 @@ class Exchange {
11124
11152
  async fetchDeposits(code = undefined, since = undefined, limit = undefined, params = {}) {
11125
11153
  throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__.NotSupported(this.id + ' fetchDeposits() is not supported yet');
11126
11154
  }
11155
+ async fetchDepositsWs(code = undefined, since = undefined, limit = undefined, params = {}) {
11156
+ throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__.NotSupported(this.id + ' fetchDepositsWs() is not supported yet');
11157
+ }
11127
11158
  async fetchWithdrawals(code = undefined, since = undefined, limit = undefined, params = {}) {
11128
11159
  throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__.NotSupported(this.id + ' fetchWithdrawals() is not supported yet');
11129
11160
  }
11161
+ async fetchWithdrawalsWs(code = undefined, since = undefined, limit = undefined, params = {}) {
11162
+ throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__.NotSupported(this.id + ' fetchWithdrawalsWs() is not supported yet');
11163
+ }
11130
11164
  async fetchOpenInterest(symbol, params = {}) {
11131
11165
  throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__.NotSupported(this.id + ' fetchOpenInterest() is not supported yet');
11132
11166
  }
@@ -11208,8 +11242,14 @@ class Exchange {
11208
11242
  }
11209
11243
  return markets[0];
11210
11244
  }
11245
+ else if ((symbol.endsWith('-C')) || (symbol.endsWith('-P')) || (symbol.startsWith('C-')) || (symbol.startsWith('P-'))) {
11246
+ return this.createExpiredOptionMarket(symbol);
11247
+ }
11211
11248
  throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__.BadSymbol(this.id + ' does not have market symbol ' + symbol);
11212
11249
  }
11250
+ createExpiredOptionMarket(symbol) {
11251
+ throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__.NotSupported(this.id + ' createExpiredOptionMarket () is not supported yet');
11252
+ }
11213
11253
  handleWithdrawTagAndParams(tag, params) {
11214
11254
  if (typeof tag === 'object') {
11215
11255
  params = this.extend(tag, params);
@@ -11600,6 +11640,9 @@ class Exchange {
11600
11640
  async fetchTradingFees(params = {}) {
11601
11641
  throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__.NotSupported(this.id + ' fetchTradingFees() is not supported yet');
11602
11642
  }
11643
+ async fetchTradingFeesWs(params = {}) {
11644
+ throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__.NotSupported(this.id + ' fetchTradingFeesWs() is not supported yet');
11645
+ }
11603
11646
  async fetchTradingFee(symbol, params = {}) {
11604
11647
  if (!this.has['fetchTradingFees']) {
11605
11648
  throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__.NotSupported(this.id + ' fetchTradingFee() is not supported yet');
@@ -15368,16 +15411,18 @@ class IndexedBids extends IndexedOrderBookSide {
15368
15411
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
15369
15412
  /* harmony export */ Z: () => (/* binding */ WsClient)
15370
15413
  /* harmony export */ });
15414
+ /* harmony import */ var ws__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7026);
15415
+ /* harmony import */ var ws__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(ws__WEBPACK_IMPORTED_MODULE_0__);
15371
15416
  /* harmony import */ var _Client_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(2897);
15372
15417
  /* harmony import */ var _base_functions_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(9125);
15373
15418
  /* harmony import */ var _base_functions_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(1621);
15374
- /* harmony import */ var ws__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7026);
15375
- /* harmony import */ var ws__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(ws__WEBPACK_IMPORTED_MODULE_0__);
15376
15419
  /* harmony import */ var _Future_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(2367);
15420
+ // eslint-disable-next-line no-shadow
15377
15421
 
15378
15422
 
15379
15423
 
15380
15424
 
15425
+ // eslint-disable-next-line no-restricted-globals
15381
15426
  const WebSocketPlatform = _base_functions_js__WEBPACK_IMPORTED_MODULE_1__/* .isNode */ .UG ? (ws__WEBPACK_IMPORTED_MODULE_0___default()) : self.WebSocket;
15382
15427
  class WsClient extends _Client_js__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z {
15383
15428
  createConnection() {
@@ -15431,7 +15476,6 @@ class WsClient extends _Client_js__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */
15431
15476
  return this.disconnected;
15432
15477
  }
15433
15478
  }
15434
- ;
15435
15479
 
15436
15480
 
15437
15481
  /***/ }),
@@ -18664,6 +18708,7 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
18664
18708
  },
18665
18709
  'papi': {
18666
18710
  'get': {
18711
+ 'ping': 1,
18667
18712
  'um/order': 1,
18668
18713
  'um/openOrder': 1,
18669
18714
  'um/openOrders': 1,
@@ -26409,7 +26454,7 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
26409
26454
  throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.AuthenticationError(this.id + ' userDataStream endpoint requires `apiKey` credential');
26410
26455
  }
26411
26456
  }
26412
- 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')) {
26457
+ 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' && path !== 'ping')) {
26413
26458
  this.checkRequiredCredentials();
26414
26459
  if (method === 'POST' && ((path === 'order') || (path === 'sor/order'))) {
26415
26460
  // inject in implicit API calls
@@ -27701,7 +27746,24 @@ class binanceus extends _binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] *
27701
27746
  'api': {
27702
27747
  'public': {
27703
27748
  'get': {
27749
+ 'exchangeInfo': 10,
27750
+ 'ping': 1,
27751
+ 'time': 1,
27752
+ 'depth': { 'cost': 1, 'byLimit': [[100, 1], [500, 5], [1000, 10], [5000, 50]] },
27753
+ 'trades': 1,
27754
+ 'aggTrades': 1,
27755
+ 'historicalTrades': 5,
27756
+ 'klines': 1,
27704
27757
  'ticker/price': { 'cost': 1, 'noSymbol': 2 },
27758
+ 'avgPrice': 1,
27759
+ 'ticker/bookTicker': { 'cost': 1, 'noSymbol': 2 },
27760
+ 'ticker/24hr': { 'cost': 1, 'noSymbol': 40 },
27761
+ 'ticker': { 'cost': 2, 'noSymbol': 100 },
27762
+ },
27763
+ },
27764
+ 'private': {
27765
+ 'get': {
27766
+ 'status': 1,
27705
27767
  },
27706
27768
  },
27707
27769
  },
@@ -28153,7 +28215,8 @@ class bingx extends _abstract_bingx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
28153
28215
  '80017': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.OrderNotFound,
28154
28216
  '100414': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.AccountSuspended,
28155
28217
  '100419': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.PermissionDenied,
28156
- '100437': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.BadRequest, // {"code":100437,"msg":"The withdrawal amount is lower than the minimum limit, please re-enter.","timestamp":1689258588845}
28218
+ '100437': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.BadRequest,
28219
+ '101204': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.InsufficientFunds, // bingx {"code":101204,"msg":"","data":{}}
28157
28220
  },
28158
28221
  'broad': {},
28159
28222
  },
@@ -41530,6 +41593,7 @@ class bitget extends _abstract_bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
41530
41593
  'fetchBorrowInterest': true,
41531
41594
  'fetchBorrowRateHistories': false,
41532
41595
  'fetchBorrowRateHistory': false,
41596
+ 'fetchCanceledAndClosedOrders': true,
41533
41597
  'fetchCanceledOrders': true,
41534
41598
  'fetchClosedOrders': true,
41535
41599
  'fetchCrossBorrowRate': true,
@@ -46870,20 +46934,8 @@ class bitget extends _abstract_bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
46870
46934
  * @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
46871
46935
  */
46872
46936
  await this.loadMarkets();
46873
- let market = undefined;
46874
- if (symbol !== undefined) {
46875
- market = this.market(symbol);
46876
- }
46877
- const response = await this.fetchCanceledAndClosedOrders(symbol, since, limit, params);
46878
- const result = [];
46879
- for (let i = 0; i < response.length; i++) {
46880
- const entry = response[i];
46881
- const status = this.parseOrderStatus(this.safeStringN(entry, ['state', 'status', 'planStatus']));
46882
- if (status === 'closed') {
46883
- result.push(entry);
46884
- }
46885
- }
46886
- return this.parseOrders(result, market, since, limit);
46937
+ const orders = await this.fetchCanceledAndClosedOrders(symbol, since, limit, params);
46938
+ return this.filterBy(orders, 'status', 'closed');
46887
46939
  }
46888
46940
  async fetchCanceledOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
46889
46941
  /**
@@ -46908,22 +46960,26 @@ class bitget extends _abstract_bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
46908
46960
  * @returns {object} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
46909
46961
  */
46910
46962
  await this.loadMarkets();
46911
- let market = undefined;
46912
- if (symbol !== undefined) {
46913
- market = this.market(symbol);
46914
- }
46915
- const response = await this.fetchCanceledAndClosedOrders(symbol, since, limit, params);
46916
- const result = [];
46917
- for (let i = 0; i < response.length; i++) {
46918
- const entry = response[i];
46919
- const status = this.parseOrderStatus(this.safeStringN(entry, ['state', 'status', 'planStatus']));
46920
- if (status === 'canceled') {
46921
- result.push(entry);
46922
- }
46923
- }
46924
- return this.parseOrders(result, market, since, limit);
46963
+ const orders = await this.fetchCanceledAndClosedOrders(symbol, since, limit, params);
46964
+ return this.filterBy(orders, 'status', 'canceled');
46925
46965
  }
46926
46966
  async fetchCanceledAndClosedOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
46967
+ /**
46968
+ * @method
46969
+ * @name bitget#fetchCanceledAndClosedOrders
46970
+ * @see https://www.bitget.com/api-doc/spot/trade/Get-History-Orders
46971
+ * @see https://www.bitget.com/api-doc/spot/plan/Get-History-Plan-Order
46972
+ * @see https://www.bitget.com/api-doc/contract/trade/Get-Orders-History
46973
+ * @see https://www.bitget.com/api-doc/contract/plan/orders-plan-history
46974
+ * @see https://www.bitget.com/api-doc/margin/cross/trade/Get-Cross-Order-History
46975
+ * @see https://www.bitget.com/api-doc/margin/isolated/trade/Get-Isolated-Order-History
46976
+ * @description fetches information on multiple canceled and closed orders made by the user
46977
+ * @param {string} symbol unified market symbol of the market orders were made in
46978
+ * @param {int} [since] the earliest time in ms to fetch orders for
46979
+ * @param {int} [limit] the maximum number of order structures to retrieve
46980
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
46981
+ * @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
46982
+ */
46927
46983
  await this.loadMarkets();
46928
46984
  const sandboxMode = this.safeValue(this.options, 'sandboxMode', false);
46929
46985
  let market = undefined;
@@ -47208,16 +47264,17 @@ class bitget extends _abstract_bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
47208
47264
  const data = this.safeValue(response, 'data', {});
47209
47265
  if (marketType === 'spot') {
47210
47266
  if ((marginMode !== undefined) || stop) {
47211
- return this.safeValue(data, 'orderList', []);
47267
+ return this.parseOrders(this.safeValue(data, 'orderList', []), market, since, limit);
47212
47268
  }
47213
47269
  }
47214
47270
  else {
47215
- return this.safeValue(data, 'entrustedList', []);
47271
+ return this.parseOrders(this.safeValue(data, 'entrustedList', []), market, since, limit);
47216
47272
  }
47217
47273
  if (typeof response === 'string') {
47218
47274
  response = JSON.parse(response);
47219
47275
  }
47220
- return this.safeValue(response, 'data', []);
47276
+ const orders = this.safeValue(response, 'data', []);
47277
+ return this.parseOrders(orders, market, since, limit);
47221
47278
  }
47222
47279
  async fetchLedger(code = undefined, since = undefined, limit = undefined, params = {}) {
47223
47280
  /**
@@ -67366,7 +67423,7 @@ class bitteam extends _abstract_bitteam_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
67366
67423
  '1d': '1D',
67367
67424
  },
67368
67425
  'urls': {
67369
- 'logo': 'https://private-user-images.githubusercontent.com/43336371/291263231-aa2e0d61-edba-44a8-b9bf-68797dc417bd.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTEiLCJleHAiOjE3MDMwOTE4NTYsIm5iZiI6MTcwMzA5MTU1NiwicGF0aCI6Ii80MzMzNjM3MS8yOTEyNjMyMzEtYWEyZTBkNjEtZWRiYS00NGE4LWI5YmYtNjg3OTdkYzQxN2JkLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFJV05KWUFYNENTVkVINTNBJTJGMjAyMzEyMjAlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjMxMjIwVDE2NTkxNlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTVkOGE5YmY3ZDMzMWY4YzVjODYzYWJjNjE1MGFkNTRkNzVlMDJmNWE1ZTgwNGQ2NzVkMzkyZTFhOTc4OTNjMWQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.B-ySU5Uo6vz53-iDe08tTQmJH6QOzUA9Jcbj-kZc2wg',
67426
+ 'logo': 'https://github.com/ccxt/ccxt/assets/43336371/cf71fe3d-b8b4-40f2-a906-907661b28793',
67370
67427
  'api': {
67371
67428
  'history': 'https://history.bit.team',
67372
67429
  'public': 'https://bit.team',
@@ -69871,6 +69928,7 @@ class bitvavo extends _abstract_bitvavo_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
69871
69928
  /**
69872
69929
  * @method
69873
69930
  * @name bitvavo#fetchMarkets
69931
+ * @see https://docs.bitvavo.com/#tag/General/paths/~1markets/get
69874
69932
  * @description retrieves data on all markets for bitvavo
69875
69933
  * @param {object} [params] extra parameters specific to the exchange API endpoint
69876
69934
  * @returns {object[]} an array of objects representing market data
@@ -69890,12 +69948,15 @@ class bitvavo extends _abstract_bitvavo_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
69890
69948
  // }
69891
69949
  // ]
69892
69950
  //
69951
+ return this.parseMarkets(response);
69952
+ }
69953
+ parseMarkets(markets) {
69893
69954
  const currencies = this.currencies;
69894
69955
  const currenciesById = this.indexBy(currencies, 'id');
69895
69956
  const result = [];
69896
69957
  const fees = this.fees;
69897
- for (let i = 0; i < response.length; i++) {
69898
- const market = response[i];
69958
+ for (let i = 0; i < markets.length; i++) {
69959
+ const market = markets[i];
69899
69960
  const id = this.safeString(market, 'market');
69900
69961
  const baseId = this.safeString(market, 'base');
69901
69962
  const quoteId = this.safeString(market, 'quote');
@@ -69962,11 +70023,48 @@ class bitvavo extends _abstract_bitvavo_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
69962
70023
  /**
69963
70024
  * @method
69964
70025
  * @name bitvavo#fetchCurrencies
70026
+ * @see https://docs.bitvavo.com/#tag/General/paths/~1assets/get
69965
70027
  * @description fetches all available currencies on an exchange
69966
70028
  * @param {object} [params] extra parameters specific to the exchange API endpoint
69967
70029
  * @returns {object} an associative dictionary of currencies
69968
70030
  */
69969
70031
  const response = await this.publicGetAssets(params);
70032
+ //
70033
+ // [
70034
+ // {
70035
+ // "symbol": "USDT",
70036
+ // "displayTicker": "USDT",
70037
+ // "name": "Tether",
70038
+ // "slug": "tether",
70039
+ // "popularity": -1,
70040
+ // "decimals": 6,
70041
+ // "depositFee": "0",
70042
+ // "depositConfirmations": 64,
70043
+ // "depositStatus": "OK",
70044
+ // "withdrawalFee": "3.2",
70045
+ // "withdrawalMinAmount": "3.2",
70046
+ // "withdrawalStatus": "OK",
70047
+ // "networks": [
70048
+ // "ETH"
70049
+ // ],
70050
+ // "light": {
70051
+ // "color": "#009393",
70052
+ // "icon": { "hash": "4ad7c699", "svg": "https://...", "webp16": "https://...", "webp32": "https://...", "webp64": "https://...", "webp128": "https://...", "webp256": "https://...", "png16": "https://...", "png32": "https://...", "png64": "https://...", "png128": "https://...", "png256": "https://..."
70053
+ // }
70054
+ // },
70055
+ // "dark": {
70056
+ // "color": "#009393",
70057
+ // "icon": { "hash": "4ad7c699", "svg": "https://...", "webp16": "https://...", "webp32": "https://...", "webp64": "https://...", "webp128": "https://...", "webp256": "https://...", "png16": "https://...", "png32": "https://...", "png64": "https://...", "png128": "https://...", "png256": "https://..."
70058
+ // }
70059
+ // },
70060
+ // "visibility": "PUBLIC",
70061
+ // "message": ""
70062
+ // },
70063
+ // ]
70064
+ //
70065
+ return this.parseCurrencies(response);
70066
+ }
70067
+ parseCurrencies(currencies) {
69970
70068
  //
69971
70069
  // [
69972
70070
  // {
@@ -70001,8 +70099,8 @@ class bitvavo extends _abstract_bitvavo_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
70001
70099
  // ]
70002
70100
  //
70003
70101
  const result = {};
70004
- for (let i = 0; i < response.length; i++) {
70005
- const currency = response[i];
70102
+ for (let i = 0; i < currencies.length; i++) {
70103
+ const currency = currencies[i];
70006
70104
  const id = this.safeString(currency, 'symbol');
70007
70105
  const code = this.safeCurrencyCode(id);
70008
70106
  const networks = {};
@@ -70331,6 +70429,7 @@ class bitvavo extends _abstract_bitvavo_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
70331
70429
  /**
70332
70430
  * @method
70333
70431
  * @name bitvavo#fetchTradingFees
70432
+ * @see https://docs.bitvavo.com/#tag/Account/paths/~1account/get
70334
70433
  * @description fetch the trading fees for multiple markets
70335
70434
  * @param {object} [params] extra parameters specific to the exchange API endpoint
70336
70435
  * @returns {object} a dictionary of [fee structures]{@link https://docs.ccxt.com/#/?id=fee-structure} indexed by market symbols
@@ -70346,14 +70445,26 @@ class bitvavo extends _abstract_bitvavo_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
70346
70445
  // }
70347
70446
  // }
70348
70447
  //
70349
- const fees = this.safeValue(response, 'fees');
70350
- const maker = this.safeNumber(fees, 'maker');
70351
- const taker = this.safeNumber(fees, 'taker');
70448
+ return this.parseTradingFees(response);
70449
+ }
70450
+ parseTradingFees(fees, market = undefined) {
70451
+ //
70452
+ // {
70453
+ // "fees": {
70454
+ // "taker": "0.0025",
70455
+ // "maker": "0.0015",
70456
+ // "volume": "10000.00"
70457
+ // }
70458
+ // }
70459
+ //
70460
+ const feesValue = this.safeValue(fees, 'fees');
70461
+ const maker = this.safeNumber(feesValue, 'maker');
70462
+ const taker = this.safeNumber(feesValue, 'taker');
70352
70463
  const result = {};
70353
70464
  for (let i = 0; i < this.symbols.length; i++) {
70354
70465
  const symbol = this.symbols[i];
70355
70466
  result[symbol] = {
70356
- 'info': response,
70467
+ 'info': fees,
70357
70468
  'symbol': symbol,
70358
70469
  'maker': maker,
70359
70470
  'taker': taker,
@@ -70423,6 +70534,30 @@ class bitvavo extends _abstract_bitvavo_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
70423
70534
  this.safeNumber(ohlcv, 5),
70424
70535
  ];
70425
70536
  }
70537
+ fetchOHLCVRequest(symbol, timeframe = '1m', since = undefined, limit = undefined, params = {}) {
70538
+ const market = this.market(symbol);
70539
+ let request = {
70540
+ 'market': market['id'],
70541
+ 'interval': this.safeString(this.timeframes, timeframe, timeframe),
70542
+ // "limit": 1440, // default 1440, max 1440
70543
+ // "start": since,
70544
+ // "end": this.milliseconds (),
70545
+ };
70546
+ if (since !== undefined) {
70547
+ // https://github.com/ccxt/ccxt/issues/9227
70548
+ const duration = this.parseTimeframe(timeframe);
70549
+ request['start'] = since;
70550
+ if (limit === undefined) {
70551
+ limit = 1440;
70552
+ }
70553
+ request['end'] = this.sum(since, limit * duration * 1000);
70554
+ }
70555
+ [request, params] = this.handleUntilOption('end', request, params);
70556
+ if (limit !== undefined) {
70557
+ request['limit'] = limit; // default 1440, max 1440
70558
+ }
70559
+ return this.extend(request, params);
70560
+ }
70426
70561
  async fetchOHLCV(symbol, timeframe = '1m', since = undefined, limit = undefined, params = {}) {
70427
70562
  /**
70428
70563
  * @method
@@ -70445,27 +70580,8 @@ class bitvavo extends _abstract_bitvavo_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
70445
70580
  if (paginate) {
70446
70581
  return await this.fetchPaginatedCallDeterministic('fetchOHLCV', symbol, since, limit, timeframe, params, 1440);
70447
70582
  }
70448
- let request = {
70449
- 'market': market['id'],
70450
- 'interval': this.safeString(this.timeframes, timeframe, timeframe),
70451
- // "limit": 1440, // default 1440, max 1440
70452
- // "start": since,
70453
- // "end": this.milliseconds (),
70454
- };
70455
- if (since !== undefined) {
70456
- // https://github.com/ccxt/ccxt/issues/9227
70457
- const duration = this.parseTimeframe(timeframe);
70458
- request['start'] = since;
70459
- if (limit === undefined) {
70460
- limit = 1440;
70461
- }
70462
- request['end'] = this.sum(since, limit * duration * 1000);
70463
- }
70464
- [request, params] = this.handleUntilOption('end', request, params);
70465
- if (limit !== undefined) {
70466
- request['limit'] = limit; // default 1440, max 1440
70467
- }
70468
- const response = await this.publicGetMarketCandles(this.extend(request, params));
70583
+ const request = this.fetchOHLCVRequest(symbol, timeframe, since, limit, params);
70584
+ const response = await this.publicGetMarketCandles(request);
70469
70585
  //
70470
70586
  // [
70471
70587
  // [1590383700000,"8088.5","8088.5","8088.5","8088.5","0.04788623"],
@@ -70496,6 +70612,7 @@ class bitvavo extends _abstract_bitvavo_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
70496
70612
  /**
70497
70613
  * @method
70498
70614
  * @name bitvavo#fetchBalance
70615
+ * @see https://docs.bitvavo.com/#tag/Account/paths/~1balance/get
70499
70616
  * @description query for balance and get the amount of funds available for trading or funds locked in orders
70500
70617
  * @param {object} [params] extra parameters specific to the exchange API endpoint
70501
70618
  * @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
@@ -70545,33 +70662,7 @@ class bitvavo extends _abstract_bitvavo_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
70545
70662
  'info': response,
70546
70663
  };
70547
70664
  }
70548
- async createOrder(symbol, type, side, amount, price = undefined, params = {}) {
70549
- /**
70550
- * @method
70551
- * @name bitvavo#createOrder
70552
- * @description create a trade order
70553
- * @see https://docs.bitvavo.com/#tag/Trading-endpoints/paths/~1order/post
70554
- * @param {string} symbol unified symbol of the market to create an order in
70555
- * @param {string} type 'market' or 'limit'
70556
- * @param {string} side 'buy' or 'sell'
70557
- * @param {float} amount how much of currency you want to trade in units of base currency
70558
- * @param {float} [price] the price at which the order is to be fullfilled, in units of the quote currency, ignored in market orders
70559
- * @param {object} [params] extra parameters specific to the exchange API endpoint
70560
- * @param {string} [params.timeInForce] "GTC", "IOC", or "PO"
70561
- * @param {float} [params.stopPrice] The price at which a trigger order is triggered at
70562
- * @param {float} [params.triggerPrice] The price at which a trigger order is triggered at
70563
- * @param {bool} [params.postOnly] If true, the order will only be posted to the order book and not executed immediately
70564
- * @param {float} [params.stopLossPrice] The price at which a stop loss order is triggered at
70565
- * @param {float} [params.takeProfitPrice] The price at which a take profit order is triggered at
70566
- * @param {string} [params.triggerType] "price"
70567
- * @param {string} [params.triggerReference] "lastTrade", "bestBid", "bestAsk", "midPrice" Only for stop orders: Use this to determine which parameter will trigger the order
70568
- * @param {string} [params.selfTradePrevention] "decrementAndCancel", "cancelOldest", "cancelNewest", "cancelBoth"
70569
- * @param {bool} [params.disableMarketProtection] don't cancel if the next fill price is 10% worse than the best fill price
70570
- * @param {bool} [params.responseRequired] Set this to 'false' when only an acknowledgement of success or failure is required, this is faster.
70571
- * @param {string} [params.clientOrderId] An ID supplied by the client that must be unique among all open orders for the same market
70572
- * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
70573
- */
70574
- await this.loadMarkets();
70665
+ createOrderRequest(symbol, type, side, amount, price = undefined, params = {}) {
70575
70666
  const market = this.market(symbol);
70576
70667
  const request = {
70577
70668
  'market': market['id'],
@@ -70635,7 +70726,37 @@ class bitvavo extends _abstract_bitvavo_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
70635
70726
  if (postOnly) {
70636
70727
  request['postOnly'] = true;
70637
70728
  }
70638
- const response = await this.privatePostOrder(this.extend(request, params));
70729
+ return this.extend(request, params);
70730
+ }
70731
+ async createOrder(symbol, type, side, amount, price = undefined, params = {}) {
70732
+ /**
70733
+ * @method
70734
+ * @name bitvavo#createOrder
70735
+ * @description create a trade order
70736
+ * @see https://docs.bitvavo.com/#tag/Orders/paths/~1order/post
70737
+ * @param {string} symbol unified symbol of the market to create an order in
70738
+ * @param {string} type 'market' or 'limit'
70739
+ * @param {string} side 'buy' or 'sell'
70740
+ * @param {float} amount how much of currency you want to trade in units of base currency
70741
+ * @param {float} price the price at which the order is to be fullfilled, in units of the quote currency, ignored in market orders
70742
+ * @param {object} [params] extra parameters specific to the bitvavo api endpoint
70743
+ * @param {string} [params.timeInForce] "GTC", "IOC", or "PO"
70744
+ * @param {float} [params.stopPrice] The price at which a trigger order is triggered at
70745
+ * @param {float} [params.triggerPrice] The price at which a trigger order is triggered at
70746
+ * @param {bool} [params.postOnly] If true, the order will only be posted to the order book and not executed immediately
70747
+ * @param {float} [params.stopLossPrice] The price at which a stop loss order is triggered at
70748
+ * @param {float} [params.takeProfitPrice] The price at which a take profit order is triggered at
70749
+ * @param {string} [params.triggerType] "price"
70750
+ * @param {string} [params.triggerReference] "lastTrade", "bestBid", "bestAsk", "midPrice" Only for stop orders: Use this to determine which parameter will trigger the order
70751
+ * @param {string} [params.selfTradePrevention] "decrementAndCancel", "cancelOldest", "cancelNewest", "cancelBoth"
70752
+ * @param {bool} [params.disableMarketProtection] don't cancel if the next fill price is 10% worse than the best fill price
70753
+ * @param {bool} [params.responseRequired] Set this to 'false' when only an acknowledgement of success or failure is required, this is faster.
70754
+ * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
70755
+ */
70756
+ await this.loadMarkets();
70757
+ const market = this.market(symbol);
70758
+ const request = this.createOrderRequest(symbol, type, side, amount, price, params);
70759
+ const response = await this.privatePostOrder(request);
70639
70760
  //
70640
70761
  // {
70641
70762
  // "orderId":"dec6a640-5b4c-45bc-8d22-3b41c6716630",
@@ -70678,29 +70799,61 @@ class bitvavo extends _abstract_bitvavo_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
70678
70799
  //
70679
70800
  return this.parseOrder(response, market);
70680
70801
  }
70802
+ editOrderRequest(id, symbol, type, side, amount = undefined, price = undefined, params = {}) {
70803
+ let request = {};
70804
+ const market = this.market(symbol);
70805
+ const amountRemaining = this.safeNumber(params, 'amountRemaining');
70806
+ const triggerPrice = this.safeStringN(params, ['triggerPrice', 'stopPrice', 'triggerAmount']);
70807
+ params = this.omit(params, ['amountRemaining', 'triggerPrice', 'stopPrice', 'triggerAmount']);
70808
+ if (price !== undefined) {
70809
+ request['price'] = this.priceToPrecision(symbol, price);
70810
+ }
70811
+ if (amount !== undefined) {
70812
+ request['amount'] = this.amountToPrecision(symbol, amount);
70813
+ }
70814
+ if (amountRemaining !== undefined) {
70815
+ request['amountRemaining'] = this.amountToPrecision(symbol, amountRemaining);
70816
+ }
70817
+ if (triggerPrice !== undefined) {
70818
+ request['triggerAmount'] = this.priceToPrecision(symbol, triggerPrice);
70819
+ }
70820
+ request = this.extend(request, params);
70821
+ if (this.isEmpty(request)) {
70822
+ throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.ArgumentsRequired(this.id + ' editOrder() requires an amount argument, or a price argument, or non-empty params');
70823
+ }
70824
+ const clientOrderId = this.safeString(params, 'clientOrderId');
70825
+ if (clientOrderId === undefined) {
70826
+ request['orderId'] = id;
70827
+ }
70828
+ request['market'] = market['id'];
70829
+ return request;
70830
+ }
70681
70831
  async editOrder(id, symbol, type, side, amount = undefined, price = undefined, params = {}) {
70682
70832
  /**
70683
70833
  * @method
70684
70834
  * @name bitvavo#editOrder
70685
70835
  * @description edit a trade order
70686
- * @see https://docs.bitvavo.com/#tag/Trading-endpoints/paths/~1order/put
70836
+ * @see https://docs.bitvavo.com/#tag/Orders/paths/~1order/put
70837
+ * @param {string} id cancel order id
70687
70838
  * @param {string} symbol unified symbol of the market to create an order in
70688
70839
  * @param {string} type 'market' or 'limit'
70689
70840
  * @param {string} side 'buy' or 'sell'
70690
- * @param {float} amount how much of currency you want to trade in units of base currency
70691
- * @param {float} [price] the price at which the order is to be fullfilled, in units of the quote currency, ignored in market orders
70692
- * @param {object} [params] extra parameters specific to the exchange API endpoint
70693
- * @param {string} [params.timeInForce] "GTC", "IOC", or "PO"
70694
- * @param {bool} [params.postOnly] If true, the order will only be posted to the order book and not executed immediately
70695
- * @param {float} [params.stopPrice] The price at which a trigger order is triggered at
70696
- * @param {float} [params.triggerPrice] The price at which a trigger order is triggered at
70697
- * @param {string} [params.selfTradePrevention] "decrementAndCancel", "cancelOldest", "cancelNewest", "cancelBoth"
70698
- * @param {bool} [params.responseRequired] Set this to 'false' when only an acknowledgement of success or failure is required, this is faster.
70699
- * @param {string} [params.clientOrderId] An ID supplied by the client
70841
+ * @param {float} [amount] how much of currency you want to trade in units of base currency
70842
+ * @param {float} [price] the price at which the order is to be fullfilled, in units of the base currency, ignored in market orders
70843
+ * @param {object} [params] extra parameters specific to the bitvavo api endpoint
70700
70844
  * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
70701
70845
  */
70702
70846
  await this.loadMarkets();
70703
70847
  const market = this.market(symbol);
70848
+ const request = this.editOrderRequest(id, symbol, type, side, amount, price, params);
70849
+ const response = await this.privatePutOrder(request);
70850
+ return this.parseOrder(response, market);
70851
+ }
70852
+ cancelOrderRequest(id, symbol = undefined, params = {}) {
70853
+ if (symbol === undefined) {
70854
+ throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.ArgumentsRequired(this.id + ' cancelOrder() requires a symbol argument');
70855
+ }
70856
+ const market = this.market(symbol);
70704
70857
  const request = {
70705
70858
  'market': market['id'],
70706
70859
  };
@@ -70708,35 +70861,13 @@ class bitvavo extends _abstract_bitvavo_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
70708
70861
  if (clientOrderId === undefined) {
70709
70862
  request['orderId'] = id;
70710
70863
  }
70711
- const amountRemaining = this.safeNumber(params, 'amountRemaining');
70712
- const triggerPrice = this.safeStringN(params, ['triggerPrice', 'stopPrice', 'triggerAmount']);
70713
- params = this.omit(params, ['amountRemaining', 'triggerPrice', 'stopPrice', 'triggerAmount']);
70714
- let updateRequest = {};
70715
- if (price !== undefined) {
70716
- updateRequest['price'] = this.priceToPrecision(symbol, price);
70717
- }
70718
- if (amount !== undefined) {
70719
- updateRequest['amount'] = this.amountToPrecision(symbol, amount);
70720
- }
70721
- if (amountRemaining !== undefined) {
70722
- updateRequest['amountRemaining'] = this.amountToPrecision(symbol, amountRemaining);
70723
- }
70724
- if (triggerPrice !== undefined) {
70725
- updateRequest['triggerAmount'] = this.priceToPrecision(symbol, triggerPrice);
70726
- }
70727
- updateRequest = this.extend(updateRequest, params);
70728
- if (Object.keys(updateRequest).length) {
70729
- const response = await this.privatePutOrder(this.extend(request, updateRequest));
70730
- return this.parseOrder(response, market);
70731
- }
70732
- else {
70733
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.ArgumentsRequired(this.id + ' editOrder() requires an amount argument, or a price argument, or non-empty params');
70734
- }
70864
+ return this.extend(request, params);
70735
70865
  }
70736
70866
  async cancelOrder(id, symbol = undefined, params = {}) {
70737
70867
  /**
70738
70868
  * @method
70739
70869
  * @name bitvavo#cancelOrder
70870
+ * @see https://docs.bitvavo.com/#tag/Orders/paths/~1order/delete
70740
70871
  * @description cancels an open order
70741
70872
  * @see https://docs.bitvavo.com/#tag/Trading-endpoints/paths/~1order/delete
70742
70873
  * @param {string} id order id
@@ -70744,19 +70875,10 @@ class bitvavo extends _abstract_bitvavo_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
70744
70875
  * @param {object} [params] extra parameters specific to the exchange API endpoint
70745
70876
  * @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
70746
70877
  */
70747
- if (symbol === undefined) {
70748
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.ArgumentsRequired(this.id + ' cancelOrder() requires a symbol argument');
70749
- }
70750
70878
  await this.loadMarkets();
70751
70879
  const market = this.market(symbol);
70752
- const request = {
70753
- 'market': market['id'],
70754
- };
70755
- const clientOrderId = this.safeString(params, 'clientOrderId');
70756
- if (clientOrderId === undefined) {
70757
- request['orderId'] = id;
70758
- }
70759
- const response = await this.privateDeleteOrder(this.extend(request, params));
70880
+ const request = this.cancelOrderRequest(id, symbol, params);
70881
+ const response = await this.privateDeleteOrder(request);
70760
70882
  //
70761
70883
  // {
70762
70884
  // "orderId": "2e7ce7fc-44e2-4d80-a4a7-d079c4750b61"
@@ -70768,6 +70890,7 @@ class bitvavo extends _abstract_bitvavo_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
70768
70890
  /**
70769
70891
  * @method
70770
70892
  * @name bitvavo#cancelAllOrders
70893
+ * @see https://docs.bitvavo.com/#tag/Orders/paths/~1orders/delete
70771
70894
  * @description cancel all open orders
70772
70895
  * @param {string} symbol unified market symbol, only orders in the market of this symbol are cancelled when symbol is not undefined
70773
70896
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -70849,6 +70972,25 @@ class bitvavo extends _abstract_bitvavo_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
70849
70972
  //
70850
70973
  return this.parseOrder(response, market);
70851
70974
  }
70975
+ fetchOrdersRequest(symbol = undefined, since = undefined, limit = undefined, params = {}) {
70976
+ const market = this.market(symbol);
70977
+ let request = {
70978
+ 'market': market['id'],
70979
+ // "limit": 500,
70980
+ // "start": since,
70981
+ // "end": this.milliseconds (),
70982
+ // "orderIdFrom": "af76d6ce-9f7c-4006-b715-bb5d430652d0",
70983
+ // "orderIdTo": "af76d6ce-9f7c-4006-b715-bb5d430652d0",
70984
+ };
70985
+ if (since !== undefined) {
70986
+ request['start'] = since;
70987
+ }
70988
+ if (limit !== undefined) {
70989
+ request['limit'] = limit; // default 500, max 1000
70990
+ }
70991
+ [request, params] = this.handleUntilOption('end', request, params);
70992
+ return this.extend(request, params);
70993
+ }
70852
70994
  async fetchOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
70853
70995
  /**
70854
70996
  * @method
@@ -70873,22 +71015,8 @@ class bitvavo extends _abstract_bitvavo_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
70873
71015
  return await this.fetchPaginatedCallDynamic('fetchOrders', symbol, since, limit, params);
70874
71016
  }
70875
71017
  const market = this.market(symbol);
70876
- let request = {
70877
- 'market': market['id'],
70878
- // "limit": 500,
70879
- // "start": since,
70880
- // "end": this.milliseconds (),
70881
- // "orderIdFrom": "af76d6ce-9f7c-4006-b715-bb5d430652d0",
70882
- // "orderIdTo": "af76d6ce-9f7c-4006-b715-bb5d430652d0",
70883
- };
70884
- if (since !== undefined) {
70885
- request['start'] = since;
70886
- }
70887
- if (limit !== undefined) {
70888
- request['limit'] = limit; // default 500, max 1000
70889
- }
70890
- [request, params] = this.handleUntilOption('end', request, params);
70891
- const response = await this.privateGetOrders(this.extend(request, params));
71018
+ const request = this.fetchOrdersRequest(symbol, since, limit, params);
71019
+ const response = await this.privateGetOrders(request);
70892
71020
  //
70893
71021
  // [
70894
71022
  // {
@@ -71108,6 +71236,25 @@ class bitvavo extends _abstract_bitvavo_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
71108
71236
  'trades': rawTrades,
71109
71237
  }, market);
71110
71238
  }
71239
+ fetchMyTradesRequest(symbol = undefined, since = undefined, limit = undefined, params = {}) {
71240
+ const market = this.market(symbol);
71241
+ let request = {
71242
+ 'market': market['id'],
71243
+ // "limit": 500,
71244
+ // "start": since,
71245
+ // "end": this.milliseconds (),
71246
+ // "tradeIdFrom": "af76d6ce-9f7c-4006-b715-bb5d430652d0",
71247
+ // "tradeIdTo": "af76d6ce-9f7c-4006-b715-bb5d430652d0",
71248
+ };
71249
+ if (since !== undefined) {
71250
+ request['start'] = since;
71251
+ }
71252
+ if (limit !== undefined) {
71253
+ request['limit'] = limit; // default 500, max 1000
71254
+ }
71255
+ [request, params] = this.handleUntilOption('end', request, params);
71256
+ return this.extend(request, params);
71257
+ }
71111
71258
  async fetchMyTrades(symbol = undefined, since = undefined, limit = undefined, params = {}) {
71112
71259
  /**
71113
71260
  * @method
@@ -71132,22 +71279,8 @@ class bitvavo extends _abstract_bitvavo_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
71132
71279
  return await this.fetchPaginatedCallDynamic('fetchMyTrades', symbol, since, limit, params);
71133
71280
  }
71134
71281
  const market = this.market(symbol);
71135
- let request = {
71136
- 'market': market['id'],
71137
- // "limit": 500,
71138
- // "start": since,
71139
- // "end": this.milliseconds (),
71140
- // "tradeIdFrom": "af76d6ce-9f7c-4006-b715-bb5d430652d0",
71141
- // "tradeIdTo": "af76d6ce-9f7c-4006-b715-bb5d430652d0",
71142
- };
71143
- if (since !== undefined) {
71144
- request['start'] = since;
71145
- }
71146
- if (limit !== undefined) {
71147
- request['limit'] = limit; // default 500, max 1000
71148
- }
71149
- [request, params] = this.handleUntilOption('end', request, params);
71150
- const response = await this.privateGetTrades(this.extend(request, params));
71282
+ const request = this.fetchMyTradesRequest(symbol, since, limit, params);
71283
+ const response = await this.privateGetTrades(request);
71151
71284
  //
71152
71285
  // [
71153
71286
  // {
@@ -71167,6 +71300,20 @@ class bitvavo extends _abstract_bitvavo_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
71167
71300
  //
71168
71301
  return this.parseTrades(response, market, since, limit);
71169
71302
  }
71303
+ withdrawRequest(code, amount, address, tag = undefined, params = {}) {
71304
+ const currency = this.currency(code);
71305
+ const request = {
71306
+ 'symbol': currency['id'],
71307
+ 'amount': this.currencyToPrecision(code, amount),
71308
+ 'address': address, // address or IBAN
71309
+ // 'internal': false, // transfer to another Bitvavo user address, no fees
71310
+ // 'addWithdrawalFee': false, // true = add the fee on top, otherwise the fee is subtracted from the amount
71311
+ };
71312
+ if (tag !== undefined) {
71313
+ request['paymentId'] = tag;
71314
+ }
71315
+ return this.extend(request, params);
71316
+ }
71170
71317
  async withdraw(code, amount, address, tag = undefined, params = {}) {
71171
71318
  /**
71172
71319
  * @method
@@ -71183,17 +71330,8 @@ class bitvavo extends _abstract_bitvavo_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
71183
71330
  this.checkAddress(address);
71184
71331
  await this.loadMarkets();
71185
71332
  const currency = this.currency(code);
71186
- const request = {
71187
- 'symbol': currency['id'],
71188
- 'amount': this.currencyToPrecision(code, amount),
71189
- 'address': address, // address or IBAN
71190
- // "internal": false, // transfer to another Bitvavo user address, no fees
71191
- // "addWithdrawalFee": false, // true = add the fee on top, otherwise the fee is subtracted from the amount
71192
- };
71193
- if (tag !== undefined) {
71194
- request['paymentId'] = tag;
71195
- }
71196
- const response = await this.privatePostWithdrawal(this.extend(request, params));
71333
+ const request = this.withdrawRequest(code, amount, address, tag, params);
71334
+ const response = await this.privatePostWithdrawal(request);
71197
71335
  //
71198
71336
  // {
71199
71337
  // "success": true,
@@ -71203,18 +71341,7 @@ class bitvavo extends _abstract_bitvavo_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
71203
71341
  //
71204
71342
  return this.parseTransaction(response, currency);
71205
71343
  }
71206
- async fetchWithdrawals(code = undefined, since = undefined, limit = undefined, params = {}) {
71207
- /**
71208
- * @method
71209
- * @name bitvavo#fetchWithdrawals
71210
- * @description fetch all withdrawals made from an account
71211
- * @param {string} code unified currency code
71212
- * @param {int} [since] the earliest time in ms to fetch withdrawals for
71213
- * @param {int} [limit] the maximum number of withdrawals structures to retrieve
71214
- * @param {object} [params] extra parameters specific to the exchange API endpoint
71215
- * @returns {object[]} a list of [transaction structures]{@link https://docs.ccxt.com/#/?id=transaction-structure}
71216
- */
71217
- await this.loadMarkets();
71344
+ fetchWithdrawalsRequest(code = undefined, since = undefined, limit = undefined, params = {}) {
71218
71345
  const request = {
71219
71346
  // 'symbol': currency['id'],
71220
71347
  // 'limit': 500, // default 500, max 1000
@@ -71232,7 +71359,27 @@ class bitvavo extends _abstract_bitvavo_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
71232
71359
  if (limit !== undefined) {
71233
71360
  request['limit'] = limit; // default 500, max 1000
71234
71361
  }
71235
- const response = await this.privateGetWithdrawalHistory(this.extend(request, params));
71362
+ return this.extend(request, params);
71363
+ }
71364
+ async fetchWithdrawals(code = undefined, since = undefined, limit = undefined, params = {}) {
71365
+ /**
71366
+ * @method
71367
+ * @name bitvavo#fetchWithdrawals
71368
+ * @see https://docs.bitvavo.com/#tag/Account/paths/~1withdrawalHistory/get
71369
+ * @description fetch all withdrawals made from an account
71370
+ * @param {string} code unified currency code
71371
+ * @param {int} [since] the earliest time in ms to fetch withdrawals for
71372
+ * @param {int} [limit] the maximum number of withdrawals structures to retrieve
71373
+ * @param {object} [params] extra parameters specific to the bitvavo api endpoint
71374
+ * @returns {object[]} a list of [transaction structures]{@link https://docs.ccxt.com/#/?id=transaction-structure}
71375
+ */
71376
+ await this.loadMarkets();
71377
+ const request = this.fetchWithdrawalsRequest(code, since, limit, params);
71378
+ let currency = undefined;
71379
+ if (code !== undefined) {
71380
+ currency = this.currency(code);
71381
+ }
71382
+ const response = await this.privateGetWithdrawalHistory(request);
71236
71383
  //
71237
71384
  // [
71238
71385
  // {
@@ -71249,18 +71396,7 @@ class bitvavo extends _abstract_bitvavo_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
71249
71396
  //
71250
71397
  return this.parseTransactions(response, currency, since, limit, { 'type': 'withdrawal' });
71251
71398
  }
71252
- async fetchDeposits(code = undefined, since = undefined, limit = undefined, params = {}) {
71253
- /**
71254
- * @method
71255
- * @name bitvavo#fetchDeposits
71256
- * @description fetch all deposits made to an account
71257
- * @param {string} code unified currency code
71258
- * @param {int} [since] the earliest time in ms to fetch deposits for
71259
- * @param {int} [limit] the maximum number of deposits structures to retrieve
71260
- * @param {object} [params] extra parameters specific to the exchange API endpoint
71261
- * @returns {object[]} a list of [transaction structures]{@link https://docs.ccxt.com/#/?id=transaction-structure}
71262
- */
71263
- await this.loadMarkets();
71399
+ fetchDepositsRequest(code = undefined, since = undefined, limit = undefined, params = {}) {
71264
71400
  const request = {
71265
71401
  // 'symbol': currency['id'],
71266
71402
  // 'limit': 500, // default 500, max 1000
@@ -71278,7 +71414,27 @@ class bitvavo extends _abstract_bitvavo_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
71278
71414
  if (limit !== undefined) {
71279
71415
  request['limit'] = limit; // default 500, max 1000
71280
71416
  }
71281
- const response = await this.privateGetDepositHistory(this.extend(request, params));
71417
+ return this.extend(request, params);
71418
+ }
71419
+ async fetchDeposits(code = undefined, since = undefined, limit = undefined, params = {}) {
71420
+ /**
71421
+ * @method
71422
+ * @name bitvavo#fetchDeposits
71423
+ * @see https://docs.bitvavo.com/#tag/Account/paths/~1depositHistory/get
71424
+ * @description fetch all deposits made to an account
71425
+ * @param {string} code unified currency code
71426
+ * @param {int} [since] the earliest time in ms to fetch deposits for
71427
+ * @param {int} [limit] the maximum number of deposits structures to retrieve
71428
+ * @param {object} [params] extra parameters specific to the bitvavo api endpoint
71429
+ * @returns {object[]} a list of [transaction structures]{@link https://docs.ccxt.com/#/?id=transaction-structure}
71430
+ */
71431
+ await this.loadMarkets();
71432
+ const request = this.fetchDepositsRequest(code, since, limit, params);
71433
+ let currency = undefined;
71434
+ if (code !== undefined) {
71435
+ currency = this.currency(code);
71436
+ }
71437
+ const response = await this.privateGetDepositHistory(request);
71282
71438
  //
71283
71439
  // [
71284
71440
  // {
@@ -72808,8 +72964,10 @@ class blockchaincom extends _abstract_blockchaincom_js__WEBPACK_IMPORTED_MODULE_
72808
72964
  let tag = undefined;
72809
72965
  let address = undefined;
72810
72966
  if (rawAddress !== undefined) {
72967
+ const addressParts = rawAddress.split(';');
72811
72968
  // if a tag or memo is used it is separated by a colon in the 'address' value
72812
- [address, tag] = rawAddress.split(':');
72969
+ tag = this.safeString(addressParts, 0);
72970
+ address = this.safeString(addressParts, 1);
72813
72971
  }
72814
72972
  const result = { 'info': response };
72815
72973
  result['currency'] = currency['code'];
@@ -78113,34 +78271,6 @@ class bybit extends _abstract_bybit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
78113
78271
  'info': undefined,
78114
78272
  };
78115
78273
  }
78116
- market(symbol) {
78117
- if (this.markets === undefined) {
78118
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.ExchangeError(this.id + ' markets not loaded');
78119
- }
78120
- if (typeof symbol === 'string') {
78121
- if (symbol in this.markets) {
78122
- return this.markets[symbol];
78123
- }
78124
- else if (symbol in this.markets_by_id) {
78125
- const markets = this.markets_by_id[symbol];
78126
- let defaultType = this.safeString2(this.options, 'defaultType', 'defaultSubType', 'spot');
78127
- if (defaultType === 'future') {
78128
- defaultType = 'contract';
78129
- }
78130
- for (let i = 0; i < markets.length; i++) {
78131
- const market = markets[i];
78132
- if (market[defaultType]) {
78133
- return market;
78134
- }
78135
- }
78136
- return markets[0];
78137
- }
78138
- else if ((symbol.indexOf('-C') > -1) || (symbol.indexOf('-P') > -1)) {
78139
- return this.createExpiredOptionMarket(symbol);
78140
- }
78141
- }
78142
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.BadSymbol(this.id + ' does not have market symbol ' + symbol);
78143
- }
78144
78274
  safeMarket(marketId = undefined, market = undefined, delimiter = undefined, marketType = undefined) {
78145
78275
  const isOption = (marketId !== undefined) && ((marketId.indexOf('-C') > -1) || (marketId.indexOf('-P') > -1));
78146
78276
  if (isOption && !(marketId in this.markets_by_id)) {
@@ -110196,24 +110326,6 @@ class delta extends _abstract_delta_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
110196
110326
  'info': undefined,
110197
110327
  };
110198
110328
  }
110199
- market(symbol) {
110200
- if (this.markets === undefined) {
110201
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ExchangeError(this.id + ' markets not loaded');
110202
- }
110203
- if (typeof symbol === 'string') {
110204
- if (symbol in this.markets) {
110205
- return this.markets[symbol];
110206
- }
110207
- else if (symbol in this.markets_by_id) {
110208
- const markets = this.markets_by_id[symbol];
110209
- return markets[0];
110210
- }
110211
- else if ((symbol.endsWith('-C')) || (symbol.endsWith('-P')) || (symbol.startsWith('C-')) || (symbol.startsWith('P-'))) {
110212
- return this.createExpiredOptionMarket(symbol);
110213
- }
110214
- }
110215
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.BadSymbol(this.id + ' does not have market symbol ' + symbol);
110216
- }
110217
110329
  safeMarket(marketId = undefined, market = undefined, delimiter = undefined, marketType = undefined) {
110218
110330
  const isOption = (marketId !== undefined) && ((marketId.endsWith('-C')) || (marketId.endsWith('-P')) || (marketId.startsWith('C-')) || (marketId.startsWith('P-')));
110219
110331
  if (isOption && !(marketId in this.markets_by_id)) {
@@ -124050,6 +124162,7 @@ class gate extends _abstract_gate_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
124050
124162
  'multi_collateral/currency_quota': 20 / 15,
124051
124163
  'multi_collateral/currencies': 20 / 15,
124052
124164
  'multi_collateral/ltv': 20 / 15,
124165
+ 'multi_collateral/fixed_rate': 20 / 15,
124053
124166
  },
124054
124167
  'post': {
124055
124168
  'collateral/orders': 20 / 15,
@@ -124454,31 +124567,6 @@ class gate extends _abstract_gate_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
124454
124567
  'info': undefined,
124455
124568
  };
124456
124569
  }
124457
- market(symbol) {
124458
- if (this.markets === undefined) {
124459
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ExchangeError(this.id + ' markets not loaded');
124460
- }
124461
- if (typeof symbol === 'string') {
124462
- if (symbol in this.markets) {
124463
- return this.markets[symbol];
124464
- }
124465
- else if (symbol in this.markets_by_id) {
124466
- const markets = this.markets_by_id[symbol];
124467
- const defaultType = this.safeString2(this.options, 'defaultType', 'defaultSubType', 'spot');
124468
- for (let i = 0; i < markets.length; i++) {
124469
- const market = markets[i];
124470
- if (market[defaultType]) {
124471
- return market;
124472
- }
124473
- }
124474
- return markets[0];
124475
- }
124476
- else if ((symbol.indexOf('-C') > -1) || (symbol.indexOf('-P') > -1)) {
124477
- return this.createExpiredOptionMarket(symbol);
124478
- }
124479
- }
124480
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.BadSymbol(this.id + ' does not have market symbol ' + symbol);
124481
- }
124482
124570
  safeMarket(marketId = undefined, market = undefined, delimiter = undefined, marketType = undefined) {
124483
124571
  const isOption = (marketId !== undefined) && ((marketId.indexOf('-C') > -1) || (marketId.indexOf('-P') > -1));
124484
124572
  if (isOption && !(marketId in this.markets_by_id)) {
@@ -129104,7 +129192,7 @@ class gate extends _abstract_gate_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
129104
129192
  * @description retrieve information on the maximum leverage, and maintenance margin for trades of varying trade sizes
129105
129193
  * @see https://www.gate.io/docs/developers/apiv4/en/#list-all-futures-contracts
129106
129194
  * @see https://www.gate.io/docs/developers/apiv4/en/#list-all-futures-contracts-2
129107
- * @param {string[]|undefined} symbols list of unified market symbols
129195
+ * @param {string[]} [symbols] list of unified market symbols
129108
129196
  * @param {object} [params] extra parameters specific to the exchange API endpoint
129109
129197
  * @returns {object} a dictionary of [leverage tiers structures]{@link https://docs.ccxt.com/#/?id=leverage-tiers-structure}, indexed by market symbols
129110
129198
  */
@@ -129249,6 +129337,33 @@ class gate extends _abstract_gate_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
129249
129337
  //
129250
129338
  return this.parseMarketLeverageTiers(response, market);
129251
129339
  }
129340
+ parseEmulatedLeverageTiers(info, market = undefined) {
129341
+ const maintenanceMarginUnit = this.safeString(info, 'maintenance_rate'); // '0.005',
129342
+ const leverageMax = this.safeString(info, 'leverage_max'); // '100',
129343
+ const riskLimitStep = this.safeString(info, 'risk_limit_step'); // '1000000',
129344
+ const riskLimitMax = this.safeString(info, 'risk_limit_max'); // '16000000',
129345
+ const initialMarginUnit = _base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise */ .O.stringDiv('1', leverageMax);
129346
+ let maintenanceMarginRate = maintenanceMarginUnit;
129347
+ let initialMarginRatio = initialMarginUnit;
129348
+ let floor = '0';
129349
+ const tiers = [];
129350
+ while (_base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise */ .O.stringLt(floor, riskLimitMax)) {
129351
+ const cap = _base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise */ .O.stringAdd(floor, riskLimitStep);
129352
+ tiers.push({
129353
+ 'tier': this.parseNumber(_base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise */ .O.stringDiv(cap, riskLimitStep)),
129354
+ 'currency': this.safeString(market, 'settle'),
129355
+ 'minNotional': this.parseNumber(floor),
129356
+ 'maxNotional': this.parseNumber(cap),
129357
+ 'maintenanceMarginRate': this.parseNumber(maintenanceMarginRate),
129358
+ 'maxLeverage': this.parseNumber(_base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise */ .O.stringDiv('1', initialMarginRatio)),
129359
+ 'info': info,
129360
+ });
129361
+ maintenanceMarginRate = _base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise */ .O.stringAdd(maintenanceMarginRate, maintenanceMarginUnit);
129362
+ initialMarginRatio = _base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise */ .O.stringAdd(initialMarginRatio, initialMarginUnit);
129363
+ floor = cap;
129364
+ }
129365
+ return tiers;
129366
+ }
129252
129367
  parseMarketLeverageTiers(info, market = undefined) {
129253
129368
  //
129254
129369
  // [
@@ -129261,6 +129376,9 @@ class gate extends _abstract_gate_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
129261
129376
  // }
129262
129377
  // ]
129263
129378
  //
129379
+ if (!Array.isArray(info)) {
129380
+ return this.parseEmulatedLeverageTiers(info, market);
129381
+ }
129264
129382
  let minNotional = 0;
129265
129383
  const tiers = [];
129266
129384
  for (let i = 0; i < info.length; i++) {
@@ -164391,7 +164509,7 @@ class kucoinfutures extends _abstract_kucoinfutures_js__WEBPACK_IMPORTED_MODULE_
164391
164509
  * @method
164392
164510
  * @name kucoinfutures#fetchFundingRate
164393
164511
  * @description fetch the current funding rate
164394
- * @see https://www.kucoin.com/docs/rest/futures-trading/market-data/get-current-funding-rate
164512
+ * @see https://www.kucoin.com/docs/rest/futures-trading/funding-fees/get-current-funding-rate
164395
164513
  * @param {string} symbol unified market symbol
164396
164514
  * @param {object} [params] extra parameters specific to the exchange API endpoint
164397
164515
  * @returns {object} a [funding rate structure]{@link https://docs.ccxt.com/#/?id=funding-rate-structure}
@@ -164415,7 +164533,7 @@ class kucoinfutures extends _abstract_kucoinfutures_js__WEBPACK_IMPORTED_MODULE_
164415
164533
  // }
164416
164534
  //
164417
164535
  const data = this.safeValue(response, 'data');
164418
- const fundingTimestamp = this.safeNumber(data, 'timePoint');
164536
+ const fundingTimestamp = this.safeInteger(data, 'timePoint');
164419
164537
  // the website displayes the previous funding rate as "funding rate"
164420
164538
  return {
164421
164539
  'info': data,
@@ -164426,15 +164544,15 @@ class kucoinfutures extends _abstract_kucoinfutures_js__WEBPACK_IMPORTED_MODULE_
164426
164544
  'estimatedSettlePrice': undefined,
164427
164545
  'timestamp': undefined,
164428
164546
  'datetime': undefined,
164429
- 'fundingRate': this.safeNumber(data, 'predictedValue'),
164430
- 'fundingTimestamp': undefined,
164431
- 'fundingDatetime': undefined,
164432
- 'nextFundingRate': undefined,
164547
+ 'fundingRate': this.safeNumber(data, 'value'),
164548
+ 'fundingTimestamp': fundingTimestamp,
164549
+ 'fundingDatetime': this.iso8601(fundingTimestamp),
164550
+ 'nextFundingRate': this.safeNumber(data, 'predictedValue'),
164433
164551
  'nextFundingTimestamp': undefined,
164434
164552
  'nextFundingDatetime': undefined,
164435
- 'previousFundingRate': this.safeNumber(data, 'value'),
164436
- 'previousFundingTimestamp': fundingTimestamp,
164437
- 'previousFundingDatetime': this.iso8601(fundingTimestamp),
164553
+ 'previousFundingRate': undefined,
164554
+ 'previousFundingTimestamp': undefined,
164555
+ 'previousFundingDatetime': undefined,
164438
164556
  };
164439
164557
  }
164440
164558
  parseBalance(response) {
@@ -182912,9 +183030,9 @@ class novadax extends _abstract_novadax_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
182912
183030
  'id': 'novadax',
182913
183031
  'name': 'NovaDAX',
182914
183032
  'countries': ['BR'],
182915
- // 60 requests per second = 1000ms / 60 = 16.6667ms between requests (public endpoints, limited by IP address)
182916
- // 20 requests per second => cost = 60 / 20 = 3 (private endpoints, limited by API Key)
182917
- 'rateLimit': 16.6667,
183033
+ // 6000 weight per min => 100 weight per second => min weight = 1
183034
+ // 100 requests per second => ( 1000ms / 100 ) = 10 ms between requests on average
183035
+ 'rateLimit': 10,
182918
183036
  'version': 'v1',
182919
183037
  // new metainfo interface
182920
183038
  'has': {
@@ -183012,33 +183130,37 @@ class novadax extends _abstract_novadax_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
183012
183130
  'api': {
183013
183131
  'public': {
183014
183132
  'get': {
183015
- 'common/symbol': 1.2,
183016
- 'common/symbols': 1.2,
183017
- 'common/timestamp': 1.2,
183018
- 'market/tickers': 1.2,
183019
- 'market/ticker': 1.2,
183020
- 'market/depth': 1.2,
183021
- 'market/trades': 1.2,
183022
- 'market/kline/history': 1.2,
183133
+ 'common/symbol': 1,
183134
+ 'common/symbols': 1,
183135
+ 'common/timestamp': 1,
183136
+ 'market/tickers': 5,
183137
+ 'market/ticker': 1,
183138
+ 'market/depth': 1,
183139
+ 'market/trades': 5,
183140
+ 'market/kline/history': 5,
183023
183141
  },
183024
183142
  },
183025
183143
  'private': {
183026
183144
  'get': {
183027
- 'orders/get': 3,
183028
- 'orders/list': 3,
183145
+ 'orders/get': 1,
183146
+ 'orders/list': 10,
183029
183147
  'orders/fill': 3,
183030
- 'orders/fills': 3,
183031
- 'account/getBalance': 3,
183032
- 'account/subs': 3,
183033
- 'account/subs/balance': 3,
183034
- 'account/subs/transfer/record': 3,
183148
+ 'orders/fills': 10,
183149
+ 'account/getBalance': 1,
183150
+ 'account/subs': 1,
183151
+ 'account/subs/balance': 1,
183152
+ 'account/subs/transfer/record': 10,
183035
183153
  'wallet/query/deposit-withdraw': 3,
183036
183154
  },
183037
183155
  'post': {
183038
- 'orders/create': 3,
183039
- 'orders/cancel': 3,
183040
- 'account/withdraw/coin': 3,
183041
- 'account/subs/transfer': 3,
183156
+ 'orders/create': 5,
183157
+ 'orders/batch-create': 50,
183158
+ 'orders/cancel': 1,
183159
+ 'orders/batch-cancel': 10,
183160
+ 'orders/cancel-by-symbol': 10,
183161
+ 'account/subs/transfer': 5,
183162
+ 'wallet/withdraw/coin': 3,
183163
+ 'account/withdraw/coin': 3, // not found in doc
183042
183164
  },
183043
183165
  },
183044
183166
  },
@@ -189710,24 +189832,6 @@ class okx extends _abstract_okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
189710
189832
  'info': undefined,
189711
189833
  };
189712
189834
  }
189713
- market(symbol) {
189714
- if (this.markets === undefined) {
189715
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.ExchangeError(this.id + ' markets not loaded');
189716
- }
189717
- if (typeof symbol === 'string') {
189718
- if (symbol in this.markets) {
189719
- return this.markets[symbol];
189720
- }
189721
- else if (symbol in this.markets_by_id) {
189722
- const markets = this.markets_by_id[symbol];
189723
- return markets[0];
189724
- }
189725
- else if ((symbol.indexOf('-C') > -1) || (symbol.indexOf('-P') > -1)) {
189726
- return this.createExpiredOptionMarket(symbol);
189727
- }
189728
- }
189729
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.BadSymbol(this.id + ' does not have market symbol ' + symbol);
189730
- }
189731
189835
  safeMarket(marketId = undefined, market = undefined, delimiter = undefined, marketType = undefined) {
189732
189836
  const isOption = (marketId !== undefined) && ((marketId.indexOf('-C') > -1) || (marketId.indexOf('-P') > -1));
189733
189837
  if (isOption && !(marketId in this.markets_by_id)) {
@@ -199959,6 +200063,7 @@ class phemex extends _abstract_phemex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
199959
200063
  'api-data/g-futures/trades': 5,
199960
200064
  'api-data/futures/trading-fees': 5,
199961
200065
  'api-data/g-futures/trading-fees': 5,
200066
+ 'api-data/futures/v2/tradeAccountDetail': 5,
199962
200067
  'g-orders/activeList': 1,
199963
200068
  'orders/activeList': 1,
199964
200069
  'exchange/order/list': 5,
@@ -202536,7 +202641,7 @@ class phemex extends _abstract_phemex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
202536
202641
  }
202537
202642
  else if (amount !== undefined) {
202538
202643
  if (isUSDTSettled) {
202539
- request['baseQtyEV'] = this.amountToPrecision(market['symbol'], amount);
202644
+ request['orderQtyRq'] = this.amountToPrecision(market['symbol'], amount);
202540
202645
  }
202541
202646
  else {
202542
202647
  request['baseQtyEV'] = this.toEv(amount, market);
@@ -221026,8 +221131,8 @@ class bitopro extends _bitopro_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
221026
221131
  },
221027
221132
  'urls': {
221028
221133
  'ws': {
221029
- 'public': 'wss://stream.bitopro.com:9443/ws/v1/pub',
221030
- 'private': 'wss://stream.bitopro.com:9443/ws/v1/pub/auth',
221134
+ 'public': 'wss://stream.bitopro.com:443/ws/v1/pub',
221135
+ 'private': 'wss://stream.bitopro.com:443/ws/v1/pub/auth',
221031
221136
  },
221032
221137
  },
221033
221138
  'requiredCredentials': {
@@ -221056,6 +221161,7 @@ class bitopro extends _bitopro_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
221056
221161
  * @method
221057
221162
  * @name bitopro#watchOrderBook
221058
221163
  * @description watches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
221164
+ * @see https://github.com/bitoex/bitopro-offical-api-docs/blob/master/ws/public/order_book_stream.md
221059
221165
  * @param {string} symbol unified symbol of the market to fetch the order book for
221060
221166
  * @param {int} [limit] the maximum amount of order book entries to return
221061
221167
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -221121,6 +221227,7 @@ class bitopro extends _bitopro_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
221121
221227
  * @method
221122
221228
  * @name bitopro#watchTrades
221123
221229
  * @description get the list of most recent trades for a particular symbol
221230
+ * @see https://github.com/bitoex/bitopro-offical-api-docs/blob/master/ws/public/trade_stream.md
221124
221231
  * @param {string} symbol unified symbol of the market to fetch trades for
221125
221232
  * @param {int} [since] timestamp in ms of the earliest trade to fetch
221126
221233
  * @param {int} [limit] the maximum amount of trades to fetch
@@ -221180,6 +221287,7 @@ class bitopro extends _bitopro_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
221180
221287
  * @method
221181
221288
  * @name bitopro#watchTicker
221182
221289
  * @description watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
221290
+ * @see https://github.com/bitoex/bitopro-offical-api-docs/blob/master/ws/public/ticker_stream.md
221183
221291
  * @param {string} symbol unified symbol of the market to fetch the ticker for
221184
221292
  * @param {object} [params] extra parameters specific to the exchange API endpoint
221185
221293
  * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
@@ -221233,7 +221341,7 @@ class bitopro extends _bitopro_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
221233
221341
  'identity': this.login,
221234
221342
  });
221235
221343
  const payload = this.stringToBase64(rawData);
221236
- const signature = this.hmac(payload, this.encode(this.secret), _static_dependencies_noble_hashes_sha512_js__WEBPACK_IMPORTED_MODULE_3__/* .sha384 */ .iC);
221344
+ const signature = this.hmac(this.encode(payload), this.encode(this.secret), _static_dependencies_noble_hashes_sha512_js__WEBPACK_IMPORTED_MODULE_3__/* .sha384 */ .iC);
221237
221345
  const defaultOptions = {
221238
221346
  'ws': {
221239
221347
  'options': {
@@ -221259,6 +221367,7 @@ class bitopro extends _bitopro_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
221259
221367
  * @method
221260
221368
  * @name bitopro#watchBalance
221261
221369
  * @description watch balance and get the amount of funds available for trading or funds locked in orders
221370
+ * @see https://github.com/bitoex/bitopro-offical-api-docs/blob/master/ws/private/user_balance_stream.md
221262
221371
  * @param {object} [params] extra parameters specific to the exchange API endpoint
221263
221372
  * @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
221264
221373
  */
@@ -222397,21 +222506,38 @@ class bitvavo extends _bitvavo_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
222397
222506
  return this.deepExtend(super.describe(), {
222398
222507
  'has': {
222399
222508
  'ws': true,
222400
- 'createOrderWs': false,
222401
- 'editOrderWs': false,
222402
- 'fetchOpenOrdersWs': false,
222403
- 'fetchOrderWs': false,
222404
- 'cancelOrderWs': false,
222405
222509
  'cancelOrdersWs': false,
222406
- 'cancelAllOrdersWs': false,
222407
222510
  'fetchTradesWs': false,
222408
- 'fetchBalanceWs': false,
222409
222511
  'watchOrderBook': true,
222410
222512
  'watchTrades': true,
222411
222513
  'watchTicker': true,
222412
222514
  'watchOHLCV': true,
222413
222515
  'watchOrders': true,
222414
222516
  'watchMyTrades': true,
222517
+ 'cancelAllOrdersWs': true,
222518
+ 'cancelOrderWs': true,
222519
+ 'createOrderWs': true,
222520
+ 'createStopLimitOrderWs': true,
222521
+ 'createStopMarketOrderWs': true,
222522
+ 'createStopOrderWs': true,
222523
+ 'editOrderWs': true,
222524
+ 'fetchBalanceWs': true,
222525
+ 'fetchCurrenciesWS': true,
222526
+ 'fetchDepositAddressWs': true,
222527
+ 'fetchDepositsWs': true,
222528
+ 'fetchDepositWithdrawFeesWs': true,
222529
+ 'fetchMyTradesWs': true,
222530
+ 'fetchOHLCVWs': true,
222531
+ 'fetchOpenOrdersWs': true,
222532
+ 'fetchOrderWs': true,
222533
+ 'fetchOrderBookWs': true,
222534
+ 'fetchOrdersWs': true,
222535
+ 'fetchTickerWs': true,
222536
+ 'fetchTickersWs': true,
222537
+ 'fetchTimeWs': true,
222538
+ 'fetchTradingFeesWs': true,
222539
+ 'fetchWithdrawalsWs': true,
222540
+ 'withdrawWs': true,
222415
222541
  },
222416
222542
  'urls': {
222417
222543
  'api': {
@@ -222419,6 +222545,7 @@ class bitvavo extends _bitvavo_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
222419
222545
  },
222420
222546
  },
222421
222547
  'options': {
222548
+ 'supressMultipleWsRequestsError': false,
222422
222549
  'tradesLimit': 1000,
222423
222550
  'ordersLimit': 1000,
222424
222551
  'OHLCVLimit': 1000,
@@ -222574,6 +222701,22 @@ class bitvavo extends _bitvavo_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
222574
222701
  }
222575
222702
  return this.filterBySinceLimit(ohlcv, since, limit, 0, true);
222576
222703
  }
222704
+ handleFetchOHLCV(client, message) {
222705
+ //
222706
+ // {
222707
+ // action: 'getCandles',
222708
+ // response: [
222709
+ // [1690325820000, '26453', '26453', '26436', '26447', '0.01626246'],
222710
+ // [1690325760000, '26454', '26454', '26453', '26453', '0.00037707']
222711
+ // ]
222712
+ // }
222713
+ //
222714
+ const action = this.safeString(message, 'action');
222715
+ const response = this.safeValue(message, 'response');
222716
+ const ohlcv = this.parseOHLCVs(response, undefined, undefined, undefined);
222717
+ const messageHash = this.buildMessageHash(action);
222718
+ client.resolve(ohlcv, messageHash);
222719
+ }
222577
222720
  handleOHLCV(client, message) {
222578
222721
  //
222579
222722
  // {
@@ -222879,6 +223022,584 @@ class bitvavo extends _bitvavo_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
222879
223022
  }
222880
223023
  return this.filterBySymbolSinceLimit(trades, symbol, since, limit, true);
222881
223024
  }
223025
+ async createOrderWs(symbol, type, side, amount, price = undefined, params = {}) {
223026
+ /**
223027
+ * @method
223028
+ * @name bitvavo#createOrderWs
223029
+ * @description create a trade order
223030
+ * @see https://docs.bitvavo.com/#tag/Orders/paths/~1order/post
223031
+ * @param {string} symbol unified symbol of the market to create an order in
223032
+ * @param {string} type 'market' or 'limit'
223033
+ * @param {string} side 'buy' or 'sell'
223034
+ * @param {float} amount how much of currency you want to trade in units of base currency
223035
+ * @param {float} price the price at which the order is to be fullfilled, in units of the quote currency, ignored in market orders
223036
+ * @param {object} [params] extra parameters specific to the bitvavo api endpoint
223037
+ * @param {string} [params.timeInForce] "GTC", "IOC", or "PO"
223038
+ * @param {float} [params.stopPrice] The price at which a trigger order is triggered at
223039
+ * @param {float} [params.triggerPrice] The price at which a trigger order is triggered at
223040
+ * @param {bool} [params.postOnly] If true, the order will only be posted to the order book and not executed immediately
223041
+ * @param {float} [params.stopLossPrice] The price at which a stop loss order is triggered at
223042
+ * @param {float} [params.takeProfitPrice] The price at which a take profit order is triggered at
223043
+ * @param {string} [params.triggerType] "price"
223044
+ * @param {string} [params.triggerReference] "lastTrade", "bestBid", "bestAsk", "midPrice" Only for stop orders: Use this to determine which parameter will trigger the order
223045
+ * @param {string} [params.selfTradePrevention] "decrementAndCancel", "cancelOldest", "cancelNewest", "cancelBoth"
223046
+ * @param {bool} [params.disableMarketProtection] don't cancel if the next fill price is 10% worse than the best fill price
223047
+ * @param {bool} [params.responseRequired] Set this to 'false' when only an acknowledgement of success or failure is required, this is faster.
223048
+ * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
223049
+ */
223050
+ await this.loadMarkets();
223051
+ await this.authenticate();
223052
+ const request = this.createOrderRequest(symbol, type, side, amount, price, params);
223053
+ return await this.watchRequest('privateCreateOrder', request);
223054
+ }
223055
+ async editOrderWs(id, symbol, type, side, amount = undefined, price = undefined, params = {}) {
223056
+ /**
223057
+ * @method
223058
+ * @name bitvavo#editOrderWs
223059
+ * @description edit a trade order
223060
+ * @see https://docs.bitvavo.com/#tag/Orders/paths/~1order/put
223061
+ * @param {string} id cancel order id
223062
+ * @param {string} symbol unified symbol of the market to create an order in
223063
+ * @param {string} type 'market' or 'limit'
223064
+ * @param {string} side 'buy' or 'sell'
223065
+ * @param {float} [amount] how much of currency you want to trade in units of base currency
223066
+ * @param {float} [price] the price at which the order is to be fullfilled, in units of the base currency, ignored in market orders
223067
+ * @param {object} [params] extra parameters specific to the bitvavo api endpoint
223068
+ * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
223069
+ */
223070
+ await this.loadMarkets();
223071
+ await this.authenticate();
223072
+ const request = this.editOrderRequest(id, symbol, type, side, amount, price, params);
223073
+ return await this.watchRequest('privateUpdateOrder', request);
223074
+ }
223075
+ async cancelOrderWs(id, symbol = undefined, params = {}) {
223076
+ /**
223077
+ * @method
223078
+ * @name bitvavo#cancelOrderWs
223079
+ * @see https://docs.bitvavo.com/#tag/Orders/paths/~1order/delete
223080
+ * @description cancels an open order
223081
+ * @param {string} id order id
223082
+ * @param {string} symbol unified symbol of the market the order was made in
223083
+ * @param {object} [params] extra parameters specific to the bitvavo api endpoint
223084
+ * @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
223085
+ */
223086
+ await this.loadMarkets();
223087
+ await this.authenticate();
223088
+ const request = this.cancelOrderRequest(id, symbol, params);
223089
+ return await this.watchRequest('privateCancelOrder', request);
223090
+ }
223091
+ async cancelAllOrdersWs(symbol = undefined, params = {}) {
223092
+ /**
223093
+ * @method
223094
+ * @name bitvavo#cancelAllOrdersWs
223095
+ * @see https://docs.bitvavo.com/#tag/Orders/paths/~1orders/delete
223096
+ * @description cancel all open orders
223097
+ * @param {string} symbol unified market symbol, only orders in the market of this symbol are cancelled when symbol is not undefined
223098
+ * @param {object} [params] extra parameters specific to the bitvavo api endpoint
223099
+ * @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
223100
+ */
223101
+ await this.loadMarkets();
223102
+ await this.authenticate();
223103
+ const request = {};
223104
+ let market = undefined;
223105
+ if (symbol !== undefined) {
223106
+ market = this.market(symbol);
223107
+ request['market'] = market['id'];
223108
+ }
223109
+ return await this.watchRequest('privateCancelOrders', this.extend(request, params));
223110
+ }
223111
+ handleMultipleOrders(client, message) {
223112
+ //
223113
+ // {
223114
+ // action: 'privateCancelOrders',
223115
+ // response: [{
223116
+ // orderId: 'd71df826-1130-478a-8741-d219128675b0'
223117
+ // }]
223118
+ // }
223119
+ //
223120
+ const action = this.safeString(message, 'action');
223121
+ const response = this.safeValue(message, 'response');
223122
+ const firstRawOrder = this.safeValue(response, 0, {});
223123
+ const marketId = this.safeString(firstRawOrder, 'market');
223124
+ const orders = this.parseOrders(response);
223125
+ let messageHash = this.buildMessageHash(action, { 'market': marketId });
223126
+ client.resolve(orders, messageHash);
223127
+ messageHash = this.buildMessageHash(action, message);
223128
+ client.resolve(orders, messageHash);
223129
+ }
223130
+ async fetchOrderWs(id, symbol = undefined, params = {}) {
223131
+ /**
223132
+ * @method
223133
+ * @name bitvavo#fetchOrderWs
223134
+ * @see https://docs.bitvavo.com/#tag/General/paths/~1assets/get
223135
+ * @description fetches information on an order made by the user
223136
+ * @param {string} symbol unified symbol of the market the order was made in
223137
+ * @param {object} [params] extra parameters specific to the bitvavo api endpoint
223138
+ * @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
223139
+ */
223140
+ if (symbol === undefined) {
223141
+ throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ArgumentsRequired(this.id + ' fetchOrder() requires a symbol argument');
223142
+ }
223143
+ await this.loadMarkets();
223144
+ await this.authenticate();
223145
+ const market = this.market(symbol);
223146
+ const request = {
223147
+ 'orderId': id,
223148
+ 'market': market['id'],
223149
+ };
223150
+ return await this.watchRequest('privateGetOrder', this.extend(request, params));
223151
+ }
223152
+ async fetchOrdersWs(symbol = undefined, since = undefined, limit = undefined, params = {}) {
223153
+ /**
223154
+ * @method
223155
+ * @name bitvavo#fetchOrdersWs
223156
+ * @see https://docs.bitvavo.com/#tag/Orders/paths/~1orders/get
223157
+ * @description fetches information on multiple orders made by the user
223158
+ * @param {string} symbol unified market symbol of the market orders were made in
223159
+ * @param {int} [since] the earliest time in ms to fetch orders for
223160
+ * @param {int} [limit] the maximum number of orde structures to retrieve
223161
+ * @param {object} [params] extra parameters specific to the bitvavo api endpoint
223162
+ * @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
223163
+ */
223164
+ if (symbol === undefined) {
223165
+ throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ArgumentsRequired(this.id + ' fetchOrdersWs() requires a symbol argument');
223166
+ }
223167
+ await this.loadMarkets();
223168
+ await this.authenticate();
223169
+ const request = this.fetchOrdersRequest(symbol, since, limit, params);
223170
+ const orders = await this.watchRequest('privateGetOrders', request);
223171
+ return this.filterBySymbolSinceLimit(orders, symbol, since, limit);
223172
+ }
223173
+ async watchRequest(action, request) {
223174
+ request['action'] = action;
223175
+ const messageHash = this.buildMessageHash(action, request);
223176
+ this.checkMessageHashDoesNotExist(messageHash);
223177
+ const url = this.urls['api']['ws'];
223178
+ return await this.watch(url, messageHash, request, messageHash);
223179
+ }
223180
+ async fetchOpenOrdersWs(symbol = undefined, since = undefined, limit = undefined, params = {}) {
223181
+ /**
223182
+ * @method
223183
+ * @name bitvavo#fetchOpenOrdersWs
223184
+ * @description fetch all unfilled currently open orders
223185
+ * @param {string} symbol unified market symbol
223186
+ * @param {int} [since] the earliest time in ms to fetch open orders for
223187
+ * @param {int} [limit] the maximum number of open orders structures to retrieve
223188
+ * @param {object} [params] extra parameters specific to the bitvavo api endpoint
223189
+ * @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
223190
+ */
223191
+ await this.loadMarkets();
223192
+ await this.authenticate();
223193
+ const request = {
223194
+ // 'market': market['id'], // rate limit 25 without a market, 1 with market specified
223195
+ };
223196
+ let market = undefined;
223197
+ if (symbol !== undefined) {
223198
+ market = this.market(symbol);
223199
+ request['market'] = market['id'];
223200
+ }
223201
+ const orders = await this.watchRequest('privateGetOrdersOpen', this.extend(request, params));
223202
+ return this.filterBySymbolSinceLimit(orders, symbol, since, limit);
223203
+ }
223204
+ async fetchMyTradesWs(symbol = undefined, since = undefined, limit = undefined, params = {}) {
223205
+ /**
223206
+ * @method
223207
+ * @name bitvavo#fetchMyTradesWs
223208
+ * @see https://docs.bitvavo.com/#tag/Trades
223209
+ * @description fetch all trades made by the user
223210
+ * @param {string} symbol unified market symbol
223211
+ * @param {int} [since] the earliest time in ms to fetch trades for
223212
+ * @param {int} [limit] the maximum number of trades structures to retrieve
223213
+ * @param {object} [params] extra parameters specific to the bitvavo api endpoint
223214
+ * @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
223215
+ */
223216
+ if (symbol === undefined) {
223217
+ throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ArgumentsRequired(this.id + ' fetchMyTradesWs() requires a symbol argument');
223218
+ }
223219
+ await this.loadMarkets();
223220
+ await this.authenticate();
223221
+ const request = this.fetchMyTradesRequest(symbol, since, limit, params);
223222
+ const myTrades = await this.watchRequest('privateGetTrades', request);
223223
+ return this.filterBySymbolSinceLimit(myTrades, symbol, since, limit);
223224
+ }
223225
+ handleMyTrades(client, message) {
223226
+ //
223227
+ // {
223228
+ // action: 'privateGetTrades',
223229
+ // response: [
223230
+ // {
223231
+ // "id": "108c3633-0276-4480-a902-17a01829deae",
223232
+ // "orderId": "1d671998-3d44-4df4-965f-0d48bd129a1b",
223233
+ // "timestamp": 1542967486256,
223234
+ // "market": "BTC-EUR",
223235
+ // "side": "buy",
223236
+ // "amount": "0.005",
223237
+ // "price": "5000.1",
223238
+ // "taker": true,
223239
+ // "fee": "0.03",
223240
+ // "feeCurrency": "EUR",
223241
+ // "settled": true
223242
+ // }
223243
+ // ]
223244
+ // }
223245
+ //
223246
+ //
223247
+ const action = this.safeString(message, 'action');
223248
+ const response = this.safeValue(message, 'response');
223249
+ const firstRawTrade = this.safeValue(response, 0, {});
223250
+ const marketId = this.safeString(firstRawTrade, 'market');
223251
+ const trades = this.parseTrades(response, undefined, undefined, undefined);
223252
+ const messageHash = this.buildMessageHash(action, { 'market': marketId });
223253
+ client.resolve(trades, messageHash);
223254
+ }
223255
+ async withdrawWs(code, amount, address, tag = undefined, params = {}) {
223256
+ /**
223257
+ * @method
223258
+ * @name bitvavo#withdrawWs
223259
+ * @description make a withdrawal
223260
+ * @param {string} code unified currency code
223261
+ * @param {float} amount the amount to withdraw
223262
+ * @param {string} address the address to withdraw to
223263
+ * @param {string} tag
223264
+ * @param {object} [params] extra parameters specific to the bitvavo api endpoint
223265
+ * @returns {object} a [transaction structure]{@link https://docs.ccxt.com/#/?id=transaction-structure}
223266
+ */
223267
+ [tag, params] = this.handleWithdrawTagAndParams(tag, params);
223268
+ this.checkAddress(address);
223269
+ await this.loadMarkets();
223270
+ await this.authenticate();
223271
+ const request = this.withdrawRequest(code, amount, address, tag, params);
223272
+ return await this.watchRequest('privateWithdrawAssets', request);
223273
+ }
223274
+ handleWithdraw(client, message) {
223275
+ //
223276
+ // {
223277
+ // action: 'privateWithdrawAssets',
223278
+ // response: {
223279
+ // "success": true,
223280
+ // "symbol": "BTC",
223281
+ // "amount": "1.5"
223282
+ // }
223283
+ // }
223284
+ //
223285
+ const action = this.safeString(message, 'action');
223286
+ const messageHash = this.buildMessageHash(action, message);
223287
+ const response = this.safeValue(message, 'response');
223288
+ const withdraw = this.parseTransaction(response);
223289
+ client.resolve(withdraw, messageHash);
223290
+ }
223291
+ async fetchWithdrawalsWs(code = undefined, since = undefined, limit = undefined, params = {}) {
223292
+ /**
223293
+ * @method
223294
+ * @name bitvavo#fetchWithdrawalsWs
223295
+ * @see https://docs.bitvavo.com/#tag/Account/paths/~1withdrawalHistory/get
223296
+ * @description fetch all withdrawals made from an account
223297
+ * @param {string} code unified currency code
223298
+ * @param {int} [since] the earliest time in ms to fetch withdrawals for
223299
+ * @param {int} [limit] the maximum number of withdrawals structures to retrieve
223300
+ * @param {object} [params] extra parameters specific to the bitvavo api endpoint
223301
+ * @returns {object[]} a list of [transaction structures]{@link https://docs.ccxt.com/#/?id=transaction-structure}
223302
+ */
223303
+ await this.loadMarkets();
223304
+ await this.authenticate();
223305
+ const request = this.fetchWithdrawalsRequest(code, since, limit, params);
223306
+ const withdraws = await this.watchRequest('privateGetWithdrawalHistory', request);
223307
+ return this.filterByCurrencySinceLimit(withdraws, code, since, limit);
223308
+ }
223309
+ handleWithdraws(client, message) {
223310
+ //
223311
+ // {
223312
+ // action: 'privateGetWithdrawalHistory',
223313
+ // response: [{
223314
+ // timestamp: 1689792085000,
223315
+ // symbol: 'BTC',
223316
+ // amount: '0.0009',
223317
+ // fee: '0',
223318
+ // status: 'completed',
223319
+ // txId: '7dbadc658d7d59c129de1332c55ee8e08d0ab74432faae03b417b9809c819d1f'
223320
+ // },
223321
+ // ...
223322
+ // ]
223323
+ // }
223324
+ //
223325
+ const action = this.safeString(message, 'action');
223326
+ const messageHash = this.buildMessageHash(action, message);
223327
+ const response = this.safeValue(message, 'response');
223328
+ const withdrawals = this.parseTransactions(response, undefined, undefined, undefined, { 'type': 'withdrawal' });
223329
+ client.resolve(withdrawals, messageHash);
223330
+ }
223331
+ async fetchOHLCVWs(symbol, timeframe = '1m', since = undefined, limit = undefined, params = {}) {
223332
+ /**
223333
+ * @method
223334
+ * @name bitvavo#fetchOHLCVWs
223335
+ * @see https://docs.bitvavo.com/#tag/Market-Data/paths/~1{market}~1candles/get
223336
+ * @description fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
223337
+ * @param {string} symbol unified symbol of the market to fetch OHLCV data for
223338
+ * @param {string} timeframe the length of time each candle represents
223339
+ * @param {int} [since] timestamp in ms of the earliest candle to fetch
223340
+ * @param {int} [limit] the maximum amount of candles to fetch
223341
+ * @param {object} [params] extra parameters specific to the bitvavo api endpoint
223342
+ * @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume
223343
+ */
223344
+ await this.loadMarkets();
223345
+ const request = this.fetchOHLCVRequest(symbol, timeframe, since, limit, params);
223346
+ const action = 'getCandles';
223347
+ const ohlcv = await this.watchRequest(action, request);
223348
+ return this.filterBySinceLimit(ohlcv, since, limit, 0, true);
223349
+ }
223350
+ async fetchDepositsWs(code = undefined, since = undefined, limit = undefined, params = {}) {
223351
+ /**
223352
+ * @method
223353
+ * @name bitvavo#fetchDepositsWs
223354
+ * @see https://docs.bitvavo.com/#tag/Account/paths/~1depositHistory/get
223355
+ * @description fetch all deposits made to an account
223356
+ * @param {string} code unified currency code
223357
+ * @param {int} [since] the earliest time in ms to fetch deposits for
223358
+ * @param {int} [limit] the maximum number of deposits structures to retrieve
223359
+ * @param {object} [params] extra parameters specific to the bitvavo api endpoint
223360
+ * @returns {object[]} a list of [transaction structures]{@link https://docs.ccxt.com/#/?id=transaction-structure}
223361
+ */
223362
+ await this.loadMarkets();
223363
+ await this.authenticate();
223364
+ const request = this.fetchDepositsRequest(code, since, limit, params);
223365
+ const deposits = await this.watchRequest('privateGetDepositHistory', request);
223366
+ return this.filterByCurrencySinceLimit(deposits, code, since, limit);
223367
+ }
223368
+ handleDeposits(client, message) {
223369
+ //
223370
+ // {
223371
+ // action: 'privateGetDepositHistory',
223372
+ // response: [{
223373
+ // timestamp: 1689792085000,
223374
+ // symbol: 'BTC',
223375
+ // amount: '0.0009',
223376
+ // fee: '0',
223377
+ // status: 'completed',
223378
+ // txId: '7dbadc658d7d59c129de1332c55ee8e08d0ab74432faae03b417b9809c819d1f'
223379
+ // },
223380
+ // ...
223381
+ // ]
223382
+ // }
223383
+ //
223384
+ const action = this.safeString(message, 'action');
223385
+ const messageHash = this.buildMessageHash(action, message);
223386
+ const response = this.safeValue(message, 'response');
223387
+ const deposits = this.parseTransactions(response, undefined, undefined, undefined, { 'type': 'deposit' });
223388
+ client.resolve(deposits, messageHash);
223389
+ }
223390
+ async fetchTradingFeesWs(params = {}) {
223391
+ /**
223392
+ * @method
223393
+ * @name bitvavo#fetchTradingFeesWs
223394
+ * @see https://docs.bitvavo.com/#tag/Account/paths/~1account/get
223395
+ * @description fetch the trading fees for multiple markets
223396
+ * @param {object} [params] extra parameters specific to the bitvavo api endpoint
223397
+ * @returns {object} a dictionary of [fee structures]{@link https://docs.ccxt.com/#/?id=fee-structure} indexed by market symbols
223398
+ */
223399
+ await this.loadMarkets();
223400
+ await this.authenticate();
223401
+ return await this.watchRequest('privateGetAccount', params);
223402
+ }
223403
+ async fetchMarketsWs(params = {}) {
223404
+ /**
223405
+ * @method
223406
+ * @name bitvavo#fetchMarketsWs
223407
+ * @see https://docs.bitvavo.com/#tag/General/paths/~1markets/get
223408
+ * @description retrieves data on all markets for bitvavo
223409
+ * @param {object} [params] extra parameters specific to the exchange api endpoint
223410
+ * @returns {object[]} an array of objects representing market data
223411
+ */
223412
+ return await this.watchRequest('getMarkets', params);
223413
+ }
223414
+ async fetchCurrenciesWs(params = {}) {
223415
+ /**
223416
+ * @method
223417
+ * @name bitvavo#fetchCurrenciesWs
223418
+ * @see https://docs.bitvavo.com/#tag/General/paths/~1assets/get
223419
+ * @description fetches all available currencies on an exchange
223420
+ * @param {object} [params] extra parameters specific to the bitvavo api endpoint
223421
+ * @returns {object} an associative dictionary of currencies
223422
+ */
223423
+ await this.loadMarkets();
223424
+ return await this.watchRequest('getAssets', params);
223425
+ }
223426
+ handleFetchCurrencies(client, message) {
223427
+ //
223428
+ // {
223429
+ // action: 'getAssets',
223430
+ // response: [{
223431
+ // symbol: '1INCH',
223432
+ // name: '1inch',
223433
+ // decimals: 8,
223434
+ // depositFee: '0',
223435
+ // depositConfirmations: 64,
223436
+ // depositStatus: 'OK',
223437
+ // withdrawalFee: '13',
223438
+ // withdrawalMinAmount: '13',
223439
+ // withdrawalStatus: 'OK',
223440
+ // networks: [Array],
223441
+ // message: ''
223442
+ // },
223443
+ // ...
223444
+ // ]
223445
+ // }
223446
+ //
223447
+ const action = this.safeString(message, 'action');
223448
+ const messageHash = this.buildMessageHash(action, message);
223449
+ const response = this.safeValue(message, 'response');
223450
+ const currencies = this.parseCurrencies(response);
223451
+ client.resolve(currencies, messageHash);
223452
+ }
223453
+ handleTradingFees(client, message) {
223454
+ //
223455
+ // {
223456
+ // action: 'privateGetAccount',
223457
+ // response: {
223458
+ // fees: {
223459
+ // taker: '0.0025',
223460
+ // maker: '0.0015',
223461
+ // volume: '1693.74'
223462
+ // }
223463
+ // }
223464
+ // }
223465
+ //
223466
+ const action = this.safeString(message, 'action');
223467
+ const messageHash = this.buildMessageHash(action, message);
223468
+ const response = this.safeValue(message, 'response');
223469
+ const fees = this.parseTradingFees(response);
223470
+ client.resolve(fees, messageHash);
223471
+ }
223472
+ async fetchBalanceWs(params = {}) {
223473
+ /**
223474
+ * @method
223475
+ * @name bitvavo#fetchBalanceWs
223476
+ * @see https://docs.bitvavo.com/#tag/Account/paths/~1balance/get
223477
+ * @description query for balance and get the amount of funds available for trading or funds locked in orders
223478
+ * @param {object} [params] extra parameters specific to the bitvavo api endpoint
223479
+ * @returns {object} a [balance structure]{@link https://docs.ccxt.com/en/latest/manual.html?#balance-structure}
223480
+ */
223481
+ await this.loadMarkets();
223482
+ await this.authenticate();
223483
+ return await this.watchRequest('privateGetBalance', params);
223484
+ }
223485
+ handleFetchBalance(client, message) {
223486
+ //
223487
+ // {
223488
+ // action: 'privateGetBalance',
223489
+ // response: [{
223490
+ // symbol: 'ADA',
223491
+ // available: '0',
223492
+ // inOrder: '0'
223493
+ // },
223494
+ // ...
223495
+ // ]
223496
+ // }
223497
+ //
223498
+ const action = this.safeString(message, 'action', 'privateGetBalance');
223499
+ const messageHash = this.buildMessageHash(action, message);
223500
+ const response = this.safeValue(message, 'response', []);
223501
+ const balance = this.parseBalance(response);
223502
+ client.resolve(balance, messageHash);
223503
+ }
223504
+ handleSingleOrder(client, message) {
223505
+ //
223506
+ // {
223507
+ // action: 'privateCreateOrder',
223508
+ // response: {
223509
+ // orderId: 'd71df826-1130-478a-8741-d219128675b0',
223510
+ // market: 'BTC-EUR',
223511
+ // created: 1689792749748,
223512
+ // updated: 1689792749748,
223513
+ // status: 'new',
223514
+ // side: 'sell',
223515
+ // orderType: 'limit',
223516
+ // amount: '0.0002',
223517
+ // amountRemaining: '0.0002',
223518
+ // price: '37000',
223519
+ // onHold: '0.0002',
223520
+ // onHoldCurrency: 'BTC',
223521
+ // filledAmount: '0',
223522
+ // filledAmountQuote: '0',
223523
+ // feePaid: '0',
223524
+ // feeCurrency: 'EUR',
223525
+ // fills: [],
223526
+ // selfTradePrevention: 'decrementAndCancel',
223527
+ // visible: true,
223528
+ // timeInForce: 'GTC',
223529
+ // postOnly: false
223530
+ // }
223531
+ // }
223532
+ //
223533
+ const action = this.safeString(message, 'action');
223534
+ const response = this.safeValue(message, 'response', {});
223535
+ const order = this.parseOrder(response);
223536
+ const messageHash = this.buildMessageHash(action, response);
223537
+ client.resolve(order, messageHash);
223538
+ }
223539
+ handleMarkets(client, message) {
223540
+ //
223541
+ // {
223542
+ // action: 'getMarkets',
223543
+ // response: [{
223544
+ // market: '1INCH-EUR',
223545
+ // status: 'trading',
223546
+ // base: '1INCH',
223547
+ // quote: 'EUR',
223548
+ // pricePrecision: 5,
223549
+ // minOrderInBaseAsset: '2',
223550
+ // minOrderInQuoteAsset: '5',
223551
+ // maxOrderInBaseAsset: '1000000000',
223552
+ // maxOrderInQuoteAsset: '1000000000',
223553
+ // orderTypes: [Array]
223554
+ // },
223555
+ // ...
223556
+ // ]
223557
+ // }
223558
+ //
223559
+ const action = this.safeString(message, 'action');
223560
+ const response = this.safeValue(message, 'response', {});
223561
+ const markets = this.parseMarkets(response);
223562
+ const messageHash = this.buildMessageHash(action, response);
223563
+ client.resolve(markets, messageHash);
223564
+ }
223565
+ buildMessageHash(action, params = {}) {
223566
+ const methods = {
223567
+ 'privateCreateOrder': this.actionAndMarketMessageHash,
223568
+ 'privateUpdateOrder': this.actionAndOrderIdMessageHash,
223569
+ 'privateCancelOrder': this.actionAndOrderIdMessageHash,
223570
+ 'privateGetOrder': this.actionAndOrderIdMessageHash,
223571
+ 'privateGetTrades': this.actionAndMarketMessageHash,
223572
+ };
223573
+ const method = this.safeValue(methods, action);
223574
+ let messageHash = action;
223575
+ if (method !== undefined) {
223576
+ messageHash = method.call(this, action, params);
223577
+ }
223578
+ return messageHash;
223579
+ }
223580
+ checkMessageHashDoesNotExist(messageHash) {
223581
+ const supressMultipleWsRequestsError = this.safeValue(this.options, 'supressMultipleWsRequestsError', false);
223582
+ if (!supressMultipleWsRequestsError) {
223583
+ const client = this.safeValue(this.clients, this.urls['api']['ws']);
223584
+ if (client !== undefined) {
223585
+ const future = this.safeValue(client.futures, messageHash);
223586
+ if (future !== undefined) {
223587
+ throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ExchangeError(this.id + ' a similar request with messageHash ' + messageHash + ' is already pending, you must wait for a response, or turn off this error by setting supressMultipleWsRequestsError in the options to true');
223588
+ }
223589
+ }
223590
+ }
223591
+ }
223592
+ actionAndMarketMessageHash(action, params = {}) {
223593
+ const symbol = this.safeString(params, 'market', '');
223594
+ return action + symbol;
223595
+ }
223596
+ actionAndOrderIdMessageHash(action, params = {}) {
223597
+ const orderId = this.safeString(params, 'orderId');
223598
+ if (orderId === undefined) {
223599
+ throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ExchangeError(this.id + ' privateUpdateOrderMessageHash requires a orderId parameter');
223600
+ }
223601
+ return action + orderId;
223602
+ }
222882
223603
  handleOrder(client, message) {
222883
223604
  //
222884
223605
  // {
@@ -223012,6 +223733,31 @@ class bitvavo extends _bitvavo_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
223012
223733
  }
223013
223734
  }
223014
223735
  }
223736
+ handleErrorMessage(client, message) {
223737
+ //
223738
+ // {
223739
+ // action: 'privateCreateOrder',
223740
+ // market: 'BTC-EUR',
223741
+ // errorCode: 217,
223742
+ // error: 'Minimum order size in quote currency is 5 EUR or 0.001 BTC.'
223743
+ // }
223744
+ //
223745
+ const error = this.safeString(message, 'error');
223746
+ const code = this.safeInteger(error, 'errorCode');
223747
+ const action = this.safeString(message, 'action');
223748
+ const messageHash = this.buildMessageHash(action, message);
223749
+ let rejected = false;
223750
+ try {
223751
+ this.handleErrors(code, error, client.url, undefined, undefined, error, message, undefined, undefined);
223752
+ }
223753
+ catch (e) {
223754
+ rejected = true;
223755
+ client.reject(e, messageHash);
223756
+ }
223757
+ if (!rejected) {
223758
+ client.reject(message, messageHash);
223759
+ }
223760
+ }
223015
223761
  handleMessage(client, message) {
223016
223762
  //
223017
223763
  // {
@@ -223021,7 +223767,6 @@ class bitvavo extends _bitvavo_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
223021
223767
  // }
223022
223768
  // }
223023
223769
  //
223024
- //
223025
223770
  // {
223026
223771
  // "event": "book",
223027
223772
  // "market": "BTC-EUR",
@@ -223057,6 +223802,10 @@ class bitvavo extends _bitvavo_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
223057
223802
  // "authenticated": true
223058
223803
  // }
223059
223804
  //
223805
+ const error = this.safeString(message, 'error');
223806
+ if (error !== undefined) {
223807
+ this.handleErrorMessage(client, message);
223808
+ }
223060
223809
  const methods = {
223061
223810
  'subscribed': this.handleSubscriptionStatus,
223062
223811
  'book': this.handleOrderBook,
@@ -223067,21 +223816,27 @@ class bitvavo extends _bitvavo_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
223067
223816
  'authenticate': this.handleAuthenticationMessage,
223068
223817
  'order': this.handleOrder,
223069
223818
  'fill': this.handleMyTrade,
223070
- };
223071
- const event = this.safeString(message, 'event');
223072
- let method = this.safeValue(methods, event);
223073
- if (method === undefined) {
223074
- const action = this.safeString(message, 'action');
223075
- method = this.safeValue(methods, action);
223076
- if (method === undefined) {
223077
- return message;
223078
- }
223079
- else {
223080
- return method.call(this, client, message);
223081
- }
223082
- }
223083
- else {
223084
- return method.call(this, client, message);
223819
+ 'privateCreateOrder': this.handleSingleOrder,
223820
+ 'privateUpdateOrder': this.handleSingleOrder,
223821
+ 'privateGetBalance': this.handleFetchBalance,
223822
+ 'privateCancelOrders': this.handleMultipleOrders,
223823
+ 'privateGetOrders': this.handleMultipleOrders,
223824
+ 'privateGetOrder': this.handleSingleOrder,
223825
+ 'privateCancelOrder': this.handleSingleOrder,
223826
+ 'privateGetOrdersOpen': this.handleMultipleOrders,
223827
+ 'privateGetAccount': this.handleTradingFees,
223828
+ 'privateGetDepositHistory': this.handleDeposits,
223829
+ 'privateGetWithdrawalHistory': this.handleWithdraws,
223830
+ 'privateWithdrawAssets': this.handleWithdraw,
223831
+ 'privateGetTrades': this.handleMyTrades,
223832
+ 'getAssets': this.handleFetchCurrencies,
223833
+ 'getCandles': this.handleFetchOHLCV,
223834
+ 'getMarkets': this.handleMarkets,
223835
+ };
223836
+ const event = this.safeString2(message, 'event', 'action');
223837
+ const method = this.safeValue(methods, event);
223838
+ if (method !== undefined) {
223839
+ method.call(this, client, message);
223085
223840
  }
223086
223841
  }
223087
223842
  }
@@ -247260,7 +248015,7 @@ class lbank extends _lbank_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
247260
248015
  };
247261
248016
  const request = this.deepExtend(subscribe, params);
247262
248017
  const orderbook = await this.watch(url, messageHash, request, messageHash);
247263
- return orderbook.limit(limit);
248018
+ return orderbook.limit();
247264
248019
  }
247265
248020
  async watchOrderBook(symbol, limit = undefined, params = {}) {
247266
248021
  /**
@@ -295516,7 +296271,7 @@ SOFTWARE.
295516
296271
 
295517
296272
  //-----------------------------------------------------------------------------
295518
296273
  // this is updated by vss.js when building
295519
- const version = '4.2.19';
296274
+ const version = '4.2.21';
295520
296275
  _src_base_Exchange_js__WEBPACK_IMPORTED_MODULE_0__/* .Exchange */ .e.ccxtVersion = version;
295521
296276
  //-----------------------------------------------------------------------------
295522
296277