ccxt 4.4.50__py2.py3-none-any.whl → 4.4.52__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 -1
- ccxt/alpaca.py +1 -1
- ccxt/async_support/__init__.py +1 -1
- ccxt/async_support/alpaca.py +1 -1
- ccxt/async_support/base/exchange.py +1 -1
- ccxt/async_support/binance.py +31 -16
- ccxt/async_support/blofin.py +4 -0
- ccxt/async_support/coinex.py +1 -1
- ccxt/async_support/coinmetro.py +16 -3
- ccxt/async_support/deribit.py +18 -3
- ccxt/async_support/gate.py +1 -1
- ccxt/async_support/hollaex.py +2 -1
- ccxt/async_support/htx.py +5 -3
- ccxt/async_support/kucoin.py +2 -2
- ccxt/async_support/mexc.py +21 -6
- ccxt/async_support/onetrading.py +1 -1
- ccxt/async_support/paradex.py +1 -1
- ccxt/async_support/probit.py +9 -7
- ccxt/async_support/vertex.py +65 -2
- ccxt/async_support/wavesexchange.py +73 -0
- ccxt/async_support/wazirx.py +59 -3
- ccxt/async_support/whitebit.py +69 -0
- ccxt/async_support/xt.py +112 -0
- ccxt/async_support/yobit.py +56 -0
- ccxt/async_support/zaif.py +55 -0
- ccxt/async_support/zonda.py +58 -0
- ccxt/base/exchange.py +32 -4
- ccxt/binance.py +31 -16
- ccxt/blofin.py +4 -0
- ccxt/coinex.py +1 -1
- ccxt/coinmetro.py +16 -3
- ccxt/deribit.py +18 -3
- ccxt/gate.py +1 -1
- ccxt/hollaex.py +2 -1
- ccxt/htx.py +5 -3
- ccxt/kucoin.py +2 -2
- ccxt/mexc.py +21 -6
- ccxt/onetrading.py +1 -1
- ccxt/paradex.py +1 -1
- ccxt/pro/__init__.py +1 -1
- ccxt/pro/binance.py +2 -0
- ccxt/pro/blofin.py +8 -0
- ccxt/pro/coinex.py +4 -1
- ccxt/probit.py +9 -7
- ccxt/test/tests_async.py +0 -1
- ccxt/test/tests_sync.py +0 -1
- ccxt/vertex.py +65 -2
- ccxt/wavesexchange.py +73 -0
- ccxt/wazirx.py +59 -3
- ccxt/whitebit.py +69 -0
- ccxt/xt.py +112 -0
- ccxt/yobit.py +56 -0
- ccxt/zaif.py +55 -0
- ccxt/zonda.py +58 -0
- {ccxt-4.4.50.dist-info → ccxt-4.4.52.dist-info}/METADATA +18 -18
- {ccxt-4.4.50.dist-info → ccxt-4.4.52.dist-info}/RECORD +59 -59
- {ccxt-4.4.50.dist-info → ccxt-4.4.52.dist-info}/WHEEL +1 -1
- {ccxt-4.4.50.dist-info → ccxt-4.4.52.dist-info}/LICENSE.txt +0 -0
- {ccxt-4.4.50.dist-info → ccxt-4.4.52.dist-info}/top_level.txt +0 -0
ccxt/__init__.py
CHANGED
ccxt/alpaca.py
CHANGED
@@ -445,7 +445,7 @@ class alpaca(Exchange, ImplicitAPI):
|
|
445
445
|
# "status": "active",
|
446
446
|
# "tradable": True,
|
447
447
|
# "marginable": False,
|
448
|
-
# "maintenance_margin_requirement":
|
448
|
+
# "maintenance_margin_requirement": 101,
|
449
449
|
# "shortable": False,
|
450
450
|
# "easy_to_borrow": False,
|
451
451
|
# "fractionable": True,
|
ccxt/async_support/__init__.py
CHANGED
ccxt/async_support/alpaca.py
CHANGED
@@ -445,7 +445,7 @@ class alpaca(Exchange, ImplicitAPI):
|
|
445
445
|
# "status": "active",
|
446
446
|
# "tradable": True,
|
447
447
|
# "marginable": False,
|
448
|
-
# "maintenance_margin_requirement":
|
448
|
+
# "maintenance_margin_requirement": 101,
|
449
449
|
# "shortable": False,
|
450
450
|
# "easy_to_borrow": False,
|
451
451
|
# "fractionable": True,
|
ccxt/async_support/binance.py
CHANGED
@@ -1600,7 +1600,7 @@ class binance(Exchange, ImplicitAPI):
|
|
1600
1600
|
'triggerDirection': False,
|
1601
1601
|
'stopLossPrice': True,
|
1602
1602
|
'takeProfitPrice': True,
|
1603
|
-
'attachedStopLossTakeProfit': None,
|
1603
|
+
'attachedStopLossTakeProfit': None,
|
1604
1604
|
'timeInForce': {
|
1605
1605
|
'IOC': True,
|
1606
1606
|
'FOK': True,
|
@@ -1609,12 +1609,16 @@ class binance(Exchange, ImplicitAPI):
|
|
1609
1609
|
},
|
1610
1610
|
'hedged': True,
|
1611
1611
|
'leverage': False,
|
1612
|
-
'marketBuyRequiresPrice': False,
|
1613
1612
|
'marketBuyByCost': True,
|
1614
|
-
|
1615
|
-
'selfTradePrevention':
|
1616
|
-
|
1617
|
-
|
1613
|
+
'marketBuyRequiresPrice': False,
|
1614
|
+
'selfTradePrevention': {
|
1615
|
+
'expire_maker': True,
|
1616
|
+
'expire_taker': True,
|
1617
|
+
'expire_both': True,
|
1618
|
+
'none': True,
|
1619
|
+
},
|
1620
|
+
'trailing': False, # todo: self is different from standard trailing https://github.com/binance/binance-spot-api-docs/blob/master/faqs/trailing-stop-faq.md
|
1621
|
+
'icebergAmount': True,
|
1618
1622
|
},
|
1619
1623
|
'createOrders': None,
|
1620
1624
|
'fetchMyTrades': {
|
@@ -1655,7 +1659,7 @@ class binance(Exchange, ImplicitAPI):
|
|
1655
1659
|
'limit': 1000,
|
1656
1660
|
},
|
1657
1661
|
},
|
1658
|
-
'
|
1662
|
+
'forDerivatives': {
|
1659
1663
|
'sandbox': True,
|
1660
1664
|
'createOrder': {
|
1661
1665
|
'marginMode': False,
|
@@ -1727,18 +1731,18 @@ class binance(Exchange, ImplicitAPI):
|
|
1727
1731
|
},
|
1728
1732
|
'swap': {
|
1729
1733
|
'linear': {
|
1730
|
-
'extends': '
|
1734
|
+
'extends': 'forDerivatives',
|
1731
1735
|
},
|
1732
1736
|
'inverse': {
|
1733
|
-
'extends': '
|
1737
|
+
'extends': 'forDerivatives',
|
1734
1738
|
},
|
1735
1739
|
},
|
1736
1740
|
'future': {
|
1737
1741
|
'linear': {
|
1738
|
-
'extends': '
|
1742
|
+
'extends': 'forDerivatives',
|
1739
1743
|
},
|
1740
1744
|
'inverse': {
|
1741
|
-
'extends': '
|
1745
|
+
'extends': 'forDerivatives',
|
1742
1746
|
},
|
1743
1747
|
},
|
1744
1748
|
},
|
@@ -4402,12 +4406,11 @@ class binance(Exchange, ImplicitAPI):
|
|
4402
4406
|
type = 'spot' if (timestamp is None) else 'swap'
|
4403
4407
|
marketId = self.safe_string(entry, 'symbol')
|
4404
4408
|
market = self.safe_market(marketId, market, None, type)
|
4405
|
-
price = self.safe_number(entry, 'price')
|
4406
4409
|
return {
|
4407
4410
|
'symbol': market['symbol'],
|
4408
4411
|
'timestamp': timestamp,
|
4409
4412
|
'datetime': self.iso8601(timestamp),
|
4410
|
-
'price': price,
|
4413
|
+
'price': self.safe_number_omit_zero(entry, 'price'),
|
4411
4414
|
'side': None,
|
4412
4415
|
'info': entry,
|
4413
4416
|
}
|
@@ -6022,7 +6025,7 @@ class binance(Exchange, ImplicitAPI):
|
|
6022
6025
|
"""
|
6023
6026
|
create a trade order
|
6024
6027
|
|
6025
|
-
https://developers.binance.com/docs/binance-spot-api-docs/rest-api/
|
6028
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints#new-order-trade
|
6026
6029
|
https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#test-new-order-trade
|
6027
6030
|
https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/New-Order
|
6028
6031
|
https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/New-Order
|
@@ -6051,6 +6054,8 @@ class binance(Exchange, ImplicitAPI):
|
|
6051
6054
|
:param float [params.stopLossPrice]: the price that a stop loss order is triggered at
|
6052
6055
|
:param float [params.takeProfitPrice]: the price that a take profit order is triggered at
|
6053
6056
|
:param boolean [params.portfolioMargin]: set to True if you would like to create an order in a portfolio margin account
|
6057
|
+
:param str [params.selfTradePrevention]: set unified value for stp(see .features for available values)
|
6058
|
+
:param float [params.icebergAmount]: set iceberg amount for limit orders
|
6054
6059
|
:param str [params.stopLossOrTakeProfit]: 'stopLoss' or 'takeProfit', required for spot trailing orders
|
6055
6060
|
:param str [params.positionSide]: *swap and portfolio margin only* "BOTH" for one-way mode, "LONG" for buy side of hedged mode, "SHORT" for sell side of hedged mode
|
6056
6061
|
:param bool [params.hedged]: *swap and portfolio margin only* True for hedged mode, False for one way mode, default is False
|
@@ -6344,7 +6349,7 @@ class binance(Exchange, ImplicitAPI):
|
|
6344
6349
|
if stopPrice is not None:
|
6345
6350
|
request['stopPrice'] = self.price_to_precision(symbol, stopPrice)
|
6346
6351
|
if timeInForceIsRequired and (self.safe_string(params, 'timeInForce') is None) and (self.safe_string(request, 'timeInForce') is None):
|
6347
|
-
request['timeInForce'] = self.options
|
6352
|
+
request['timeInForce'] = self.safe_string(self.options, 'defaultTimeInForce') # 'GTC' = Good To Cancel(default), 'IOC' = Immediate Or Cancel
|
6348
6353
|
if not isPortfolioMargin and market['contract'] and postOnly:
|
6349
6354
|
request['timeInForce'] = 'GTX'
|
6350
6355
|
# remove timeInForce from params because PO is only used by self.is_post_only and it's not a valid value for Binance
|
@@ -6356,7 +6361,17 @@ class binance(Exchange, ImplicitAPI):
|
|
6356
6361
|
params = self.omit(params, 'reduceOnly')
|
6357
6362
|
side = 'sell' if (side == 'buy') else 'buy'
|
6358
6363
|
request['positionSide'] = 'LONG' if (side == 'buy') else 'SHORT'
|
6359
|
-
|
6364
|
+
# unified stp
|
6365
|
+
selfTradePrevention = self.safe_string(params, 'selfTradePrevention')
|
6366
|
+
if selfTradePrevention is not None:
|
6367
|
+
if market['spot']:
|
6368
|
+
request['selfTradePreventionMode'] = selfTradePrevention.upper() # binance enums exactly match the unified ccxt enums(but needs uppercase)
|
6369
|
+
# unified iceberg
|
6370
|
+
icebergAmount = self.safe_number(params, 'icebergAmount')
|
6371
|
+
if icebergAmount is not None:
|
6372
|
+
if market['spot']:
|
6373
|
+
request['icebergQty'] = self.amount_to_precision(symbol, icebergAmount)
|
6374
|
+
requestParams = self.omit(params, ['type', 'newClientOrderId', 'clientOrderId', 'postOnly', 'stopLossPrice', 'takeProfitPrice', 'stopPrice', 'triggerPrice', 'trailingTriggerPrice', 'trailingPercent', 'quoteOrderQty', 'cost', 'test', 'hedged', 'selfTradePrevention', 'icebergAmount'])
|
6360
6375
|
return self.extend(request, requestParams)
|
6361
6376
|
|
6362
6377
|
async def create_market_order_with_cost(self, symbol: str, side: OrderSide, cost: float, params={}):
|
ccxt/async_support/blofin.py
CHANGED
@@ -166,6 +166,9 @@ class blofin(Exchange, ImplicitAPI):
|
|
166
166
|
'api': {
|
167
167
|
'rest': 'https://openapi.blofin.com',
|
168
168
|
},
|
169
|
+
'test': {
|
170
|
+
'rest': 'https://demo-trading-openapi.blofin.com',
|
171
|
+
},
|
169
172
|
'referral': {
|
170
173
|
'url': 'https://blofin.com/register?referral_code=f79EsS',
|
171
174
|
'discount': 0.05,
|
@@ -323,6 +326,7 @@ class blofin(Exchange, ImplicitAPI):
|
|
323
326
|
'attachedStopLossTakeProfit': {
|
324
327
|
'triggerPriceType': None,
|
325
328
|
'limit': True,
|
329
|
+
'price': None,
|
326
330
|
},
|
327
331
|
'hedged': True,
|
328
332
|
},
|
ccxt/async_support/coinex.py
CHANGED
@@ -3767,7 +3767,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
3767
3767
|
'currency': self.safe_currency_code(None, currency),
|
3768
3768
|
'network': None,
|
3769
3769
|
'address': address,
|
3770
|
-
'tag': tag,
|
3770
|
+
'tag': self.safe_string(depositAddress, 'memo', tag),
|
3771
3771
|
}
|
3772
3772
|
|
3773
3773
|
async def fetch_my_trades(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
ccxt/async_support/coinmetro.py
CHANGED
@@ -219,7 +219,7 @@ class coinmetro(Exchange, ImplicitAPI):
|
|
219
219
|
# exchange-specific options
|
220
220
|
'options': {
|
221
221
|
'currenciesByIdForParseMarket': None,
|
222
|
-
'currencyIdsListForParseMarket':
|
222
|
+
'currencyIdsListForParseMarket': ['QRDO'],
|
223
223
|
},
|
224
224
|
'features': {
|
225
225
|
'spot': {
|
@@ -407,7 +407,11 @@ class coinmetro(Exchange, ImplicitAPI):
|
|
407
407
|
if self.safe_value(self.options, 'currenciesByIdForParseMarket') is None:
|
408
408
|
currenciesById = self.index_by(result, 'id')
|
409
409
|
self.options['currenciesByIdForParseMarket'] = currenciesById
|
410
|
-
self.options
|
410
|
+
currentCurrencyIdsList = self.safe_list(self.options, 'currencyIdsListForParseMarket', [])
|
411
|
+
currencyIdsList = list(currenciesById.keys())
|
412
|
+
for i in range(0, len(currencyIdsList)):
|
413
|
+
currentCurrencyIdsList.append(currencyIdsList[i])
|
414
|
+
self.options['currencyIdsListForParseMarket'] = currentCurrencyIdsList
|
411
415
|
return result
|
412
416
|
|
413
417
|
async def fetch_markets(self, params={}) -> List[Market]:
|
@@ -506,10 +510,19 @@ class coinmetro(Exchange, ImplicitAPI):
|
|
506
510
|
baseId = None
|
507
511
|
quoteId = None
|
508
512
|
currencyIds = self.safe_value(self.options, 'currencyIdsListForParseMarket', [])
|
513
|
+
# Bubble sort by length(longest first)
|
514
|
+
currencyIdsLength = len(currencyIds)
|
515
|
+
for i in range(0, currencyIdsLength):
|
516
|
+
for j in range(0, currencyIdsLength - i - 1):
|
517
|
+
a = currencyIds[j]
|
518
|
+
b = currencyIds[j + 1]
|
519
|
+
if len(a) < len(b):
|
520
|
+
currencyIds[j] = b
|
521
|
+
currencyIds[j + 1] = a
|
509
522
|
for i in range(0, len(currencyIds)):
|
510
523
|
currencyId = currencyIds[i]
|
511
524
|
entryIndex = marketId.find(currencyId)
|
512
|
-
if entryIndex
|
525
|
+
if entryIndex == 0:
|
513
526
|
restId = marketId.replace(currencyId, '')
|
514
527
|
if self.in_array(restId, currencyIds):
|
515
528
|
if entryIndex == 0:
|
ccxt/async_support/deribit.py
CHANGED
@@ -3063,7 +3063,7 @@ class deribit(Exchange, ImplicitAPI):
|
|
3063
3063
|
:param int [since]: the earliest time in ms to fetch funding rate history for
|
3064
3064
|
:param int [limit]: the maximum number of entries to retrieve
|
3065
3065
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
3066
|
-
:param int [params.
|
3066
|
+
:param int [params.until]: fetch funding rate ending at self timestamp
|
3067
3067
|
:param boolean [params.paginate]: default False, when True will automatically paginate by calling self endpoint multiple times. See in the docs all the [availble parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
|
3068
3068
|
:returns dict: a `funding rate structure <https://docs.ccxt.com/#/?id=funding-rate-structure>`
|
3069
3069
|
"""
|
@@ -3071,17 +3071,32 @@ class deribit(Exchange, ImplicitAPI):
|
|
3071
3071
|
market = self.market(symbol)
|
3072
3072
|
paginate = False
|
3073
3073
|
paginate, params = self.handle_option_and_params(params, 'fetchFundingRateHistory', 'paginate')
|
3074
|
+
maxEntriesPerRequest = 744 # seems exchange returns max 744 items per request
|
3075
|
+
eachItemDuration = '1h'
|
3074
3076
|
if paginate:
|
3075
|
-
|
3077
|
+
# fix for: https://github.com/ccxt/ccxt/issues/25040
|
3078
|
+
return await self.fetch_paginated_call_deterministic('fetchFundingRateHistory', symbol, since, limit, eachItemDuration, self.extend(params, {'isDeribitPaginationCall': True}), maxEntriesPerRequest)
|
3079
|
+
duration = self.parse_timeframe(eachItemDuration) * 1000
|
3076
3080
|
time = self.milliseconds()
|
3077
3081
|
month = 30 * 24 * 60 * 60 * 1000
|
3078
3082
|
if since is None:
|
3079
3083
|
since = time - month
|
3084
|
+
else:
|
3085
|
+
time = since + month
|
3080
3086
|
request: dict = {
|
3081
3087
|
'instrument_name': market['id'],
|
3082
3088
|
'start_timestamp': since - 1,
|
3083
|
-
'end_timestamp': time,
|
3084
3089
|
}
|
3090
|
+
until = self.safe_integer_2(params, 'until', 'end_timestamp')
|
3091
|
+
if until is not None:
|
3092
|
+
params = self.omit(params, ['until'])
|
3093
|
+
request['end_timestamp'] = until
|
3094
|
+
else:
|
3095
|
+
request['end_timestamp'] = time
|
3096
|
+
if 'isDeribitPaginationCall' in params:
|
3097
|
+
params = self.omit(params, 'isDeribitPaginationCall')
|
3098
|
+
maxUntil = self.sum(since, limit * duration)
|
3099
|
+
request['end_timestamp'] = min(request['end_timestamp'], maxUntil)
|
3085
3100
|
response = await self.publicGetGetFundingRateHistory(self.extend(request, params))
|
3086
3101
|
#
|
3087
3102
|
# {
|
ccxt/async_support/gate.py
CHANGED
@@ -1792,7 +1792,7 @@ class gate(Exchange, ImplicitAPI):
|
|
1792
1792
|
active = listed and tradeEnabled and withdrawEnabled and depositEnabled
|
1793
1793
|
if self.safe_value(result, code) is None:
|
1794
1794
|
result[code] = {
|
1795
|
-
'id':
|
1795
|
+
'id': currency,
|
1796
1796
|
'code': code,
|
1797
1797
|
'info': None,
|
1798
1798
|
'name': None,
|
ccxt/async_support/hollaex.py
CHANGED
@@ -1912,13 +1912,14 @@ class hollaex(Exchange, ImplicitAPI):
|
|
1912
1912
|
return {'url': url, 'method': method, 'body': body, 'headers': headers}
|
1913
1913
|
|
1914
1914
|
def handle_errors(self, code: int, reason: str, url: str, method: str, headers: dict, body: str, response, requestHeaders, requestBody):
|
1915
|
+
# {"message": "Invalid token"}
|
1915
1916
|
if response is None:
|
1916
1917
|
return None
|
1917
1918
|
if (code >= 400) and (code <= 503):
|
1918
1919
|
#
|
1919
1920
|
# {"message": "Invalid token"}
|
1920
1921
|
#
|
1921
|
-
# different errors return the same code eg
|
1922
|
+
# different errors return the same code eg
|
1922
1923
|
#
|
1923
1924
|
# {"message":"Error 1001 - Order rejected. Order could not be submitted order was set to a post only order."}
|
1924
1925
|
#
|
ccxt/async_support/htx.py
CHANGED
@@ -6992,10 +6992,12 @@ class htx(Exchange, ImplicitAPI):
|
|
6992
6992
|
'AccessKeyId': self.apiKey,
|
6993
6993
|
'Timestamp': timestamp,
|
6994
6994
|
}
|
6995
|
-
|
6996
|
-
request = self.extend(request, query)
|
6995
|
+
# sorting needs such flow exactly, before urlencoding(more at: https://github.com/ccxt/ccxt/issues/24930 )
|
6997
6996
|
request = self.keysort(request)
|
6998
|
-
|
6997
|
+
if method != 'POST':
|
6998
|
+
sortedQuery = self.keysort(query)
|
6999
|
+
request = self.extend(request, sortedQuery)
|
7000
|
+
auth = self.urlencode(request).replace('%2c', '%2C') # in c# it manually needs to be uppercased
|
6999
7001
|
# unfortunately, PHP demands double quotes for the escaped newline symbol
|
7000
7002
|
payload = "\n".join([method, hostname, url, auth]) # eslint-disable-line quotes
|
7001
7003
|
signature = self.hmac(self.encode(payload), self.encode(self.secret), hashlib.sha256, 'base64')
|
ccxt/async_support/kucoin.py
CHANGED
@@ -3101,14 +3101,14 @@ class kucoin(Exchange, ImplicitAPI):
|
|
3101
3101
|
if symbol is not None:
|
3102
3102
|
market = self.market(symbol)
|
3103
3103
|
request['symbol'] = market['id']
|
3104
|
-
if limit is not None:
|
3105
|
-
request['pageSize'] = limit
|
3106
3104
|
method = self.options['fetchMyTradesMethod']
|
3107
3105
|
parseResponseData = False
|
3108
3106
|
response = None
|
3109
3107
|
request, params = self.handle_until_option('endAt', request, params)
|
3110
3108
|
if hf:
|
3111
3109
|
# does not return trades earlier than 2019-02-18T00:00:00Z
|
3110
|
+
if limit is not None:
|
3111
|
+
request['limit'] = limit
|
3112
3112
|
if since is not None:
|
3113
3113
|
# only returns trades up to one week after the since param
|
3114
3114
|
request['startAt'] = since
|
ccxt/async_support/mexc.py
CHANGED
@@ -2235,7 +2235,7 @@ class mexc(Exchange, ImplicitAPI):
|
|
2235
2235
|
:param bool [params.postOnly]: if True, the order will only be posted if it will be a maker order
|
2236
2236
|
:param bool [params.reduceOnly]: *contract only* indicates if self order is to reduce the size of a position
|
2237
2237
|
:param bool [params.hedged]: *swap only* True for hedged mode, False for one way mode, default is False
|
2238
|
-
|
2238
|
+
:param str [params.timeInForce]: 'IOC' or 'FOK', default is 'GTC'
|
2239
2239
|
EXCHANGE SPECIFIC PARAMETERS
|
2240
2240
|
:param int [params.leverage]: *contract only* leverage is necessary on isolated margin
|
2241
2241
|
:param long [params.positionId]: *contract only* it is recommended to hasattr(self, fill) parameter when closing a position
|
@@ -2290,6 +2290,13 @@ class mexc(Exchange, ImplicitAPI):
|
|
2290
2290
|
postOnly, params = self.handle_post_only(type == 'market', type == 'LIMIT_MAKER', params)
|
2291
2291
|
if postOnly:
|
2292
2292
|
request['type'] = 'LIMIT_MAKER'
|
2293
|
+
tif = self.safe_string(params, 'timeInForce')
|
2294
|
+
if tif is not None:
|
2295
|
+
params = self.omit(params, 'timeInForce')
|
2296
|
+
if tif == 'IOC':
|
2297
|
+
request['type'] = 'IMMEDIATE_OR_CANCEL'
|
2298
|
+
elif tif == 'FOK':
|
2299
|
+
request['type'] = 'FILL_OR_KILL'
|
2293
2300
|
return self.extend(request, params)
|
2294
2301
|
|
2295
2302
|
async def create_spot_order(self, market, type, side, amount, price=None, marginMode=None, params={}):
|
@@ -5709,12 +5716,20 @@ class mexc(Exchange, ImplicitAPI):
|
|
5709
5716
|
url = self.urls['api'][section][access] + '/' + path
|
5710
5717
|
else:
|
5711
5718
|
url = self.urls['api'][section][access] + '/api/' + self.version + '/' + path
|
5712
|
-
|
5719
|
+
urlParams = params
|
5713
5720
|
if access == 'private':
|
5714
|
-
|
5715
|
-
|
5716
|
-
|
5717
|
-
|
5721
|
+
if section == 'broker' and ((method == 'POST') or (method == 'PUT') or (method == 'DELETE')):
|
5722
|
+
urlParams = {
|
5723
|
+
'timestamp': self.nonce(),
|
5724
|
+
'recvWindow': self.safe_integer(self.options, 'recvWindow', 5000),
|
5725
|
+
}
|
5726
|
+
body = self.json(params)
|
5727
|
+
else:
|
5728
|
+
urlParams['timestamp'] = self.nonce()
|
5729
|
+
urlParams['recvWindow'] = self.safe_integer(self.options, 'recvWindow', 5000)
|
5730
|
+
paramsEncoded = ''
|
5731
|
+
if urlParams:
|
5732
|
+
paramsEncoded = self.urlencode(urlParams)
|
5718
5733
|
url += '?' + paramsEncoded
|
5719
5734
|
if access == 'private':
|
5720
5735
|
self.check_required_credentials()
|
ccxt/async_support/onetrading.py
CHANGED
@@ -1200,7 +1200,7 @@ class onetrading(Exchange, ImplicitAPI):
|
|
1200
1200
|
https://docs.onetrading.com/#create-order
|
1201
1201
|
|
1202
1202
|
:param str symbol: unified symbol of the market to create an order in
|
1203
|
-
:param str type: '
|
1203
|
+
:param str type: 'limit'
|
1204
1204
|
:param str side: 'buy' or 'sell'
|
1205
1205
|
:param float amount: how much of currency you want to trade in units of base currency
|
1206
1206
|
:param float [price]: the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
ccxt/async_support/paradex.py
CHANGED
@@ -943,7 +943,7 @@ class paradex(Exchange, ImplicitAPI):
|
|
943
943
|
#
|
944
944
|
# {
|
945
945
|
# "symbol": "BTC-USD-PERP",
|
946
|
-
# "oracle_price": "68465.
|
946
|
+
# "oracle_price": "68465.17449904",
|
947
947
|
# "mark_price": "68465.17449906",
|
948
948
|
# "last_traded_price": "68495.1",
|
949
949
|
# "bid": "68477.6",
|
ccxt/async_support/probit.py
CHANGED
@@ -990,6 +990,7 @@ class probit(Exchange, ImplicitAPI):
|
|
990
990
|
:param int [since]: timestamp in ms of the earliest candle to fetch
|
991
991
|
:param int [limit]: the maximum amount of candles to fetch
|
992
992
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
993
|
+
:param str [params.until]: timestamp in ms of the earliest candle to fetch
|
993
994
|
:returns int[][]: A list of candles ordered, open, high, low, close, volume
|
994
995
|
"""
|
995
996
|
await self.load_markets()
|
@@ -1005,18 +1006,19 @@ class probit(Exchange, ImplicitAPI):
|
|
1005
1006
|
'limit': requestLimit, # max 1000
|
1006
1007
|
}
|
1007
1008
|
now = self.milliseconds()
|
1008
|
-
|
1009
|
+
until = self.safe_integer(params, 'until')
|
1010
|
+
durationMilliseconds = self.parse_timeframe(timeframe) * 1000
|
1009
1011
|
startTime = since
|
1010
|
-
endTime = now
|
1012
|
+
endTime = until - durationMilliseconds if (until is not None) else now
|
1011
1013
|
if since is None:
|
1012
1014
|
if limit is None:
|
1013
1015
|
limit = requestLimit
|
1014
|
-
|
1016
|
+
startLimit = limit - 1
|
1017
|
+
startTime = endTime - startLimit * durationMilliseconds
|
1015
1018
|
else:
|
1016
|
-
if limit is None:
|
1017
|
-
|
1018
|
-
|
1019
|
-
endTime = self.sum(since, self.sum(limit, 1) * duration * 1000)
|
1019
|
+
if limit is not None:
|
1020
|
+
endByLimit = self.sum(since, limit * durationMilliseconds)
|
1021
|
+
endTime = min(endTime, endByLimit)
|
1020
1022
|
startTimeNormalized = self.normalize_ohlcv_timestamp(startTime, timeframe)
|
1021
1023
|
endTimeNormalized = self.normalize_ohlcv_timestamp(endTime, timeframe, True)
|
1022
1024
|
request['start_time'] = startTimeNormalized
|
ccxt/async_support/vertex.py
CHANGED
@@ -330,6 +330,69 @@ class vertex(Exchange, ImplicitAPI):
|
|
330
330
|
'timeDifference': 0, # the difference between system clock and exchange server clock
|
331
331
|
'brokerId': 5930043274845996,
|
332
332
|
},
|
333
|
+
'features': {
|
334
|
+
'default': {
|
335
|
+
'sandbox': True,
|
336
|
+
'createOrder': {
|
337
|
+
'marginMode': False,
|
338
|
+
'triggerPrice': True, # todo
|
339
|
+
'triggerDirection': False,
|
340
|
+
'triggerPriceType': None,
|
341
|
+
'stopLossPrice': True, # todo
|
342
|
+
'takeProfitPrice': True, # todo
|
343
|
+
'attachedStopLossTakeProfit': None,
|
344
|
+
'timeInForce': {
|
345
|
+
'IOC': False,
|
346
|
+
'FOK': False,
|
347
|
+
'PO': True,
|
348
|
+
'GTD': True,
|
349
|
+
},
|
350
|
+
'hedged': False,
|
351
|
+
'trailing': False,
|
352
|
+
'leverage': False,
|
353
|
+
'marketBuyByCost': True, # todo
|
354
|
+
'marketBuyRequiresPrice': True, # todo fix implementation
|
355
|
+
'selfTradePrevention': False,
|
356
|
+
'iceberg': False,
|
357
|
+
},
|
358
|
+
'createOrders': None,
|
359
|
+
'fetchMyTrades': {
|
360
|
+
'marginMode': False,
|
361
|
+
'limit': 500,
|
362
|
+
'daysBack': 100000, # todo
|
363
|
+
'untilDays': None,
|
364
|
+
},
|
365
|
+
'fetchOrder': {
|
366
|
+
'marginMode': False,
|
367
|
+
'trigger': False,
|
368
|
+
'trailing': False,
|
369
|
+
},
|
370
|
+
'fetchOpenOrders': {
|
371
|
+
'marginMode': False,
|
372
|
+
'limit': 500,
|
373
|
+
'trigger': True,
|
374
|
+
'trailing': False,
|
375
|
+
},
|
376
|
+
'fetchOrders': None, # todo, only for trigger
|
377
|
+
'fetchClosedOrders': None, # todo through fetchOrders
|
378
|
+
'fetchOHLCV': {
|
379
|
+
'limit': 1000,
|
380
|
+
},
|
381
|
+
},
|
382
|
+
'spot': {
|
383
|
+
'extends': 'default',
|
384
|
+
},
|
385
|
+
'swap': {
|
386
|
+
'linear': {
|
387
|
+
'extends': 'default',
|
388
|
+
},
|
389
|
+
'inverse': None,
|
390
|
+
},
|
391
|
+
'future': {
|
392
|
+
'linear': None,
|
393
|
+
'inverse': None,
|
394
|
+
},
|
395
|
+
},
|
333
396
|
})
|
334
397
|
|
335
398
|
def set_sandbox_mode(self, enabled):
|
@@ -2104,7 +2167,7 @@ class vertex(Exchange, ImplicitAPI):
|
|
2104
2167
|
# "product_id": 1,
|
2105
2168
|
# "orders": [
|
2106
2169
|
# {
|
2107
|
-
# "product_id":
|
2170
|
+
# "product_id": 2,
|
2108
2171
|
# "sender": "0x7a5ec2748e9065794491a8d29dcf3f9edb8d7c43000000000000000000000000",
|
2109
2172
|
# "price_x18": "1000000000000000000",
|
2110
2173
|
# "amount": "1000000000000000000",
|
@@ -2113,7 +2176,7 @@ class vertex(Exchange, ImplicitAPI):
|
|
2113
2176
|
# "order_type": "default",
|
2114
2177
|
# "unfilled_amount": "1000000000000000000",
|
2115
2178
|
# "digest": "0x0000000000000000000000000000000000000000000000000000000000000000",
|
2116
|
-
# "placed_at":
|
2179
|
+
# "placed_at": 1682437737,
|
2117
2180
|
# "order_type": "ioc"
|
2118
2181
|
# }
|
2119
2182
|
# ]
|
@@ -358,6 +358,79 @@ class wavesexchange(Exchange, ImplicitAPI):
|
|
358
358
|
'BEP20': 'BSC',
|
359
359
|
},
|
360
360
|
},
|
361
|
+
'features': {
|
362
|
+
'spot': {
|
363
|
+
'sandbox': True,
|
364
|
+
'createOrder': {
|
365
|
+
'marginMode': False,
|
366
|
+
'triggerPrice': True, # todo
|
367
|
+
'triggerDirection': False,
|
368
|
+
'triggerPriceType': None,
|
369
|
+
'stopLossPrice': False, # todo
|
370
|
+
'takeProfitPrice': False, # todo
|
371
|
+
'attachedStopLossTakeProfit': None,
|
372
|
+
'timeInForce': {
|
373
|
+
'IOC': False,
|
374
|
+
'FOK': False,
|
375
|
+
'PO': False,
|
376
|
+
'GTD': True, # todo
|
377
|
+
},
|
378
|
+
'hedged': False,
|
379
|
+
'trailing': False,
|
380
|
+
'leverage': False,
|
381
|
+
'marketBuyByCost': False, # todo
|
382
|
+
'marketBuyRequiresPrice': True,
|
383
|
+
'selfTradePrevention': False,
|
384
|
+
'iceberg': False,
|
385
|
+
},
|
386
|
+
'createOrders': None,
|
387
|
+
'fetchMyTrades': {
|
388
|
+
'marginMode': False,
|
389
|
+
'limit': 100, # todo
|
390
|
+
'daysBack': 100000, # todo
|
391
|
+
'untilDays': 100000, # todo
|
392
|
+
},
|
393
|
+
'fetchOrder': {
|
394
|
+
'marginMode': False,
|
395
|
+
'trigger': False,
|
396
|
+
'trailing': False,
|
397
|
+
},
|
398
|
+
'fetchOpenOrders': {
|
399
|
+
'marginMode': False,
|
400
|
+
'limit': 100, # todo
|
401
|
+
'trigger': False,
|
402
|
+
'trailing': False,
|
403
|
+
},
|
404
|
+
'fetchOrders': {
|
405
|
+
'marginMode': False,
|
406
|
+
'limit': 100, # todo
|
407
|
+
'daysBack': None,
|
408
|
+
'untilDays': None,
|
409
|
+
'trigger': False,
|
410
|
+
'trailing': False,
|
411
|
+
}, # todo
|
412
|
+
'fetchClosedOrders': {
|
413
|
+
'marginMode': False,
|
414
|
+
'limit': 100,
|
415
|
+
'daysBack': 100000, # todo
|
416
|
+
'daysBackCanceled': 1, # todo
|
417
|
+
'untilDays': 100000, # todo
|
418
|
+
'trigger': False,
|
419
|
+
'trailing': False,
|
420
|
+
},
|
421
|
+
'fetchOHLCV': {
|
422
|
+
'limit': None, # todo
|
423
|
+
},
|
424
|
+
},
|
425
|
+
'swap': {
|
426
|
+
'linear': None,
|
427
|
+
'inverse': None,
|
428
|
+
},
|
429
|
+
'future': {
|
430
|
+
'linear': None,
|
431
|
+
'inverse': None,
|
432
|
+
},
|
433
|
+
},
|
361
434
|
'commonCurrencies': {
|
362
435
|
'EGG': 'Waves Ducks',
|
363
436
|
},
|