ccxt 4.3.5__py2.py3-none-any.whl → 4.3.7__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 (189) hide show
  1. ccxt/__init__.py +1 -1
  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/bingx.py +1 -0
  7. ccxt/abstract/coinbase.py +5 -0
  8. ccxt/abstract/woo.py +1 -0
  9. ccxt/ace.py +5 -0
  10. ccxt/alpaca.py +6 -0
  11. ccxt/ascendex.py +2 -2
  12. ccxt/async_support/__init__.py +1 -1
  13. ccxt/async_support/ace.py +5 -0
  14. ccxt/async_support/alpaca.py +6 -0
  15. ccxt/async_support/ascendex.py +2 -2
  16. ccxt/async_support/base/exchange.py +30 -1
  17. ccxt/async_support/bigone.py +1 -1
  18. ccxt/async_support/binance.py +7 -3
  19. ccxt/async_support/bingx.py +43 -1
  20. ccxt/async_support/bitbank.py +4 -1
  21. ccxt/async_support/bitfinex.py +1 -1
  22. ccxt/async_support/bitfinex2.py +1 -1
  23. ccxt/async_support/bitflyer.py +1 -1
  24. ccxt/async_support/bitget.py +70 -4
  25. ccxt/async_support/bithumb.py +5 -1
  26. ccxt/async_support/bitmart.py +1 -1
  27. ccxt/async_support/bitmex.py +25 -1
  28. ccxt/async_support/bitopro.py +6 -1
  29. ccxt/async_support/bitrue.py +1 -1
  30. ccxt/async_support/bitso.py +4 -1
  31. ccxt/async_support/bitstamp.py +4 -1
  32. ccxt/async_support/bitteam.py +4 -0
  33. ccxt/async_support/bitvavo.py +4 -1
  34. ccxt/async_support/bl3p.py +3 -0
  35. ccxt/async_support/blockchaincom.py +1 -1
  36. ccxt/async_support/btcalpha.py +3 -0
  37. ccxt/async_support/btcbox.py +3 -0
  38. ccxt/async_support/btcmarkets.py +4 -1
  39. ccxt/async_support/btcturk.py +3 -0
  40. ccxt/async_support/bybit.py +196 -14
  41. ccxt/async_support/cex.py +6 -0
  42. ccxt/async_support/coinbase.py +98 -22
  43. ccxt/async_support/coinbaseinternational.py +3 -1
  44. ccxt/async_support/coinbasepro.py +7 -1
  45. ccxt/async_support/coincheck.py +3 -0
  46. ccxt/async_support/coinex.py +180 -79
  47. ccxt/async_support/coinlist.py +5 -1
  48. ccxt/async_support/coinmate.py +4 -1
  49. ccxt/async_support/coinone.py +3 -0
  50. ccxt/async_support/coinsph.py +5 -1
  51. ccxt/async_support/coinspot.py +3 -0
  52. ccxt/async_support/cryptocom.py +33 -2
  53. ccxt/async_support/delta.py +2 -2
  54. ccxt/async_support/deribit.py +1 -1
  55. ccxt/async_support/digifinex.py +3 -3
  56. ccxt/async_support/exmo.py +8 -3
  57. ccxt/async_support/gate.py +112 -24
  58. ccxt/async_support/gemini.py +1 -1
  59. ccxt/async_support/hitbtc.py +7 -6
  60. ccxt/async_support/hollaex.py +1 -1
  61. ccxt/async_support/htx.py +29 -1
  62. ccxt/async_support/huobijp.py +1 -1
  63. ccxt/async_support/hyperliquid.py +39 -2
  64. ccxt/async_support/idex.py +4 -1
  65. ccxt/async_support/independentreserve.py +3 -0
  66. ccxt/async_support/indodax.py +4 -1
  67. ccxt/async_support/kraken.py +28 -1
  68. ccxt/async_support/krakenfutures.py +26 -0
  69. ccxt/async_support/kucoin.py +3 -1
  70. ccxt/async_support/kucoinfutures.py +5 -3
  71. ccxt/async_support/kuna.py +1 -1
  72. ccxt/async_support/latoken.py +6 -0
  73. ccxt/async_support/lbank.py +1 -1
  74. ccxt/async_support/luno.py +3 -0
  75. ccxt/async_support/lykke.py +6 -1
  76. ccxt/async_support/mercado.py +4 -1
  77. ccxt/async_support/mexc.py +110 -4
  78. ccxt/async_support/ndax.py +5 -1
  79. ccxt/async_support/novadax.py +5 -1
  80. ccxt/async_support/okcoin.py +1 -1
  81. ccxt/async_support/okx.py +183 -4
  82. ccxt/async_support/onetrading.py +4 -1
  83. ccxt/async_support/p2b.py +3 -0
  84. ccxt/async_support/phemex.py +1 -1
  85. ccxt/async_support/poloniex.py +1 -1
  86. ccxt/async_support/probit.py +4 -1
  87. ccxt/async_support/timex.py +3 -0
  88. ccxt/async_support/tokocrypto.py +1 -1
  89. ccxt/async_support/tradeogre.py +3 -0
  90. ccxt/async_support/upbit.py +1 -1
  91. ccxt/async_support/wavesexchange.py +4 -1
  92. ccxt/async_support/wazirx.py +3 -0
  93. ccxt/async_support/whitebit.py +38 -1
  94. ccxt/async_support/woo.py +30 -1
  95. ccxt/async_support/yobit.py +4 -1
  96. ccxt/async_support/zaif.py +1 -1
  97. ccxt/async_support/zonda.py +1 -1
  98. ccxt/base/exchange.py +30 -1
  99. ccxt/bigone.py +1 -1
  100. ccxt/binance.py +7 -3
  101. ccxt/bingx.py +43 -1
  102. ccxt/bitbank.py +4 -1
  103. ccxt/bitfinex.py +1 -1
  104. ccxt/bitfinex2.py +1 -1
  105. ccxt/bitflyer.py +1 -1
  106. ccxt/bitget.py +70 -4
  107. ccxt/bithumb.py +5 -1
  108. ccxt/bitmart.py +1 -1
  109. ccxt/bitmex.py +25 -1
  110. ccxt/bitopro.py +6 -1
  111. ccxt/bitrue.py +1 -1
  112. ccxt/bitso.py +4 -1
  113. ccxt/bitstamp.py +4 -1
  114. ccxt/bitteam.py +4 -0
  115. ccxt/bitvavo.py +4 -1
  116. ccxt/bl3p.py +3 -0
  117. ccxt/blockchaincom.py +1 -1
  118. ccxt/btcalpha.py +3 -0
  119. ccxt/btcbox.py +3 -0
  120. ccxt/btcmarkets.py +4 -1
  121. ccxt/btcturk.py +3 -0
  122. ccxt/bybit.py +196 -14
  123. ccxt/cex.py +6 -0
  124. ccxt/coinbase.py +98 -22
  125. ccxt/coinbaseinternational.py +3 -1
  126. ccxt/coinbasepro.py +7 -1
  127. ccxt/coincheck.py +3 -0
  128. ccxt/coinex.py +180 -79
  129. ccxt/coinlist.py +5 -1
  130. ccxt/coinmate.py +4 -1
  131. ccxt/coinone.py +3 -0
  132. ccxt/coinsph.py +5 -1
  133. ccxt/coinspot.py +3 -0
  134. ccxt/cryptocom.py +33 -2
  135. ccxt/delta.py +2 -2
  136. ccxt/deribit.py +1 -1
  137. ccxt/digifinex.py +3 -3
  138. ccxt/exmo.py +8 -3
  139. ccxt/gate.py +112 -24
  140. ccxt/gemini.py +1 -1
  141. ccxt/hitbtc.py +7 -6
  142. ccxt/hollaex.py +1 -1
  143. ccxt/htx.py +29 -1
  144. ccxt/huobijp.py +1 -1
  145. ccxt/hyperliquid.py +39 -2
  146. ccxt/idex.py +4 -1
  147. ccxt/independentreserve.py +3 -0
  148. ccxt/indodax.py +4 -1
  149. ccxt/kraken.py +28 -1
  150. ccxt/krakenfutures.py +26 -0
  151. ccxt/kucoin.py +3 -1
  152. ccxt/kucoinfutures.py +5 -3
  153. ccxt/kuna.py +1 -1
  154. ccxt/latoken.py +6 -0
  155. ccxt/lbank.py +1 -1
  156. ccxt/luno.py +3 -0
  157. ccxt/lykke.py +6 -1
  158. ccxt/mercado.py +4 -1
  159. ccxt/mexc.py +110 -4
  160. ccxt/ndax.py +5 -1
  161. ccxt/novadax.py +5 -1
  162. ccxt/okcoin.py +1 -1
  163. ccxt/okx.py +183 -4
  164. ccxt/onetrading.py +4 -1
  165. ccxt/p2b.py +3 -0
  166. ccxt/phemex.py +1 -1
  167. ccxt/poloniex.py +1 -1
  168. ccxt/pro/__init__.py +1 -1
  169. ccxt/pro/bitget.py +1 -1
  170. ccxt/pro/bybit.py +1 -1
  171. ccxt/pro/coinbase.py +28 -28
  172. ccxt/probit.py +4 -1
  173. ccxt/test/test_async.py +2 -0
  174. ccxt/test/test_sync.py +2 -0
  175. ccxt/timex.py +3 -0
  176. ccxt/tokocrypto.py +1 -1
  177. ccxt/tradeogre.py +3 -0
  178. ccxt/upbit.py +1 -1
  179. ccxt/wavesexchange.py +4 -1
  180. ccxt/wazirx.py +3 -0
  181. ccxt/whitebit.py +38 -1
  182. ccxt/woo.py +30 -1
  183. ccxt/yobit.py +4 -1
  184. ccxt/zaif.py +1 -1
  185. ccxt/zonda.py +1 -1
  186. {ccxt-4.3.5.dist-info → ccxt-4.3.7.dist-info}/METADATA +4 -4
  187. {ccxt-4.3.5.dist-info → ccxt-4.3.7.dist-info}/RECORD +189 -189
  188. {ccxt-4.3.5.dist-info → ccxt-4.3.7.dist-info}/WHEEL +0 -0
  189. {ccxt-4.3.5.dist-info → ccxt-4.3.7.dist-info}/top_level.txt +0 -0
ccxt/__init__.py CHANGED
@@ -22,7 +22,7 @@
22
22
 
23
23
  # ----------------------------------------------------------------------------
24
24
 
25
- __version__ = '4.3.5'
25
+ __version__ = '4.3.7'
26
26
 
27
27
  # ----------------------------------------------------------------------------
28
28
 
ccxt/abstract/binance.py CHANGED
@@ -87,6 +87,7 @@ class ImplicitAPI:
87
87
  sapi_get_capital_deposit_subaddress = sapiGetCapitalDepositSubAddress = Entry('capital/deposit/subAddress', 'sapi', 'GET', {'cost': 0.1})
88
88
  sapi_get_capital_deposit_subhisrec = sapiGetCapitalDepositSubHisrec = Entry('capital/deposit/subHisrec', 'sapi', 'GET', {'cost': 0.1})
89
89
  sapi_get_capital_withdraw_history = sapiGetCapitalWithdrawHistory = Entry('capital/withdraw/history', 'sapi', 'GET', {'cost': 1800})
90
+ sapi_get_capital_withdraw_address_list = sapiGetCapitalWithdrawAddressList = Entry('capital/withdraw/address/list', 'sapi', 'GET', {'cost': 10})
90
91
  sapi_get_capital_contract_convertible_coins = sapiGetCapitalContractConvertibleCoins = Entry('capital/contract/convertible-coins', 'sapi', 'GET', {'cost': 4.0002})
91
92
  sapi_get_convert_tradeflow = sapiGetConvertTradeFlow = Entry('convert/tradeFlow', 'sapi', 'GET', {'cost': 20.001})
92
93
  sapi_get_convert_exchangeinfo = sapiGetConvertExchangeInfo = Entry('convert/exchangeInfo', 'sapi', 'GET', {'cost': 50})
@@ -87,6 +87,7 @@ class ImplicitAPI:
87
87
  sapi_get_capital_deposit_subaddress = sapiGetCapitalDepositSubAddress = Entry('capital/deposit/subAddress', 'sapi', 'GET', {'cost': 0.1})
88
88
  sapi_get_capital_deposit_subhisrec = sapiGetCapitalDepositSubHisrec = Entry('capital/deposit/subHisrec', 'sapi', 'GET', {'cost': 0.1})
89
89
  sapi_get_capital_withdraw_history = sapiGetCapitalWithdrawHistory = Entry('capital/withdraw/history', 'sapi', 'GET', {'cost': 1800})
90
+ sapi_get_capital_withdraw_address_list = sapiGetCapitalWithdrawAddressList = Entry('capital/withdraw/address/list', 'sapi', 'GET', {'cost': 10})
90
91
  sapi_get_capital_contract_convertible_coins = sapiGetCapitalContractConvertibleCoins = Entry('capital/contract/convertible-coins', 'sapi', 'GET', {'cost': 4.0002})
91
92
  sapi_get_convert_tradeflow = sapiGetConvertTradeFlow = Entry('convert/tradeFlow', 'sapi', 'GET', {'cost': 20.001})
92
93
  sapi_get_convert_exchangeinfo = sapiGetConvertExchangeInfo = Entry('convert/exchangeInfo', 'sapi', 'GET', {'cost': 50})
@@ -87,6 +87,7 @@ class ImplicitAPI:
87
87
  sapi_get_capital_deposit_subaddress = sapiGetCapitalDepositSubAddress = Entry('capital/deposit/subAddress', 'sapi', 'GET', {'cost': 0.1})
88
88
  sapi_get_capital_deposit_subhisrec = sapiGetCapitalDepositSubHisrec = Entry('capital/deposit/subHisrec', 'sapi', 'GET', {'cost': 0.1})
89
89
  sapi_get_capital_withdraw_history = sapiGetCapitalWithdrawHistory = Entry('capital/withdraw/history', 'sapi', 'GET', {'cost': 1800})
90
+ sapi_get_capital_withdraw_address_list = sapiGetCapitalWithdrawAddressList = Entry('capital/withdraw/address/list', 'sapi', 'GET', {'cost': 10})
90
91
  sapi_get_capital_contract_convertible_coins = sapiGetCapitalContractConvertibleCoins = Entry('capital/contract/convertible-coins', 'sapi', 'GET', {'cost': 4.0002})
91
92
  sapi_get_convert_tradeflow = sapiGetConvertTradeFlow = Entry('convert/tradeFlow', 'sapi', 'GET', {'cost': 20.001})
92
93
  sapi_get_convert_exchangeinfo = sapiGetConvertExchangeInfo = Entry('convert/exchangeInfo', 'sapi', 'GET', {'cost': 50})
@@ -87,6 +87,7 @@ class ImplicitAPI:
87
87
  sapi_get_capital_deposit_subaddress = sapiGetCapitalDepositSubAddress = Entry('capital/deposit/subAddress', 'sapi', 'GET', {'cost': 0.1})
88
88
  sapi_get_capital_deposit_subhisrec = sapiGetCapitalDepositSubHisrec = Entry('capital/deposit/subHisrec', 'sapi', 'GET', {'cost': 0.1})
89
89
  sapi_get_capital_withdraw_history = sapiGetCapitalWithdrawHistory = Entry('capital/withdraw/history', 'sapi', 'GET', {'cost': 1800})
90
+ sapi_get_capital_withdraw_address_list = sapiGetCapitalWithdrawAddressList = Entry('capital/withdraw/address/list', 'sapi', 'GET', {'cost': 10})
90
91
  sapi_get_capital_contract_convertible_coins = sapiGetCapitalContractConvertibleCoins = Entry('capital/contract/convertible-coins', 'sapi', 'GET', {'cost': 4.0002})
91
92
  sapi_get_convert_tradeflow = sapiGetConvertTradeFlow = Entry('convert/tradeFlow', 'sapi', 'GET', {'cost': 20.001})
92
93
  sapi_get_convert_exchangeinfo = sapiGetConvertExchangeInfo = Entry('convert/exchangeInfo', 'sapi', 'GET', {'cost': 50})
ccxt/abstract/bingx.py CHANGED
@@ -62,6 +62,7 @@ class ImplicitAPI:
62
62
  swap_v2_private_post_trade_order = swapV2PrivatePostTradeOrder = Entry('trade/order', ['swap', 'v2', 'private'], 'POST', {'cost': 3})
63
63
  swap_v2_private_post_trade_batchorders = swapV2PrivatePostTradeBatchOrders = Entry('trade/batchOrders', ['swap', 'v2', 'private'], 'POST', {'cost': 3})
64
64
  swap_v2_private_post_trade_closeallpositions = swapV2PrivatePostTradeCloseAllPositions = Entry('trade/closeAllPositions', ['swap', 'v2', 'private'], 'POST', {'cost': 3})
65
+ swap_v2_private_post_trade_cancelallafter = swapV2PrivatePostTradeCancelAllAfter = Entry('trade/cancelAllAfter', ['swap', 'v2', 'private'], 'POST', {'cost': 3})
65
66
  swap_v2_private_post_trade_margintype = swapV2PrivatePostTradeMarginType = Entry('trade/marginType', ['swap', 'v2', 'private'], 'POST', {'cost': 3})
66
67
  swap_v2_private_post_trade_leverage = swapV2PrivatePostTradeLeverage = Entry('trade/leverage', ['swap', 'v2', 'private'], 'POST', {'cost': 3})
67
68
  swap_v2_private_post_trade_positionmargin = swapV2PrivatePostTradePositionMargin = Entry('trade/positionMargin', ['swap', 'v2', 'private'], 'POST', {'cost': 3})
ccxt/abstract/coinbase.py CHANGED
@@ -48,6 +48,11 @@ class ImplicitAPI:
48
48
  v2_private_delete_accounts_id = v2PrivateDeleteAccountsId = Entry('accounts/{id}', ['v2', 'private'], 'DELETE', {'cost': 10.6})
49
49
  v2_private_delete_accounts_account_id_transactions_transaction_id = v2PrivateDeleteAccountsAccountIdTransactionsTransactionId = Entry('accounts/{account_id}/transactions/{transaction_id}', ['v2', 'private'], 'DELETE', {'cost': 10.6})
50
50
  v3_public_get_brokerage_time = v3PublicGetBrokerageTime = Entry('brokerage/time', ['v3', 'public'], 'GET', {'cost': 3})
51
+ v3_public_get_brokerage_market_product_book = v3PublicGetBrokerageMarketProductBook = Entry('brokerage/market/product_book', ['v3', 'public'], 'GET', {'cost': 3})
52
+ v3_public_get_brokerage_market_products = v3PublicGetBrokerageMarketProducts = Entry('brokerage/market/products', ['v3', 'public'], 'GET', {'cost': 3})
53
+ v3_public_get_brokerage_market_products_product_id = v3PublicGetBrokerageMarketProductsProductId = Entry('brokerage/market/products/{product_id}', ['v3', 'public'], 'GET', {'cost': 3})
54
+ v3_public_get_brokerage_market_products_product_id_candles = v3PublicGetBrokerageMarketProductsProductIdCandles = Entry('brokerage/market/products/{product_id}/candles', ['v3', 'public'], 'GET', {'cost': 3})
55
+ v3_public_get_brokerage_market_products_product_id_ticker = v3PublicGetBrokerageMarketProductsProductIdTicker = Entry('brokerage/market/products/{product_id}/ticker', ['v3', 'public'], 'GET', {'cost': 3})
51
56
  v3_private_get_brokerage_accounts = v3PrivateGetBrokerageAccounts = Entry('brokerage/accounts', ['v3', 'private'], 'GET', {'cost': 1})
52
57
  v3_private_get_brokerage_accounts_account_uuid = v3PrivateGetBrokerageAccountsAccountUuid = Entry('brokerage/accounts/{account_uuid}', ['v3', 'private'], 'GET', {'cost': 1})
53
58
  v3_private_get_brokerage_orders_historical_batch = v3PrivateGetBrokerageOrdersHistoricalBatch = Entry('brokerage/orders/historical/batch', ['v3', 'private'], 'GET', {'cost': 1})
ccxt/abstract/woo.py CHANGED
@@ -43,6 +43,7 @@ class ImplicitAPI:
43
43
  v1_private_get_position_symbol = v1PrivateGetPositionSymbol = Entry('position/{symbol}', ['v1', 'private'], 'GET', {'cost': 3.33})
44
44
  v1_private_get_client_transaction_history = v1PrivateGetClientTransactionHistory = Entry('client/transaction_history', ['v1', 'private'], 'GET', {'cost': 60})
45
45
  v1_private_post_order = v1PrivatePostOrder = Entry('order', ['v1', 'private'], 'POST', {'cost': 5})
46
+ v1_private_post_order_cancel_all_after = v1PrivatePostOrderCancelAllAfter = Entry('order/cancel_all_after', ['v1', 'private'], 'POST', {'cost': 1})
46
47
  v1_private_post_asset_main_sub_transfer = v1PrivatePostAssetMainSubTransfer = Entry('asset/main_sub_transfer', ['v1', 'private'], 'POST', {'cost': 30})
47
48
  v1_private_post_asset_ltv = v1PrivatePostAssetLtv = Entry('asset/ltv', ['v1', 'private'], 'POST', {'cost': 30})
48
49
  v1_private_post_asset_withdraw = v1PrivatePostAssetWithdraw = Entry('asset/withdraw', ['v1', 'private'], 'POST', {'cost': 30})
ccxt/ace.py CHANGED
@@ -67,8 +67,13 @@ class ace(Exchange, ImplicitAPI):
67
67
  'fetchOrderBook': True,
68
68
  'fetchOrders': False,
69
69
  'fetchOrderTrades': True,
70
+ 'fetchPosition': False,
71
+ 'fetchPositionHistory': False,
70
72
  'fetchPositionMode': False,
71
73
  'fetchPositions': False,
74
+ 'fetchPositionsForSymbol': False,
75
+ 'fetchPositionsHistory': False,
76
+ 'fetchPositionsRisk': False,
72
77
  'fetchPremiumIndexOHLCV': False,
73
78
  'fetchTicker': True,
74
79
  'fetchTickers': True,
ccxt/alpaca.py CHANGED
@@ -80,7 +80,13 @@ class alpaca(Exchange, ImplicitAPI):
80
80
  'fetchOrder': True,
81
81
  'fetchOrderBook': True,
82
82
  'fetchOrders': True,
83
+ 'fetchPosition': False,
84
+ 'fetchPositionHistory': False,
85
+ 'fetchPositionMode': False,
83
86
  'fetchPositions': False,
87
+ 'fetchPositionsForSymbol': False,
88
+ 'fetchPositionsHistory': False,
89
+ 'fetchPositionsRisk': False,
84
90
  'fetchStatus': False,
85
91
  'fetchTicker': False,
86
92
  'fetchTickers': False,
ccxt/ascendex.py CHANGED
@@ -2754,7 +2754,7 @@ class ascendex(Exchange, ImplicitAPI):
2754
2754
  'datetime': None,
2755
2755
  }
2756
2756
 
2757
- def reduce_margin(self, symbol: str, amount, params={}) -> MarginModification:
2757
+ def reduce_margin(self, symbol: str, amount: float, params={}) -> MarginModification:
2758
2758
  """
2759
2759
  remove margin from a position
2760
2760
  :param str symbol: unified market symbol
@@ -2764,7 +2764,7 @@ class ascendex(Exchange, ImplicitAPI):
2764
2764
  """
2765
2765
  return self.modify_margin_helper(symbol, -amount, 'reduce', params)
2766
2766
 
2767
- def add_margin(self, symbol: str, amount, params={}) -> MarginModification:
2767
+ def add_margin(self, symbol: str, amount: float, params={}) -> MarginModification:
2768
2768
  """
2769
2769
  add margin
2770
2770
  :param str symbol: unified market symbol
@@ -4,7 +4,7 @@
4
4
 
5
5
  # -----------------------------------------------------------------------------
6
6
 
7
- __version__ = '4.3.5'
7
+ __version__ = '4.3.7'
8
8
 
9
9
  # -----------------------------------------------------------------------------
10
10
 
ccxt/async_support/ace.py CHANGED
@@ -67,8 +67,13 @@ class ace(Exchange, ImplicitAPI):
67
67
  'fetchOrderBook': True,
68
68
  'fetchOrders': False,
69
69
  'fetchOrderTrades': True,
70
+ 'fetchPosition': False,
71
+ 'fetchPositionHistory': False,
70
72
  'fetchPositionMode': False,
71
73
  'fetchPositions': False,
74
+ 'fetchPositionsForSymbol': False,
75
+ 'fetchPositionsHistory': False,
76
+ 'fetchPositionsRisk': False,
72
77
  'fetchPremiumIndexOHLCV': False,
73
78
  'fetchTicker': True,
74
79
  'fetchTickers': True,
@@ -80,7 +80,13 @@ class alpaca(Exchange, ImplicitAPI):
80
80
  'fetchOrder': True,
81
81
  'fetchOrderBook': True,
82
82
  'fetchOrders': True,
83
+ 'fetchPosition': False,
84
+ 'fetchPositionHistory': False,
85
+ 'fetchPositionMode': False,
83
86
  'fetchPositions': False,
87
+ 'fetchPositionsForSymbol': False,
88
+ 'fetchPositionsHistory': False,
89
+ 'fetchPositionsRisk': False,
84
90
  'fetchStatus': False,
85
91
  'fetchTicker': False,
86
92
  'fetchTickers': False,
@@ -2754,7 +2754,7 @@ class ascendex(Exchange, ImplicitAPI):
2754
2754
  'datetime': None,
2755
2755
  }
2756
2756
 
2757
- async def reduce_margin(self, symbol: str, amount, params={}) -> MarginModification:
2757
+ async def reduce_margin(self, symbol: str, amount: float, params={}) -> MarginModification:
2758
2758
  """
2759
2759
  remove margin from a position
2760
2760
  :param str symbol: unified market symbol
@@ -2764,7 +2764,7 @@ class ascendex(Exchange, ImplicitAPI):
2764
2764
  """
2765
2765
  return await self.modify_margin_helper(symbol, -amount, 'reduce', params)
2766
2766
 
2767
- async def add_margin(self, symbol: str, amount, params={}) -> MarginModification:
2767
+ async def add_margin(self, symbol: str, amount: float, params={}) -> MarginModification:
2768
2768
  """
2769
2769
  add margin
2770
2770
  :param str symbol: unified market symbol
@@ -2,7 +2,7 @@
2
2
 
3
3
  # -----------------------------------------------------------------------------
4
4
 
5
- __version__ = '4.3.5'
5
+ __version__ = '4.3.7'
6
6
 
7
7
  # -----------------------------------------------------------------------------
8
8
 
@@ -1348,6 +1348,9 @@ class Exchange(BaseExchange):
1348
1348
  async def cancel_all_orders(self, symbol: Str = None, params={}):
1349
1349
  raise NotSupported(self.id + ' cancelAllOrders() is not supported yet')
1350
1350
 
1351
+ async def cancel_all_orders_after(self, timeout: Int, params={}):
1352
+ raise NotSupported(self.id + ' cancelAllOrdersAfter() is not supported yet')
1353
+
1351
1354
  async def cancel_orders_for_symbols(self, orders: List[CancellationRequest], params={}):
1352
1355
  raise NotSupported(self.id + ' cancelOrdersForSymbols() is not supported yet')
1353
1356
 
@@ -1890,3 +1893,29 @@ class Exchange(BaseExchange):
1890
1893
  sorted = self.sortCursorPaginatedResult(result)
1891
1894
  key = 0 if (method == 'fetchOHLCV') else 'timestamp'
1892
1895
  return self.filter_by_since_limit(sorted, since, limit, key)
1896
+
1897
+ async def fetch_position_history(self, symbol: str, since: Int = None, limit: Int = None, params={}):
1898
+ """
1899
+ fetches the history of margin added or reduced from contract isolated positions
1900
+ :param str [symbol]: unified market symbol
1901
+ :param int [since]: timestamp in ms of the position
1902
+ :param int [limit]: the maximum amount of candles to fetch, default=1000
1903
+ :param dict params: extra parameters specific to the exchange api endpoint
1904
+ :returns dict[]: a list of `position structures <https://docs.ccxt.com/#/?id=position-structure>`
1905
+ """
1906
+ if self.has['fetchPositionsHistory']:
1907
+ positions = await self.fetch_positions_history([symbol], since, limit, params)
1908
+ return self.safe_dict(positions, 0)
1909
+ else:
1910
+ raise NotSupported(self.id + ' fetchPositionHistory() is not supported yet')
1911
+
1912
+ async def fetch_positions_history(self, symbols: Strings = None, since: Int = None, limit: Int = None, params={}):
1913
+ """
1914
+ fetches the history of margin added or reduced from contract isolated positions
1915
+ :param str [symbol]: unified market symbol
1916
+ :param int [since]: timestamp in ms of the position
1917
+ :param int [limit]: the maximum amount of candles to fetch, default=1000
1918
+ :param dict params: extra parameters specific to the exchange api endpoint
1919
+ :returns dict[]: a list of `position structures <https://docs.ccxt.com/#/?id=position-structure>`
1920
+ """
1921
+ raise NotSupported(self.id + ' fetchPositionsHistory() is not supported yet')
@@ -2044,7 +2044,7 @@ class bigone(Exchange, ImplicitAPI):
2044
2044
  }
2045
2045
  return self.safe_string(statuses, status, 'failed')
2046
2046
 
2047
- async def withdraw(self, code: str, amount: float, address, tag=None, params={}):
2047
+ async def withdraw(self, code: str, amount: float, address: str, tag=None, params={}):
2048
2048
  """
2049
2049
  make a withdrawal
2050
2050
  :see: https://open.big.one/docs/spot_withdrawal.html#create-withdrawal-of-user
@@ -148,8 +148,10 @@ class binance(Exchange, ImplicitAPI):
148
148
  'fetchOrders': True,
149
149
  'fetchOrderTrades': True,
150
150
  'fetchPosition': True,
151
+ 'fetchPositionHistory': False,
151
152
  'fetchPositionMode': True,
152
153
  'fetchPositions': True,
154
+ 'fetchPositionsHistory': False,
153
155
  'fetchPositionsRisk': True,
154
156
  'fetchPremiumIndexOHLCV': False,
155
157
  'fetchSettlementHistory': True,
@@ -344,6 +346,7 @@ class binance(Exchange, ImplicitAPI):
344
346
  'capital/deposit/subAddress': 0.1,
345
347
  'capital/deposit/subHisrec': 0.1,
346
348
  'capital/withdraw/history': 1800, # Weight(IP): 18000 => cost = 0.1 * 18000 = 1800
349
+ 'capital/withdraw/address/list': 10,
347
350
  'capital/contract/convertible-coins': 4.0002, # Weight(UID): 600 => cost = 0.006667 * 600 = 4.0002
348
351
  'convert/tradeFlow': 20.001, # Weight(UID): 3000 => cost = 0.006667 * 3000 = 20.001
349
352
  'convert/exchangeInfo': 50,
@@ -3988,6 +3991,7 @@ class binance(Exchange, ImplicitAPI):
3988
3991
  :param str[] [symbols]: unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
3989
3992
  :param dict [params]: extra parameters specific to the exchange API endpoint
3990
3993
  :param str [params.subType]: "linear" or "inverse"
3994
+ :param str [params.type]: 'spot', 'option', use params["subType"] for swap and future markets
3991
3995
  :returns dict: a dictionary of `ticker structures <https://docs.ccxt.com/#/?id=ticker-structure>`
3992
3996
  """
3993
3997
  await self.load_markets()
@@ -8017,7 +8021,7 @@ class binance(Exchange, ImplicitAPI):
8017
8021
  }
8018
8022
  return result
8019
8023
 
8020
- async def withdraw(self, code: str, amount: float, address, tag=None, params={}):
8024
+ async def withdraw(self, code: str, amount: float, address: str, tag=None, params={}):
8021
8025
  """
8022
8026
  make a withdrawal
8023
8027
  :see: https://binance-docs.github.io/apidocs/spot/en/#withdraw-user_data
@@ -10378,7 +10382,7 @@ class binance(Exchange, ImplicitAPI):
10378
10382
  'datetime': self.iso8601(timestamp),
10379
10383
  }
10380
10384
 
10381
- async def reduce_margin(self, symbol: str, amount, params={}) -> MarginModification:
10385
+ async def reduce_margin(self, symbol: str, amount: float, params={}) -> MarginModification:
10382
10386
  """
10383
10387
  :see: https://binance-docs.github.io/apidocs/delivery/en/#modify-isolated-position-margin-trade
10384
10388
  :see: https://binance-docs.github.io/apidocs/futures/en/#modify-isolated-position-margin-trade
@@ -10390,7 +10394,7 @@ class binance(Exchange, ImplicitAPI):
10390
10394
  """
10391
10395
  return await self.modify_margin_helper(symbol, amount, 2, params)
10392
10396
 
10393
- async def add_margin(self, symbol: str, amount, params={}) -> MarginModification:
10397
+ async def add_margin(self, symbol: str, amount: float, params={}) -> MarginModification:
10394
10398
  """
10395
10399
  :see: https://binance-docs.github.io/apidocs/delivery/en/#modify-isolated-position-margin-trade
10396
10400
  :see: https://binance-docs.github.io/apidocs/futures/en/#modify-isolated-position-margin-trade
@@ -47,6 +47,7 @@ class bingx(Exchange, ImplicitAPI):
47
47
  'option': False,
48
48
  'addMargin': True,
49
49
  'cancelAllOrders': True,
50
+ 'cancelAllOrdersAfter': True,
50
51
  'cancelOrder': True,
51
52
  'cancelOrders': True,
52
53
  'closeAllPositions': True,
@@ -86,8 +87,10 @@ class bingx(Exchange, ImplicitAPI):
86
87
  'fetchOrder': True,
87
88
  'fetchOrderBook': True,
88
89
  'fetchOrders': True,
90
+ 'fetchPositionHistory': False,
89
91
  'fetchPositionMode': True,
90
92
  'fetchPositions': True,
93
+ 'fetchPositionsHistory': False,
91
94
  'fetchTicker': True,
92
95
  'fetchTickers': True,
93
96
  'fetchTime': True,
@@ -243,6 +246,7 @@ class bingx(Exchange, ImplicitAPI):
243
246
  'trade/order': 3,
244
247
  'trade/batchOrders': 3,
245
248
  'trade/closeAllPositions': 3,
249
+ 'trade/cancelAllAfter': 3,
246
250
  'trade/marginType': 3,
247
251
  'trade/leverage': 3,
248
252
  'trade/positionMargin': 3,
@@ -2582,6 +2586,44 @@ class bingx(Exchange, ImplicitAPI):
2582
2586
  #
2583
2587
  return response
2584
2588
 
2589
+ async def cancel_all_orders_after(self, timeout: Int, params={}):
2590
+ """
2591
+ dead man's switch, cancel all orders after the given timeout
2592
+ :see: https://bingx-api.github.io/docs/#/en-us/spot/trade-api.html#Cancel%20all%20orders%20in%20countdown
2593
+ :see: https://bingx-api.github.io/docs/#/en-us/swapV2/trade-api.html#Cancel%20all%20orders%20in%20countdown
2594
+ :param number timeout: time in milliseconds, 0 represents cancel the timer
2595
+ :param dict [params]: extra parameters specific to the exchange API endpoint
2596
+ :param str [params.type]: spot or swap market
2597
+ :returns dict: the api result
2598
+ """
2599
+ await self.load_markets()
2600
+ isActive = (timeout > 0)
2601
+ request: dict = {
2602
+ 'type': 'ACTIVATE' if (isActive) else 'CLOSE',
2603
+ 'timeOut': (self.parse_to_int(timeout / 1000)) if (isActive) else 0,
2604
+ }
2605
+ response = None
2606
+ type = None
2607
+ type, params = self.handle_market_type_and_params('cancelAllOrdersAfter', None, params)
2608
+ if type == 'spot':
2609
+ response = await self.spotV1PrivatePostTradeCancelAllAfter(self.extend(request, params))
2610
+ elif type == 'swap':
2611
+ response = await self.swapV2PrivatePostTradeCancelAllAfter(self.extend(request, params))
2612
+ else:
2613
+ raise NotSupported(self.id + ' cancelAllOrdersAfter() is not supported for ' + type + ' markets')
2614
+ #
2615
+ # {
2616
+ # code: '0',
2617
+ # msg: '',
2618
+ # data: {
2619
+ # triggerTime: '1712645434',
2620
+ # status: 'ACTIVATED',
2621
+ # note: 'All your perpetual pending orders will be closed automatically at 2024-04-09 06:50:34 UTC(+0),before that you can cancel the timer, or self.extend triggerTime time by self request'
2622
+ # }
2623
+ # }
2624
+ #
2625
+ return response
2626
+
2585
2627
  async def fetch_order(self, id: str, symbol: Str = None, params={}):
2586
2628
  """
2587
2629
  fetches information on an order made by the user
@@ -3643,7 +3685,7 @@ class bingx(Exchange, ImplicitAPI):
3643
3685
  coins = self.safe_list(response, 'data')
3644
3686
  return self.parse_deposit_withdraw_fees(coins, codes, 'coin')
3645
3687
 
3646
- async def withdraw(self, code: str, amount: float, address, tag=None, params={}):
3688
+ async def withdraw(self, code: str, amount: float, address: str, tag=None, params={}):
3647
3689
  """
3648
3690
  make a withdrawal
3649
3691
  :see: https://bingx-api.github.io/docs/#/common/account-api.html#Withdraw
@@ -64,8 +64,11 @@ class bitbank(Exchange, ImplicitAPI):
64
64
  'fetchOrder': True,
65
65
  'fetchOrderBook': True,
66
66
  'fetchPosition': False,
67
+ 'fetchPositionHistory': False,
67
68
  'fetchPositionMode': False,
68
69
  'fetchPositions': False,
70
+ 'fetchPositionsForSymbol': False,
71
+ 'fetchPositionsHistory': False,
69
72
  'fetchPositionsRisk': False,
70
73
  'fetchPremiumIndexOHLCV': False,
71
74
  'fetchTicker': True,
@@ -763,7 +766,7 @@ class bitbank(Exchange, ImplicitAPI):
763
766
  'info': response,
764
767
  }
765
768
 
766
- async def withdraw(self, code: str, amount: float, address, tag=None, params={}):
769
+ async def withdraw(self, code: str, amount: float, address: str, tag=None, params={}):
767
770
  """
768
771
  make a withdrawal
769
772
  :see: https://github.com/bitbankinc/bitbank-api-docs/blob/38d6d7c6f486c793872fd4b4087a0d090a04cd0a/rest-api.md#new-withdrawal-request
@@ -1462,7 +1462,7 @@ class bitfinex(Exchange, ImplicitAPI):
1462
1462
  }
1463
1463
  return self.safe_string(statuses, status, status)
1464
1464
 
1465
- async def withdraw(self, code: str, amount: float, address, tag=None, params={}):
1465
+ async def withdraw(self, code: str, amount: float, address: str, tag=None, params={}):
1466
1466
  """
1467
1467
  make a withdrawal
1468
1468
  :see: https://docs.bitfinex.com/v1/reference/rest-auth-withdrawal
@@ -2424,7 +2424,7 @@ class bitfinex2(Exchange, ImplicitAPI):
2424
2424
  #
2425
2425
  return self.parse_transactions(response, currency, since, limit)
2426
2426
 
2427
- async def withdraw(self, code: str, amount: float, address, tag=None, params={}):
2427
+ async def withdraw(self, code: str, amount: float, address: str, tag=None, params={}):
2428
2428
  """
2429
2429
  make a withdrawal
2430
2430
  :see: https://docs.bitfinex.com/reference/rest-auth-withdraw
@@ -764,7 +764,7 @@ class bitflyer(Exchange, ImplicitAPI):
764
764
  # todo unify parsePosition/parsePositions
765
765
  return response
766
766
 
767
- async def withdraw(self, code: str, amount: float, address, tag=None, params={}):
767
+ async def withdraw(self, code: str, amount: float, address: str, tag=None, params={}):
768
768
  """
769
769
  make a withdrawal
770
770
  :see: https://lightning.bitflyer.com/docs?lang=en#withdrawing-funds
@@ -128,8 +128,10 @@ class bitget(Exchange, ImplicitAPI):
128
128
  'fetchOrders': False,
129
129
  'fetchOrderTrades': False,
130
130
  'fetchPosition': True,
131
+ 'fetchPositionHistory': 'emulated',
131
132
  'fetchPositionMode': False,
132
133
  'fetchPositions': True,
134
+ 'fetchPositionsHistory': True,
133
135
  'fetchPositionsRisk': False,
134
136
  'fetchPremiumIndexOHLCV': False,
135
137
  'fetchStatus': False,
@@ -2160,7 +2162,7 @@ class bitget(Exchange, ImplicitAPI):
2160
2162
  rawTransactions = self.safe_list(response, 'data', [])
2161
2163
  return self.parse_transactions(rawTransactions, currency, since, limit)
2162
2164
 
2163
- async def withdraw(self, code: str, amount: float, address, tag=None, params={}):
2165
+ async def withdraw(self, code: str, amount: float, address: str, tag=None, params={}):
2164
2166
  """
2165
2167
  make a withdrawal
2166
2168
  :see: https://www.bitget.com/api-doc/spot/account/Wallet-Withdrawal
@@ -6086,7 +6088,7 @@ class bitget(Exchange, ImplicitAPI):
6086
6088
  # "cTime": "1700807507275"
6087
6089
  # }
6088
6090
  #
6089
- # fetchPositions: privateMixGetV2MixPositionHistoryPosition
6091
+ # fetchPositionsHistory: privateMixGetV2MixPositionHistoryPosition
6090
6092
  #
6091
6093
  # {
6092
6094
  # "symbol": "BTCUSDT",
@@ -6501,7 +6503,7 @@ class bitget(Exchange, ImplicitAPI):
6501
6503
  'datetime': None,
6502
6504
  }
6503
6505
 
6504
- async def reduce_margin(self, symbol: str, amount, params={}) -> MarginModification:
6506
+ async def reduce_margin(self, symbol: str, amount: float, params={}) -> MarginModification:
6505
6507
  """
6506
6508
  remove margin from a position
6507
6509
  :see: https://www.bitget.com/api-doc/contract/account/Change-Margin
@@ -6517,7 +6519,7 @@ class bitget(Exchange, ImplicitAPI):
6517
6519
  raise ArgumentsRequired(self.id + ' reduceMargin() requires a holdSide parameter, either long or short')
6518
6520
  return await self.modify_margin_helper(symbol, amount, 'reduce', params)
6519
6521
 
6520
- async def add_margin(self, symbol: str, amount, params={}) -> MarginModification:
6522
+ async def add_margin(self, symbol: str, amount: float, params={}) -> MarginModification:
6521
6523
  """
6522
6524
  add margin
6523
6525
  :see: https://www.bitget.com/api-doc/contract/account/Change-Margin
@@ -7858,6 +7860,70 @@ class bitget(Exchange, ImplicitAPI):
7858
7860
  'marginMode': marginType,
7859
7861
  }
7860
7862
 
7863
+ async def fetch_positions_history(self, symbols: Strings = None, since: Int = None, limit: Int = None, params={}) -> List[Position]:
7864
+ """
7865
+ fetches historical positions
7866
+ :see: https://www.bitget.com/api-doc/contract/position/Get-History-Position
7867
+ :param str [symbol]: unified contract symbols
7868
+ :param int [since]: timestamp in ms of the earliest position to fetch, default=3 months ago, max range for params["until"] - since is 3 months
7869
+ :param int [limit]: the maximum amount of records to fetch, default=20, max=100
7870
+ :param dict params: extra parameters specific to the exchange api endpoint
7871
+ :param int [params.until]: timestamp in ms of the latest position to fetch, max range for params["until"] - since is 3 months
7872
+ *
7873
+ * EXCHANGE SPECIFIC PARAMETERS
7874
+ :param str [params.productType]: USDT-FUTURES(default), COIN-FUTURES, USDC-FUTURES, SUSDT-FUTURES, SCOIN-FUTURES, or SUSDC-FUTURES
7875
+ :returns dict[]: a list of `position structures <https://docs.ccxt.com/#/?id=position-structure>`
7876
+ """
7877
+ await self.load_markets()
7878
+ until = self.safe_integer(params, 'until')
7879
+ params = self.omit(params, 'until')
7880
+ request = {}
7881
+ if symbols is not None:
7882
+ symbolsLength = len(symbols)
7883
+ if symbolsLength > 0:
7884
+ market = self.market(symbols[0])
7885
+ request['symbol'] = market['id']
7886
+ if since is not None:
7887
+ request['startTime'] = since
7888
+ if limit is not None:
7889
+ request['limit'] = limit
7890
+ if until is not None:
7891
+ request['endTime'] = until
7892
+ response = await self.privateMixGetV2MixPositionHistoryPosition(self.extend(request, params))
7893
+ #
7894
+ # {
7895
+ # code: '00000',
7896
+ # msg: 'success',
7897
+ # requestTime: '1712794148791',
7898
+ # data: {
7899
+ # list: [
7900
+ # {
7901
+ # symbol: 'XRPUSDT',
7902
+ # marginCoin: 'USDT',
7903
+ # holdSide: 'long',
7904
+ # openAvgPrice: '0.64967',
7905
+ # closeAvgPrice: '0.58799',
7906
+ # marginMode: 'isolated',
7907
+ # openTotalPos: '10',
7908
+ # closeTotalPos: '10',
7909
+ # pnl: '-0.62976205',
7910
+ # netProfit: '-0.65356802',
7911
+ # totalFunding: '-0.01638',
7912
+ # openFee: '-0.00389802',
7913
+ # closeFee: '-0.00352794',
7914
+ # ctime: '1709590322199',
7915
+ # utime: '1709667583395'
7916
+ # },
7917
+ # ...
7918
+ # ]
7919
+ # }
7920
+ # }
7921
+ #
7922
+ data = self.safe_dict(response, 'data')
7923
+ responseList = self.safe_list(data, 'list')
7924
+ positions = self.parse_positions(responseList, symbols, params)
7925
+ return self.filter_by_since_limit(positions, since, limit)
7926
+
7861
7927
  async def fetch_convert_quote(self, fromCode: str, toCode: str, amount: Num = None, params={}) -> Conversion:
7862
7928
  """
7863
7929
  fetch a quote for converting from one currency to another
@@ -66,7 +66,11 @@ class bithumb(Exchange, ImplicitAPI):
66
66
  'fetchOrder': True,
67
67
  'fetchOrderBook': True,
68
68
  'fetchPosition': False,
69
+ 'fetchPositionHistory': False,
70
+ 'fetchPositionMode': False,
69
71
  'fetchPositions': False,
72
+ 'fetchPositionsForSymbol': False,
73
+ 'fetchPositionsHistory': False,
70
74
  'fetchPositionsRisk': False,
71
75
  'fetchPremiumIndexOHLCV': False,
72
76
  'fetchTicker': True,
@@ -928,7 +932,7 @@ class bithumb(Exchange, ImplicitAPI):
928
932
  }
929
933
  return await self.cancel_order(order['id'], order['symbol'], self.extend(request, params))
930
934
 
931
- async def withdraw(self, code: str, amount: float, address, tag=None, params={}):
935
+ async def withdraw(self, code: str, amount: float, address: str, tag=None, params={}):
932
936
  """
933
937
  make a withdrawal
934
938
  :see: https://apidocs.bithumb.com/reference/%EC%BD%94%EC%9D%B8-%EC%B6%9C%EA%B8%88%ED%95%98%EA%B8%B0-%EA%B0%9C%EC%9D%B8
@@ -2961,7 +2961,7 @@ class bitmart(Exchange, ImplicitAPI):
2961
2961
  return code
2962
2962
  return self.network_id_to_code(networkId)
2963
2963
 
2964
- async def withdraw(self, code: str, amount: float, address, tag=None, params={}):
2964
+ async def withdraw(self, code: str, amount: float, address: str, tag=None, params={}):
2965
2965
  """
2966
2966
  make a withdrawal
2967
2967
  :param str code: unified currency code