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/kuna.py CHANGED
@@ -650,7 +650,7 @@ class kuna(Exchange, ImplicitAPI):
650
650
  # }
651
651
  # }
652
652
  #
653
- data = self.safe_value(response, 'data', {})
653
+ data = self.safe_dict(response, 'data', {})
654
654
  return self.parse_order_book(data, market['symbol'], None, 'bids', 'asks', 0, 1)
655
655
 
656
656
  def parse_ticker(self, ticker, market: Market = None) -> Ticker:
@@ -728,7 +728,7 @@ class kuna(Exchange, ImplicitAPI):
728
728
  # ]
729
729
  # }
730
730
  #
731
- data = self.safe_value(response, 'data', [])
731
+ data = self.safe_list(response, 'data', [])
732
732
  return self.parse_tickers(data, symbols, params)
733
733
 
734
734
  def fetch_ticker(self, symbol: str, params={}) -> Ticker:
@@ -766,7 +766,7 @@ class kuna(Exchange, ImplicitAPI):
766
766
  # }
767
767
  #
768
768
  data = self.safe_value(response, 'data', [])
769
- ticker = self.safe_value(data, 0)
769
+ ticker = self.safe_dict(data, 0)
770
770
  return self.parse_ticker(ticker, market)
771
771
 
772
772
  def fetch_l3_order_book(self, symbol: str, limit: Int = None, params={}):
@@ -968,7 +968,7 @@ class kuna(Exchange, ImplicitAPI):
968
968
  # }
969
969
  # }
970
970
  #
971
- data = self.safe_value(response, 'data', {})
971
+ data = self.safe_dict(response, 'data', {})
972
972
  return self.parse_order(data, market)
973
973
 
974
974
  def cancel_order(self, id: str, symbol: Str = None, params={}):
@@ -1023,7 +1023,7 @@ class kuna(Exchange, ImplicitAPI):
1023
1023
  # ]
1024
1024
  # }
1025
1025
  #
1026
- data = self.safe_value(response, 'data', [])
1026
+ data = self.safe_list(response, 'data', [])
1027
1027
  return self.parse_orders(data)
1028
1028
 
1029
1029
  def parse_order_status(self, status):
@@ -1165,7 +1165,7 @@ class kuna(Exchange, ImplicitAPI):
1165
1165
  # }
1166
1166
  # }
1167
1167
  #
1168
- data = self.safe_value(response, 'data', {})
1168
+ data = self.safe_dict(response, 'data', {})
1169
1169
  return self.parse_order(data)
1170
1170
 
1171
1171
  def fetch_open_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
@@ -1219,7 +1219,7 @@ class kuna(Exchange, ImplicitAPI):
1219
1219
  # ]
1220
1220
  # }
1221
1221
  #
1222
- data = self.safe_value(response, 'data', [])
1222
+ data = self.safe_list(response, 'data', [])
1223
1223
  return self.parse_orders(data, market, since, limit)
1224
1224
 
1225
1225
  def fetch_closed_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
@@ -1294,7 +1294,7 @@ class kuna(Exchange, ImplicitAPI):
1294
1294
  # ]
1295
1295
  # }
1296
1296
  #
1297
- data = self.safe_value(response, 'data', [])
1297
+ data = self.safe_list(response, 'data', [])
1298
1298
  return self.parse_orders(data, market, since, limit)
1299
1299
 
1300
1300
  def fetch_my_trades(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
@@ -1337,7 +1337,7 @@ class kuna(Exchange, ImplicitAPI):
1337
1337
  # ]
1338
1338
  # }
1339
1339
  #
1340
- data = self.safe_value(response, 'data')
1340
+ data = self.safe_list(response, 'data')
1341
1341
  return self.parse_trades(data, market, since, limit)
1342
1342
 
1343
1343
  def withdraw(self, code: str, amount: float, address, tag=None, params={}):
@@ -1384,7 +1384,7 @@ class kuna(Exchange, ImplicitAPI):
1384
1384
  # }
1385
1385
  # }
1386
1386
  #
1387
- data = self.safe_value(response, 'data', {})
1387
+ data = self.safe_dict(response, 'data', {})
1388
1388
  return self.parse_transaction(data, currency)
1389
1389
 
1390
1390
  def fetch_withdrawals(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
@@ -1445,7 +1445,7 @@ class kuna(Exchange, ImplicitAPI):
1445
1445
  # ]
1446
1446
  # }
1447
1447
  #
1448
- data = self.safe_value(response, 'data', [])
1448
+ data = self.safe_list(response, 'data', [])
1449
1449
  return self.parse_transactions(data, currency)
1450
1450
 
1451
1451
  def fetch_withdrawal(self, id: str, code: Str = None, params={}):
@@ -1483,7 +1483,7 @@ class kuna(Exchange, ImplicitAPI):
1483
1483
  # }
1484
1484
  # }
1485
1485
  #
1486
- data = self.safe_value(response, 'data', {})
1486
+ data = self.safe_dict(response, 'data', {})
1487
1487
  return self.parse_transaction(data)
1488
1488
 
1489
1489
  def create_deposit_address(self, code: str, params={}):
@@ -1509,7 +1509,7 @@ class kuna(Exchange, ImplicitAPI):
1509
1509
  # }
1510
1510
  # }
1511
1511
  #
1512
- data = self.safe_value(response, 'data', {})
1512
+ data = self.safe_dict(response, 'data', {})
1513
1513
  return self.parse_deposit_address(data, currency)
1514
1514
 
1515
1515
  def fetch_deposit_address(self, code: str, params={}):
@@ -1535,7 +1535,7 @@ class kuna(Exchange, ImplicitAPI):
1535
1535
  # }
1536
1536
  # }
1537
1537
  #
1538
- data = self.safe_value(response, 'data', {})
1538
+ data = self.safe_dict(response, 'data', {})
1539
1539
  return self.parse_deposit_address(data, currency)
1540
1540
 
1541
1541
  def parse_deposit_address(self, depositAddress, currency: Currency = None):
@@ -1626,7 +1626,7 @@ class kuna(Exchange, ImplicitAPI):
1626
1626
  # ]
1627
1627
  # }
1628
1628
  #
1629
- data = self.safe_value(response, 'data', [])
1629
+ data = self.safe_list(response, 'data', [])
1630
1630
  return self.parse_transactions(data, currency)
1631
1631
 
1632
1632
  def fetch_deposit(self, id: str, code: Str = None, params={}):
@@ -1667,7 +1667,7 @@ class kuna(Exchange, ImplicitAPI):
1667
1667
  # }
1668
1668
  # }
1669
1669
  #
1670
- data = self.safe_value(response, 'data', {})
1670
+ data = self.safe_dict(response, 'data', {})
1671
1671
  return self.parse_transaction(data, currency)
1672
1672
 
1673
1673
  def parse_transaction(self, transaction, currency: Currency = None) -> Transaction:
ccxt/latoken.py CHANGED
@@ -1382,7 +1382,7 @@ class latoken(Exchange, ImplicitAPI):
1382
1382
  currency = None
1383
1383
  if code is not None:
1384
1384
  currency = self.currency(code)
1385
- content = self.safe_value(response, 'content', [])
1385
+ content = self.safe_list(response, 'content', [])
1386
1386
  return self.parse_transactions(content, currency, since, limit)
1387
1387
 
1388
1388
  def parse_transaction(self, transaction, currency: Currency = None) -> Transaction:
@@ -1506,7 +1506,7 @@ class latoken(Exchange, ImplicitAPI):
1506
1506
  # "hasContent": True
1507
1507
  # }
1508
1508
  #
1509
- transfers = self.safe_value(response, 'content', [])
1509
+ transfers = self.safe_list(response, 'content', [])
1510
1510
  return self.parse_transfers(transfers, currency, since, limit)
1511
1511
 
1512
1512
  def transfer(self, code: str, amount: float, fromAccount: str, toAccount: str, params={}) -> TransferEntry:
ccxt/lbank.py CHANGED
@@ -633,7 +633,7 @@ class lbank(Exchange, ImplicitAPI):
633
633
  # }
634
634
  #
635
635
  data = self.safe_value(response, 'data', [])
636
- first = self.safe_value(data, 0, {})
636
+ first = self.safe_dict(data, 0, {})
637
637
  return self.parse_ticker(first, market)
638
638
 
639
639
  def fetch_tickers(self, symbols: Strings = None, params={}) -> Tickers:
@@ -707,7 +707,7 @@ class lbank(Exchange, ImplicitAPI):
707
707
  # "success": True
708
708
  # }
709
709
  #
710
- data = self.safe_value(response, 'data', [])
710
+ data = self.safe_list(response, 'data', [])
711
711
  return self.parse_tickers(data, symbols)
712
712
 
713
713
  def fetch_order_book(self, symbol: str, limit: Int = None, params={}) -> OrderBook:
@@ -930,7 +930,7 @@ class lbank(Exchange, ImplicitAPI):
930
930
  # "ts":1647021999308
931
931
  # }
932
932
  #
933
- trades = self.safe_value(response, 'data', [])
933
+ trades = self.safe_list(response, 'data', [])
934
934
  return self.parse_trades(trades, market, since, limit)
935
935
 
936
936
  def parse_ohlcv(self, ohlcv, market: Market = None) -> list:
@@ -1514,7 +1514,7 @@ class lbank(Exchange, ImplicitAPI):
1514
1514
  # "ts":1648164471827
1515
1515
  # }
1516
1516
  #
1517
- result = self.safe_value(response, 'data', {})
1517
+ result = self.safe_dict(response, 'data', {})
1518
1518
  return self.parse_order(result)
1519
1519
 
1520
1520
  def fetch_order_default(self, id: str, symbol: Str = None, params={}):
@@ -1612,7 +1612,7 @@ class lbank(Exchange, ImplicitAPI):
1612
1612
  # "ts":1648509742164
1613
1613
  # }
1614
1614
  #
1615
- trades = self.safe_value(response, 'data', [])
1615
+ trades = self.safe_list(response, 'data', [])
1616
1616
  return self.parse_trades(trades, market, since, limit)
1617
1617
 
1618
1618
  def fetch_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
@@ -1668,7 +1668,7 @@ class lbank(Exchange, ImplicitAPI):
1668
1668
  # }
1669
1669
  #
1670
1670
  result = self.safe_value(response, 'data', {})
1671
- orders = self.safe_value(result, 'orders', [])
1671
+ orders = self.safe_list(result, 'orders', [])
1672
1672
  return self.parse_orders(orders, market, since, limit)
1673
1673
 
1674
1674
  def fetch_open_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
@@ -1721,7 +1721,7 @@ class lbank(Exchange, ImplicitAPI):
1721
1721
  # }
1722
1722
  #
1723
1723
  result = self.safe_value(response, 'data', {})
1724
- orders = self.safe_value(result, 'orders', [])
1724
+ orders = self.safe_list(result, 'orders', [])
1725
1725
  return self.parse_orders(orders, market, since, limit)
1726
1726
 
1727
1727
  def cancel_order(self, id: str, symbol: Str = None, params={}):
@@ -2107,7 +2107,7 @@ class lbank(Exchange, ImplicitAPI):
2107
2107
  # }
2108
2108
  #
2109
2109
  data = self.safe_value(response, 'data', {})
2110
- deposits = self.safe_value(data, 'depositOrders', [])
2110
+ deposits = self.safe_list(data, 'depositOrders', [])
2111
2111
  return self.parse_transactions(deposits, currency, since, limit)
2112
2112
 
2113
2113
  def fetch_withdrawals(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
@@ -2160,7 +2160,7 @@ class lbank(Exchange, ImplicitAPI):
2160
2160
  # }
2161
2161
  #
2162
2162
  data = self.safe_value(response, 'data', {})
2163
- withdraws = self.safe_value(data, 'withdraws', [])
2163
+ withdraws = self.safe_list(data, 'withdraws', [])
2164
2164
  return self.parse_transactions(withdraws, currency, since, limit)
2165
2165
 
2166
2166
  def fetch_transaction_fees(self, codes: List[str] = None, params={}):
@@ -2358,7 +2358,7 @@ class lbank(Exchange, ImplicitAPI):
2358
2358
  # "code": 0
2359
2359
  # }
2360
2360
  #
2361
- data = self.safe_value(response, 'data', [])
2361
+ data = self.safe_list(response, 'data', [])
2362
2362
  return self.parse_deposit_withdraw_fees(data, codes, 'coin')
2363
2363
 
2364
2364
  def fetch_public_deposit_withdraw_fees(self, codes=None, params={}):
ccxt/luno.py CHANGED
@@ -465,7 +465,7 @@ class luno(Exchange, ImplicitAPI):
465
465
  market = self.market(symbol)
466
466
  request['pair'] = market['id']
467
467
  response = self.privateGetListorders(self.extend(request, params))
468
- orders = self.safe_value(response, 'orders', [])
468
+ orders = self.safe_list(response, 'orders', [])
469
469
  return self.parse_orders(orders, market, since, limit)
470
470
 
471
471
  def fetch_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
@@ -703,7 +703,7 @@ class luno(Exchange, ImplicitAPI):
703
703
  # ]
704
704
  # }
705
705
  #
706
- trades = self.safe_value(response, 'trades', [])
706
+ trades = self.safe_list(response, 'trades', [])
707
707
  return self.parse_trades(trades, market, since, limit)
708
708
 
709
709
  def fetch_ohlcv(self, symbol: str, timeframe='1m', since: Int = None, limit: Int = None, params={}):
@@ -745,7 +745,7 @@ class luno(Exchange, ImplicitAPI):
745
745
  # "pair": "XBTEUR"
746
746
  # }
747
747
  #
748
- ohlcvs = self.safe_value(response, 'candles', [])
748
+ ohlcvs = self.safe_list(response, 'candles', [])
749
749
  return self.parse_ohlcvs(ohlcvs, market, timeframe, since, limit)
750
750
 
751
751
  def parse_ohlcv(self, ohlcv, market: Market = None) -> list:
@@ -809,7 +809,7 @@ class luno(Exchange, ImplicitAPI):
809
809
  # ]
810
810
  # }
811
811
  #
812
- trades = self.safe_value(response, 'trades', [])
812
+ trades = self.safe_list(response, 'trades', [])
813
813
  return self.parse_trades(trades, market, since, limit)
814
814
 
815
815
  def fetch_trading_fee(self, symbol: str, params={}):
ccxt/mercado.py CHANGED
@@ -492,7 +492,7 @@ class mercado(Exchange, ImplicitAPI):
492
492
  # }
493
493
  #
494
494
  responseData = self.safe_value(response, 'response_data', {})
495
- order = self.safe_value(responseData, 'order', {})
495
+ order = self.safe_dict(responseData, 'order', {})
496
496
  return self.parse_order(order, market)
497
497
 
498
498
  def parse_order_status(self, status):
@@ -591,7 +591,7 @@ class mercado(Exchange, ImplicitAPI):
591
591
  }
592
592
  response = self.privatePostGetOrder(self.extend(request, params))
593
593
  responseData = self.safe_value(response, 'response_data', {})
594
- order = self.safe_value(responseData, 'order')
594
+ order = self.safe_dict(responseData, 'order')
595
595
  return self.parse_order(order, market)
596
596
 
597
597
  def withdraw(self, code: str, amount: float, address, tag=None, params={}):
@@ -648,7 +648,7 @@ class mercado(Exchange, ImplicitAPI):
648
648
  # }
649
649
  #
650
650
  responseData = self.safe_value(response, 'response_data', {})
651
- withdrawal = self.safe_value(responseData, 'withdrawal')
651
+ withdrawal = self.safe_dict(responseData, 'withdrawal')
652
652
  return self.parse_transaction(withdrawal, currency)
653
653
 
654
654
  def parse_transaction(self, transaction, currency: Currency = None) -> Transaction:
@@ -745,7 +745,7 @@ class mercado(Exchange, ImplicitAPI):
745
745
  }
746
746
  response = self.privatePostListOrders(self.extend(request, params))
747
747
  responseData = self.safe_value(response, 'response_data', {})
748
- orders = self.safe_value(responseData, 'orders', [])
748
+ orders = self.safe_list(responseData, 'orders', [])
749
749
  return self.parse_orders(orders, market, since, limit)
750
750
 
751
751
  def fetch_open_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
@@ -767,7 +767,7 @@ class mercado(Exchange, ImplicitAPI):
767
767
  }
768
768
  response = self.privatePostListOrders(self.extend(request, params))
769
769
  responseData = self.safe_value(response, 'response_data', {})
770
- orders = self.safe_value(responseData, 'orders', [])
770
+ orders = self.safe_list(responseData, 'orders', [])
771
771
  return self.parse_orders(orders, market, since, limit)
772
772
 
773
773
  def fetch_my_trades(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
ccxt/mexc.py CHANGED
@@ -2680,7 +2680,7 @@ class mexc(Exchange, ImplicitAPI):
2680
2680
  # ]
2681
2681
  # }
2682
2682
  #
2683
- data = self.safe_value(response, 'data')
2683
+ data = self.safe_list(response, 'data')
2684
2684
  return self.parse_orders(data, market)
2685
2685
 
2686
2686
  def fetch_open_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
@@ -2930,7 +2930,7 @@ class mexc(Exchange, ImplicitAPI):
2930
2930
  # ]
2931
2931
  # }
2932
2932
  #
2933
- data = self.safe_value(response, 'data')
2933
+ data = self.safe_list(response, 'data')
2934
2934
  return self.parse_orders(data, market)
2935
2935
 
2936
2936
  def cancel_all_orders(self, symbol: Str = None, params={}):
@@ -3013,7 +3013,7 @@ class mexc(Exchange, ImplicitAPI):
3013
3013
  # "code": "0"
3014
3014
  # }
3015
3015
  #
3016
- data = self.safe_value(response, 'data', [])
3016
+ data = self.safe_list(response, 'data', [])
3017
3017
  return self.parse_orders(data, market)
3018
3018
 
3019
3019
  def parse_order(self, order, market: Market = None) -> Order:
@@ -4084,7 +4084,7 @@ class mexc(Exchange, ImplicitAPI):
4084
4084
  # ]
4085
4085
  # }
4086
4086
  #
4087
- data = self.safe_value(response, 'data')
4087
+ data = self.safe_list(response, 'data')
4088
4088
  return self.parse_leverage_tiers(data, symbols, 'symbol')
4089
4089
 
4090
4090
  def parse_market_leverage_tiers(self, info, market: Market = None):
@@ -4505,7 +4505,7 @@ class mexc(Exchange, ImplicitAPI):
4505
4505
  # ]
4506
4506
  # }
4507
4507
  #
4508
- data = self.safe_value(response, 'data', [])
4508
+ data = self.safe_list(response, 'data', [])
4509
4509
  return self.parse_positions(data, symbols)
4510
4510
 
4511
4511
  def parse_position(self, position, market: Market = None):
@@ -4596,7 +4596,7 @@ class mexc(Exchange, ImplicitAPI):
4596
4596
  # }
4597
4597
  # }
4598
4598
  #
4599
- data = self.safe_value(response, 'data', {})
4599
+ data = self.safe_dict(response, 'data', {})
4600
4600
  return self.parse_transfer(data)
4601
4601
  elif marketType == 'swap':
4602
4602
  raise BadRequest(self.id + ' fetchTransfer() is not supported for ' + marketType)
ccxt/ndax.py CHANGED
@@ -1858,7 +1858,7 @@ class ndax(Exchange, ImplicitAPI):
1858
1858
  # ]
1859
1859
  #
1860
1860
  grouped = self.group_by(response, 'ChangeReason')
1861
- trades = self.safe_value(grouped, 'Trade', [])
1861
+ trades = self.safe_list(grouped, 'Trade', [])
1862
1862
  return self.parse_trades(trades, market, since, limit)
1863
1863
 
1864
1864
  def fetch_deposit_address(self, code: str, params={}):
ccxt/novadax.py CHANGED
@@ -405,7 +405,7 @@ class novadax(Exchange, ImplicitAPI):
405
405
  # "message":"Success"
406
406
  # }
407
407
  #
408
- data = self.safe_value(response, 'data', {})
408
+ data = self.safe_dict(response, 'data', {})
409
409
  return self.parse_ticker(data, market)
410
410
 
411
411
  def fetch_tickers(self, symbols: Strings = None, params={}) -> Tickers:
@@ -593,7 +593,7 @@ class novadax(Exchange, ImplicitAPI):
593
593
  # "message":"Success"
594
594
  # }
595
595
  #
596
- data = self.safe_value(response, 'data', [])
596
+ data = self.safe_list(response, 'data', [])
597
597
  return self.parse_trades(data, market, since, limit)
598
598
 
599
599
  def fetch_ohlcv(self, symbol: str, timeframe='1m', since: Int = None, limit: Int = None, params={}) -> List[list]:
@@ -644,7 +644,7 @@ class novadax(Exchange, ImplicitAPI):
644
644
  # "message": "Success"
645
645
  # }
646
646
  #
647
- data = self.safe_value(response, 'data', [])
647
+ data = self.safe_list(response, 'data', [])
648
648
  return self.parse_ohlcvs(data, market, timeframe, since, limit)
649
649
 
650
650
  def parse_ohlcv(self, ohlcv, market: Market = None) -> list:
@@ -804,7 +804,7 @@ class novadax(Exchange, ImplicitAPI):
804
804
  # "message": "Success"
805
805
  # }
806
806
  #
807
- data = self.safe_value(response, 'data', {})
807
+ data = self.safe_dict(response, 'data', {})
808
808
  return self.parse_order(data, market)
809
809
 
810
810
  def cancel_order(self, id: str, symbol: Str = None, params={}):
@@ -830,7 +830,7 @@ class novadax(Exchange, ImplicitAPI):
830
830
  # "message": "Success"
831
831
  # }
832
832
  #
833
- data = self.safe_value(response, 'data', {})
833
+ data = self.safe_dict(response, 'data', {})
834
834
  return self.parse_order(data)
835
835
 
836
836
  def fetch_order(self, id: str, symbol: Str = None, params={}):
@@ -867,7 +867,7 @@ class novadax(Exchange, ImplicitAPI):
867
867
  # "message": "Success"
868
868
  # }
869
869
  #
870
- data = self.safe_value(response, 'data', {})
870
+ data = self.safe_dict(response, 'data', {})
871
871
  return self.parse_order(data)
872
872
 
873
873
  def fetch_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
@@ -922,7 +922,7 @@ class novadax(Exchange, ImplicitAPI):
922
922
  # "message": "Success"
923
923
  # }
924
924
  #
925
- data = self.safe_value(response, 'data', [])
925
+ data = self.safe_list(response, 'data', [])
926
926
  return self.parse_orders(data, market, since, limit)
927
927
 
928
928
  def fetch_open_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
@@ -1297,7 +1297,7 @@ class novadax(Exchange, ImplicitAPI):
1297
1297
  # "message": "Success"
1298
1298
  # }
1299
1299
  #
1300
- data = self.safe_value(response, 'data', [])
1300
+ data = self.safe_list(response, 'data', [])
1301
1301
  return self.parse_transactions(data, currency, since, limit)
1302
1302
 
1303
1303
  def parse_transaction_status(self, status):
@@ -1435,7 +1435,7 @@ class novadax(Exchange, ImplicitAPI):
1435
1435
  # "message": "Success"
1436
1436
  # }
1437
1437
  #
1438
- data = self.safe_value(response, 'data', [])
1438
+ data = self.safe_list(response, 'data', [])
1439
1439
  return self.parse_trades(data, market, since, limit)
1440
1440
 
1441
1441
  def sign(self, path, api='public', method='GET', params={}, headers=None, body=None):
ccxt/oceanex.py CHANGED
@@ -271,7 +271,7 @@ class oceanex(Exchange, ImplicitAPI):
271
271
  # }
272
272
  # }
273
273
  #
274
- data = self.safe_value(response, 'data', {})
274
+ data = self.safe_dict(response, 'data', {})
275
275
  return self.parse_ticker(data, market)
276
276
 
277
277
  def fetch_tickers(self, symbols: Strings = None, params={}) -> Tickers:
@@ -484,7 +484,7 @@ class oceanex(Exchange, ImplicitAPI):
484
484
  # ]
485
485
  # }
486
486
  #
487
- data = self.safe_value(response, 'data')
487
+ data = self.safe_list(response, 'data')
488
488
  return self.parse_trades(data, market, since, limit)
489
489
 
490
490
  def parse_trade(self, trade, market: Market = None) -> Trade:
@@ -620,7 +620,7 @@ class oceanex(Exchange, ImplicitAPI):
620
620
  if type == 'limit':
621
621
  request['price'] = self.price_to_precision(symbol, price)
622
622
  response = self.privatePostOrders(self.extend(request, params))
623
- data = self.safe_value(response, 'data')
623
+ data = self.safe_dict(response, 'data')
624
624
  return self.parse_order(data, market)
625
625
 
626
626
  def fetch_order(self, id: str, symbol: Str = None, params={}):
@@ -752,7 +752,7 @@ class oceanex(Exchange, ImplicitAPI):
752
752
  if limit is not None:
753
753
  request['limit'] = limit
754
754
  response = self.publicPostK(self.extend(request, params))
755
- ohlcvs = self.safe_value(response, 'data', [])
755
+ ohlcvs = self.safe_list(response, 'data', [])
756
756
  return self.parse_ohlcvs(ohlcvs, market, timeframe, since, limit)
757
757
 
758
758
  def parse_order(self, order, market: Market = None) -> Order:
@@ -828,7 +828,7 @@ class oceanex(Exchange, ImplicitAPI):
828
828
  """
829
829
  self.load_markets()
830
830
  response = self.privatePostOrderDelete(self.extend({'id': id}, params))
831
- data = self.safe_value(response, 'data')
831
+ data = self.safe_dict(response, 'data')
832
832
  return self.parse_order(data)
833
833
 
834
834
  def cancel_orders(self, ids, symbol: Str = None, params={}):
@@ -842,7 +842,7 @@ class oceanex(Exchange, ImplicitAPI):
842
842
  """
843
843
  self.load_markets()
844
844
  response = self.privatePostOrderDeleteMulti(self.extend({'ids': ids}, params))
845
- data = self.safe_value(response, 'data')
845
+ data = self.safe_list(response, 'data')
846
846
  return self.parse_orders(data)
847
847
 
848
848
  def cancel_all_orders(self, symbol: Str = None, params={}):
@@ -855,7 +855,7 @@ class oceanex(Exchange, ImplicitAPI):
855
855
  """
856
856
  self.load_markets()
857
857
  response = self.privatePostOrdersClear(params)
858
- data = self.safe_value(response, 'data')
858
+ data = self.safe_list(response, 'data')
859
859
  return self.parse_orders(data)
860
860
 
861
861
  def sign(self, path, api='public', method='GET', params={}, headers=None, body=None):
ccxt/okcoin.py CHANGED
@@ -971,7 +971,7 @@ class okcoin(Exchange, ImplicitAPI):
971
971
  'instType': 'SPOT',
972
972
  }
973
973
  response = self.publicGetMarketTickers(self.extend(request, params))
974
- data = self.safe_value(response, 'data', [])
974
+ data = self.safe_list(response, 'data', [])
975
975
  return self.parse_tickers(data, symbols, params)
976
976
 
977
977
  def parse_trade(self, trade, market: Market = None) -> Trade:
@@ -1072,7 +1072,7 @@ class okcoin(Exchange, ImplicitAPI):
1072
1072
  response = self.publicGetMarketTrades(self.extend(request, params))
1073
1073
  else:
1074
1074
  response = self.publicGetMarketHistoryTrades(self.extend(request, params))
1075
- data = self.safe_value(response, 'data', [])
1075
+ data = self.safe_list(response, 'data', [])
1076
1076
  return self.parse_trades(data, market, since, limit)
1077
1077
 
1078
1078
  def parse_ohlcv(self, ohlcv, market: Market = None) -> list:
@@ -1121,8 +1121,9 @@ class okcoin(Exchange, ImplicitAPI):
1121
1121
  request = {
1122
1122
  'instId': market['id'],
1123
1123
  'bar': bar,
1124
- 'limit': limit,
1125
1124
  }
1125
+ if limit is not None:
1126
+ request['limit'] = limit # default 100, max 100
1126
1127
  method = None
1127
1128
  method, params = self.handle_option_and_params(params, 'fetchOHLCV', 'method', 'publicGetMarketCandles')
1128
1129
  response = None
@@ -1130,7 +1131,7 @@ class okcoin(Exchange, ImplicitAPI):
1130
1131
  response = self.publicGetMarketCandles(self.extend(request, params))
1131
1132
  else:
1132
1133
  response = self.publicGetMarketHistoryCandles(self.extend(request, params))
1133
- data = self.safe_value(response, 'data', [])
1134
+ data = self.safe_list(response, 'data', [])
1134
1135
  return self.parse_ohlcvs(data, market, timeframe, since, limit)
1135
1136
 
1136
1137
  def parse_account_balance(self, response):
@@ -1571,7 +1572,7 @@ class okcoin(Exchange, ImplicitAPI):
1571
1572
  response = self.privatePostTradeCancelOrder(self.extend(request, query))
1572
1573
  # {"code":"0","data":[{"clOrdId":"","ordId":"317251910906576896","sCode":"0","sMsg":""}],"msg":""}
1573
1574
  data = self.safe_value(response, 'data', [])
1574
- order = self.safe_value(data, 0)
1575
+ order = self.safe_dict(data, 0)
1575
1576
  return self.parse_order(order, market)
1576
1577
 
1577
1578
  def parse_ids(self, ids):
@@ -1654,7 +1655,7 @@ class okcoin(Exchange, ImplicitAPI):
1654
1655
  # }
1655
1656
  #
1656
1657
  #
1657
- ordersData = self.safe_value(response, 'data', [])
1658
+ ordersData = self.safe_list(response, 'data', [])
1658
1659
  return self.parse_orders(ordersData, market, None, None, params)
1659
1660
 
1660
1661
  def parse_order_status(self, status):
@@ -1895,7 +1896,7 @@ class okcoin(Exchange, ImplicitAPI):
1895
1896
  else:
1896
1897
  response = self.privateGetTradeOrder(self.extend(request, query))
1897
1898
  data = self.safe_value(response, 'data', [])
1898
- order = self.safe_value(data, 0)
1899
+ order = self.safe_dict(data, 0)
1899
1900
  return self.parse_order(order)
1900
1901
 
1901
1902
  def fetch_open_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
@@ -1936,7 +1937,7 @@ class okcoin(Exchange, ImplicitAPI):
1936
1937
  response = self.privateGetTradeOrdersAlgoPending(self.extend(request, params))
1937
1938
  else:
1938
1939
  response = self.privateGetTradeOrdersPending(self.extend(request, params))
1939
- data = self.safe_value(response, 'data', [])
1940
+ data = self.safe_list(response, 'data', [])
1940
1941
  return self.parse_orders(data, market, since, limit)
1941
1942
 
1942
1943
  def fetch_closed_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
@@ -2017,7 +2018,7 @@ class okcoin(Exchange, ImplicitAPI):
2017
2018
  # "msg":""
2018
2019
  # }
2019
2020
  #
2020
- data = self.safe_value(response, 'data', [])
2021
+ data = self.safe_list(response, 'data', [])
2021
2022
  return self.parse_orders(data, market, since, limit)
2022
2023
 
2023
2024
  def parse_deposit_address(self, depositAddress, currency: Currency = None):
@@ -2223,7 +2224,7 @@ class okcoin(Exchange, ImplicitAPI):
2223
2224
  # }
2224
2225
  #
2225
2226
  data = self.safe_value(response, 'data', [])
2226
- rawTransfer = self.safe_value(data, 0, {})
2227
+ rawTransfer = self.safe_dict(data, 0, {})
2227
2228
  return self.parse_transfer(rawTransfer, currency)
2228
2229
 
2229
2230
  def parse_transfer(self, transfer, currency: Currency = None):
@@ -2359,7 +2360,7 @@ class okcoin(Exchange, ImplicitAPI):
2359
2360
  # }
2360
2361
  #
2361
2362
  data = self.safe_value(response, 'data', [])
2362
- transaction = self.safe_value(data, 0)
2363
+ transaction = self.safe_dict(data, 0)
2363
2364
  return self.parse_transaction(transaction, currency)
2364
2365
 
2365
2366
  def fetch_deposits(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
@@ -2428,7 +2429,7 @@ class okcoin(Exchange, ImplicitAPI):
2428
2429
  # ]
2429
2430
  # }
2430
2431
  #
2431
- data = self.safe_value(response, 'data', [])
2432
+ data = self.safe_list(response, 'data', [])
2432
2433
  return self.parse_transactions(data, currency, since, limit, params)
2433
2434
 
2434
2435
  def fetch_withdrawals(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
@@ -2489,7 +2490,7 @@ class okcoin(Exchange, ImplicitAPI):
2489
2490
  # ]
2490
2491
  # }
2491
2492
  #
2492
- data = self.safe_value(response, 'data', [])
2493
+ data = self.safe_list(response, 'data', [])
2493
2494
  return self.parse_transactions(data, currency, since, limit, params)
2494
2495
 
2495
2496
  def parse_transaction_status(self, status):
@@ -2650,7 +2651,7 @@ class okcoin(Exchange, ImplicitAPI):
2650
2651
  response = self.privateGetTradeFillsHistory(self.extend(request, params))
2651
2652
  else:
2652
2653
  response = self.privateGetTradeFills(self.extend(request, params))
2653
- data = self.safe_value(response, 'data', [])
2654
+ data = self.safe_list(response, 'data', [])
2654
2655
  return self.parse_trades(data, market, since, limit)
2655
2656
 
2656
2657
  def fetch_order_trades(self, id: str, symbol: Str = None, since: Int = None, limit: Int = None, params={}):