ccxt 4.2.20 → 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.
@@ -7394,11 +7394,13 @@ class Exchange {
7394
7394
  'fetchCrossBorrowRate': undefined,
7395
7395
  'fetchCrossBorrowRates': undefined,
7396
7396
  'fetchCurrencies': 'emulated',
7397
+ 'fetchCurrenciesWs': 'emulated',
7397
7398
  'fetchDeposit': undefined,
7398
7399
  'fetchDepositAddress': undefined,
7399
7400
  'fetchDepositAddresses': undefined,
7400
7401
  'fetchDepositAddressesByNetwork': undefined,
7401
7402
  'fetchDeposits': undefined,
7403
+ 'fetchDepositsWs': undefined,
7402
7404
  'fetchDepositsWithdrawals': undefined,
7403
7405
  'fetchTransactionFee': undefined,
7404
7406
  'fetchTransactionFees': undefined,
@@ -7416,9 +7418,11 @@ class Exchange {
7416
7418
  'fetchLeverageTiers': undefined,
7417
7419
  'fetchMarketLeverageTiers': undefined,
7418
7420
  'fetchMarkets': true,
7421
+ 'fetchMarketsWs': undefined,
7419
7422
  'fetchMarkOHLCV': undefined,
7420
7423
  'fetchMyTrades': undefined,
7421
7424
  'fetchOHLCV': undefined,
7425
+ 'fetchOHLCVWs': undefined,
7422
7426
  'fetchOpenInterest': undefined,
7423
7427
  'fetchOpenInterestHistory': undefined,
7424
7428
  'fetchOpenOrder': undefined,
@@ -7441,12 +7445,14 @@ class Exchange {
7441
7445
  'fetchTrades': true,
7442
7446
  'fetchTradingFee': undefined,
7443
7447
  'fetchTradingFees': undefined,
7448
+ 'fetchTradingFeesWs': undefined,
7444
7449
  'fetchTradingLimits': undefined,
7445
7450
  'fetchTransactions': undefined,
7446
7451
  'fetchTransfers': undefined,
7447
7452
  'fetchWithdrawAddresses': undefined,
7448
7453
  'fetchWithdrawal': undefined,
7449
7454
  'fetchWithdrawals': undefined,
7455
+ 'fetchWithdrawalsWs': undefined,
7450
7456
  'reduceMargin': undefined,
7451
7457
  'setLeverage': undefined,
7452
7458
  'setMargin': undefined,
@@ -7966,6 +7972,13 @@ class Exchange {
7966
7972
  // and may be changed for consistency later
7967
7973
  return new Promise((resolve, reject) => resolve(this.currencies));
7968
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
+ }
7969
7982
  fetchMarkets(params = {}) {
7970
7983
  // markets are returned as a list
7971
7984
  // currencies are returned as a dict
@@ -7973,6 +7986,13 @@ class Exchange {
7973
7986
  // and may be changed for consistency later
7974
7987
  return new Promise((resolve, reject) => resolve(Object.values(this.markets)));
7975
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
+ }
7976
7996
  checkRequiredDependencies() {
7977
7997
  return;
7978
7998
  }
@@ -9753,6 +9773,13 @@ class Exchange {
9753
9773
  }
9754
9774
  throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__.NotSupported(this.id + ' fetchOHLCV() is not supported yet' + message);
9755
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
+ }
9756
9783
  async watchOHLCV(symbol, timeframe = '1m', since = undefined, limit = undefined, params = {}) {
9757
9784
  throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__.NotSupported(this.id + ' watchOHLCV() is not supported yet');
9758
9785
  }
@@ -10112,7 +10139,7 @@ class Exchange {
10112
10139
  for (let i = 0; i < response.length; i++) {
10113
10140
  const item = response[i];
10114
10141
  const id = this.safeString(item, marketIdKey);
10115
- const market = this.safeMarket(id, undefined, undefined, this.safeString(this.options, 'defaultType'));
10142
+ const market = this.safeMarket(id, undefined, undefined, 'swap');
10116
10143
  const symbol = market['symbol'];
10117
10144
  const contract = this.safeValue(market, 'contract', false);
10118
10145
  if (contract && ((symbols === undefined) || this.inArray(symbol, symbols))) {
@@ -11106,9 +11133,6 @@ class Exchange {
11106
11133
  async watchMyTrades(symbol = undefined, since = undefined, limit = undefined, params = {}) {
11107
11134
  throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__.NotSupported(this.id + ' watchMyTrades() is not supported yet');
11108
11135
  }
11109
- async fetchOHLCVWs(symbol, timeframe = '1m', since = undefined, limit = undefined, params = {}) {
11110
- throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__.NotSupported(this.id + ' fetchOHLCVWs() is not supported yet');
11111
- }
11112
11136
  async fetchGreeks(symbol, params = {}) {
11113
11137
  throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__.NotSupported(this.id + ' fetchGreeks() is not supported yet');
11114
11138
  }
@@ -11128,9 +11152,15 @@ class Exchange {
11128
11152
  async fetchDeposits(code = undefined, since = undefined, limit = undefined, params = {}) {
11129
11153
  throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__.NotSupported(this.id + ' fetchDeposits() is not supported yet');
11130
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
+ }
11131
11158
  async fetchWithdrawals(code = undefined, since = undefined, limit = undefined, params = {}) {
11132
11159
  throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__.NotSupported(this.id + ' fetchWithdrawals() is not supported yet');
11133
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
+ }
11134
11164
  async fetchOpenInterest(symbol, params = {}) {
11135
11165
  throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__.NotSupported(this.id + ' fetchOpenInterest() is not supported yet');
11136
11166
  }
@@ -11610,6 +11640,9 @@ class Exchange {
11610
11640
  async fetchTradingFees(params = {}) {
11611
11641
  throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__.NotSupported(this.id + ' fetchTradingFees() is not supported yet');
11612
11642
  }
11643
+ async fetchTradingFeesWs(params = {}) {
11644
+ throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__.NotSupported(this.id + ' fetchTradingFeesWs() is not supported yet');
11645
+ }
11613
11646
  async fetchTradingFee(symbol, params = {}) {
11614
11647
  if (!this.has['fetchTradingFees']) {
11615
11648
  throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__.NotSupported(this.id + ' fetchTradingFee() is not supported yet');
@@ -15378,16 +15411,18 @@ class IndexedBids extends IndexedOrderBookSide {
15378
15411
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
15379
15412
  /* harmony export */ Z: () => (/* binding */ WsClient)
15380
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__);
15381
15416
  /* harmony import */ var _Client_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(2897);
15382
15417
  /* harmony import */ var _base_functions_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(9125);
15383
15418
  /* harmony import */ var _base_functions_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(1621);
15384
- /* harmony import */ var ws__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7026);
15385
- /* harmony import */ var ws__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(ws__WEBPACK_IMPORTED_MODULE_0__);
15386
15419
  /* harmony import */ var _Future_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(2367);
15420
+ // eslint-disable-next-line no-shadow
15387
15421
 
15388
15422
 
15389
15423
 
15390
15424
 
15425
+ // eslint-disable-next-line no-restricted-globals
15391
15426
  const WebSocketPlatform = _base_functions_js__WEBPACK_IMPORTED_MODULE_1__/* .isNode */ .UG ? (ws__WEBPACK_IMPORTED_MODULE_0___default()) : self.WebSocket;
15392
15427
  class WsClient extends _Client_js__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z {
15393
15428
  createConnection() {
@@ -15441,7 +15476,6 @@ class WsClient extends _Client_js__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */
15441
15476
  return this.disconnected;
15442
15477
  }
15443
15478
  }
15444
- ;
15445
15479
 
15446
15480
 
15447
15481
  /***/ }),
@@ -41559,8 +41593,8 @@ class bitget extends _abstract_bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
41559
41593
  'fetchBorrowInterest': true,
41560
41594
  'fetchBorrowRateHistories': false,
41561
41595
  'fetchBorrowRateHistory': false,
41562
- 'fetchCanceledOrders': true,
41563
41596
  'fetchCanceledAndClosedOrders': true,
41597
+ 'fetchCanceledOrders': true,
41564
41598
  'fetchClosedOrders': true,
41565
41599
  'fetchCrossBorrowRate': true,
41566
41600
  'fetchCrossBorrowRates': false,
@@ -69894,6 +69928,7 @@ class bitvavo extends _abstract_bitvavo_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
69894
69928
  /**
69895
69929
  * @method
69896
69930
  * @name bitvavo#fetchMarkets
69931
+ * @see https://docs.bitvavo.com/#tag/General/paths/~1markets/get
69897
69932
  * @description retrieves data on all markets for bitvavo
69898
69933
  * @param {object} [params] extra parameters specific to the exchange API endpoint
69899
69934
  * @returns {object[]} an array of objects representing market data
@@ -69913,12 +69948,15 @@ class bitvavo extends _abstract_bitvavo_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
69913
69948
  // }
69914
69949
  // ]
69915
69950
  //
69951
+ return this.parseMarkets(response);
69952
+ }
69953
+ parseMarkets(markets) {
69916
69954
  const currencies = this.currencies;
69917
69955
  const currenciesById = this.indexBy(currencies, 'id');
69918
69956
  const result = [];
69919
69957
  const fees = this.fees;
69920
- for (let i = 0; i < response.length; i++) {
69921
- const market = response[i];
69958
+ for (let i = 0; i < markets.length; i++) {
69959
+ const market = markets[i];
69922
69960
  const id = this.safeString(market, 'market');
69923
69961
  const baseId = this.safeString(market, 'base');
69924
69962
  const quoteId = this.safeString(market, 'quote');
@@ -69985,11 +70023,48 @@ class bitvavo extends _abstract_bitvavo_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
69985
70023
  /**
69986
70024
  * @method
69987
70025
  * @name bitvavo#fetchCurrencies
70026
+ * @see https://docs.bitvavo.com/#tag/General/paths/~1assets/get
69988
70027
  * @description fetches all available currencies on an exchange
69989
70028
  * @param {object} [params] extra parameters specific to the exchange API endpoint
69990
70029
  * @returns {object} an associative dictionary of currencies
69991
70030
  */
69992
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) {
69993
70068
  //
69994
70069
  // [
69995
70070
  // {
@@ -70024,8 +70099,8 @@ class bitvavo extends _abstract_bitvavo_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
70024
70099
  // ]
70025
70100
  //
70026
70101
  const result = {};
70027
- for (let i = 0; i < response.length; i++) {
70028
- const currency = response[i];
70102
+ for (let i = 0; i < currencies.length; i++) {
70103
+ const currency = currencies[i];
70029
70104
  const id = this.safeString(currency, 'symbol');
70030
70105
  const code = this.safeCurrencyCode(id);
70031
70106
  const networks = {};
@@ -70354,6 +70429,7 @@ class bitvavo extends _abstract_bitvavo_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
70354
70429
  /**
70355
70430
  * @method
70356
70431
  * @name bitvavo#fetchTradingFees
70432
+ * @see https://docs.bitvavo.com/#tag/Account/paths/~1account/get
70357
70433
  * @description fetch the trading fees for multiple markets
70358
70434
  * @param {object} [params] extra parameters specific to the exchange API endpoint
70359
70435
  * @returns {object} a dictionary of [fee structures]{@link https://docs.ccxt.com/#/?id=fee-structure} indexed by market symbols
@@ -70369,14 +70445,26 @@ class bitvavo extends _abstract_bitvavo_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
70369
70445
  // }
70370
70446
  // }
70371
70447
  //
70372
- const fees = this.safeValue(response, 'fees');
70373
- const maker = this.safeNumber(fees, 'maker');
70374
- 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');
70375
70463
  const result = {};
70376
70464
  for (let i = 0; i < this.symbols.length; i++) {
70377
70465
  const symbol = this.symbols[i];
70378
70466
  result[symbol] = {
70379
- 'info': response,
70467
+ 'info': fees,
70380
70468
  'symbol': symbol,
70381
70469
  'maker': maker,
70382
70470
  'taker': taker,
@@ -70446,6 +70534,30 @@ class bitvavo extends _abstract_bitvavo_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
70446
70534
  this.safeNumber(ohlcv, 5),
70447
70535
  ];
70448
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
+ }
70449
70561
  async fetchOHLCV(symbol, timeframe = '1m', since = undefined, limit = undefined, params = {}) {
70450
70562
  /**
70451
70563
  * @method
@@ -70468,27 +70580,8 @@ class bitvavo extends _abstract_bitvavo_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
70468
70580
  if (paginate) {
70469
70581
  return await this.fetchPaginatedCallDeterministic('fetchOHLCV', symbol, since, limit, timeframe, params, 1440);
70470
70582
  }
70471
- let request = {
70472
- 'market': market['id'],
70473
- 'interval': this.safeString(this.timeframes, timeframe, timeframe),
70474
- // "limit": 1440, // default 1440, max 1440
70475
- // "start": since,
70476
- // "end": this.milliseconds (),
70477
- };
70478
- if (since !== undefined) {
70479
- // https://github.com/ccxt/ccxt/issues/9227
70480
- const duration = this.parseTimeframe(timeframe);
70481
- request['start'] = since;
70482
- if (limit === undefined) {
70483
- limit = 1440;
70484
- }
70485
- request['end'] = this.sum(since, limit * duration * 1000);
70486
- }
70487
- [request, params] = this.handleUntilOption('end', request, params);
70488
- if (limit !== undefined) {
70489
- request['limit'] = limit; // default 1440, max 1440
70490
- }
70491
- 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);
70492
70585
  //
70493
70586
  // [
70494
70587
  // [1590383700000,"8088.5","8088.5","8088.5","8088.5","0.04788623"],
@@ -70519,6 +70612,7 @@ class bitvavo extends _abstract_bitvavo_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
70519
70612
  /**
70520
70613
  * @method
70521
70614
  * @name bitvavo#fetchBalance
70615
+ * @see https://docs.bitvavo.com/#tag/Account/paths/~1balance/get
70522
70616
  * @description query for balance and get the amount of funds available for trading or funds locked in orders
70523
70617
  * @param {object} [params] extra parameters specific to the exchange API endpoint
70524
70618
  * @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
@@ -70568,33 +70662,7 @@ class bitvavo extends _abstract_bitvavo_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
70568
70662
  'info': response,
70569
70663
  };
70570
70664
  }
70571
- async createOrder(symbol, type, side, amount, price = undefined, params = {}) {
70572
- /**
70573
- * @method
70574
- * @name bitvavo#createOrder
70575
- * @description create a trade order
70576
- * @see https://docs.bitvavo.com/#tag/Trading-endpoints/paths/~1order/post
70577
- * @param {string} symbol unified symbol of the market to create an order in
70578
- * @param {string} type 'market' or 'limit'
70579
- * @param {string} side 'buy' or 'sell'
70580
- * @param {float} amount how much of currency you want to trade in units of base currency
70581
- * @param {float} [price] the price at which the order is to be fullfilled, in units of the quote currency, ignored in market orders
70582
- * @param {object} [params] extra parameters specific to the exchange API endpoint
70583
- * @param {string} [params.timeInForce] "GTC", "IOC", or "PO"
70584
- * @param {float} [params.stopPrice] The price at which a trigger order is triggered at
70585
- * @param {float} [params.triggerPrice] The price at which a trigger order is triggered at
70586
- * @param {bool} [params.postOnly] If true, the order will only be posted to the order book and not executed immediately
70587
- * @param {float} [params.stopLossPrice] The price at which a stop loss order is triggered at
70588
- * @param {float} [params.takeProfitPrice] The price at which a take profit order is triggered at
70589
- * @param {string} [params.triggerType] "price"
70590
- * @param {string} [params.triggerReference] "lastTrade", "bestBid", "bestAsk", "midPrice" Only for stop orders: Use this to determine which parameter will trigger the order
70591
- * @param {string} [params.selfTradePrevention] "decrementAndCancel", "cancelOldest", "cancelNewest", "cancelBoth"
70592
- * @param {bool} [params.disableMarketProtection] don't cancel if the next fill price is 10% worse than the best fill price
70593
- * @param {bool} [params.responseRequired] Set this to 'false' when only an acknowledgement of success or failure is required, this is faster.
70594
- * @param {string} [params.clientOrderId] An ID supplied by the client that must be unique among all open orders for the same market
70595
- * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
70596
- */
70597
- await this.loadMarkets();
70665
+ createOrderRequest(symbol, type, side, amount, price = undefined, params = {}) {
70598
70666
  const market = this.market(symbol);
70599
70667
  const request = {
70600
70668
  'market': market['id'],
@@ -70658,7 +70726,37 @@ class bitvavo extends _abstract_bitvavo_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
70658
70726
  if (postOnly) {
70659
70727
  request['postOnly'] = true;
70660
70728
  }
70661
- 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);
70662
70760
  //
70663
70761
  // {
70664
70762
  // "orderId":"dec6a640-5b4c-45bc-8d22-3b41c6716630",
@@ -70701,29 +70799,61 @@ class bitvavo extends _abstract_bitvavo_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
70701
70799
  //
70702
70800
  return this.parseOrder(response, market);
70703
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
+ }
70704
70831
  async editOrder(id, symbol, type, side, amount = undefined, price = undefined, params = {}) {
70705
70832
  /**
70706
70833
  * @method
70707
70834
  * @name bitvavo#editOrder
70708
70835
  * @description edit a trade order
70709
- * @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
70710
70838
  * @param {string} symbol unified symbol of the market to create an order in
70711
70839
  * @param {string} type 'market' or 'limit'
70712
70840
  * @param {string} side 'buy' or 'sell'
70713
- * @param {float} amount how much of currency you want to trade in units of base currency
70714
- * @param {float} [price] the price at which the order is to be fullfilled, in units of the quote currency, ignored in market orders
70715
- * @param {object} [params] extra parameters specific to the exchange API endpoint
70716
- * @param {string} [params.timeInForce] "GTC", "IOC", or "PO"
70717
- * @param {bool} [params.postOnly] If true, the order will only be posted to the order book and not executed immediately
70718
- * @param {float} [params.stopPrice] The price at which a trigger order is triggered at
70719
- * @param {float} [params.triggerPrice] The price at which a trigger order is triggered at
70720
- * @param {string} [params.selfTradePrevention] "decrementAndCancel", "cancelOldest", "cancelNewest", "cancelBoth"
70721
- * @param {bool} [params.responseRequired] Set this to 'false' when only an acknowledgement of success or failure is required, this is faster.
70722
- * @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
70723
70844
  * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
70724
70845
  */
70725
70846
  await this.loadMarkets();
70726
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);
70727
70857
  const request = {
70728
70858
  'market': market['id'],
70729
70859
  };
@@ -70731,35 +70861,13 @@ class bitvavo extends _abstract_bitvavo_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
70731
70861
  if (clientOrderId === undefined) {
70732
70862
  request['orderId'] = id;
70733
70863
  }
70734
- const amountRemaining = this.safeNumber(params, 'amountRemaining');
70735
- const triggerPrice = this.safeStringN(params, ['triggerPrice', 'stopPrice', 'triggerAmount']);
70736
- params = this.omit(params, ['amountRemaining', 'triggerPrice', 'stopPrice', 'triggerAmount']);
70737
- let updateRequest = {};
70738
- if (price !== undefined) {
70739
- updateRequest['price'] = this.priceToPrecision(symbol, price);
70740
- }
70741
- if (amount !== undefined) {
70742
- updateRequest['amount'] = this.amountToPrecision(symbol, amount);
70743
- }
70744
- if (amountRemaining !== undefined) {
70745
- updateRequest['amountRemaining'] = this.amountToPrecision(symbol, amountRemaining);
70746
- }
70747
- if (triggerPrice !== undefined) {
70748
- updateRequest['triggerAmount'] = this.priceToPrecision(symbol, triggerPrice);
70749
- }
70750
- updateRequest = this.extend(updateRequest, params);
70751
- if (Object.keys(updateRequest).length) {
70752
- const response = await this.privatePutOrder(this.extend(request, updateRequest));
70753
- return this.parseOrder(response, market);
70754
- }
70755
- else {
70756
- 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');
70757
- }
70864
+ return this.extend(request, params);
70758
70865
  }
70759
70866
  async cancelOrder(id, symbol = undefined, params = {}) {
70760
70867
  /**
70761
70868
  * @method
70762
70869
  * @name bitvavo#cancelOrder
70870
+ * @see https://docs.bitvavo.com/#tag/Orders/paths/~1order/delete
70763
70871
  * @description cancels an open order
70764
70872
  * @see https://docs.bitvavo.com/#tag/Trading-endpoints/paths/~1order/delete
70765
70873
  * @param {string} id order id
@@ -70767,19 +70875,10 @@ class bitvavo extends _abstract_bitvavo_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
70767
70875
  * @param {object} [params] extra parameters specific to the exchange API endpoint
70768
70876
  * @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
70769
70877
  */
70770
- if (symbol === undefined) {
70771
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.ArgumentsRequired(this.id + ' cancelOrder() requires a symbol argument');
70772
- }
70773
70878
  await this.loadMarkets();
70774
70879
  const market = this.market(symbol);
70775
- const request = {
70776
- 'market': market['id'],
70777
- };
70778
- const clientOrderId = this.safeString(params, 'clientOrderId');
70779
- if (clientOrderId === undefined) {
70780
- request['orderId'] = id;
70781
- }
70782
- const response = await this.privateDeleteOrder(this.extend(request, params));
70880
+ const request = this.cancelOrderRequest(id, symbol, params);
70881
+ const response = await this.privateDeleteOrder(request);
70783
70882
  //
70784
70883
  // {
70785
70884
  // "orderId": "2e7ce7fc-44e2-4d80-a4a7-d079c4750b61"
@@ -70791,6 +70890,7 @@ class bitvavo extends _abstract_bitvavo_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
70791
70890
  /**
70792
70891
  * @method
70793
70892
  * @name bitvavo#cancelAllOrders
70893
+ * @see https://docs.bitvavo.com/#tag/Orders/paths/~1orders/delete
70794
70894
  * @description cancel all open orders
70795
70895
  * @param {string} symbol unified market symbol, only orders in the market of this symbol are cancelled when symbol is not undefined
70796
70896
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -70872,6 +70972,25 @@ class bitvavo extends _abstract_bitvavo_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
70872
70972
  //
70873
70973
  return this.parseOrder(response, market);
70874
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
+ }
70875
70994
  async fetchOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
70876
70995
  /**
70877
70996
  * @method
@@ -70896,22 +71015,8 @@ class bitvavo extends _abstract_bitvavo_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
70896
71015
  return await this.fetchPaginatedCallDynamic('fetchOrders', symbol, since, limit, params);
70897
71016
  }
70898
71017
  const market = this.market(symbol);
70899
- let request = {
70900
- 'market': market['id'],
70901
- // "limit": 500,
70902
- // "start": since,
70903
- // "end": this.milliseconds (),
70904
- // "orderIdFrom": "af76d6ce-9f7c-4006-b715-bb5d430652d0",
70905
- // "orderIdTo": "af76d6ce-9f7c-4006-b715-bb5d430652d0",
70906
- };
70907
- if (since !== undefined) {
70908
- request['start'] = since;
70909
- }
70910
- if (limit !== undefined) {
70911
- request['limit'] = limit; // default 500, max 1000
70912
- }
70913
- [request, params] = this.handleUntilOption('end', request, params);
70914
- 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);
70915
71020
  //
70916
71021
  // [
70917
71022
  // {
@@ -71131,6 +71236,25 @@ class bitvavo extends _abstract_bitvavo_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
71131
71236
  'trades': rawTrades,
71132
71237
  }, market);
71133
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
+ }
71134
71258
  async fetchMyTrades(symbol = undefined, since = undefined, limit = undefined, params = {}) {
71135
71259
  /**
71136
71260
  * @method
@@ -71155,22 +71279,8 @@ class bitvavo extends _abstract_bitvavo_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
71155
71279
  return await this.fetchPaginatedCallDynamic('fetchMyTrades', symbol, since, limit, params);
71156
71280
  }
71157
71281
  const market = this.market(symbol);
71158
- let request = {
71159
- 'market': market['id'],
71160
- // "limit": 500,
71161
- // "start": since,
71162
- // "end": this.milliseconds (),
71163
- // "tradeIdFrom": "af76d6ce-9f7c-4006-b715-bb5d430652d0",
71164
- // "tradeIdTo": "af76d6ce-9f7c-4006-b715-bb5d430652d0",
71165
- };
71166
- if (since !== undefined) {
71167
- request['start'] = since;
71168
- }
71169
- if (limit !== undefined) {
71170
- request['limit'] = limit; // default 500, max 1000
71171
- }
71172
- [request, params] = this.handleUntilOption('end', request, params);
71173
- 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);
71174
71284
  //
71175
71285
  // [
71176
71286
  // {
@@ -71190,6 +71300,20 @@ class bitvavo extends _abstract_bitvavo_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
71190
71300
  //
71191
71301
  return this.parseTrades(response, market, since, limit);
71192
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
+ }
71193
71317
  async withdraw(code, amount, address, tag = undefined, params = {}) {
71194
71318
  /**
71195
71319
  * @method
@@ -71206,17 +71330,8 @@ class bitvavo extends _abstract_bitvavo_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
71206
71330
  this.checkAddress(address);
71207
71331
  await this.loadMarkets();
71208
71332
  const currency = this.currency(code);
71209
- const request = {
71210
- 'symbol': currency['id'],
71211
- 'amount': this.currencyToPrecision(code, amount),
71212
- 'address': address, // address or IBAN
71213
- // "internal": false, // transfer to another Bitvavo user address, no fees
71214
- // "addWithdrawalFee": false, // true = add the fee on top, otherwise the fee is subtracted from the amount
71215
- };
71216
- if (tag !== undefined) {
71217
- request['paymentId'] = tag;
71218
- }
71219
- 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);
71220
71335
  //
71221
71336
  // {
71222
71337
  // "success": true,
@@ -71226,18 +71341,7 @@ class bitvavo extends _abstract_bitvavo_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
71226
71341
  //
71227
71342
  return this.parseTransaction(response, currency);
71228
71343
  }
71229
- async fetchWithdrawals(code = undefined, since = undefined, limit = undefined, params = {}) {
71230
- /**
71231
- * @method
71232
- * @name bitvavo#fetchWithdrawals
71233
- * @description fetch all withdrawals made from an account
71234
- * @param {string} code unified currency code
71235
- * @param {int} [since] the earliest time in ms to fetch withdrawals for
71236
- * @param {int} [limit] the maximum number of withdrawals structures to retrieve
71237
- * @param {object} [params] extra parameters specific to the exchange API endpoint
71238
- * @returns {object[]} a list of [transaction structures]{@link https://docs.ccxt.com/#/?id=transaction-structure}
71239
- */
71240
- await this.loadMarkets();
71344
+ fetchWithdrawalsRequest(code = undefined, since = undefined, limit = undefined, params = {}) {
71241
71345
  const request = {
71242
71346
  // 'symbol': currency['id'],
71243
71347
  // 'limit': 500, // default 500, max 1000
@@ -71255,7 +71359,27 @@ class bitvavo extends _abstract_bitvavo_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
71255
71359
  if (limit !== undefined) {
71256
71360
  request['limit'] = limit; // default 500, max 1000
71257
71361
  }
71258
- 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);
71259
71383
  //
71260
71384
  // [
71261
71385
  // {
@@ -71272,18 +71396,7 @@ class bitvavo extends _abstract_bitvavo_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
71272
71396
  //
71273
71397
  return this.parseTransactions(response, currency, since, limit, { 'type': 'withdrawal' });
71274
71398
  }
71275
- async fetchDeposits(code = undefined, since = undefined, limit = undefined, params = {}) {
71276
- /**
71277
- * @method
71278
- * @name bitvavo#fetchDeposits
71279
- * @description fetch all deposits made to an account
71280
- * @param {string} code unified currency code
71281
- * @param {int} [since] the earliest time in ms to fetch deposits for
71282
- * @param {int} [limit] the maximum number of deposits structures to retrieve
71283
- * @param {object} [params] extra parameters specific to the exchange API endpoint
71284
- * @returns {object[]} a list of [transaction structures]{@link https://docs.ccxt.com/#/?id=transaction-structure}
71285
- */
71286
- await this.loadMarkets();
71399
+ fetchDepositsRequest(code = undefined, since = undefined, limit = undefined, params = {}) {
71287
71400
  const request = {
71288
71401
  // 'symbol': currency['id'],
71289
71402
  // 'limit': 500, // default 500, max 1000
@@ -71301,7 +71414,27 @@ class bitvavo extends _abstract_bitvavo_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
71301
71414
  if (limit !== undefined) {
71302
71415
  request['limit'] = limit; // default 500, max 1000
71303
71416
  }
71304
- 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);
71305
71438
  //
71306
71439
  // [
71307
71440
  // {
@@ -72831,8 +72964,10 @@ class blockchaincom extends _abstract_blockchaincom_js__WEBPACK_IMPORTED_MODULE_
72831
72964
  let tag = undefined;
72832
72965
  let address = undefined;
72833
72966
  if (rawAddress !== undefined) {
72967
+ const addressParts = rawAddress.split(';');
72834
72968
  // if a tag or memo is used it is separated by a colon in the 'address' value
72835
- [address, tag] = rawAddress.split(':');
72969
+ tag = this.safeString(addressParts, 0);
72970
+ address = this.safeString(addressParts, 1);
72836
72971
  }
72837
72972
  const result = { 'info': response };
72838
72973
  result['currency'] = currency['code'];
@@ -124027,6 +124162,7 @@ class gate extends _abstract_gate_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
124027
124162
  'multi_collateral/currency_quota': 20 / 15,
124028
124163
  'multi_collateral/currencies': 20 / 15,
124029
124164
  'multi_collateral/ltv': 20 / 15,
124165
+ 'multi_collateral/fixed_rate': 20 / 15,
124030
124166
  },
124031
124167
  'post': {
124032
124168
  'collateral/orders': 20 / 15,
@@ -129056,7 +129192,7 @@ class gate extends _abstract_gate_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
129056
129192
  * @description retrieve information on the maximum leverage, and maintenance margin for trades of varying trade sizes
129057
129193
  * @see https://www.gate.io/docs/developers/apiv4/en/#list-all-futures-contracts
129058
129194
  * @see https://www.gate.io/docs/developers/apiv4/en/#list-all-futures-contracts-2
129059
- * @param {string[]|undefined} symbols list of unified market symbols
129195
+ * @param {string[]} [symbols] list of unified market symbols
129060
129196
  * @param {object} [params] extra parameters specific to the exchange API endpoint
129061
129197
  * @returns {object} a dictionary of [leverage tiers structures]{@link https://docs.ccxt.com/#/?id=leverage-tiers-structure}, indexed by market symbols
129062
129198
  */
@@ -129201,6 +129337,33 @@ class gate extends _abstract_gate_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
129201
129337
  //
129202
129338
  return this.parseMarketLeverageTiers(response, market);
129203
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
+ }
129204
129367
  parseMarketLeverageTiers(info, market = undefined) {
129205
129368
  //
129206
129369
  // [
@@ -129213,6 +129376,9 @@ class gate extends _abstract_gate_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
129213
129376
  // }
129214
129377
  // ]
129215
129378
  //
129379
+ if (!Array.isArray(info)) {
129380
+ return this.parseEmulatedLeverageTiers(info, market);
129381
+ }
129216
129382
  let minNotional = 0;
129217
129383
  const tiers = [];
129218
129384
  for (let i = 0; i < info.length; i++) {
@@ -182864,9 +183030,9 @@ class novadax extends _abstract_novadax_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
182864
183030
  'id': 'novadax',
182865
183031
  'name': 'NovaDAX',
182866
183032
  'countries': ['BR'],
182867
- // 60 requests per second = 1000ms / 60 = 16.6667ms between requests (public endpoints, limited by IP address)
182868
- // 20 requests per second => cost = 60 / 20 = 3 (private endpoints, limited by API Key)
182869
- '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,
182870
183036
  'version': 'v1',
182871
183037
  // new metainfo interface
182872
183038
  'has': {
@@ -182964,33 +183130,37 @@ class novadax extends _abstract_novadax_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
182964
183130
  'api': {
182965
183131
  'public': {
182966
183132
  'get': {
182967
- 'common/symbol': 1.2,
182968
- 'common/symbols': 1.2,
182969
- 'common/timestamp': 1.2,
182970
- 'market/tickers': 1.2,
182971
- 'market/ticker': 1.2,
182972
- 'market/depth': 1.2,
182973
- 'market/trades': 1.2,
182974
- '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,
182975
183141
  },
182976
183142
  },
182977
183143
  'private': {
182978
183144
  'get': {
182979
- 'orders/get': 3,
182980
- 'orders/list': 3,
183145
+ 'orders/get': 1,
183146
+ 'orders/list': 10,
182981
183147
  'orders/fill': 3,
182982
- 'orders/fills': 3,
182983
- 'account/getBalance': 3,
182984
- 'account/subs': 3,
182985
- 'account/subs/balance': 3,
182986
- '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,
182987
183153
  'wallet/query/deposit-withdraw': 3,
182988
183154
  },
182989
183155
  'post': {
182990
- 'orders/create': 3,
182991
- 'orders/cancel': 3,
182992
- 'account/withdraw/coin': 3,
182993
- '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
182994
183164
  },
182995
183165
  },
182996
183166
  },
@@ -199893,6 +200063,7 @@ class phemex extends _abstract_phemex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
199893
200063
  'api-data/g-futures/trades': 5,
199894
200064
  'api-data/futures/trading-fees': 5,
199895
200065
  'api-data/g-futures/trading-fees': 5,
200066
+ 'api-data/futures/v2/tradeAccountDetail': 5,
199896
200067
  'g-orders/activeList': 1,
199897
200068
  'orders/activeList': 1,
199898
200069
  'exchange/order/list': 5,
@@ -202470,7 +202641,7 @@ class phemex extends _abstract_phemex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
202470
202641
  }
202471
202642
  else if (amount !== undefined) {
202472
202643
  if (isUSDTSettled) {
202473
- request['baseQtyEV'] = this.amountToPrecision(market['symbol'], amount);
202644
+ request['orderQtyRq'] = this.amountToPrecision(market['symbol'], amount);
202474
202645
  }
202475
202646
  else {
202476
202647
  request['baseQtyEV'] = this.toEv(amount, market);
@@ -220960,8 +221131,8 @@ class bitopro extends _bitopro_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
220960
221131
  },
220961
221132
  'urls': {
220962
221133
  'ws': {
220963
- 'public': 'wss://stream.bitopro.com:9443/ws/v1/pub',
220964
- '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',
220965
221136
  },
220966
221137
  },
220967
221138
  'requiredCredentials': {
@@ -220990,6 +221161,7 @@ class bitopro extends _bitopro_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
220990
221161
  * @method
220991
221162
  * @name bitopro#watchOrderBook
220992
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
220993
221165
  * @param {string} symbol unified symbol of the market to fetch the order book for
220994
221166
  * @param {int} [limit] the maximum amount of order book entries to return
220995
221167
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -221055,6 +221227,7 @@ class bitopro extends _bitopro_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
221055
221227
  * @method
221056
221228
  * @name bitopro#watchTrades
221057
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
221058
221231
  * @param {string} symbol unified symbol of the market to fetch trades for
221059
221232
  * @param {int} [since] timestamp in ms of the earliest trade to fetch
221060
221233
  * @param {int} [limit] the maximum amount of trades to fetch
@@ -221114,6 +221287,7 @@ class bitopro extends _bitopro_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
221114
221287
  * @method
221115
221288
  * @name bitopro#watchTicker
221116
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
221117
221291
  * @param {string} symbol unified symbol of the market to fetch the ticker for
221118
221292
  * @param {object} [params] extra parameters specific to the exchange API endpoint
221119
221293
  * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
@@ -221167,7 +221341,7 @@ class bitopro extends _bitopro_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
221167
221341
  'identity': this.login,
221168
221342
  });
221169
221343
  const payload = this.stringToBase64(rawData);
221170
- 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);
221171
221345
  const defaultOptions = {
221172
221346
  'ws': {
221173
221347
  'options': {
@@ -221193,6 +221367,7 @@ class bitopro extends _bitopro_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
221193
221367
  * @method
221194
221368
  * @name bitopro#watchBalance
221195
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
221196
221371
  * @param {object} [params] extra parameters specific to the exchange API endpoint
221197
221372
  * @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
221198
221373
  */
@@ -222331,21 +222506,38 @@ class bitvavo extends _bitvavo_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
222331
222506
  return this.deepExtend(super.describe(), {
222332
222507
  'has': {
222333
222508
  'ws': true,
222334
- 'createOrderWs': false,
222335
- 'editOrderWs': false,
222336
- 'fetchOpenOrdersWs': false,
222337
- 'fetchOrderWs': false,
222338
- 'cancelOrderWs': false,
222339
222509
  'cancelOrdersWs': false,
222340
- 'cancelAllOrdersWs': false,
222341
222510
  'fetchTradesWs': false,
222342
- 'fetchBalanceWs': false,
222343
222511
  'watchOrderBook': true,
222344
222512
  'watchTrades': true,
222345
222513
  'watchTicker': true,
222346
222514
  'watchOHLCV': true,
222347
222515
  'watchOrders': true,
222348
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,
222349
222541
  },
222350
222542
  'urls': {
222351
222543
  'api': {
@@ -222353,6 +222545,7 @@ class bitvavo extends _bitvavo_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
222353
222545
  },
222354
222546
  },
222355
222547
  'options': {
222548
+ 'supressMultipleWsRequestsError': false,
222356
222549
  'tradesLimit': 1000,
222357
222550
  'ordersLimit': 1000,
222358
222551
  'OHLCVLimit': 1000,
@@ -222508,6 +222701,22 @@ class bitvavo extends _bitvavo_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
222508
222701
  }
222509
222702
  return this.filterBySinceLimit(ohlcv, since, limit, 0, true);
222510
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
+ }
222511
222720
  handleOHLCV(client, message) {
222512
222721
  //
222513
222722
  // {
@@ -222813,6 +223022,584 @@ class bitvavo extends _bitvavo_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
222813
223022
  }
222814
223023
  return this.filterBySymbolSinceLimit(trades, symbol, since, limit, true);
222815
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
+ }
222816
223603
  handleOrder(client, message) {
222817
223604
  //
222818
223605
  // {
@@ -222946,6 +223733,31 @@ class bitvavo extends _bitvavo_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
222946
223733
  }
222947
223734
  }
222948
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
+ }
222949
223761
  handleMessage(client, message) {
222950
223762
  //
222951
223763
  // {
@@ -222955,7 +223767,6 @@ class bitvavo extends _bitvavo_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
222955
223767
  // }
222956
223768
  // }
222957
223769
  //
222958
- //
222959
223770
  // {
222960
223771
  // "event": "book",
222961
223772
  // "market": "BTC-EUR",
@@ -222991,6 +223802,10 @@ class bitvavo extends _bitvavo_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
222991
223802
  // "authenticated": true
222992
223803
  // }
222993
223804
  //
223805
+ const error = this.safeString(message, 'error');
223806
+ if (error !== undefined) {
223807
+ this.handleErrorMessage(client, message);
223808
+ }
222994
223809
  const methods = {
222995
223810
  'subscribed': this.handleSubscriptionStatus,
222996
223811
  'book': this.handleOrderBook,
@@ -223001,21 +223816,27 @@ class bitvavo extends _bitvavo_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
223001
223816
  'authenticate': this.handleAuthenticationMessage,
223002
223817
  'order': this.handleOrder,
223003
223818
  'fill': this.handleMyTrade,
223004
- };
223005
- const event = this.safeString(message, 'event');
223006
- let method = this.safeValue(methods, event);
223007
- if (method === undefined) {
223008
- const action = this.safeString(message, 'action');
223009
- method = this.safeValue(methods, action);
223010
- if (method === undefined) {
223011
- return message;
223012
- }
223013
- else {
223014
- return method.call(this, client, message);
223015
- }
223016
- }
223017
- else {
223018
- 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);
223019
223840
  }
223020
223841
  }
223021
223842
  }
@@ -247194,7 +248015,7 @@ class lbank extends _lbank_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
247194
248015
  };
247195
248016
  const request = this.deepExtend(subscribe, params);
247196
248017
  const orderbook = await this.watch(url, messageHash, request, messageHash);
247197
- return orderbook.limit(limit);
248018
+ return orderbook.limit();
247198
248019
  }
247199
248020
  async watchOrderBook(symbol, limit = undefined, params = {}) {
247200
248021
  /**
@@ -295450,7 +296271,7 @@ SOFTWARE.
295450
296271
 
295451
296272
  //-----------------------------------------------------------------------------
295452
296273
  // this is updated by vss.js when building
295453
- const version = '4.2.20';
296274
+ const version = '4.2.21';
295454
296275
  _src_base_Exchange_js__WEBPACK_IMPORTED_MODULE_0__/* .Exchange */ .e.ccxtVersion = version;
295455
296276
  //-----------------------------------------------------------------------------
295456
296277