ccxt 4.2.84__py2.py3-none-any.whl → 4.2.86__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.

Potentially problematic release.


This version of ccxt might be problematic. Click here for more details.

Files changed (152) hide show
  1. ccxt/__init__.py +1 -1
  2. ccxt/abstract/coinex.py +232 -123
  3. ccxt/ace.py +5 -5
  4. ccxt/ascendex.py +8 -8
  5. ccxt/async_support/__init__.py +1 -1
  6. ccxt/async_support/ace.py +5 -5
  7. ccxt/async_support/ascendex.py +8 -8
  8. ccxt/async_support/base/exchange.py +3 -27
  9. ccxt/async_support/bigone.py +12 -12
  10. ccxt/async_support/binance.py +20 -32
  11. ccxt/async_support/bingx.py +45 -28
  12. ccxt/async_support/bit2c.py +1 -1
  13. ccxt/async_support/bitbank.py +27 -29
  14. ccxt/async_support/bitbns.py +5 -5
  15. ccxt/async_support/bitfinex.py +1 -1
  16. ccxt/async_support/bitfinex2.py +1 -1
  17. ccxt/async_support/bitget.py +29 -24
  18. ccxt/async_support/bithumb.py +5 -5
  19. ccxt/async_support/bitmart.py +16 -16
  20. ccxt/async_support/bitopro.py +1 -1
  21. ccxt/async_support/bitrue.py +4 -4
  22. ccxt/async_support/bitso.py +5 -5
  23. ccxt/async_support/bitstamp.py +1 -1
  24. ccxt/async_support/bitteam.py +8 -8
  25. ccxt/async_support/bl3p.py +1 -1
  26. ccxt/async_support/btcturk.py +6 -6
  27. ccxt/async_support/bybit.py +30 -83
  28. ccxt/async_support/coincheck.py +4 -4
  29. ccxt/async_support/coinex.py +404 -262
  30. ccxt/async_support/coinlist.py +7 -7
  31. ccxt/async_support/coinmate.py +4 -4
  32. ccxt/async_support/coinmetro.py +3 -3
  33. ccxt/async_support/coinone.py +5 -5
  34. ccxt/async_support/coinspot.py +2 -2
  35. ccxt/async_support/cryptocom.py +17 -17
  36. ccxt/async_support/currencycom.py +1 -1
  37. ccxt/async_support/delta.py +0 -8
  38. ccxt/async_support/deribit.py +16 -80
  39. ccxt/async_support/digifinex.py +8 -8
  40. ccxt/async_support/exmo.py +8 -8
  41. ccxt/async_support/gate.py +0 -8
  42. ccxt/async_support/hitbtc.py +5 -4
  43. ccxt/async_support/hollaex.py +7 -7
  44. ccxt/async_support/htx.py +7 -7
  45. ccxt/async_support/huobijp.py +3 -3
  46. ccxt/async_support/idex.py +12 -12
  47. ccxt/async_support/independentreserve.py +2 -2
  48. ccxt/async_support/indodax.py +2 -2
  49. ccxt/async_support/kraken.py +8 -8
  50. ccxt/async_support/krakenfutures.py +6 -6
  51. ccxt/async_support/kucoin.py +4 -1
  52. ccxt/async_support/kucoinfutures.py +8 -8
  53. ccxt/async_support/kuna.py +16 -16
  54. ccxt/async_support/latoken.py +2 -2
  55. ccxt/async_support/lbank.py +10 -10
  56. ccxt/async_support/luno.py +4 -4
  57. ccxt/async_support/mercado.py +5 -5
  58. ccxt/async_support/mexc.py +6 -6
  59. ccxt/async_support/ndax.py +1 -1
  60. ccxt/async_support/novadax.py +9 -9
  61. ccxt/async_support/oceanex.py +7 -7
  62. ccxt/async_support/okcoin.py +15 -14
  63. ccxt/async_support/okx.py +23 -31
  64. ccxt/async_support/onetrading.py +4 -4
  65. ccxt/async_support/p2b.py +7 -7
  66. ccxt/async_support/phemex.py +12 -12
  67. ccxt/async_support/poloniexfutures.py +5 -5
  68. ccxt/async_support/probit.py +11 -11
  69. ccxt/async_support/timex.py +7 -7
  70. ccxt/async_support/tokocrypto.py +9 -9
  71. ccxt/async_support/wavesexchange.py +3 -3
  72. ccxt/async_support/whitebit.py +5 -5
  73. ccxt/async_support/woo.py +1 -1
  74. ccxt/async_support/zaif.py +1 -1
  75. ccxt/async_support/zonda.py +7 -7
  76. ccxt/base/exchange.py +66 -23
  77. ccxt/bigone.py +12 -12
  78. ccxt/binance.py +20 -32
  79. ccxt/bingx.py +45 -28
  80. ccxt/bit2c.py +1 -1
  81. ccxt/bitbank.py +27 -29
  82. ccxt/bitbns.py +5 -5
  83. ccxt/bitfinex.py +1 -1
  84. ccxt/bitfinex2.py +1 -1
  85. ccxt/bitget.py +29 -24
  86. ccxt/bithumb.py +5 -5
  87. ccxt/bitmart.py +16 -16
  88. ccxt/bitopro.py +1 -1
  89. ccxt/bitrue.py +4 -4
  90. ccxt/bitso.py +5 -5
  91. ccxt/bitstamp.py +1 -1
  92. ccxt/bitteam.py +8 -8
  93. ccxt/bl3p.py +1 -1
  94. ccxt/btcturk.py +6 -6
  95. ccxt/bybit.py +30 -83
  96. ccxt/coincheck.py +4 -4
  97. ccxt/coinex.py +404 -262
  98. ccxt/coinlist.py +7 -7
  99. ccxt/coinmate.py +4 -4
  100. ccxt/coinmetro.py +3 -3
  101. ccxt/coinone.py +5 -5
  102. ccxt/coinspot.py +2 -2
  103. ccxt/cryptocom.py +17 -17
  104. ccxt/currencycom.py +1 -1
  105. ccxt/delta.py +0 -8
  106. ccxt/deribit.py +16 -80
  107. ccxt/digifinex.py +8 -8
  108. ccxt/exmo.py +8 -8
  109. ccxt/gate.py +0 -8
  110. ccxt/hitbtc.py +5 -4
  111. ccxt/hollaex.py +7 -7
  112. ccxt/htx.py +7 -7
  113. ccxt/huobijp.py +3 -3
  114. ccxt/idex.py +12 -12
  115. ccxt/independentreserve.py +2 -2
  116. ccxt/indodax.py +2 -2
  117. ccxt/kraken.py +8 -8
  118. ccxt/krakenfutures.py +6 -6
  119. ccxt/kucoin.py +4 -1
  120. ccxt/kucoinfutures.py +8 -8
  121. ccxt/kuna.py +16 -16
  122. ccxt/latoken.py +2 -2
  123. ccxt/lbank.py +10 -10
  124. ccxt/luno.py +4 -4
  125. ccxt/mercado.py +5 -5
  126. ccxt/mexc.py +6 -6
  127. ccxt/ndax.py +1 -1
  128. ccxt/novadax.py +9 -9
  129. ccxt/oceanex.py +7 -7
  130. ccxt/okcoin.py +15 -14
  131. ccxt/okx.py +23 -31
  132. ccxt/onetrading.py +4 -4
  133. ccxt/p2b.py +7 -7
  134. ccxt/phemex.py +12 -12
  135. ccxt/poloniexfutures.py +5 -5
  136. ccxt/pro/__init__.py +1 -1
  137. ccxt/pro/binance.py +150 -112
  138. ccxt/pro/bitget.py +1 -0
  139. ccxt/pro/kucoin.py +6 -7
  140. ccxt/pro/okx.py +12 -1
  141. ccxt/probit.py +11 -11
  142. ccxt/timex.py +7 -7
  143. ccxt/tokocrypto.py +9 -9
  144. ccxt/wavesexchange.py +3 -3
  145. ccxt/whitebit.py +5 -5
  146. ccxt/woo.py +1 -1
  147. ccxt/zaif.py +1 -1
  148. ccxt/zonda.py +7 -7
  149. {ccxt-4.2.84.dist-info → ccxt-4.2.86.dist-info}/METADATA +6 -6
  150. {ccxt-4.2.84.dist-info → ccxt-4.2.86.dist-info}/RECORD +152 -152
  151. {ccxt-4.2.84.dist-info → ccxt-4.2.86.dist-info}/WHEEL +0 -0
  152. {ccxt-4.2.84.dist-info → ccxt-4.2.86.dist-info}/top_level.txt +0 -0
ccxt/exmo.py CHANGED
@@ -854,7 +854,7 @@ class exmo(Exchange, ImplicitAPI):
854
854
  # ]
855
855
  # }
856
856
  #
857
- candles = self.safe_value(response, 'candles', [])
857
+ candles = self.safe_list(response, 'candles', [])
858
858
  return self.parse_ohlcvs(candles, market, timeframe, since, limit)
859
859
 
860
860
  def parse_ohlcv(self, ohlcv, market: Market = None) -> list:
@@ -967,7 +967,7 @@ class exmo(Exchange, ImplicitAPI):
967
967
  if limit is not None:
968
968
  request['limit'] = limit
969
969
  response = self.publicGetOrderBook(self.extend(request, params))
970
- result = self.safe_value(response, market['id'])
970
+ result = self.safe_dict(response, market['id'])
971
971
  return self.parse_order_book(result, market['symbol'], None, 'bid', 'ask')
972
972
 
973
973
  def fetch_order_books(self, symbols: Strings = None, limit: Int = None, params={}):
@@ -1218,7 +1218,7 @@ class exmo(Exchange, ImplicitAPI):
1218
1218
  # ]
1219
1219
  # }
1220
1220
  #
1221
- data = self.safe_value(response, market['id'], [])
1221
+ data = self.safe_list(response, market['id'], [])
1222
1222
  return self.parse_trades(data, market, since, limit)
1223
1223
 
1224
1224
  def fetch_my_trades(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
@@ -1558,7 +1558,7 @@ class exmo(Exchange, ImplicitAPI):
1558
1558
  # ]
1559
1559
  # }
1560
1560
  #
1561
- trades = self.safe_value(response, 'trades')
1561
+ trades = self.safe_list(response, 'trades')
1562
1562
  return self.parse_trades(trades, market, since, limit)
1563
1563
 
1564
1564
  def fetch_open_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
@@ -2240,7 +2240,7 @@ class exmo(Exchange, ImplicitAPI):
2240
2240
  # "count": 23
2241
2241
  # }
2242
2242
  #
2243
- items = self.safe_value(response, 'items', [])
2243
+ items = self.safe_list(response, 'items', [])
2244
2244
  return self.parse_transactions(items, currency, since, limit)
2245
2245
 
2246
2246
  def fetch_withdrawal(self, id: str, code: Str = None, params={}):
@@ -2289,7 +2289,7 @@ class exmo(Exchange, ImplicitAPI):
2289
2289
  # }
2290
2290
  #
2291
2291
  items = self.safe_value(response, 'items', [])
2292
- first = self.safe_value(items, 0, {})
2292
+ first = self.safe_dict(items, 0, {})
2293
2293
  return self.parse_transaction(first, currency)
2294
2294
 
2295
2295
  def fetch_deposit(self, id=None, code: Str = None, params={}):
@@ -2338,7 +2338,7 @@ class exmo(Exchange, ImplicitAPI):
2338
2338
  # }
2339
2339
  #
2340
2340
  items = self.safe_value(response, 'items', [])
2341
- first = self.safe_value(items, 0, {})
2341
+ first = self.safe_dict(items, 0, {})
2342
2342
  return self.parse_transaction(first, currency)
2343
2343
 
2344
2344
  def fetch_deposits(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
@@ -2388,7 +2388,7 @@ class exmo(Exchange, ImplicitAPI):
2388
2388
  # "count": 23
2389
2389
  # }
2390
2390
  #
2391
- items = self.safe_value(response, 'items', [])
2391
+ items = self.safe_list(response, 'items', [])
2392
2392
  return self.parse_transactions(items, currency, since, limit)
2393
2393
 
2394
2394
  def sign(self, path, api='public', method='GET', params={}, headers=None, body=None):
ccxt/gate.py CHANGED
@@ -888,14 +888,6 @@ class gate(Exchange, ImplicitAPI):
888
888
  super(gate, self).set_sandbox_mode(enable)
889
889
  self.options['sandboxMode'] = enable
890
890
 
891
- def convert_expire_date(self, date):
892
- # parse YYMMDD to timestamp
893
- year = date[0:2]
894
- month = date[2:4]
895
- day = date[4:6]
896
- reconstructedDate = '20' + year + '-' + month + '-' + day + 'T00:00:00Z'
897
- return reconstructedDate
898
-
899
891
  def create_expired_option_market(self, symbol: str):
900
892
  # support expired option contracts
901
893
  quote = 'USDT'
ccxt/hitbtc.py CHANGED
@@ -1404,15 +1404,16 @@ class hitbtc(Exchange, ImplicitAPI):
1404
1404
  # ],
1405
1405
  # "fee": "1.22" # only for WITHDRAW
1406
1406
  # }
1407
- # }
1408
- #
1407
+ # },
1408
+ # "operation_id": "084cfcd5-06b9-4826-882e-fdb75ec3625d", # only for WITHDRAW
1409
+ # "commit_risk": {}
1409
1410
  # withdraw
1410
1411
  #
1411
1412
  # {
1412
1413
  # "id":"084cfcd5-06b9-4826-882e-fdb75ec3625d"
1413
1414
  # }
1414
1415
  #
1415
- id = self.safe_string(transaction, 'id')
1416
+ id = self.safe_string_2(transaction, 'operation_id', 'id')
1416
1417
  timestamp = self.parse8601(self.safe_string(transaction, 'created_at'))
1417
1418
  updated = self.parse8601(self.safe_string(transaction, 'updated_at'))
1418
1419
  type = self.parse_transaction_type(self.safe_string(transaction, 'type'))
@@ -1830,7 +1831,7 @@ class hitbtc(Exchange, ImplicitAPI):
1830
1831
  # }
1831
1832
  # ]
1832
1833
  #
1833
- order = self.safe_value(response, 0)
1834
+ order = self.safe_dict(response, 0)
1834
1835
  return self.parse_order(order, market)
1835
1836
 
1836
1837
  def fetch_order_trades(self, id: str, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
ccxt/hollaex.py CHANGED
@@ -622,7 +622,7 @@ class hollaex(Exchange, ImplicitAPI):
622
622
  # ]
623
623
  # }
624
624
  #
625
- trades = self.safe_value(response, market['id'], [])
625
+ trades = self.safe_list(response, market['id'], [])
626
626
  return self.parse_trades(trades, market, since, limit)
627
627
 
628
628
  def parse_trade(self, trade, market: Market = None) -> Trade:
@@ -1017,7 +1017,7 @@ class hollaex(Exchange, ImplicitAPI):
1017
1017
  # ]
1018
1018
  # }
1019
1019
  #
1020
- data = self.safe_value(response, 'data', [])
1020
+ data = self.safe_list(response, 'data', [])
1021
1021
  return self.parse_orders(data, market, since, limit)
1022
1022
 
1023
1023
  def parse_order_status(self, status):
@@ -1266,7 +1266,7 @@ class hollaex(Exchange, ImplicitAPI):
1266
1266
  # ]
1267
1267
  # }
1268
1268
  #
1269
- data = self.safe_value(response, 'data', [])
1269
+ data = self.safe_list(response, 'data', [])
1270
1270
  return self.parse_trades(data, market, since, limit)
1271
1271
 
1272
1272
  def parse_deposit_address(self, depositAddress, currency: Currency = None):
@@ -1411,7 +1411,7 @@ class hollaex(Exchange, ImplicitAPI):
1411
1411
  # ]
1412
1412
  # }
1413
1413
  #
1414
- data = self.safe_value(response, 'data', [])
1414
+ data = self.safe_list(response, 'data', [])
1415
1415
  return self.parse_transactions(data, currency, since, limit)
1416
1416
 
1417
1417
  def fetch_withdrawal(self, id: str, code: Str = None, params={}):
@@ -1456,7 +1456,7 @@ class hollaex(Exchange, ImplicitAPI):
1456
1456
  # }
1457
1457
  #
1458
1458
  data = self.safe_value(response, 'data', [])
1459
- transaction = self.safe_value(data, 0, {})
1459
+ transaction = self.safe_dict(data, 0, {})
1460
1460
  return self.parse_transaction(transaction, currency)
1461
1461
 
1462
1462
  def fetch_withdrawals(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
@@ -1511,7 +1511,7 @@ class hollaex(Exchange, ImplicitAPI):
1511
1511
  # ]
1512
1512
  # }
1513
1513
  #
1514
- data = self.safe_value(response, 'data', [])
1514
+ data = self.safe_list(response, 'data', [])
1515
1515
  return self.parse_transactions(data, currency, since, limit)
1516
1516
 
1517
1517
  def parse_transaction(self, transaction, currency: Currency = None) -> Transaction:
@@ -1757,7 +1757,7 @@ class hollaex(Exchange, ImplicitAPI):
1757
1757
  # "network":"https://api.hollaex.network"
1758
1758
  # }
1759
1759
  #
1760
- coins = self.safe_value(response, 'coins')
1760
+ coins = self.safe_list(response, 'coins')
1761
1761
  return self.parse_deposit_withdraw_fees(coins, codes, 'symbol')
1762
1762
 
1763
1763
  def normalize_number_if_needed(self, number):
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
@@ -173,13 +173,15 @@ class idex(Exchange, ImplicitAPI):
173
173
  'network': 'MATIC',
174
174
  },
175
175
  'exceptions': {
176
- 'INVALID_ORDER_QUANTITY': InvalidOrder,
177
- 'INSUFFICIENT_FUNDS': InsufficientFunds,
178
- 'SERVICE_UNAVAILABLE': ExchangeNotAvailable,
179
- 'EXCEEDED_RATE_LIMIT': DDoSProtection,
180
- 'INVALID_PARAMETER': BadRequest,
181
- 'WALLET_NOT_ASSOCIATED': InvalidAddress,
182
- 'INVALID_WALLET_SIGNATURE': AuthenticationError,
176
+ 'exact': {
177
+ 'INVALID_ORDER_QUANTITY': InvalidOrder,
178
+ 'INSUFFICIENT_FUNDS': InsufficientFunds,
179
+ 'SERVICE_UNAVAILABLE': ExchangeNotAvailable,
180
+ 'EXCEEDED_RATE_LIMIT': DDoSProtection,
181
+ 'INVALID_PARAMETER': BadRequest,
182
+ 'WALLET_NOT_ASSOCIATED': InvalidAddress,
183
+ 'INVALID_WALLET_SIGNATURE': AuthenticationError,
184
+ },
183
185
  },
184
186
  'requiredCredentials': {
185
187
  'walletAddress': True,
@@ -363,7 +365,7 @@ class idex(Exchange, ImplicitAPI):
363
365
  # }
364
366
  # ]
365
367
  response = self.publicGetTickers(self.extend(request, params))
366
- ticker = self.safe_value(response, 0)
368
+ ticker = self.safe_dict(response, 0)
367
369
  return self.parse_ticker(ticker, market)
368
370
 
369
371
  def fetch_tickers(self, symbols: Strings = None, params={}) -> Tickers:
@@ -1407,16 +1409,14 @@ class idex(Exchange, ImplicitAPI):
1407
1409
  }
1408
1410
  # [{orderId: "688336f0-ec50-11ea-9842-b332f8a34d0e"}]
1409
1411
  response = self.privateDeleteOrders(self.extend(request, params))
1410
- canceledOrder = self.safe_value(response, 0)
1412
+ canceledOrder = self.safe_dict(response, 0)
1411
1413
  return self.parse_order(canceledOrder, market)
1412
1414
 
1413
1415
  def handle_errors(self, code, reason, url, method, headers, body, response, requestHeaders, requestBody):
1414
1416
  errorCode = self.safe_string(response, 'code')
1415
1417
  message = self.safe_string(response, 'message')
1416
- if errorCode in self.exceptions:
1417
- Exception = self.exceptions[errorCode]
1418
- raise Exception(self.id + ' ' + message)
1419
1418
  if errorCode is not None:
1419
+ self.throw_exactly_matched_exception(self.exceptions['exact'], errorCode, message)
1420
1420
  raise ExchangeError(self.id + ' ' + message)
1421
1421
  return None
1422
1422
 
@@ -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: