ccxt 4.5.0__py2.py3-none-any.whl → 4.5.2__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 -5
- ccxt/ascendex.py +1 -1
- ccxt/async_support/__init__.py +1 -5
- ccxt/async_support/ascendex.py +1 -1
- ccxt/async_support/base/exchange.py +1 -1
- ccxt/async_support/binance.py +17 -12
- ccxt/async_support/bitget.py +1 -1
- ccxt/async_support/coinbase.py +46 -34
- ccxt/async_support/gate.py +31 -17
- ccxt/async_support/gemini.py +1 -1
- ccxt/async_support/hibachi.py +1 -1
- ccxt/async_support/hyperliquid.py +13 -2
- ccxt/async_support/indodax.py +11 -12
- ccxt/async_support/kraken.py +1 -8
- ccxt/async_support/krakenfutures.py +25 -25
- ccxt/async_support/mexc.py +2 -1
- ccxt/async_support/okx.py +2 -2
- ccxt/async_support/poloniex.py +1 -1
- ccxt/async_support/timex.py +35 -0
- ccxt/async_support/tradeogre.py +32 -0
- ccxt/async_support/wavesexchange.py +33 -0
- ccxt/async_support/zonda.py +12 -0
- ccxt/base/exchange.py +7 -1
- ccxt/binance.py +17 -12
- ccxt/bitget.py +1 -1
- ccxt/coinbase.py +46 -34
- ccxt/gate.py +31 -17
- ccxt/gemini.py +1 -1
- ccxt/hibachi.py +1 -1
- ccxt/hyperliquid.py +13 -2
- ccxt/indodax.py +11 -12
- ccxt/kraken.py +1 -8
- ccxt/krakenfutures.py +25 -25
- ccxt/mexc.py +2 -1
- ccxt/okx.py +2 -2
- ccxt/poloniex.py +1 -1
- ccxt/pro/__init__.py +1 -3
- ccxt/pro/bitget.py +328 -75
- ccxt/pro/bitmart.py +1 -1
- ccxt/pro/bybit.py +8 -10
- ccxt/pro/gate.py +8 -1
- ccxt/pro/gemini.py +6 -2
- ccxt/pro/hyperliquid.py +6 -0
- ccxt/pro/kraken.py +4 -6
- ccxt/pro/lbank.py +56 -2
- ccxt/pro/mexc.py +1 -1
- ccxt/test/tests_async.py +2 -25
- ccxt/test/tests_sync.py +2 -25
- ccxt/timex.py +35 -0
- ccxt/tradeogre.py +32 -0
- ccxt/wavesexchange.py +33 -0
- ccxt/zonda.py +12 -0
- {ccxt-4.5.0.dist-info → ccxt-4.5.2.dist-info}/METADATA +111 -113
- {ccxt-4.5.0.dist-info → ccxt-4.5.2.dist-info}/RECORD +57 -64
- ccxt/abstract/ellipx.py +0 -25
- ccxt/abstract/vertex.py +0 -19
- ccxt/async_support/ellipx.py +0 -2029
- ccxt/async_support/vertex.py +0 -3050
- ccxt/ellipx.py +0 -2029
- ccxt/pro/vertex.py +0 -948
- ccxt/vertex.py +0 -3050
- {ccxt-4.5.0.dist-info → ccxt-4.5.2.dist-info}/LICENSE.txt +0 -0
- {ccxt-4.5.0.dist-info → ccxt-4.5.2.dist-info}/WHEEL +0 -0
- {ccxt-4.5.0.dist-info → ccxt-4.5.2.dist-info}/top_level.txt +0 -0
ccxt/binance.py
CHANGED
@@ -1308,6 +1308,7 @@ class binance(Exchange, ImplicitAPI):
|
|
1308
1308
|
'defaultSubType': None, # 'linear', 'inverse'
|
1309
1309
|
'hasAlreadyAuthenticatedSuccessfully': False,
|
1310
1310
|
'warnOnFetchOpenOrdersWithoutSymbol': True,
|
1311
|
+
'currencyToPrecisionRoundingMode': TRUNCATE,
|
1311
1312
|
# not an error
|
1312
1313
|
# https://github.com/ccxt/ccxt/issues/11268
|
1313
1314
|
# https://github.com/ccxt/ccxt/pull/11624
|
@@ -2752,13 +2753,6 @@ class binance(Exchange, ImplicitAPI):
|
|
2752
2753
|
def cost_to_precision(self, symbol, cost):
|
2753
2754
|
return self.decimal_to_precision(cost, TRUNCATE, self.markets[symbol]['precision']['quote'], self.precisionMode, self.paddingMode)
|
2754
2755
|
|
2755
|
-
def currency_to_precision(self, code, fee, networkCode=None):
|
2756
|
-
# info is available in currencies only if the user has configured his api keys
|
2757
|
-
if self.safe_value(self.currencies[code], 'precision') is not None:
|
2758
|
-
return self.decimal_to_precision(fee, TRUNCATE, self.currencies[code]['precision'], self.precisionMode, self.paddingMode)
|
2759
|
-
else:
|
2760
|
-
return self.number_to_string(fee)
|
2761
|
-
|
2762
2756
|
def nonce(self):
|
2763
2757
|
return self.milliseconds() - self.options['timeDifference']
|
2764
2758
|
|
@@ -7365,6 +7359,7 @@ class binance(Exchange, ImplicitAPI):
|
|
7365
7359
|
:param str[] ids: order ids
|
7366
7360
|
:param str [symbol]: unified market symbol
|
7367
7361
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
7362
|
+
:param str[] [params.clientOrderIds]: alternative to ids, array of client order ids
|
7368
7363
|
|
7369
7364
|
EXCHANGE SPECIFIC PARAMETERS
|
7370
7365
|
:param str[] [params.origClientOrderIdList]: max length 10 e.g. ["my_id_1","my_id_2"], encode the double quotes. No space after comma
|
@@ -7379,8 +7374,14 @@ class binance(Exchange, ImplicitAPI):
|
|
7379
7374
|
raise BadRequest(self.id + ' cancelOrders is only supported for swap markets.')
|
7380
7375
|
request: dict = {
|
7381
7376
|
'symbol': market['id'],
|
7382
|
-
'orderidlist': ids,
|
7377
|
+
# 'orderidlist': ids,
|
7383
7378
|
}
|
7379
|
+
origClientOrderIdList = self.safe_list_2(params, 'origClientOrderIdList', 'clientOrderIds')
|
7380
|
+
if origClientOrderIdList is not None:
|
7381
|
+
params = self.omit(params, ['clientOrderIds'])
|
7382
|
+
request['origClientOrderIdList'] = origClientOrderIdList
|
7383
|
+
else:
|
7384
|
+
request['orderidlist'] = ids
|
7384
7385
|
response = None
|
7385
7386
|
if market['linear']:
|
7386
7387
|
response = self.fapiPrivateDeleteBatchOrders(self.extend(request, params))
|
@@ -8863,7 +8864,6 @@ class binance(Exchange, ImplicitAPI):
|
|
8863
8864
|
request: dict = {
|
8864
8865
|
'coin': currency['id'],
|
8865
8866
|
'address': address,
|
8866
|
-
'amount': self.currency_to_precision(code, amount),
|
8867
8867
|
# issue sapiGetCapitalConfigGetall() to get networks for withdrawing USDT ERC20 vs USDT Omni
|
8868
8868
|
# 'network': 'ETH', # 'BTC', 'TRX', etc, optional
|
8869
8869
|
}
|
@@ -8875,6 +8875,7 @@ class binance(Exchange, ImplicitAPI):
|
|
8875
8875
|
if network is not None:
|
8876
8876
|
request['network'] = network
|
8877
8877
|
params = self.omit(params, 'network')
|
8878
|
+
request['amount'] = self.currency_to_precision(code, amount, network)
|
8878
8879
|
response = self.sapiPostCapitalWithdrawApply(self.extend(request, params))
|
8879
8880
|
# {id: '9a67628b16ba4988ae20d329333f16bc'}
|
8880
8881
|
return self.parse_transaction(response, currency)
|
@@ -11252,15 +11253,19 @@ class binance(Exchange, ImplicitAPI):
|
|
11252
11253
|
elif (path == 'batchOrders') or (path.find('sub-account') >= 0) or (path == 'capital/withdraw/apply') or (path.find('staking') >= 0) or (path.find('simple-earn') >= 0):
|
11253
11254
|
if (method == 'DELETE') and (path == 'batchOrders'):
|
11254
11255
|
orderidlist = self.safe_list(extendedParams, 'orderidlist', [])
|
11255
|
-
origclientorderidlist = self.
|
11256
|
-
extendedParams = self.omit(extendedParams, ['orderidlist', 'origclientorderidlist'])
|
11256
|
+
origclientorderidlist = self.safe_list_2(extendedParams, 'origclientorderidlist', 'origClientOrderIdList', [])
|
11257
|
+
extendedParams = self.omit(extendedParams, ['orderidlist', 'origclientorderidlist', 'origClientOrderIdList'])
|
11257
11258
|
query = self.rawencode(extendedParams)
|
11258
11259
|
orderidlistLength = len(orderidlist)
|
11259
11260
|
origclientorderidlistLength = len(origclientorderidlist)
|
11260
11261
|
if orderidlistLength > 0:
|
11261
11262
|
query = query + '&' + 'orderidlist=%5B' + '%2C'.join(orderidlist) + '%5D'
|
11262
11263
|
if origclientorderidlistLength > 0:
|
11263
|
-
|
11264
|
+
# wrap clientOrderids around ""
|
11265
|
+
newClientOrderIds = []
|
11266
|
+
for i in range(0, origclientorderidlistLength):
|
11267
|
+
newClientOrderIds.append('%22' + origclientorderidlist[i] + '%22')
|
11268
|
+
query = query + '&' + 'origclientorderidlist=%5B' + '%2C'.join(newClientOrderIds) + '%5D'
|
11264
11269
|
else:
|
11265
11270
|
query = self.rawencode(extendedParams)
|
11266
11271
|
else:
|
ccxt/bitget.py
CHANGED
@@ -1916,7 +1916,7 @@ class bitget(Exchange, ImplicitAPI):
|
|
1916
1916
|
res = self.safe_dict(results, i)
|
1917
1917
|
data = self.safe_list(res, 'data', [])
|
1918
1918
|
firstData = self.safe_dict(data, 0, {})
|
1919
|
-
isBorrowable = self.
|
1919
|
+
isBorrowable = self.safe_bool(firstData, 'isBorrowable')
|
1920
1920
|
if fetchMargins and isBorrowable is not None:
|
1921
1921
|
keysList = list(self.index_by(data, 'symbol').keys())
|
1922
1922
|
self.options['crossMarginPairsData'] = keysList
|
ccxt/coinbase.py
CHANGED
@@ -2192,34 +2192,44 @@ class coinbase(Exchange, ImplicitAPI):
|
|
2192
2192
|
# fetchTickersV3
|
2193
2193
|
#
|
2194
2194
|
# [
|
2195
|
-
#
|
2196
|
-
#
|
2197
|
-
#
|
2198
|
-
#
|
2199
|
-
#
|
2200
|
-
#
|
2201
|
-
#
|
2202
|
-
#
|
2203
|
-
#
|
2204
|
-
#
|
2205
|
-
#
|
2206
|
-
#
|
2207
|
-
#
|
2208
|
-
#
|
2209
|
-
#
|
2210
|
-
#
|
2211
|
-
#
|
2212
|
-
#
|
2213
|
-
#
|
2214
|
-
#
|
2215
|
-
#
|
2216
|
-
#
|
2217
|
-
#
|
2218
|
-
#
|
2219
|
-
#
|
2220
|
-
#
|
2221
|
-
#
|
2222
|
-
#
|
2195
|
+
# {
|
2196
|
+
# "product_id": "ETH-USD",
|
2197
|
+
# "price": "4471.59",
|
2198
|
+
# "price_percentage_change_24h": "0.14243387238731",
|
2199
|
+
# "volume_24h": "87329.92990204",
|
2200
|
+
# "volume_percentage_change_24h": "-60.7789801794578",
|
2201
|
+
# "base_increment": "0.00000001",
|
2202
|
+
# "quote_increment": "0.01",
|
2203
|
+
# "quote_min_size": "1",
|
2204
|
+
# "quote_max_size": "150000000",
|
2205
|
+
# "base_min_size": "0.00000001",
|
2206
|
+
# "base_max_size": "42000",
|
2207
|
+
# "base_name": "Ethereum",
|
2208
|
+
# "quote_name": "US Dollar",
|
2209
|
+
# "watched": False,
|
2210
|
+
# "is_disabled": False,
|
2211
|
+
# "new": False,
|
2212
|
+
# "status": "online",
|
2213
|
+
# "cancel_only": False,
|
2214
|
+
# "limit_only": False,
|
2215
|
+
# "post_only": False,
|
2216
|
+
# "trading_disabled": False,
|
2217
|
+
# "auction_mode": False,
|
2218
|
+
# "product_type": "SPOT",
|
2219
|
+
# "quote_currency_id": "USD",
|
2220
|
+
# "base_currency_id": "ETH",
|
2221
|
+
# "fcm_trading_session_details": null,
|
2222
|
+
# "mid_market_price": "",
|
2223
|
+
# "alias": "",
|
2224
|
+
# "alias_to": ["ETH-USDC"],
|
2225
|
+
# "base_display_symbol": "ETH",
|
2226
|
+
# "quote_display_symbol": "USD",
|
2227
|
+
# "view_only": False,
|
2228
|
+
# "price_increment": "0.01",
|
2229
|
+
# "display_name": "ETH-USD",
|
2230
|
+
# "product_venue": "CBE",
|
2231
|
+
# "approximate_quote_24h_volume": "390503641.25",
|
2232
|
+
# "new_at": "2023-01-01T00:00:00Z"
|
2223
2233
|
# },
|
2224
2234
|
# ...
|
2225
2235
|
# ]
|
@@ -2250,10 +2260,12 @@ class coinbase(Exchange, ImplicitAPI):
|
|
2250
2260
|
if ('bids' in ticker):
|
2251
2261
|
bids = self.safe_list(ticker, 'bids', [])
|
2252
2262
|
asks = self.safe_list(ticker, 'asks', [])
|
2253
|
-
|
2254
|
-
|
2255
|
-
|
2256
|
-
|
2263
|
+
firstBid = self.safe_dict(bids, 0, {})
|
2264
|
+
firstAsk = self.safe_dict(asks, 0, {})
|
2265
|
+
bid = self.safe_number(firstBid, 'price')
|
2266
|
+
bidVolume = self.safe_number(firstBid, 'size')
|
2267
|
+
ask = self.safe_number(firstAsk, 'price')
|
2268
|
+
askVolume = self.safe_number(firstAsk, 'size')
|
2257
2269
|
marketId = self.safe_string(ticker, 'product_id')
|
2258
2270
|
market = self.safe_market(marketId, market)
|
2259
2271
|
last = self.safe_number(ticker, 'price')
|
@@ -2276,8 +2288,8 @@ class coinbase(Exchange, ImplicitAPI):
|
|
2276
2288
|
'change': None,
|
2277
2289
|
'percentage': self.safe_number(ticker, 'price_percentage_change_24h'),
|
2278
2290
|
'average': None,
|
2279
|
-
'baseVolume':
|
2280
|
-
'quoteVolume':
|
2291
|
+
'baseVolume': self.safe_number(ticker, 'volume_24h'),
|
2292
|
+
'quoteVolume': self.safe_number(ticker, 'approximate_quote_24h_volume'),
|
2281
2293
|
'info': ticker,
|
2282
2294
|
}, market)
|
2283
2295
|
|
ccxt/gate.py
CHANGED
@@ -764,6 +764,9 @@ class gate(Exchange, ImplicitAPI):
|
|
764
764
|
'option': 'options',
|
765
765
|
'options': 'options',
|
766
766
|
},
|
767
|
+
'fetchMarkets': {
|
768
|
+
'types': ['spot', 'swap', 'future', 'option'],
|
769
|
+
},
|
767
770
|
'swap': {
|
768
771
|
'fetchMarkets': {
|
769
772
|
'settlementCurrencies': ['usdt', 'btc'],
|
@@ -1233,21 +1236,24 @@ class gate(Exchange, ImplicitAPI):
|
|
1233
1236
|
self.load_time_difference()
|
1234
1237
|
if self.check_required_credentials(False):
|
1235
1238
|
self.load_unified_status()
|
1239
|
+
rawPromises = []
|
1236
1240
|
sandboxMode = self.safe_bool(self.options, 'sandboxMode', False)
|
1237
|
-
|
1238
|
-
|
1239
|
-
|
1240
|
-
|
1241
|
-
|
1242
|
-
|
1243
|
-
|
1244
|
-
|
1245
|
-
|
1246
|
-
|
1247
|
-
|
1248
|
-
|
1249
|
-
|
1250
|
-
|
1241
|
+
fetchMarketsOptions = self.safe_dict(self.options, 'fetchMarkets')
|
1242
|
+
types = self.safe_list(fetchMarketsOptions, 'types', ['spot', 'swap', 'future', 'option'])
|
1243
|
+
for i in range(0, len(types)):
|
1244
|
+
marketType = types[i]
|
1245
|
+
if marketType == 'spot':
|
1246
|
+
if not sandboxMode:
|
1247
|
+
# gate doesn't have a sandbox for spot markets
|
1248
|
+
rawPromises.append(self.fetch_spot_markets(params))
|
1249
|
+
elif marketType == 'swap':
|
1250
|
+
rawPromises.append(self.fetch_swap_markets(params))
|
1251
|
+
elif marketType == 'future':
|
1252
|
+
rawPromises.append(self.fetch_future_markets(params))
|
1253
|
+
elif marketType == 'option':
|
1254
|
+
rawPromises.append(self.fetch_option_markets(params))
|
1255
|
+
results = rawPromises
|
1256
|
+
return self.arrays_concat(results)
|
1251
1257
|
|
1252
1258
|
def fetch_spot_markets(self, params={}):
|
1253
1259
|
marginPromise = self.publicMarginGetCurrencyPairs(params)
|
@@ -1362,10 +1368,9 @@ class gate(Exchange, ImplicitAPI):
|
|
1362
1368
|
})
|
1363
1369
|
return result
|
1364
1370
|
|
1365
|
-
def
|
1371
|
+
def fetch_swap_markets(self, params={}):
|
1366
1372
|
result = []
|
1367
1373
|
swapSettlementCurrencies = self.get_settlement_currencies('swap', 'fetchMarkets')
|
1368
|
-
futureSettlementCurrencies = self.get_settlement_currencies('future', 'fetchMarkets')
|
1369
1374
|
for c in range(0, len(swapSettlementCurrencies)):
|
1370
1375
|
settleId = swapSettlementCurrencies[c]
|
1371
1376
|
request: dict = {
|
@@ -1375,6 +1380,11 @@ class gate(Exchange, ImplicitAPI):
|
|
1375
1380
|
for i in range(0, len(response)):
|
1376
1381
|
parsedMarket = self.parse_contract_market(response[i], settleId)
|
1377
1382
|
result.append(parsedMarket)
|
1383
|
+
return result
|
1384
|
+
|
1385
|
+
def fetch_future_markets(self, params={}):
|
1386
|
+
result = []
|
1387
|
+
futureSettlementCurrencies = self.get_settlement_currencies('future', 'fetchMarkets')
|
1378
1388
|
for c in range(0, len(futureSettlementCurrencies)):
|
1379
1389
|
settleId = futureSettlementCurrencies[c]
|
1380
1390
|
request: dict = {
|
@@ -2542,7 +2552,11 @@ class gate(Exchange, ImplicitAPI):
|
|
2542
2552
|
#
|
2543
2553
|
request, query = self.prepare_request(market, market['type'], params)
|
2544
2554
|
if limit is not None:
|
2545
|
-
|
2555
|
+
if market['spot']:
|
2556
|
+
limit = min(limit, 1000)
|
2557
|
+
else:
|
2558
|
+
limit = min(limit, 300)
|
2559
|
+
request['limit'] = limit
|
2546
2560
|
request['with_id'] = True
|
2547
2561
|
response = None
|
2548
2562
|
if market['spot'] or market['margin']:
|
ccxt/gemini.py
CHANGED
@@ -275,7 +275,7 @@ class gemini(Exchange, ImplicitAPI):
|
|
275
275
|
'fetchMarketFromWebRetries': 10,
|
276
276
|
'fetchMarketsFromAPI': {
|
277
277
|
'fetchDetailsForAllSymbols': False,
|
278
|
-
'quoteCurrencies': ['USDT', 'GUSD', 'USD', 'DAI', 'EUR', 'GBP', 'SGD', 'BTC', 'ETH', 'LTC', 'BCH', 'SOL'],
|
278
|
+
'quoteCurrencies': ['USDT', 'GUSD', 'USD', 'DAI', 'EUR', 'GBP', 'SGD', 'BTC', 'ETH', 'LTC', 'BCH', 'SOL', 'USDC'],
|
279
279
|
},
|
280
280
|
'fetchMarkets': {
|
281
281
|
'webApiEnable': True, # fetches from WEB
|
ccxt/hibachi.py
CHANGED
@@ -1561,7 +1561,7 @@ class hibachi(Exchange, ImplicitAPI):
|
|
1561
1561
|
def sign(self, path, api='public', method='GET', params={}, headers=None, body=None):
|
1562
1562
|
endpoint = '/' + self.implode_params(path, params)
|
1563
1563
|
url = self.urls['api'][api] + endpoint
|
1564
|
-
headers = {}
|
1564
|
+
headers = {'Hibachi-Client': 'HibachiCCXT/unversioned'}
|
1565
1565
|
if method == 'GET':
|
1566
1566
|
request = self.omit(params, self.extract_params(path))
|
1567
1567
|
query = self.urlencode(request)
|
ccxt/hyperliquid.py
CHANGED
@@ -2283,6 +2283,7 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
2283
2283
|
:param str id: order id
|
2284
2284
|
:param str symbol: unified symbol of the market the order was made in
|
2285
2285
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
2286
|
+
:param str [params.clientOrderId]: client order id,(optional 128 bit hex string e.g. 0x1234567890abcdef1234567890abcdef)
|
2286
2287
|
:param str [params.user]: user address, will default to self.walletAddress if not provided
|
2287
2288
|
:param str [params.subAccountAddress]: sub account user address
|
2288
2289
|
:returns dict: An `order structure <https://docs.ccxt.com/#/?id=order-structure>`
|
@@ -2291,12 +2292,18 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
2291
2292
|
userAddress, params = self.handle_public_address('fetchOrder', params)
|
2292
2293
|
self.load_markets()
|
2293
2294
|
market = self.safe_market(symbol)
|
2294
|
-
|
2295
|
+
clientOrderId = self.safe_string(params, 'clientOrderId')
|
2295
2296
|
request: dict = {
|
2296
2297
|
'type': 'orderStatus',
|
2297
|
-
'oid': id if isClientOrderId else self.parse_to_numeric(id),
|
2298
|
+
# 'oid': id if isClientOrderId else self.parse_to_numeric(id),
|
2298
2299
|
'user': userAddress,
|
2299
2300
|
}
|
2301
|
+
if clientOrderId is not None:
|
2302
|
+
params = self.omit(params, 'clientOrderId')
|
2303
|
+
request['oid'] = clientOrderId
|
2304
|
+
else:
|
2305
|
+
isClientOrderId = len(id) >= 34
|
2306
|
+
request['oid'] = id if isClientOrderId else self.parse_to_numeric(id)
|
2300
2307
|
response = self.publicPostInfo(self.extend(request, params))
|
2301
2308
|
#
|
2302
2309
|
# {
|
@@ -3668,11 +3675,15 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
3668
3675
|
# }
|
3669
3676
|
# {"status":"ok","response":{"type":"order","data":{"statuses":[{"error":"Insufficient margin to place order. asset=84"}]}}}
|
3670
3677
|
#
|
3678
|
+
# {"status":"unknownOid"}
|
3679
|
+
#
|
3671
3680
|
status = self.safe_string(response, 'status', '')
|
3672
3681
|
error = self.safe_string(response, 'error')
|
3673
3682
|
message = None
|
3674
3683
|
if status == 'err':
|
3675
3684
|
message = self.safe_string(response, 'response')
|
3685
|
+
elif status == 'unknownOid':
|
3686
|
+
raise OrderNotFound(self.id + ' ' + body) # {"status":"unknownOid"}
|
3676
3687
|
elif error is not None:
|
3677
3688
|
message = error
|
3678
3689
|
else:
|
ccxt/indodax.py
CHANGED
@@ -204,6 +204,16 @@ class indodax(Exchange, ImplicitAPI):
|
|
204
204
|
'Minimum order': InvalidOrder,
|
205
205
|
},
|
206
206
|
},
|
207
|
+
'timeframes': {
|
208
|
+
'1m': '1',
|
209
|
+
'15m': '15',
|
210
|
+
'30m': '30',
|
211
|
+
'1h': '60',
|
212
|
+
'4h': '240',
|
213
|
+
'1d': '1D',
|
214
|
+
'3d': '3D',
|
215
|
+
'1w': '1W',
|
216
|
+
},
|
207
217
|
# exchange-specific options
|
208
218
|
'options': {
|
209
219
|
'recvWindow': 5 * 1000, # default 5 sec
|
@@ -227,16 +237,6 @@ class indodax(Exchange, ImplicitAPI):
|
|
227
237
|
# 'ETH': 'eth'
|
228
238
|
# 'BASE': 'base'
|
229
239
|
},
|
230
|
-
'timeframes': {
|
231
|
-
'1m': '1',
|
232
|
-
'15m': '15',
|
233
|
-
'30m': '30',
|
234
|
-
'1h': '60',
|
235
|
-
'4h': '240',
|
236
|
-
'1d': '1D',
|
237
|
-
'3d': '3D',
|
238
|
-
'1w': '1W',
|
239
|
-
},
|
240
240
|
},
|
241
241
|
'features': {
|
242
242
|
'spot': {
|
@@ -690,8 +690,7 @@ class indodax(Exchange, ImplicitAPI):
|
|
690
690
|
"""
|
691
691
|
self.load_markets()
|
692
692
|
market = self.market(symbol)
|
693
|
-
|
694
|
-
selectedTimeframe = self.safe_string(timeframes, timeframe, timeframe)
|
693
|
+
selectedTimeframe = self.safe_string(self.timeframes, timeframe, timeframe)
|
695
694
|
now = self.seconds()
|
696
695
|
until = self.safe_integer(params, 'until', now)
|
697
696
|
params = self.omit(params, ['until'])
|
ccxt/kraken.py
CHANGED
@@ -251,6 +251,7 @@ class kraken(Exchange, ImplicitAPI):
|
|
251
251
|
'UST': 'USTC',
|
252
252
|
'XBT': 'BTC',
|
253
253
|
'XDG': 'DOGE',
|
254
|
+
'FEE': 'KFEE',
|
254
255
|
},
|
255
256
|
'options': {
|
256
257
|
'timeDifference': 0, # the difference between system clock and Binance clock
|
@@ -715,14 +716,6 @@ class kraken(Exchange, ImplicitAPI):
|
|
715
716
|
self.options['marketsByAltname'] = self.index_by(result, 'altname')
|
716
717
|
return result
|
717
718
|
|
718
|
-
def safe_currency(self, currencyId, currency: Currency = None):
|
719
|
-
if currencyId is not None:
|
720
|
-
if len(currencyId) > 3:
|
721
|
-
if (currencyId.find('X') == 0) or (currencyId.find('Z') == 0):
|
722
|
-
if not (currencyId.find('.') > 0) and (currencyId != 'ZEUS'):
|
723
|
-
currencyId = currencyId[1:]
|
724
|
-
return super(kraken, self).safe_currency(currencyId, currency)
|
725
|
-
|
726
719
|
def fetch_status(self, params={}):
|
727
720
|
"""
|
728
721
|
the latest known information on the availability of the exchange API
|
ccxt/krakenfutures.py
CHANGED
@@ -115,7 +115,7 @@ class krakenfutures(Exchange, ImplicitAPI):
|
|
115
115
|
},
|
116
116
|
'www': 'https://futures.kraken.com/',
|
117
117
|
'doc': [
|
118
|
-
'https://docs.
|
118
|
+
'https://docs.kraken.com/api/docs/futures-api/trading/market-data/',
|
119
119
|
],
|
120
120
|
'fees': 'https://support.kraken.com/hc/en-us/articles/360022835771-Transaction-fees-and-rebates-for-Kraken-Futures',
|
121
121
|
'referral': None,
|
@@ -378,7 +378,7 @@ class krakenfutures(Exchange, ImplicitAPI):
|
|
378
378
|
"""
|
379
379
|
Fetches the available trading markets from the exchange, Multi-collateral markets are returned markets, but can be settled in multiple currencies
|
380
380
|
|
381
|
-
https://docs.
|
381
|
+
https://docs.kraken.com/api/docs/futures-api/trading/get-instruments
|
382
382
|
|
383
383
|
:param dict [params]: exchange specific params
|
384
384
|
:returns: An array of market structures
|
@@ -545,7 +545,7 @@ class krakenfutures(Exchange, ImplicitAPI):
|
|
545
545
|
def fetch_order_book(self, symbol: str, limit: Int = None, params={}) -> OrderBook:
|
546
546
|
"""
|
547
547
|
|
548
|
-
https://docs.
|
548
|
+
https://docs.kraken.com/api/docs/futures-api/trading/get-orderbook
|
549
549
|
|
550
550
|
Fetches a list of open orders in a market
|
551
551
|
:param str symbol: Unified market symbol
|
@@ -596,7 +596,7 @@ class krakenfutures(Exchange, ImplicitAPI):
|
|
596
596
|
"""
|
597
597
|
fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
|
598
598
|
|
599
|
-
https://docs.
|
599
|
+
https://docs.kraken.com/api/docs/futures-api/trading/get-tickers
|
600
600
|
|
601
601
|
:param str[] symbols: unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
|
602
602
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
@@ -712,7 +712,7 @@ class krakenfutures(Exchange, ImplicitAPI):
|
|
712
712
|
def fetch_ohlcv(self, symbol: str, timeframe='1m', since: Int = None, limit: Int = None, params={}) -> List[list]:
|
713
713
|
"""
|
714
714
|
|
715
|
-
https://docs.
|
715
|
+
https://docs.kraken.com/api/docs/futures-api/charts/candles
|
716
716
|
|
717
717
|
fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
|
718
718
|
:param str symbol: unified symbol of the market to fetch OHLCV data for
|
@@ -791,8 +791,8 @@ class krakenfutures(Exchange, ImplicitAPI):
|
|
791
791
|
def fetch_trades(self, symbol: str, since: Int = None, limit: Int = None, params={}) -> List[Trade]:
|
792
792
|
"""
|
793
793
|
|
794
|
-
https://docs.
|
795
|
-
https://docs.
|
794
|
+
https://docs.kraken.com/api/docs/futures-api/trading/get-history
|
795
|
+
https://docs.kraken.com/api/docs/futures-api/history/get-public-execution-events
|
796
796
|
|
797
797
|
Fetch a history of filled trades that self account has made
|
798
798
|
:param str symbol: Unified CCXT market symbol
|
@@ -1205,7 +1205,7 @@ class krakenfutures(Exchange, ImplicitAPI):
|
|
1205
1205
|
def edit_order(self, id: str, symbol: str, type: OrderType, side: OrderSide, amount: Num = None, price: Num = None, params={}):
|
1206
1206
|
"""
|
1207
1207
|
|
1208
|
-
https://docs.
|
1208
|
+
https://docs.kraken.com/api/docs/futures-api/trading/edit-order-spring
|
1209
1209
|
|
1210
1210
|
Edit an open order on the exchange
|
1211
1211
|
:param str id: order id
|
@@ -1235,7 +1235,7 @@ class krakenfutures(Exchange, ImplicitAPI):
|
|
1235
1235
|
def cancel_order(self, id: str, symbol: Str = None, params={}):
|
1236
1236
|
"""
|
1237
1237
|
|
1238
|
-
https://docs.
|
1238
|
+
https://docs.kraken.com/api/docs/futures-api/trading/cancel-order
|
1239
1239
|
|
1240
1240
|
Cancel an open order on the exchange
|
1241
1241
|
:param str id: Order id
|
@@ -1256,7 +1256,7 @@ class krakenfutures(Exchange, ImplicitAPI):
|
|
1256
1256
|
"""
|
1257
1257
|
cancel multiple orders
|
1258
1258
|
|
1259
|
-
https://docs.
|
1259
|
+
https://docs.kraken.com/api/docs/futures-api/trading/send-batch-order
|
1260
1260
|
|
1261
1261
|
:param str[] ids: order ids
|
1262
1262
|
:param str [symbol]: unified market symbol
|
@@ -1315,7 +1315,7 @@ class krakenfutures(Exchange, ImplicitAPI):
|
|
1315
1315
|
def cancel_all_orders(self, symbol: Str = None, params={}):
|
1316
1316
|
"""
|
1317
1317
|
|
1318
|
-
https://docs.
|
1318
|
+
https://docs.kraken.com/api/docs/futures-api/trading/cancel-all-orders
|
1319
1319
|
|
1320
1320
|
Cancels all orders on the exchange, including trigger orders
|
1321
1321
|
:param str symbol: Unified market symbol
|
@@ -1370,7 +1370,7 @@ class krakenfutures(Exchange, ImplicitAPI):
|
|
1370
1370
|
"""
|
1371
1371
|
dead man's switch, cancel all orders after the given timeout
|
1372
1372
|
|
1373
|
-
https://docs.
|
1373
|
+
https://docs.kraken.com/api/docs/futures-api/trading/cancel-all-orders-after
|
1374
1374
|
|
1375
1375
|
:param number timeout: time in milliseconds, 0 represents cancel the timer
|
1376
1376
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
@@ -1396,7 +1396,7 @@ class krakenfutures(Exchange, ImplicitAPI):
|
|
1396
1396
|
def fetch_open_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
|
1397
1397
|
"""
|
1398
1398
|
|
1399
|
-
https://docs.
|
1399
|
+
https://docs.kraken.com/api/docs/futures-api/trading/get-open-orders
|
1400
1400
|
|
1401
1401
|
Gets all open orders, including trigger orders, for an account from the exchange api
|
1402
1402
|
:param str symbol: Unified market symbol
|
@@ -1452,7 +1452,7 @@ class krakenfutures(Exchange, ImplicitAPI):
|
|
1452
1452
|
def fetch_canceled_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
|
1453
1453
|
"""
|
1454
1454
|
|
1455
|
-
https://docs.
|
1455
|
+
https://docs.kraken.com/api/docs/futures-api/history/get-order-events
|
1456
1456
|
|
1457
1457
|
Gets all canceled orders, including trigger orders, for an account from the exchange api
|
1458
1458
|
:param str symbol: Unified market symbol
|
@@ -1905,7 +1905,7 @@ class krakenfutures(Exchange, ImplicitAPI):
|
|
1905
1905
|
"""
|
1906
1906
|
fetch all trades made by the user
|
1907
1907
|
|
1908
|
-
https://docs.
|
1908
|
+
https://docs.kraken.com/api/docs/futures-api/trading/get-fills
|
1909
1909
|
|
1910
1910
|
:param str symbol: unified market symbol
|
1911
1911
|
:param int [since]: *not used by the api* the earliest time in ms to fetch trades for
|
@@ -1945,7 +1945,7 @@ class krakenfutures(Exchange, ImplicitAPI):
|
|
1945
1945
|
def fetch_balance(self, params={}) -> Balances:
|
1946
1946
|
"""
|
1947
1947
|
|
1948
|
-
https://docs.
|
1948
|
+
https://docs.kraken.com/api/docs/futures-api/trading/get-accounts
|
1949
1949
|
|
1950
1950
|
Fetch the balance for a sub-account, all sub-account balances are inside 'info' in the response
|
1951
1951
|
:param dict [params]: Exchange specific parameters
|
@@ -2160,7 +2160,7 @@ class krakenfutures(Exchange, ImplicitAPI):
|
|
2160
2160
|
"""
|
2161
2161
|
fetch the current funding rates for multiple markets
|
2162
2162
|
|
2163
|
-
https://docs.
|
2163
|
+
https://docs.kraken.com/api/docs/futures-api/trading/get-tickers
|
2164
2164
|
|
2165
2165
|
:param str[] symbols: unified market symbols
|
2166
2166
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
@@ -2243,7 +2243,7 @@ class krakenfutures(Exchange, ImplicitAPI):
|
|
2243
2243
|
"""
|
2244
2244
|
fetches historical funding rate prices
|
2245
2245
|
|
2246
|
-
https://docs.
|
2246
|
+
https://docs.kraken.com/api/docs/futures-api/trading/historical-funding-rates
|
2247
2247
|
|
2248
2248
|
:param str symbol: unified symbol of the market to fetch the funding rate history for
|
2249
2249
|
:param int [since]: timestamp in ms of the earliest funding rate to fetch
|
@@ -2291,7 +2291,7 @@ class krakenfutures(Exchange, ImplicitAPI):
|
|
2291
2291
|
def fetch_positions(self, symbols: Strings = None, params={}) -> List[Position]:
|
2292
2292
|
"""
|
2293
2293
|
|
2294
|
-
https://docs.
|
2294
|
+
https://docs.kraken.com/api/docs/futures-api/trading/get-open-positions
|
2295
2295
|
|
2296
2296
|
Fetches current contract trading positions
|
2297
2297
|
:param str[] symbols: List of unified symbols
|
@@ -2386,7 +2386,7 @@ class krakenfutures(Exchange, ImplicitAPI):
|
|
2386
2386
|
"""
|
2387
2387
|
retrieve information on the maximum leverage, and maintenance margin for trades of varying trade sizes
|
2388
2388
|
|
2389
|
-
https://docs.
|
2389
|
+
https://docs.kraken.com/api/docs/futures-api/trading/get-instruments
|
2390
2390
|
|
2391
2391
|
:param str[]|None symbols: list of unified market symbols
|
2392
2392
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
@@ -2565,8 +2565,8 @@ class krakenfutures(Exchange, ImplicitAPI):
|
|
2565
2565
|
def transfer(self, code: str, amount: float, fromAccount: str, toAccount: str, params={}) -> TransferEntry:
|
2566
2566
|
"""
|
2567
2567
|
|
2568
|
-
https://docs.
|
2569
|
-
https://docs.
|
2568
|
+
https://docs.kraken.com/api/docs/futures-api/trading/transfer
|
2569
|
+
https://docs.kraken.com/api/docs/futures-api/trading/sub-account-transfer
|
2570
2570
|
|
2571
2571
|
transfers currencies between sub-accounts
|
2572
2572
|
:param str code: Unified currency code
|
@@ -2611,7 +2611,7 @@ class krakenfutures(Exchange, ImplicitAPI):
|
|
2611
2611
|
"""
|
2612
2612
|
set the level of leverage for a market
|
2613
2613
|
|
2614
|
-
https://docs.
|
2614
|
+
https://docs.kraken.com/api/docs/futures-api/trading/set-leverage-setting
|
2615
2615
|
|
2616
2616
|
:param float leverage: the rate of leverage
|
2617
2617
|
:param str symbol: unified market symbol
|
@@ -2634,7 +2634,7 @@ class krakenfutures(Exchange, ImplicitAPI):
|
|
2634
2634
|
"""
|
2635
2635
|
fetch the set leverage for all contract and margin markets
|
2636
2636
|
|
2637
|
-
https://docs.
|
2637
|
+
https://docs.kraken.com/api/docs/futures-api/trading/get-leverage-setting
|
2638
2638
|
|
2639
2639
|
:param str[] [symbols]: a list of unified market symbols
|
2640
2640
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
@@ -2661,7 +2661,7 @@ class krakenfutures(Exchange, ImplicitAPI):
|
|
2661
2661
|
"""
|
2662
2662
|
fetch the set leverage for a market
|
2663
2663
|
|
2664
|
-
https://docs.
|
2664
|
+
https://docs.kraken.com/api/docs/futures-api/trading/get-leverage-setting
|
2665
2665
|
|
2666
2666
|
:param str symbol: unified market symbol
|
2667
2667
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
ccxt/mexc.py
CHANGED
@@ -680,6 +680,7 @@ class mexc(Exchange, ImplicitAPI):
|
|
680
680
|
'BNB Smart Chain(BEP20-RACAV1)': 'BSC',
|
681
681
|
'BNB Smart Chain(BEP20-RACAV2)': 'BSC',
|
682
682
|
'BNB Smart Chain(BEP20)': 'BSC',
|
683
|
+
'Ethereum(ERC20)': 'ERC20',
|
683
684
|
# TODO: uncomment below after deciding unified name
|
684
685
|
# 'PEPE COIN BSC':
|
685
686
|
# 'SMART BLOCKCHAIN':
|
@@ -4960,7 +4961,7 @@ class mexc(Exchange, ImplicitAPI):
|
|
4960
4961
|
# positionShowStatus: 'CLOSED'
|
4961
4962
|
# }
|
4962
4963
|
#
|
4963
|
-
market = self.safe_market(self.safe_string(position, 'symbol'), market)
|
4964
|
+
market = self.safe_market(self.safe_string(position, 'symbol'), market, None, 'swap')
|
4964
4965
|
symbol = market['symbol']
|
4965
4966
|
contracts = self.safe_string(position, 'holdVol')
|
4966
4967
|
entryPrice = self.safe_number(position, 'openAvgPrice')
|