ccxt 4.1.32 → 4.1.34

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 (48) hide show
  1. package/README.md +4 -4
  2. package/build.sh +5 -2
  3. package/dist/ccxt.browser.js +237 -132
  4. package/dist/ccxt.browser.min.js +9 -9
  5. package/dist/cjs/ccxt.js +1 -1
  6. package/dist/cjs/src/base/Exchange.js +4 -1
  7. package/dist/cjs/src/base/functions/misc.js +6 -0
  8. package/dist/cjs/src/binance.js +3 -3
  9. package/dist/cjs/src/bitforex.js +1 -1
  10. package/dist/cjs/src/bitmex.js +16 -22
  11. package/dist/cjs/src/digifinex.js +81 -1
  12. package/dist/cjs/src/krakenfutures.js +2 -2
  13. package/dist/cjs/src/pro/bitget.js +1 -1
  14. package/dist/cjs/src/pro/coinex.js +1 -1
  15. package/dist/cjs/src/pro/hitbtc.js +4 -6
  16. package/dist/cjs/src/pro/huobi.js +3 -0
  17. package/dist/cjs/src/pro/woo.js +5 -2
  18. package/dist/cjs/src/upbit.js +8 -6
  19. package/dist/cjs/src/wavesexchange.js +6 -7
  20. package/dist/cjs/src/woo.js +16 -8
  21. package/dist/cjs/src/zonda.js +37 -30
  22. package/js/ccxt.d.ts +1 -1
  23. package/js/ccxt.js +1 -1
  24. package/js/src/abstract/bitbay.d.ts +2 -0
  25. package/js/src/abstract/digifinex.d.ts +14 -0
  26. package/js/src/abstract/zonda.d.ts +2 -0
  27. package/js/src/base/Exchange.d.ts +1 -1
  28. package/js/src/base/Exchange.js +7 -2
  29. package/js/src/base/errorHierarchy.d.ts +2 -0
  30. package/js/src/base/errorHierarchy.js +2 -0
  31. package/js/src/base/functions/misc.js +6 -0
  32. package/js/src/binance.js +3 -3
  33. package/js/src/bitforex.js +1 -1
  34. package/js/src/bitmex.js +16 -22
  35. package/js/src/digifinex.d.ts +10 -0
  36. package/js/src/digifinex.js +81 -1
  37. package/js/src/krakenfutures.js +2 -2
  38. package/js/src/pro/bitget.js +1 -1
  39. package/js/src/pro/coinex.js +1 -1
  40. package/js/src/pro/hitbtc.js +4 -6
  41. package/js/src/pro/huobi.js +3 -0
  42. package/js/src/pro/woo.js +5 -2
  43. package/js/src/upbit.js +8 -6
  44. package/js/src/wavesexchange.js +6 -7
  45. package/js/src/woo.d.ts +1 -0
  46. package/js/src/woo.js +16 -8
  47. package/js/src/zonda.js +37 -30
  48. package/package.json +4 -2
package/dist/cjs/ccxt.js CHANGED
@@ -180,7 +180,7 @@ var woo$1 = require('./src/pro/woo.js');
180
180
 
181
181
  //-----------------------------------------------------------------------------
182
182
  // this is updated by vss.js when building
183
- const version = '4.1.32';
183
+ const version = '4.1.34';
184
184
  Exchange["default"].ccxtVersion = version;
185
185
  const exchanges = {
186
186
  'ace': ace,
@@ -8,6 +8,7 @@ var Precise = require('./Precise.js');
8
8
  var WsClient = require('./ws/WsClient.js');
9
9
  var Future = require('./ws/Future.js');
10
10
  var OrderBook = require('./ws/OrderBook.js');
11
+ var crypto = require('./functions/crypto.js');
11
12
  var totp = require('./functions/totp.js');
12
13
  var generic = require('./functions/generic.js');
13
14
  var misc = require('./functions/misc.js');
@@ -208,7 +209,6 @@ class Exchange {
208
209
  this.urlencodeNested = urlencodeNested;
209
210
  this.parseDate = parseDate;
210
211
  this.ymd = ymd;
211
- this.isArray = generic.inArray;
212
212
  this.base64ToString = base64ToString;
213
213
  this.crc32 = crc32;
214
214
  Object.assign(this, functions);
@@ -1081,6 +1081,9 @@ class Exchange {
1081
1081
  getProperty(obj, property, defaultValue = undefined) {
1082
1082
  return (property in obj ? obj[property] : defaultValue);
1083
1083
  }
1084
+ axolotl(payload, hexKey, ed25519) {
1085
+ return crypto.axolotl(payload, hexKey, ed25519);
1086
+ }
1084
1087
  /* eslint-enable */
1085
1088
  // ------------------------------------------------------------------------
1086
1089
  // ########################################################################
@@ -45,6 +45,12 @@ const roundTimeframe = (timeframe, timestamp, direction = number.ROUND_DOWN) =>
45
45
  return timestamp - offset + ((direction === number.ROUND_UP) ? ms : 0);
46
46
  };
47
47
  const extractParams = (string) => {
48
+ /**
49
+ * @ignore
50
+ * @method
51
+ * @param string usually a url path
52
+ * @returns {[string]} all substrings surrounded by {} from parameter string
53
+ */
48
54
  const re = /{([\w-]+)}/g;
49
55
  const matches = [];
50
56
  let match = re.exec(string);
@@ -5151,13 +5151,13 @@ class binance extends binance$1 {
5151
5151
  * @description cancel multiple orders
5152
5152
  * @see https://binance-docs.github.io/apidocs/futures/en/#cancel-multiple-orders-trade
5153
5153
  * @see https://binance-docs.github.io/apidocs/delivery/en/#cancel-multiple-orders-trade
5154
- * @param {[string]} ids order ids
5154
+ * @param {string[]} ids order ids
5155
5155
  * @param {string} [symbol] unified market symbol
5156
5156
  * @param {object} [params] extra parameters specific to the bingx api endpoint
5157
5157
  *
5158
5158
  * EXCHANGE SPECIFIC PARAMETERS
5159
- * @param {[string]} [params.origClientOrderIdList] max length 10 e.g. ["my_id_1","my_id_2"], encode the double quotes. No space after comma
5160
- * @param {[int]} [params.recvWindow]
5159
+ * @param {string[]} [params.origClientOrderIdList] max length 10 e.g. ["my_id_1","my_id_2"], encode the double quotes. No space after comma
5160
+ * @param {int[]} [params.recvWindow]
5161
5161
  * @returns {object} an list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
5162
5162
  */
5163
5163
  this.checkRequiredSymbol('cancelOrders', symbol);
@@ -657,7 +657,7 @@ class bitforex extends bitforex$1 {
657
657
  * @method
658
658
  * @name bitforex#fetchOrder
659
659
  * @description fetches information on an order made by the user
660
- * @see
660
+ * @see https://apidoc.bitforex.com/#order-information-user_data
661
661
  * @param {string} symbol unified symbol of the market the order was made in
662
662
  * @param {object} [params] extra parameters specific to the bitforex api endpoint
663
663
  * @returns {object} An [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
@@ -1671,18 +1671,15 @@ class bitmex extends bitmex$1 {
1671
1671
  // "timestamp":"2021-01-02T21:38:49.246Z"
1672
1672
  // }
1673
1673
  //
1674
- const status = this.parseOrderStatus(this.safeString(order, 'ordStatus'));
1675
1674
  const marketId = this.safeString(order, 'symbol');
1676
- const symbol = this.safeSymbol(marketId, market);
1677
- const timestamp = this.parse8601(this.safeString(order, 'timestamp'));
1678
- const lastTradeTimestamp = this.parse8601(this.safeString(order, 'transactTime'));
1679
- const price = this.safeString(order, 'price');
1675
+ market = this.safeMarket(marketId, market);
1676
+ const symbol = market['symbol'];
1680
1677
  const qty = this.safeString(order, 'orderQty');
1681
1678
  let cost = undefined;
1682
1679
  let amount = undefined;
1683
- const defaultSubType = this.safeString(this.options, 'defaultSubType', 'linear');
1684
1680
  let isInverse = false;
1685
- if (market === undefined) {
1681
+ if (marketId === undefined) {
1682
+ const defaultSubType = this.safeString(this.options, 'defaultSubType', 'linear');
1686
1683
  isInverse = (defaultSubType === 'inverse');
1687
1684
  }
1688
1685
  else {
@@ -1703,38 +1700,35 @@ class bitmex extends bitmex$1 {
1703
1700
  else {
1704
1701
  filled = cumQty;
1705
1702
  }
1706
- const id = this.safeString(order, 'orderID');
1707
- const type = this.safeStringLower(order, 'ordType');
1708
- const side = this.safeStringLower(order, 'side');
1709
- const clientOrderId = this.safeString(order, 'clOrdID');
1710
- const timeInForce = this.parseTimeInForce(this.safeString(order, 'timeInForce'));
1711
- const stopPrice = this.safeNumber(order, 'stopPx');
1712
1703
  const execInst = this.safeString(order, 'execInst');
1713
1704
  let postOnly = undefined;
1714
1705
  if (execInst !== undefined) {
1715
1706
  postOnly = (execInst === 'ParticipateDoNotInitiate');
1716
1707
  }
1708
+ const timestamp = this.parse8601(this.safeString(order, 'timestamp'));
1709
+ const stopPrice = this.safeNumber(order, 'stopPx');
1710
+ const remaining = this.safeString(order, 'leavesQty');
1717
1711
  return this.safeOrder({
1718
1712
  'info': order,
1719
- 'id': id,
1720
- 'clientOrderId': clientOrderId,
1713
+ 'id': this.safeString(order, 'orderID'),
1714
+ 'clientOrderId': this.safeString(order, 'clOrdID'),
1721
1715
  'timestamp': timestamp,
1722
1716
  'datetime': this.iso8601(timestamp),
1723
- 'lastTradeTimestamp': lastTradeTimestamp,
1717
+ 'lastTradeTimestamp': this.parse8601(this.safeString(order, 'transactTime')),
1724
1718
  'symbol': symbol,
1725
- 'type': type,
1726
- 'timeInForce': timeInForce,
1719
+ 'type': this.safeStringLower(order, 'ordType'),
1720
+ 'timeInForce': this.parseTimeInForce(this.safeString(order, 'timeInForce')),
1727
1721
  'postOnly': postOnly,
1728
- 'side': side,
1729
- 'price': price,
1722
+ 'side': this.safeStringLower(order, 'side'),
1723
+ 'price': this.safeString(order, 'price'),
1730
1724
  'stopPrice': stopPrice,
1731
1725
  'triggerPrice': stopPrice,
1732
1726
  'amount': amount,
1733
1727
  'cost': cost,
1734
1728
  'average': average,
1735
1729
  'filled': filled,
1736
- 'remaining': undefined,
1737
- 'status': status,
1730
+ 'remaining': this.convertFromRawQuantity(symbol, remaining),
1731
+ 'status': this.parseOrderStatus(this.safeString(order, 'ordStatus')),
1738
1732
  'fee': undefined,
1739
1733
  'trades': undefined,
1740
1734
  }, market);
@@ -47,7 +47,7 @@ class digifinex extends digifinex$1 {
47
47
  'fetchDeposits': true,
48
48
  'fetchDepositWithdrawFee': 'emulated',
49
49
  'fetchDepositWithdrawFees': true,
50
- 'fetchFundingHistory': false,
50
+ 'fetchFundingHistory': true,
51
51
  'fetchFundingRate': true,
52
52
  'fetchFundingRateHistory': true,
53
53
  'fetchFundingRates': false,
@@ -194,6 +194,7 @@ class digifinex extends digifinex$1 {
194
194
  'account/finance_record',
195
195
  'account/trading_fee_rate',
196
196
  'account/transfer_record',
197
+ 'account/funding_fee',
197
198
  'trade/history_orders',
198
199
  'trade/history_trades',
199
200
  'trade/open_orders',
@@ -201,10 +202,23 @@ class digifinex extends digifinex$1 {
201
202
  ],
202
203
  'post': [
203
204
  'account/leverage',
205
+ 'account/position_mode',
206
+ 'account/position_margin',
204
207
  'trade/batch_cancel_order',
205
208
  'trade/batch_order',
206
209
  'trade/cancel_order',
207
210
  'trade/order_place',
211
+ 'follow/sponsor_order',
212
+ 'follow/close_order',
213
+ 'follow/cancel_order',
214
+ 'follow/user_center_current',
215
+ 'follow/user_center_history',
216
+ 'follow/expert_current_open_order',
217
+ 'follow/add_algo',
218
+ 'follow/cancel_algo',
219
+ 'follow/account_available',
220
+ 'follow/plan_task',
221
+ 'follow/instrument_list',
208
222
  ],
209
223
  },
210
224
  },
@@ -3783,6 +3797,72 @@ class digifinex extends digifinex$1 {
3783
3797
  }
3784
3798
  return depositWithdrawFees;
3785
3799
  }
3800
+ async fetchFundingHistory(symbol = undefined, since = undefined, limit = undefined, params = {}) {
3801
+ /**
3802
+ * @method
3803
+ * @name digifinex#fetchFundingHistory
3804
+ * @description fetch the history of funding payments paid and received on this account
3805
+ * @see https://docs.digifinex.com/en-ww/swap/v2/rest.html#funding-fee
3806
+ * @param {string} [symbol] unified market symbol
3807
+ * @param {int} [since] the earliest time in ms to fetch funding history for
3808
+ * @param {int} [limit] the maximum number of funding history structures to retrieve
3809
+ * @param {object} [params] extra parameters specific to the digifinex api endpoint
3810
+ * @param {int} [params.until] timestamp in ms of the latest funding payment
3811
+ * @returns {object} a [funding history structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#funding-history-structure}
3812
+ */
3813
+ await this.loadMarkets();
3814
+ let request = {};
3815
+ [request, params] = this.handleUntilOption('end_timestamp', request, params);
3816
+ let market = undefined;
3817
+ if (symbol !== undefined) {
3818
+ market = this.market(symbol);
3819
+ request['instrument_id'] = market['id'];
3820
+ }
3821
+ if (limit !== undefined) {
3822
+ request['limit'] = limit;
3823
+ }
3824
+ if (since !== undefined) {
3825
+ request['start_timestamp'] = since;
3826
+ }
3827
+ const response = await this.privateSwapGetAccountFundingFee(this.extend(request, params));
3828
+ //
3829
+ // {
3830
+ // "code": 0,
3831
+ // "data": [
3832
+ // {
3833
+ // "instrument_id": "BTCUSDTPERP",
3834
+ // "currency": "USDT",
3835
+ // "amount": "-0.000342814",
3836
+ // "timestamp": 1698768009440
3837
+ // }
3838
+ // ]
3839
+ // }
3840
+ //
3841
+ const data = this.safeValue(response, 'data', []);
3842
+ return this.parseIncomes(data, market, since, limit);
3843
+ }
3844
+ parseIncome(income, market = undefined) {
3845
+ //
3846
+ // {
3847
+ // "instrument_id": "BTCUSDTPERP",
3848
+ // "currency": "USDT",
3849
+ // "amount": "-0.000342814",
3850
+ // "timestamp": 1698768009440
3851
+ // }
3852
+ //
3853
+ const marketId = this.safeString(income, 'instrument_id');
3854
+ const currencyId = this.safeString(income, 'currency');
3855
+ const timestamp = this.safeInteger(income, 'timestamp');
3856
+ return {
3857
+ 'info': income,
3858
+ 'symbol': this.safeSymbol(marketId, market, undefined, 'swap'),
3859
+ 'code': this.safeCurrencyCode(currencyId),
3860
+ 'timestamp': timestamp,
3861
+ 'datetime': this.iso8601(timestamp),
3862
+ 'id': undefined,
3863
+ 'amount': this.safeNumber(income, 'amount'),
3864
+ };
3865
+ }
3786
3866
  sign(path, api = [], method = 'GET', params = {}, headers = undefined, body = undefined) {
3787
3867
  const signed = api[0] === 'private';
3788
3868
  const endpoint = api[1];
@@ -1040,12 +1040,12 @@ class krakenfutures extends krakenfutures$1 {
1040
1040
  * @name krakenfutures#cancelOrders
1041
1041
  * @description cancel multiple orders
1042
1042
  * @see https://docs.futures.kraken.com/#http-api-trading-v3-api-order-management-batch-order-management
1043
- * @param {[string]} ids order ids
1043
+ * @param {string[]} ids order ids
1044
1044
  * @param {string} [symbol] unified market symbol
1045
1045
  * @param {object} [params] extra parameters specific to the bingx api endpoint
1046
1046
  *
1047
1047
  * EXCHANGE SPECIFIC PARAMETERS
1048
- * @param {[string]} [params.clientOrderIds] max length 10 e.g. ["my_id_1","my_id_2"]
1048
+ * @param {string[]} [params.clientOrderIds] max length 10 e.g. ["my_id_1","my_id_2"]
1049
1049
  * @returns {object} an list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
1050
1050
  */
1051
1051
  await this.loadMarkets();
@@ -461,7 +461,7 @@ class bitget extends bitget$1 {
461
461
  const instType = market['spot'] ? 'sp' : 'mc';
462
462
  let channel = 'books';
463
463
  let incrementalFeed = true;
464
- if ((limit === 5) || (limit === 15)) {
464
+ if ((limit === 1) || (limit === 5) || (limit === 15)) {
465
465
  channel += limit.toString();
466
466
  incrementalFeed = false;
467
467
  }
@@ -586,7 +586,7 @@ class coinex extends coinex$1 {
586
586
  * @param {int|undefined} limit the maximum amount of candles to fetch
587
587
  * @param {object} params extra parameters specific to the coinex api endpoint
588
588
  * @param {int|undefined} params.end the end time for spot markets, this.seconds () is set as default
589
- * @returns {[[int]]} A list of candles ordered as timestamp, open, high, low, close, volume
589
+ * @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume
590
590
  */
591
591
  await this.loadMarkets();
592
592
  const market = this.market(symbol);
@@ -110,9 +110,8 @@ class hitbtc extends hitbtc$1 {
110
110
  * @ignore
111
111
  * @method
112
112
  * @param {string} name websocket endpoint name
113
- * @param {[string]} [symbols] unified CCXT symbol(s)
113
+ * @param {string[]} [symbols] unified CCXT symbol(s)
114
114
  * @param {object} [params] extra parameters specific to the hitbtc api
115
- * @returns
116
115
  */
117
116
  await this.loadMarkets();
118
117
  const url = this.urls['api']['ws']['public'];
@@ -135,7 +134,6 @@ class hitbtc extends hitbtc$1 {
135
134
  * @param {string} name websocket endpoint name
136
135
  * @param {string} [symbol] unified CCXT symbol
137
136
  * @param {object} [params] extra parameters specific to the hitbtc api
138
- * @returns
139
137
  */
140
138
  await this.loadMarkets();
141
139
  await this.authenticate();
@@ -589,7 +587,7 @@ class hitbtc extends hitbtc$1 {
589
587
  * @param {int} [since] not used by hitbtc watchOHLCV
590
588
  * @param {int} [limit] 0 – 1000, default value = 0 (no history returned)
591
589
  * @param {object} [params] extra parameters specific to the hitbtc api endpoint
592
- * @returns {[[int]]} A list of candles ordered as timestamp, open, high, low, close, volume
590
+ * @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume
593
591
  */
594
592
  const period = this.safeString(this.timeframes, timeframe, timeframe);
595
593
  const name = 'candles/' + period;
@@ -701,7 +699,7 @@ class hitbtc extends hitbtc$1 {
701
699
  * @param {int} [since] timestamp in ms of the earliest order to fetch
702
700
  * @param {int} [limit] the maximum amount of orders to fetch
703
701
  * @param {object} [params] extra parameters specific to the hitbtc api endpoint
704
- * @returns {[object]} a list of [order structures]{@link https://docs.ccxt.com/en/latest/manual.html#order-structure}
702
+ * @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/en/latest/manual.html#order-structure}
705
703
  */
706
704
  await this.loadMarkets();
707
705
  let marketType = undefined;
@@ -933,7 +931,7 @@ class hitbtc extends hitbtc$1 {
933
931
  *
934
932
  * EXCHANGE SPECIFIC PARAMETERS
935
933
  * @param {string} [params.mode] 'updates' or 'batches' (default), 'updates' = messages arrive after balance updates, 'batches' = messages arrive at equal intervals if there were any updates
936
- * @returns {[object]} a list of [balance structures]{@link https://docs.ccxt.com/#/?id=balance-structure}
934
+ * @returns {object[]} a list of [balance structures]{@link https://docs.ccxt.com/#/?id=balance-structure}
937
935
  */
938
936
  await this.loadMarkets();
939
937
  let type = undefined;
@@ -544,6 +544,9 @@ class huobi extends huobi$1 {
544
544
  orderbook.reset(snapshot);
545
545
  orderbook['nonce'] = seqNum;
546
546
  }
547
+ if (prevSeqNum !== undefined && prevSeqNum > orderbook['nonce']) {
548
+ throw new errors.InvalidNonce(this.id + ' watchOrderBook() received a mesage out of order');
549
+ }
547
550
  if ((prevSeqNum === undefined || prevSeqNum <= orderbook['nonce']) && (seqNum > orderbook['nonce'])) {
548
551
  const asks = this.safeValue(tick, 'asks', []);
549
552
  const bids = this.safeValue(tick, 'bids', []);
@@ -664,8 +664,11 @@ class woo extends woo$1 {
664
664
  const value = balances[key];
665
665
  const code = this.safeCurrencyCode(key);
666
666
  const account = (code in this.balance) ? this.balance[code] : this.account();
667
- account['total'] = this.safeString(value, 'holding');
668
- account['used'] = this.safeString(value, 'frozen');
667
+ const total = this.safeString(value, 'holding');
668
+ const used = this.safeString(value, 'frozen');
669
+ account['total'] = total;
670
+ account['used'] = used;
671
+ account['free'] = Precise["default"].stringSub(total, used);
669
672
  this.balance[code] = account;
670
673
  }
671
674
  this.balance = this.safeBalance(this.balance);
@@ -973,17 +973,19 @@ class upbit extends upbit$1 {
973
973
  'timeframe': timeframeValue,
974
974
  'count': limit,
975
975
  };
976
- let method = 'publicGetCandlesTimeframe';
976
+ let response = undefined;
977
+ if (since !== undefined) {
978
+ // convert `since` to `to` value
979
+ request['to'] = this.iso8601(this.sum(since, timeframePeriod * limit * 1000));
980
+ }
977
981
  if (timeframeValue === 'minutes') {
978
982
  const numMinutes = Math.round(timeframePeriod / 60);
979
983
  request['unit'] = numMinutes;
980
- method += 'Unit';
984
+ response = await this.publicGetCandlesTimeframeUnit(this.extend(request, params));
981
985
  }
982
- if (since !== undefined) {
983
- // convert `since` to `to` value
984
- request['to'] = this.iso8601(this.sum(since, timeframePeriod * limit * 1000));
986
+ else {
987
+ response = await this.publicGetCandlesTimeframe(this.extend(request, params));
985
988
  }
986
- const response = await this[method](this.extend(request, params));
987
989
  //
988
990
  // [
989
991
  // {
@@ -4,7 +4,6 @@ var wavesexchange$1 = require('./abstract/wavesexchange.js');
4
4
  var errors = require('./base/errors.js');
5
5
  var Precise = require('./base/Precise.js');
6
6
  var ed25519 = require('./static_dependencies/noble-curves/ed25519.js');
7
- var crypto = require('./base/functions/crypto.js');
8
7
  var number = require('./base/functions/number.js');
9
8
 
10
9
  // ---------------------------------------------------------------------------
@@ -752,7 +751,7 @@ class wavesexchange extends wavesexchange$1 {
752
751
  const messageHex = this.binaryToBase16(this.encode(message));
753
752
  const payload = prefix + messageHex;
754
753
  const hexKey = this.binaryToBase16(this.base58ToBinary(this.secret));
755
- const signature = crypto.axolotl(payload, hexKey, ed25519.ed25519);
754
+ const signature = this.axolotl(payload, hexKey, ed25519.ed25519);
756
755
  const request = {
757
756
  'grant_type': 'password',
758
757
  'scope': 'general',
@@ -1421,7 +1420,7 @@ class wavesexchange extends wavesexchange$1 {
1421
1420
  if ((serializedOrder[0] === '"') && (serializedOrder[(serializedOrder.length - 1)] === '"')) {
1422
1421
  serializedOrder = serializedOrder.slice(1, serializedOrder.length - 1);
1423
1422
  }
1424
- const signature = crypto.axolotl(this.binaryToBase16(this.base58ToBinary(serializedOrder)), this.binaryToBase16(this.base58ToBinary(this.secret)), ed25519.ed25519);
1423
+ const signature = this.axolotl(this.binaryToBase16(this.base58ToBinary(serializedOrder)), this.binaryToBase16(this.base58ToBinary(this.secret)), ed25519.ed25519);
1425
1424
  body['signature'] = signature;
1426
1425
  //
1427
1426
  // {
@@ -1536,7 +1535,7 @@ class wavesexchange extends wavesexchange$1 {
1536
1535
  ];
1537
1536
  const binary = this.binaryConcatArray(byteArray);
1538
1537
  const hexSecret = this.binaryToBase16(this.base58ToBinary(this.secret));
1539
- const signature = crypto.axolotl(this.binaryToBase16(binary), hexSecret, ed25519.ed25519);
1538
+ const signature = this.axolotl(this.binaryToBase16(binary), hexSecret, ed25519.ed25519);
1540
1539
  const request = {
1541
1540
  'Timestamp': timestamp.toString(),
1542
1541
  'Signature': signature,
@@ -1571,7 +1570,7 @@ class wavesexchange extends wavesexchange$1 {
1571
1570
  ];
1572
1571
  const binary = this.binaryConcatArray(byteArray);
1573
1572
  const hexSecret = this.binaryToBase16(this.base58ToBinary(this.secret));
1574
- const signature = crypto.axolotl(this.binaryToBase16(binary), hexSecret, ed25519.ed25519);
1573
+ const signature = this.axolotl(this.binaryToBase16(binary), hexSecret, ed25519.ed25519);
1575
1574
  const request = {
1576
1575
  'Accept': 'application/json',
1577
1576
  'Timestamp': timestamp.toString(),
@@ -1935,7 +1934,7 @@ class wavesexchange extends wavesexchange$1 {
1935
1934
  ];
1936
1935
  const binary = this.binaryConcatArray(byteArray);
1937
1936
  const hexSecret = this.binaryToBase16(this.base58ToBinary(this.secret));
1938
- const signature = crypto.axolotl(this.binaryToBase16(binary), hexSecret, ed25519.ed25519);
1937
+ const signature = this.axolotl(this.binaryToBase16(binary), hexSecret, ed25519.ed25519);
1939
1938
  const matcherRequest = {
1940
1939
  'publicKey': this.apiKey,
1941
1940
  'signature': signature,
@@ -2533,7 +2532,7 @@ class wavesexchange extends wavesexchange$1 {
2533
2532
  ];
2534
2533
  const binary = this.binaryConcatArray(byteArray);
2535
2534
  const hexSecret = this.binaryToBase16(this.base58ToBinary(this.secret));
2536
- const signature = crypto.axolotl(this.binaryToBase16(binary), hexSecret, ed25519.ed25519);
2535
+ const signature = this.axolotl(this.binaryToBase16(binary), hexSecret, ed25519.ed25519);
2537
2536
  const request = {
2538
2537
  'senderPublicKey': this.apiKey,
2539
2538
  'amount': amountInteger,
@@ -243,6 +243,7 @@ class woo extends woo$1 {
243
243
  },
244
244
  },
245
245
  'options': {
246
+ 'sandboxMode': false,
246
247
  'createMarketBuyOrderRequiresPrice': true,
247
248
  // these network aliases require manual mapping here
248
249
  'network-aliases-for-tokens': {
@@ -2149,14 +2150,17 @@ class woo extends woo$1 {
2149
2150
  else {
2150
2151
  this.checkRequiredCredentials();
2151
2152
  if (method === 'POST' && (path === 'algo/order' || path === 'order')) {
2152
- const applicationId = 'bc830de7-50f3-460b-9ee0-f430f83f9dad';
2153
- const brokerId = this.safeString(this.options, 'brokerId', applicationId);
2154
- const isStop = path.indexOf('algo') > -1;
2155
- if (isStop) {
2156
- params['brokerId'] = brokerId;
2157
- }
2158
- else {
2159
- params['broker_id'] = brokerId;
2153
+ const isSandboxMode = this.safeValue(this.options, 'sandboxMode', false);
2154
+ if (!isSandboxMode) {
2155
+ const applicationId = 'bc830de7-50f3-460b-9ee0-f430f83f9dad';
2156
+ const brokerId = this.safeString(this.options, 'brokerId', applicationId);
2157
+ const isStop = path.indexOf('algo') > -1;
2158
+ if (isStop) {
2159
+ params['brokerId'] = brokerId;
2160
+ }
2161
+ else {
2162
+ params['broker_id'] = brokerId;
2163
+ }
2160
2164
  }
2161
2165
  params = this.keysort(params);
2162
2166
  }
@@ -2612,6 +2616,10 @@ class woo extends woo$1 {
2612
2616
  // if it was not returned according to above options, then return the first network of currency
2613
2617
  return this.safeValue(networkKeys, 0);
2614
2618
  }
2619
+ setSandboxMode(enable) {
2620
+ super.setSandboxMode(enable);
2621
+ this.options['sandboxMode'] = enable;
2622
+ }
2615
2623
  }
2616
2624
 
2617
2625
  module.exports = woo;