ccxt 4.2.29 → 4.2.31

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 (164) hide show
  1. package/README.md +5 -6
  2. package/dist/ccxt.browser.js +2196 -601
  3. package/dist/ccxt.browser.min.js +7 -7
  4. package/dist/cjs/ccxt.js +3 -1
  5. package/dist/cjs/src/ascendex.js +5 -5
  6. package/dist/cjs/src/base/Exchange.js +33 -25
  7. package/dist/cjs/src/base/errors.js +3 -3
  8. package/dist/cjs/src/base/functions/type.js +12 -0
  9. package/dist/cjs/src/bigone.js +2 -2
  10. package/dist/cjs/src/binance.js +897 -218
  11. package/dist/cjs/src/bingx.js +1 -1
  12. package/dist/cjs/src/bitfinex.js +1 -1
  13. package/dist/cjs/src/bitfinex2.js +457 -93
  14. package/dist/cjs/src/bitforex.js +3 -0
  15. package/dist/cjs/src/bitget.js +8 -4
  16. package/dist/cjs/src/bitmart.js +3 -3
  17. package/dist/cjs/src/bitmex.js +4 -4
  18. package/dist/cjs/src/bitrue.js +1 -1
  19. package/dist/cjs/src/bitso.js +1 -1
  20. package/dist/cjs/src/bitteam.js +2 -2
  21. package/dist/cjs/src/btcalpha.js +1 -1
  22. package/dist/cjs/src/bybit.js +3 -3
  23. package/dist/cjs/src/coinbase.js +22 -5
  24. package/dist/cjs/src/coincheck.js +1 -1
  25. package/dist/cjs/src/coinex.js +2 -2
  26. package/dist/cjs/src/coinlist.js +1 -1
  27. package/dist/cjs/src/coinmate.js +1 -1
  28. package/dist/cjs/src/coinmetro.js +2 -2
  29. package/dist/cjs/src/coinsph.js +1 -1
  30. package/dist/cjs/src/cryptocom.js +3 -3
  31. package/dist/cjs/src/deribit.js +1 -0
  32. package/dist/cjs/src/digifinex.js +6 -4
  33. package/dist/cjs/src/exmo.js +2 -2
  34. package/dist/cjs/src/gate.js +5 -5
  35. package/dist/cjs/src/gemini.js +3 -3
  36. package/dist/cjs/src/hitbtc.js +14 -20
  37. package/dist/cjs/src/hollaex.js +2 -2
  38. package/dist/cjs/src/htx.js +6 -6
  39. package/dist/cjs/src/huobijp.js +1 -1
  40. package/dist/cjs/src/kraken.js +3 -1
  41. package/dist/cjs/src/krakenfutures.js +4 -1
  42. package/dist/cjs/src/kucoin.js +17 -17
  43. package/dist/cjs/src/kucoinfutures.js +3 -3
  44. package/dist/cjs/src/lbank.js +28 -27
  45. package/dist/cjs/src/mexc.js +7 -7
  46. package/dist/cjs/src/novadax.js +1 -1
  47. package/dist/cjs/src/okcoin.js +2 -2
  48. package/dist/cjs/src/okx.js +23 -8
  49. package/dist/cjs/src/p2b.js +1 -0
  50. package/dist/cjs/src/phemex.js +3 -3
  51. package/dist/cjs/src/poloniexfutures.js +6 -3
  52. package/dist/cjs/src/pro/alpaca.js +1 -1
  53. package/dist/cjs/src/pro/binance.js +4 -4
  54. package/dist/cjs/src/pro/bitget.js +1 -1
  55. package/dist/cjs/src/pro/bitmart.js +1 -1
  56. package/dist/cjs/src/pro/bitmex.js +49 -6
  57. package/dist/cjs/src/pro/bitvavo.js +1 -1
  58. package/dist/cjs/src/pro/bybit.js +2 -2
  59. package/dist/cjs/src/pro/cex.js +2 -2
  60. package/dist/cjs/src/pro/independentreserve.js +1 -1
  61. package/dist/cjs/src/pro/okx.js +1 -1
  62. package/dist/cjs/src/pro/onetrading.js +2 -2
  63. package/dist/cjs/src/pro/p2b.js +432 -0
  64. package/dist/cjs/src/pro/probit.js +5 -5
  65. package/dist/cjs/src/pro/whitebit.js +1 -1
  66. package/dist/cjs/src/probit.js +1 -1
  67. package/dist/cjs/src/timex.js +2 -2
  68. package/dist/cjs/src/tokocrypto.js +3 -3
  69. package/dist/cjs/src/wavesexchange.js +2 -2
  70. package/dist/cjs/src/whitebit.js +3 -3
  71. package/dist/cjs/src/woo.js +3 -3
  72. package/dist/cjs/src/yobit.js +1 -1
  73. package/dist/cjs/src/zaif.js +1 -1
  74. package/dist/cjs/src/zonda.js +3 -3
  75. package/js/ccxt.d.ts +4 -1
  76. package/js/ccxt.js +3 -1
  77. package/js/src/abstract/bybit.d.ts +2 -2
  78. package/js/src/abstract/coinbase.d.ts +10 -0
  79. package/js/src/abstract/okx.d.ts +12 -1
  80. package/js/src/ascendex.js +5 -5
  81. package/js/src/base/Exchange.d.ts +2 -2
  82. package/js/src/base/Exchange.js +33 -25
  83. package/js/src/base/errorHierarchy.d.ts +7 -6
  84. package/js/src/base/errorHierarchy.js +7 -6
  85. package/js/src/base/errors.d.ts +3 -3
  86. package/js/src/base/errors.js +3 -3
  87. package/js/src/base/functions/type.js +12 -0
  88. package/js/src/bigone.js +2 -2
  89. package/js/src/binance.d.ts +1 -0
  90. package/js/src/binance.js +898 -219
  91. package/js/src/bingx.js +1 -1
  92. package/js/src/bitfinex.js +1 -1
  93. package/js/src/bitfinex2.d.ts +6 -1
  94. package/js/src/bitfinex2.js +457 -93
  95. package/js/src/bitforex.js +3 -0
  96. package/js/src/bitget.js +8 -4
  97. package/js/src/bitmart.js +3 -3
  98. package/js/src/bitmex.js +4 -4
  99. package/js/src/bitrue.js +1 -1
  100. package/js/src/bitso.d.ts +1 -1
  101. package/js/src/bitso.js +1 -1
  102. package/js/src/bitteam.js +2 -2
  103. package/js/src/btcalpha.js +1 -1
  104. package/js/src/bybit.js +3 -3
  105. package/js/src/coinbase.js +22 -5
  106. package/js/src/coincheck.js +1 -1
  107. package/js/src/coinex.js +2 -2
  108. package/js/src/coinlist.js +1 -1
  109. package/js/src/coinmate.js +1 -1
  110. package/js/src/coinmetro.d.ts +1 -1
  111. package/js/src/coinmetro.js +2 -2
  112. package/js/src/coinsph.js +1 -1
  113. package/js/src/cryptocom.js +3 -3
  114. package/js/src/deribit.js +1 -0
  115. package/js/src/digifinex.js +6 -4
  116. package/js/src/exmo.js +2 -2
  117. package/js/src/gate.js +5 -5
  118. package/js/src/gemini.d.ts +1 -1
  119. package/js/src/gemini.js +3 -3
  120. package/js/src/hitbtc.js +14 -20
  121. package/js/src/hollaex.js +2 -2
  122. package/js/src/htx.js +6 -6
  123. package/js/src/huobijp.js +1 -1
  124. package/js/src/kraken.js +3 -1
  125. package/js/src/krakenfutures.js +4 -1
  126. package/js/src/kucoin.js +17 -17
  127. package/js/src/kucoinfutures.js +3 -3
  128. package/js/src/lbank.d.ts +1 -1
  129. package/js/src/lbank.js +28 -27
  130. package/js/src/mexc.js +7 -7
  131. package/js/src/novadax.js +1 -1
  132. package/js/src/okcoin.js +2 -2
  133. package/js/src/okx.js +23 -8
  134. package/js/src/p2b.js +1 -0
  135. package/js/src/phemex.js +3 -3
  136. package/js/src/poloniexfutures.js +6 -3
  137. package/js/src/pro/alpaca.js +1 -1
  138. package/js/src/pro/binance.js +4 -4
  139. package/js/src/pro/bitget.js +1 -1
  140. package/js/src/pro/bitmart.js +1 -1
  141. package/js/src/pro/bitmex.d.ts +2 -1
  142. package/js/src/pro/bitmex.js +49 -6
  143. package/js/src/pro/bitvavo.js +1 -1
  144. package/js/src/pro/bybit.js +2 -2
  145. package/js/src/pro/cex.js +2 -2
  146. package/js/src/pro/independentreserve.js +1 -1
  147. package/js/src/pro/okx.js +1 -1
  148. package/js/src/pro/onetrading.js +2 -2
  149. package/js/src/pro/p2b.d.ts +23 -0
  150. package/js/src/pro/p2b.js +433 -0
  151. package/js/src/pro/probit.js +5 -5
  152. package/js/src/pro/whitebit.js +1 -1
  153. package/js/src/probit.js +1 -1
  154. package/js/src/timex.js +2 -2
  155. package/js/src/tokocrypto.js +3 -3
  156. package/js/src/wavesexchange.js +2 -2
  157. package/js/src/whitebit.js +3 -3
  158. package/js/src/woo.js +3 -3
  159. package/js/src/yobit.js +1 -1
  160. package/js/src/zaif.js +1 -1
  161. package/js/src/zonda.d.ts +1 -1
  162. package/js/src/zonda.js +3 -3
  163. package/package.json +1 -1
  164. package/skip-tests.json +3 -10
package/dist/cjs/ccxt.js CHANGED
@@ -164,6 +164,7 @@ var ndax$1 = require('./src/pro/ndax.js');
164
164
  var okcoin$1 = require('./src/pro/okcoin.js');
165
165
  var okx$1 = require('./src/pro/okx.js');
166
166
  var onetrading$1 = require('./src/pro/onetrading.js');
167
+ var p2b$1 = require('./src/pro/p2b.js');
167
168
  var phemex$1 = require('./src/pro/phemex.js');
168
169
  var poloniex$1 = require('./src/pro/poloniex.js');
169
170
  var poloniexfutures$1 = require('./src/pro/poloniexfutures.js');
@@ -175,7 +176,7 @@ var woo$1 = require('./src/pro/woo.js');
175
176
 
176
177
  //-----------------------------------------------------------------------------
177
178
  // this is updated by vss.js when building
178
- const version = '4.2.29';
179
+ const version = '4.2.31';
179
180
  Exchange["default"].ccxtVersion = version;
180
181
  const exchanges = {
181
182
  'ace': ace,
@@ -332,6 +333,7 @@ const pro = {
332
333
  'okcoin': okcoin$1,
333
334
  'okx': okx$1,
334
335
  'onetrading': onetrading$1,
336
+ 'p2b': p2b$1,
335
337
  'phemex': phemex$1,
336
338
  'poloniex': poloniex$1,
337
339
  'poloniexfutures': poloniexfutures$1,
@@ -619,7 +619,7 @@ class ascendex extends ascendex$1 {
619
619
  symbol = base + '/' + quote + ':' + settle;
620
620
  }
621
621
  const fee = this.safeNumber(market, 'commissionReserveRate');
622
- const marginTradable = this.safeValue(market, 'marginTradable', false);
622
+ const marginTradable = this.safeBool(market, 'marginTradable', false);
623
623
  result.push({
624
624
  'id': id,
625
625
  'symbol': symbol,
@@ -814,7 +814,7 @@ class ascendex extends ascendex$1 {
814
814
  let marginMode = undefined;
815
815
  [marketType, params] = this.handleMarketTypeAndParams('fetchBalance', undefined, params);
816
816
  [marginMode, params] = this.handleMarginModeAndParams('fetchBalance', params);
817
- const isMargin = this.safeValue(params, 'margin', false);
817
+ const isMargin = this.safeBool(params, 'margin', false);
818
818
  const isCross = marginMode === 'cross';
819
819
  marketType = (isMargin || isCross) ? 'margin' : marketType;
820
820
  params = this.omit(params, 'margin');
@@ -1174,7 +1174,7 @@ class ascendex extends ascendex$1 {
1174
1174
  const timestamp = this.safeInteger(trade, 'ts');
1175
1175
  const priceString = this.safeString2(trade, 'price', 'p');
1176
1176
  const amountString = this.safeString(trade, 'q');
1177
- const buyerIsMaker = this.safeValue(trade, 'bm', false);
1177
+ const buyerIsMaker = this.safeBool(trade, 'bm', false);
1178
1178
  const side = buyerIsMaker ? 'sell' : 'buy';
1179
1179
  market = this.safeMarket(undefined, market);
1180
1180
  return this.safeTrade({
@@ -1518,7 +1518,7 @@ class ascendex extends ascendex$1 {
1518
1518
  const isLimitOrder = ((type === 'limit') || (type === 'stop_limit'));
1519
1519
  const timeInForce = this.safeString(params, 'timeInForce');
1520
1520
  const postOnly = this.isPostOnly(isMarketOrder, false, params);
1521
- const reduceOnly = this.safeValue(params, 'reduceOnly', false);
1521
+ const reduceOnly = this.safeBool(params, 'reduceOnly', false);
1522
1522
  const stopPrice = this.safeValue2(params, 'triggerPrice', 'stopPrice');
1523
1523
  if (isLimitOrder) {
1524
1524
  request['orderPrice'] = this.priceToPrecision(symbol, price);
@@ -3161,7 +3161,7 @@ class ascendex extends ascendex$1 {
3161
3161
  // { "code": "0" }
3162
3162
  //
3163
3163
  const transferOptions = this.safeValue(this.options, 'transfer', {});
3164
- const fillResponseFromRequest = this.safeValue(transferOptions, 'fillResponseFromRequest', true);
3164
+ const fillResponseFromRequest = this.safeBool(transferOptions, 'fillResponseFromRequest', true);
3165
3165
  const transfer = this.parseTransfer(response, currency);
3166
3166
  if (fillResponseFromRequest) {
3167
3167
  transfer['fromAccount'] = fromAccount;
@@ -1681,7 +1681,7 @@ class Exchange {
1681
1681
  }
1682
1682
  return result;
1683
1683
  }
1684
- filterByLimit(array, limit = undefined, key = 'timestamp') {
1684
+ filterByLimit(array, limit = undefined, key = 'timestamp', fromStart = false) {
1685
1685
  if (this.valueIsDefined(limit)) {
1686
1686
  const arrayLength = array.length;
1687
1687
  if (arrayLength > 0) {
@@ -1693,7 +1693,12 @@ class Exchange {
1693
1693
  ascending = first <= last; // true if array is sorted in ascending order based on 'timestamp'
1694
1694
  }
1695
1695
  }
1696
- array = ascending ? this.arraySlice(array, -limit) : this.arraySlice(array, 0, limit);
1696
+ if (fromStart) {
1697
+ array = ascending ? this.arraySlice(array, 0, limit) : this.arraySlice(array, -limit);
1698
+ }
1699
+ else {
1700
+ array = ascending ? this.arraySlice(array, -limit) : this.arraySlice(array, 0, limit);
1701
+ }
1697
1702
  }
1698
1703
  }
1699
1704
  return array;
@@ -1715,7 +1720,10 @@ class Exchange {
1715
1720
  if (tail && limit !== undefined) {
1716
1721
  return this.arraySlice(result, -limit);
1717
1722
  }
1718
- return this.filterByLimit(result, limit, key);
1723
+ // if the user provided a 'since' argument
1724
+ // we want to limit the result starting from the 'since'
1725
+ const shouldFilterFromStart = !tail && sinceIsDefined;
1726
+ return this.filterByLimit(result, limit, key, shouldFilterFromStart);
1719
1727
  }
1720
1728
  filterByValueSinceLimit(array, field, value = undefined, since = undefined, limit = undefined, key = 'timestamp', tail = false) {
1721
1729
  const valueIsDefined = this.valueIsDefined(value);
@@ -1740,7 +1748,7 @@ class Exchange {
1740
1748
  if (tail && limit !== undefined) {
1741
1749
  return this.arraySlice(result, -limit);
1742
1750
  }
1743
- return this.filterByLimit(result, limit, key);
1751
+ return this.filterByLimit(result, limit, key, sinceIsDefined);
1744
1752
  }
1745
1753
  setSandboxMode(enabled) {
1746
1754
  if (enabled) {
@@ -1984,7 +1992,7 @@ class Exchange {
1984
1992
  fee['cost'] = this.safeNumber(fee, 'cost');
1985
1993
  }
1986
1994
  const timestamp = this.safeInteger(entry, 'timestamp');
1987
- const info = this.safeValue(entry, 'info', {});
1995
+ const info = this.safeDict(entry, 'info', {});
1988
1996
  return {
1989
1997
  'id': this.safeString(entry, 'id'),
1990
1998
  'timestamp': timestamp,
@@ -2156,7 +2164,7 @@ class Exchange {
2156
2164
  for (let i = 0; i < values.length; i++) {
2157
2165
  const market = values[i];
2158
2166
  const defaultCurrencyPrecision = (this.precisionMode === DECIMAL_PLACES) ? 8 : this.parseNumber('1e-8');
2159
- const marketPrecision = this.safeValue(market, 'precision', {});
2167
+ const marketPrecision = this.safeDict(market, 'precision', {});
2160
2168
  if ('base' in market) {
2161
2169
  const currency = this.safeCurrencyStructure({
2162
2170
  'id': this.safeString2(market, 'baseId', 'base'),
@@ -2186,7 +2194,7 @@ class Exchange {
2186
2194
  const resultingCurrencies = [];
2187
2195
  for (let i = 0; i < codes.length; i++) {
2188
2196
  const code = codes[i];
2189
- const groupedCurrenciesCode = this.safeValue(groupedCurrencies, code, []);
2197
+ const groupedCurrenciesCode = this.safeList(groupedCurrencies, code, []);
2190
2198
  let highestPrecisionCurrency = this.safeValue(groupedCurrenciesCode, 0);
2191
2199
  for (let j = 1; j < groupedCurrenciesCode.length; j++) {
2192
2200
  const currentCurrency = groupedCurrenciesCode[j];
@@ -2269,7 +2277,7 @@ class Exchange {
2269
2277
  const parseSymbol = symbol === undefined;
2270
2278
  const parseSide = side === undefined;
2271
2279
  const shouldParseFees = parseFee || parseFees;
2272
- const fees = this.safeValue(order, 'fees', []);
2280
+ const fees = this.safeList(order, 'fees', []);
2273
2281
  let trades = [];
2274
2282
  if (parseFilled || parseCost || shouldParseFees) {
2275
2283
  const rawTrades = this.safeValue(order, 'trades', trades);
@@ -2403,7 +2411,7 @@ class Exchange {
2403
2411
  }
2404
2412
  }
2405
2413
  // ensure that the average field is calculated correctly
2406
- const inverse = this.safeValue(market, 'inverse', false);
2414
+ const inverse = this.safeBool(market, 'inverse', false);
2407
2415
  const contractSize = this.numberToString(this.safeValue(market, 'contractSize', 1));
2408
2416
  // inverse
2409
2417
  // price = filled * contract size / cost
@@ -2457,12 +2465,12 @@ class Exchange {
2457
2465
  entry['amount'] = this.safeNumber(entry, 'amount');
2458
2466
  entry['price'] = this.safeNumber(entry, 'price');
2459
2467
  entry['cost'] = this.safeNumber(entry, 'cost');
2460
- const tradeFee = this.safeValue(entry, 'fee', {});
2468
+ const tradeFee = this.safeDict(entry, 'fee', {});
2461
2469
  tradeFee['cost'] = this.safeNumber(tradeFee, 'cost');
2462
2470
  if ('rate' in tradeFee) {
2463
2471
  tradeFee['rate'] = this.safeNumber(tradeFee, 'rate');
2464
2472
  }
2465
- const entryFees = this.safeValue(entry, 'fees', []);
2473
+ const entryFees = this.safeList(entry, 'fees', []);
2466
2474
  for (let j = 0; j < entryFees.length; j++) {
2467
2475
  entryFees[j]['cost'] = this.safeNumber(entryFees[j], 'cost');
2468
2476
  }
@@ -2637,7 +2645,7 @@ class Exchange {
2637
2645
  const contractSize = this.safeString(market, 'contractSize');
2638
2646
  let multiplyPrice = price;
2639
2647
  if (contractSize !== undefined) {
2640
- const inverse = this.safeValue(market, 'inverse', false);
2648
+ const inverse = this.safeBool(market, 'inverse', false);
2641
2649
  if (inverse) {
2642
2650
  multiplyPrice = Precise["default"].stringDiv('1', price);
2643
2651
  }
@@ -2880,12 +2888,12 @@ class Exchange {
2880
2888
  }
2881
2889
  convertTradingViewToOHLCV(ohlcvs, timestamp = 't', open = 'o', high = 'h', low = 'l', close = 'c', volume = 'v', ms = false) {
2882
2890
  const result = [];
2883
- const timestamps = this.safeValue(ohlcvs, timestamp, []);
2884
- const opens = this.safeValue(ohlcvs, open, []);
2885
- const highs = this.safeValue(ohlcvs, high, []);
2886
- const lows = this.safeValue(ohlcvs, low, []);
2887
- const closes = this.safeValue(ohlcvs, close, []);
2888
- const volumes = this.safeValue(ohlcvs, volume, []);
2891
+ const timestamps = this.safeList(ohlcvs, timestamp, []);
2892
+ const opens = this.safeList(ohlcvs, open, []);
2893
+ const highs = this.safeList(ohlcvs, high, []);
2894
+ const lows = this.safeList(ohlcvs, low, []);
2895
+ const closes = this.safeList(ohlcvs, close, []);
2896
+ const volumes = this.safeList(ohlcvs, volume, []);
2889
2897
  for (let i = 0; i < timestamps.length; i++) {
2890
2898
  result.push([
2891
2899
  ms ? this.safeInteger(timestamps, i) : this.safeTimestamp(timestamps, i),
@@ -2920,10 +2928,10 @@ class Exchange {
2920
2928
  async fetchWebEndpoint(method, endpointMethod, returnAsJson, startRegex = undefined, endRegex = undefined) {
2921
2929
  let errorMessage = '';
2922
2930
  const options = this.safeValue(this.options, method, {});
2923
- const muteOnFailure = this.safeValue(options, 'webApiMuteFailure', true);
2931
+ const muteOnFailure = this.safeBool(options, 'webApiMuteFailure', true);
2924
2932
  try {
2925
2933
  // if it was not explicitly disabled, then don't fetch
2926
- if (this.safeValue(options, 'webApiEnable', true) !== true) {
2934
+ if (this.safeBool(options, 'webApiEnable', true) !== true) {
2927
2935
  return undefined;
2928
2936
  }
2929
2937
  const maxRetries = this.safeValue(options, 'webApiRetries', 10);
@@ -3134,7 +3142,7 @@ class Exchange {
3134
3142
  if (currencyCode !== undefined) {
3135
3143
  const defaultNetworkCodeReplacements = this.safeValue(this.options, 'defaultNetworkCodeReplacements', {});
3136
3144
  if (currencyCode in defaultNetworkCodeReplacements) {
3137
- const replacementObject = this.safeValue(defaultNetworkCodeReplacements, currencyCode, {});
3145
+ const replacementObject = this.safeDict(defaultNetworkCodeReplacements, currencyCode, {});
3138
3146
  networkCode = this.safeString(replacementObject, networkCode, networkCode);
3139
3147
  }
3140
3148
  }
@@ -3236,7 +3244,7 @@ class Exchange {
3236
3244
  const id = this.safeString(item, marketIdKey);
3237
3245
  const market = this.safeMarket(id, undefined, undefined, 'swap');
3238
3246
  const symbol = market['symbol'];
3239
- const contract = this.safeValue(market, 'contract', false);
3247
+ const contract = this.safeBool(market, 'contract', false);
3240
3248
  if (contract && ((symbols === undefined) || this.inArray(symbol, symbols))) {
3241
3249
  tiers[symbol] = this.parseMarketLeverageTiers(item, market);
3242
3250
  }
@@ -4407,8 +4415,8 @@ class Exchange {
4407
4415
  const currency = this.currencies[code];
4408
4416
  let precision = this.safeValue(currency, 'precision');
4409
4417
  if (networkCode !== undefined) {
4410
- const networks = this.safeValue(currency, 'networks', {});
4411
- const networkItem = this.safeValue(networks, networkCode, {});
4418
+ const networks = this.safeDict(currency, 'networks', {});
4419
+ const networkItem = this.safeDict(networks, networkCode, {});
4412
4420
  precision = this.safeValue(networkItem, 'precision', precision);
4413
4421
  }
4414
4422
  if (precision === undefined) {
@@ -4710,7 +4718,7 @@ class Exchange {
4710
4718
  * @returns {Array}
4711
4719
  */
4712
4720
  const timeInForce = this.safeStringUpper(params, 'timeInForce');
4713
- let postOnly = this.safeValue(params, 'postOnly', false);
4721
+ let postOnly = this.safeBool(params, 'postOnly', false);
4714
4722
  const ioc = timeInForce === 'IOC';
4715
4723
  const fok = timeInForce === 'FOK';
4716
4724
  const po = timeInForce === 'PO';
@@ -88,7 +88,7 @@ class BadRequest extends ExchangeError {
88
88
  this.name = 'BadRequest';
89
89
  }
90
90
  }
91
- class OperationRejected extends BadRequest {
91
+ class OperationRejected extends ExchangeError {
92
92
  constructor(message) {
93
93
  super(message);
94
94
  this.name = 'OperationRejected';
@@ -100,7 +100,7 @@ class BadSymbol extends BadRequest {
100
100
  this.name = 'BadSymbol';
101
101
  }
102
102
  }
103
- class NoChange extends BadRequest {
103
+ class NoChange extends OperationRejected {
104
104
  constructor(message) {
105
105
  super(message);
106
106
  this.name = 'NoChange';
@@ -221,7 +221,7 @@ class DDoSProtection extends NetworkError {
221
221
  this.name = 'DDoSProtection';
222
222
  }
223
223
  }
224
- class RateLimitExceeded extends DDoSProtection {
224
+ class RateLimitExceeded extends NetworkError {
225
225
  constructor(message) {
226
226
  super(message);
227
227
  this.name = 'RateLimitExceeded';
@@ -96,6 +96,9 @@ const safeFloatN = (o, k, $default) => {
96
96
  return isNumber(n) ? n : $default;
97
97
  };
98
98
  const safeIntegerN = (o, k, $default) => {
99
+ if (o === undefined) {
100
+ return $default;
101
+ }
99
102
  const n = asInteger(getValueFromKeysInArray(o, k));
100
103
  return isNumber(n) ? n : $default;
101
104
  };
@@ -108,14 +111,23 @@ const safeTimestampN = (o, k, $default) => {
108
111
  return isNumber(n) ? parseInt(n * 1000) : $default;
109
112
  };
110
113
  const safeValueN = (o, k, $default) => {
114
+ if (o === undefined) {
115
+ return $default;
116
+ }
111
117
  const x = getValueFromKeysInArray(o, k);
112
118
  return hasProps(x) ? x : $default;
113
119
  };
114
120
  const safeStringN = (o, k, $default) => {
121
+ if (o === undefined) {
122
+ return $default;
123
+ }
115
124
  const x = getValueFromKeysInArray(o, k);
116
125
  return isStringCoercible(x) ? String(x) : $default;
117
126
  };
118
127
  const safeStringLowerN = (o, k, $default) => {
128
+ if (o === undefined) {
129
+ return $default;
130
+ }
119
131
  const x = getValueFromKeysInArray(o, k);
120
132
  return isStringCoercible(x) ? String(x).toLowerCase() : $default;
121
133
  };
@@ -1469,7 +1469,7 @@ class bigone extends bigone$1 {
1469
1469
  const requestSide = isBuy ? 'BID' : 'ASK';
1470
1470
  let uppercaseType = type.toUpperCase();
1471
1471
  const isLimit = uppercaseType === 'LIMIT';
1472
- const exchangeSpecificParam = this.safeValue(params, 'post_only', false);
1472
+ const exchangeSpecificParam = this.safeBool(params, 'post_only', false);
1473
1473
  let postOnly = undefined;
1474
1474
  [postOnly, params] = this.handlePostOnly((uppercaseType === 'MARKET'), exchangeSpecificParam, params);
1475
1475
  const triggerPrice = this.safeStringN(params, ['triggerPrice', 'stopPrice', 'stop_price']);
@@ -2101,7 +2101,7 @@ class bigone extends bigone$1 {
2101
2101
  //
2102
2102
  const transfer = this.parseTransfer(response, currency);
2103
2103
  const transferOptions = this.safeValue(this.options, 'transfer', {});
2104
- const fillResponseFromRequest = this.safeValue(transferOptions, 'fillResponseFromRequest', true);
2104
+ const fillResponseFromRequest = this.safeBool(transferOptions, 'fillResponseFromRequest', true);
2105
2105
  if (fillResponseFromRequest) {
2106
2106
  transfer['fromAccount'] = fromAccount;
2107
2107
  transfer['toAccount'] = toAccount;