ccxt 4.2.84__py2.py3-none-any.whl → 4.2.85__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 (150) hide show
  1. ccxt/__init__.py +1 -1
  2. ccxt/ace.py +5 -5
  3. ccxt/ascendex.py +8 -8
  4. ccxt/async_support/__init__.py +1 -1
  5. ccxt/async_support/ace.py +5 -5
  6. ccxt/async_support/ascendex.py +8 -8
  7. ccxt/async_support/base/exchange.py +3 -27
  8. ccxt/async_support/bigone.py +12 -12
  9. ccxt/async_support/binance.py +20 -32
  10. ccxt/async_support/bingx.py +12 -9
  11. ccxt/async_support/bit2c.py +1 -1
  12. ccxt/async_support/bitbank.py +8 -8
  13. ccxt/async_support/bitbns.py +5 -5
  14. ccxt/async_support/bitfinex.py +1 -1
  15. ccxt/async_support/bitfinex2.py +1 -1
  16. ccxt/async_support/bitget.py +29 -24
  17. ccxt/async_support/bithumb.py +5 -5
  18. ccxt/async_support/bitmart.py +16 -16
  19. ccxt/async_support/bitopro.py +1 -1
  20. ccxt/async_support/bitrue.py +4 -4
  21. ccxt/async_support/bitso.py +5 -5
  22. ccxt/async_support/bitstamp.py +1 -1
  23. ccxt/async_support/bitteam.py +8 -8
  24. ccxt/async_support/bl3p.py +1 -1
  25. ccxt/async_support/btcturk.py +6 -6
  26. ccxt/async_support/bybit.py +30 -83
  27. ccxt/async_support/coincheck.py +4 -4
  28. ccxt/async_support/coinex.py +11 -11
  29. ccxt/async_support/coinlist.py +7 -7
  30. ccxt/async_support/coinmate.py +4 -4
  31. ccxt/async_support/coinmetro.py +3 -3
  32. ccxt/async_support/coinone.py +5 -5
  33. ccxt/async_support/coinspot.py +2 -2
  34. ccxt/async_support/cryptocom.py +17 -17
  35. ccxt/async_support/currencycom.py +1 -1
  36. ccxt/async_support/delta.py +0 -8
  37. ccxt/async_support/deribit.py +16 -80
  38. ccxt/async_support/digifinex.py +8 -8
  39. ccxt/async_support/exmo.py +8 -8
  40. ccxt/async_support/gate.py +0 -8
  41. ccxt/async_support/hitbtc.py +5 -4
  42. ccxt/async_support/hollaex.py +7 -7
  43. ccxt/async_support/htx.py +7 -7
  44. ccxt/async_support/huobijp.py +3 -3
  45. ccxt/async_support/idex.py +2 -2
  46. ccxt/async_support/independentreserve.py +2 -2
  47. ccxt/async_support/indodax.py +2 -2
  48. ccxt/async_support/kraken.py +8 -8
  49. ccxt/async_support/krakenfutures.py +6 -6
  50. ccxt/async_support/kucoin.py +4 -1
  51. ccxt/async_support/kucoinfutures.py +8 -8
  52. ccxt/async_support/kuna.py +16 -16
  53. ccxt/async_support/latoken.py +2 -2
  54. ccxt/async_support/lbank.py +10 -10
  55. ccxt/async_support/luno.py +4 -4
  56. ccxt/async_support/mercado.py +5 -5
  57. ccxt/async_support/mexc.py +6 -6
  58. ccxt/async_support/ndax.py +1 -1
  59. ccxt/async_support/novadax.py +9 -9
  60. ccxt/async_support/oceanex.py +7 -7
  61. ccxt/async_support/okcoin.py +13 -13
  62. ccxt/async_support/okx.py +23 -31
  63. ccxt/async_support/onetrading.py +4 -4
  64. ccxt/async_support/p2b.py +7 -7
  65. ccxt/async_support/phemex.py +12 -12
  66. ccxt/async_support/poloniexfutures.py +5 -5
  67. ccxt/async_support/probit.py +11 -11
  68. ccxt/async_support/timex.py +7 -7
  69. ccxt/async_support/tokocrypto.py +9 -9
  70. ccxt/async_support/wavesexchange.py +3 -3
  71. ccxt/async_support/whitebit.py +5 -5
  72. ccxt/async_support/woo.py +1 -1
  73. ccxt/async_support/zaif.py +1 -1
  74. ccxt/async_support/zonda.py +7 -7
  75. ccxt/base/exchange.py +66 -23
  76. ccxt/bigone.py +12 -12
  77. ccxt/binance.py +20 -32
  78. ccxt/bingx.py +12 -9
  79. ccxt/bit2c.py +1 -1
  80. ccxt/bitbank.py +8 -8
  81. ccxt/bitbns.py +5 -5
  82. ccxt/bitfinex.py +1 -1
  83. ccxt/bitfinex2.py +1 -1
  84. ccxt/bitget.py +29 -24
  85. ccxt/bithumb.py +5 -5
  86. ccxt/bitmart.py +16 -16
  87. ccxt/bitopro.py +1 -1
  88. ccxt/bitrue.py +4 -4
  89. ccxt/bitso.py +5 -5
  90. ccxt/bitstamp.py +1 -1
  91. ccxt/bitteam.py +8 -8
  92. ccxt/bl3p.py +1 -1
  93. ccxt/btcturk.py +6 -6
  94. ccxt/bybit.py +30 -83
  95. ccxt/coincheck.py +4 -4
  96. ccxt/coinex.py +11 -11
  97. ccxt/coinlist.py +7 -7
  98. ccxt/coinmate.py +4 -4
  99. ccxt/coinmetro.py +3 -3
  100. ccxt/coinone.py +5 -5
  101. ccxt/coinspot.py +2 -2
  102. ccxt/cryptocom.py +17 -17
  103. ccxt/currencycom.py +1 -1
  104. ccxt/delta.py +0 -8
  105. ccxt/deribit.py +16 -80
  106. ccxt/digifinex.py +8 -8
  107. ccxt/exmo.py +8 -8
  108. ccxt/gate.py +0 -8
  109. ccxt/hitbtc.py +5 -4
  110. ccxt/hollaex.py +7 -7
  111. ccxt/htx.py +7 -7
  112. ccxt/huobijp.py +3 -3
  113. ccxt/idex.py +2 -2
  114. ccxt/independentreserve.py +2 -2
  115. ccxt/indodax.py +2 -2
  116. ccxt/kraken.py +8 -8
  117. ccxt/krakenfutures.py +6 -6
  118. ccxt/kucoin.py +4 -1
  119. ccxt/kucoinfutures.py +8 -8
  120. ccxt/kuna.py +16 -16
  121. ccxt/latoken.py +2 -2
  122. ccxt/lbank.py +10 -10
  123. ccxt/luno.py +4 -4
  124. ccxt/mercado.py +5 -5
  125. ccxt/mexc.py +6 -6
  126. ccxt/ndax.py +1 -1
  127. ccxt/novadax.py +9 -9
  128. ccxt/oceanex.py +7 -7
  129. ccxt/okcoin.py +13 -13
  130. ccxt/okx.py +23 -31
  131. ccxt/onetrading.py +4 -4
  132. ccxt/p2b.py +7 -7
  133. ccxt/phemex.py +12 -12
  134. ccxt/poloniexfutures.py +5 -5
  135. ccxt/pro/__init__.py +1 -1
  136. ccxt/pro/binance.py +150 -112
  137. ccxt/pro/kucoin.py +6 -7
  138. ccxt/pro/okx.py +12 -1
  139. ccxt/probit.py +11 -11
  140. ccxt/timex.py +7 -7
  141. ccxt/tokocrypto.py +9 -9
  142. ccxt/wavesexchange.py +3 -3
  143. ccxt/whitebit.py +5 -5
  144. ccxt/woo.py +1 -1
  145. ccxt/zaif.py +1 -1
  146. ccxt/zonda.py +7 -7
  147. {ccxt-4.2.84.dist-info → ccxt-4.2.85.dist-info}/METADATA +4 -4
  148. {ccxt-4.2.84.dist-info → ccxt-4.2.85.dist-info}/RECORD +150 -150
  149. {ccxt-4.2.84.dist-info → ccxt-4.2.85.dist-info}/WHEEL +0 -0
  150. {ccxt-4.2.84.dist-info → ccxt-4.2.85.dist-info}/top_level.txt +0 -0
ccxt/bybit.py CHANGED
@@ -1132,70 +1132,6 @@ class bybit(Exchange, ImplicitAPI):
1132
1132
  def upgrade_unified_trade_account(self, params={}):
1133
1133
  return self.privatePostV5AccountUpgradeToUta(params)
1134
1134
 
1135
- def convert_expire_date(self, date):
1136
- # parse YYMMDD to timestamp
1137
- year = date[0:2]
1138
- month = date[2:4]
1139
- day = date[4:6]
1140
- reconstructedDate = '20' + year + '-' + month + '-' + day + 'T00:00:00Z'
1141
- return reconstructedDate
1142
-
1143
- def convert_expire_date_to_market_id_date(self, date):
1144
- # parse 231229 to 29DEC23
1145
- year = date[0:2]
1146
- monthRaw = date[2:4]
1147
- month = None
1148
- day = date[4:6]
1149
- if monthRaw == '01':
1150
- month = 'JAN'
1151
- elif monthRaw == '02':
1152
- month = 'FEB'
1153
- elif monthRaw == '03':
1154
- month = 'MAR'
1155
- elif monthRaw == '04':
1156
- month = 'APR'
1157
- elif monthRaw == '05':
1158
- month = 'MAY'
1159
- elif monthRaw == '06':
1160
- month = 'JUN'
1161
- elif monthRaw == '07':
1162
- month = 'JUL'
1163
- elif monthRaw == '08':
1164
- month = 'AUG'
1165
- elif monthRaw == '09':
1166
- month = 'SEP'
1167
- elif monthRaw == '10':
1168
- month = 'OCT'
1169
- elif monthRaw == '11':
1170
- month = 'NOV'
1171
- elif monthRaw == '12':
1172
- month = 'DEC'
1173
- reconstructedDate = day + month + year
1174
- return reconstructedDate
1175
-
1176
- def convert_market_id_expire_date(self, date):
1177
- # parse 22JAN23 to 230122
1178
- monthMappping = {
1179
- 'JAN': '01',
1180
- 'FEB': '02',
1181
- 'MAR': '03',
1182
- 'APR': '04',
1183
- 'MAY': '05',
1184
- 'JUN': '06',
1185
- 'JUL': '07',
1186
- 'AUG': '08',
1187
- 'SEP': '09',
1188
- 'OCT': '10',
1189
- 'NOV': '11',
1190
- 'DEC': '12',
1191
- }
1192
- year = date[0:2]
1193
- monthName = date[2:5]
1194
- month = self.safe_string(monthMappping, monthName)
1195
- day = date[5:7]
1196
- reconstructedDate = day + month + year
1197
- return reconstructedDate
1198
-
1199
1135
  def create_expired_option_market(self, symbol: str):
1200
1136
  # support expired option contracts
1201
1137
  quote = 'USD'
@@ -2040,7 +1976,7 @@ class bybit(Exchange, ImplicitAPI):
2040
1976
  #
2041
1977
  result = self.safe_value(response, 'result', [])
2042
1978
  tickers = self.safe_value(result, 'list', [])
2043
- rawTicker = self.safe_value(tickers, 0)
1979
+ rawTicker = self.safe_dict(tickers, 0)
2044
1980
  return self.parse_ticker(rawTicker, market)
2045
1981
 
2046
1982
  def fetch_tickers(self, symbols: Strings = None, params={}) -> Tickers:
@@ -2049,6 +1985,7 @@ class bybit(Exchange, ImplicitAPI):
2049
1985
  :see: https://bybit-exchange.github.io/docs/v5/market/tickers
2050
1986
  :param str[] symbols: unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
2051
1987
  :param dict [params]: extra parameters specific to the exchange API endpoint
1988
+ :param str [params.subType]: *contract only* 'linear', 'inverse'
2052
1989
  :returns dict: an array of `ticker structures <https://docs.ccxt.com/#/?id=ticker-structure>`
2053
1990
  """
2054
1991
  self.load_markets()
@@ -2081,11 +2018,16 @@ class bybit(Exchange, ImplicitAPI):
2081
2018
  }
2082
2019
  type = None
2083
2020
  type, params = self.handle_market_type_and_params('fetchTickers', market, params)
2084
- if type == 'spot':
2021
+ # Calls like `.fetch_tickers(None, {subType:'inverse'})` should be supported for self exchange, so
2022
+ # as "options.defaultSubType" is also set in exchange options, we should consider `params.subType`
2023
+ # with higher priority and only default to spot, if `subType` is not set in params
2024
+ passedSubType = self.safe_string(params, 'subType')
2025
+ subType = None
2026
+ subType, params = self.handle_sub_type_and_params('fetchTickers', market, params, 'linear')
2027
+ # only if passedSubType is None, then use spot
2028
+ if type == 'spot' and passedSubType is None:
2085
2029
  request['category'] = 'spot'
2086
- elif type == 'swap' or type == 'future':
2087
- subType = None
2088
- subType, params = self.handle_sub_type_and_params('fetchTickers', market, params, 'linear')
2030
+ elif type == 'swap' or type == 'future' or subType is not None:
2089
2031
  request['category'] = subType
2090
2032
  elif type == 'option':
2091
2033
  request['category'] = 'option'
@@ -2129,7 +2071,7 @@ class bybit(Exchange, ImplicitAPI):
2129
2071
  # }
2130
2072
  #
2131
2073
  result = self.safe_value(response, 'result', {})
2132
- tickerList = self.safe_value(result, 'list', [])
2074
+ tickerList = self.safe_list(result, 'list', [])
2133
2075
  return self.parse_tickers(tickerList, parsedSymbols)
2134
2076
 
2135
2077
  def parse_ohlcv(self, ohlcv, market: Market = None) -> list:
@@ -2252,7 +2194,7 @@ class bybit(Exchange, ImplicitAPI):
2252
2194
  # }
2253
2195
  #
2254
2196
  result = self.safe_value(response, 'result', {})
2255
- ohlcvs = self.safe_value(result, 'list', [])
2197
+ ohlcvs = self.safe_list(result, 'list', [])
2256
2198
  return self.parse_ohlcvs(ohlcvs, market, timeframe, since, limit)
2257
2199
 
2258
2200
  def parse_funding_rate(self, ticker, market: Market = None):
@@ -2686,7 +2628,7 @@ class bybit(Exchange, ImplicitAPI):
2686
2628
  # }
2687
2629
  #
2688
2630
  result = self.safe_value(response, 'result', {})
2689
- trades = self.safe_value(result, 'list', [])
2631
+ trades = self.safe_list(result, 'list', [])
2690
2632
  return self.parse_trades(trades, market, since, limit)
2691
2633
 
2692
2634
  def fetch_order_book(self, symbol: str, limit: Int = None, params={}) -> OrderBook:
@@ -3381,7 +3323,7 @@ class bybit(Exchange, ImplicitAPI):
3381
3323
  # "time": 1672211918471
3382
3324
  # }
3383
3325
  #
3384
- order = self.safe_value(response, 'result', {})
3326
+ order = self.safe_dict(response, 'result', {})
3385
3327
  return self.parse_order(order, market)
3386
3328
 
3387
3329
  def create_order_request(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, params={}, isUTA=True):
@@ -3762,7 +3704,7 @@ class bybit(Exchange, ImplicitAPI):
3762
3704
  # "tpTriggerBy":"UNKNOWN"
3763
3705
  # }
3764
3706
  #
3765
- order = self.safe_value(response, 'result', {})
3707
+ order = self.safe_dict(response, 'result', {})
3766
3708
  return self.parse_order(order, market)
3767
3709
 
3768
3710
  def edit_usdc_order(self, id, symbol, type, side, amount=None, price=None, params={}):
@@ -3810,7 +3752,7 @@ class bybit(Exchange, ImplicitAPI):
3810
3752
  # "retExtMap": {}
3811
3753
  # }
3812
3754
  #
3813
- result = self.safe_value(response, 'result', {})
3755
+ result = self.safe_dict(response, 'result', {})
3814
3756
  return self.parse_order(result, market)
3815
3757
 
3816
3758
  def edit_order(self, id: str, symbol: str, type: OrderType, side: OrderSide, amount: Num = None, price: Num = None, params={}):
@@ -3959,7 +3901,7 @@ class bybit(Exchange, ImplicitAPI):
3959
3901
  # "retExtMap": {}
3960
3902
  # }
3961
3903
  #
3962
- result = self.safe_value(response, 'result', {})
3904
+ result = self.safe_dict(response, 'result', {})
3963
3905
  return self.parse_order(result, market)
3964
3906
 
3965
3907
  def cancel_order(self, id: str, symbol: Str = None, params={}):
@@ -4017,7 +3959,7 @@ class bybit(Exchange, ImplicitAPI):
4017
3959
  # "time": 1672217377164
4018
3960
  # }
4019
3961
  #
4020
- result = self.safe_value(response, 'result', {})
3962
+ result = self.safe_dict(response, 'result', {})
4021
3963
  return self.parse_order(result, market)
4022
3964
 
4023
3965
  def cancel_orders(self, ids, symbol: Str = None, params={}):
@@ -4288,7 +4230,7 @@ class bybit(Exchange, ImplicitAPI):
4288
4230
  # }
4289
4231
  #
4290
4232
  result = self.safe_value(response, 'result', {})
4291
- data = self.safe_value(result, 'dataList', [])
4233
+ data = self.safe_list(result, 'dataList', [])
4292
4234
  return self.parse_orders(data, market, since, limit)
4293
4235
 
4294
4236
  def fetch_order_classic(self, id: str, symbol: Str = None, params={}):
@@ -4858,7 +4800,7 @@ class bybit(Exchange, ImplicitAPI):
4858
4800
  # }
4859
4801
  #
4860
4802
  result = self.safe_value(response, 'result', {})
4861
- dataList = self.safe_value(result, 'dataList', [])
4803
+ dataList = self.safe_list(result, 'dataList', [])
4862
4804
  return self.parse_trades(dataList, market, since, limit)
4863
4805
 
4864
4806
  def fetch_my_trades(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
@@ -5049,7 +4991,7 @@ class bybit(Exchange, ImplicitAPI):
5049
4991
  chains = self.safe_value(result, 'chains', [])
5050
4992
  chainsIndexedById = self.index_by(chains, 'chain')
5051
4993
  selectedNetworkId = self.select_network_id_from_raw_networks(code, networkCode, chainsIndexedById)
5052
- addressObject = self.safe_value(chainsIndexedById, selectedNetworkId, {})
4994
+ addressObject = self.safe_dict(chainsIndexedById, selectedNetworkId, {})
5053
4995
  return self.parse_deposit_address(addressObject, currency)
5054
4996
 
5055
4997
  def fetch_deposits(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
@@ -5579,7 +5521,7 @@ class bybit(Exchange, ImplicitAPI):
5579
5521
  # "time": "1666892894902"
5580
5522
  # }
5581
5523
  #
5582
- result = self.safe_value(response, 'result', {})
5524
+ result = self.safe_dict(response, 'result', {})
5583
5525
  return self.parse_transaction(result, currency)
5584
5526
 
5585
5527
  def fetch_position(self, symbol: str, params={}):
@@ -5958,6 +5900,11 @@ class bybit(Exchange, ImplicitAPI):
5958
5900
  timestamp = self.parse8601(self.safe_string(position, 'updated_at'))
5959
5901
  if timestamp is None:
5960
5902
  timestamp = self.safe_integer_n(position, ['updatedTime', 'updatedAt'])
5903
+ tradeMode = self.safe_integer(position, 'tradeMode', 0)
5904
+ marginMode = None
5905
+ if (not self.options['enableUnifiedAccount']) or (self.options['enableUnifiedAccount'] and market['inverse']):
5906
+ # tradeMode would work for classic and UTA(inverse)
5907
+ marginMode = 'isolated' if (tradeMode == 1) else 'cross'
5961
5908
  collateralString = self.safe_string(position, 'positionBalance')
5962
5909
  entryPrice = self.omit_zero(self.safe_string_2(position, 'entryPrice', 'avgPrice'))
5963
5910
  liquidationPrice = self.omit_zero(self.safe_string(position, 'liqPrice'))
@@ -6014,7 +5961,7 @@ class bybit(Exchange, ImplicitAPI):
6014
5961
  'markPrice': self.safe_number(position, 'markPrice'),
6015
5962
  'lastPrice': None,
6016
5963
  'collateral': self.parse_number(collateralString),
6017
- 'marginMode': None,
5964
+ 'marginMode': marginMode,
6018
5965
  'side': side,
6019
5966
  'percentage': None,
6020
5967
  'stopLossPrice': self.safe_number_2(position, 'stop_loss', 'stopLoss'),
@@ -6985,7 +6932,7 @@ class bybit(Exchange, ImplicitAPI):
6985
6932
  # }
6986
6933
  #
6987
6934
  data = self.safe_value(response, 'result', {})
6988
- rows = self.safe_value(data, 'rows', [])
6935
+ rows = self.safe_list(data, 'rows', [])
6989
6936
  return self.parse_deposit_withdraw_fees(rows, codes, 'coin')
6990
6937
 
6991
6938
  def fetch_settlement_history(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
ccxt/coincheck.py CHANGED
@@ -469,7 +469,7 @@ class coincheck(Exchange, ImplicitAPI):
469
469
  # ]
470
470
  # }
471
471
  #
472
- transactions = self.safe_value(response, 'data', [])
472
+ transactions = self.safe_list(response, 'data', [])
473
473
  return self.parse_trades(transactions, market, since, limit)
474
474
 
475
475
  def fetch_trades(self, symbol: str, since: Int = None, limit: Int = None, params={}) -> List[Trade]:
@@ -500,7 +500,7 @@ class coincheck(Exchange, ImplicitAPI):
500
500
  # "created_at": "2021-12-08T14:10:33.000Z"
501
501
  # }
502
502
  #
503
- data = self.safe_value(response, 'data', [])
503
+ data = self.safe_list(response, 'data', [])
504
504
  return self.parse_trades(data, market, since, limit)
505
505
 
506
506
  def fetch_trading_fees(self, params={}):
@@ -636,7 +636,7 @@ class coincheck(Exchange, ImplicitAPI):
636
636
  # }
637
637
  # ]
638
638
  # }
639
- data = self.safe_value(response, 'deposits', [])
639
+ data = self.safe_list(response, 'deposits', [])
640
640
  return self.parse_transactions(data, currency, since, limit, {'type': 'deposit'})
641
641
 
642
642
  def fetch_withdrawals(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
@@ -678,7 +678,7 @@ class coincheck(Exchange, ImplicitAPI):
678
678
  # }
679
679
  # ]
680
680
  # }
681
- data = self.safe_value(response, 'data', [])
681
+ data = self.safe_list(response, 'data', [])
682
682
  return self.parse_transactions(data, currency, since, limit, {'type': 'withdrawal'})
683
683
 
684
684
  def parse_transaction_status(self, status):
ccxt/coinex.py CHANGED
@@ -1331,7 +1331,7 @@ class coinex(Exchange, ImplicitAPI):
1331
1331
  # "message": "OK"
1332
1332
  # }
1333
1333
  #
1334
- data = self.safe_value(response, 'data', [])
1334
+ data = self.safe_list(response, 'data', [])
1335
1335
  return self.parse_ohlcvs(data, market, timeframe, since, limit)
1336
1336
 
1337
1337
  def fetch_margin_balance(self, params={}):
@@ -2168,7 +2168,7 @@ class coinex(Exchange, ImplicitAPI):
2168
2168
  #
2169
2169
  # {"code":0,"data":{"status":"success"},"message":"OK"}
2170
2170
  #
2171
- data = self.safe_value(response, 'data', {})
2171
+ data = self.safe_dict(response, 'data', {})
2172
2172
  return self.parse_order(data, market)
2173
2173
 
2174
2174
  def create_orders(self, orders: List[OrderRequest], params={}) -> List[Order]:
@@ -2446,7 +2446,7 @@ class coinex(Exchange, ImplicitAPI):
2446
2446
  # "message": "Success"
2447
2447
  # }
2448
2448
  #
2449
- data = self.safe_value(response, 'data', {})
2449
+ data = self.safe_dict(response, 'data', {})
2450
2450
  return self.parse_order(data, market)
2451
2451
 
2452
2452
  def cancel_order(self, id: str, symbol: Str = None, params={}):
@@ -2617,7 +2617,7 @@ class coinex(Exchange, ImplicitAPI):
2617
2617
  #
2618
2618
  # {"code":0,"data":{},"message":"Success"}
2619
2619
  #
2620
- data = self.safe_value(response, 'data')
2620
+ data = self.safe_dict(response, 'data')
2621
2621
  return self.parse_order(data, market)
2622
2622
 
2623
2623
  def cancel_all_orders(self, symbol: Str = None, params={}):
@@ -2798,7 +2798,7 @@ class coinex(Exchange, ImplicitAPI):
2798
2798
  # "message":"OK"
2799
2799
  # }
2800
2800
  #
2801
- data = self.safe_value(response, 'data')
2801
+ data = self.safe_dict(response, 'data')
2802
2802
  return self.parse_order(data, market)
2803
2803
 
2804
2804
  def fetch_orders_by_status(self, status, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
@@ -3006,7 +3006,7 @@ class coinex(Exchange, ImplicitAPI):
3006
3006
  #
3007
3007
  tradeRequest = 'records' if (marketType == 'swap') else 'data'
3008
3008
  data = self.safe_value(response, 'data')
3009
- orders = self.safe_value(data, tradeRequest, [])
3009
+ orders = self.safe_list(data, tradeRequest, [])
3010
3010
  return self.parse_orders(orders, market, since, limit)
3011
3011
 
3012
3012
  def fetch_open_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
@@ -3065,7 +3065,7 @@ class coinex(Exchange, ImplicitAPI):
3065
3065
  # },
3066
3066
  # "message": "Success"
3067
3067
  # }
3068
- data = self.safe_value(response, 'data', {})
3068
+ data = self.safe_dict(response, 'data', {})
3069
3069
  return self.parse_deposit_address(data, currency)
3070
3070
 
3071
3071
  def fetch_deposit_address(self, code: str, params={}):
@@ -3275,7 +3275,7 @@ class coinex(Exchange, ImplicitAPI):
3275
3275
  #
3276
3276
  tradeRequest = 'records' if swap else 'data'
3277
3277
  data = self.safe_value(response, 'data')
3278
- trades = self.safe_value(data, tradeRequest, [])
3278
+ trades = self.safe_list(data, tradeRequest, [])
3279
3279
  return self.parse_trades(trades, market, since, limit)
3280
3280
 
3281
3281
  def fetch_positions(self, symbols: Strings = None, params={}):
@@ -3456,7 +3456,7 @@ class coinex(Exchange, ImplicitAPI):
3456
3456
  # "message": "OK"
3457
3457
  # }
3458
3458
  #
3459
- data = self.safe_value(response, 'data', [])
3459
+ data = self.safe_list(response, 'data', [])
3460
3460
  return self.parse_position(data[0], market)
3461
3461
 
3462
3462
  def parse_position(self, position, market: Market = None):
@@ -4106,7 +4106,7 @@ class coinex(Exchange, ImplicitAPI):
4106
4106
  # "message": "Ok"
4107
4107
  # }
4108
4108
  #
4109
- transaction = self.safe_value(response, 'data', {})
4109
+ transaction = self.safe_dict(response, 'data', {})
4110
4110
  return self.parse_transaction(transaction, currency)
4111
4111
 
4112
4112
  def parse_transaction_status(self, status):
@@ -4492,7 +4492,7 @@ class coinex(Exchange, ImplicitAPI):
4492
4492
  # }
4493
4493
  #
4494
4494
  data = self.safe_value(response, 'data', {})
4495
- transfers = self.safe_value(data, 'records', [])
4495
+ transfers = self.safe_list(data, 'records', [])
4496
4496
  return self.parse_transfers(transfers, currency, since, limit)
4497
4497
 
4498
4498
  def fetch_withdrawals(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
ccxt/coinlist.py CHANGED
@@ -708,7 +708,7 @@ class coinlist(Exchange, ImplicitAPI):
708
708
  # ]
709
709
  # }
710
710
  #
711
- candles = self.safe_value(response, 'candles', [])
711
+ candles = self.safe_list(response, 'candles', [])
712
712
  return self.parse_ohlcvs(candles, market, timeframe, since, limit)
713
713
 
714
714
  def parse_ohlcv(self, ohlcv, market: Market = None) -> list:
@@ -781,7 +781,7 @@ class coinlist(Exchange, ImplicitAPI):
781
781
  # ]
782
782
  # }
783
783
  #
784
- auctions = self.safe_value(response, 'auctions', [])
784
+ auctions = self.safe_list(response, 'auctions', [])
785
785
  return self.parse_trades(auctions, market, since, limit)
786
786
 
787
787
  def parse_trade(self, trade, market: Market = None) -> Trade:
@@ -1163,7 +1163,7 @@ class coinlist(Exchange, ImplicitAPI):
1163
1163
  # ]
1164
1164
  # }
1165
1165
  #
1166
- fills = self.safe_value(response, 'fills', [])
1166
+ fills = self.safe_list(response, 'fills', [])
1167
1167
  return self.parse_trades(fills, market, since, limit)
1168
1168
 
1169
1169
  def fetch_order_trades(self, id: str, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Trade]:
@@ -1240,7 +1240,7 @@ class coinlist(Exchange, ImplicitAPI):
1240
1240
  # ]
1241
1241
  # }
1242
1242
  #
1243
- orders = self.safe_value(response, 'orders', [])
1243
+ orders = self.safe_list(response, 'orders', [])
1244
1244
  return self.parse_orders(orders, market, since, limit)
1245
1245
 
1246
1246
  def fetch_order(self, id: str, symbol: Str = None, params={}):
@@ -1458,7 +1458,7 @@ class coinlist(Exchange, ImplicitAPI):
1458
1458
  # "timestamp": "2023-10-26T11:30:55.376Z"
1459
1459
  # }
1460
1460
  #
1461
- order = self.safe_value(response, 'order', {})
1461
+ order = self.safe_dict(response, 'order', {})
1462
1462
  return self.parse_order(order, market)
1463
1463
 
1464
1464
  def edit_order(self, id: str, symbol: str, type: OrderType, side: OrderSide, amount: Num = None, price: Num = None, params={}):
@@ -1729,7 +1729,7 @@ class coinlist(Exchange, ImplicitAPI):
1729
1729
  # ]
1730
1730
  # }
1731
1731
  #
1732
- transfers = self.safe_value(response, 'transfers', [])
1732
+ transfers = self.safe_list(response, 'transfers', [])
1733
1733
  return self.parse_transfers(transfers, currency, since, limit)
1734
1734
 
1735
1735
  def parse_transfer(self, transfer, currency: Currency = None):
@@ -1889,7 +1889,7 @@ class coinlist(Exchange, ImplicitAPI):
1889
1889
  # "transfer_id": "d4a2d8dd-7def-4545-a062-761683b9aa05"
1890
1890
  # }
1891
1891
  #
1892
- data = self.safe_value(response, 'data', {})
1892
+ data = self.safe_dict(response, 'data', {})
1893
1893
  return self.parse_transaction(data, currency)
1894
1894
 
1895
1895
  def parse_transaction(self, transaction, currency: Currency = None) -> Transaction:
ccxt/coinmate.py CHANGED
@@ -395,7 +395,7 @@ class coinmate(Exchange, ImplicitAPI):
395
395
  # }
396
396
  # }
397
397
  #
398
- data = self.safe_value(response, 'data')
398
+ data = self.safe_dict(response, 'data')
399
399
  return self.parse_ticker(data, market)
400
400
 
401
401
  def fetch_tickers(self, symbols: Strings = None, params={}) -> Tickers:
@@ -660,7 +660,7 @@ class coinmate(Exchange, ImplicitAPI):
660
660
  if since is not None:
661
661
  request['timestampFrom'] = since
662
662
  response = self.privatePostTradeHistory(self.extend(request, params))
663
- data = self.safe_value(response, 'data', [])
663
+ data = self.safe_list(response, 'data', [])
664
664
  return self.parse_trades(data, None, since, limit)
665
665
 
666
666
  def parse_trade(self, trade, market: Market = None) -> Trade:
@@ -758,7 +758,7 @@ class coinmate(Exchange, ImplicitAPI):
758
758
  # ]
759
759
  # }
760
760
  #
761
- data = self.safe_value(response, 'data', [])
761
+ data = self.safe_list(response, 'data', [])
762
762
  return self.parse_trades(data, market, since, limit)
763
763
 
764
764
  def fetch_trading_fee(self, symbol: str, params={}):
@@ -985,7 +985,7 @@ class coinmate(Exchange, ImplicitAPI):
985
985
  if symbol:
986
986
  market = self.market(symbol)
987
987
  response = self.privatePostOrderById(self.extend(request, params))
988
- data = self.safe_value(response, 'data')
988
+ data = self.safe_dict(response, 'data')
989
989
  return self.parse_order(data, market)
990
990
 
991
991
  def cancel_order(self, id: str, symbol: Str = None, params={}):
ccxt/coinmetro.py CHANGED
@@ -532,7 +532,7 @@ class coinmetro(Exchange, ImplicitAPI):
532
532
  # ]
533
533
  # }
534
534
  #
535
- candleHistory = self.safe_value(response, 'candleHistory', [])
535
+ candleHistory = self.safe_list(response, 'candleHistory', [])
536
536
  return self.parse_ohlcvs(candleHistory, market, timeframe, since, limit)
537
537
 
538
538
  def parse_ohlcv(self, ohlcv, market: Market = None) -> list:
@@ -594,7 +594,7 @@ class coinmetro(Exchange, ImplicitAPI):
594
594
  # ]
595
595
  # }
596
596
  #
597
- tickHistory = self.safe_value(response, 'tickHistory', [])
597
+ tickHistory = self.safe_list(response, 'tickHistory', [])
598
598
  return self.parse_trades(tickHistory, market, since, limit)
599
599
 
600
600
  def fetch_my_trades(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
@@ -851,7 +851,7 @@ class coinmetro(Exchange, ImplicitAPI):
851
851
  """
852
852
  self.load_markets()
853
853
  response = self.publicGetExchangePrices(params)
854
- latestPrices = self.safe_value(response, 'latestPrices', [])
854
+ latestPrices = self.safe_list(response, 'latestPrices', [])
855
855
  return self.parse_tickers(latestPrices, symbols)
856
856
 
857
857
  def parse_ticker(self, ticker, market: Market = None) -> Ticker:
ccxt/coinone.py CHANGED
@@ -503,7 +503,7 @@ class coinone(Exchange, ImplicitAPI):
503
503
  # ]
504
504
  # }
505
505
  #
506
- data = self.safe_value(response, 'tickers', [])
506
+ data = self.safe_list(response, 'tickers', [])
507
507
  return self.parse_tickers(data, symbols)
508
508
 
509
509
  def fetch_ticker(self, symbol: str, params={}) -> Ticker:
@@ -555,7 +555,7 @@ class coinone(Exchange, ImplicitAPI):
555
555
  # }
556
556
  #
557
557
  data = self.safe_value(response, 'tickers', [])
558
- ticker = self.safe_value(data, 0, {})
558
+ ticker = self.safe_dict(data, 0, {})
559
559
  return self.parse_ticker(ticker, market)
560
560
 
561
561
  def parse_ticker(self, ticker, market: Market = None) -> Ticker:
@@ -714,7 +714,7 @@ class coinone(Exchange, ImplicitAPI):
714
714
  # ]
715
715
  # }
716
716
  #
717
- data = self.safe_value(response, 'transactions', [])
717
+ data = self.safe_list(response, 'transactions', [])
718
718
  return self.parse_trades(data, market, since, limit)
719
719
 
720
720
  def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, params={}):
@@ -942,7 +942,7 @@ class coinone(Exchange, ImplicitAPI):
942
942
  # ]
943
943
  # }
944
944
  #
945
- limitOrders = self.safe_value(response, 'limitOrders', [])
945
+ limitOrders = self.safe_list(response, 'limitOrders', [])
946
946
  return self.parse_orders(limitOrders, market, since, limit)
947
947
 
948
948
  def fetch_my_trades(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
@@ -982,7 +982,7 @@ class coinone(Exchange, ImplicitAPI):
982
982
  # ]
983
983
  # }
984
984
  #
985
- completeOrders = self.safe_value(response, 'completeOrders', [])
985
+ completeOrders = self.safe_list(response, 'completeOrders', [])
986
986
  return self.parse_trades(completeOrders, market, since, limit)
987
987
 
988
988
  def cancel_order(self, id: str, symbol: Str = None, params={}):
ccxt/coinspot.py CHANGED
@@ -274,7 +274,7 @@ class coinspot(Exchange, ImplicitAPI):
274
274
  # }
275
275
  # }
276
276
  #
277
- ticker = self.safe_value(prices, id)
277
+ ticker = self.safe_dict(prices, id)
278
278
  return self.parse_ticker(ticker, market)
279
279
 
280
280
  def fetch_tickers(self, symbols: Strings = None, params={}) -> Tickers:
@@ -340,7 +340,7 @@ class coinspot(Exchange, ImplicitAPI):
340
340
  # ],
341
341
  # }
342
342
  #
343
- trades = self.safe_value(response, 'orders', [])
343
+ trades = self.safe_list(response, 'orders', [])
344
344
  return self.parse_trades(trades, market, since, limit)
345
345
 
346
346
  def fetch_my_trades(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):