ccxt 4.4.32__py2.py3-none-any.whl → 4.4.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.
Files changed (95) hide show
  1. ccxt/__init__.py +3 -1
  2. ccxt/abstract/bingx.py +16 -0
  3. ccxt/abstract/bitbank.py +5 -0
  4. ccxt/abstract/bitfinex2.py +1 -0
  5. ccxt/abstract/coinbaseexchange.py +1 -0
  6. ccxt/abstract/ellipx.py +25 -0
  7. ccxt/abstract/kraken.py +1 -0
  8. ccxt/alpaca.py +2 -0
  9. ccxt/async_support/__init__.py +3 -1
  10. ccxt/async_support/alpaca.py +2 -0
  11. ccxt/async_support/base/exchange.py +1 -1
  12. ccxt/async_support/binance.py +164 -7
  13. ccxt/async_support/bingx.py +155 -8
  14. ccxt/async_support/bitbank.py +5 -0
  15. ccxt/async_support/bitbns.py +2 -0
  16. ccxt/async_support/bitfinex2.py +1 -0
  17. ccxt/async_support/bitget.py +174 -40
  18. ccxt/async_support/bitmex.py +2 -0
  19. ccxt/async_support/bitopro.py +3 -0
  20. ccxt/async_support/bitrue.py +1 -0
  21. ccxt/async_support/btcmarkets.py +2 -0
  22. ccxt/async_support/bybit.py +143 -12
  23. ccxt/async_support/cex.py +16 -5
  24. ccxt/async_support/coinbase.py +5 -24
  25. ccxt/async_support/coinbaseexchange.py +2 -1
  26. ccxt/async_support/coinex.py +2 -0
  27. ccxt/async_support/coinone.py +7 -7
  28. ccxt/async_support/coinsph.py +7 -7
  29. ccxt/async_support/coinspot.py +39 -39
  30. ccxt/async_support/cryptocom.py +36 -34
  31. ccxt/async_support/ellipx.py +1828 -0
  32. ccxt/async_support/gate.py +1 -0
  33. ccxt/async_support/hyperliquid.py +13 -2
  34. ccxt/async_support/kraken.py +1 -0
  35. ccxt/async_support/krakenfutures.py +3 -1
  36. ccxt/async_support/kucoinfutures.py +1 -1
  37. ccxt/async_support/lbank.py +1 -0
  38. ccxt/async_support/okcoin.py +2 -0
  39. ccxt/async_support/okx.py +103 -8
  40. ccxt/async_support/onetrading.py +20 -1
  41. ccxt/async_support/paradex.py +2 -0
  42. ccxt/async_support/phemex.py +33 -6
  43. ccxt/async_support/poloniex.py +3 -1
  44. ccxt/async_support/poloniexfutures.py +3 -1
  45. ccxt/async_support/vertex.py +2 -0
  46. ccxt/async_support/woo.py +69 -69
  47. ccxt/base/exchange.py +100 -2
  48. ccxt/binance.py +164 -7
  49. ccxt/bingx.py +155 -8
  50. ccxt/bitbank.py +5 -0
  51. ccxt/bitbns.py +2 -0
  52. ccxt/bitfinex2.py +1 -0
  53. ccxt/bitget.py +174 -40
  54. ccxt/bitmex.py +2 -0
  55. ccxt/bitopro.py +3 -0
  56. ccxt/bitrue.py +1 -0
  57. ccxt/btcmarkets.py +2 -0
  58. ccxt/bybit.py +143 -12
  59. ccxt/cex.py +16 -5
  60. ccxt/coinbase.py +5 -24
  61. ccxt/coinbaseexchange.py +2 -1
  62. ccxt/coinex.py +2 -0
  63. ccxt/coinone.py +7 -7
  64. ccxt/coinsph.py +7 -7
  65. ccxt/coinspot.py +39 -39
  66. ccxt/cryptocom.py +36 -34
  67. ccxt/ellipx.py +1828 -0
  68. ccxt/gate.py +1 -0
  69. ccxt/hyperliquid.py +13 -2
  70. ccxt/kraken.py +1 -0
  71. ccxt/krakenfutures.py +3 -1
  72. ccxt/kucoinfutures.py +1 -1
  73. ccxt/lbank.py +1 -0
  74. ccxt/okcoin.py +2 -0
  75. ccxt/okx.py +103 -8
  76. ccxt/onetrading.py +20 -1
  77. ccxt/paradex.py +2 -0
  78. ccxt/phemex.py +33 -6
  79. ccxt/poloniex.py +3 -1
  80. ccxt/poloniexfutures.py +3 -1
  81. ccxt/pro/__init__.py +1 -1
  82. ccxt/pro/idex.py +15 -0
  83. ccxt/pro/okx.py +8 -0
  84. ccxt/pro/probit.py +4 -2
  85. ccxt/pro/woo.py +15 -15
  86. ccxt/test/tests_async.py +3 -1
  87. ccxt/test/tests_helpers.py +1 -3
  88. ccxt/test/tests_sync.py +3 -1
  89. ccxt/vertex.py +2 -0
  90. ccxt/woo.py +69 -69
  91. {ccxt-4.4.32.dist-info → ccxt-4.4.34.dist-info}/METADATA +9 -8
  92. {ccxt-4.4.32.dist-info → ccxt-4.4.34.dist-info}/RECORD +95 -92
  93. {ccxt-4.4.32.dist-info → ccxt-4.4.34.dist-info}/LICENSE.txt +0 -0
  94. {ccxt-4.4.32.dist-info → ccxt-4.4.34.dist-info}/WHEEL +0 -0
  95. {ccxt-4.4.32.dist-info → ccxt-4.4.34.dist-info}/top_level.txt +0 -0
ccxt/__init__.py CHANGED
@@ -22,7 +22,7 @@
22
22
 
23
23
  # ----------------------------------------------------------------------------
24
24
 
25
- __version__ = '4.4.32'
25
+ __version__ = '4.4.34'
26
26
 
27
27
  # ----------------------------------------------------------------------------
28
28
 
@@ -138,6 +138,7 @@ from ccxt.currencycom import currencycom # noqa: F4
138
138
  from ccxt.delta import delta # noqa: F401
139
139
  from ccxt.deribit import deribit # noqa: F401
140
140
  from ccxt.digifinex import digifinex # noqa: F401
141
+ from ccxt.ellipx import ellipx # noqa: F401
141
142
  from ccxt.exmo import exmo # noqa: F401
142
143
  from ccxt.fmfwio import fmfwio # noqa: F401
143
144
  from ccxt.gate import gate # noqa: F401
@@ -249,6 +250,7 @@ exchanges = [
249
250
  'delta',
250
251
  'deribit',
251
252
  'digifinex',
253
+ 'ellipx',
252
254
  'exmo',
253
255
  'fmfwio',
254
256
  'gate',
ccxt/abstract/bingx.py CHANGED
@@ -32,14 +32,28 @@ class ImplicitAPI:
32
32
  spot_v3_private_post_post_asset_transfer = spotV3PrivatePostPostAssetTransfer = Entry('post/asset/transfer', ['spot', 'v3', 'private'], 'POST', {'cost': 5})
33
33
  swap_v1_public_get_ticker_price = swapV1PublicGetTickerPrice = Entry('ticker/price', ['swap', 'v1', 'public'], 'GET', {'cost': 1})
34
34
  swap_v1_public_get_market_historicaltrades = swapV1PublicGetMarketHistoricalTrades = Entry('market/historicalTrades', ['swap', 'v1', 'public'], 'GET', {'cost': 1})
35
+ swap_v1_public_get_market_markpriceklines = swapV1PublicGetMarketMarkPriceKlines = Entry('market/markPriceKlines', ['swap', 'v1', 'public'], 'GET', {'cost': 1})
36
+ swap_v1_public_get_trade_multiassetsrules = swapV1PublicGetTradeMultiAssetsRules = Entry('trade/multiAssetsRules', ['swap', 'v1', 'public'], 'GET', {'cost': 1})
35
37
  swap_v1_private_get_positionside_dual = swapV1PrivateGetPositionSideDual = Entry('positionSide/dual', ['swap', 'v1', 'private'], 'GET', {'cost': 5})
36
38
  swap_v1_private_get_market_markpriceklines = swapV1PrivateGetMarketMarkPriceKlines = Entry('market/markPriceKlines', ['swap', 'v1', 'private'], 'GET', {'cost': 1})
37
39
  swap_v1_private_get_trade_batchcancelreplace = swapV1PrivateGetTradeBatchCancelReplace = Entry('trade/batchCancelReplace', ['swap', 'v1', 'private'], 'GET', {'cost': 5})
38
40
  swap_v1_private_get_trade_fullorder = swapV1PrivateGetTradeFullOrder = Entry('trade/fullOrder', ['swap', 'v1', 'private'], 'GET', {'cost': 2})
41
+ swap_v1_private_get_maintmarginratio = swapV1PrivateGetMaintMarginRatio = Entry('maintMarginRatio', ['swap', 'v1', 'private'], 'GET', {'cost': 2})
42
+ swap_v1_private_get_trade_positionhistory = swapV1PrivateGetTradePositionHistory = Entry('trade/positionHistory', ['swap', 'v1', 'private'], 'GET', {'cost': 2})
39
43
  swap_v1_private_get_positionmargin_history = swapV1PrivateGetPositionMarginHistory = Entry('positionMargin/history', ['swap', 'v1', 'private'], 'GET', {'cost': 2})
44
+ swap_v1_private_get_twap_openorders = swapV1PrivateGetTwapOpenOrders = Entry('twap/openOrders', ['swap', 'v1', 'private'], 'GET', {'cost': 5})
45
+ swap_v1_private_get_twap_historyorders = swapV1PrivateGetTwapHistoryOrders = Entry('twap/historyOrders', ['swap', 'v1', 'private'], 'GET', {'cost': 5})
46
+ swap_v1_private_get_twap_orderdetail = swapV1PrivateGetTwapOrderDetail = Entry('twap/orderDetail', ['swap', 'v1', 'private'], 'GET', {'cost': 5})
47
+ swap_v1_private_get_trade_assetmode = swapV1PrivateGetTradeAssetMode = Entry('trade/assetMode', ['swap', 'v1', 'private'], 'GET', {'cost': 5})
48
+ swap_v1_private_get_user_marginassets = swapV1PrivateGetUserMarginAssets = Entry('user/marginAssets', ['swap', 'v1', 'private'], 'GET', {'cost': 5})
40
49
  swap_v1_private_post_trade_cancelreplace = swapV1PrivatePostTradeCancelReplace = Entry('trade/cancelReplace', ['swap', 'v1', 'private'], 'POST', {'cost': 2})
41
50
  swap_v1_private_post_positionside_dual = swapV1PrivatePostPositionSideDual = Entry('positionSide/dual', ['swap', 'v1', 'private'], 'POST', {'cost': 5})
51
+ swap_v1_private_post_trade_batchcancelreplace = swapV1PrivatePostTradeBatchCancelReplace = Entry('trade/batchCancelReplace', ['swap', 'v1', 'private'], 'POST', {'cost': 5})
42
52
  swap_v1_private_post_trade_closeposition = swapV1PrivatePostTradeClosePosition = Entry('trade/closePosition', ['swap', 'v1', 'private'], 'POST', {'cost': 2})
53
+ swap_v1_private_post_trade_getvst = swapV1PrivatePostTradeGetVst = Entry('trade/getVst', ['swap', 'v1', 'private'], 'POST', {'cost': 5})
54
+ swap_v1_private_post_twap_order = swapV1PrivatePostTwapOrder = Entry('twap/order', ['swap', 'v1', 'private'], 'POST', {'cost': 5})
55
+ swap_v1_private_post_twap_cancelorder = swapV1PrivatePostTwapCancelOrder = Entry('twap/cancelOrder', ['swap', 'v1', 'private'], 'POST', {'cost': 5})
56
+ swap_v1_private_post_trade_assetmode = swapV1PrivatePostTradeAssetMode = Entry('trade/assetMode', ['swap', 'v1', 'private'], 'POST', {'cost': 5})
43
57
  swap_v2_public_get_server_time = swapV2PublicGetServerTime = Entry('server/time', ['swap', 'v2', 'public'], 'GET', {'cost': 1})
44
58
  swap_v2_public_get_quote_contracts = swapV2PublicGetQuoteContracts = Entry('quote/contracts', ['swap', 'v2', 'public'], 'GET', {'cost': 1})
45
59
  swap_v2_public_get_quote_price = swapV2PublicGetQuotePrice = Entry('quote/price', ['swap', 'v2', 'public'], 'GET', {'cost': 1})
@@ -62,6 +76,7 @@ class ImplicitAPI:
62
76
  swap_v2_private_get_trade_forceorders = swapV2PrivateGetTradeForceOrders = Entry('trade/forceOrders', ['swap', 'v2', 'private'], 'GET', {'cost': 1})
63
77
  swap_v2_private_get_trade_allorders = swapV2PrivateGetTradeAllOrders = Entry('trade/allOrders', ['swap', 'v2', 'private'], 'GET', {'cost': 2})
64
78
  swap_v2_private_get_trade_allfillorders = swapV2PrivateGetTradeAllFillOrders = Entry('trade/allFillOrders', ['swap', 'v2', 'private'], 'GET', {'cost': 2})
79
+ swap_v2_private_get_trade_fillhistory = swapV2PrivateGetTradeFillHistory = Entry('trade/fillHistory', ['swap', 'v2', 'private'], 'GET', {'cost': 2})
65
80
  swap_v2_private_get_user_income_export = swapV2PrivateGetUserIncomeExport = Entry('user/income/export', ['swap', 'v2', 'private'], 'GET', {'cost': 2})
66
81
  swap_v2_private_get_user_commissionrate = swapV2PrivateGetUserCommissionRate = Entry('user/commissionRate', ['swap', 'v2', 'private'], 'GET', {'cost': 2})
67
82
  swap_v2_private_get_quote_bookticker = swapV2PrivateGetQuoteBookTicker = Entry('quote/bookTicker', ['swap', 'v2', 'private'], 'GET', {'cost': 1})
@@ -95,6 +110,7 @@ class ImplicitAPI:
95
110
  cswap_v1_private_get_user_balance = cswapV1PrivateGetUserBalance = Entry('user/balance', ['cswap', 'v1', 'private'], 'GET', {'cost': 2})
96
111
  cswap_v1_private_post_trade_order = cswapV1PrivatePostTradeOrder = Entry('trade/order', ['cswap', 'v1', 'private'], 'POST', {'cost': 2})
97
112
  cswap_v1_private_post_trade_leverage = cswapV1PrivatePostTradeLeverage = Entry('trade/leverage', ['cswap', 'v1', 'private'], 'POST', {'cost': 2})
113
+ cswap_v1_private_post_trade_allopenorders = cswapV1PrivatePostTradeAllOpenOrders = Entry('trade/allOpenOrders', ['cswap', 'v1', 'private'], 'POST', {'cost': 2})
98
114
  cswap_v1_private_post_trade_closeallpositions = cswapV1PrivatePostTradeCloseAllPositions = Entry('trade/closeAllPositions', ['cswap', 'v1', 'private'], 'POST', {'cost': 2})
99
115
  cswap_v1_private_post_trade_margintype = cswapV1PrivatePostTradeMarginType = Entry('trade/marginType', ['cswap', 'v1', 'private'], 'POST', {'cost': 2})
100
116
  cswap_v1_private_post_trade_positionmargin = cswapV1PrivatePostTradePositionMargin = Entry('trade/positionMargin', ['cswap', 'v1', 'private'], 'POST', {'cost': 2})
ccxt/abstract/bitbank.py CHANGED
@@ -13,8 +13,11 @@ class ImplicitAPI:
13
13
  private_get_user_assets = privateGetUserAssets = Entry('user/assets', 'private', 'GET', {})
14
14
  private_get_user_spot_order = privateGetUserSpotOrder = Entry('user/spot/order', 'private', 'GET', {})
15
15
  private_get_user_spot_active_orders = privateGetUserSpotActiveOrders = Entry('user/spot/active_orders', 'private', 'GET', {})
16
+ private_get_user_margin_positions = privateGetUserMarginPositions = Entry('user/margin/positions', 'private', 'GET', {})
16
17
  private_get_user_spot_trade_history = privateGetUserSpotTradeHistory = Entry('user/spot/trade_history', 'private', 'GET', {})
17
18
  private_get_user_deposit_history = privateGetUserDepositHistory = Entry('user/deposit_history', 'private', 'GET', {})
19
+ private_get_user_unconfirmed_deposits = privateGetUserUnconfirmedDeposits = Entry('user/unconfirmed_deposits', 'private', 'GET', {})
20
+ private_get_user_deposit_originators = privateGetUserDepositOriginators = Entry('user/deposit_originators', 'private', 'GET', {})
18
21
  private_get_user_withdrawal_account = privateGetUserWithdrawalAccount = Entry('user/withdrawal_account', 'private', 'GET', {})
19
22
  private_get_user_withdrawal_history = privateGetUserWithdrawalHistory = Entry('user/withdrawal_history', 'private', 'GET', {})
20
23
  private_get_spot_status = privateGetSpotStatus = Entry('spot/status', 'private', 'GET', {})
@@ -23,5 +26,7 @@ class ImplicitAPI:
23
26
  private_post_user_spot_cancel_order = privatePostUserSpotCancelOrder = Entry('user/spot/cancel_order', 'private', 'POST', {})
24
27
  private_post_user_spot_cancel_orders = privatePostUserSpotCancelOrders = Entry('user/spot/cancel_orders', 'private', 'POST', {})
25
28
  private_post_user_spot_orders_info = privatePostUserSpotOrdersInfo = Entry('user/spot/orders_info', 'private', 'POST', {})
29
+ private_post_user_confirm_deposits = privatePostUserConfirmDeposits = Entry('user/confirm_deposits', 'private', 'POST', {})
30
+ private_post_user_confirm_deposits_all = privatePostUserConfirmDepositsAll = Entry('user/confirm_deposits_all', 'private', 'POST', {})
26
31
  private_post_user_request_withdrawal = privatePostUserRequestWithdrawal = Entry('user/request_withdrawal', 'private', 'POST', {})
27
32
  markets_get_spot_pairs = marketsGetSpotPairs = Entry('spot/pairs', 'markets', 'GET', {})
@@ -63,6 +63,7 @@ class ImplicitAPI:
63
63
  public_get_pulse_hist = publicGetPulseHist = Entry('pulse/hist', 'public', 'GET', {'cost': 2.7})
64
64
  public_get_pulse_profile_nickname = publicGetPulseProfileNickname = Entry('pulse/profile/{nickname}', 'public', 'GET', {'cost': 2.7})
65
65
  public_get_funding_stats_symbol_hist = publicGetFundingStatsSymbolHist = Entry('funding/stats/{symbol}/hist', 'public', 'GET', {'cost': 10})
66
+ public_get_ext_vasps = publicGetExtVasps = Entry('ext/vasps', 'public', 'GET', {'cost': 1})
66
67
  public_post_calc_trade_avg = publicPostCalcTradeAvg = Entry('calc/trade/avg', 'public', 'POST', {'cost': 2.7})
67
68
  public_post_calc_fx = publicPostCalcFx = Entry('calc/fx', 'public', 'POST', {'cost': 2.7})
68
69
  private_post_auth_r_wallets = privatePostAuthRWallets = Entry('auth/r/wallets', 'private', 'POST', {'cost': 2.7})
@@ -12,6 +12,7 @@ class ImplicitAPI:
12
12
  public_get_products_id_trades = publicGetProductsIdTrades = Entry('products/{id}/trades', 'public', 'GET', {})
13
13
  public_get_time = publicGetTime = Entry('time', 'public', 'GET', {})
14
14
  public_get_products_spark_lines = publicGetProductsSparkLines = Entry('products/spark-lines', 'public', 'GET', {})
15
+ public_get_products_volume_summary = publicGetProductsVolumeSummary = Entry('products/volume-summary', 'public', 'GET', {})
15
16
  private_get_address_book = privateGetAddressBook = Entry('address-book', 'private', 'GET', {})
16
17
  private_get_accounts = privateGetAccounts = Entry('accounts', 'private', 'GET', {})
17
18
  private_get_accounts_id = privateGetAccountsId = Entry('accounts/{id}', 'private', 'GET', {})
@@ -0,0 +1,25 @@
1
+ from ccxt.base.types import Entry
2
+
3
+
4
+ class ImplicitAPI:
5
+ _rest_get_market = _restGetMarket = Entry('Market', '_rest', 'GET', {'cost': 1})
6
+ _rest_get_market_currencypair = _restGetMarketCurrencyPair = Entry('Market/{currencyPair}', '_rest', 'GET', {'cost': 1})
7
+ _rest_get_crypto_token_info = _restGetCryptoTokenInfo = Entry('Crypto/Token/Info', '_rest', 'GET', {'cost': 1})
8
+ public_get_market_currencypair_getdepth = publicGetMarketCurrencyPairGetDepth = Entry('Market/{currencyPair}:getDepth', 'public', 'GET', {'cost': 1})
9
+ public_get_market_currencypair_ticker = publicGetMarketCurrencyPairTicker = Entry('Market/{currencyPair}:ticker', 'public', 'GET', {'cost': 1})
10
+ public_get_market_currencypair_gettrades = publicGetMarketCurrencyPairGetTrades = Entry('Market/{currencyPair}:getTrades', 'public', 'GET', {'cost': 1})
11
+ public_get_market_currencypair_getgraph = publicGetMarketCurrencyPairGetGraph = Entry('Market/{currencyPair}:getGraph', 'public', 'GET', {'cost': 1})
12
+ public_get_cmc_summary = publicGetCMCSummary = Entry('CMC:summary', 'public', 'GET', {'cost': 1})
13
+ public_get_cmc_currencypair_ticker = publicGetCMCCurrencyPairTicker = Entry('CMC/{currencyPair}:ticker', 'public', 'GET', {'cost': 1})
14
+ private_get_user_wallet = privateGetUserWallet = Entry('User/Wallet', 'private', 'GET', {'cost': 1})
15
+ private_get_market_currencypair_order = privateGetMarketCurrencyPairOrder = Entry('Market/{currencyPair}/Order', 'private', 'GET', {'cost': 1})
16
+ private_get_market_order_orderuuid = privateGetMarketOrderOrderUuid = Entry('Market/Order/{orderUuid}', 'private', 'GET', {'cost': 1})
17
+ private_get_market_currencypair_trade = privateGetMarketCurrencyPairTrade = Entry('Market/{currencyPair}/Trade', 'private', 'GET', {'cost': 1})
18
+ private_get_market_tradefee_query = privateGetMarketTradeFeeQuery = Entry('Market/TradeFee:query', 'private', 'GET', {'cost': 1})
19
+ private_get_unit_currency = privateGetUnitCurrency = Entry('Unit/{currency}', 'private', 'GET', {'cost': 1})
20
+ private_get_crypto_token_currency = privateGetCryptoTokenCurrency = Entry('Crypto/Token/{currency}', 'private', 'GET', {'cost': 1})
21
+ private_get_crypto_token_currency_chains = privateGetCryptoTokenCurrencyChains = Entry('Crypto/Token/{currency}:chains', 'private', 'GET', {'cost': 1})
22
+ private_post_market_currencypair_order = privatePostMarketCurrencyPairOrder = Entry('Market/{currencyPair}/Order', 'private', 'POST', {'cost': 1})
23
+ private_post_crypto_address_fetch = privatePostCryptoAddressFetch = Entry('Crypto/Address:fetch', 'private', 'POST', {'cost': 1})
24
+ private_post_crypto_disbursement_withdraw = privatePostCryptoDisbursementWithdraw = Entry('Crypto/Disbursement:withdraw', 'private', 'POST', {'cost': 1})
25
+ private_delete_market_order_orderuuid = privateDeleteMarketOrderOrderUuid = Entry('Market/Order/{orderUuid}', 'private', 'DELETE', {'cost': 1})
ccxt/abstract/kraken.py CHANGED
@@ -16,6 +16,7 @@ class ImplicitAPI:
16
16
  private_post_addorder = privatePostAddOrder = Entry('AddOrder', 'private', 'POST', {'cost': 0})
17
17
  private_post_addorderbatch = privatePostAddOrderBatch = Entry('AddOrderBatch', 'private', 'POST', {'cost': 0})
18
18
  private_post_addexport = privatePostAddExport = Entry('AddExport', 'private', 'POST', {'cost': 3})
19
+ private_post_amendorder = privatePostAmendOrder = Entry('AmendOrder', 'private', 'POST', {'cost': 0})
19
20
  private_post_balance = privatePostBalance = Entry('Balance', 'private', 'POST', {'cost': 3})
20
21
  private_post_cancelall = privatePostCancelAll = Entry('CancelAll', 'private', 'POST', {'cost': 3})
21
22
  private_post_cancelallordersafter = privatePostCancelAllOrdersAfter = Entry('CancelAllOrdersAfter', 'private', 'POST', {'cost': 3})
ccxt/alpaca.py CHANGED
@@ -61,6 +61,8 @@ class alpaca(Exchange, ImplicitAPI):
61
61
  'closeAllPositions': False,
62
62
  'closePosition': False,
63
63
  'createOrder': True,
64
+ 'createStopOrder': True,
65
+ 'createTriggerOrder': True,
64
66
  'editOrder': True,
65
67
  'fetchBalance': False,
66
68
  'fetchBidsAsks': False,
@@ -4,7 +4,7 @@
4
4
 
5
5
  # -----------------------------------------------------------------------------
6
6
 
7
- __version__ = '4.4.32'
7
+ __version__ = '4.4.34'
8
8
 
9
9
  # -----------------------------------------------------------------------------
10
10
 
@@ -118,6 +118,7 @@ from ccxt.async_support.currencycom import currencycom
118
118
  from ccxt.async_support.delta import delta # noqa: F401
119
119
  from ccxt.async_support.deribit import deribit # noqa: F401
120
120
  from ccxt.async_support.digifinex import digifinex # noqa: F401
121
+ from ccxt.async_support.ellipx import ellipx # noqa: F401
121
122
  from ccxt.async_support.exmo import exmo # noqa: F401
122
123
  from ccxt.async_support.fmfwio import fmfwio # noqa: F401
123
124
  from ccxt.async_support.gate import gate # noqa: F401
@@ -229,6 +230,7 @@ exchanges = [
229
230
  'delta',
230
231
  'deribit',
231
232
  'digifinex',
233
+ 'ellipx',
232
234
  'exmo',
233
235
  'fmfwio',
234
236
  'gate',
@@ -61,6 +61,8 @@ class alpaca(Exchange, ImplicitAPI):
61
61
  'closeAllPositions': False,
62
62
  'closePosition': False,
63
63
  'createOrder': True,
64
+ 'createStopOrder': True,
65
+ 'createTriggerOrder': True,
64
66
  'editOrder': True,
65
67
  'fetchBalance': False,
66
68
  'fetchBidsAsks': False,
@@ -2,7 +2,7 @@
2
2
 
3
3
  # -----------------------------------------------------------------------------
4
4
 
5
- __version__ = '4.4.32'
5
+ __version__ = '4.4.34'
6
6
 
7
7
  # -----------------------------------------------------------------------------
8
8
 
@@ -1579,6 +1579,159 @@ class binance(Exchange, ImplicitAPI):
1579
1579
  'BUSD': 'USD',
1580
1580
  },
1581
1581
  },
1582
+ 'features': {
1583
+ # https://developers.binance.com/docs/binance-spot-api-docs/rest-api#:~:text=quoteOrderQty
1584
+ 'spot': {
1585
+ 'sandbox': True,
1586
+ 'createOrder': {
1587
+ 'marginMode': True,
1588
+ 'triggerPrice': True,
1589
+ 'triggerPriceType': None,
1590
+ 'triggerDirection': False,
1591
+ 'stopLossPrice': True,
1592
+ 'takeProfitPrice': True,
1593
+ 'attachedStopLossTakeProfit': None, # not supported
1594
+ 'timeInForce': {
1595
+ 'GTC': True,
1596
+ 'IOC': True,
1597
+ 'FOK': True,
1598
+ 'PO': True,
1599
+ 'GTD': False,
1600
+ },
1601
+ 'hedged': True,
1602
+ # exchange-supported features
1603
+ 'selfTradePrevention': True,
1604
+ 'trailing': True,
1605
+ 'twap': False,
1606
+ 'iceberg': True,
1607
+ 'oco': False,
1608
+ },
1609
+ 'createOrders': None,
1610
+ 'fetchMyTrades': {
1611
+ 'marginMode': False,
1612
+ 'limit': 1000,
1613
+ 'daysBack': None,
1614
+ 'untilDays': 1, # days between start-end
1615
+ },
1616
+ 'fetchOrder': {
1617
+ 'marginMode': True,
1618
+ 'trigger': False,
1619
+ 'trailing': False,
1620
+ },
1621
+ 'fetchOpenOrders': {
1622
+ 'marginMode': True,
1623
+ 'limit': None,
1624
+ 'trigger': False,
1625
+ 'trailing': False,
1626
+ },
1627
+ 'fetchOrders': {
1628
+ 'marginMode': True,
1629
+ 'limit': 1000,
1630
+ 'daysBack': None,
1631
+ 'untilDays': 10000,
1632
+ 'trigger': False,
1633
+ 'trailing': False,
1634
+ },
1635
+ 'fetchClosedOrders': {
1636
+ 'marginMode': True,
1637
+ 'limit': 1000,
1638
+ 'daysBackClosed': None,
1639
+ 'daysBackCanceled': None,
1640
+ 'untilDays': 10000,
1641
+ 'trigger': False,
1642
+ 'trailing': False,
1643
+ },
1644
+ 'fetchOHLCV': {
1645
+ 'limit': 1000,
1646
+ },
1647
+ },
1648
+ 'default': {
1649
+ 'sandbox': True,
1650
+ 'createOrder': {
1651
+ 'marginMode': False,
1652
+ 'triggerPrice': True,
1653
+ 'triggerPriceType': {
1654
+ 'mark': True,
1655
+ 'last': True,
1656
+ 'index': False,
1657
+ },
1658
+ 'stopLossPrice': True,
1659
+ 'takeProfitPrice': True,
1660
+ 'attachedStopLossTakeProfit': None, # not supported
1661
+ 'timeInForce': {
1662
+ 'GTC': True,
1663
+ 'IOC': True,
1664
+ 'FOK': True,
1665
+ 'PO': True,
1666
+ 'GTD': True,
1667
+ # 'GTX': True,
1668
+ },
1669
+ 'hedged': True,
1670
+ # exchange-supported features
1671
+ 'selfTradePrevention': True,
1672
+ 'trailing': True,
1673
+ 'twap': False,
1674
+ 'iceberg': False,
1675
+ 'oco': False,
1676
+ },
1677
+ 'createOrders': {
1678
+ 'max': 5,
1679
+ },
1680
+ 'fetchMyTrades': {
1681
+ 'marginMode': False,
1682
+ 'daysBack': None,
1683
+ 'limit': 1000,
1684
+ 'untilDays': 7,
1685
+ },
1686
+ 'fetchOrder': {
1687
+ 'marginMode': False,
1688
+ 'trigger': False,
1689
+ 'trailing': False,
1690
+ },
1691
+ 'fetchOpenOrders': {
1692
+ 'marginMode': True,
1693
+ 'limit': 500,
1694
+ 'trigger': False,
1695
+ 'trailing': False,
1696
+ },
1697
+ 'fetchOrders': {
1698
+ 'marginMode': True,
1699
+ 'limit': 1000,
1700
+ 'daysBack': 90,
1701
+ 'untilDays': 7,
1702
+ 'trigger': False,
1703
+ 'trailing': False,
1704
+ },
1705
+ 'fetchClosedOrders': {
1706
+ 'marginMode': True,
1707
+ 'limit': 1000,
1708
+ 'daysBackClosed': 90,
1709
+ 'daysBackCanceled': 3,
1710
+ 'untilDays': 7,
1711
+ 'trigger': False,
1712
+ 'trailing': False,
1713
+ },
1714
+ 'fetchOHLCV': {
1715
+ 'limit': 1500,
1716
+ },
1717
+ },
1718
+ 'swap': {
1719
+ 'linear': {
1720
+ 'extends': 'default',
1721
+ },
1722
+ 'inverse': {
1723
+ 'extends': 'default',
1724
+ },
1725
+ },
1726
+ 'future': {
1727
+ 'linear': {
1728
+ 'extends': 'default',
1729
+ },
1730
+ 'inverse': {
1731
+ 'extends': 'default',
1732
+ },
1733
+ },
1734
+ },
1582
1735
  'exceptions': {
1583
1736
  'spot': {
1584
1737
  'exact': {
@@ -1974,12 +2127,15 @@ class binance(Exchange, ImplicitAPI):
1974
2127
  '-4088': PermissionDenied, # User can not place order currently
1975
2128
  '-4114': BadRequest, # INVALID_CLIENT_TRAN_ID_LEN
1976
2129
  '-4115': BadRequest, # DUPLICATED_CLIENT_TRAN_ID
2130
+ '-4116': InvalidOrder, # DUPLICATED_CLIENT_ORDER_ID
2131
+ '-4117': OperationRejected, # STOP_ORDER_TRIGGERING
1977
2132
  '-4118': OperationRejected, # REDUCE_ONLY_MARGIN_CHECK_FAILED
1978
2133
  '-4131': OperationRejected, # The counterparty's best price does not meet the PERCENT_PRICE filter limit
1979
2134
  '-4140': BadRequest, # Invalid symbol status for opening position
1980
2135
  '-4141': OperationRejected, # Symbol is closed
1981
2136
  '-4144': BadSymbol, # Invalid pair
1982
- '-4164': InvalidOrder, # {"code":-4164,"msg":"Order's notional must be no smaller than 20(unless you choose reduce only)."}
2137
+ '-4164': InvalidOrder, # {"code":-4164,"msg":"Order's notional must be no smaller than 20(unless you choose reduce only)."},
2138
+ '-4136': InvalidOrder, # {"code":-4136,"msg":"Target strategy invalid for orderType TRAILING_STOP_MARKET,closePosition True"}
1983
2139
  '-4165': BadRequest, # Invalid time interval
1984
2140
  '-4167': BadRequest, # Unable to adjust to Multi-Assets mode with symbols of USDⓈ-M Futures under isolated-margin mode.
1985
2141
  '-4168': BadRequest, # Unable to adjust to isolated-margin mode under the Multi-Assets mode.
@@ -5958,6 +6114,7 @@ class binance(Exchange, ImplicitAPI):
5958
6114
  typeRequest = 'strategyType' if isPortfolioMarginConditional else 'type'
5959
6115
  request[typeRequest] = uppercaseType
5960
6116
  # additional required fields depending on the order type
6117
+ closePosition = self.safe_bool(params, 'closePosition', False)
5961
6118
  timeInForceIsRequired = False
5962
6119
  priceIsRequired = False
5963
6120
  stopPriceIsRequired = False
@@ -6023,12 +6180,12 @@ class binance(Exchange, ImplicitAPI):
6023
6180
  stopPriceIsRequired = True
6024
6181
  priceIsRequired = True
6025
6182
  elif (uppercaseType == 'STOP_MARKET') or (uppercaseType == 'TAKE_PROFIT_MARKET'):
6026
- closePosition = self.safe_bool(params, 'closePosition')
6027
- if closePosition is None:
6183
+ if not closePosition:
6028
6184
  quantityIsRequired = True
6029
6185
  stopPriceIsRequired = True
6030
6186
  elif uppercaseType == 'TRAILING_STOP_MARKET':
6031
- quantityIsRequired = True
6187
+ if not closePosition:
6188
+ quantityIsRequired = True
6032
6189
  if trailingPercent is None:
6033
6190
  raise InvalidOrder(self.id + ' createOrder() requires a trailingPercent param for a ' + type + ' order')
6034
6191
  if quantityIsRequired:
@@ -10977,11 +11134,11 @@ class binance(Exchange, ImplicitAPI):
10977
11134
  def get_exceptions_by_url(self, url: str, exactOrBroad: str):
10978
11135
  marketType = None
10979
11136
  hostname = self.hostname if (self.hostname is not None) else 'binance.com'
10980
- if url.startswith('https://api.' + hostname + '/'):
11137
+ if url.startswith('https://api.' + hostname + '/') or url.startswith('https://testnet.binance.vision'):
10981
11138
  marketType = 'spot'
10982
- elif url.startswith('https://dapi.' + hostname + '/'):
11139
+ elif url.startswith('https://dapi.' + hostname + '/') or url.startswith('https://testnet.binancefuture.com/dapi'):
10983
11140
  marketType = 'inverse'
10984
- elif url.startswith('https://fapi.' + hostname + '/'):
11141
+ elif url.startswith('https://fapi.' + hostname + '/') or url.startswith('https://testnet.binancefuture.com/fapi'):
10985
11142
  marketType = 'linear'
10986
11143
  elif url.startswith('https://eapi.' + hostname + '/'):
10987
11144
  marketType = 'option'