ccxt 4.4.41__py2.py3-none-any.whl → 4.4.43__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 +3 -1
- ccxt/abstract/binance.py +3 -0
- ccxt/abstract/binancecoinm.py +3 -0
- ccxt/abstract/binanceus.py +3 -0
- ccxt/abstract/binanceusdm.py +3 -0
- ccxt/abstract/bingx.py +4 -0
- ccxt/abstract/bitstamp.py +1 -0
- ccxt/abstract/myokx.py +340 -0
- ccxt/ace.py +1 -1
- ccxt/alpaca.py +0 -1
- ccxt/ascendex.py +0 -1
- ccxt/async_support/__init__.py +3 -1
- ccxt/async_support/ace.py +1 -1
- ccxt/async_support/alpaca.py +0 -1
- ccxt/async_support/ascendex.py +0 -1
- ccxt/async_support/base/exchange.py +15 -15
- ccxt/async_support/bigone.py +0 -1
- ccxt/async_support/binance.py +3 -0
- ccxt/async_support/bingx.py +27 -7
- ccxt/async_support/bitfinex.py +122 -0
- ccxt/async_support/bitstamp.py +54 -0
- ccxt/async_support/blofin.py +16 -7
- ccxt/async_support/cex.py +1 -1
- ccxt/async_support/coinbase.py +8 -9
- ccxt/async_support/coinbaseexchange.py +5 -6
- ccxt/async_support/coinbaseinternational.py +7 -8
- ccxt/async_support/coincatch.py +0 -1
- ccxt/async_support/coincheck.py +0 -1
- ccxt/async_support/coinex.py +91 -6
- ccxt/async_support/coinlist.py +3 -4
- ccxt/async_support/coinmate.py +1 -3
- ccxt/async_support/coinmetro.py +4 -5
- ccxt/async_support/coinone.py +0 -1
- ccxt/async_support/coinsph.py +7 -8
- ccxt/async_support/cryptocom.py +3 -0
- ccxt/async_support/currencycom.py +3 -4
- ccxt/async_support/defx.py +6 -7
- ccxt/async_support/deribit.py +1 -3
- ccxt/async_support/digifinex.py +0 -1
- ccxt/async_support/ellipx.py +0 -2
- ccxt/async_support/exmo.py +1 -2
- ccxt/async_support/gate.py +1 -2
- ccxt/async_support/gemini.py +63 -6
- ccxt/async_support/hashkey.py +79 -67
- ccxt/async_support/hitbtc.py +47 -5
- ccxt/async_support/hollaex.py +4 -6
- ccxt/async_support/htx.py +1 -3
- ccxt/async_support/huobijp.py +0 -1
- ccxt/async_support/hyperliquid.py +1 -1
- ccxt/async_support/idex.py +8 -8
- ccxt/async_support/independentreserve.py +0 -1
- ccxt/async_support/indodax.py +0 -1
- ccxt/async_support/kraken.py +63 -3
- ccxt/async_support/krakenfutures.py +75 -3
- ccxt/async_support/kucoin.py +1 -3
- ccxt/async_support/kucoinfutures.py +10 -9
- ccxt/async_support/kuna.py +1 -3
- ccxt/async_support/latoken.py +1 -3
- ccxt/async_support/lbank.py +0 -1
- ccxt/async_support/luno.py +0 -1
- ccxt/async_support/lykke.py +0 -1
- ccxt/async_support/mercado.py +0 -1
- ccxt/async_support/mexc.py +3 -4
- ccxt/async_support/myokx.py +35 -0
- ccxt/async_support/ndax.py +1 -1
- ccxt/async_support/novadax.py +4 -6
- ccxt/async_support/oceanex.py +0 -1
- ccxt/async_support/okcoin.py +1 -3
- ccxt/async_support/okx.py +1 -3
- ccxt/async_support/onetrading.py +1 -3
- ccxt/async_support/p2b.py +1 -1
- ccxt/async_support/paradex.py +5 -7
- ccxt/async_support/phemex.py +14 -14
- ccxt/async_support/poloniex.py +1 -3
- ccxt/async_support/poloniexfutures.py +6 -6
- ccxt/async_support/probit.py +0 -1
- ccxt/async_support/timex.py +0 -1
- ccxt/async_support/tokocrypto.py +11 -14
- ccxt/async_support/tradeogre.py +1 -1
- ccxt/async_support/upbit.py +0 -1
- ccxt/async_support/vertex.py +63 -4
- ccxt/async_support/wavesexchange.py +4 -5
- ccxt/async_support/whitebit.py +8 -9
- ccxt/async_support/woo.py +100 -14
- ccxt/async_support/woofipro.py +96 -15
- ccxt/async_support/xt.py +3 -2
- ccxt/async_support/yobit.py +0 -1
- ccxt/async_support/zaif.py +0 -1
- ccxt/async_support/zonda.py +1 -2
- ccxt/base/exchange.py +21 -17
- ccxt/bigone.py +0 -1
- ccxt/binance.py +3 -0
- ccxt/bingx.py +27 -7
- ccxt/bitfinex.py +122 -0
- ccxt/bitstamp.py +54 -0
- ccxt/blofin.py +16 -7
- ccxt/cex.py +1 -1
- ccxt/coinbase.py +8 -9
- ccxt/coinbaseexchange.py +5 -6
- ccxt/coinbaseinternational.py +7 -8
- ccxt/coincatch.py +0 -1
- ccxt/coincheck.py +0 -1
- ccxt/coinex.py +91 -6
- ccxt/coinlist.py +3 -4
- ccxt/coinmate.py +1 -3
- ccxt/coinmetro.py +4 -5
- ccxt/coinone.py +0 -1
- ccxt/coinsph.py +7 -8
- ccxt/cryptocom.py +3 -0
- ccxt/currencycom.py +3 -4
- ccxt/defx.py +6 -7
- ccxt/deribit.py +1 -3
- ccxt/digifinex.py +0 -1
- ccxt/ellipx.py +0 -2
- ccxt/exmo.py +1 -2
- ccxt/gate.py +1 -2
- ccxt/gemini.py +63 -6
- ccxt/hashkey.py +79 -67
- ccxt/hitbtc.py +47 -5
- ccxt/hollaex.py +4 -6
- ccxt/htx.py +1 -3
- ccxt/huobijp.py +0 -1
- ccxt/hyperliquid.py +1 -1
- ccxt/idex.py +8 -8
- ccxt/independentreserve.py +0 -1
- ccxt/indodax.py +0 -1
- ccxt/kraken.py +63 -3
- ccxt/krakenfutures.py +75 -3
- ccxt/kucoin.py +1 -3
- ccxt/kucoinfutures.py +10 -9
- ccxt/kuna.py +1 -3
- ccxt/latoken.py +1 -3
- ccxt/lbank.py +0 -1
- ccxt/luno.py +0 -1
- ccxt/lykke.py +0 -1
- ccxt/mercado.py +0 -1
- ccxt/mexc.py +3 -4
- ccxt/myokx.py +35 -0
- ccxt/ndax.py +1 -1
- ccxt/novadax.py +4 -6
- ccxt/oceanex.py +0 -1
- ccxt/okcoin.py +1 -3
- ccxt/okx.py +1 -3
- ccxt/onetrading.py +1 -3
- ccxt/p2b.py +1 -1
- ccxt/paradex.py +5 -7
- ccxt/phemex.py +14 -14
- ccxt/poloniex.py +1 -3
- ccxt/poloniexfutures.py +6 -6
- ccxt/pro/__init__.py +3 -1
- ccxt/pro/myokx.py +23 -0
- ccxt/probit.py +0 -1
- ccxt/timex.py +0 -1
- ccxt/tokocrypto.py +11 -14
- ccxt/tradeogre.py +1 -1
- ccxt/upbit.py +0 -1
- ccxt/vertex.py +63 -4
- ccxt/wavesexchange.py +4 -5
- ccxt/whitebit.py +8 -9
- ccxt/woo.py +100 -14
- ccxt/woofipro.py +96 -15
- ccxt/xt.py +3 -2
- ccxt/yobit.py +0 -1
- ccxt/zaif.py +0 -1
- ccxt/zonda.py +1 -2
- {ccxt-4.4.41.dist-info → ccxt-4.4.43.dist-info}/METADATA +37 -35
- {ccxt-4.4.41.dist-info → ccxt-4.4.43.dist-info}/RECORD +170 -173
- ccxt/async_support/bitbay.py +0 -17
- ccxt/async_support/bitfinex2.py +0 -3625
- ccxt/async_support/hitbtc3.py +0 -16
- ccxt/bitbay.py +0 -17
- ccxt/bitfinex2.py +0 -3624
- ccxt/hitbtc3.py +0 -16
- ccxt/pro/bitfinex2.py +0 -1086
- {ccxt-4.4.41.dist-info → ccxt-4.4.43.dist-info}/LICENSE.txt +0 -0
- {ccxt-4.4.41.dist-info → ccxt-4.4.43.dist-info}/WHEEL +0 -0
- {ccxt-4.4.41.dist-info → ccxt-4.4.43.dist-info}/top_level.txt +0 -0
@@ -857,12 +857,12 @@ class poloniexfutures(Exchange, ImplicitAPI):
|
|
857
857
|
'size': preciseAmount,
|
858
858
|
'leverage': 1,
|
859
859
|
}
|
860
|
-
|
861
|
-
if
|
860
|
+
triggerPrice = self.safe_value_2(params, 'triggerPrice', 'stopPrice')
|
861
|
+
if triggerPrice:
|
862
862
|
request['stop'] = 'up' if (side == 'buy') else 'down'
|
863
863
|
stopPriceType = self.safe_string(params, 'stopPriceType', 'TP')
|
864
864
|
request['stopPriceType'] = stopPriceType
|
865
|
-
request['stopPrice'] = self.price_to_precision(symbol,
|
865
|
+
request['stopPrice'] = self.price_to_precision(symbol, triggerPrice)
|
866
866
|
timeInForce = self.safe_string_upper(params, 'timeInForce')
|
867
867
|
if type == 'limit':
|
868
868
|
if price is None:
|
@@ -911,7 +911,7 @@ class poloniexfutures(Exchange, ImplicitAPI):
|
|
911
911
|
'trades': None,
|
912
912
|
'timeInForce': None,
|
913
913
|
'postOnly': None,
|
914
|
-
'
|
914
|
+
'triggerPrice': None,
|
915
915
|
'info': response,
|
916
916
|
}, market)
|
917
917
|
|
@@ -1230,7 +1230,7 @@ class poloniexfutures(Exchange, ImplicitAPI):
|
|
1230
1230
|
'trades': None,
|
1231
1231
|
'timeInForce': None,
|
1232
1232
|
'postOnly': None,
|
1233
|
-
'
|
1233
|
+
'triggerPrice': None,
|
1234
1234
|
'info': response,
|
1235
1235
|
}))
|
1236
1236
|
return result
|
@@ -1549,7 +1549,7 @@ class poloniexfutures(Exchange, ImplicitAPI):
|
|
1549
1549
|
'side': self.safe_string(order, 'side'),
|
1550
1550
|
'amount': self.safe_string(order, 'size'),
|
1551
1551
|
'price': self.safe_string(order, 'price'),
|
1552
|
-
'
|
1552
|
+
'triggerPrice': self.safe_string(order, 'stopPrice'),
|
1553
1553
|
'cost': self.safe_string(order, 'dealValue'),
|
1554
1554
|
'filled': filled,
|
1555
1555
|
'remaining': None,
|
ccxt/async_support/probit.py
CHANGED
ccxt/async_support/timex.py
CHANGED
ccxt/async_support/tokocrypto.py
CHANGED
@@ -1536,8 +1536,6 @@ class tokocrypto(Exchange, ImplicitAPI):
|
|
1536
1536
|
# GTX means "Good Till Crossing" and is an equivalent way of saying Post Only
|
1537
1537
|
timeInForce = 'PO'
|
1538
1538
|
postOnly = (type == 'limit_maker') or (timeInForce == 'PO')
|
1539
|
-
stopPriceString = self.safe_string(order, 'stopPrice')
|
1540
|
-
stopPrice = self.parse_number(self.omit_zero(stopPriceString))
|
1541
1539
|
return self.safe_order({
|
1542
1540
|
'info': order,
|
1543
1541
|
'id': id,
|
@@ -1552,8 +1550,7 @@ class tokocrypto(Exchange, ImplicitAPI):
|
|
1552
1550
|
'reduceOnly': self.safe_value(order, 'reduceOnly'),
|
1553
1551
|
'side': side,
|
1554
1552
|
'price': price,
|
1555
|
-
'
|
1556
|
-
'triggerPrice': stopPrice,
|
1553
|
+
'triggerPrice': self.parse_number(self.omit_zero(self.safe_string(order, 'stopPrice'))),
|
1557
1554
|
'amount': amount,
|
1558
1555
|
'cost': cost,
|
1559
1556
|
'average': average,
|
@@ -1600,8 +1597,8 @@ class tokocrypto(Exchange, ImplicitAPI):
|
|
1600
1597
|
params = self.omit(params, ['clientId', 'clientOrderId'])
|
1601
1598
|
initialUppercaseType = type.upper()
|
1602
1599
|
uppercaseType = initialUppercaseType
|
1603
|
-
|
1604
|
-
if
|
1600
|
+
triggerPrice = self.safe_value_2(params, 'triggerPrice', 'stopPrice')
|
1601
|
+
if triggerPrice is not None:
|
1605
1602
|
params = self.omit(params, ['triggerPrice', 'stopPrice'])
|
1606
1603
|
if uppercaseType == 'MARKET':
|
1607
1604
|
uppercaseType = 'STOP_LOSS'
|
@@ -1610,7 +1607,7 @@ class tokocrypto(Exchange, ImplicitAPI):
|
|
1610
1607
|
validOrderTypes = self.safe_value(market['info'], 'orderTypes')
|
1611
1608
|
if not self.in_array(uppercaseType, validOrderTypes):
|
1612
1609
|
if initialUppercaseType != uppercaseType:
|
1613
|
-
raise InvalidOrder(self.id + '
|
1610
|
+
raise InvalidOrder(self.id + ' triggerPrice parameter is not allowed for ' + symbol + ' ' + type + ' orders')
|
1614
1611
|
else:
|
1615
1612
|
raise InvalidOrder(self.id + ' ' + type + ' is not a valid order type for the ' + symbol + ' market')
|
1616
1613
|
reverseOrderTypeMapping: dict = {
|
@@ -1640,7 +1637,7 @@ class tokocrypto(Exchange, ImplicitAPI):
|
|
1640
1637
|
request['clientId'] = clientOrderId
|
1641
1638
|
# additional required fields depending on the order type
|
1642
1639
|
priceIsRequired = False
|
1643
|
-
|
1640
|
+
triggerPriceIsRequired = False
|
1644
1641
|
quantityIsRequired = False
|
1645
1642
|
#
|
1646
1643
|
# spot/margin
|
@@ -1679,13 +1676,13 @@ class tokocrypto(Exchange, ImplicitAPI):
|
|
1679
1676
|
priceIsRequired = True
|
1680
1677
|
quantityIsRequired = True
|
1681
1678
|
elif (uppercaseType == 'STOP_LOSS') or (uppercaseType == 'TAKE_PROFIT'):
|
1682
|
-
|
1679
|
+
triggerPriceIsRequired = True
|
1683
1680
|
quantityIsRequired = True
|
1684
1681
|
if market['linear'] or market['inverse']:
|
1685
1682
|
priceIsRequired = True
|
1686
1683
|
elif (uppercaseType == 'STOP_LOSS_LIMIT') or (uppercaseType == 'TAKE_PROFIT_LIMIT'):
|
1687
1684
|
quantityIsRequired = True
|
1688
|
-
|
1685
|
+
triggerPriceIsRequired = True
|
1689
1686
|
priceIsRequired = True
|
1690
1687
|
elif uppercaseType == 'LIMIT_MAKER':
|
1691
1688
|
priceIsRequired = True
|
@@ -1696,11 +1693,11 @@ class tokocrypto(Exchange, ImplicitAPI):
|
|
1696
1693
|
if price is None:
|
1697
1694
|
raise InvalidOrder(self.id + ' createOrder() requires a price argument for a ' + type + ' order')
|
1698
1695
|
request['price'] = self.price_to_precision(symbol, price)
|
1699
|
-
if
|
1700
|
-
if
|
1701
|
-
raise InvalidOrder(self.id + ' createOrder() requires a
|
1696
|
+
if triggerPriceIsRequired:
|
1697
|
+
if triggerPrice is None:
|
1698
|
+
raise InvalidOrder(self.id + ' createOrder() requires a triggerPrice extra param for a ' + type + ' order')
|
1702
1699
|
else:
|
1703
|
-
request['stopPrice'] = self.price_to_precision(symbol,
|
1700
|
+
request['stopPrice'] = self.price_to_precision(symbol, triggerPrice)
|
1704
1701
|
response = await self.privatePostOpenV1Orders(self.extend(request, params))
|
1705
1702
|
#
|
1706
1703
|
# {
|
ccxt/async_support/tradeogre.py
CHANGED
@@ -561,7 +561,7 @@ class tradeogre(Exchange, ImplicitAPI):
|
|
561
561
|
'postOnly': None,
|
562
562
|
'side': self.safe_string(order, 'type'),
|
563
563
|
'price': self.safe_string(order, 'price'),
|
564
|
-
'
|
564
|
+
'triggerPrice': None,
|
565
565
|
'amount': self.safe_string(order, 'quantity'),
|
566
566
|
'cost': None,
|
567
567
|
'average': None,
|
ccxt/async_support/upbit.py
CHANGED
ccxt/async_support/vertex.py
CHANGED
@@ -93,6 +93,7 @@ class vertex(Exchange, ImplicitAPI):
|
|
93
93
|
'fetchOHLCV': True,
|
94
94
|
'fetchOpenInterest': True,
|
95
95
|
'fetchOpenInterestHistory': False,
|
96
|
+
'fetchOpenInterests': True,
|
96
97
|
'fetchOpenOrders': True,
|
97
98
|
'fetchOrder': True,
|
98
99
|
'fetchOrderBook': True,
|
@@ -1329,16 +1330,74 @@ class vertex(Exchange, ImplicitAPI):
|
|
1329
1330
|
# }
|
1330
1331
|
# }
|
1331
1332
|
#
|
1332
|
-
|
1333
|
+
marketId = self.safe_string(interest, 'ticker_id')
|
1333
1334
|
return self.safe_open_interest({
|
1334
|
-
'symbol': market
|
1335
|
-
'openInterestAmount':
|
1336
|
-
'openInterestValue':
|
1335
|
+
'symbol': self.safe_symbol(marketId, market),
|
1336
|
+
'openInterestAmount': self.safe_number(interest, 'open_interest'),
|
1337
|
+
'openInterestValue': self.safe_number(interest, 'open_interest_usd'),
|
1337
1338
|
'timestamp': None,
|
1338
1339
|
'datetime': None,
|
1339
1340
|
'info': interest,
|
1340
1341
|
}, market)
|
1341
1342
|
|
1343
|
+
async def fetch_open_interests(self, symbols: Strings = None, params={}):
|
1344
|
+
"""
|
1345
|
+
Retrieves the open interest for a list of symbols
|
1346
|
+
|
1347
|
+
https://docs.vertexprotocol.com/developer-resources/api/v2/contracts
|
1348
|
+
|
1349
|
+
:param str[] [symbols]: a list of unified CCXT market symbols
|
1350
|
+
:param dict [params]: exchange specific parameters
|
1351
|
+
:returns dict[]: a list of `open interest structures <https://docs.ccxt.com/#/?id=open-interest-structure>`
|
1352
|
+
"""
|
1353
|
+
await self.load_markets()
|
1354
|
+
symbols = self.market_symbols(symbols)
|
1355
|
+
response = await self.v2ArchiveGetContracts(params)
|
1356
|
+
#
|
1357
|
+
# {
|
1358
|
+
# "ADA-PERP_USDC": {
|
1359
|
+
# "ticker_id": "ADA-PERP_USDC",
|
1360
|
+
# "base_currency": "ADA-PERP",
|
1361
|
+
# "quote_currency": "USDC",
|
1362
|
+
# "last_price": 0.85506,
|
1363
|
+
# "base_volume": 1241320.0,
|
1364
|
+
# "quote_volume": 1122670.9080057142,
|
1365
|
+
# "product_type": "perpetual",
|
1366
|
+
# "contract_price": 0.8558601432685385,
|
1367
|
+
# "contract_price_currency": "USD",
|
1368
|
+
# "open_interest": 104040.0,
|
1369
|
+
# "open_interest_usd": 89043.68930565874,
|
1370
|
+
# "index_price": 0.8561952606869176,
|
1371
|
+
# "mark_price": 0.856293781088936,
|
1372
|
+
# "funding_rate": 0.000116153806226841,
|
1373
|
+
# "next_funding_rate_timestamp": 1734685200,
|
1374
|
+
# "price_change_percent_24h": -12.274325340321374
|
1375
|
+
# },
|
1376
|
+
# }
|
1377
|
+
#
|
1378
|
+
parsedSymbols = []
|
1379
|
+
results = []
|
1380
|
+
markets = list(response.keys())
|
1381
|
+
if symbols is None:
|
1382
|
+
symbols = []
|
1383
|
+
for y in range(0, len(markets)):
|
1384
|
+
tickerId = markets[y]
|
1385
|
+
parsedTickerId = tickerId.split('-')
|
1386
|
+
currentSymbol = parsedTickerId[0] + '/USDC:USDC'
|
1387
|
+
if not self.in_array(currentSymbol, symbols):
|
1388
|
+
symbols.append(currentSymbol)
|
1389
|
+
for i in range(0, len(markets)):
|
1390
|
+
marketId = markets[i]
|
1391
|
+
marketInner = self.safe_market(marketId)
|
1392
|
+
openInterest = self.safe_dict(response, marketId, {})
|
1393
|
+
for j in range(0, len(symbols)):
|
1394
|
+
market = self.market(symbols[j])
|
1395
|
+
tickerId = market['base'] + '_USDC'
|
1396
|
+
if marketInner['marketId'] == tickerId:
|
1397
|
+
parsedSymbols.append(market['symbol'])
|
1398
|
+
results.append(self.parse_open_interest(openInterest, market))
|
1399
|
+
return self.filter_by_array(results, 'symbol', parsedSymbols)
|
1400
|
+
|
1342
1401
|
async def fetch_open_interest(self, symbol: str, params={}):
|
1343
1402
|
"""
|
1344
1403
|
Retrieves the open interest of a derivative trading pair
|
@@ -1244,7 +1244,7 @@ class wavesexchange(Exchange, ImplicitAPI):
|
|
1244
1244
|
:param float amount: how much of currency you want to trade in units of base currency
|
1245
1245
|
:param float [price]: the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
1246
1246
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1247
|
-
:param float [params.
|
1247
|
+
:param float [params.triggerPrice]: The price at which a stop order is triggered at
|
1248
1248
|
:returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
|
1249
1249
|
"""
|
1250
1250
|
self.check_required_dependencies()
|
@@ -1255,8 +1255,8 @@ class wavesexchange(Exchange, ImplicitAPI):
|
|
1255
1255
|
amountAsset = self.get_asset_id(market['baseId'])
|
1256
1256
|
priceAsset = self.get_asset_id(market['quoteId'])
|
1257
1257
|
isMarketOrder = (type == 'market')
|
1258
|
-
|
1259
|
-
isStopOrder = (
|
1258
|
+
triggerPrice = self.safe_float_2(params, 'triggerPrice', 'stopPrice')
|
1259
|
+
isStopOrder = (triggerPrice is not None)
|
1260
1260
|
if (isMarketOrder) and (price is None):
|
1261
1261
|
raise InvalidOrder(self.id + ' createOrder() requires a price argument for ' + type + ' orders to determine the max price for buy and the min price for sell')
|
1262
1262
|
timestamp = self.milliseconds()
|
@@ -1352,7 +1352,7 @@ class wavesexchange(Exchange, ImplicitAPI):
|
|
1352
1352
|
'c': {
|
1353
1353
|
't': 'sp',
|
1354
1354
|
'v': {
|
1355
|
-
'p': self.to_real_symbol_price(symbol,
|
1355
|
+
'p': self.to_real_symbol_price(symbol, triggerPrice),
|
1356
1356
|
},
|
1357
1357
|
},
|
1358
1358
|
}
|
@@ -1726,7 +1726,6 @@ class wavesexchange(Exchange, ImplicitAPI):
|
|
1726
1726
|
'postOnly': None,
|
1727
1727
|
'side': side,
|
1728
1728
|
'price': price,
|
1729
|
-
'stopPrice': triggerPrice,
|
1730
1729
|
'triggerPrice': triggerPrice,
|
1731
1730
|
'amount': amount,
|
1732
1731
|
'cost': None,
|
ccxt/async_support/whitebit.py
CHANGED
@@ -1275,8 +1275,8 @@ class whitebit(Exchange, ImplicitAPI):
|
|
1275
1275
|
marketType = self.safe_string(market, 'type')
|
1276
1276
|
isLimitOrder = type == 'limit'
|
1277
1277
|
isMarketOrder = type == 'market'
|
1278
|
-
|
1279
|
-
isStopOrder = (
|
1278
|
+
triggerPrice = self.safe_number_n(params, ['triggerPrice', 'stopPrice', 'activation_price'])
|
1279
|
+
isStopOrder = (triggerPrice is not None)
|
1280
1280
|
postOnly = self.is_post_only(isMarketOrder, False, params)
|
1281
1281
|
marginMode, query = self.handle_margin_mode_and_params('createOrder', params)
|
1282
1282
|
if postOnly:
|
@@ -1287,7 +1287,7 @@ class whitebit(Exchange, ImplicitAPI):
|
|
1287
1287
|
useCollateralEndpoint = marginMode is not None or marketType == 'swap'
|
1288
1288
|
response = None
|
1289
1289
|
if isStopOrder:
|
1290
|
-
request['activation_price'] = self.price_to_precision(symbol,
|
1290
|
+
request['activation_price'] = self.price_to_precision(symbol, triggerPrice)
|
1291
1291
|
if isLimitOrder:
|
1292
1292
|
# stop limit order
|
1293
1293
|
request['price'] = self.price_to_precision(symbol, price)
|
@@ -1347,11 +1347,11 @@ class whitebit(Exchange, ImplicitAPI):
|
|
1347
1347
|
# Update clientOrderId of the order
|
1348
1348
|
request['clientOrderId'] = clientOrderId
|
1349
1349
|
isLimitOrder = type == 'limit'
|
1350
|
-
|
1351
|
-
isStopOrder = (
|
1350
|
+
triggerPrice = self.safe_number_n(params, ['triggerPrice', 'stopPrice', 'activation_price'])
|
1351
|
+
isStopOrder = (triggerPrice is not None)
|
1352
1352
|
params = self.omit(params, ['clOrdId', 'clientOrderId', 'triggerPrice', 'stopPrice'])
|
1353
1353
|
if isStopOrder:
|
1354
|
-
request['activation_price'] = self.price_to_precision(symbol,
|
1354
|
+
request['activation_price'] = self.price_to_precision(symbol, triggerPrice)
|
1355
1355
|
if isLimitOrder:
|
1356
1356
|
# stop limit order
|
1357
1357
|
request['amount'] = self.amount_to_precision(symbol, amount)
|
@@ -1714,7 +1714,7 @@ class whitebit(Exchange, ImplicitAPI):
|
|
1714
1714
|
if clientOrderId == '':
|
1715
1715
|
clientOrderId = None
|
1716
1716
|
price = self.safe_string(order, 'price')
|
1717
|
-
|
1717
|
+
triggerPrice = self.safe_number(order, 'activation_price')
|
1718
1718
|
orderId = self.safe_string_2(order, 'orderId', 'id')
|
1719
1719
|
type = self.safe_string(order, 'type')
|
1720
1720
|
orderType = self.parse_order_type(type)
|
@@ -1747,8 +1747,7 @@ class whitebit(Exchange, ImplicitAPI):
|
|
1747
1747
|
'side': side,
|
1748
1748
|
'price': price,
|
1749
1749
|
'type': orderType,
|
1750
|
-
'
|
1751
|
-
'triggerPrice': stopPrice,
|
1750
|
+
'triggerPrice': triggerPrice,
|
1752
1751
|
'amount': amount,
|
1753
1752
|
'filled': filled,
|
1754
1753
|
'remaining': remaining,
|
ccxt/async_support/woo.py
CHANGED
@@ -321,6 +321,92 @@ class woo(Exchange, ImplicitAPI):
|
|
321
321
|
},
|
322
322
|
'brokerId': 'bc830de7-50f3-460b-9ee0-f430f83f9dad',
|
323
323
|
},
|
324
|
+
'features': {
|
325
|
+
'default': {
|
326
|
+
'sandbox': True,
|
327
|
+
'createOrder': {
|
328
|
+
'marginMode': True,
|
329
|
+
'triggerPrice': True,
|
330
|
+
'triggerPriceType': {
|
331
|
+
'last': True,
|
332
|
+
'mark': True,
|
333
|
+
'index': False,
|
334
|
+
},
|
335
|
+
'triggerDirection': False,
|
336
|
+
'stopLossPrice': False, # todo by triggerPrice
|
337
|
+
'takeProfitPrice': False, # todo by triggerPrice
|
338
|
+
'attachedStopLossTakeProfit': None,
|
339
|
+
'timeInForce': {
|
340
|
+
'IOC': True,
|
341
|
+
'FOK': True,
|
342
|
+
'PO': True,
|
343
|
+
'GTD': True,
|
344
|
+
},
|
345
|
+
'hedged': False,
|
346
|
+
'trailing': True,
|
347
|
+
# exchange specific params:
|
348
|
+
# 'iceberg': True,
|
349
|
+
# 'oco': True,
|
350
|
+
},
|
351
|
+
'createOrders': None,
|
352
|
+
'fetchMyTrades': {
|
353
|
+
'marginMode': False,
|
354
|
+
'limit': 500,
|
355
|
+
'daysBack': 90,
|
356
|
+
'untilDays': 10000,
|
357
|
+
},
|
358
|
+
'fetchOrder': {
|
359
|
+
'marginMode': False,
|
360
|
+
'trigger': True,
|
361
|
+
'trailing': False,
|
362
|
+
},
|
363
|
+
'fetchOpenOrders': {
|
364
|
+
'marginMode': False,
|
365
|
+
'limit': 500,
|
366
|
+
'trigger': True,
|
367
|
+
'trailing': True,
|
368
|
+
},
|
369
|
+
'fetchOrders': {
|
370
|
+
'marginMode': False,
|
371
|
+
'limit': 500,
|
372
|
+
'daysBack': None,
|
373
|
+
'untilDays': 100000,
|
374
|
+
'trigger': True,
|
375
|
+
'trailing': True,
|
376
|
+
},
|
377
|
+
'fetchClosedOrders': {
|
378
|
+
'marginMode': False,
|
379
|
+
'limit': 500,
|
380
|
+
'daysBackClosed': None,
|
381
|
+
'daysBackCanceled': None,
|
382
|
+
'untilDays': 100000,
|
383
|
+
'trigger': True,
|
384
|
+
'trailing': True,
|
385
|
+
},
|
386
|
+
'fetchOHLCV': {
|
387
|
+
'limit': 1000,
|
388
|
+
},
|
389
|
+
},
|
390
|
+
'spot': {
|
391
|
+
'extends': 'default',
|
392
|
+
},
|
393
|
+
'forSwap': {
|
394
|
+
'extends': 'default',
|
395
|
+
'createOrder': {
|
396
|
+
'hedged': True,
|
397
|
+
},
|
398
|
+
},
|
399
|
+
'swap': {
|
400
|
+
'linear': {
|
401
|
+
'extends': 'forSwap',
|
402
|
+
},
|
403
|
+
'inverse': None,
|
404
|
+
},
|
405
|
+
'future': {
|
406
|
+
'linear': None,
|
407
|
+
'inverse': None,
|
408
|
+
},
|
409
|
+
},
|
324
410
|
'commonCurrencies': {},
|
325
411
|
'exceptions': {
|
326
412
|
'exact': {
|
@@ -965,7 +1051,7 @@ class woo(Exchange, ImplicitAPI):
|
|
965
1051
|
marginMode, params = self.handle_margin_mode_and_params('createOrder', params)
|
966
1052
|
if marginMode is not None:
|
967
1053
|
request['margin_mode'] = self.encode_margin_mode(marginMode)
|
968
|
-
|
1054
|
+
triggerPrice = self.safe_string_2(params, 'triggerPrice', 'stopPrice')
|
969
1055
|
stopLoss = self.safe_value(params, 'stopLoss')
|
970
1056
|
takeProfit = self.safe_value(params, 'takeProfit')
|
971
1057
|
algoType = self.safe_string(params, 'algoType')
|
@@ -975,7 +1061,7 @@ class woo(Exchange, ImplicitAPI):
|
|
975
1061
|
isTrailingAmountOrder = trailingAmount is not None
|
976
1062
|
isTrailingPercentOrder = trailingPercent is not None
|
977
1063
|
isTrailing = isTrailingAmountOrder or isTrailingPercentOrder
|
978
|
-
isConditional = isTrailing or
|
1064
|
+
isConditional = isTrailing or triggerPrice is not None or stopLoss is not None or takeProfit is not None or (self.safe_value(params, 'childOrders') is not None)
|
979
1065
|
isMarket = orderType == 'MARKET'
|
980
1066
|
timeInForce = self.safe_string_lower(params, 'timeInForce')
|
981
1067
|
postOnly = self.is_post_only(isMarket, None, params)
|
@@ -1028,9 +1114,9 @@ class woo(Exchange, ImplicitAPI):
|
|
1028
1114
|
elif isTrailingPercentOrder:
|
1029
1115
|
convertedTrailingPercent = Precise.string_div(trailingPercent, '100')
|
1030
1116
|
request['callbackRate'] = convertedTrailingPercent
|
1031
|
-
elif
|
1117
|
+
elif triggerPrice is not None:
|
1032
1118
|
if algoType != 'TRAILING_STOP':
|
1033
|
-
request['triggerPrice'] = self.price_to_precision(symbol,
|
1119
|
+
request['triggerPrice'] = self.price_to_precision(symbol, triggerPrice)
|
1034
1120
|
request['algoType'] = 'STOP'
|
1035
1121
|
elif (stopLoss is not None) or (takeProfit is not None):
|
1036
1122
|
request['algoType'] = 'BRACKET'
|
@@ -1042,7 +1128,7 @@ class woo(Exchange, ImplicitAPI):
|
|
1042
1128
|
}
|
1043
1129
|
closeSide = 'SELL' if (orderSide == 'BUY') else 'BUY'
|
1044
1130
|
if stopLoss is not None:
|
1045
|
-
stopLossPrice = self.
|
1131
|
+
stopLossPrice = self.safe_string(stopLoss, 'triggerPrice', stopLoss)
|
1046
1132
|
stopLossOrder: dict = {
|
1047
1133
|
'side': closeSide,
|
1048
1134
|
'algoType': 'STOP_LOSS',
|
@@ -1052,7 +1138,7 @@ class woo(Exchange, ImplicitAPI):
|
|
1052
1138
|
}
|
1053
1139
|
outterOrder['childOrders'].append(stopLossOrder)
|
1054
1140
|
if takeProfit is not None:
|
1055
|
-
takeProfitPrice = self.
|
1141
|
+
takeProfitPrice = self.safe_string(takeProfit, 'triggerPrice', takeProfit)
|
1056
1142
|
takeProfitOrder: dict = {
|
1057
1143
|
'side': closeSide,
|
1058
1144
|
'algoType': 'TAKE_PROFIT',
|
@@ -1145,9 +1231,9 @@ class woo(Exchange, ImplicitAPI):
|
|
1145
1231
|
clientOrderIdUnified = self.safe_string_2(params, 'clOrdID', 'clientOrderId')
|
1146
1232
|
clientOrderIdExchangeSpecific = self.safe_string(params, 'client_order_id', clientOrderIdUnified)
|
1147
1233
|
isByClientOrder = clientOrderIdExchangeSpecific is not None
|
1148
|
-
|
1149
|
-
if
|
1150
|
-
request['triggerPrice'] = self.price_to_precision(symbol,
|
1234
|
+
triggerPrice = self.safe_number_n(params, ['triggerPrice', 'stopPrice', 'takeProfitPrice', 'stopLossPrice'])
|
1235
|
+
if triggerPrice is not None:
|
1236
|
+
request['triggerPrice'] = self.price_to_precision(symbol, triggerPrice)
|
1151
1237
|
trailingTriggerPrice = self.safe_string_2(params, 'trailingTriggerPrice', 'activatedPrice', self.number_to_string(price))
|
1152
1238
|
trailingAmount = self.safe_string_2(params, 'trailingAmount', 'callbackValue')
|
1153
1239
|
trailingPercent = self.safe_string_2(params, 'trailingPercent', 'callbackRate')
|
@@ -1163,7 +1249,7 @@ class woo(Exchange, ImplicitAPI):
|
|
1163
1249
|
convertedTrailingPercent = Precise.string_div(trailingPercent, '100')
|
1164
1250
|
request['callbackRate'] = convertedTrailingPercent
|
1165
1251
|
params = self.omit(params, ['clOrdID', 'clientOrderId', 'client_order_id', 'stopPrice', 'triggerPrice', 'takeProfitPrice', 'stopLossPrice', 'trailingTriggerPrice', 'trailingAmount', 'trailingPercent'])
|
1166
|
-
isConditional = isTrailing or (
|
1252
|
+
isConditional = isTrailing or (triggerPrice is not None) or (self.safe_value(params, 'childOrders') is not None)
|
1167
1253
|
response = None
|
1168
1254
|
if isByClientOrder:
|
1169
1255
|
request['client_order_id'] = clientOrderIdExchangeSpecific
|
@@ -1570,7 +1656,7 @@ class woo(Exchange, ImplicitAPI):
|
|
1570
1656
|
fee = self.safe_number_2(order, 'total_fee', 'totalFee')
|
1571
1657
|
feeCurrency = self.safe_string_2(order, 'fee_asset', 'feeAsset')
|
1572
1658
|
transactions = self.safe_value(order, 'Transactions')
|
1573
|
-
|
1659
|
+
triggerPrice = self.safe_number(order, 'triggerPrice')
|
1574
1660
|
takeProfitPrice: Num = None
|
1575
1661
|
stopLossPrice: Num = None
|
1576
1662
|
childOrders = self.safe_value(order, 'childOrders')
|
@@ -1599,8 +1685,7 @@ class woo(Exchange, ImplicitAPI):
|
|
1599
1685
|
'reduceOnly': self.safe_bool(order, 'reduce_only'),
|
1600
1686
|
'side': side,
|
1601
1687
|
'price': price,
|
1602
|
-
'
|
1603
|
-
'triggerPrice': stopPrice,
|
1688
|
+
'triggerPrice': triggerPrice,
|
1604
1689
|
'takeProfitPrice': takeProfitPrice,
|
1605
1690
|
'stopLossPrice': stopLossPrice,
|
1606
1691
|
'average': average,
|
@@ -1808,7 +1893,7 @@ class woo(Exchange, ImplicitAPI):
|
|
1808
1893
|
"""
|
1809
1894
|
fetch all trades made by the user
|
1810
1895
|
|
1811
|
-
https://docs.woox.io/#get-
|
1896
|
+
https://docs.woox.io/#get-trade-history
|
1812
1897
|
|
1813
1898
|
:param str symbol: unified market symbol
|
1814
1899
|
:param int [since]: the earliest time in ms to fetch trades for
|
@@ -1829,6 +1914,7 @@ class woo(Exchange, ImplicitAPI):
|
|
1829
1914
|
request['symbol'] = market['id']
|
1830
1915
|
if since is not None:
|
1831
1916
|
request['start_t'] = since
|
1917
|
+
request, params = self.handle_until_option('end_t', request, params)
|
1832
1918
|
if limit is not None:
|
1833
1919
|
request['size'] = limit
|
1834
1920
|
else:
|