ccxt 4.4.53__py2.py3-none-any.whl → 4.4.57__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.
- ccxt/__init__.py +1 -3
- ccxt/async_support/__init__.py +1 -3
- ccxt/async_support/base/exchange.py +5 -5
- ccxt/async_support/binance.py +20 -6
- ccxt/async_support/bitget.py +1 -1
- ccxt/async_support/bybit.py +3 -1
- ccxt/async_support/coinbase.py +1 -1
- ccxt/async_support/coinbaseinternational.py +2 -2
- ccxt/async_support/coinex.py +1 -1
- ccxt/async_support/deribit.py +8 -25
- ccxt/async_support/exmo.py +1 -1
- ccxt/async_support/hyperliquid.py +3 -3
- ccxt/async_support/kraken.py +1 -1
- ccxt/async_support/woofipro.py +2 -2
- ccxt/base/exchange.py +5 -5
- ccxt/binance.py +20 -6
- ccxt/bitget.py +1 -1
- ccxt/bybit.py +3 -1
- ccxt/coinbase.py +1 -1
- ccxt/coinbaseinternational.py +2 -2
- ccxt/coinex.py +1 -1
- ccxt/deribit.py +8 -25
- ccxt/exmo.py +1 -1
- ccxt/hyperliquid.py +3 -3
- ccxt/kraken.py +1 -1
- ccxt/pro/__init__.py +1 -1
- ccxt/pro/binance.py +2 -2
- ccxt/pro/bitget.py +3 -3
- ccxt/pro/bybit.py +7 -2
- ccxt/pro/cex.py +1 -1
- ccxt/pro/coincatch.py +3 -3
- ccxt/pro/mexc.py +3 -3
- ccxt/pro/okx.py +1 -1
- ccxt/static_dependencies/ethereum/abi/py.typed +0 -0
- ccxt/static_dependencies/ethereum/account/py.typed +0 -0
- ccxt/static_dependencies/ethereum/hexbytes/py.typed +0 -0
- ccxt/static_dependencies/ethereum/typing/py.typed +0 -0
- ccxt/static_dependencies/ethereum/utils/py.typed +0 -0
- ccxt/static_dependencies/lark/py.typed +0 -0
- ccxt/static_dependencies/marshmallow/py.typed +0 -0
- ccxt/static_dependencies/marshmallow_dataclass/py.typed +0 -0
- ccxt/static_dependencies/marshmallow_oneofschema/py.typed +0 -0
- ccxt/woofipro.py +2 -2
- {ccxt-4.4.53.dist-info → ccxt-4.4.57.dist-info}/METADATA +9 -12
- {ccxt-4.4.53.dist-info → ccxt-4.4.57.dist-info}/RECORD +48 -42
- ccxt/abstract/lykke.py +0 -29
- ccxt/async_support/lykke.py +0 -1374
- ccxt/lykke.py +0 -1374
- {ccxt-4.4.53.dist-info → ccxt-4.4.57.dist-info}/LICENSE.txt +0 -0
- {ccxt-4.4.53.dist-info → ccxt-4.4.57.dist-info}/WHEEL +0 -0
- {ccxt-4.4.53.dist-info → ccxt-4.4.57.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.
|
25
|
+
__version__ = '4.4.57'
|
26
26
|
|
27
27
|
# ----------------------------------------------------------------------------
|
28
28
|
|
@@ -163,7 +163,6 @@ from ccxt.kuna import kuna # noqa: F4
|
|
163
163
|
from ccxt.latoken import latoken # noqa: F401
|
164
164
|
from ccxt.lbank import lbank # noqa: F401
|
165
165
|
from ccxt.luno import luno # noqa: F401
|
166
|
-
from ccxt.lykke import lykke # noqa: F401
|
167
166
|
from ccxt.mercado import mercado # noqa: F401
|
168
167
|
from ccxt.mexc import mexc # noqa: F401
|
169
168
|
from ccxt.myokx import myokx # noqa: F401
|
@@ -277,7 +276,6 @@ exchanges = [
|
|
277
276
|
'latoken',
|
278
277
|
'lbank',
|
279
278
|
'luno',
|
280
|
-
'lykke',
|
281
279
|
'mercado',
|
282
280
|
'mexc',
|
283
281
|
'myokx',
|
ccxt/async_support/__init__.py
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
|
5
5
|
# -----------------------------------------------------------------------------
|
6
6
|
|
7
|
-
__version__ = '4.4.
|
7
|
+
__version__ = '4.4.57'
|
8
8
|
|
9
9
|
# -----------------------------------------------------------------------------
|
10
10
|
|
@@ -143,7 +143,6 @@ from ccxt.async_support.kuna import kuna
|
|
143
143
|
from ccxt.async_support.latoken import latoken # noqa: F401
|
144
144
|
from ccxt.async_support.lbank import lbank # noqa: F401
|
145
145
|
from ccxt.async_support.luno import luno # noqa: F401
|
146
|
-
from ccxt.async_support.lykke import lykke # noqa: F401
|
147
146
|
from ccxt.async_support.mercado import mercado # noqa: F401
|
148
147
|
from ccxt.async_support.mexc import mexc # noqa: F401
|
149
148
|
from ccxt.async_support.myokx import myokx # noqa: F401
|
@@ -257,7 +256,6 @@ exchanges = [
|
|
257
256
|
'latoken',
|
258
257
|
'lbank',
|
259
258
|
'luno',
|
260
|
-
'lykke',
|
261
259
|
'mercado',
|
262
260
|
'mexc',
|
263
261
|
'myokx',
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
# -----------------------------------------------------------------------------
|
4
4
|
|
5
|
-
__version__ = '4.4.
|
5
|
+
__version__ = '4.4.57'
|
6
6
|
|
7
7
|
# -----------------------------------------------------------------------------
|
8
8
|
|
@@ -1648,25 +1648,25 @@ class Exchange(BaseExchange):
|
|
1648
1648
|
|
1649
1649
|
async def create_post_only_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, params={}):
|
1650
1650
|
if not self.has['createPostOnlyOrder']:
|
1651
|
-
raise NotSupported(self.id + 'createPostOnlyOrder() is not supported yet')
|
1651
|
+
raise NotSupported(self.id + ' createPostOnlyOrder() is not supported yet')
|
1652
1652
|
query = self.extend(params, {'postOnly': True})
|
1653
1653
|
return await self.create_order(symbol, type, side, amount, price, query)
|
1654
1654
|
|
1655
1655
|
async def create_post_only_order_ws(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, params={}):
|
1656
1656
|
if not self.has['createPostOnlyOrderWs']:
|
1657
|
-
raise NotSupported(self.id + 'createPostOnlyOrderWs() is not supported yet')
|
1657
|
+
raise NotSupported(self.id + ' createPostOnlyOrderWs() is not supported yet')
|
1658
1658
|
query = self.extend(params, {'postOnly': True})
|
1659
1659
|
return await self.create_order_ws(symbol, type, side, amount, price, query)
|
1660
1660
|
|
1661
1661
|
async def create_reduce_only_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, params={}):
|
1662
1662
|
if not self.has['createReduceOnlyOrder']:
|
1663
|
-
raise NotSupported(self.id + 'createReduceOnlyOrder() is not supported yet')
|
1663
|
+
raise NotSupported(self.id + ' createReduceOnlyOrder() is not supported yet')
|
1664
1664
|
query = self.extend(params, {'reduceOnly': True})
|
1665
1665
|
return await self.create_order(symbol, type, side, amount, price, query)
|
1666
1666
|
|
1667
1667
|
async def create_reduce_only_order_ws(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, params={}):
|
1668
1668
|
if not self.has['createReduceOnlyOrderWs']:
|
1669
|
-
raise NotSupported(self.id + 'createReduceOnlyOrderWs() is not supported yet')
|
1669
|
+
raise NotSupported(self.id + ' createReduceOnlyOrderWs() is not supported yet')
|
1670
1670
|
query = self.extend(params, {'reduceOnly': True})
|
1671
1671
|
return await self.create_order_ws(symbol, type, side, amount, price, query)
|
1672
1672
|
|
ccxt/async_support/binance.py
CHANGED
@@ -5273,10 +5273,10 @@ class binance(Exchange, ImplicitAPI):
|
|
5273
5273
|
request: dict = {
|
5274
5274
|
'symbol': market['id'],
|
5275
5275
|
'side': side.upper(),
|
5276
|
+
'orderId': id,
|
5277
|
+
'quantity': self.amount_to_precision(symbol, amount),
|
5276
5278
|
}
|
5277
5279
|
clientOrderId = self.safe_string_n(params, ['newClientOrderId', 'clientOrderId', 'origClientOrderId'])
|
5278
|
-
request['orderId'] = id
|
5279
|
-
request['quantity'] = self.amount_to_precision(symbol, amount)
|
5280
5280
|
if price is not None:
|
5281
5281
|
request['price'] = self.price_to_precision(symbol, price)
|
5282
5282
|
if clientOrderId is not None:
|
@@ -5290,6 +5290,8 @@ class binance(Exchange, ImplicitAPI):
|
|
5290
5290
|
|
5291
5291
|
https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Modify-Order
|
5292
5292
|
https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Modify-Order
|
5293
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Modify-UM-Order
|
5294
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Modify-CM-Order
|
5293
5295
|
|
5294
5296
|
:param str id: cancel order id
|
5295
5297
|
:param str symbol: unified symbol of the market to create an order in
|
@@ -5298,16 +5300,28 @@ class binance(Exchange, ImplicitAPI):
|
|
5298
5300
|
:param float amount: how much of currency you want to trade in units of base currency
|
5299
5301
|
:param float [price]: the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
5300
5302
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
5303
|
+
:param boolean [params.portfolioMargin]: set to True if you would like to edit an order in a portfolio margin account
|
5301
5304
|
:returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
|
5302
5305
|
"""
|
5303
5306
|
await self.load_markets()
|
5304
5307
|
market = self.market(symbol)
|
5308
|
+
isPortfolioMargin = None
|
5309
|
+
isPortfolioMargin, params = self.handle_option_and_params_2(params, 'editContractOrder', 'papi', 'portfolioMargin', False)
|
5310
|
+
if market['linear'] or isPortfolioMargin:
|
5311
|
+
if (price is None) and not ('priceMatch' in params):
|
5312
|
+
raise ArgumentsRequired(self.id + ' editOrder() requires a price argument for portfolio margin and linear orders')
|
5305
5313
|
request = self.edit_contract_order_request(id, symbol, type, side, amount, price, params)
|
5306
5314
|
response = None
|
5307
5315
|
if market['linear']:
|
5308
|
-
|
5316
|
+
if isPortfolioMargin:
|
5317
|
+
response = await self.papiPutUmOrder(self.extend(request, params))
|
5318
|
+
else:
|
5319
|
+
response = await self.fapiPrivatePutOrder(self.extend(request, params))
|
5309
5320
|
elif market['inverse']:
|
5310
|
-
|
5321
|
+
if isPortfolioMargin:
|
5322
|
+
response = await self.papiPutCmOrder(self.extend(request, params))
|
5323
|
+
else:
|
5324
|
+
response = await self.dapiPrivatePutOrder(self.extend(request, params))
|
5311
5325
|
#
|
5312
5326
|
# swap and future
|
5313
5327
|
#
|
@@ -12060,7 +12074,7 @@ class binance(Exchange, ImplicitAPI):
|
|
12060
12074
|
:returns dict: an array of `open interest structure <https://docs.ccxt.com/#/?id=open-interest-structure>`
|
12061
12075
|
"""
|
12062
12076
|
if timeframe == '1m':
|
12063
|
-
raise BadRequest(self.id + 'fetchOpenInterestHistory cannot use the 1m timeframe')
|
12077
|
+
raise BadRequest(self.id + ' fetchOpenInterestHistory cannot use the 1m timeframe')
|
12064
12078
|
await self.load_markets()
|
12065
12079
|
paginate = False
|
12066
12080
|
paginate, params = self.handle_option_and_params(params, 'fetchOpenInterestHistory', 'paginate', False)
|
@@ -12819,7 +12833,7 @@ class binance(Exchange, ImplicitAPI):
|
|
12819
12833
|
elif market['inverse']:
|
12820
12834
|
response = await self.dapiPrivateGetPositionMarginHistory(self.extend(request, params))
|
12821
12835
|
else:
|
12822
|
-
raise BadRequest(self.id + 'fetchMarginAdjustmentHistory() is not supported for markets of type ' + market['type'])
|
12836
|
+
raise BadRequest(self.id + ' fetchMarginAdjustmentHistory() is not supported for markets of type ' + market['type'])
|
12823
12837
|
#
|
12824
12838
|
# [
|
12825
12839
|
# {
|
ccxt/async_support/bitget.py
CHANGED
@@ -4633,7 +4633,7 @@ class bitget(Exchange, ImplicitAPI):
|
|
4633
4633
|
response = None
|
4634
4634
|
if market['spot']:
|
4635
4635
|
if triggerPrice is None:
|
4636
|
-
raise NotSupported(self.id + 'editOrder() only supports plan/trigger spot orders')
|
4636
|
+
raise NotSupported(self.id + ' editOrder() only supports plan/trigger spot orders')
|
4637
4637
|
editMarketBuyOrderRequiresPrice = self.safe_bool(self.options, 'editMarketBuyOrderRequiresPrice', True)
|
4638
4638
|
if editMarketBuyOrderRequiresPrice and isMarketOrder and (side == 'buy'):
|
4639
4639
|
if price is None:
|
ccxt/async_support/bybit.py
CHANGED
@@ -6489,7 +6489,7 @@ classic accounts only/ spot not supported* fetches information on an order made
|
|
6489
6489
|
:returns: An array of open interest structures
|
6490
6490
|
"""
|
6491
6491
|
if timeframe == '1m':
|
6492
|
-
raise BadRequest(self.id + 'fetchOpenInterestHistory cannot use the 1m timeframe')
|
6492
|
+
raise BadRequest(self.id + ' fetchOpenInterestHistory cannot use the 1m timeframe')
|
6493
6493
|
await self.load_markets()
|
6494
6494
|
paginate = self.safe_bool(params, 'paginate')
|
6495
6495
|
if paginate:
|
@@ -8705,6 +8705,8 @@ classic accounts only/ spot not supported* fetches information on an order made
|
|
8705
8705
|
feedback = self.id + ' private api uses /user/v3/private/query-api to check if you have a unified account. The API key of user id must own one of permissions: "Account Transfer", "Subaccount Transfer", "Withdrawal" ' + body
|
8706
8706
|
else:
|
8707
8707
|
feedback = self.id + ' ' + body
|
8708
|
+
if body.find('Withdraw address chain or destination tag are not equal'):
|
8709
|
+
feedback = feedback + '; You might also need to ensure the address is whitelisted'
|
8708
8710
|
self.throw_broadly_matched_exception(self.exceptions['broad'], body, feedback)
|
8709
8711
|
self.throw_exactly_matched_exception(self.exceptions['exact'], errorCode, feedback)
|
8710
8712
|
raise ExchangeError(feedback) # unknown message
|
ccxt/async_support/coinbase.py
CHANGED
@@ -1684,7 +1684,7 @@ class coinbaseinternational(Exchange, ImplicitAPI):
|
|
1684
1684
|
request['type'] = typeId
|
1685
1685
|
if type == 'limit':
|
1686
1686
|
if price is None:
|
1687
|
-
raise InvalidOrder(self.id + 'createOrder() requires a price parameter for a limit order types')
|
1687
|
+
raise InvalidOrder(self.id + ' createOrder() requires a price parameter for a limit order types')
|
1688
1688
|
request['price'] = price
|
1689
1689
|
portfolio = None
|
1690
1690
|
portfolio, params = await self.handle_portfolio_and_params('createOrder', params)
|
@@ -1695,7 +1695,7 @@ class coinbaseinternational(Exchange, ImplicitAPI):
|
|
1695
1695
|
# market orders must be IOC
|
1696
1696
|
if typeId == 'MARKET':
|
1697
1697
|
if tif is not None and tif != 'IOC':
|
1698
|
-
raise InvalidOrder(self.id + 'createOrder() market orders must have tif set to "IOC"')
|
1698
|
+
raise InvalidOrder(self.id + ' createOrder() market orders must have tif set to "IOC"')
|
1699
1699
|
tif = 'IOC'
|
1700
1700
|
else:
|
1701
1701
|
tif = 'GTC' if (tif is None) else tif
|
ccxt/async_support/coinex.py
CHANGED
@@ -4616,7 +4616,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
4616
4616
|
request: dict = {
|
4617
4617
|
'ccy': currency['id'],
|
4618
4618
|
'to_address': address, # must be authorized, inter-user transfer by a registered mobile phone number or an email address is supported
|
4619
|
-
'amount': self.
|
4619
|
+
'amount': self.currency_to_precision(code, amount), # the actual amount without fees, https://www.coinex.com/fees
|
4620
4620
|
}
|
4621
4621
|
if tag is not None:
|
4622
4622
|
request['memo'] = tag
|
ccxt/async_support/deribit.py
CHANGED
@@ -498,9 +498,6 @@ class deribit(Exchange, ImplicitAPI):
|
|
498
498
|
'fetchBalance': {
|
499
499
|
'code': 'BTC',
|
500
500
|
},
|
501
|
-
'fetchPositions': {
|
502
|
-
'code': 'BTC',
|
503
|
-
},
|
504
501
|
'transfer': {
|
505
502
|
'method': 'privateGetSubmitTransferToSubaccount', # or 'privateGetSubmitTransferToUser'
|
506
503
|
},
|
@@ -2663,32 +2660,18 @@ class deribit(Exchange, ImplicitAPI):
|
|
2663
2660
|
|
2664
2661
|
:param str[]|None symbols: list of unified market symbols
|
2665
2662
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
2663
|
+
:param str [params.currency]: currency code filter for positions
|
2666
2664
|
:param str [params.kind]: market type filter for positions 'future', 'option', 'spot', 'future_combo' or 'option_combo'
|
2665
|
+
:param int [params.subaccount_id]: the user id for the subaccount
|
2667
2666
|
:returns dict[]: a list of `position structure <https://docs.ccxt.com/#/?id=position-structure>`
|
2668
2667
|
"""
|
2669
2668
|
await self.load_markets()
|
2670
|
-
|
2671
|
-
|
2672
|
-
if
|
2673
|
-
|
2674
|
-
|
2675
|
-
|
2676
|
-
symbols = None # fix https://github.com/ccxt/ccxt/issues/13961
|
2677
|
-
else:
|
2678
|
-
if isinstance(symbols, list):
|
2679
|
-
length = len(symbols)
|
2680
|
-
if length != 1:
|
2681
|
-
raise BadRequest(self.id + ' fetchPositions() symbols argument cannot contain more than 1 symbol')
|
2682
|
-
market = self.market(symbols[0])
|
2683
|
-
settle = market['settle']
|
2684
|
-
code = settle if (settle is not None) else market['base']
|
2685
|
-
kind = market['info']['kind']
|
2686
|
-
currency = self.currency(code)
|
2687
|
-
request: dict = {
|
2688
|
-
'currency': currency['id'],
|
2689
|
-
}
|
2690
|
-
if kind is not None:
|
2691
|
-
request['kind'] = kind
|
2669
|
+
code = self.safe_string(params, 'currency')
|
2670
|
+
request: dict = {}
|
2671
|
+
if code is not None:
|
2672
|
+
params = self.omit(params, 'currency')
|
2673
|
+
currency = self.currency(code)
|
2674
|
+
request['currency'] = currency['id']
|
2692
2675
|
response = await self.privateGetGetPositions(self.extend(request, params))
|
2693
2676
|
#
|
2694
2677
|
# {
|
ccxt/async_support/exmo.py
CHANGED
@@ -1351,7 +1351,7 @@ class exmo(Exchange, ImplicitAPI):
|
|
1351
1351
|
marginMode = None
|
1352
1352
|
marginMode, params = self.handle_margin_mode_and_params('fetchMyTrades', params)
|
1353
1353
|
if marginMode == 'cross':
|
1354
|
-
raise BadRequest(self.id + 'only isolated margin is supported')
|
1354
|
+
raise BadRequest(self.id + ' only isolated margin is supported')
|
1355
1355
|
await self.load_markets()
|
1356
1356
|
market = self.market(symbol)
|
1357
1357
|
pair = market['id']
|
@@ -2707,7 +2707,7 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
2707
2707
|
if self.in_array(fromAccount, ['spot', 'swap', 'perp']):
|
2708
2708
|
# handle swap <> spot account transfer
|
2709
2709
|
if not self.in_array(toAccount, ['spot', 'swap', 'perp']):
|
2710
|
-
raise NotSupported(self.id + 'transfer() only support spot <> swap transfer')
|
2710
|
+
raise NotSupported(self.id + ' transfer() only support spot <> swap transfer')
|
2711
2711
|
strAmount = self.number_to_string(amount)
|
2712
2712
|
vaultAddress = self.format_vault_address(self.safe_string(params, 'vaultAddress'))
|
2713
2713
|
params = self.omit(params, 'vaultAddress')
|
@@ -2742,7 +2742,7 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
2742
2742
|
if code is not None:
|
2743
2743
|
code = code.upper()
|
2744
2744
|
if code != 'USDC':
|
2745
|
-
raise NotSupported(self.id + 'transfer() only support USDC')
|
2745
|
+
raise NotSupported(self.id + ' transfer() only support USDC')
|
2746
2746
|
payload: dict = {
|
2747
2747
|
'hyperliquidChain': 'Testnet' if isSandboxMode else 'Mainnet',
|
2748
2748
|
'destination': toAccount,
|
@@ -2805,7 +2805,7 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
2805
2805
|
if code is not None:
|
2806
2806
|
code = code.upper()
|
2807
2807
|
if code != 'USDC':
|
2808
|
-
raise NotSupported(self.id + 'withdraw() only support USDC')
|
2808
|
+
raise NotSupported(self.id + ' withdraw() only support USDC')
|
2809
2809
|
vaultAddress = self.format_vault_address(self.safe_string(params, 'vaultAddress'))
|
2810
2810
|
params = self.omit(params, 'vaultAddress')
|
2811
2811
|
nonce = self.milliseconds()
|
ccxt/async_support/kraken.py
CHANGED
@@ -2365,7 +2365,7 @@ class kraken(Exchange, ImplicitAPI):
|
|
2365
2365
|
:returns dict: the api result
|
2366
2366
|
"""
|
2367
2367
|
if timeout > 86400000:
|
2368
|
-
raise BadRequest(self.id + 'cancelAllOrdersAfter timeout should be less than 86400000 milliseconds')
|
2368
|
+
raise BadRequest(self.id + ' cancelAllOrdersAfter timeout should be less than 86400000 milliseconds')
|
2369
2369
|
await self.load_markets()
|
2370
2370
|
request: dict = {
|
2371
2371
|
'timeout': (self.parse_to_int(timeout / 1000)) if (timeout > 0) else 0,
|
ccxt/async_support/woofipro.py
CHANGED
@@ -1507,7 +1507,7 @@ class woofipro(Exchange, ImplicitAPI):
|
|
1507
1507
|
takeProfit = self.safe_value(orderParams, 'takeProfit')
|
1508
1508
|
isConditional = triggerPrice is not None or stopLoss is not None or takeProfit is not None or (self.safe_value(orderParams, 'childOrders') is not None)
|
1509
1509
|
if isConditional:
|
1510
|
-
raise NotSupported(self.id + 'createOrders() only support non-stop order')
|
1510
|
+
raise NotSupported(self.id + ' createOrders() only support non-stop order')
|
1511
1511
|
orderRequest = self.create_order_request(marketId, type, side, amount, price, orderParams)
|
1512
1512
|
ordersRequests.append(orderRequest)
|
1513
1513
|
request: dict = {
|
@@ -2355,7 +2355,7 @@ class woofipro(Exchange, ImplicitAPI):
|
|
2355
2355
|
if code is not None:
|
2356
2356
|
code = code.upper()
|
2357
2357
|
if code != 'USDC':
|
2358
|
-
raise NotSupported(self.id + 'withdraw() only support USDC')
|
2358
|
+
raise NotSupported(self.id + ' withdraw() only support USDC')
|
2359
2359
|
currency = self.currency(code)
|
2360
2360
|
verifyingContractAddress = self.safe_string(self.options, 'verifyingContractAddress')
|
2361
2361
|
chainId = self.safe_string(params, 'chainId')
|
ccxt/base/exchange.py
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
|
5
5
|
# -----------------------------------------------------------------------------
|
6
6
|
|
7
|
-
__version__ = '4.4.
|
7
|
+
__version__ = '4.4.57'
|
8
8
|
|
9
9
|
# -----------------------------------------------------------------------------
|
10
10
|
|
@@ -5544,25 +5544,25 @@ class Exchange(object):
|
|
5544
5544
|
|
5545
5545
|
def create_post_only_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, params={}):
|
5546
5546
|
if not self.has['createPostOnlyOrder']:
|
5547
|
-
raise NotSupported(self.id + 'createPostOnlyOrder() is not supported yet')
|
5547
|
+
raise NotSupported(self.id + ' createPostOnlyOrder() is not supported yet')
|
5548
5548
|
query = self.extend(params, {'postOnly': True})
|
5549
5549
|
return self.create_order(symbol, type, side, amount, price, query)
|
5550
5550
|
|
5551
5551
|
def create_post_only_order_ws(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, params={}):
|
5552
5552
|
if not self.has['createPostOnlyOrderWs']:
|
5553
|
-
raise NotSupported(self.id + 'createPostOnlyOrderWs() is not supported yet')
|
5553
|
+
raise NotSupported(self.id + ' createPostOnlyOrderWs() is not supported yet')
|
5554
5554
|
query = self.extend(params, {'postOnly': True})
|
5555
5555
|
return self.create_order_ws(symbol, type, side, amount, price, query)
|
5556
5556
|
|
5557
5557
|
def create_reduce_only_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, params={}):
|
5558
5558
|
if not self.has['createReduceOnlyOrder']:
|
5559
|
-
raise NotSupported(self.id + 'createReduceOnlyOrder() is not supported yet')
|
5559
|
+
raise NotSupported(self.id + ' createReduceOnlyOrder() is not supported yet')
|
5560
5560
|
query = self.extend(params, {'reduceOnly': True})
|
5561
5561
|
return self.create_order(symbol, type, side, amount, price, query)
|
5562
5562
|
|
5563
5563
|
def create_reduce_only_order_ws(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, params={}):
|
5564
5564
|
if not self.has['createReduceOnlyOrderWs']:
|
5565
|
-
raise NotSupported(self.id + 'createReduceOnlyOrderWs() is not supported yet')
|
5565
|
+
raise NotSupported(self.id + ' createReduceOnlyOrderWs() is not supported yet')
|
5566
5566
|
query = self.extend(params, {'reduceOnly': True})
|
5567
5567
|
return self.create_order_ws(symbol, type, side, amount, price, query)
|
5568
5568
|
|
ccxt/binance.py
CHANGED
@@ -5272,10 +5272,10 @@ class binance(Exchange, ImplicitAPI):
|
|
5272
5272
|
request: dict = {
|
5273
5273
|
'symbol': market['id'],
|
5274
5274
|
'side': side.upper(),
|
5275
|
+
'orderId': id,
|
5276
|
+
'quantity': self.amount_to_precision(symbol, amount),
|
5275
5277
|
}
|
5276
5278
|
clientOrderId = self.safe_string_n(params, ['newClientOrderId', 'clientOrderId', 'origClientOrderId'])
|
5277
|
-
request['orderId'] = id
|
5278
|
-
request['quantity'] = self.amount_to_precision(symbol, amount)
|
5279
5279
|
if price is not None:
|
5280
5280
|
request['price'] = self.price_to_precision(symbol, price)
|
5281
5281
|
if clientOrderId is not None:
|
@@ -5289,6 +5289,8 @@ class binance(Exchange, ImplicitAPI):
|
|
5289
5289
|
|
5290
5290
|
https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Modify-Order
|
5291
5291
|
https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Modify-Order
|
5292
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Modify-UM-Order
|
5293
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Modify-CM-Order
|
5292
5294
|
|
5293
5295
|
:param str id: cancel order id
|
5294
5296
|
:param str symbol: unified symbol of the market to create an order in
|
@@ -5297,16 +5299,28 @@ class binance(Exchange, ImplicitAPI):
|
|
5297
5299
|
:param float amount: how much of currency you want to trade in units of base currency
|
5298
5300
|
:param float [price]: the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
5299
5301
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
5302
|
+
:param boolean [params.portfolioMargin]: set to True if you would like to edit an order in a portfolio margin account
|
5300
5303
|
:returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
|
5301
5304
|
"""
|
5302
5305
|
self.load_markets()
|
5303
5306
|
market = self.market(symbol)
|
5307
|
+
isPortfolioMargin = None
|
5308
|
+
isPortfolioMargin, params = self.handle_option_and_params_2(params, 'editContractOrder', 'papi', 'portfolioMargin', False)
|
5309
|
+
if market['linear'] or isPortfolioMargin:
|
5310
|
+
if (price is None) and not ('priceMatch' in params):
|
5311
|
+
raise ArgumentsRequired(self.id + ' editOrder() requires a price argument for portfolio margin and linear orders')
|
5304
5312
|
request = self.edit_contract_order_request(id, symbol, type, side, amount, price, params)
|
5305
5313
|
response = None
|
5306
5314
|
if market['linear']:
|
5307
|
-
|
5315
|
+
if isPortfolioMargin:
|
5316
|
+
response = self.papiPutUmOrder(self.extend(request, params))
|
5317
|
+
else:
|
5318
|
+
response = self.fapiPrivatePutOrder(self.extend(request, params))
|
5308
5319
|
elif market['inverse']:
|
5309
|
-
|
5320
|
+
if isPortfolioMargin:
|
5321
|
+
response = self.papiPutCmOrder(self.extend(request, params))
|
5322
|
+
else:
|
5323
|
+
response = self.dapiPrivatePutOrder(self.extend(request, params))
|
5310
5324
|
#
|
5311
5325
|
# swap and future
|
5312
5326
|
#
|
@@ -12059,7 +12073,7 @@ class binance(Exchange, ImplicitAPI):
|
|
12059
12073
|
:returns dict: an array of `open interest structure <https://docs.ccxt.com/#/?id=open-interest-structure>`
|
12060
12074
|
"""
|
12061
12075
|
if timeframe == '1m':
|
12062
|
-
raise BadRequest(self.id + 'fetchOpenInterestHistory cannot use the 1m timeframe')
|
12076
|
+
raise BadRequest(self.id + ' fetchOpenInterestHistory cannot use the 1m timeframe')
|
12063
12077
|
self.load_markets()
|
12064
12078
|
paginate = False
|
12065
12079
|
paginate, params = self.handle_option_and_params(params, 'fetchOpenInterestHistory', 'paginate', False)
|
@@ -12818,7 +12832,7 @@ class binance(Exchange, ImplicitAPI):
|
|
12818
12832
|
elif market['inverse']:
|
12819
12833
|
response = self.dapiPrivateGetPositionMarginHistory(self.extend(request, params))
|
12820
12834
|
else:
|
12821
|
-
raise BadRequest(self.id + 'fetchMarginAdjustmentHistory() is not supported for markets of type ' + market['type'])
|
12835
|
+
raise BadRequest(self.id + ' fetchMarginAdjustmentHistory() is not supported for markets of type ' + market['type'])
|
12822
12836
|
#
|
12823
12837
|
# [
|
12824
12838
|
# {
|
ccxt/bitget.py
CHANGED
@@ -4632,7 +4632,7 @@ class bitget(Exchange, ImplicitAPI):
|
|
4632
4632
|
response = None
|
4633
4633
|
if market['spot']:
|
4634
4634
|
if triggerPrice is None:
|
4635
|
-
raise NotSupported(self.id + 'editOrder() only supports plan/trigger spot orders')
|
4635
|
+
raise NotSupported(self.id + ' editOrder() only supports plan/trigger spot orders')
|
4636
4636
|
editMarketBuyOrderRequiresPrice = self.safe_bool(self.options, 'editMarketBuyOrderRequiresPrice', True)
|
4637
4637
|
if editMarketBuyOrderRequiresPrice and isMarketOrder and (side == 'buy'):
|
4638
4638
|
if price is None:
|
ccxt/bybit.py
CHANGED
@@ -6488,7 +6488,7 @@ classic accounts only/ spot not supported* fetches information on an order made
|
|
6488
6488
|
:returns: An array of open interest structures
|
6489
6489
|
"""
|
6490
6490
|
if timeframe == '1m':
|
6491
|
-
raise BadRequest(self.id + 'fetchOpenInterestHistory cannot use the 1m timeframe')
|
6491
|
+
raise BadRequest(self.id + ' fetchOpenInterestHistory cannot use the 1m timeframe')
|
6492
6492
|
self.load_markets()
|
6493
6493
|
paginate = self.safe_bool(params, 'paginate')
|
6494
6494
|
if paginate:
|
@@ -8704,6 +8704,8 @@ classic accounts only/ spot not supported* fetches information on an order made
|
|
8704
8704
|
feedback = self.id + ' private api uses /user/v3/private/query-api to check if you have a unified account. The API key of user id must own one of permissions: "Account Transfer", "Subaccount Transfer", "Withdrawal" ' + body
|
8705
8705
|
else:
|
8706
8706
|
feedback = self.id + ' ' + body
|
8707
|
+
if body.find('Withdraw address chain or destination tag are not equal'):
|
8708
|
+
feedback = feedback + '; You might also need to ensure the address is whitelisted'
|
8707
8709
|
self.throw_broadly_matched_exception(self.exceptions['broad'], body, feedback)
|
8708
8710
|
self.throw_exactly_matched_exception(self.exceptions['exact'], errorCode, feedback)
|
8709
8711
|
raise ExchangeError(feedback) # unknown message
|
ccxt/coinbase.py
CHANGED
ccxt/coinbaseinternational.py
CHANGED
@@ -1684,7 +1684,7 @@ class coinbaseinternational(Exchange, ImplicitAPI):
|
|
1684
1684
|
request['type'] = typeId
|
1685
1685
|
if type == 'limit':
|
1686
1686
|
if price is None:
|
1687
|
-
raise InvalidOrder(self.id + 'createOrder() requires a price parameter for a limit order types')
|
1687
|
+
raise InvalidOrder(self.id + ' createOrder() requires a price parameter for a limit order types')
|
1688
1688
|
request['price'] = price
|
1689
1689
|
portfolio = None
|
1690
1690
|
portfolio, params = self.handle_portfolio_and_params('createOrder', params)
|
@@ -1695,7 +1695,7 @@ class coinbaseinternational(Exchange, ImplicitAPI):
|
|
1695
1695
|
# market orders must be IOC
|
1696
1696
|
if typeId == 'MARKET':
|
1697
1697
|
if tif is not None and tif != 'IOC':
|
1698
|
-
raise InvalidOrder(self.id + 'createOrder() market orders must have tif set to "IOC"')
|
1698
|
+
raise InvalidOrder(self.id + ' createOrder() market orders must have tif set to "IOC"')
|
1699
1699
|
tif = 'IOC'
|
1700
1700
|
else:
|
1701
1701
|
tif = 'GTC' if (tif is None) else tif
|
ccxt/coinex.py
CHANGED
@@ -4615,7 +4615,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
4615
4615
|
request: dict = {
|
4616
4616
|
'ccy': currency['id'],
|
4617
4617
|
'to_address': address, # must be authorized, inter-user transfer by a registered mobile phone number or an email address is supported
|
4618
|
-
'amount': self.
|
4618
|
+
'amount': self.currency_to_precision(code, amount), # the actual amount without fees, https://www.coinex.com/fees
|
4619
4619
|
}
|
4620
4620
|
if tag is not None:
|
4621
4621
|
request['memo'] = tag
|
ccxt/deribit.py
CHANGED
@@ -498,9 +498,6 @@ class deribit(Exchange, ImplicitAPI):
|
|
498
498
|
'fetchBalance': {
|
499
499
|
'code': 'BTC',
|
500
500
|
},
|
501
|
-
'fetchPositions': {
|
502
|
-
'code': 'BTC',
|
503
|
-
},
|
504
501
|
'transfer': {
|
505
502
|
'method': 'privateGetSubmitTransferToSubaccount', # or 'privateGetSubmitTransferToUser'
|
506
503
|
},
|
@@ -2663,32 +2660,18 @@ class deribit(Exchange, ImplicitAPI):
|
|
2663
2660
|
|
2664
2661
|
:param str[]|None symbols: list of unified market symbols
|
2665
2662
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
2663
|
+
:param str [params.currency]: currency code filter for positions
|
2666
2664
|
:param str [params.kind]: market type filter for positions 'future', 'option', 'spot', 'future_combo' or 'option_combo'
|
2665
|
+
:param int [params.subaccount_id]: the user id for the subaccount
|
2667
2666
|
:returns dict[]: a list of `position structure <https://docs.ccxt.com/#/?id=position-structure>`
|
2668
2667
|
"""
|
2669
2668
|
self.load_markets()
|
2670
|
-
|
2671
|
-
|
2672
|
-
if
|
2673
|
-
|
2674
|
-
|
2675
|
-
|
2676
|
-
symbols = None # fix https://github.com/ccxt/ccxt/issues/13961
|
2677
|
-
else:
|
2678
|
-
if isinstance(symbols, list):
|
2679
|
-
length = len(symbols)
|
2680
|
-
if length != 1:
|
2681
|
-
raise BadRequest(self.id + ' fetchPositions() symbols argument cannot contain more than 1 symbol')
|
2682
|
-
market = self.market(symbols[0])
|
2683
|
-
settle = market['settle']
|
2684
|
-
code = settle if (settle is not None) else market['base']
|
2685
|
-
kind = market['info']['kind']
|
2686
|
-
currency = self.currency(code)
|
2687
|
-
request: dict = {
|
2688
|
-
'currency': currency['id'],
|
2689
|
-
}
|
2690
|
-
if kind is not None:
|
2691
|
-
request['kind'] = kind
|
2669
|
+
code = self.safe_string(params, 'currency')
|
2670
|
+
request: dict = {}
|
2671
|
+
if code is not None:
|
2672
|
+
params = self.omit(params, 'currency')
|
2673
|
+
currency = self.currency(code)
|
2674
|
+
request['currency'] = currency['id']
|
2692
2675
|
response = self.privateGetGetPositions(self.extend(request, params))
|
2693
2676
|
#
|
2694
2677
|
# {
|
ccxt/exmo.py
CHANGED
@@ -1351,7 +1351,7 @@ class exmo(Exchange, ImplicitAPI):
|
|
1351
1351
|
marginMode = None
|
1352
1352
|
marginMode, params = self.handle_margin_mode_and_params('fetchMyTrades', params)
|
1353
1353
|
if marginMode == 'cross':
|
1354
|
-
raise BadRequest(self.id + 'only isolated margin is supported')
|
1354
|
+
raise BadRequest(self.id + ' only isolated margin is supported')
|
1355
1355
|
self.load_markets()
|
1356
1356
|
market = self.market(symbol)
|
1357
1357
|
pair = market['id']
|
ccxt/hyperliquid.py
CHANGED
@@ -2706,7 +2706,7 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
2706
2706
|
if self.in_array(fromAccount, ['spot', 'swap', 'perp']):
|
2707
2707
|
# handle swap <> spot account transfer
|
2708
2708
|
if not self.in_array(toAccount, ['spot', 'swap', 'perp']):
|
2709
|
-
raise NotSupported(self.id + 'transfer() only support spot <> swap transfer')
|
2709
|
+
raise NotSupported(self.id + ' transfer() only support spot <> swap transfer')
|
2710
2710
|
strAmount = self.number_to_string(amount)
|
2711
2711
|
vaultAddress = self.format_vault_address(self.safe_string(params, 'vaultAddress'))
|
2712
2712
|
params = self.omit(params, 'vaultAddress')
|
@@ -2741,7 +2741,7 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
2741
2741
|
if code is not None:
|
2742
2742
|
code = code.upper()
|
2743
2743
|
if code != 'USDC':
|
2744
|
-
raise NotSupported(self.id + 'transfer() only support USDC')
|
2744
|
+
raise NotSupported(self.id + ' transfer() only support USDC')
|
2745
2745
|
payload: dict = {
|
2746
2746
|
'hyperliquidChain': 'Testnet' if isSandboxMode else 'Mainnet',
|
2747
2747
|
'destination': toAccount,
|
@@ -2804,7 +2804,7 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
2804
2804
|
if code is not None:
|
2805
2805
|
code = code.upper()
|
2806
2806
|
if code != 'USDC':
|
2807
|
-
raise NotSupported(self.id + 'withdraw() only support USDC')
|
2807
|
+
raise NotSupported(self.id + ' withdraw() only support USDC')
|
2808
2808
|
vaultAddress = self.format_vault_address(self.safe_string(params, 'vaultAddress'))
|
2809
2809
|
params = self.omit(params, 'vaultAddress')
|
2810
2810
|
nonce = self.milliseconds()
|
ccxt/kraken.py
CHANGED
@@ -2365,7 +2365,7 @@ class kraken(Exchange, ImplicitAPI):
|
|
2365
2365
|
:returns dict: the api result
|
2366
2366
|
"""
|
2367
2367
|
if timeout > 86400000:
|
2368
|
-
raise BadRequest(self.id + 'cancelAllOrdersAfter timeout should be less than 86400000 milliseconds')
|
2368
|
+
raise BadRequest(self.id + ' cancelAllOrdersAfter timeout should be less than 86400000 milliseconds')
|
2369
2369
|
self.load_markets()
|
2370
2370
|
request: dict = {
|
2371
2371
|
'timeout': (self.parse_to_int(timeout / 1000)) if (timeout > 0) else 0,
|