ccxt 4.2.29__py2.py3-none-any.whl → 4.2.31__py2.py3-none-any.whl

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 (133) hide show
  1. ccxt/__init__.py +3 -3
  2. ccxt/abstract/bybit.py +2 -2
  3. ccxt/abstract/coinbase.py +10 -0
  4. ccxt/abstract/okx.py +12 -1
  5. ccxt/ascendex.py +5 -5
  6. ccxt/async_support/__init__.py +3 -3
  7. ccxt/async_support/ascendex.py +5 -5
  8. ccxt/async_support/base/exchange.py +3 -3
  9. ccxt/async_support/bigone.py +2 -2
  10. ccxt/async_support/binance.py +892 -218
  11. ccxt/async_support/bingx.py +1 -1
  12. ccxt/async_support/bitfinex.py +1 -1
  13. ccxt/async_support/bitfinex2.py +421 -86
  14. ccxt/async_support/bitforex.py +3 -0
  15. ccxt/async_support/bitget.py +8 -4
  16. ccxt/async_support/bitmart.py +3 -3
  17. ccxt/async_support/bitmex.py +4 -4
  18. ccxt/async_support/bitrue.py +1 -1
  19. ccxt/async_support/bitso.py +1 -1
  20. ccxt/async_support/bitteam.py +2 -2
  21. ccxt/async_support/btcalpha.py +1 -1
  22. ccxt/async_support/bybit.py +3 -3
  23. ccxt/async_support/coinbase.py +20 -5
  24. ccxt/async_support/coincheck.py +1 -1
  25. ccxt/async_support/coinex.py +2 -2
  26. ccxt/async_support/coinlist.py +1 -1
  27. ccxt/async_support/coinmate.py +1 -1
  28. ccxt/async_support/coinmetro.py +2 -2
  29. ccxt/async_support/coinsph.py +1 -1
  30. ccxt/async_support/cryptocom.py +3 -3
  31. ccxt/async_support/deribit.py +1 -0
  32. ccxt/async_support/digifinex.py +6 -4
  33. ccxt/async_support/exmo.py +2 -2
  34. ccxt/async_support/gate.py +5 -5
  35. ccxt/async_support/gemini.py +3 -3
  36. ccxt/async_support/hitbtc.py +13 -17
  37. ccxt/async_support/hollaex.py +2 -2
  38. ccxt/async_support/htx.py +6 -6
  39. ccxt/async_support/huobijp.py +1 -1
  40. ccxt/async_support/kraken.py +3 -1
  41. ccxt/async_support/krakenfutures.py +4 -1
  42. ccxt/async_support/kucoin.py +17 -17
  43. ccxt/async_support/kucoinfutures.py +3 -3
  44. ccxt/async_support/lbank.py +4 -3
  45. ccxt/async_support/mexc.py +7 -7
  46. ccxt/async_support/novadax.py +1 -1
  47. ccxt/async_support/okcoin.py +2 -2
  48. ccxt/async_support/okx.py +22 -8
  49. ccxt/async_support/p2b.py +1 -0
  50. ccxt/async_support/phemex.py +3 -3
  51. ccxt/async_support/poloniexfutures.py +6 -3
  52. ccxt/async_support/probit.py +1 -1
  53. ccxt/async_support/timex.py +2 -2
  54. ccxt/async_support/tokocrypto.py +3 -3
  55. ccxt/async_support/wavesexchange.py +2 -2
  56. ccxt/async_support/whitebit.py +3 -3
  57. ccxt/async_support/woo.py +3 -3
  58. ccxt/async_support/yobit.py +1 -1
  59. ccxt/async_support/zaif.py +1 -1
  60. ccxt/async_support/zonda.py +3 -3
  61. ccxt/base/errors.py +13 -12
  62. ccxt/base/exchange.py +36 -26
  63. ccxt/bigone.py +2 -2
  64. ccxt/binance.py +892 -218
  65. ccxt/bingx.py +1 -1
  66. ccxt/bitfinex.py +1 -1
  67. ccxt/bitfinex2.py +421 -86
  68. ccxt/bitforex.py +3 -0
  69. ccxt/bitget.py +8 -4
  70. ccxt/bitmart.py +3 -3
  71. ccxt/bitmex.py +4 -4
  72. ccxt/bitrue.py +1 -1
  73. ccxt/bitso.py +1 -1
  74. ccxt/bitteam.py +2 -2
  75. ccxt/btcalpha.py +1 -1
  76. ccxt/bybit.py +3 -3
  77. ccxt/coinbase.py +20 -5
  78. ccxt/coincheck.py +1 -1
  79. ccxt/coinex.py +2 -2
  80. ccxt/coinlist.py +1 -1
  81. ccxt/coinmate.py +1 -1
  82. ccxt/coinmetro.py +2 -2
  83. ccxt/coinsph.py +1 -1
  84. ccxt/cryptocom.py +3 -3
  85. ccxt/deribit.py +1 -0
  86. ccxt/digifinex.py +6 -4
  87. ccxt/exmo.py +2 -2
  88. ccxt/gate.py +5 -5
  89. ccxt/gemini.py +3 -3
  90. ccxt/hitbtc.py +13 -17
  91. ccxt/hollaex.py +2 -2
  92. ccxt/htx.py +6 -6
  93. ccxt/huobijp.py +1 -1
  94. ccxt/kraken.py +3 -1
  95. ccxt/krakenfutures.py +4 -1
  96. ccxt/kucoin.py +17 -17
  97. ccxt/kucoinfutures.py +3 -3
  98. ccxt/lbank.py +4 -3
  99. ccxt/mexc.py +7 -7
  100. ccxt/novadax.py +1 -1
  101. ccxt/okcoin.py +2 -2
  102. ccxt/okx.py +22 -8
  103. ccxt/p2b.py +1 -0
  104. ccxt/phemex.py +3 -3
  105. ccxt/poloniexfutures.py +6 -3
  106. ccxt/pro/__init__.py +3 -1
  107. ccxt/pro/alpaca.py +1 -1
  108. ccxt/pro/binance.py +4 -4
  109. ccxt/pro/bitget.py +1 -1
  110. ccxt/pro/bitmart.py +1 -1
  111. ccxt/pro/bitmex.py +43 -7
  112. ccxt/pro/bitvavo.py +1 -1
  113. ccxt/pro/bybit.py +2 -2
  114. ccxt/pro/cex.py +2 -2
  115. ccxt/pro/independentreserve.py +1 -1
  116. ccxt/pro/okx.py +1 -1
  117. ccxt/pro/onetrading.py +2 -2
  118. ccxt/pro/p2b.py +407 -0
  119. ccxt/pro/probit.py +5 -5
  120. ccxt/pro/whitebit.py +1 -1
  121. ccxt/probit.py +1 -1
  122. ccxt/timex.py +2 -2
  123. ccxt/tokocrypto.py +3 -3
  124. ccxt/wavesexchange.py +2 -2
  125. ccxt/whitebit.py +3 -3
  126. ccxt/woo.py +3 -3
  127. ccxt/yobit.py +1 -1
  128. ccxt/zaif.py +1 -1
  129. ccxt/zonda.py +3 -3
  130. {ccxt-4.2.29.dist-info → ccxt-4.2.31.dist-info}/METADATA +6 -7
  131. {ccxt-4.2.29.dist-info → ccxt-4.2.31.dist-info}/RECORD +133 -132
  132. {ccxt-4.2.29.dist-info → ccxt-4.2.31.dist-info}/WHEEL +0 -0
  133. {ccxt-4.2.29.dist-info → ccxt-4.2.31.dist-info}/top_level.txt +0 -0
ccxt/async_support/woo.py CHANGED
@@ -1065,7 +1065,7 @@ class woo(Exchange, ImplicitAPI):
1065
1065
  :param boolean [params.stop]: whether the order is a stop/algo order
1066
1066
  :returns dict: An `order structure <https://docs.ccxt.com/#/?id=order-structure>`
1067
1067
  """
1068
- stop = self.safe_value(params, 'stop', False)
1068
+ stop = self.safe_bool(params, 'stop', False)
1069
1069
  params = self.omit(params, 'stop')
1070
1070
  if not stop and (symbol is None):
1071
1071
  raise ArgumentsRequired(self.id + ' cancelOrder() requires a symbol argument')
@@ -1214,7 +1214,7 @@ class woo(Exchange, ImplicitAPI):
1214
1214
  request = {}
1215
1215
  market: Market = None
1216
1216
  stop = self.safe_value(params, 'stop')
1217
- trailing = self.safe_value(params, 'trailing', False)
1217
+ trailing = self.safe_bool(params, 'trailing', False)
1218
1218
  params = self.omit(params, ['stop', 'trailing'])
1219
1219
  if symbol is not None:
1220
1220
  market = self.market(symbol)
@@ -1947,7 +1947,7 @@ class woo(Exchange, ImplicitAPI):
1947
1947
  #
1948
1948
  transfer = self.parse_transfer(response, currency)
1949
1949
  transferOptions = self.safe_value(self.options, 'transfer', {})
1950
- fillResponseFromRequest = self.safe_value(transferOptions, 'fillResponseFromRequest', True)
1950
+ fillResponseFromRequest = self.safe_bool(transferOptions, 'fillResponseFromRequest', True)
1951
1951
  if fillResponseFromRequest:
1952
1952
  transfer['amount'] = amount
1953
1953
  transfer['fromAccount'] = fromAccount
@@ -1224,7 +1224,7 @@ class yobit(Exchange, ImplicitAPI):
1224
1224
  #
1225
1225
  # To cover points 1, 2, 3 and 4 combined self handler should work like self:
1226
1226
  #
1227
- success = self.safe_value(response, 'success', False)
1227
+ success = self.safe_bool(response, 'success', False)
1228
1228
  if isinstance(success, str):
1229
1229
  if (success == 'true') or (success == '1'):
1230
1230
  success = True
@@ -691,7 +691,7 @@ class zaif(Exchange, ImplicitAPI):
691
691
  self.throw_exactly_matched_exception(self.exceptions['exact'], error, feedback)
692
692
  self.throw_broadly_matched_exception(self.exceptions['broad'], error, feedback)
693
693
  raise ExchangeError(feedback) # unknown message
694
- success = self.safe_value(response, 'success', True)
694
+ success = self.safe_bool(response, 'success', True)
695
695
  if not success:
696
696
  raise ExchangeError(feedback)
697
697
  return None
@@ -1399,7 +1399,7 @@ class zonda(Exchange, ImplicitAPI):
1399
1399
  # }
1400
1400
  #
1401
1401
  id = self.safe_string_2(response, 'offerId', 'stopOfferId')
1402
- completed = self.safe_value(response, 'completed', False)
1402
+ completed = self.safe_bool(response, 'completed', False)
1403
1403
  status = 'closed' if completed else 'open'
1404
1404
  transactions = self.safe_value(response, 'transactions')
1405
1405
  return self.safe_order({
@@ -1457,7 +1457,7 @@ class zonda(Exchange, ImplicitAPI):
1457
1457
  'EUR': True,
1458
1458
  'PLN': True,
1459
1459
  }
1460
- return self.safe_value(fiatCurrencies, currency, False)
1460
+ return self.safe_bool(fiatCurrencies, currency, False)
1461
1461
 
1462
1462
  def parse_deposit_address(self, depositAddress, currency: Currency = None):
1463
1463
  #
@@ -1588,7 +1588,7 @@ class zonda(Exchange, ImplicitAPI):
1588
1588
  #
1589
1589
  transfer = self.parse_transfer(response, currency)
1590
1590
  transferOptions = self.safe_value(self.options, 'transfer', {})
1591
- fillResponseFromRequest = self.safe_value(transferOptions, 'fillResponseFromRequest', True)
1591
+ fillResponseFromRequest = self.safe_bool(transferOptions, 'fillResponseFromRequest', True)
1592
1592
  if fillResponseFromRequest:
1593
1593
  transfer['amount'] = amount
1594
1594
  return transfer
ccxt/base/errors.py CHANGED
@@ -10,9 +10,11 @@ error_hierarchy = {
10
10
  'ArgumentsRequired': {},
11
11
  'BadRequest': {
12
12
  'BadSymbol': {},
13
- 'MarginModeAlreadySet': {},
14
- 'NoChange': {},
15
- 'OperationRejected': {},
13
+ },
14
+ 'OperationRejected': {
15
+ 'NoChange': {
16
+ 'MarginModeAlreadySet': {},
17
+ },
16
18
  },
17
19
  'BadResponse': {
18
20
  'NullResponse': {},
@@ -35,9 +37,8 @@ error_hierarchy = {
35
37
  },
36
38
  'OperationFailed': {
37
39
  'NetworkError': {
38
- 'DDoSProtection': {
39
- 'RateLimitExceeded': {},
40
- },
40
+ 'DDoSProtection': {},
41
+ 'RateLimitExceeded': {},
41
42
  'ExchangeNotAvailable': {
42
43
  'OnMaintenance': {},
43
44
  },
@@ -86,15 +87,15 @@ class BadSymbol(BadRequest):
86
87
  pass
87
88
 
88
89
 
89
- class MarginModeAlreadySet(BadRequest):
90
+ class OperationRejected(ExchangeError):
90
91
  pass
91
92
 
92
93
 
93
- class NoChange(BadRequest):
94
+ class NoChange(OperationRejected):
94
95
  pass
95
96
 
96
97
 
97
- class OperationRejected(BadRequest):
98
+ class MarginModeAlreadySet(NoChange):
98
99
  pass
99
100
 
100
101
 
@@ -170,7 +171,7 @@ class DDoSProtection(NetworkError):
170
171
  pass
171
172
 
172
173
 
173
- class RateLimitExceeded(DDoSProtection):
174
+ class RateLimitExceeded(NetworkError):
174
175
  pass
175
176
 
176
177
 
@@ -205,9 +206,9 @@ __all__ = [
205
206
  'ArgumentsRequired',
206
207
  'BadRequest',
207
208
  'BadSymbol',
208
- 'MarginModeAlreadySet',
209
- 'NoChange',
210
209
  'OperationRejected',
210
+ 'NoChange',
211
+ 'MarginModeAlreadySet',
211
212
  'BadResponse',
212
213
  'NullResponse',
213
214
  'InsufficientFunds',
ccxt/base/exchange.py CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  # -----------------------------------------------------------------------------
6
6
 
7
- __version__ = '4.2.29'
7
+ __version__ = '4.2.31'
8
8
 
9
9
  # -----------------------------------------------------------------------------
10
10
 
@@ -851,6 +851,8 @@ class Exchange(object):
851
851
 
852
852
  @staticmethod
853
853
  def safe_integer_product_n(dictionary, key_list, factor, default_value=None):
854
+ if dictionary is None:
855
+ return default_value
854
856
  value = Exchange.get_object_value_from_key_list(dictionary, key_list)
855
857
  if value is None:
856
858
  return default_value
@@ -869,6 +871,8 @@ class Exchange(object):
869
871
 
870
872
  @staticmethod
871
873
  def safe_value_n(dictionary, key_list, default_value=None):
874
+ if dictionary is None:
875
+ return default_value
872
876
  value = Exchange.get_object_value_from_key_list(dictionary, key_list)
873
877
  return value if value is not None else default_value
874
878
 
@@ -1965,7 +1969,7 @@ class Exchange(object):
1965
1969
  result.append(messageHash)
1966
1970
  return result
1967
1971
 
1968
- def filter_by_limit(self, array: List[object], limit: Int = None, key: IndexType = 'timestamp'):
1972
+ def filter_by_limit(self, array: List[object], limit: Int = None, key: IndexType = 'timestamp', fromStart: bool = False):
1969
1973
  if self.valueIsDefined(limit):
1970
1974
  arrayLength = len(array)
1971
1975
  if arrayLength > 0:
@@ -1975,7 +1979,10 @@ class Exchange(object):
1975
1979
  last = array[arrayLength - 1][key]
1976
1980
  if first is not None and last is not None:
1977
1981
  ascending = first <= last # True if array is sorted in ascending order based on 'timestamp'
1978
- array = self.arraySlice(array, -limit) if ascending else self.arraySlice(array, 0, limit)
1982
+ if fromStart:
1983
+ array = self.arraySlice(array, 0, limit) if ascending else self.arraySlice(array, -limit)
1984
+ else:
1985
+ array = self.arraySlice(array, -limit) if ascending else self.arraySlice(array, 0, limit)
1979
1986
  return array
1980
1987
 
1981
1988
  def filter_by_since_limit(self, array: List[object], since: Int = None, limit: Int = None, key: IndexType = 'timestamp', tail=False):
@@ -1991,7 +1998,10 @@ class Exchange(object):
1991
1998
  result.append(entry)
1992
1999
  if tail and limit is not None:
1993
2000
  return self.arraySlice(result, -limit)
1994
- return self.filter_by_limit(result, limit, key)
2001
+ # if the user provided a 'since' argument
2002
+ # we want to limit the result starting from the 'since'
2003
+ shouldFilterFromStart = not tail and sinceIsDefined
2004
+ return self.filter_by_limit(result, limit, key, shouldFilterFromStart)
1995
2005
 
1996
2006
  def filter_by_value_since_limit(self, array: List[object], field: IndexType, value=None, since: Int = None, limit: Int = None, key='timestamp', tail=False):
1997
2007
  valueIsDefined = self.valueIsDefined(value)
@@ -2012,7 +2022,7 @@ class Exchange(object):
2012
2022
  result.append(entry)
2013
2023
  if tail and limit is not None:
2014
2024
  return self.arraySlice(result, -limit)
2015
- return self.filter_by_limit(result, limit, key)
2025
+ return self.filter_by_limit(result, limit, key, sinceIsDefined)
2016
2026
 
2017
2027
  def set_sandbox_mode(self, enabled):
2018
2028
  if enabled:
@@ -2234,7 +2244,7 @@ class Exchange(object):
2234
2244
  if fee is not None:
2235
2245
  fee['cost'] = self.safe_number(fee, 'cost')
2236
2246
  timestamp = self.safe_integer(entry, 'timestamp')
2237
- info = self.safe_value(entry, 'info', {})
2247
+ info = self.safe_dict(entry, 'info', {})
2238
2248
  return {
2239
2249
  'id': self.safe_string(entry, 'id'),
2240
2250
  'timestamp': timestamp,
@@ -2392,7 +2402,7 @@ class Exchange(object):
2392
2402
  for i in range(0, len(values)):
2393
2403
  market = values[i]
2394
2404
  defaultCurrencyPrecision = 8 if (self.precisionMode == DECIMAL_PLACES) else self.parse_number('1e-8')
2395
- marketPrecision = self.safe_value(market, 'precision', {})
2405
+ marketPrecision = self.safe_dict(market, 'precision', {})
2396
2406
  if 'base' in market:
2397
2407
  currency = self.safe_currency_structure({
2398
2408
  'id': self.safe_string_2(market, 'baseId', 'base'),
@@ -2419,7 +2429,7 @@ class Exchange(object):
2419
2429
  resultingCurrencies = []
2420
2430
  for i in range(0, len(codes)):
2421
2431
  code = codes[i]
2422
- groupedCurrenciesCode = self.safe_value(groupedCurrencies, code, [])
2432
+ groupedCurrenciesCode = self.safe_list(groupedCurrencies, code, [])
2423
2433
  highestPrecisionCurrency = self.safe_value(groupedCurrenciesCode, 0)
2424
2434
  for j in range(1, len(groupedCurrenciesCode)):
2425
2435
  currentCurrency = groupedCurrenciesCode[j]
@@ -2491,7 +2501,7 @@ class Exchange(object):
2491
2501
  parseSymbol = symbol is None
2492
2502
  parseSide = side is None
2493
2503
  shouldParseFees = parseFee or parseFees
2494
- fees = self.safe_value(order, 'fees', [])
2504
+ fees = self.safe_list(order, 'fees', [])
2495
2505
  trades = []
2496
2506
  if parseFilled or parseCost or shouldParseFees:
2497
2507
  rawTrades = self.safe_value(order, 'trades', trades)
@@ -2586,7 +2596,7 @@ class Exchange(object):
2586
2596
  elif status == 'closed':
2587
2597
  remaining = '0'
2588
2598
  # ensure that the average field is calculated correctly
2589
- inverse = self.safe_value(market, 'inverse', False)
2599
+ inverse = self.safe_bool(market, 'inverse', False)
2590
2600
  contractSize = self.number_to_string(self.safe_value(market, 'contractSize', 1))
2591
2601
  # inverse
2592
2602
  # price = filled * contract size / cost
@@ -2630,11 +2640,11 @@ class Exchange(object):
2630
2640
  entry['amount'] = self.safe_number(entry, 'amount')
2631
2641
  entry['price'] = self.safe_number(entry, 'price')
2632
2642
  entry['cost'] = self.safe_number(entry, 'cost')
2633
- tradeFee = self.safe_value(entry, 'fee', {})
2643
+ tradeFee = self.safe_dict(entry, 'fee', {})
2634
2644
  tradeFee['cost'] = self.safe_number(tradeFee, 'cost')
2635
2645
  if 'rate' in tradeFee:
2636
2646
  tradeFee['rate'] = self.safe_number(tradeFee, 'rate')
2637
- entryFees = self.safe_value(entry, 'fees', [])
2647
+ entryFees = self.safe_list(entry, 'fees', [])
2638
2648
  for j in range(0, len(entryFees)):
2639
2649
  entryFees[j]['cost'] = self.safe_number(entryFees[j], 'cost')
2640
2650
  entry['fees'] = entryFees
@@ -2788,7 +2798,7 @@ class Exchange(object):
2788
2798
  contractSize = self.safe_string(market, 'contractSize')
2789
2799
  multiplyPrice = price
2790
2800
  if contractSize is not None:
2791
- inverse = self.safe_value(market, 'inverse', False)
2801
+ inverse = self.safe_bool(market, 'inverse', False)
2792
2802
  if inverse:
2793
2803
  multiplyPrice = Precise.string_div('1', price)
2794
2804
  multiplyPrice = Precise.string_mul(multiplyPrice, contractSize)
@@ -2998,12 +3008,12 @@ class Exchange(object):
2998
3008
 
2999
3009
  def convert_trading_view_to_ohlcv(self, ohlcvs, timestamp='t', open='o', high='h', low='l', close='c', volume='v', ms=False):
3000
3010
  result = []
3001
- timestamps = self.safe_value(ohlcvs, timestamp, [])
3002
- opens = self.safe_value(ohlcvs, open, [])
3003
- highs = self.safe_value(ohlcvs, high, [])
3004
- lows = self.safe_value(ohlcvs, low, [])
3005
- closes = self.safe_value(ohlcvs, close, [])
3006
- volumes = self.safe_value(ohlcvs, volume, [])
3011
+ timestamps = self.safe_list(ohlcvs, timestamp, [])
3012
+ opens = self.safe_list(ohlcvs, open, [])
3013
+ highs = self.safe_list(ohlcvs, high, [])
3014
+ lows = self.safe_list(ohlcvs, low, [])
3015
+ closes = self.safe_list(ohlcvs, close, [])
3016
+ volumes = self.safe_list(ohlcvs, volume, [])
3007
3017
  for i in range(0, len(timestamps)):
3008
3018
  result.append([
3009
3019
  self.safe_integer(timestamps, i) if ms else self.safe_timestamp(timestamps, i),
@@ -3036,10 +3046,10 @@ class Exchange(object):
3036
3046
  def fetch_web_endpoint(self, method, endpointMethod, returnAsJson, startRegex=None, endRegex=None):
3037
3047
  errorMessage = ''
3038
3048
  options = self.safe_value(self.options, method, {})
3039
- muteOnFailure = self.safe_value(options, 'webApiMuteFailure', True)
3049
+ muteOnFailure = self.safe_bool(options, 'webApiMuteFailure', True)
3040
3050
  try:
3041
3051
  # if it was not explicitly disabled, then don't fetch
3042
- if self.safe_value(options, 'webApiEnable', True) is not True:
3052
+ if self.safe_bool(options, 'webApiEnable', True) is not True:
3043
3053
  return None
3044
3054
  maxRetries = self.safe_value(options, 'webApiRetries', 10)
3045
3055
  response = None
@@ -3204,7 +3214,7 @@ class Exchange(object):
3204
3214
  if currencyCode is not None:
3205
3215
  defaultNetworkCodeReplacements = self.safe_value(self.options, 'defaultNetworkCodeReplacements', {})
3206
3216
  if currencyCode in defaultNetworkCodeReplacements:
3207
- replacementObject = self.safe_value(defaultNetworkCodeReplacements, currencyCode, {})
3217
+ replacementObject = self.safe_dict(defaultNetworkCodeReplacements, currencyCode, {})
3208
3218
  networkCode = self.safe_string(replacementObject, networkCode, networkCode)
3209
3219
  return networkCode
3210
3220
 
@@ -3291,7 +3301,7 @@ class Exchange(object):
3291
3301
  id = self.safe_string(item, marketIdKey)
3292
3302
  market = self.safe_market(id, None, None, 'swap')
3293
3303
  symbol = market['symbol']
3294
- contract = self.safe_value(market, 'contract', False)
3304
+ contract = self.safe_bool(market, 'contract', False)
3295
3305
  if contract and ((symbols is None) or self.in_array(symbol, symbols)):
3296
3306
  tiers[symbol] = self.parse_market_leverage_tiers(item, market)
3297
3307
  return tiers
@@ -4297,8 +4307,8 @@ class Exchange(object):
4297
4307
  currency = self.currencies[code]
4298
4308
  precision = self.safe_value(currency, 'precision')
4299
4309
  if networkCode is not None:
4300
- networks = self.safe_value(currency, 'networks', {})
4301
- networkItem = self.safe_value(networks, networkCode, {})
4310
+ networks = self.safe_dict(currency, 'networks', {})
4311
+ networkItem = self.safe_dict(networks, networkCode, {})
4302
4312
  precision = self.safe_value(networkItem, 'precision', precision)
4303
4313
  if precision is None:
4304
4314
  return self.forceString(fee)
@@ -4561,7 +4571,7 @@ class Exchange(object):
4561
4571
  :returns Array:
4562
4572
  """
4563
4573
  timeInForce = self.safe_string_upper(params, 'timeInForce')
4564
- postOnly = self.safe_value(params, 'postOnly', False)
4574
+ postOnly = self.safe_bool(params, 'postOnly', False)
4565
4575
  ioc = timeInForce == 'IOC'
4566
4576
  fok = timeInForce == 'FOK'
4567
4577
  po = timeInForce == 'PO'
ccxt/bigone.py CHANGED
@@ -1406,7 +1406,7 @@ class bigone(Exchange, ImplicitAPI):
1406
1406
  requestSide = 'BID' if isBuy else 'ASK'
1407
1407
  uppercaseType = type.upper()
1408
1408
  isLimit = uppercaseType == 'LIMIT'
1409
- exchangeSpecificParam = self.safe_value(params, 'post_only', False)
1409
+ exchangeSpecificParam = self.safe_bool(params, 'post_only', False)
1410
1410
  postOnly = None
1411
1411
  postOnly, params = self.handle_post_only((uppercaseType == 'MARKET'), exchangeSpecificParam, params)
1412
1412
  triggerPrice = self.safe_string_n(params, ['triggerPrice', 'stopPrice', 'stop_price'])
@@ -1987,7 +1987,7 @@ class bigone(Exchange, ImplicitAPI):
1987
1987
  #
1988
1988
  transfer = self.parse_transfer(response, currency)
1989
1989
  transferOptions = self.safe_value(self.options, 'transfer', {})
1990
- fillResponseFromRequest = self.safe_value(transferOptions, 'fillResponseFromRequest', True)
1990
+ fillResponseFromRequest = self.safe_bool(transferOptions, 'fillResponseFromRequest', True)
1991
1991
  if fillResponseFromRequest:
1992
1992
  transfer['fromAccount'] = fromAccount
1993
1993
  transfer['toAccount'] = toAccount