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
@@ -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
  async 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
  async 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
  async 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
  async def cancel_order(self, id: str, symbol: Str = None, params={}):
@@ -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
  async 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
  async def fetch_my_trades(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
@@ -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
  async 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
  async 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
  async 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
  async 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
  async 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
  async 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 = await 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
  async 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
  async 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
  async 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
  async 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
  await self.load_markets()
2161
2161
  response = await 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
  async 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
  async 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):
@@ -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):
@@ -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'
@@ -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
  async 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
  async 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
  async 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 = await 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
  async 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 = await 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
  async 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 = await 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
  async 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
  async 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
  async 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
  async 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
  async 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
  async 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
  async 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
  async 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):
@@ -1397,7 +1397,7 @@ class digifinex(Exchange, ImplicitAPI):
1397
1397
  # ]
1398
1398
  # }
1399
1399
  #
1400
- data = self.safe_value(response, 'data', [])
1400
+ data = self.safe_list(response, 'data', [])
1401
1401
  return self.parse_trades(data, market, since, limit)
1402
1402
 
1403
1403
  def parse_ohlcv(self, ohlcv, market: Market = None) -> list:
@@ -2080,7 +2080,7 @@ class digifinex(Exchange, ImplicitAPI):
2080
2080
  # ]
2081
2081
  # }
2082
2082
  #
2083
- data = self.safe_value(response, 'data', [])
2083
+ data = self.safe_list(response, 'data', [])
2084
2084
  return self.parse_orders(data, market, since, limit)
2085
2085
 
2086
2086
  async def fetch_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
@@ -2175,7 +2175,7 @@ class digifinex(Exchange, ImplicitAPI):
2175
2175
  # ]
2176
2176
  # }
2177
2177
  #
2178
- data = self.safe_value(response, 'data', [])
2178
+ data = self.safe_list(response, 'data', [])
2179
2179
  return self.parse_orders(data, market, since, limit)
2180
2180
 
2181
2181
  async def fetch_order(self, id: str, symbol: Str = None, params={}):
@@ -2354,7 +2354,7 @@ class digifinex(Exchange, ImplicitAPI):
2354
2354
  # }
2355
2355
  #
2356
2356
  responseRequest = 'data' if (marketType == 'swap') else 'list'
2357
- data = self.safe_value(response, responseRequest, [])
2357
+ data = self.safe_list(response, responseRequest, [])
2358
2358
  return self.parse_trades(data, market, since, limit)
2359
2359
 
2360
2360
  def parse_ledger_entry_type(self, type):
@@ -2581,7 +2581,7 @@ class digifinex(Exchange, ImplicitAPI):
2581
2581
  # ]
2582
2582
  # }
2583
2583
  #
2584
- data = self.safe_value(response, 'data', [])
2584
+ data = self.safe_list(response, 'data', [])
2585
2585
  return self.parse_transactions(data, currency, since, limit, {'type': type})
2586
2586
 
2587
2587
  async def fetch_deposits(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
@@ -3473,7 +3473,7 @@ class digifinex(Exchange, ImplicitAPI):
3473
3473
  # ]
3474
3474
  # }
3475
3475
  #
3476
- transfers = self.safe_value(response, 'data', [])
3476
+ transfers = self.safe_list(response, 'data', [])
3477
3477
  return self.parse_transfers(transfers, currency, since, limit)
3478
3478
 
3479
3479
  async def fetch_leverage_tiers(self, symbols: Strings = None, params={}):
@@ -3709,7 +3709,7 @@ class digifinex(Exchange, ImplicitAPI):
3709
3709
  # "code": 200,
3710
3710
  # }
3711
3711
  #
3712
- data = self.safe_value(response, 'data')
3712
+ data = self.safe_list(response, 'data')
3713
3713
  return self.parse_deposit_withdraw_fees(data, codes)
3714
3714
 
3715
3715
  def parse_deposit_withdraw_fees(self, response, codes=None, currencyIdKey=None):
@@ -3891,7 +3891,7 @@ class digifinex(Exchange, ImplicitAPI):
3891
3891
  # ]
3892
3892
  # }
3893
3893
  #
3894
- data = self.safe_value(response, 'data', [])
3894
+ data = self.safe_list(response, 'data', [])
3895
3895
  return self.parse_incomes(data, market, since, limit)
3896
3896
 
3897
3897
  def parse_income(self, income, market: Market = None):
@@ -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 = await 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
  async 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
  async 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
  async 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
  async 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
  async 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
  async 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):
@@ -889,14 +889,6 @@ class gate(Exchange, ImplicitAPI):
889
889
  super(gate, self).set_sandbox_mode(enable)
890
890
  self.options['sandboxMode'] = enable
891
891
 
892
- def convert_expire_date(self, date):
893
- # parse YYMMDD to timestamp
894
- year = date[0:2]
895
- month = date[2:4]
896
- day = date[4:6]
897
- reconstructedDate = '20' + year + '-' + month + '-' + day + 'T00:00:00Z'
898
- return reconstructedDate
899
-
900
892
  def create_expired_option_market(self, symbol: str):
901
893
  # support expired option contracts
902
894
  quote = 'USDT'
@@ -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
  async def fetch_order_trades(self, id: str, symbol: Str = None, since: Int = None, limit: Int = None, params={}):