ccxt 4.1.54__py2.py3-none-any.whl → 4.1.56__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 (251) hide show
  1. ccxt/__init__.py +2 -2
  2. ccxt/abstract/binance.py +1 -0
  3. ccxt/abstract/binancecoinm.py +1 -0
  4. ccxt/abstract/binanceus.py +1 -0
  5. ccxt/abstract/binanceusdm.py +1 -0
  6. ccxt/abstract/bitbank.py +1 -0
  7. ccxt/abstract/coinbase.py +2 -0
  8. ccxt/abstract/htx.py +3 -0
  9. ccxt/abstract/huobi.py +3 -0
  10. ccxt/abstract/huobipro.py +3 -0
  11. ccxt/abstract/okex.py +3 -1
  12. ccxt/abstract/okex5.py +3 -1
  13. ccxt/abstract/okx.py +3 -1
  14. ccxt/ace.py +23 -23
  15. ccxt/alpaca.py +8 -8
  16. ccxt/ascendex.py +26 -26
  17. ccxt/async_support/__init__.py +2 -2
  18. ccxt/async_support/ace.py +23 -23
  19. ccxt/async_support/alpaca.py +8 -8
  20. ccxt/async_support/ascendex.py +26 -26
  21. ccxt/async_support/base/exchange.py +4 -2216
  22. ccxt/async_support/bigone.py +21 -24
  23. ccxt/async_support/binance.py +61 -54
  24. ccxt/async_support/bingx.py +28 -28
  25. ccxt/async_support/bit2c.py +9 -9
  26. ccxt/async_support/bitbank.py +11 -10
  27. ccxt/async_support/bitbns.py +11 -11
  28. ccxt/async_support/bitfinex.py +15 -15
  29. ccxt/async_support/bitfinex2.py +22 -22
  30. ccxt/async_support/bitflyer.py +13 -13
  31. ccxt/async_support/bitforex.py +10 -10
  32. ccxt/async_support/bitget.py +44 -44
  33. ccxt/async_support/bithumb.py +9 -9
  34. ccxt/async_support/bitmart.py +85 -104
  35. ccxt/async_support/bitmex.py +27 -27
  36. ccxt/async_support/bitopro.py +18 -18
  37. ccxt/async_support/bitpanda.py +18 -18
  38. ccxt/async_support/bitrue.py +14 -14
  39. ccxt/async_support/bitso.py +17 -17
  40. ccxt/async_support/bitstamp.py +17 -17
  41. ccxt/async_support/bittrex.py +22 -24
  42. ccxt/async_support/bitvavo.py +15 -15
  43. ccxt/async_support/bl3p.py +4 -4
  44. ccxt/async_support/blockchaincom.py +17 -17
  45. ccxt/async_support/btcalpha.py +14 -14
  46. ccxt/async_support/btcbox.py +9 -9
  47. ccxt/async_support/btcmarkets.py +17 -17
  48. ccxt/async_support/btcturk.py +9 -9
  49. ccxt/async_support/bybit.py +46 -46
  50. ccxt/async_support/cex.py +10 -10
  51. ccxt/async_support/coinbase.py +69 -25
  52. ccxt/async_support/coinbasepro.py +19 -19
  53. ccxt/async_support/coincheck.py +10 -10
  54. ccxt/async_support/coinex.py +57 -66
  55. ccxt/async_support/coinlist.py +22 -22
  56. ccxt/async_support/coinmate.py +10 -10
  57. ccxt/async_support/coinone.py +10 -10
  58. ccxt/async_support/coinsph.py +17 -17
  59. ccxt/async_support/coinspot.py +5 -5
  60. ccxt/async_support/cryptocom.py +27 -27
  61. ccxt/async_support/currencycom.py +18 -18
  62. ccxt/async_support/delta.py +21 -21
  63. ccxt/async_support/deribit.py +24 -24
  64. ccxt/async_support/digifinex.py +35 -35
  65. ccxt/async_support/exmo.py +19 -19
  66. ccxt/async_support/gate.py +38 -38
  67. ccxt/async_support/gemini.py +11 -11
  68. ccxt/async_support/hitbtc.py +27 -27
  69. ccxt/async_support/hollaex.py +19 -19
  70. ccxt/async_support/htx.py +47 -44
  71. ccxt/async_support/huobijp.py +22 -22
  72. ccxt/async_support/idex.py +20 -20
  73. ccxt/async_support/independentreserve.py +9 -9
  74. ccxt/async_support/indodax.py +10 -10
  75. ccxt/async_support/kraken.py +25 -25
  76. ccxt/async_support/krakenfutures.py +17 -17
  77. ccxt/async_support/kucoin.py +27 -27
  78. ccxt/async_support/kucoinfutures.py +20 -20
  79. ccxt/async_support/kuna.py +19 -19
  80. ccxt/async_support/latoken.py +14 -14
  81. ccxt/async_support/lbank.py +18 -18
  82. ccxt/async_support/luno.py +14 -14
  83. ccxt/async_support/lykke.py +12 -12
  84. ccxt/async_support/mercado.py +11 -11
  85. ccxt/async_support/mexc.py +36 -36
  86. ccxt/async_support/ndax.py +18 -18
  87. ccxt/async_support/novadax.py +17 -17
  88. ccxt/async_support/oceanex.py +12 -12
  89. ccxt/async_support/okcoin.py +19 -19
  90. ccxt/async_support/okx.py +48 -45
  91. ccxt/async_support/p2b.py +6 -6
  92. ccxt/async_support/paymium.py +6 -6
  93. ccxt/async_support/phemex.py +57 -57
  94. ccxt/async_support/poloniex.py +31 -30
  95. ccxt/async_support/poloniexfutures.py +16 -16
  96. ccxt/async_support/probit.py +22 -22
  97. ccxt/async_support/tidex.py +15 -15
  98. ccxt/async_support/timex.py +20 -20
  99. ccxt/async_support/tokocrypto.py +16 -16
  100. ccxt/async_support/upbit.py +15 -15
  101. ccxt/async_support/wavesexchange.py +12 -12
  102. ccxt/async_support/wazirx.py +13 -13
  103. ccxt/async_support/whitebit.py +26 -26
  104. ccxt/async_support/woo.py +47 -47
  105. ccxt/async_support/yobit.py +8 -8
  106. ccxt/async_support/zaif.py +10 -10
  107. ccxt/async_support/zonda.py +16 -16
  108. ccxt/base/errors.py +17 -16
  109. ccxt/base/exchange.py +57 -97
  110. ccxt/base/types.py +138 -139
  111. ccxt/bigone.py +21 -24
  112. ccxt/binance.py +61 -54
  113. ccxt/bingx.py +28 -28
  114. ccxt/bit2c.py +9 -9
  115. ccxt/bitbank.py +11 -10
  116. ccxt/bitbns.py +11 -11
  117. ccxt/bitfinex.py +15 -15
  118. ccxt/bitfinex2.py +22 -22
  119. ccxt/bitflyer.py +13 -13
  120. ccxt/bitforex.py +10 -10
  121. ccxt/bitget.py +44 -44
  122. ccxt/bithumb.py +9 -9
  123. ccxt/bitmart.py +85 -104
  124. ccxt/bitmex.py +27 -27
  125. ccxt/bitopro.py +18 -18
  126. ccxt/bitpanda.py +18 -18
  127. ccxt/bitrue.py +14 -14
  128. ccxt/bitso.py +17 -17
  129. ccxt/bitstamp.py +17 -17
  130. ccxt/bittrex.py +22 -24
  131. ccxt/bitvavo.py +15 -15
  132. ccxt/bl3p.py +4 -4
  133. ccxt/blockchaincom.py +17 -17
  134. ccxt/btcalpha.py +14 -14
  135. ccxt/btcbox.py +9 -9
  136. ccxt/btcmarkets.py +17 -17
  137. ccxt/btcturk.py +9 -9
  138. ccxt/bybit.py +46 -46
  139. ccxt/cex.py +10 -10
  140. ccxt/coinbase.py +69 -25
  141. ccxt/coinbasepro.py +19 -19
  142. ccxt/coincheck.py +10 -10
  143. ccxt/coinex.py +57 -66
  144. ccxt/coinlist.py +22 -22
  145. ccxt/coinmate.py +10 -10
  146. ccxt/coinone.py +10 -10
  147. ccxt/coinsph.py +17 -17
  148. ccxt/coinspot.py +5 -5
  149. ccxt/cryptocom.py +27 -27
  150. ccxt/currencycom.py +18 -18
  151. ccxt/delta.py +21 -21
  152. ccxt/deribit.py +24 -24
  153. ccxt/digifinex.py +35 -35
  154. ccxt/exmo.py +19 -19
  155. ccxt/gate.py +38 -38
  156. ccxt/gemini.py +11 -11
  157. ccxt/hitbtc.py +27 -27
  158. ccxt/hollaex.py +19 -19
  159. ccxt/htx.py +47 -44
  160. ccxt/huobijp.py +22 -22
  161. ccxt/idex.py +20 -20
  162. ccxt/independentreserve.py +9 -9
  163. ccxt/indodax.py +10 -10
  164. ccxt/kraken.py +25 -25
  165. ccxt/krakenfutures.py +17 -17
  166. ccxt/kucoin.py +27 -27
  167. ccxt/kucoinfutures.py +20 -20
  168. ccxt/kuna.py +19 -19
  169. ccxt/latoken.py +14 -14
  170. ccxt/lbank.py +18 -18
  171. ccxt/luno.py +14 -14
  172. ccxt/lykke.py +12 -12
  173. ccxt/mercado.py +11 -11
  174. ccxt/mexc.py +36 -36
  175. ccxt/ndax.py +18 -18
  176. ccxt/novadax.py +17 -17
  177. ccxt/oceanex.py +12 -12
  178. ccxt/okcoin.py +19 -19
  179. ccxt/okx.py +48 -45
  180. ccxt/p2b.py +6 -6
  181. ccxt/paymium.py +6 -6
  182. ccxt/phemex.py +57 -57
  183. ccxt/poloniex.py +31 -30
  184. ccxt/poloniexfutures.py +16 -16
  185. ccxt/pro/__init__.py +1 -1
  186. ccxt/pro/alpaca.py +3 -3
  187. ccxt/pro/ascendex.py +2 -2
  188. ccxt/pro/binance.py +9 -9
  189. ccxt/pro/bingx.py +3 -3
  190. ccxt/pro/bitfinex.py +3 -3
  191. ccxt/pro/bitfinex2.py +3 -3
  192. ccxt/pro/bitget.py +3 -3
  193. ccxt/pro/bitmart.py +2 -2
  194. ccxt/pro/bitmex.py +3 -3
  195. ccxt/pro/bitpanda.py +3 -3
  196. ccxt/pro/bitrue.py +2 -2
  197. ccxt/pro/bitstamp.py +2 -2
  198. ccxt/pro/bittrex.py +3 -3
  199. ccxt/pro/bitvavo.py +3 -3
  200. ccxt/pro/blockchaincom.py +2 -2
  201. ccxt/pro/bybit.py +4 -4
  202. ccxt/pro/cex.py +3 -3
  203. ccxt/pro/coinbasepro.py +3 -3
  204. ccxt/pro/coinex.py +2 -2
  205. ccxt/pro/cryptocom.py +5 -5
  206. ccxt/pro/deribit.py +3 -3
  207. ccxt/pro/exmo.py +2 -2
  208. ccxt/pro/gate.py +3 -3
  209. ccxt/pro/gemini.py +2 -2
  210. ccxt/pro/hitbtc.py +4 -4
  211. ccxt/pro/hollaex.py +3 -3
  212. ccxt/pro/htx.py +3 -3
  213. ccxt/pro/idex.py +3 -3
  214. ccxt/pro/kraken.py +7 -7
  215. ccxt/pro/krakenfutures.py +4 -4
  216. ccxt/pro/kucoin.py +3 -3
  217. ccxt/pro/kucoinfutures.py +3 -3
  218. ccxt/pro/mexc.py +3 -3
  219. ccxt/pro/okcoin.py +2 -2
  220. ccxt/pro/okx.py +6 -6
  221. ccxt/pro/phemex.py +3 -3
  222. ccxt/pro/poloniex.py +3 -3
  223. ccxt/pro/poloniexfutures.py +3 -3
  224. ccxt/pro/probit.py +3 -3
  225. ccxt/pro/wazirx.py +3 -3
  226. ccxt/pro/whitebit.py +3 -3
  227. ccxt/pro/woo.py +2 -2
  228. ccxt/probit.py +22 -22
  229. ccxt/test/base/test_shared_methods.py +3 -3
  230. ccxt/test/test_async.py +543 -535
  231. ccxt/test/test_sync.py +542 -534
  232. ccxt/tidex.py +15 -15
  233. ccxt/timex.py +20 -20
  234. ccxt/tokocrypto.py +16 -16
  235. ccxt/upbit.py +15 -15
  236. ccxt/wavesexchange.py +12 -12
  237. ccxt/wazirx.py +13 -13
  238. ccxt/whitebit.py +26 -26
  239. ccxt/woo.py +47 -47
  240. ccxt/yobit.py +8 -8
  241. ccxt/zaif.py +10 -10
  242. ccxt/zonda.py +16 -16
  243. {ccxt-4.1.54.dist-info → ccxt-4.1.56.dist-info}/METADATA +10 -8
  244. ccxt-4.1.56.dist-info/RECORD +449 -0
  245. ccxt/async_support/bitstamp1.py +0 -402
  246. ccxt/async_support/lbank2.py +0 -2620
  247. ccxt/bitstamp1.py +0 -402
  248. ccxt/lbank2.py +0 -2619
  249. ccxt-4.1.54.dist-info/RECORD +0 -453
  250. {ccxt-4.1.54.dist-info → ccxt-4.1.56.dist-info}/WHEEL +0 -0
  251. {ccxt-4.1.54.dist-info → ccxt-4.1.56.dist-info}/top_level.txt +0 -0
@@ -6,7 +6,7 @@
6
6
  from ccxt.async_support.base.exchange import Exchange
7
7
  from ccxt.abstract.coinex import ImplicitAPI
8
8
  import asyncio
9
- from ccxt.base.types import Balances, Int, Order, OrderSide, OrderType, String, Strings, Ticker, Tickers, Trade, Transaction
9
+ from ccxt.base.types import Balances, Currency, Int, Market, Order, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction
10
10
  from typing import List
11
11
  from ccxt.base.errors import ExchangeError
12
12
  from ccxt.base.errors import PermissionDenied
@@ -70,8 +70,8 @@ class coinex(Exchange, ImplicitAPI):
70
70
  'fetchDepositAddressByNetwork': False,
71
71
  'fetchDepositAddresses': False,
72
72
  'fetchDeposits': True,
73
+ 'fetchDepositWithdrawFee': 'emulated',
73
74
  'fetchDepositWithdrawFees': True,
74
- 'fetchDepsoitWithdrawFee': 'emulated',
75
75
  'fetchFundingHistory': True,
76
76
  'fetchFundingRate': True,
77
77
  'fetchFundingRateHistory': True,
@@ -659,7 +659,7 @@ class coinex(Exchange, ImplicitAPI):
659
659
  })
660
660
  return result
661
661
 
662
- def parse_ticker(self, ticker, market=None) -> Ticker:
662
+ def parse_ticker(self, ticker, market: Market = None) -> Ticker:
663
663
  #
664
664
  # Spot fetchTicker, fetchTickers
665
665
  #
@@ -974,7 +974,7 @@ class coinex(Exchange, ImplicitAPI):
974
974
  timestamp = self.safe_integer(result, 'time')
975
975
  return self.parse_order_book(result, symbol, timestamp)
976
976
 
977
- def parse_trade(self, trade, market=None) -> Trade:
977
+ def parse_trade(self, trade, market: Market = None) -> Trade:
978
978
  #
979
979
  # Spot and Swap fetchTrades(public)
980
980
  #
@@ -1196,7 +1196,7 @@ class coinex(Exchange, ImplicitAPI):
1196
1196
  result[symbol] = self.parse_trading_fee(fee, market)
1197
1197
  return result
1198
1198
 
1199
- def parse_trading_fee(self, fee, market=None):
1199
+ def parse_trading_fee(self, fee, market: Market = None):
1200
1200
  marketId = self.safe_value(fee, 'name')
1201
1201
  symbol = self.safe_symbol(marketId, market)
1202
1202
  return {
@@ -1208,7 +1208,7 @@ class coinex(Exchange, ImplicitAPI):
1208
1208
  'tierBased': True,
1209
1209
  }
1210
1210
 
1211
- def parse_ohlcv(self, ohlcv, market=None) -> list:
1211
+ def parse_ohlcv(self, ohlcv, market: Market = None) -> list:
1212
1212
  #
1213
1213
  # [
1214
1214
  # 1591484400,
@@ -1497,7 +1497,7 @@ class coinex(Exchange, ImplicitAPI):
1497
1497
  }
1498
1498
  return self.safe_string(statuses, status, status)
1499
1499
 
1500
- def parse_order(self, order, market=None) -> Order:
1500
+ def parse_order(self, order, market: Market = None) -> Order:
1501
1501
  #
1502
1502
  # fetchOrder
1503
1503
  #
@@ -2078,7 +2078,7 @@ class coinex(Exchange, ImplicitAPI):
2078
2078
  data = self.safe_value(response, 'data', {})
2079
2079
  return self.parse_order(data, market)
2080
2080
 
2081
- async def cancel_order(self, id: str, symbol: String = None, params={}):
2081
+ async def cancel_order(self, id: str, symbol: Str = None, params={}):
2082
2082
  """
2083
2083
  cancels an open order
2084
2084
  :param str id: order id
@@ -2218,7 +2218,7 @@ class coinex(Exchange, ImplicitAPI):
2218
2218
  data = self.safe_value(response, 'data')
2219
2219
  return self.parse_order(data, market)
2220
2220
 
2221
- async def cancel_all_orders(self, symbol: String = None, params={}):
2221
+ async def cancel_all_orders(self, symbol: Str = None, params={}):
2222
2222
  """
2223
2223
  cancel all open orders in a market
2224
2224
  :param str symbol: unified market symbol of the market to cancel orders in
@@ -2260,7 +2260,7 @@ class coinex(Exchange, ImplicitAPI):
2260
2260
  #
2261
2261
  return response
2262
2262
 
2263
- async def fetch_order(self, id: str, symbol: String = None, params={}):
2263
+ async def fetch_order(self, id: str, symbol: Str = None, params={}):
2264
2264
  """
2265
2265
  fetches information on an order made by the user
2266
2266
  :param str symbol: unified symbol of the market the order was made in
@@ -2387,7 +2387,7 @@ class coinex(Exchange, ImplicitAPI):
2387
2387
  data = self.safe_value(response, 'data')
2388
2388
  return self.parse_order(data, market)
2389
2389
 
2390
- async def fetch_orders_by_status(self, status, symbol: String = None, since: Int = None, limit: Int = None, params={}):
2390
+ async def fetch_orders_by_status(self, status, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
2391
2391
  await self.load_markets()
2392
2392
  limit = 100 if (limit is None) else limit
2393
2393
  request = {
@@ -2584,7 +2584,7 @@ class coinex(Exchange, ImplicitAPI):
2584
2584
  orders = self.safe_value(data, tradeRequest, [])
2585
2585
  return self.parse_orders(orders, market, since, limit)
2586
2586
 
2587
- async def fetch_open_orders(self, symbol: String = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
2587
+ async def fetch_open_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
2588
2588
  """
2589
2589
  fetch all unfilled currently open orders
2590
2590
  :param str symbol: unified market symbol
@@ -2595,7 +2595,7 @@ class coinex(Exchange, ImplicitAPI):
2595
2595
  """
2596
2596
  return await self.fetch_orders_by_status('pending', symbol, since, limit, params)
2597
2597
 
2598
- async def fetch_closed_orders(self, symbol: String = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
2598
+ async def fetch_closed_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
2599
2599
  """
2600
2600
  fetches information on multiple closed orders made by the user
2601
2601
  :param str symbol: unified market symbol of the market orders were made in
@@ -2679,7 +2679,7 @@ class coinex(Exchange, ImplicitAPI):
2679
2679
  depositAddress['network'] = self.safe_network_code(network, currency)
2680
2680
  return depositAddress
2681
2681
 
2682
- def safe_network(self, networkId, currency=None):
2682
+ def safe_network(self, networkId, currency: Currency = None):
2683
2683
  networks = self.safe_value(currency, 'networks', {})
2684
2684
  networksCodes = list(networks.keys())
2685
2685
  networksCodesLength = len(networksCodes)
@@ -2690,11 +2690,11 @@ class coinex(Exchange, ImplicitAPI):
2690
2690
  'network': None if (networkId is None) else networkId.upper(),
2691
2691
  }
2692
2692
 
2693
- def safe_network_code(self, networkId, currency=None):
2693
+ def safe_network_code(self, networkId, currency: Currency = None):
2694
2694
  network = self.safe_network(networkId, currency)
2695
2695
  return network['network']
2696
2696
 
2697
- def parse_deposit_address(self, depositAddress, currency=None):
2697
+ def parse_deposit_address(self, depositAddress, currency: Currency = None):
2698
2698
  #
2699
2699
  # {
2700
2700
  # "coin_address": "1P1JqozxioQwaqPwgMAQdNDYNyaVSqgARq",
@@ -2719,7 +2719,7 @@ class coinex(Exchange, ImplicitAPI):
2719
2719
  'network': None,
2720
2720
  }
2721
2721
 
2722
- async def fetch_my_trades(self, symbol: String = None, since: Int = None, limit: Int = None, params={}):
2722
+ async def fetch_my_trades(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
2723
2723
  """
2724
2724
  fetch all trades made by the user
2725
2725
  :param str symbol: unified market symbol
@@ -3009,7 +3009,7 @@ class coinex(Exchange, ImplicitAPI):
3009
3009
  data = self.safe_value(response, 'data', [])
3010
3010
  return self.parse_position(data[0], market)
3011
3011
 
3012
- def parse_position(self, position, market=None):
3012
+ def parse_position(self, position, market: Market = None):
3013
3013
  #
3014
3014
  # {
3015
3015
  # "adl_sort": 3396,
@@ -3111,7 +3111,7 @@ class coinex(Exchange, ImplicitAPI):
3111
3111
  'takeProfitPrice': self.safe_number(position, 'take_profit_price'),
3112
3112
  })
3113
3113
 
3114
- async def set_margin_mode(self, marginMode, symbol: String = None, params={}):
3114
+ async def set_margin_mode(self, marginMode, symbol: Str = None, params={}):
3115
3115
  """
3116
3116
  set margin mode to 'cross' or 'isolated'
3117
3117
  :param str marginMode: 'cross' or 'isolated'
@@ -3148,7 +3148,7 @@ class coinex(Exchange, ImplicitAPI):
3148
3148
  }
3149
3149
  return await self.perpetualPrivatePostMarketAdjustLeverage(self.extend(request, params))
3150
3150
 
3151
- async def set_leverage(self, leverage, symbol: String = None, params={}):
3151
+ async def set_leverage(self, leverage, symbol: Str = None, params={}):
3152
3152
  """
3153
3153
  :see: https://viabtc.github.io/coinex_api_en_doc/futures/#docsfutures001_http014_adjust_leverage
3154
3154
  set the level of leverage for a market
@@ -3237,7 +3237,7 @@ class coinex(Exchange, ImplicitAPI):
3237
3237
  tiers[symbol] = self.parse_market_leverage_tiers(response[marketId], market)
3238
3238
  return tiers
3239
3239
 
3240
- def parse_market_leverage_tiers(self, item, market=None):
3240
+ def parse_market_leverage_tiers(self, item, market: Market = None):
3241
3241
  tiers = []
3242
3242
  minNotional = 0
3243
3243
  for j in range(0, len(item)):
@@ -3329,7 +3329,7 @@ class coinex(Exchange, ImplicitAPI):
3329
3329
  'status': status,
3330
3330
  })
3331
3331
 
3332
- def parse_margin_modification(self, data, market=None):
3332
+ def parse_margin_modification(self, data, market: Market = None):
3333
3333
  return {
3334
3334
  'info': data,
3335
3335
  'type': None,
@@ -3359,7 +3359,7 @@ class coinex(Exchange, ImplicitAPI):
3359
3359
  """
3360
3360
  return await self.modify_margin_helper(symbol, amount, 2, params)
3361
3361
 
3362
- async def fetch_funding_history(self, symbol: String = None, since: Int = None, limit: Int = None, params={}):
3362
+ async def fetch_funding_history(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
3363
3363
  """
3364
3364
  fetch the history of funding payments paid and received on self account
3365
3365
  :param str symbol: unified market symbol
@@ -3481,7 +3481,7 @@ class coinex(Exchange, ImplicitAPI):
3481
3481
  ticker['timestamp'] = timestamp # avoid changing parseFundingRate signature
3482
3482
  return self.parse_funding_rate(ticker, market)
3483
3483
 
3484
- def parse_funding_rate(self, contract, market=None):
3484
+ def parse_funding_rate(self, contract, market: Market = None):
3485
3485
  #
3486
3486
  # fetchFundingRate
3487
3487
  #
@@ -3660,7 +3660,7 @@ class coinex(Exchange, ImplicitAPI):
3660
3660
  }
3661
3661
  return self.safe_string(statuses, status, status)
3662
3662
 
3663
- async def fetch_funding_rate_history(self, symbol: String = None, since: Int = None, limit: Int = None, params={}):
3663
+ async def fetch_funding_rate_history(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
3664
3664
  """
3665
3665
  :see: https://viabtc.github.io/coinex_api_en_doc/futures/#docsfutures001_http038_funding_history
3666
3666
  fetches historical funding rate prices
@@ -3728,7 +3728,7 @@ class coinex(Exchange, ImplicitAPI):
3728
3728
  sorted = self.sort_by(rates, 'timestamp')
3729
3729
  return self.filter_by_symbol_since_limit(sorted, market['symbol'], since, limit)
3730
3730
 
3731
- def parse_transaction(self, transaction, currency=None) -> Transaction:
3731
+ def parse_transaction(self, transaction, currency: Currency = None) -> Transaction:
3732
3732
  #
3733
3733
  # fetchDeposits
3734
3734
  #
@@ -3884,7 +3884,7 @@ class coinex(Exchange, ImplicitAPI):
3884
3884
  }
3885
3885
  return self.safe_string(statuses, status, status)
3886
3886
 
3887
- def parse_transfer(self, transfer, currency=None):
3887
+ def parse_transfer(self, transfer, currency: Currency = None):
3888
3888
  #
3889
3889
  # fetchTransfers Swap
3890
3890
  #
@@ -3940,7 +3940,7 @@ class coinex(Exchange, ImplicitAPI):
3940
3940
  'status': self.parse_transfer_status(self.safe_string_2(transfer, 'code', 'status')),
3941
3941
  }
3942
3942
 
3943
- async def fetch_transfers(self, code: String = None, since: Int = None, limit: Int = None, params={}):
3943
+ async def fetch_transfers(self, code: Str = None, since: Int = None, limit: Int = None, params={}):
3944
3944
  """
3945
3945
  fetch a history of internal transfers made on an account
3946
3946
  :param str code: unified currency code of the currency transferred
@@ -4019,7 +4019,7 @@ class coinex(Exchange, ImplicitAPI):
4019
4019
  transfers = self.safe_value(data, 'records', [])
4020
4020
  return self.parse_transfers(transfers, currency, since, limit)
4021
4021
 
4022
- async def fetch_withdrawals(self, code: String = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
4022
+ async def fetch_withdrawals(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
4023
4023
  """
4024
4024
  fetch all withdrawals made from an account
4025
4025
  :param str code: unified currency code
@@ -4080,7 +4080,7 @@ class coinex(Exchange, ImplicitAPI):
4080
4080
  data = self.safe_value(data, 'data', [])
4081
4081
  return self.parse_transactions(data, currency, since, limit)
4082
4082
 
4083
- async def fetch_deposits(self, code: String = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
4083
+ async def fetch_deposits(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
4084
4084
  """
4085
4085
  fetch all deposits made to an account
4086
4086
  :param str code: unified currency code
@@ -4141,7 +4141,7 @@ class coinex(Exchange, ImplicitAPI):
4141
4141
  data = self.safe_value(data, 'data', [])
4142
4142
  return self.parse_transactions(data, currency, since, limit)
4143
4143
 
4144
- def parse_borrow_rate(self, info, currency=None):
4144
+ def parse_borrow_rate(self, info, market: Market = None):
4145
4145
  #
4146
4146
  # {
4147
4147
  # "market": "BTCUSDT",
@@ -4158,18 +4158,25 @@ class coinex(Exchange, ImplicitAPI):
4158
4158
  # }
4159
4159
  # },
4160
4160
  #
4161
- timestamp = self.milliseconds()
4162
- baseCurrencyData = self.safe_value(info, currency, {})
4161
+ marketId = self.safe_string(info, 'market')
4162
+ market = self.safe_market(marketId, market, None, 'spot')
4163
+ baseInfo = self.safe_value(info, market['baseId'])
4164
+ baseRate = self.safe_number(baseInfo, 'day_rate')
4165
+ quoteInfo = self.safe_value(info, market['quoteId'])
4166
+ quoteRate = self.safe_number(quoteInfo, 'day_rate')
4163
4167
  return {
4164
- 'currency': self.safe_currency_code(currency),
4165
- 'rate': self.safe_number(baseCurrencyData, 'day_rate'),
4168
+ 'symbol': market['symbol'],
4169
+ 'base': market['base'],
4170
+ 'baseRate': baseRate,
4171
+ 'quote': market['quote'],
4172
+ 'quoteRate': quoteRate,
4166
4173
  'period': 86400000,
4167
- 'timestamp': timestamp,
4168
- 'datetime': self.iso8601(timestamp),
4174
+ 'timestamp': None,
4175
+ 'datetime': None,
4169
4176
  'info': info,
4170
4177
  }
4171
4178
 
4172
- async def fetch_borrow_rate(self, code: str, params={}):
4179
+ async def fetch_isolated_borrow_rate(self, symbol: str, params={}):
4173
4180
  """
4174
4181
  fetch the rate of interest to borrow a currency for margin trading
4175
4182
  :param str code: unified currency code
@@ -4178,14 +4185,10 @@ class coinex(Exchange, ImplicitAPI):
4178
4185
  """
4179
4186
  await self.load_markets()
4180
4187
  market = None
4181
- if code in self.markets:
4182
- market = self.market(code)
4183
- else:
4184
- defaultSettle = self.safe_string(self.options, 'defaultSettle', 'USDT')
4185
- market = self.market(code + '/' + defaultSettle)
4186
- request = {
4187
- 'market': market['id'],
4188
- }
4188
+ request = {}
4189
+ if symbol is not None:
4190
+ market = self.market(symbol)
4191
+ request['market'] = market['id']
4189
4192
  response = await self.privateGetMarginConfig(self.extend(request, params))
4190
4193
  #
4191
4194
  # {
@@ -4208,9 +4211,9 @@ class coinex(Exchange, ImplicitAPI):
4208
4211
  # }
4209
4212
  #
4210
4213
  data = self.safe_value(response, 'data', {})
4211
- return self.parse_borrow_rate(data, market['base'])
4214
+ return self.parse_borrow_rate(data, market)
4212
4215
 
4213
- async def fetch_borrow_rates(self, params={}):
4216
+ async def fetch_isolated_borrow_rates(self, params={}):
4214
4217
  """
4215
4218
  fetch the borrow interest rates of all currencies
4216
4219
  :param dict [params]: extra parameters specific to the coinex api endpoint
@@ -4240,25 +4243,13 @@ class coinex(Exchange, ImplicitAPI):
4240
4243
  # "message": "Success"
4241
4244
  # }
4242
4245
  #
4243
- timestamp = self.milliseconds()
4244
4246
  data = self.safe_value(response, 'data', {})
4245
4247
  rates = []
4246
4248
  for i in range(0, len(data)):
4247
- entry = data[i]
4248
- symbol = self.safe_string(entry, 'market')
4249
- market = self.safe_market(symbol, None, None, 'spot')
4250
- currencyData = self.safe_value(entry, market['base'])
4251
- rates.append({
4252
- 'currency': market['base'],
4253
- 'rate': self.safe_number(currencyData, 'day_rate'),
4254
- 'period': 86400000,
4255
- 'timestamp': timestamp,
4256
- 'datetime': self.iso8601(timestamp),
4257
- 'info': entry,
4258
- })
4249
+ rates.append(self.parse_borrow_rate(data[i]))
4259
4250
  return rates
4260
4251
 
4261
- async def fetch_borrow_interest(self, code: String = None, symbol: String = None, since: Int = None, limit: Int = None, params={}):
4252
+ async def fetch_borrow_interest(self, code: Str = None, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
4262
4253
  await self.load_markets()
4263
4254
  request = {}
4264
4255
  market = None
@@ -4303,7 +4294,7 @@ class coinex(Exchange, ImplicitAPI):
4303
4294
  interest = self.parse_borrow_interests(rows, market)
4304
4295
  return self.filter_by_currency_since_limit(interest, code, since, limit)
4305
4296
 
4306
- def parse_borrow_interest(self, info, market=None):
4297
+ def parse_borrow_interest(self, info, market: Market = None):
4307
4298
  #
4308
4299
  # {
4309
4300
  # "loan_id": 2616357,
@@ -4342,7 +4333,7 @@ class coinex(Exchange, ImplicitAPI):
4342
4333
  'info': info,
4343
4334
  }
4344
4335
 
4345
- async def borrow_margin(self, code: str, amount, symbol: String = None, params={}):
4336
+ async def borrow_margin(self, code: str, amount, symbol: Str = None, params={}):
4346
4337
  """
4347
4338
  create a loan to borrow margin
4348
4339
  :see: https://github.com/coinexcom/coinex_exchange_api/wiki/086margin_loan
@@ -4378,7 +4369,7 @@ class coinex(Exchange, ImplicitAPI):
4378
4369
  'symbol': symbol,
4379
4370
  })
4380
4371
 
4381
- async def repay_margin(self, code: str, amount, symbol: String = None, params={}):
4372
+ async def repay_margin(self, code: str, amount, symbol: Str = None, params={}):
4382
4373
  """
4383
4374
  repay borrowed margin and interest
4384
4375
  :see: https://github.com/coinexcom/coinex_exchange_api/wiki/087margin_flat
@@ -4415,7 +4406,7 @@ class coinex(Exchange, ImplicitAPI):
4415
4406
  'symbol': symbol,
4416
4407
  })
4417
4408
 
4418
- def parse_margin_loan(self, info, currency=None):
4409
+ def parse_margin_loan(self, info, currency: Currency = None):
4419
4410
  #
4420
4411
  # borrowMargin
4421
4412
  #
@@ -7,7 +7,7 @@ from ccxt.async_support.base.exchange import Exchange
7
7
  from ccxt.abstract.coinlist import ImplicitAPI
8
8
  import hashlib
9
9
  import math
10
- from ccxt.base.types import Balances, Int, Market, Order, OrderBook, OrderSide, OrderType, String, Strings, Ticker, Tickers, Trade, Transaction
10
+ from ccxt.base.types import Balances, Currency, Int, Market, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction
11
11
  from typing import List
12
12
  from ccxt.base.errors import ExchangeError
13
13
  from ccxt.base.errors import PermissionDenied
@@ -552,7 +552,7 @@ class coinlist(Exchange, ImplicitAPI):
552
552
  #
553
553
  return self.parse_ticker(ticker, market)
554
554
 
555
- def parse_ticker(self, ticker, market=None) -> Ticker:
555
+ def parse_ticker(self, ticker, market: Market = None) -> Ticker:
556
556
  #
557
557
  # {
558
558
  # "type":"spot",
@@ -700,7 +700,7 @@ class coinlist(Exchange, ImplicitAPI):
700
700
  candles = self.safe_value(response, 'candles', [])
701
701
  return self.parse_ohlcvs(candles, market, timeframe, since, limit)
702
702
 
703
- def parse_ohlcv(self, ohlcv, market=None) -> list:
703
+ def parse_ohlcv(self, ohlcv, market: Market = None) -> list:
704
704
  #
705
705
  # [
706
706
  # "2023-10-17T15:30:00.000Z",
@@ -773,7 +773,7 @@ class coinlist(Exchange, ImplicitAPI):
773
773
  auctions = self.safe_value(response, 'auctions', [])
774
774
  return self.parse_trades(auctions, market, since, limit)
775
775
 
776
- def parse_trade(self, trade, market=None) -> Trade:
776
+ def parse_trade(self, trade, market: Market = None) -> Trade:
777
777
  #
778
778
  # fetchTrades
779
779
  # {
@@ -937,7 +937,7 @@ class coinlist(Exchange, ImplicitAPI):
937
937
  }
938
938
  return result
939
939
 
940
- def parse_fee_tiers(self, feeTiers, market=None):
940
+ def parse_fee_tiers(self, feeTiers, market: Market = None):
941
941
  #
942
942
  # base: {
943
943
  # fees: {maker: '0', taker: '0.0045', liquidation: '0'},
@@ -1097,7 +1097,7 @@ class coinlist(Exchange, ImplicitAPI):
1097
1097
  result[code] = account
1098
1098
  return self.safe_balance(result)
1099
1099
 
1100
- async def fetch_my_trades(self, symbol: String = None, since: Int = None, limit: Int = None, params={}):
1100
+ async def fetch_my_trades(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
1101
1101
  """
1102
1102
  fetch all trades made by the user
1103
1103
  :see: https://trade-docs.coinlist.co/?javascript--nodejs#list-fills
@@ -1154,7 +1154,7 @@ class coinlist(Exchange, ImplicitAPI):
1154
1154
  fills = self.safe_value(response, 'fills', [])
1155
1155
  return self.parse_trades(fills, market, since, limit)
1156
1156
 
1157
- async def fetch_order_trades(self, id: str, symbol: String = None, since: Int = None, limit: Int = None, params={}) -> List[Trade]:
1157
+ async def fetch_order_trades(self, id: str, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Trade]:
1158
1158
  """
1159
1159
  fetch all the trades made from a single order
1160
1160
  :see: https://trade-docs.coinlist.co/?javascript--nodejs#list-fills
@@ -1170,7 +1170,7 @@ class coinlist(Exchange, ImplicitAPI):
1170
1170
  }
1171
1171
  return await self.fetch_my_trades(symbol, since, limit, self.extend(request, params))
1172
1172
 
1173
- async def fetch_orders(self, symbol: String = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
1173
+ async def fetch_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
1174
1174
  """
1175
1175
  fetches information on multiple orders made by the user
1176
1176
  :see: https://trade-docs.coinlist.co/?javascript--nodejs#list-orders
@@ -1231,7 +1231,7 @@ class coinlist(Exchange, ImplicitAPI):
1231
1231
  orders = self.safe_value(response, 'orders', [])
1232
1232
  return self.parse_orders(orders, market, since, limit)
1233
1233
 
1234
- async def fetch_order(self, id: str, symbol: String = None, params={}):
1234
+ async def fetch_order(self, id: str, symbol: Str = None, params={}):
1235
1235
  """
1236
1236
  fetches information on an order made by the user
1237
1237
  :see: https://trade-docs.coinlist.co/?javascript--nodejs#get-specific-order-by-id
@@ -1271,7 +1271,7 @@ class coinlist(Exchange, ImplicitAPI):
1271
1271
  #
1272
1272
  return self.parse_order(response)
1273
1273
 
1274
- async def fetch_open_orders(self, symbol: String = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
1274
+ async def fetch_open_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
1275
1275
  """
1276
1276
  fetch all unfilled currently open orders
1277
1277
  :see: https://trade-docs.coinlist.co/?javascript--nodejs#list-orders
@@ -1288,7 +1288,7 @@ class coinlist(Exchange, ImplicitAPI):
1288
1288
  }
1289
1289
  return self.fetch_orders(symbol, since, limit, self.extend(request, params))
1290
1290
 
1291
- async def fetch_closed_orders(self, symbol: String = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
1291
+ async def fetch_closed_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
1292
1292
  """
1293
1293
  fetches information on multiple closed orders made by the user
1294
1294
  :see: https://trade-docs.coinlist.co/?javascript--nodejs#list-orders
@@ -1305,7 +1305,7 @@ class coinlist(Exchange, ImplicitAPI):
1305
1305
  }
1306
1306
  return self.fetch_orders(symbol, since, limit, self.extend(request, params))
1307
1307
 
1308
- async def fetch_canceled_orders(self, symbol: String = None, since: Int = None, limit: Int = None, params={}):
1308
+ async def fetch_canceled_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
1309
1309
  """
1310
1310
  fetches information on multiple canceled orders made by the user
1311
1311
  :see: https://trade-docs.coinlist.co/?javascript--nodejs#list-orders
@@ -1322,7 +1322,7 @@ class coinlist(Exchange, ImplicitAPI):
1322
1322
  }
1323
1323
  return self.fetch_orders(symbol, since, limit, self.extend(request, params))
1324
1324
 
1325
- async def cancel_all_orders(self, symbol: String = None, params={}):
1325
+ async def cancel_all_orders(self, symbol: Str = None, params={}):
1326
1326
  """
1327
1327
  cancel open orders of market
1328
1328
  :see: https://trade-docs.coinlist.co/?javascript--nodejs#cancel-all-orders
@@ -1346,7 +1346,7 @@ class coinlist(Exchange, ImplicitAPI):
1346
1346
  orders = [response]
1347
1347
  return self.parse_orders(orders, market)
1348
1348
 
1349
- async def cancel_order(self, id: str, symbol: String = None, params={}):
1349
+ async def cancel_order(self, id: str, symbol: Str = None, params={}):
1350
1350
  """
1351
1351
  cancels an open order
1352
1352
  :see: https://trade-docs.coinlist.co/?javascript--nodejs#cancel-specific-order-by-id
@@ -1369,7 +1369,7 @@ class coinlist(Exchange, ImplicitAPI):
1369
1369
  #
1370
1370
  return self.parse_order(response)
1371
1371
 
1372
- async def cancel_orders(self, ids, symbol: String = None, params={}):
1372
+ async def cancel_orders(self, ids, symbol: Str = None, params={}):
1373
1373
  """
1374
1374
  cancel multiple orders
1375
1375
  :see: https://trade-docs.coinlist.co/?javascript--nodejs#cancel-specific-orders
@@ -1476,7 +1476,7 @@ class coinlist(Exchange, ImplicitAPI):
1476
1476
  response = await self.privatePatchV1OrdersOrderId(self.extend(request, params))
1477
1477
  return self.parse_order(response, market)
1478
1478
 
1479
- def parse_order(self, order, market=None) -> Order:
1479
+ def parse_order(self, order, market: Market = None) -> Order:
1480
1480
  #
1481
1481
  # fetchOrder
1482
1482
  # {
@@ -1670,7 +1670,7 @@ class coinlist(Exchange, ImplicitAPI):
1670
1670
  transfer = self.parse_transfer(response, currency)
1671
1671
  return transfer
1672
1672
 
1673
- async def fetch_transfers(self, code: String = None, since: Int = None, limit: Int = None, params={}):
1673
+ async def fetch_transfers(self, code: Str = None, since: Int = None, limit: Int = None, params={}):
1674
1674
  """
1675
1675
  fetch a history of internal transfers between CoinList.co and CoinList Pro. It does not return external deposits or withdrawals
1676
1676
  :see: https://trade-docs.coinlist.co/?javascript--nodejs#list-transfers
@@ -1720,7 +1720,7 @@ class coinlist(Exchange, ImplicitAPI):
1720
1720
  transfers = self.safe_value(response, 'transfers', [])
1721
1721
  return self.parse_transfers(transfers, currency, since, limit)
1722
1722
 
1723
- def parse_transfer(self, transfer, currency=None):
1723
+ def parse_transfer(self, transfer, currency: Currency = None):
1724
1724
  #
1725
1725
  # fetchTransfers
1726
1726
  # {
@@ -1781,7 +1781,7 @@ class coinlist(Exchange, ImplicitAPI):
1781
1781
  }
1782
1782
  return self.safe_string(statuses, status, status)
1783
1783
 
1784
- async def fetch_deposits_withdrawals(self, code: String = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
1784
+ async def fetch_deposits_withdrawals(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
1785
1785
  """
1786
1786
  fetch history of deposits and withdrawals from external wallets and between CoinList Pro trading account and CoinList wallet
1787
1787
  :see: https://trade-docs.coinlist.co/?javascript--nodejs#get-coinlist-wallet-ledger
@@ -1880,7 +1880,7 @@ class coinlist(Exchange, ImplicitAPI):
1880
1880
  data = self.safe_value(response, 'data', {})
1881
1881
  return self.parse_transaction(data, currency)
1882
1882
 
1883
- def parse_transaction(self, transaction, currency=None) -> Transaction:
1883
+ def parse_transaction(self, transaction, currency: Currency = None) -> Transaction:
1884
1884
  # withdraw
1885
1885
  #
1886
1886
  # {
@@ -1947,7 +1947,7 @@ class coinlist(Exchange, ImplicitAPI):
1947
1947
  }
1948
1948
  return self.safe_string(types, type, type)
1949
1949
 
1950
- async def fetch_ledger(self, code: String = None, since: Int = None, limit: Int = None, params={}):
1950
+ async def fetch_ledger(self, code: Str = None, since: Int = None, limit: Int = None, params={}):
1951
1951
  """
1952
1952
  fetch the history of changes, actions done by the user or operations that altered balance of the user
1953
1953
  :see: https://trade-docs.coinlist.co/?javascript--nodejs#get-account-history
@@ -2046,7 +2046,7 @@ class coinlist(Exchange, ImplicitAPI):
2046
2046
  ledger = self.safe_value(response, 'transactions', [])
2047
2047
  return self.parse_ledger(ledger, currency, since, limit)
2048
2048
 
2049
- def parse_ledger_entry(self, item, currency=None):
2049
+ def parse_ledger_entry(self, item, currency: Currency = None):
2050
2050
  #
2051
2051
  # deposit transaction from wallet(funding) to pro(trading)
2052
2052
  # {