ccxt 4.2.83__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 (152) hide show
  1. ccxt/__init__.py +1 -1
  2. ccxt/abstract/bybit.py +1 -1
  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 +12 -9
  12. ccxt/async_support/bit2c.py +1 -1
  13. ccxt/async_support/bitbank.py +8 -8
  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 +39 -28
  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 +34 -87
  28. ccxt/async_support/coincheck.py +4 -4
  29. ccxt/async_support/coinex.py +12 -13
  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 +12 -34
  45. ccxt/async_support/huobijp.py +3 -3
  46. ccxt/async_support/idex.py +2 -2
  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 +14 -2
  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 +13 -13
  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 +12 -9
  80. ccxt/bit2c.py +1 -1
  81. ccxt/bitbank.py +8 -8
  82. ccxt/bitbns.py +5 -5
  83. ccxt/bitfinex.py +1 -1
  84. ccxt/bitfinex2.py +1 -1
  85. ccxt/bitget.py +39 -28
  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 +34 -87
  96. ccxt/coincheck.py +4 -4
  97. ccxt/coinex.py +12 -13
  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 +12 -34
  113. ccxt/huobijp.py +3 -3
  114. ccxt/idex.py +2 -2
  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 +14 -2
  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 +13 -13
  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/kucoin.py +6 -7
  139. ccxt/pro/okx.py +12 -1
  140. ccxt/probit.py +11 -11
  141. ccxt/test/base/test_market.py +3 -0
  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.83.dist-info → ccxt-4.2.85.dist-info}/METADATA +4 -4
  150. {ccxt-4.2.83.dist-info → ccxt-4.2.85.dist-info}/RECORD +152 -152
  151. {ccxt-4.2.83.dist-info → ccxt-4.2.85.dist-info}/WHEEL +0 -0
  152. {ccxt-4.2.83.dist-info → ccxt-4.2.85.dist-info}/top_level.txt +0 -0
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={}):
ccxt/cryptocom.py CHANGED
@@ -625,7 +625,7 @@ class cryptocom(Exchange, ImplicitAPI):
625
625
  # }
626
626
  #
627
627
  result = self.safe_value(response, 'result', {})
628
- data = self.safe_value(result, 'data', [])
628
+ data = self.safe_list(result, 'data', [])
629
629
  return self.parse_tickers(data, symbols)
630
630
 
631
631
  def fetch_ticker(self, symbol: str, params={}) -> Ticker:
@@ -712,7 +712,7 @@ class cryptocom(Exchange, ImplicitAPI):
712
712
  # }
713
713
  #
714
714
  data = self.safe_value(response, 'result', {})
715
- orders = self.safe_value(data, 'data', [])
715
+ orders = self.safe_list(data, 'data', [])
716
716
  return self.parse_orders(orders, market, since, limit)
717
717
 
718
718
  def fetch_trades(self, symbol: str, since: Int = None, limit: Int = None, params={}) -> List[Trade]:
@@ -766,7 +766,7 @@ class cryptocom(Exchange, ImplicitAPI):
766
766
  # }
767
767
  #
768
768
  result = self.safe_value(response, 'result', {})
769
- trades = self.safe_value(result, 'data', [])
769
+ trades = self.safe_list(result, 'data', [])
770
770
  return self.parse_trades(trades, market, since, limit)
771
771
 
772
772
  def fetch_ohlcv(self, symbol: str, timeframe='1m', since: Int = None, limit: Int = None, params={}) -> List[list]:
@@ -823,7 +823,7 @@ class cryptocom(Exchange, ImplicitAPI):
823
823
  # }
824
824
  #
825
825
  result = self.safe_value(response, 'result', {})
826
- data = self.safe_value(result, 'data', [])
826
+ data = self.safe_list(result, 'data', [])
827
827
  return self.parse_ohlcvs(data, market, timeframe, since, limit)
828
828
 
829
829
  def fetch_order_book(self, symbol: str, limit: Int = None, params={}) -> OrderBook:
@@ -985,7 +985,7 @@ class cryptocom(Exchange, ImplicitAPI):
985
985
  # }
986
986
  # }
987
987
  #
988
- order = self.safe_value(response, 'result', {})
988
+ order = self.safe_dict(response, 'result', {})
989
989
  return self.parse_order(order, market)
990
990
 
991
991
  def create_order_request(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, params={}):
@@ -1102,7 +1102,7 @@ class cryptocom(Exchange, ImplicitAPI):
1102
1102
  # }
1103
1103
  # }
1104
1104
  #
1105
- result = self.safe_value(response, 'result', {})
1105
+ result = self.safe_dict(response, 'result', {})
1106
1106
  return self.parse_order(result, market)
1107
1107
 
1108
1108
  def create_orders(self, orders: List[OrderRequest], params={}):
@@ -1320,7 +1320,7 @@ class cryptocom(Exchange, ImplicitAPI):
1320
1320
  # }
1321
1321
  # }
1322
1322
  #
1323
- result = self.safe_value(response, 'result', {})
1323
+ result = self.safe_dict(response, 'result', {})
1324
1324
  return self.parse_order(result, market)
1325
1325
 
1326
1326
  def cancel_orders(self, ids, symbol: Str = None, params={}):
@@ -1349,7 +1349,7 @@ class cryptocom(Exchange, ImplicitAPI):
1349
1349
  'order_list': orderRequests,
1350
1350
  }
1351
1351
  response = self.v1PrivatePostPrivateCancelOrderList(self.extend(request, params))
1352
- result = self.safe_value(response, 'result', [])
1352
+ result = self.safe_list(response, 'result', [])
1353
1353
  return self.parse_orders(result, market, None, None, params)
1354
1354
 
1355
1355
  def fetch_open_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
@@ -1407,7 +1407,7 @@ class cryptocom(Exchange, ImplicitAPI):
1407
1407
  # }
1408
1408
  #
1409
1409
  data = self.safe_value(response, 'result', {})
1410
- orders = self.safe_value(data, 'data', [])
1410
+ orders = self.safe_list(data, 'data', [])
1411
1411
  return self.parse_orders(orders, market, since, limit)
1412
1412
 
1413
1413
  def fetch_my_trades(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
@@ -1471,7 +1471,7 @@ class cryptocom(Exchange, ImplicitAPI):
1471
1471
  # }
1472
1472
  #
1473
1473
  result = self.safe_value(response, 'result', {})
1474
- trades = self.safe_value(result, 'data', [])
1474
+ trades = self.safe_list(result, 'data', [])
1475
1475
  return self.parse_trades(trades, market, since, limit)
1476
1476
 
1477
1477
  def parse_address(self, addressString):
@@ -1529,7 +1529,7 @@ class cryptocom(Exchange, ImplicitAPI):
1529
1529
  # }
1530
1530
  # }
1531
1531
  #
1532
- result = self.safe_value(response, 'result')
1532
+ result = self.safe_dict(response, 'result')
1533
1533
  return self.parse_transaction(result, currency)
1534
1534
 
1535
1535
  def fetch_deposit_addresses_by_network(self, code: str, params={}):
@@ -1667,7 +1667,7 @@ class cryptocom(Exchange, ImplicitAPI):
1667
1667
  # }
1668
1668
  #
1669
1669
  data = self.safe_value(response, 'result', {})
1670
- depositList = self.safe_value(data, 'deposit_list', [])
1670
+ depositList = self.safe_list(data, 'deposit_list', [])
1671
1671
  return self.parse_transactions(depositList, currency, since, limit)
1672
1672
 
1673
1673
  def fetch_withdrawals(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
@@ -1722,7 +1722,7 @@ class cryptocom(Exchange, ImplicitAPI):
1722
1722
  # }
1723
1723
  #
1724
1724
  data = self.safe_value(response, 'result', {})
1725
- withdrawalList = self.safe_value(data, 'withdrawal_list', [])
1725
+ withdrawalList = self.safe_list(data, 'withdrawal_list', [])
1726
1726
  return self.parse_transactions(withdrawalList, currency, since, limit)
1727
1727
 
1728
1728
  def parse_ticker(self, ticker, market: Market = None) -> Ticker:
@@ -2160,7 +2160,7 @@ class cryptocom(Exchange, ImplicitAPI):
2160
2160
  self.load_markets()
2161
2161
  response = self.v1PrivatePostPrivateGetCurrencyNetworks(params)
2162
2162
  data = self.safe_value(response, 'result')
2163
- currencyMap = self.safe_value(data, 'currency_map')
2163
+ currencyMap = self.safe_list(data, 'currency_map')
2164
2164
  return self.parse_deposit_withdraw_fees(currencyMap, codes, 'full_name')
2165
2165
 
2166
2166
  def fetch_ledger(self, code: Str = None, since: Int = None, limit: Int = None, params={}):
@@ -2563,8 +2563,8 @@ class cryptocom(Exchange, ImplicitAPI):
2563
2563
  # }
2564
2564
  # }
2565
2565
  #
2566
- result = self.safe_value(response, 'result', {})
2567
- data = self.safe_value(result, 'data', [])
2566
+ result = self.safe_dict(response, 'result', {})
2567
+ data = self.safe_list(result, 'data', [])
2568
2568
  return self.parse_position(data[0], market)
2569
2569
 
2570
2570
  def fetch_positions(self, symbols: Strings = None, params={}):
@@ -2737,7 +2737,7 @@ class cryptocom(Exchange, ImplicitAPI):
2737
2737
  # }
2738
2738
  # }
2739
2739
  #
2740
- result = self.safe_value(response, 'result')
2740
+ result = self.safe_dict(response, 'result')
2741
2741
  return self.parse_order(result, market)
2742
2742
 
2743
2743
  def sign(self, path, api='public', method='GET', params={}, headers=None, body=None):
ccxt/currencycom.py CHANGED
@@ -1847,7 +1847,7 @@ class currencycom(Exchange, ImplicitAPI):
1847
1847
  # ]
1848
1848
  # }
1849
1849
  #
1850
- data = self.safe_value(response, 'positions', [])
1850
+ data = self.safe_list(response, 'positions', [])
1851
1851
  return self.parse_positions(data, symbols)
1852
1852
 
1853
1853
  def parse_position(self, position, market: Market = None):
ccxt/delta.py CHANGED
@@ -254,14 +254,6 @@ class delta(Exchange, ImplicitAPI):
254
254
  },
255
255
  })
256
256
 
257
- def convert_expire_date(self, date):
258
- # parse YYMMDD to timestamp
259
- year = date[0:2]
260
- month = date[2:4]
261
- day = date[4:6]
262
- reconstructedDate = '20' + year + '-' + month + '-' + day + 'T00:00:00Z'
263
- return reconstructedDate
264
-
265
257
  def create_expired_option_market(self, symbol: str):
266
258
  # support expired option contracts
267
259
  quote = 'USDT'
ccxt/deribit.py CHANGED
@@ -417,70 +417,6 @@ class deribit(Exchange, ImplicitAPI):
417
417
  },
418
418
  })
419
419
 
420
- def convert_expire_date(self, date):
421
- # parse YYMMDD to timestamp
422
- year = date[0:2]
423
- month = date[2:4]
424
- day = date[4:6]
425
- reconstructedDate = '20' + year + '-' + month + '-' + day + 'T00:00:00Z'
426
- return reconstructedDate
427
-
428
- def convert_market_id_expire_date(self, date):
429
- # parse 19JAN24 to 240119
430
- monthMappping = {
431
- 'JAN': '01',
432
- 'FEB': '02',
433
- 'MAR': '03',
434
- 'APR': '04',
435
- 'MAY': '05',
436
- 'JUN': '06',
437
- 'JUL': '07',
438
- 'AUG': '08',
439
- 'SEP': '09',
440
- 'OCT': '10',
441
- 'NOV': '11',
442
- 'DEC': '12',
443
- }
444
- year = date[0:2]
445
- monthName = date[2:5]
446
- month = self.safe_string(monthMappping, monthName)
447
- day = date[5:7]
448
- reconstructedDate = day + month + year
449
- return reconstructedDate
450
-
451
- def convert_expire_date_to_market_id_date(self, date):
452
- # parse 240119 to 19JAN24
453
- year = date[0:2]
454
- monthRaw = date[2:4]
455
- month = None
456
- day = date[4:6]
457
- if monthRaw == '01':
458
- month = 'JAN'
459
- elif monthRaw == '02':
460
- month = 'FEB'
461
- elif monthRaw == '03':
462
- month = 'MAR'
463
- elif monthRaw == '04':
464
- month = 'APR'
465
- elif monthRaw == '05':
466
- month = 'MAY'
467
- elif monthRaw == '06':
468
- month = 'JUN'
469
- elif monthRaw == '07':
470
- month = 'JUL'
471
- elif monthRaw == '08':
472
- month = 'AUG'
473
- elif monthRaw == '09':
474
- month = 'SEP'
475
- elif monthRaw == '10':
476
- month = 'OCT'
477
- elif monthRaw == '11':
478
- month = 'NOV'
479
- elif monthRaw == '12':
480
- month = 'DEC'
481
- reconstructedDate = day + month + year
482
- return reconstructedDate
483
-
484
420
  def create_expired_option_market(self, symbol: str):
485
421
  # support expired option contracts
486
422
  quote = 'USD'
@@ -1231,7 +1167,7 @@ class deribit(Exchange, ImplicitAPI):
1231
1167
  # "testnet": False
1232
1168
  # }
1233
1169
  #
1234
- result = self.safe_value(response, 'result')
1170
+ result = self.safe_dict(response, 'result')
1235
1171
  return self.parse_ticker(result, market)
1236
1172
 
1237
1173
  def fetch_tickers(self, symbols: Strings = None, params={}) -> Tickers:
@@ -1496,7 +1432,7 @@ class deribit(Exchange, ImplicitAPI):
1496
1432
  # }
1497
1433
  #
1498
1434
  result = self.safe_value(response, 'result', {})
1499
- trades = self.safe_value(result, 'trades', [])
1435
+ trades = self.safe_list(result, 'trades', [])
1500
1436
  return self.parse_trades(trades, market, since, limit)
1501
1437
 
1502
1438
  def fetch_trading_fees(self, params={}):
@@ -1836,7 +1772,7 @@ class deribit(Exchange, ImplicitAPI):
1836
1772
  # }
1837
1773
  # }
1838
1774
  #
1839
- result = self.safe_value(response, 'result')
1775
+ result = self.safe_dict(response, 'result')
1840
1776
  return self.parse_order(result, market)
1841
1777
 
1842
1778
  def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, params={}):
@@ -2050,7 +1986,7 @@ class deribit(Exchange, ImplicitAPI):
2050
1986
  'order_id': id,
2051
1987
  }
2052
1988
  response = self.privateGetCancel(self.extend(request, params))
2053
- result = self.safe_value(response, 'result', {})
1989
+ result = self.safe_dict(response, 'result', {})
2054
1990
  return self.parse_order(result)
2055
1991
 
2056
1992
  def cancel_all_orders(self, symbol: Str = None, params={}):
@@ -2097,7 +2033,7 @@ class deribit(Exchange, ImplicitAPI):
2097
2033
  market = self.market(symbol)
2098
2034
  request['instrument_name'] = market['id']
2099
2035
  response = self.privateGetGetOpenOrdersByInstrument(self.extend(request, params))
2100
- result = self.safe_value(response, 'result', [])
2036
+ result = self.safe_list(response, 'result', [])
2101
2037
  return self.parse_orders(result, market, since, limit)
2102
2038
 
2103
2039
  def fetch_closed_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
@@ -2124,7 +2060,7 @@ class deribit(Exchange, ImplicitAPI):
2124
2060
  market = self.market(symbol)
2125
2061
  request['instrument_name'] = market['id']
2126
2062
  response = self.privateGetGetOrderHistoryByInstrument(self.extend(request, params))
2127
- result = self.safe_value(response, 'result', [])
2063
+ result = self.safe_list(response, 'result', [])
2128
2064
  return self.parse_orders(result, market, since, limit)
2129
2065
 
2130
2066
  def fetch_order_trades(self, id: str, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
@@ -2176,7 +2112,7 @@ class deribit(Exchange, ImplicitAPI):
2176
2112
  # }
2177
2113
  # }
2178
2114
  #
2179
- result = self.safe_value(response, 'result', {})
2115
+ result = self.safe_list(response, 'result', [])
2180
2116
  return self.parse_trades(result, None, since, limit)
2181
2117
 
2182
2118
  def fetch_my_trades(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
@@ -2251,7 +2187,7 @@ class deribit(Exchange, ImplicitAPI):
2251
2187
  # }
2252
2188
  #
2253
2189
  result = self.safe_value(response, 'result', {})
2254
- trades = self.safe_value(result, 'trades', [])
2190
+ trades = self.safe_list(result, 'trades', [])
2255
2191
  return self.parse_trades(trades, market, since, limit)
2256
2192
 
2257
2193
  def fetch_deposits(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
@@ -2295,7 +2231,7 @@ class deribit(Exchange, ImplicitAPI):
2295
2231
  # }
2296
2232
  #
2297
2233
  result = self.safe_value(response, 'result', {})
2298
- data = self.safe_value(result, 'data', [])
2234
+ data = self.safe_list(result, 'data', [])
2299
2235
  return self.parse_transactions(data, currency, since, limit, params)
2300
2236
 
2301
2237
  def fetch_withdrawals(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
@@ -2343,7 +2279,7 @@ class deribit(Exchange, ImplicitAPI):
2343
2279
  # }
2344
2280
  #
2345
2281
  result = self.safe_value(response, 'result', {})
2346
- data = self.safe_value(result, 'data', [])
2282
+ data = self.safe_list(result, 'data', [])
2347
2283
  return self.parse_transactions(data, currency, since, limit, params)
2348
2284
 
2349
2285
  def parse_transaction_status(self, status):
@@ -2527,7 +2463,7 @@ class deribit(Exchange, ImplicitAPI):
2527
2463
  # }
2528
2464
  # }
2529
2465
  #
2530
- result = self.safe_value(response, 'result')
2466
+ result = self.safe_dict(response, 'result')
2531
2467
  return self.parse_position(result)
2532
2468
 
2533
2469
  def fetch_positions(self, symbols: Strings = None, params={}):
@@ -2592,7 +2528,7 @@ class deribit(Exchange, ImplicitAPI):
2592
2528
  # ]
2593
2529
  # }
2594
2530
  #
2595
- result = self.safe_value(response, 'result')
2531
+ result = self.safe_list(response, 'result')
2596
2532
  return self.parse_positions(result, symbols)
2597
2533
 
2598
2534
  def fetch_volatility_history(self, code: str, params={}):
@@ -2707,7 +2643,7 @@ class deribit(Exchange, ImplicitAPI):
2707
2643
  # }
2708
2644
  #
2709
2645
  result = self.safe_value(response, 'result', {})
2710
- transfers = self.safe_value(result, 'data', [])
2646
+ transfers = self.safe_list(result, 'data', [])
2711
2647
  return self.parse_transfers(transfers, currency, since, limit, params)
2712
2648
 
2713
2649
  def transfer(self, code: str, amount: float, fromAccount: str, toAccount: str, params={}) -> TransferEntry:
@@ -2756,7 +2692,7 @@ class deribit(Exchange, ImplicitAPI):
2756
2692
  # }
2757
2693
  # }
2758
2694
  #
2759
- result = self.safe_value(response, 'result', {})
2695
+ result = self.safe_dict(response, 'result', {})
2760
2696
  return self.parse_transfer(result, currency)
2761
2697
 
2762
2698
  def parse_transfer(self, transfer, currency: Currency = None):
@@ -2884,7 +2820,7 @@ class deribit(Exchange, ImplicitAPI):
2884
2820
  # "testnet": True
2885
2821
  # }
2886
2822
  #
2887
- data = self.safe_value(response, 'result', {})
2823
+ data = self.safe_list(response, 'result', [])
2888
2824
  return self.parse_deposit_withdraw_fees(data, codes, 'currency')
2889
2825
 
2890
2826
  def fetch_funding_rate(self, symbol: str, params={}):
@@ -3129,7 +3065,7 @@ class deribit(Exchange, ImplicitAPI):
3129
3065
  # }
3130
3066
  #
3131
3067
  result = self.safe_value(response, 'result', {})
3132
- settlements = self.safe_value(result, 'settlements', [])
3068
+ settlements = self.safe_list(result, 'settlements', [])
3133
3069
  return self.parse_liquidations(settlements, market, since, limit)
3134
3070
 
3135
3071
  def parse_liquidation(self, liquidation, market: Market = None):
ccxt/digifinex.py CHANGED
@@ -1396,7 +1396,7 @@ class digifinex(Exchange, ImplicitAPI):
1396
1396
  # ]
1397
1397
  # }
1398
1398
  #
1399
- data = self.safe_value(response, 'data', [])
1399
+ data = self.safe_list(response, 'data', [])
1400
1400
  return self.parse_trades(data, market, since, limit)
1401
1401
 
1402
1402
  def parse_ohlcv(self, ohlcv, market: Market = None) -> list:
@@ -2079,7 +2079,7 @@ class digifinex(Exchange, ImplicitAPI):
2079
2079
  # ]
2080
2080
  # }
2081
2081
  #
2082
- data = self.safe_value(response, 'data', [])
2082
+ data = self.safe_list(response, 'data', [])
2083
2083
  return self.parse_orders(data, market, since, limit)
2084
2084
 
2085
2085
  def fetch_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
@@ -2174,7 +2174,7 @@ class digifinex(Exchange, ImplicitAPI):
2174
2174
  # ]
2175
2175
  # }
2176
2176
  #
2177
- data = self.safe_value(response, 'data', [])
2177
+ data = self.safe_list(response, 'data', [])
2178
2178
  return self.parse_orders(data, market, since, limit)
2179
2179
 
2180
2180
  def fetch_order(self, id: str, symbol: Str = None, params={}):
@@ -2353,7 +2353,7 @@ class digifinex(Exchange, ImplicitAPI):
2353
2353
  # }
2354
2354
  #
2355
2355
  responseRequest = 'data' if (marketType == 'swap') else 'list'
2356
- data = self.safe_value(response, responseRequest, [])
2356
+ data = self.safe_list(response, responseRequest, [])
2357
2357
  return self.parse_trades(data, market, since, limit)
2358
2358
 
2359
2359
  def parse_ledger_entry_type(self, type):
@@ -2580,7 +2580,7 @@ class digifinex(Exchange, ImplicitAPI):
2580
2580
  # ]
2581
2581
  # }
2582
2582
  #
2583
- data = self.safe_value(response, 'data', [])
2583
+ data = self.safe_list(response, 'data', [])
2584
2584
  return self.parse_transactions(data, currency, since, limit, {'type': type})
2585
2585
 
2586
2586
  def fetch_deposits(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
@@ -3472,7 +3472,7 @@ class digifinex(Exchange, ImplicitAPI):
3472
3472
  # ]
3473
3473
  # }
3474
3474
  #
3475
- transfers = self.safe_value(response, 'data', [])
3475
+ transfers = self.safe_list(response, 'data', [])
3476
3476
  return self.parse_transfers(transfers, currency, since, limit)
3477
3477
 
3478
3478
  def fetch_leverage_tiers(self, symbols: Strings = None, params={}):
@@ -3708,7 +3708,7 @@ class digifinex(Exchange, ImplicitAPI):
3708
3708
  # "code": 200,
3709
3709
  # }
3710
3710
  #
3711
- data = self.safe_value(response, 'data')
3711
+ data = self.safe_list(response, 'data')
3712
3712
  return self.parse_deposit_withdraw_fees(data, codes)
3713
3713
 
3714
3714
  def parse_deposit_withdraw_fees(self, response, codes=None, currencyIdKey=None):
@@ -3890,7 +3890,7 @@ class digifinex(Exchange, ImplicitAPI):
3890
3890
  # ]
3891
3891
  # }
3892
3892
  #
3893
- data = self.safe_value(response, 'data', [])
3893
+ data = self.safe_list(response, 'data', [])
3894
3894
  return self.parse_incomes(data, market, since, limit)
3895
3895
 
3896
3896
  def parse_income(self, income, market: Market = None):
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={}):