ccxt 4.2.30__py2.py3-none-any.whl → 4.2.34__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 (244) hide show
  1. ccxt/__init__.py +1 -1
  2. ccxt/abstract/coinbase.py +10 -0
  3. ccxt/abstract/okx.py +12 -1
  4. ccxt/ace.py +4 -3
  5. ccxt/alpaca.py +1 -1
  6. ccxt/ascendex.py +6 -6
  7. ccxt/async_support/__init__.py +1 -1
  8. ccxt/async_support/ace.py +4 -3
  9. ccxt/async_support/alpaca.py +1 -1
  10. ccxt/async_support/ascendex.py +6 -6
  11. ccxt/async_support/base/exchange.py +62 -39
  12. ccxt/async_support/bigone.py +25 -5
  13. ccxt/async_support/binance.py +17 -16
  14. ccxt/async_support/bingx.py +10 -9
  15. ccxt/async_support/bit2c.py +13 -1
  16. ccxt/async_support/bitbank.py +2 -2
  17. ccxt/async_support/bitbns.py +1 -1
  18. ccxt/async_support/bitfinex.py +5 -5
  19. ccxt/async_support/bitfinex2.py +386 -40
  20. ccxt/async_support/bitflyer.py +5 -5
  21. ccxt/async_support/bitforex.py +4 -1
  22. ccxt/async_support/bitget.py +11 -11
  23. ccxt/async_support/bithumb.py +2 -2
  24. ccxt/async_support/bitmart.py +9 -9
  25. ccxt/async_support/bitmex.py +3 -3
  26. ccxt/async_support/bitopro.py +2 -2
  27. ccxt/async_support/bitrue.py +8 -8
  28. ccxt/async_support/bitso.py +4 -4
  29. ccxt/async_support/bitstamp.py +2 -2
  30. ccxt/async_support/bitteam.py +1 -1
  31. ccxt/async_support/bitvavo.py +3 -3
  32. ccxt/async_support/bl3p.py +1 -1
  33. ccxt/async_support/blockchaincom.py +3 -3
  34. ccxt/async_support/btcalpha.py +1 -1
  35. ccxt/async_support/btcbox.py +1 -1
  36. ccxt/async_support/btcmarkets.py +2 -2
  37. ccxt/async_support/btcturk.py +1 -1
  38. ccxt/async_support/bybit.py +9 -9
  39. ccxt/async_support/cex.py +1 -1
  40. ccxt/async_support/coinbase.py +16 -6
  41. ccxt/async_support/coinbasepro.py +2 -2
  42. ccxt/async_support/coincheck.py +1 -1
  43. ccxt/async_support/coinex.py +9 -9
  44. ccxt/async_support/coinlist.py +4 -4
  45. ccxt/async_support/coinmate.py +2 -2
  46. ccxt/async_support/coinmetro.py +2 -2
  47. ccxt/async_support/coinone.py +1 -1
  48. ccxt/async_support/coinsph.py +2 -2
  49. ccxt/async_support/coinspot.py +1 -1
  50. ccxt/async_support/cryptocom.py +14 -14
  51. ccxt/async_support/currencycom.py +1 -1
  52. ccxt/async_support/delta.py +2 -2
  53. ccxt/async_support/deribit.py +5 -4
  54. ccxt/async_support/digifinex.py +6 -6
  55. ccxt/async_support/exmo.py +2 -2
  56. ccxt/async_support/gate.py +41 -37
  57. ccxt/async_support/gemini.py +2 -2
  58. ccxt/async_support/hitbtc.py +5 -5
  59. ccxt/async_support/hollaex.py +2 -2
  60. ccxt/async_support/htx.py +11 -11
  61. ccxt/async_support/huobijp.py +4 -4
  62. ccxt/async_support/idex.py +2 -2
  63. ccxt/async_support/independentreserve.py +2 -2
  64. ccxt/async_support/indodax.py +2 -2
  65. ccxt/async_support/kraken.py +45 -5
  66. ccxt/async_support/krakenfutures.py +8 -5
  67. ccxt/async_support/kucoin.py +8 -8
  68. ccxt/async_support/kucoinfutures.py +4 -4
  69. ccxt/async_support/kuna.py +2 -2
  70. ccxt/async_support/latoken.py +3 -3
  71. ccxt/async_support/lbank.py +5 -4
  72. ccxt/async_support/luno.py +1 -1
  73. ccxt/async_support/lykke.py +2 -2
  74. ccxt/async_support/mercado.py +2 -2
  75. ccxt/async_support/mexc.py +7 -6
  76. ccxt/async_support/ndax.py +2 -2
  77. ccxt/async_support/novadax.py +4 -4
  78. ccxt/async_support/oceanex.py +1 -1
  79. ccxt/async_support/okcoin.py +5 -5
  80. ccxt/async_support/okx.py +26 -12
  81. ccxt/async_support/onetrading.py +2 -2
  82. ccxt/async_support/p2b.py +1 -1
  83. ccxt/async_support/paymium.py +3 -3
  84. ccxt/async_support/phemex.py +13 -13
  85. ccxt/async_support/poloniex.py +4 -4
  86. ccxt/async_support/poloniexfutures.py +4 -1
  87. ccxt/async_support/probit.py +5 -5
  88. ccxt/async_support/timex.py +2 -2
  89. ccxt/async_support/tokocrypto.py +4 -4
  90. ccxt/async_support/upbit.py +2 -2
  91. ccxt/async_support/wavesexchange.py +4 -3
  92. ccxt/async_support/wazirx.py +1 -1
  93. ccxt/async_support/whitebit.py +6 -6
  94. ccxt/async_support/woo.py +6 -6
  95. ccxt/async_support/yobit.py +41 -2
  96. ccxt/async_support/zaif.py +2 -2
  97. ccxt/async_support/zonda.py +4 -4
  98. ccxt/base/exchange.py +77 -44
  99. ccxt/base/types.py +10 -0
  100. ccxt/bigone.py +25 -5
  101. ccxt/binance.py +17 -16
  102. ccxt/bingx.py +10 -9
  103. ccxt/bit2c.py +13 -1
  104. ccxt/bitbank.py +2 -2
  105. ccxt/bitbns.py +1 -1
  106. ccxt/bitfinex.py +5 -5
  107. ccxt/bitfinex2.py +386 -40
  108. ccxt/bitflyer.py +5 -5
  109. ccxt/bitforex.py +4 -1
  110. ccxt/bitget.py +11 -11
  111. ccxt/bithumb.py +2 -2
  112. ccxt/bitmart.py +9 -9
  113. ccxt/bitmex.py +3 -3
  114. ccxt/bitopro.py +2 -2
  115. ccxt/bitrue.py +8 -8
  116. ccxt/bitso.py +4 -4
  117. ccxt/bitstamp.py +2 -2
  118. ccxt/bitteam.py +1 -1
  119. ccxt/bitvavo.py +3 -3
  120. ccxt/bl3p.py +1 -1
  121. ccxt/blockchaincom.py +3 -3
  122. ccxt/btcalpha.py +1 -1
  123. ccxt/btcbox.py +1 -1
  124. ccxt/btcmarkets.py +2 -2
  125. ccxt/btcturk.py +1 -1
  126. ccxt/bybit.py +9 -9
  127. ccxt/cex.py +1 -1
  128. ccxt/coinbase.py +16 -6
  129. ccxt/coinbasepro.py +2 -2
  130. ccxt/coincheck.py +1 -1
  131. ccxt/coinex.py +9 -9
  132. ccxt/coinlist.py +4 -4
  133. ccxt/coinmate.py +2 -2
  134. ccxt/coinmetro.py +2 -2
  135. ccxt/coinone.py +1 -1
  136. ccxt/coinsph.py +2 -2
  137. ccxt/coinspot.py +1 -1
  138. ccxt/cryptocom.py +14 -14
  139. ccxt/currencycom.py +1 -1
  140. ccxt/delta.py +2 -2
  141. ccxt/deribit.py +5 -4
  142. ccxt/digifinex.py +6 -6
  143. ccxt/exmo.py +2 -2
  144. ccxt/gate.py +41 -37
  145. ccxt/gemini.py +2 -2
  146. ccxt/hitbtc.py +5 -5
  147. ccxt/hollaex.py +2 -2
  148. ccxt/htx.py +11 -11
  149. ccxt/huobijp.py +4 -4
  150. ccxt/idex.py +2 -2
  151. ccxt/independentreserve.py +2 -2
  152. ccxt/indodax.py +2 -2
  153. ccxt/kraken.py +45 -5
  154. ccxt/krakenfutures.py +8 -5
  155. ccxt/kucoin.py +8 -8
  156. ccxt/kucoinfutures.py +4 -4
  157. ccxt/kuna.py +2 -2
  158. ccxt/latoken.py +3 -3
  159. ccxt/lbank.py +5 -4
  160. ccxt/luno.py +1 -1
  161. ccxt/lykke.py +2 -2
  162. ccxt/mercado.py +2 -2
  163. ccxt/mexc.py +7 -6
  164. ccxt/ndax.py +2 -2
  165. ccxt/novadax.py +4 -4
  166. ccxt/oceanex.py +1 -1
  167. ccxt/okcoin.py +5 -5
  168. ccxt/okx.py +26 -12
  169. ccxt/onetrading.py +2 -2
  170. ccxt/p2b.py +1 -1
  171. ccxt/paymium.py +3 -3
  172. ccxt/phemex.py +13 -13
  173. ccxt/poloniex.py +4 -4
  174. ccxt/poloniexfutures.py +4 -1
  175. ccxt/pro/__init__.py +1 -1
  176. ccxt/pro/alpaca.py +8 -4
  177. ccxt/pro/ascendex.py +1 -2
  178. ccxt/pro/binance.py +14 -10
  179. ccxt/pro/bingx.py +1 -1
  180. ccxt/pro/bitfinex.py +21 -22
  181. ccxt/pro/bitfinex2.py +13 -15
  182. ccxt/pro/bitget.py +3 -1
  183. ccxt/pro/bitmart.py +3 -7
  184. ccxt/pro/bitmex.py +4 -6
  185. ccxt/pro/bitopro.py +2 -4
  186. ccxt/pro/bitrue.py +1 -1
  187. ccxt/pro/bitstamp.py +2 -3
  188. ccxt/pro/bitvavo.py +10 -5
  189. ccxt/pro/blockchaincom.py +22 -22
  190. ccxt/pro/bybit.py +5 -5
  191. ccxt/pro/cex.py +7 -7
  192. ccxt/pro/coinbase.py +3 -2
  193. ccxt/pro/coinbasepro.py +1 -1
  194. ccxt/pro/coinex.py +15 -13
  195. ccxt/pro/currencycom.py +5 -6
  196. ccxt/pro/deribit.py +4 -4
  197. ccxt/pro/exmo.py +15 -13
  198. ccxt/pro/gate.py +1 -1
  199. ccxt/pro/gemini.py +4 -2
  200. ccxt/pro/hitbtc.py +10 -9
  201. ccxt/pro/hollaex.py +2 -2
  202. ccxt/pro/htx.py +6 -6
  203. ccxt/pro/huobijp.py +3 -4
  204. ccxt/pro/idex.py +1 -1
  205. ccxt/pro/independentreserve.py +14 -13
  206. ccxt/pro/kraken.py +10 -14
  207. ccxt/pro/krakenfutures.py +10 -6
  208. ccxt/pro/kucoin.py +10 -10
  209. ccxt/pro/kucoinfutures.py +11 -10
  210. ccxt/pro/lbank.py +10 -10
  211. ccxt/pro/luno.py +12 -14
  212. ccxt/pro/mexc.py +3 -2
  213. ccxt/pro/ndax.py +7 -11
  214. ccxt/pro/okcoin.py +7 -10
  215. ccxt/pro/okx.py +6 -9
  216. ccxt/pro/onetrading.py +16 -15
  217. ccxt/pro/p2b.py +5 -3
  218. ccxt/pro/phemex.py +16 -11
  219. ccxt/pro/poloniex.py +6 -4
  220. ccxt/pro/poloniexfutures.py +13 -9
  221. ccxt/pro/probit.py +15 -12
  222. ccxt/pro/upbit.py +8 -8
  223. ccxt/pro/wazirx.py +6 -3
  224. ccxt/pro/woo.py +9 -7
  225. ccxt/probit.py +5 -5
  226. ccxt/test/base/test_order_book.py +7 -7
  227. ccxt/test/base/test_shared_methods.py +1 -1
  228. ccxt/test/test_async.py +86 -36
  229. ccxt/test/test_sync.py +86 -36
  230. ccxt/timex.py +2 -2
  231. ccxt/tokocrypto.py +4 -4
  232. ccxt/upbit.py +2 -2
  233. ccxt/wavesexchange.py +4 -3
  234. ccxt/wazirx.py +1 -1
  235. ccxt/whitebit.py +6 -6
  236. ccxt/woo.py +6 -6
  237. ccxt/yobit.py +41 -2
  238. ccxt/zaif.py +2 -2
  239. ccxt/zonda.py +4 -4
  240. {ccxt-4.2.30.dist-info → ccxt-4.2.34.dist-info}/METADATA +10 -10
  241. ccxt-4.2.34.dist-info/RECORD +438 -0
  242. ccxt-4.2.30.dist-info/RECORD +0 -438
  243. {ccxt-4.2.30.dist-info → ccxt-4.2.34.dist-info}/WHEEL +0 -0
  244. {ccxt-4.2.30.dist-info → ccxt-4.2.34.dist-info}/top_level.txt +0 -0
ccxt/coinbase.py CHANGED
@@ -214,6 +214,13 @@ class coinbase(Exchange, ImplicitAPI):
214
214
  'brokerage/best_bid_ask',
215
215
  'brokerage/convert/trade/{trade_id}',
216
216
  'brokerage/time',
217
+ 'brokerage/cfm/balance_summary',
218
+ 'brokerage/cfm/positions',
219
+ 'brokerage/cfm/positions/{product_id}',
220
+ 'brokerage/cfm/sweeps',
221
+ 'brokerage/intx/portfolio/{portfolio_uuid}',
222
+ 'brokerage/intx/positions/{portfolio_uuid}',
223
+ 'brokerage/intx/positions/{portfolio_uuid}/{symbol}',
217
224
  ],
218
225
  'post': [
219
226
  'brokerage/orders',
@@ -224,12 +231,15 @@ class coinbase(Exchange, ImplicitAPI):
224
231
  'brokerage/portfolios/move_funds',
225
232
  'brokerage/convert/quote',
226
233
  'brokerage/convert/trade/{trade_id}',
234
+ 'brokerage/cfm/sweeps/schedule',
235
+ 'brokerage/intx/allocate',
227
236
  ],
228
237
  'put': [
229
238
  'brokerage/portfolios/{portfolio_uuid}',
230
239
  ],
231
240
  'delete': [
232
241
  'brokerage/portfolios/{portfolio_uuid}',
242
+ 'brokerage/cfm/sweeps',
233
243
  ],
234
244
  },
235
245
  },
@@ -696,7 +706,7 @@ class coinbase(Exchange, ImplicitAPI):
696
706
  }
697
707
  return self.safe_string(statuses, status, status)
698
708
 
699
- def parse_transaction(self, transaction, currency: Currency = None):
709
+ def parse_transaction(self, transaction, currency: Currency = None) -> Transaction:
700
710
  #
701
711
  # fiat deposit
702
712
  #
@@ -1567,7 +1577,7 @@ class coinbase(Exchange, ImplicitAPI):
1567
1577
  'info': ticker,
1568
1578
  }, market)
1569
1579
 
1570
- def parse_balance(self, response, params={}):
1580
+ def parse_custom_balance(self, response, params={}):
1571
1581
  balances = self.safe_value_2(response, 'data', 'accounts', [])
1572
1582
  accounts = self.safe_value(params, 'type', self.options['accounts'])
1573
1583
  v3Accounts = self.safe_value(params, 'type', self.options['v3Accounts'])
@@ -1705,7 +1715,7 @@ class coinbase(Exchange, ImplicitAPI):
1705
1715
  # "size": 9
1706
1716
  # }
1707
1717
  #
1708
- return self.parse_balance(response, params)
1718
+ return self.parse_custom_balance(response, params)
1709
1719
 
1710
1720
  def fetch_ledger(self, code: Str = None, since: Int = None, limit: Int = None, params={}):
1711
1721
  """
@@ -2104,7 +2114,7 @@ class coinbase(Exchange, ImplicitAPI):
2104
2114
  params['createMarketBuyOrderRequiresPrice'] = False
2105
2115
  return self.create_order(symbol, 'market', 'buy', cost, None, params)
2106
2116
 
2107
- def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount, price=None, params={}):
2117
+ def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: float = None, params={}):
2108
2118
  """
2109
2119
  create a trade order
2110
2120
  :see: https://docs.cloud.coinbase.com/advanced-trade-api/reference/retailbrokerageapi_postorder
@@ -2593,7 +2603,7 @@ class coinbase(Exchange, ImplicitAPI):
2593
2603
  order = self.safe_value(response, 'order', {})
2594
2604
  return self.parse_order(order, market)
2595
2605
 
2596
- def fetch_orders(self, symbol: Str = None, since: Int = None, limit=100, params={}) -> List[Order]:
2606
+ def fetch_orders(self, symbol: Str = None, since: Int = None, limit: Int = 100, params={}) -> List[Order]:
2597
2607
  """
2598
2608
  fetches information on multiple orders made by the user
2599
2609
  :see: https://docs.cloud.coinbase.com/advanced-trade-api/reference/retailbrokerageapi_gethistoricalorders
@@ -3055,7 +3065,7 @@ class coinbase(Exchange, ImplicitAPI):
3055
3065
  tickers = self.safe_value(response, 'pricebooks', [])
3056
3066
  return self.parse_tickers(tickers, symbols)
3057
3067
 
3058
- def withdraw(self, code: str, amount, address, tag=None, params={}):
3068
+ def withdraw(self, code: str, amount: float, address, tag=None, params={}):
3059
3069
  """
3060
3070
  make a withdrawal
3061
3071
  :see: https://docs.cloud.coinbase.com/sign-in-with-coinbase/docs/api-transactions#send-money
ccxt/coinbasepro.py CHANGED
@@ -1143,7 +1143,7 @@ class coinbasepro(Exchange, ImplicitAPI):
1143
1143
  }
1144
1144
  return self.fetch_open_orders(symbol, since, limit, self.extend(request, params))
1145
1145
 
1146
- def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount, price=None, params={}):
1146
+ def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: float = None, params={}):
1147
1147
  """
1148
1148
  :see: https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_postorders
1149
1149
  create a trade order
@@ -1273,7 +1273,7 @@ class coinbasepro(Exchange, ImplicitAPI):
1273
1273
  def fetch_payment_methods(self, params={}):
1274
1274
  return self.privateGetPaymentMethods(params)
1275
1275
 
1276
- def withdraw(self, code: str, amount, address, tag=None, params={}):
1276
+ def withdraw(self, code: str, amount: float, address, tag=None, params={}):
1277
1277
  """
1278
1278
  make a withdrawal
1279
1279
  :see: https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_postwithdrawpaymentmethod
ccxt/coincheck.py CHANGED
@@ -540,7 +540,7 @@ class coincheck(Exchange, ImplicitAPI):
540
540
  }
541
541
  return result
542
542
 
543
- def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount, price=None, params={}):
543
+ def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: float = None, params={}):
544
544
  """
545
545
  create a trade order
546
546
  :param str symbol: unified symbol of the market to create an order in
ccxt/coinex.py CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  from ccxt.base.exchange import Exchange
7
7
  from ccxt.abstract.coinex import ImplicitAPI
8
- from ccxt.base.types import Balances, Currency, Int, Market, Order, OrderRequest, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction
8
+ from ccxt.base.types import Balances, Currency, Int, Market, Order, TransferEntry, OrderRequest, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction
9
9
  from typing import List
10
10
  from ccxt.base.errors import ExchangeError
11
11
  from ccxt.base.errors import PermissionDenied
@@ -942,7 +942,7 @@ class coinex(Exchange, ImplicitAPI):
942
942
  #
943
943
  return self.safe_integer(response, 'data')
944
944
 
945
- def fetch_order_book(self, symbol: str, limit=20, params={}):
945
+ def fetch_order_book(self, symbol: str, limit: Int = 20, params={}):
946
946
  """
947
947
  fetches information on open orders with bid(buy) and ask(sell) prices, volumes and other data
948
948
  :see: https://viabtc.github.io/coinex_api_en_doc/spot/#docsspot001_market004_market_depth
@@ -1899,7 +1899,7 @@ class coinex(Exchange, ImplicitAPI):
1899
1899
  params['createMarketBuyOrderRequiresPrice'] = False
1900
1900
  return self.create_order(symbol, 'market', 'buy', cost, None, params)
1901
1901
 
1902
- def create_order_request(self, symbol, type, side, amount, price=None, params={}):
1902
+ def create_order_request(self, symbol, type, side, amount: float, price: float = None, params={}):
1903
1903
  market = self.market(symbol)
1904
1904
  swap = market['swap']
1905
1905
  clientOrderId = self.safe_string_2(params, 'client_id', 'clientOrderId')
@@ -2015,7 +2015,7 @@ class coinex(Exchange, ImplicitAPI):
2015
2015
  params = self.omit(params, ['reduceOnly', 'positionId', 'timeInForce', 'postOnly', 'stopPrice', 'triggerPrice', 'stopLossPrice', 'takeProfitPrice'])
2016
2016
  return self.extend(request, params)
2017
2017
 
2018
- def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount, price=None, params={}):
2018
+ def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: float = None, params={}):
2019
2019
  """
2020
2020
  create a trade order
2021
2021
  :see: https://viabtc.github.io/coinex_api_en_doc/spot/#docsspot003_trade001_limit_order
@@ -3601,7 +3601,7 @@ class coinex(Exchange, ImplicitAPI):
3601
3601
  }
3602
3602
  return self.perpetualPrivatePostMarketAdjustLeverage(self.extend(request, params))
3603
3603
 
3604
- def set_leverage(self, leverage, symbol: Str = None, params={}):
3604
+ def set_leverage(self, leverage: Int, symbol: Str = None, params={}):
3605
3605
  """
3606
3606
  :see: https://viabtc.github.io/coinex_api_en_doc/futures/#docsfutures001_http014_adjust_leverage
3607
3607
  set the level of leverage for a market
@@ -4058,7 +4058,7 @@ class coinex(Exchange, ImplicitAPI):
4058
4058
  result.append(self.parse_funding_rate(ticker, marketInner))
4059
4059
  return self.filter_by_array(result, 'symbol', symbols)
4060
4060
 
4061
- def withdraw(self, code: str, amount, address, tag=None, params={}):
4061
+ def withdraw(self, code: str, amount: float, address, tag=None, params={}):
4062
4062
  """
4063
4063
  make a withdrawal
4064
4064
  :see: https://viabtc.github.io/coinex_api_en_doc/spot/#docsspot002_account015_submit_withdraw
@@ -4081,7 +4081,7 @@ class coinex(Exchange, ImplicitAPI):
4081
4081
  request = {
4082
4082
  'coin_type': currency['id'],
4083
4083
  'coin_address': address, # must be authorized, inter-user transfer by a registered mobile phone number or an email address is supported
4084
- 'actual_amount': float(amount), # the actual amount without fees, https://www.coinex.com/fees
4084
+ 'actual_amount': float(self.number_to_string(amount)), # the actual amount without fees, https://www.coinex.com/fees
4085
4085
  'transfer_method': 'onchain', # onchain, local
4086
4086
  }
4087
4087
  if networkCode is not None:
@@ -4298,7 +4298,7 @@ class coinex(Exchange, ImplicitAPI):
4298
4298
  'internal': internal,
4299
4299
  }
4300
4300
 
4301
- def transfer(self, code: str, amount, fromAccount, toAccount, params={}):
4301
+ def transfer(self, code: str, amount: float, fromAccount, toAccount, params={}) -> TransferEntry:
4302
4302
  """
4303
4303
  transfer currency internally between wallets on the same account
4304
4304
  :see: https://viabtc.github.io/coinex_api_en_doc/spot/#docsspot002_account014_balance_contract_transfer
@@ -4809,7 +4809,7 @@ class coinex(Exchange, ImplicitAPI):
4809
4809
  'info': info,
4810
4810
  }
4811
4811
 
4812
- def borrow_isolated_margin(self, symbol: str, code: str, amount, params={}):
4812
+ def borrow_isolated_margin(self, symbol: str, code: str, amount: float, params={}):
4813
4813
  """
4814
4814
  create a loan to borrow margin
4815
4815
  :see: https://github.com/coinexcom/coinex_exchange_api/wiki/086margin_loan
ccxt/coinlist.py CHANGED
@@ -7,7 +7,7 @@ from ccxt.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, Currency, Int, Market, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction
10
+ from ccxt.base.types import Balances, Currency, Int, Market, Order, TransferEntry, 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
@@ -1393,7 +1393,7 @@ class coinlist(Exchange, ImplicitAPI):
1393
1393
  response = self.privateDeleteV1OrdersBulk(params)
1394
1394
  return response
1395
1395
 
1396
- def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount, price=None, params={}):
1396
+ def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: float = None, params={}):
1397
1397
  """
1398
1398
  create a trade order
1399
1399
  :see: https://trade-docs.coinlist.co/?javascript--nodejs#create-new-order
@@ -1631,7 +1631,7 @@ class coinlist(Exchange, ImplicitAPI):
1631
1631
  }
1632
1632
  return self.safe_string(statuses, status, status)
1633
1633
 
1634
- def transfer(self, code: str, amount, fromAccount, toAccount, params={}):
1634
+ def transfer(self, code: str, amount: float, fromAccount, toAccount, params={}) -> TransferEntry:
1635
1635
  """
1636
1636
  transfer currency internally between wallets on the same account
1637
1637
  :see: https://trade-docs.coinlist.co/?javascript--nodejs#transfer-funds-between-entities
@@ -1863,7 +1863,7 @@ class coinlist(Exchange, ImplicitAPI):
1863
1863
  # coinlist returns both internal transfers and blockchain transactions
1864
1864
  return self.parse_transactions(response, currency, since, limit)
1865
1865
 
1866
- def withdraw(self, code: str, amount, address, tag=None, params={}):
1866
+ def withdraw(self, code: str, amount: float, address, tag=None, params={}):
1867
1867
  """
1868
1868
  request a withdrawal from CoinList wallet.(Disabled by default. Contact CoinList to apply for an exception.)
1869
1869
  :see: https://trade-docs.coinlist.co/?javascript--nodejs#request-withdrawal-from-wallet
ccxt/coinmate.py CHANGED
@@ -492,7 +492,7 @@ class coinmate(Exchange, ImplicitAPI):
492
492
  },
493
493
  }
494
494
 
495
- def withdraw(self, code: str, amount, address, tag=None, params={}):
495
+ def withdraw(self, code: str, amount: float, address, tag=None, params={}):
496
496
  """
497
497
  make a withdrawal
498
498
  :param str code: unified currency code
@@ -827,7 +827,7 @@ class coinmate(Exchange, ImplicitAPI):
827
827
  'fee': None,
828
828
  }, market)
829
829
 
830
- def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount, price=None, params={}):
830
+ def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: float = None, params={}):
831
831
  """
832
832
  create a trade order
833
833
  :param str symbol: unified symbol of the market to create an order in
ccxt/coinmetro.py CHANGED
@@ -1139,7 +1139,7 @@ class coinmetro(Exchange, ImplicitAPI):
1139
1139
  }
1140
1140
  return self.safe_string(types, type, type)
1141
1141
 
1142
- def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount, price=None, params={}):
1142
+ def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: float = None, params={}):
1143
1143
  """
1144
1144
  create a trade order
1145
1145
  :see: https://documenter.getpostman.com/view/3653795/SVfWN6KS#a4895a1d-3f50-40ae-8231-6962ef06c771
@@ -1721,7 +1721,7 @@ class coinmetro(Exchange, ImplicitAPI):
1721
1721
  ]
1722
1722
  return self.safe_value(timeInForceTypes, timeInForce, timeInForce)
1723
1723
 
1724
- def borrow_cross_margin(self, code: str, amount, params={}):
1724
+ def borrow_cross_margin(self, code: str, amount: float, params={}):
1725
1725
  """
1726
1726
  create a loan to borrow margin
1727
1727
  :see: https://documenter.getpostman.com/view/3653795/SVfWN6KS#5b90b3b9-e5db-4d07-ac9d-d680a06fd110
ccxt/coinone.py CHANGED
@@ -717,7 +717,7 @@ class coinone(Exchange, ImplicitAPI):
717
717
  data = self.safe_value(response, 'transactions', [])
718
718
  return self.parse_trades(data, market, since, limit)
719
719
 
720
- def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount, price=None, params={}):
720
+ def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: float = None, params={}):
721
721
  """
722
722
  create a trade order
723
723
  :see: https://doc.coinone.co.kr/#tag/Order-V2/operation/v2_order_limit_buy
ccxt/coinsph.py CHANGED
@@ -1039,7 +1039,7 @@ class coinsph(Exchange, ImplicitAPI):
1039
1039
  result[code] = account
1040
1040
  return self.safe_balance(result)
1041
1041
 
1042
- def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount, price=None, params={}):
1042
+ def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: float = None, params={}):
1043
1043
  """
1044
1044
  create a trade order
1045
1045
  :see: https://coins-docs.github.io/rest-api/#new-order--trade
@@ -1466,7 +1466,7 @@ class coinsph(Exchange, ImplicitAPI):
1466
1466
  'taker': self.safe_number(fee, 'takerCommission'),
1467
1467
  }
1468
1468
 
1469
- def withdraw(self, code: str, amount, address, tag=None, params={}):
1469
+ def withdraw(self, code: str, amount: float, address, tag=None, params={}):
1470
1470
  """
1471
1471
  make a withdrawal to coins_ph account
1472
1472
  :see: https://coins-docs.github.io/rest-api/#withdrawuser_data
ccxt/coinspot.py CHANGED
@@ -459,7 +459,7 @@ class coinspot(Exchange, ImplicitAPI):
459
459
  'fee': fee,
460
460
  }, market)
461
461
 
462
- def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount, price=None, params={}):
462
+ def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: float = None, params={}):
463
463
  """
464
464
  create a trade order
465
465
  :see: https://www.coinspot.com.au/api#placebuyorder
ccxt/cryptocom.py CHANGED
@@ -988,7 +988,7 @@ class cryptocom(Exchange, ImplicitAPI):
988
988
  order = self.safe_value(response, 'result', {})
989
989
  return self.parse_order(order, market)
990
990
 
991
- def create_order_request(self, symbol: str, type: OrderType, side: OrderSide, amount, price=None, params={}):
991
+ def create_order_request(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: float = None, params={}):
992
992
  market = self.market(symbol)
993
993
  uppercaseType = type.upper()
994
994
  request = {
@@ -1030,26 +1030,26 @@ class cryptocom(Exchange, ImplicitAPI):
1030
1030
  isTakeProfitTrigger = (takeProfitPrice is not None)
1031
1031
  if isTrigger:
1032
1032
  request['ref_price'] = self.price_to_precision(symbol, triggerPrice)
1033
- price = str(price)
1033
+ priceString = self.number_to_string(price)
1034
1034
  if (uppercaseType == 'LIMIT') or (uppercaseType == 'STOP_LIMIT') or (uppercaseType == 'TAKE_PROFIT_LIMIT'):
1035
1035
  if side == 'buy':
1036
- if Precise.string_lt(price, triggerPrice):
1036
+ if Precise.string_lt(priceString, triggerPrice):
1037
1037
  request['type'] = 'TAKE_PROFIT_LIMIT'
1038
1038
  else:
1039
1039
  request['type'] = 'STOP_LIMIT'
1040
1040
  else:
1041
- if Precise.string_lt(price, triggerPrice):
1041
+ if Precise.string_lt(priceString, triggerPrice):
1042
1042
  request['type'] = 'STOP_LIMIT'
1043
1043
  else:
1044
1044
  request['type'] = 'TAKE_PROFIT_LIMIT'
1045
1045
  else:
1046
1046
  if side == 'buy':
1047
- if Precise.string_lt(price, triggerPrice):
1047
+ if Precise.string_lt(priceString, triggerPrice):
1048
1048
  request['type'] = 'TAKE_PROFIT'
1049
1049
  else:
1050
1050
  request['type'] = 'STOP_LOSS'
1051
1051
  else:
1052
- if Precise.string_lt(price, triggerPrice):
1052
+ if Precise.string_lt(priceString, triggerPrice):
1053
1053
  request['type'] = 'STOP_LOSS'
1054
1054
  else:
1055
1055
  request['type'] = 'TAKE_PROFIT'
@@ -1070,7 +1070,7 @@ class cryptocom(Exchange, ImplicitAPI):
1070
1070
  params = self.omit(params, ['postOnly', 'clientOrderId', 'timeInForce', 'stopPrice', 'triggerPrice', 'stopLossPrice', 'takeProfitPrice'])
1071
1071
  return self.extend(request, params)
1072
1072
 
1073
- def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount, price=None, params={}):
1073
+ def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: float = None, params={}):
1074
1074
  """
1075
1075
  create a trade order
1076
1076
  :see: https://exchange-docs.crypto.com/exchange/v1/rest-ws/index.html#private-create-order
@@ -1179,7 +1179,7 @@ class cryptocom(Exchange, ImplicitAPI):
1179
1179
  return self.parse_orders(ocoOrders)
1180
1180
  return self.parse_orders(result)
1181
1181
 
1182
- def create_advanced_order_request(self, symbol: str, type: OrderType, side: OrderSide, amount, price=None, params={}):
1182
+ def create_advanced_order_request(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: float = None, params={}):
1183
1183
  # differs slightly from createOrderRequest
1184
1184
  # since the advanced order endpoint requires a different set of parameters
1185
1185
  # namely here we don't support ref_price or spot_margin
@@ -1215,26 +1215,26 @@ class cryptocom(Exchange, ImplicitAPI):
1215
1215
  isStopLossTrigger = (stopLossPrice is not None)
1216
1216
  isTakeProfitTrigger = (takeProfitPrice is not None)
1217
1217
  if isTrigger:
1218
- price = str(price)
1218
+ priceString = self.number_to_string(price)
1219
1219
  if (uppercaseType == 'LIMIT') or (uppercaseType == 'STOP_LIMIT') or (uppercaseType == 'TAKE_PROFIT_LIMIT'):
1220
1220
  if side == 'buy':
1221
- if Precise.string_lt(price, triggerPrice):
1221
+ if Precise.string_lt(priceString, triggerPrice):
1222
1222
  request['type'] = 'TAKE_PROFIT_LIMIT'
1223
1223
  else:
1224
1224
  request['type'] = 'STOP_LIMIT'
1225
1225
  else:
1226
- if Precise.string_lt(price, triggerPrice):
1226
+ if Precise.string_lt(priceString, triggerPrice):
1227
1227
  request['type'] = 'STOP_LIMIT'
1228
1228
  else:
1229
1229
  request['type'] = 'TAKE_PROFIT_LIMIT'
1230
1230
  else:
1231
1231
  if side == 'buy':
1232
- if Precise.string_lt(price, triggerPrice):
1232
+ if Precise.string_lt(priceString, triggerPrice):
1233
1233
  request['type'] = 'TAKE_PROFIT'
1234
1234
  else:
1235
1235
  request['type'] = 'STOP_LOSS'
1236
1236
  else:
1237
- if Precise.string_lt(price, triggerPrice):
1237
+ if Precise.string_lt(priceString, triggerPrice):
1238
1238
  request['type'] = 'STOP_LOSS'
1239
1239
  else:
1240
1240
  request['type'] = 'TAKE_PROFIT'
@@ -1486,7 +1486,7 @@ class cryptocom(Exchange, ImplicitAPI):
1486
1486
  address = addressString
1487
1487
  return [address, tag]
1488
1488
 
1489
- def withdraw(self, code: str, amount, address, tag=None, params={}):
1489
+ def withdraw(self, code: str, amount: float, address, tag=None, params={}):
1490
1490
  """
1491
1491
  make a withdrawal
1492
1492
  :see: https://exchange-docs.crypto.com/exchange/v1/rest-ws/index.html#private-create-withdrawal
ccxt/currencycom.py CHANGED
@@ -1219,7 +1219,7 @@ class currencycom(Exchange, ImplicitAPI):
1219
1219
  }
1220
1220
  return self.safe_string(statuses, status, status)
1221
1221
 
1222
- def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount, price=None, params={}):
1222
+ def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: float = None, params={}):
1223
1223
  """
1224
1224
  create a trade order
1225
1225
  :param str symbol: unified symbol of the market to create an order in
ccxt/delta.py CHANGED
@@ -1733,7 +1733,7 @@ class delta(Exchange, ImplicitAPI):
1733
1733
  'trades': None,
1734
1734
  }, market)
1735
1735
 
1736
- def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount, price=None, params={}):
1736
+ def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: float = None, params={}):
1737
1737
  """
1738
1738
  create a trade order
1739
1739
  :see: https://docs.delta.exchange/#place-order
@@ -2725,7 +2725,7 @@ class delta(Exchange, ImplicitAPI):
2725
2725
  #
2726
2726
  return self.privateGetProductsProductIdOrdersLeverage(self.extend(request, params))
2727
2727
 
2728
- def set_leverage(self, leverage, symbol: Str = None, params={}):
2728
+ def set_leverage(self, leverage: Int, symbol: Str = None, params={}):
2729
2729
  """
2730
2730
  set the level of leverage for a market
2731
2731
  :see: https://docs.delta.exchange/#change-order-leverage
ccxt/deribit.py CHANGED
@@ -6,7 +6,7 @@
6
6
  from ccxt.base.exchange import Exchange
7
7
  from ccxt.abstract.deribit import ImplicitAPI
8
8
  import hashlib
9
- from ccxt.base.types import Balances, Currency, Greeks, Int, Market, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction
9
+ from ccxt.base.types import Balances, Currency, Greeks, Int, Market, Order, TransferEntry, OrderBook, 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
@@ -1301,6 +1301,7 @@ class deribit(Exchange, ImplicitAPI):
1301
1301
  request['start_timestamp'] = now - (limit - 1) * duration * 1000
1302
1302
  request['end_timestamp'] = now
1303
1303
  else:
1304
+ since = max(since - 1, 0)
1304
1305
  request['start_timestamp'] = since
1305
1306
  if limit is None:
1306
1307
  request['end_timestamp'] = now
@@ -1807,7 +1808,7 @@ class deribit(Exchange, ImplicitAPI):
1807
1808
  result = self.safe_value(response, 'result')
1808
1809
  return self.parse_order(result, market)
1809
1810
 
1810
- def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount, price=None, params={}):
1811
+ def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: float = None, params={}):
1811
1812
  """
1812
1813
  create a trade order
1813
1814
  :see: https://docs.deribit.com/#private-buy
@@ -2662,7 +2663,7 @@ class deribit(Exchange, ImplicitAPI):
2662
2663
  transfers = self.safe_value(result, 'data', [])
2663
2664
  return self.parse_transfers(transfers, currency, since, limit, params)
2664
2665
 
2665
- def transfer(self, code: str, amount, fromAccount, toAccount, params={}):
2666
+ def transfer(self, code: str, amount: float, fromAccount, toAccount, params={}) -> TransferEntry:
2666
2667
  """
2667
2668
  transfer currency internally between wallets on the same account
2668
2669
  :param str code: unified currency code
@@ -2749,7 +2750,7 @@ class deribit(Exchange, ImplicitAPI):
2749
2750
  }
2750
2751
  return self.safe_string(statuses, status, status)
2751
2752
 
2752
- def withdraw(self, code: str, amount, address, tag=None, params={}):
2753
+ def withdraw(self, code: str, amount: float, address, tag=None, params={}):
2753
2754
  """
2754
2755
  make a withdrawal
2755
2756
  :param str code: unified currency code
ccxt/digifinex.py CHANGED
@@ -7,7 +7,7 @@ from ccxt.base.exchange import Exchange
7
7
  from ccxt.abstract.digifinex import ImplicitAPI
8
8
  import hashlib
9
9
  import json
10
- from ccxt.base.types import Balances, Currency, Int, Market, Order, OrderBook, OrderRequest, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction
10
+ from ccxt.base.types import Balances, Currency, Int, Market, Order, TransferEntry, OrderBook, OrderRequest, 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
@@ -1498,7 +1498,7 @@ class digifinex(Exchange, ImplicitAPI):
1498
1498
  candles = self.safe_value(response, 'data', [])
1499
1499
  return self.parse_ohlcvs(candles, market, timeframe, since, limit)
1500
1500
 
1501
- def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount, price=None, params={}):
1501
+ def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: float = None, params={}):
1502
1502
  """
1503
1503
  create a trade order
1504
1504
  :see: https://docs.digifinex.com/en-ww/spot/v3/rest.html#create-new-order
@@ -1635,7 +1635,7 @@ class digifinex(Exchange, ImplicitAPI):
1635
1635
  result.append(individualOrder)
1636
1636
  return self.parse_orders(result, market)
1637
1637
 
1638
- def create_order_request(self, symbol: str, type: OrderType, side: OrderSide, amount, price=None, params={}):
1638
+ def create_order_request(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: float = None, params={}):
1639
1639
  """
1640
1640
  * @ignore
1641
1641
  helper function to build request
@@ -2722,7 +2722,7 @@ class digifinex(Exchange, ImplicitAPI):
2722
2722
  'status': self.parse_transfer_status(self.safe_string(transfer, 'code')),
2723
2723
  }
2724
2724
 
2725
- def transfer(self, code: str, amount, fromAccount, toAccount, params={}):
2725
+ def transfer(self, code: str, amount: float, fromAccount, toAccount, params={}) -> TransferEntry:
2726
2726
  """
2727
2727
  transfer currency internally between wallets on the same account
2728
2728
  :param str code: unified currency code
@@ -2751,7 +2751,7 @@ class digifinex(Exchange, ImplicitAPI):
2751
2751
  #
2752
2752
  return self.parse_transfer(response, currency)
2753
2753
 
2754
- def withdraw(self, code: str, amount, address, tag=None, params={}):
2754
+ def withdraw(self, code: str, amount: float, address, tag=None, params={}):
2755
2755
  """
2756
2756
  make a withdrawal
2757
2757
  :param str code: unified currency code
@@ -3384,7 +3384,7 @@ class digifinex(Exchange, ImplicitAPI):
3384
3384
  'takeProfitPrice': None,
3385
3385
  })
3386
3386
 
3387
- def set_leverage(self, leverage, symbol: Str = None, params={}):
3387
+ def set_leverage(self, leverage: Int, symbol: Str = None, params={}):
3388
3388
  """
3389
3389
  set the level of leverage for a market
3390
3390
  :see: https://docs.digifinex.com/en-ww/swap/v2/rest.html#setleverage
ccxt/exmo.py CHANGED
@@ -1298,7 +1298,7 @@ class exmo(Exchange, ImplicitAPI):
1298
1298
  result = self.array_concat(result, trades)
1299
1299
  return self.filter_by_since_limit(result, since, limit)
1300
1300
 
1301
- def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount, price=None, params={}):
1301
+ def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: float = None, params={}):
1302
1302
  """
1303
1303
  create a trade order
1304
1304
  :see: https://documenter.getpostman.com/view/10287440/SzYXWKPi#80daa469-ec59-4d0a-b229-6a311d8dd1cd
@@ -1963,7 +1963,7 @@ class exmo(Exchange, ImplicitAPI):
1963
1963
  return self.markets[symbols[0]]
1964
1964
  return None
1965
1965
 
1966
- def withdraw(self, code: str, amount, address, tag=None, params={}):
1966
+ def withdraw(self, code: str, amount: float, address, tag=None, params={}):
1967
1967
  """
1968
1968
  make a withdrawal
1969
1969
  :param str code: unified currency code