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/htx.py CHANGED
@@ -2292,7 +2292,7 @@ class htx(Exchange, ImplicitAPI):
2292
2292
  else:
2293
2293
  raise NotSupported(self.id + ' fetchLastPrices() does not support ' + type + ' markets yet')
2294
2294
  tick = self.safe_value(response, 'tick', {})
2295
- data = self.safe_value(tick, 'data', [])
2295
+ data = self.safe_list(tick, 'data', [])
2296
2296
  return self.parse_last_prices(data, symbols)
2297
2297
 
2298
2298
  def parse_last_price(self, entry, market: Market = None):
@@ -3712,7 +3712,7 @@ class htx(Exchange, ImplicitAPI):
3712
3712
  # ]
3713
3713
  # }
3714
3714
  #
3715
- data = self.safe_value(response, 'data', [])
3715
+ data = self.safe_list(response, 'data', [])
3716
3716
  return self.parse_orders(data, market, since, limit)
3717
3717
 
3718
3718
  def fetch_spot_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
@@ -6712,7 +6712,7 @@ class htx(Exchange, ImplicitAPI):
6712
6712
  else:
6713
6713
  request['symbol'] = market['id']
6714
6714
  response = self.contractPrivatePostApiV3ContractFinancialRecordExact(self.extend(request, query))
6715
- data = self.safe_value(response, 'data', [])
6715
+ data = self.safe_list(response, 'data', [])
6716
6716
  return self.parse_incomes(data, market, since, limit)
6717
6717
 
6718
6718
  def set_leverage(self, leverage: Int, symbol: Str = None, params={}):
@@ -7441,7 +7441,7 @@ class htx(Exchange, ImplicitAPI):
7441
7441
  # ]
7442
7442
  # }
7443
7443
  #
7444
- data = self.safe_value(response, 'data')
7444
+ data = self.safe_list(response, 'data')
7445
7445
  return self.parse_leverage_tiers(data, symbols, 'contract_code')
7446
7446
 
7447
7447
  def fetch_market_leverage_tiers(self, symbol: str, params={}):
@@ -7630,7 +7630,7 @@ class htx(Exchange, ImplicitAPI):
7630
7630
  # }
7631
7631
  #
7632
7632
  data = self.safe_value(response, 'data')
7633
- tick = self.safe_value(data, 'tick')
7633
+ tick = self.safe_list(data, 'tick')
7634
7634
  return self.parse_open_interests(tick, market, since, limit)
7635
7635
 
7636
7636
  def fetch_open_interest(self, symbol: str, params={}):
@@ -8109,7 +8109,7 @@ class htx(Exchange, ImplicitAPI):
8109
8109
  # ]
8110
8110
  # }
8111
8111
  #
8112
- data = self.safe_value(response, 'data')
8112
+ data = self.safe_list(response, 'data')
8113
8113
  return self.parse_deposit_withdraw_fees(data, codes, 'currency')
8114
8114
 
8115
8115
  def parse_deposit_withdraw_fee(self, fee, currency: Currency = None):
@@ -8322,7 +8322,7 @@ class htx(Exchange, ImplicitAPI):
8322
8322
  # "ts": 1604312615051
8323
8323
  # }
8324
8324
  #
8325
- data = self.safe_value(response, 'data', [])
8325
+ data = self.safe_list(response, 'data', [])
8326
8326
  return self.parse_liquidations(data, market, since, limit)
8327
8327
 
8328
8328
  def parse_liquidation(self, liquidation, market: Market = None):
ccxt/huobijp.py CHANGED
@@ -941,7 +941,7 @@ class huobijp(Exchange, ImplicitAPI):
941
941
  # ]
942
942
  # }
943
943
  #
944
- data = self.safe_value(response, 'data', [])
944
+ data = self.safe_list(response, 'data', [])
945
945
  return self.parse_ohlcvs(data, market, timeframe, since, limit)
946
946
 
947
947
  def fetch_accounts(self, params={}) -> List[Account]:
@@ -1125,7 +1125,7 @@ class huobijp(Exchange, ImplicitAPI):
1125
1125
  'id': id,
1126
1126
  }
1127
1127
  response = self.privateGetOrderOrdersId(self.extend(request, params))
1128
- order = self.safe_value(response, 'data')
1128
+ order = self.safe_dict(response, 'data')
1129
1129
  return self.parse_order(order)
1130
1130
 
1131
1131
  def fetch_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
@@ -1210,7 +1210,7 @@ class huobijp(Exchange, ImplicitAPI):
1210
1210
  # ]
1211
1211
  # }
1212
1212
  #
1213
- data = self.safe_value(response, 'data', [])
1213
+ data = self.safe_list(response, 'data', [])
1214
1214
  return self.parse_orders(data, market, since, limit)
1215
1215
 
1216
1216
  def parse_order_status(self, status):
ccxt/idex.py CHANGED
@@ -363,7 +363,7 @@ class idex(Exchange, ImplicitAPI):
363
363
  # }
364
364
  # ]
365
365
  response = self.publicGetTickers(self.extend(request, params))
366
- ticker = self.safe_value(response, 0)
366
+ ticker = self.safe_dict(response, 0)
367
367
  return self.parse_ticker(ticker, market)
368
368
 
369
369
  def fetch_tickers(self, symbols: Strings = None, params={}) -> Tickers:
@@ -1407,7 +1407,7 @@ class idex(Exchange, ImplicitAPI):
1407
1407
  }
1408
1408
  # [{orderId: "688336f0-ec50-11ea-9842-b332f8a34d0e"}]
1409
1409
  response = self.privateDeleteOrders(self.extend(request, params))
1410
- canceledOrder = self.safe_value(response, 0)
1410
+ canceledOrder = self.safe_dict(response, 0)
1411
1411
  return self.parse_order(canceledOrder, market)
1412
1412
 
1413
1413
  def handle_errors(self, code, reason, url, method, headers, body, response, requestHeaders, requestBody):
@@ -480,7 +480,7 @@ class independentreserve(Exchange, ImplicitAPI):
480
480
  request['pageIndex'] = 1
481
481
  request['pageSize'] = limit
482
482
  response = self.privatePostGetOpenOrders(self.extend(request, params))
483
- data = self.safe_value(response, 'Data', [])
483
+ data = self.safe_list(response, 'Data', [])
484
484
  return self.parse_orders(data, market, since, limit)
485
485
 
486
486
  def fetch_closed_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
@@ -504,7 +504,7 @@ class independentreserve(Exchange, ImplicitAPI):
504
504
  request['pageIndex'] = 1
505
505
  request['pageSize'] = limit
506
506
  response = self.privatePostGetClosedOrders(self.extend(request, params))
507
- data = self.safe_value(response, 'Data', [])
507
+ data = self.safe_list(response, 'Data', [])
508
508
  return self.parse_orders(data, market, since, limit)
509
509
 
510
510
  def fetch_my_trades(self, symbol: Str = None, since: Int = None, limit: Int = 50, params={}):
ccxt/indodax.py CHANGED
@@ -473,7 +473,7 @@ class indodax(Exchange, ImplicitAPI):
473
473
  # }
474
474
  # }
475
475
  #
476
- ticker = self.safe_value(response, 'ticker', {})
476
+ ticker = self.safe_dict(response, 'ticker', {})
477
477
  return self.parse_ticker(ticker, market)
478
478
 
479
479
  def fetch_tickers(self, symbols: Strings = None, params={}) -> Tickers:
@@ -502,7 +502,7 @@ class indodax(Exchange, ImplicitAPI):
502
502
  # }
503
503
  #
504
504
  response = self.publicGetApiTickerAll(params)
505
- tickers = self.safe_value(response, 'tickers')
505
+ tickers = self.safe_list(response, 'tickers')
506
506
  return self.parse_tickers(tickers, symbols)
507
507
 
508
508
  def parse_trade(self, trade, market: Market = None) -> Trade:
ccxt/kraken.py CHANGED
@@ -979,7 +979,7 @@ class kraken(Exchange, ImplicitAPI):
979
979
  # }
980
980
  # }
981
981
  result = self.safe_value(response, 'result', {})
982
- ohlcvs = self.safe_value(result, market['id'], [])
982
+ ohlcvs = self.safe_list(result, market['id'], [])
983
983
  return self.parse_ohlcvs(ohlcvs, market, timeframe, since, limit)
984
984
 
985
985
  def parse_ledger_entry_type(self, type):
@@ -1341,7 +1341,7 @@ class kraken(Exchange, ImplicitAPI):
1341
1341
  # }
1342
1342
  # }
1343
1343
  #
1344
- result = self.safe_value(response, 'result')
1344
+ result = self.safe_dict(response, 'result')
1345
1345
  return self.parse_order(result)
1346
1346
 
1347
1347
  def find_market_by_altname_or_id(self, id):
@@ -1724,7 +1724,7 @@ class kraken(Exchange, ImplicitAPI):
1724
1724
  # }
1725
1725
  # }
1726
1726
  #
1727
- data = self.safe_value(response, 'result', {})
1727
+ data = self.safe_dict(response, 'result', {})
1728
1728
  return self.parse_order(data, market)
1729
1729
 
1730
1730
  def fetch_order(self, id: str, symbol: Str = None, params={}):
@@ -2022,8 +2022,8 @@ class kraken(Exchange, ImplicitAPI):
2022
2022
  market = None
2023
2023
  if symbol is not None:
2024
2024
  market = self.market(symbol)
2025
- result = self.safe_value(response, 'result', {})
2026
- orders = self.safe_value(result, 'open', [])
2025
+ result = self.safe_dict(response, 'result', {})
2026
+ orders = self.safe_dict(result, 'open', {})
2027
2027
  return self.parse_orders(orders, market, since, limit)
2028
2028
 
2029
2029
  def fetch_closed_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
@@ -2090,8 +2090,8 @@ class kraken(Exchange, ImplicitAPI):
2090
2090
  market = None
2091
2091
  if symbol is not None:
2092
2092
  market = self.market(symbol)
2093
- result = self.safe_value(response, 'result', {})
2094
- orders = self.safe_value(result, 'closed', [])
2093
+ result = self.safe_dict(response, 'result', {})
2094
+ orders = self.safe_dict(result, 'closed', {})
2095
2095
  return self.parse_orders(orders, market, since, limit)
2096
2096
 
2097
2097
  def parse_transaction_status(self, status):
@@ -2518,7 +2518,7 @@ class kraken(Exchange, ImplicitAPI):
2518
2518
  # }
2519
2519
  # }
2520
2520
  #
2521
- result = self.safe_value(response, 'result', {})
2521
+ result = self.safe_dict(response, 'result', {})
2522
2522
  return self.parse_transaction(result, currency)
2523
2523
  raise ExchangeError(self.id + " withdraw() requires a 'key' parameter(withdrawal key name, up on your account)")
2524
2524
 
ccxt/krakenfutures.py CHANGED
@@ -535,7 +535,7 @@ class krakenfutures(Exchange, ImplicitAPI):
535
535
  # "serverTime": "2022-02-18T14:16:29.440Z"
536
536
  # }
537
537
  #
538
- tickers = self.safe_value(response, 'tickers')
538
+ tickers = self.safe_list(response, 'tickers')
539
539
  return self.parse_tickers(tickers, symbols)
540
540
 
541
541
  def parse_ticker(self, ticker, market: Market = None) -> Ticker:
@@ -662,7 +662,7 @@ class krakenfutures(Exchange, ImplicitAPI):
662
662
  # "more_candles": True
663
663
  # }
664
664
  #
665
- candles = self.safe_value(response, 'candles')
665
+ candles = self.safe_list(response, 'candles')
666
666
  return self.parse_ohlcvs(candles, market, timeframe, since, limit)
667
667
 
668
668
  def parse_ohlcv(self, ohlcv, market: Market = None) -> list:
@@ -1087,7 +1087,7 @@ class krakenfutures(Exchange, ImplicitAPI):
1087
1087
  # ]
1088
1088
  # }
1089
1089
  #
1090
- data = self.safe_value(response, 'batchStatus', [])
1090
+ data = self.safe_list(response, 'batchStatus', [])
1091
1091
  return self.parse_orders(data)
1092
1092
 
1093
1093
  def edit_order(self, id: str, symbol: str, type: OrderType, side: OrderSide, amount: Num = None, price: Num = None, params={}):
@@ -1191,7 +1191,7 @@ class krakenfutures(Exchange, ImplicitAPI):
1191
1191
  # }
1192
1192
  # ]
1193
1193
  # }
1194
- batchStatus = self.safe_value(response, 'batchStatus', [])
1194
+ batchStatus = self.safe_list(response, 'batchStatus', [])
1195
1195
  return self.parse_orders(batchStatus)
1196
1196
 
1197
1197
  def cancel_all_orders(self, symbol: Str = None, params={}):
@@ -1223,7 +1223,7 @@ class krakenfutures(Exchange, ImplicitAPI):
1223
1223
  if symbol is not None:
1224
1224
  market = self.market(symbol)
1225
1225
  response = self.privateGetOpenorders(params)
1226
- orders = self.safe_value(response, 'openOrders', [])
1226
+ orders = self.safe_list(response, 'openOrders', [])
1227
1227
  return self.parse_orders(orders, market, since, limit)
1228
1228
 
1229
1229
  def fetch_closed_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
@@ -2217,7 +2217,7 @@ class krakenfutures(Exchange, ImplicitAPI):
2217
2217
  # "serverTime": "2018-07-19T11:32:39.433Z"
2218
2218
  # }
2219
2219
  #
2220
- data = self.safe_value(response, 'instruments')
2220
+ data = self.safe_list(response, 'instruments')
2221
2221
  return self.parse_leverage_tiers(data, symbols, 'symbol')
2222
2222
 
2223
2223
  def parse_market_leverage_tiers(self, info, market: Market = None):
ccxt/kucoin.py CHANGED
@@ -2383,8 +2383,11 @@ class kucoin(Exchange, ImplicitAPI):
2383
2383
  # ]
2384
2384
  # }
2385
2385
  # }
2386
+ listData = self.safe_list(response, 'data')
2387
+ if listData is not None:
2388
+ return self.parse_orders(listData, market, since, limit)
2386
2389
  responseData = self.safe_dict(response, 'data', {})
2387
- orders = self.safe_value(responseData, 'items', responseData)
2390
+ orders = self.safe_list(responseData, 'items', [])
2388
2391
  return self.parse_orders(orders, market, since, limit)
2389
2392
 
2390
2393
  def fetch_closed_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
ccxt/kucoinfutures.py CHANGED
@@ -591,7 +591,7 @@ class kucoinfutures(kucoin, ImplicitAPI):
591
591
  # ]
592
592
  # }
593
593
  #
594
- data = self.safe_value(response, 'data', [])
594
+ data = self.safe_list(response, 'data', [])
595
595
  return self.parse_ohlcvs(data, market, timeframe, since, limit)
596
596
 
597
597
  def parse_ohlcv(self, ohlcv, market: Market = None) -> list:
@@ -1042,7 +1042,7 @@ class kucoinfutures(kucoin, ImplicitAPI):
1042
1042
  # }
1043
1043
  # }
1044
1044
  #
1045
- data = self.safe_value(response, 'data', {})
1045
+ data = self.safe_dict(response, 'data', {})
1046
1046
  return self.parse_position(data, market)
1047
1047
 
1048
1048
  def fetch_positions(self, symbols: Strings = None, params={}):
@@ -1101,7 +1101,7 @@ class kucoinfutures(kucoin, ImplicitAPI):
1101
1101
  # ]
1102
1102
  # }
1103
1103
  #
1104
- data = self.safe_value(response, 'data')
1104
+ data = self.safe_list(response, 'data')
1105
1105
  return self.parse_positions(data, symbols)
1106
1106
 
1107
1107
  def parse_position(self, position, market: Market = None):
@@ -1243,7 +1243,7 @@ class kucoinfutures(kucoin, ImplicitAPI):
1243
1243
  # },
1244
1244
  # }
1245
1245
  #
1246
- data = self.safe_value(response, 'data', {})
1246
+ data = self.safe_dict(response, 'data', {})
1247
1247
  return self.parse_order(data, market)
1248
1248
 
1249
1249
  def create_orders(self, orders: List[OrderRequest], params={}):
@@ -1289,7 +1289,7 @@ class kucoinfutures(kucoin, ImplicitAPI):
1289
1289
  # ]
1290
1290
  # }
1291
1291
  #
1292
- data = self.safe_value(response, 'data', [])
1292
+ data = self.safe_list(response, 'data', [])
1293
1293
  return self.parse_orders(data)
1294
1294
 
1295
1295
  def create_contract_order_request(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, params={}):
@@ -1658,7 +1658,7 @@ class kucoinfutures(kucoin, ImplicitAPI):
1658
1658
  # }
1659
1659
  #
1660
1660
  responseData = self.safe_value(response, 'data', {})
1661
- orders = self.safe_value(responseData, 'items', [])
1661
+ orders = self.safe_list(responseData, 'items', [])
1662
1662
  return self.parse_orders(orders, market, since, limit)
1663
1663
 
1664
1664
  def fetch_closed_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
@@ -1747,7 +1747,7 @@ class kucoinfutures(kucoin, ImplicitAPI):
1747
1747
  # }
1748
1748
  #
1749
1749
  market = self.market(symbol) if (symbol is not None) else None
1750
- responseData = self.safe_value(response, 'data')
1750
+ responseData = self.safe_dict(response, 'data')
1751
1751
  return self.parse_order(responseData, market)
1752
1752
 
1753
1753
  def parse_order(self, order, market: Market = None) -> Order:
@@ -2146,7 +2146,7 @@ class kucoinfutures(kucoin, ImplicitAPI):
2146
2146
  # ]
2147
2147
  # }
2148
2148
  #
2149
- trades = self.safe_value(response, 'data', [])
2149
+ trades = self.safe_list(response, 'data', [])
2150
2150
  return self.parse_trades(trades, market, since, limit)
2151
2151
 
2152
2152
  def parse_trade(self, trade, market: Market = None) -> Trade:
ccxt/kuna.py CHANGED
@@ -650,7 +650,7 @@ class kuna(Exchange, ImplicitAPI):
650
650
  # }
651
651
  # }
652
652
  #
653
- data = self.safe_value(response, 'data', {})
653
+ data = self.safe_dict(response, 'data', {})
654
654
  return self.parse_order_book(data, market['symbol'], None, 'bids', 'asks', 0, 1)
655
655
 
656
656
  def parse_ticker(self, ticker, market: Market = None) -> Ticker:
@@ -728,7 +728,7 @@ class kuna(Exchange, ImplicitAPI):
728
728
  # ]
729
729
  # }
730
730
  #
731
- data = self.safe_value(response, 'data', [])
731
+ data = self.safe_list(response, 'data', [])
732
732
  return self.parse_tickers(data, symbols, params)
733
733
 
734
734
  def fetch_ticker(self, symbol: str, params={}) -> Ticker:
@@ -766,7 +766,7 @@ class kuna(Exchange, ImplicitAPI):
766
766
  # }
767
767
  #
768
768
  data = self.safe_value(response, 'data', [])
769
- ticker = self.safe_value(data, 0)
769
+ ticker = self.safe_dict(data, 0)
770
770
  return self.parse_ticker(ticker, market)
771
771
 
772
772
  def fetch_l3_order_book(self, symbol: str, limit: Int = None, params={}):
@@ -968,7 +968,7 @@ class kuna(Exchange, ImplicitAPI):
968
968
  # }
969
969
  # }
970
970
  #
971
- data = self.safe_value(response, 'data', {})
971
+ data = self.safe_dict(response, 'data', {})
972
972
  return self.parse_order(data, market)
973
973
 
974
974
  def cancel_order(self, id: str, symbol: Str = None, params={}):
@@ -1023,7 +1023,7 @@ class kuna(Exchange, ImplicitAPI):
1023
1023
  # ]
1024
1024
  # }
1025
1025
  #
1026
- data = self.safe_value(response, 'data', [])
1026
+ data = self.safe_list(response, 'data', [])
1027
1027
  return self.parse_orders(data)
1028
1028
 
1029
1029
  def parse_order_status(self, status):
@@ -1165,7 +1165,7 @@ class kuna(Exchange, ImplicitAPI):
1165
1165
  # }
1166
1166
  # }
1167
1167
  #
1168
- data = self.safe_value(response, 'data', {})
1168
+ data = self.safe_dict(response, 'data', {})
1169
1169
  return self.parse_order(data)
1170
1170
 
1171
1171
  def fetch_open_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
@@ -1219,7 +1219,7 @@ class kuna(Exchange, ImplicitAPI):
1219
1219
  # ]
1220
1220
  # }
1221
1221
  #
1222
- data = self.safe_value(response, 'data', [])
1222
+ data = self.safe_list(response, 'data', [])
1223
1223
  return self.parse_orders(data, market, since, limit)
1224
1224
 
1225
1225
  def fetch_closed_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
@@ -1294,7 +1294,7 @@ class kuna(Exchange, ImplicitAPI):
1294
1294
  # ]
1295
1295
  # }
1296
1296
  #
1297
- data = self.safe_value(response, 'data', [])
1297
+ data = self.safe_list(response, 'data', [])
1298
1298
  return self.parse_orders(data, market, since, limit)
1299
1299
 
1300
1300
  def fetch_my_trades(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
@@ -1337,7 +1337,7 @@ class kuna(Exchange, ImplicitAPI):
1337
1337
  # ]
1338
1338
  # }
1339
1339
  #
1340
- data = self.safe_value(response, 'data')
1340
+ data = self.safe_list(response, 'data')
1341
1341
  return self.parse_trades(data, market, since, limit)
1342
1342
 
1343
1343
  def withdraw(self, code: str, amount: float, address, tag=None, params={}):
@@ -1384,7 +1384,7 @@ class kuna(Exchange, ImplicitAPI):
1384
1384
  # }
1385
1385
  # }
1386
1386
  #
1387
- data = self.safe_value(response, 'data', {})
1387
+ data = self.safe_dict(response, 'data', {})
1388
1388
  return self.parse_transaction(data, currency)
1389
1389
 
1390
1390
  def fetch_withdrawals(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
@@ -1445,7 +1445,7 @@ class kuna(Exchange, ImplicitAPI):
1445
1445
  # ]
1446
1446
  # }
1447
1447
  #
1448
- data = self.safe_value(response, 'data', [])
1448
+ data = self.safe_list(response, 'data', [])
1449
1449
  return self.parse_transactions(data, currency)
1450
1450
 
1451
1451
  def fetch_withdrawal(self, id: str, code: Str = None, params={}):
@@ -1483,7 +1483,7 @@ class kuna(Exchange, ImplicitAPI):
1483
1483
  # }
1484
1484
  # }
1485
1485
  #
1486
- data = self.safe_value(response, 'data', {})
1486
+ data = self.safe_dict(response, 'data', {})
1487
1487
  return self.parse_transaction(data)
1488
1488
 
1489
1489
  def create_deposit_address(self, code: str, params={}):
@@ -1509,7 +1509,7 @@ class kuna(Exchange, ImplicitAPI):
1509
1509
  # }
1510
1510
  # }
1511
1511
  #
1512
- data = self.safe_value(response, 'data', {})
1512
+ data = self.safe_dict(response, 'data', {})
1513
1513
  return self.parse_deposit_address(data, currency)
1514
1514
 
1515
1515
  def fetch_deposit_address(self, code: str, params={}):
@@ -1535,7 +1535,7 @@ class kuna(Exchange, ImplicitAPI):
1535
1535
  # }
1536
1536
  # }
1537
1537
  #
1538
- data = self.safe_value(response, 'data', {})
1538
+ data = self.safe_dict(response, 'data', {})
1539
1539
  return self.parse_deposit_address(data, currency)
1540
1540
 
1541
1541
  def parse_deposit_address(self, depositAddress, currency: Currency = None):
@@ -1626,7 +1626,7 @@ class kuna(Exchange, ImplicitAPI):
1626
1626
  # ]
1627
1627
  # }
1628
1628
  #
1629
- data = self.safe_value(response, 'data', [])
1629
+ data = self.safe_list(response, 'data', [])
1630
1630
  return self.parse_transactions(data, currency)
1631
1631
 
1632
1632
  def fetch_deposit(self, id: str, code: Str = None, params={}):
@@ -1667,7 +1667,7 @@ class kuna(Exchange, ImplicitAPI):
1667
1667
  # }
1668
1668
  # }
1669
1669
  #
1670
- data = self.safe_value(response, 'data', {})
1670
+ data = self.safe_dict(response, 'data', {})
1671
1671
  return self.parse_transaction(data, currency)
1672
1672
 
1673
1673
  def parse_transaction(self, transaction, currency: Currency = None) -> Transaction:
ccxt/latoken.py CHANGED
@@ -1382,7 +1382,7 @@ class latoken(Exchange, ImplicitAPI):
1382
1382
  currency = None
1383
1383
  if code is not None:
1384
1384
  currency = self.currency(code)
1385
- content = self.safe_value(response, 'content', [])
1385
+ content = self.safe_list(response, 'content', [])
1386
1386
  return self.parse_transactions(content, currency, since, limit)
1387
1387
 
1388
1388
  def parse_transaction(self, transaction, currency: Currency = None) -> Transaction:
@@ -1506,7 +1506,7 @@ class latoken(Exchange, ImplicitAPI):
1506
1506
  # "hasContent": True
1507
1507
  # }
1508
1508
  #
1509
- transfers = self.safe_value(response, 'content', [])
1509
+ transfers = self.safe_list(response, 'content', [])
1510
1510
  return self.parse_transfers(transfers, currency, since, limit)
1511
1511
 
1512
1512
  def transfer(self, code: str, amount: float, fromAccount: str, toAccount: str, params={}) -> TransferEntry:
ccxt/lbank.py CHANGED
@@ -633,7 +633,7 @@ class lbank(Exchange, ImplicitAPI):
633
633
  # }
634
634
  #
635
635
  data = self.safe_value(response, 'data', [])
636
- first = self.safe_value(data, 0, {})
636
+ first = self.safe_dict(data, 0, {})
637
637
  return self.parse_ticker(first, market)
638
638
 
639
639
  def fetch_tickers(self, symbols: Strings = None, params={}) -> Tickers:
@@ -707,7 +707,7 @@ class lbank(Exchange, ImplicitAPI):
707
707
  # "success": True
708
708
  # }
709
709
  #
710
- data = self.safe_value(response, 'data', [])
710
+ data = self.safe_list(response, 'data', [])
711
711
  return self.parse_tickers(data, symbols)
712
712
 
713
713
  def fetch_order_book(self, symbol: str, limit: Int = None, params={}) -> OrderBook:
@@ -930,7 +930,7 @@ class lbank(Exchange, ImplicitAPI):
930
930
  # "ts":1647021999308
931
931
  # }
932
932
  #
933
- trades = self.safe_value(response, 'data', [])
933
+ trades = self.safe_list(response, 'data', [])
934
934
  return self.parse_trades(trades, market, since, limit)
935
935
 
936
936
  def parse_ohlcv(self, ohlcv, market: Market = None) -> list:
@@ -1514,7 +1514,7 @@ class lbank(Exchange, ImplicitAPI):
1514
1514
  # "ts":1648164471827
1515
1515
  # }
1516
1516
  #
1517
- result = self.safe_value(response, 'data', {})
1517
+ result = self.safe_dict(response, 'data', {})
1518
1518
  return self.parse_order(result)
1519
1519
 
1520
1520
  def fetch_order_default(self, id: str, symbol: Str = None, params={}):
@@ -1612,7 +1612,7 @@ class lbank(Exchange, ImplicitAPI):
1612
1612
  # "ts":1648509742164
1613
1613
  # }
1614
1614
  #
1615
- trades = self.safe_value(response, 'data', [])
1615
+ trades = self.safe_list(response, 'data', [])
1616
1616
  return self.parse_trades(trades, market, since, limit)
1617
1617
 
1618
1618
  def fetch_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
@@ -1668,7 +1668,7 @@ class lbank(Exchange, ImplicitAPI):
1668
1668
  # }
1669
1669
  #
1670
1670
  result = self.safe_value(response, 'data', {})
1671
- orders = self.safe_value(result, 'orders', [])
1671
+ orders = self.safe_list(result, 'orders', [])
1672
1672
  return self.parse_orders(orders, market, since, limit)
1673
1673
 
1674
1674
  def fetch_open_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
@@ -1721,7 +1721,7 @@ class lbank(Exchange, ImplicitAPI):
1721
1721
  # }
1722
1722
  #
1723
1723
  result = self.safe_value(response, 'data', {})
1724
- orders = self.safe_value(result, 'orders', [])
1724
+ orders = self.safe_list(result, 'orders', [])
1725
1725
  return self.parse_orders(orders, market, since, limit)
1726
1726
 
1727
1727
  def cancel_order(self, id: str, symbol: Str = None, params={}):
@@ -2107,7 +2107,7 @@ class lbank(Exchange, ImplicitAPI):
2107
2107
  # }
2108
2108
  #
2109
2109
  data = self.safe_value(response, 'data', {})
2110
- deposits = self.safe_value(data, 'depositOrders', [])
2110
+ deposits = self.safe_list(data, 'depositOrders', [])
2111
2111
  return self.parse_transactions(deposits, currency, since, limit)
2112
2112
 
2113
2113
  def fetch_withdrawals(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
@@ -2160,7 +2160,7 @@ class lbank(Exchange, ImplicitAPI):
2160
2160
  # }
2161
2161
  #
2162
2162
  data = self.safe_value(response, 'data', {})
2163
- withdraws = self.safe_value(data, 'withdraws', [])
2163
+ withdraws = self.safe_list(data, 'withdraws', [])
2164
2164
  return self.parse_transactions(withdraws, currency, since, limit)
2165
2165
 
2166
2166
  def fetch_transaction_fees(self, codes: List[str] = None, params={}):
@@ -2358,7 +2358,7 @@ class lbank(Exchange, ImplicitAPI):
2358
2358
  # "code": 0
2359
2359
  # }
2360
2360
  #
2361
- data = self.safe_value(response, 'data', [])
2361
+ data = self.safe_list(response, 'data', [])
2362
2362
  return self.parse_deposit_withdraw_fees(data, codes, 'coin')
2363
2363
 
2364
2364
  def fetch_public_deposit_withdraw_fees(self, codes=None, params={}):
ccxt/luno.py CHANGED
@@ -465,7 +465,7 @@ class luno(Exchange, ImplicitAPI):
465
465
  market = self.market(symbol)
466
466
  request['pair'] = market['id']
467
467
  response = self.privateGetListorders(self.extend(request, params))
468
- orders = self.safe_value(response, 'orders', [])
468
+ orders = self.safe_list(response, 'orders', [])
469
469
  return self.parse_orders(orders, market, since, limit)
470
470
 
471
471
  def fetch_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
@@ -703,7 +703,7 @@ class luno(Exchange, ImplicitAPI):
703
703
  # ]
704
704
  # }
705
705
  #
706
- trades = self.safe_value(response, 'trades', [])
706
+ trades = self.safe_list(response, 'trades', [])
707
707
  return self.parse_trades(trades, market, since, limit)
708
708
 
709
709
  def fetch_ohlcv(self, symbol: str, timeframe='1m', since: Int = None, limit: Int = None, params={}):
@@ -745,7 +745,7 @@ class luno(Exchange, ImplicitAPI):
745
745
  # "pair": "XBTEUR"
746
746
  # }
747
747
  #
748
- ohlcvs = self.safe_value(response, 'candles', [])
748
+ ohlcvs = self.safe_list(response, 'candles', [])
749
749
  return self.parse_ohlcvs(ohlcvs, market, timeframe, since, limit)
750
750
 
751
751
  def parse_ohlcv(self, ohlcv, market: Market = None) -> list:
@@ -809,7 +809,7 @@ class luno(Exchange, ImplicitAPI):
809
809
  # ]
810
810
  # }
811
811
  #
812
- trades = self.safe_value(response, 'trades', [])
812
+ trades = self.safe_list(response, 'trades', [])
813
813
  return self.parse_trades(trades, market, since, limit)
814
814
 
815
815
  def fetch_trading_fee(self, symbol: str, params={}):
ccxt/mercado.py CHANGED
@@ -492,7 +492,7 @@ class mercado(Exchange, ImplicitAPI):
492
492
  # }
493
493
  #
494
494
  responseData = self.safe_value(response, 'response_data', {})
495
- order = self.safe_value(responseData, 'order', {})
495
+ order = self.safe_dict(responseData, 'order', {})
496
496
  return self.parse_order(order, market)
497
497
 
498
498
  def parse_order_status(self, status):
@@ -591,7 +591,7 @@ class mercado(Exchange, ImplicitAPI):
591
591
  }
592
592
  response = self.privatePostGetOrder(self.extend(request, params))
593
593
  responseData = self.safe_value(response, 'response_data', {})
594
- order = self.safe_value(responseData, 'order')
594
+ order = self.safe_dict(responseData, 'order')
595
595
  return self.parse_order(order, market)
596
596
 
597
597
  def withdraw(self, code: str, amount: float, address, tag=None, params={}):
@@ -648,7 +648,7 @@ class mercado(Exchange, ImplicitAPI):
648
648
  # }
649
649
  #
650
650
  responseData = self.safe_value(response, 'response_data', {})
651
- withdrawal = self.safe_value(responseData, 'withdrawal')
651
+ withdrawal = self.safe_dict(responseData, 'withdrawal')
652
652
  return self.parse_transaction(withdrawal, currency)
653
653
 
654
654
  def parse_transaction(self, transaction, currency: Currency = None) -> Transaction:
@@ -745,7 +745,7 @@ class mercado(Exchange, ImplicitAPI):
745
745
  }
746
746
  response = self.privatePostListOrders(self.extend(request, params))
747
747
  responseData = self.safe_value(response, 'response_data', {})
748
- orders = self.safe_value(responseData, 'orders', [])
748
+ orders = self.safe_list(responseData, 'orders', [])
749
749
  return self.parse_orders(orders, market, since, limit)
750
750
 
751
751
  def fetch_open_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
@@ -767,7 +767,7 @@ class mercado(Exchange, ImplicitAPI):
767
767
  }
768
768
  response = self.privatePostListOrders(self.extend(request, params))
769
769
  responseData = self.safe_value(response, 'response_data', {})
770
- orders = self.safe_value(responseData, 'orders', [])
770
+ orders = self.safe_list(responseData, 'orders', [])
771
771
  return self.parse_orders(orders, market, since, limit)
772
772
 
773
773
  def fetch_my_trades(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):