ccxt 4.4.88__py2.py3-none-any.whl → 4.4.90__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/abstract/bitget.py +58 -0
- ccxt/abstract/bitrue.py +65 -65
- ccxt/abstract/cryptocom.py +2 -0
- ccxt/abstract/luno.py +1 -0
- ccxt/async_support/__init__.py +1 -1
- ccxt/async_support/base/exchange.py +1 -1
- ccxt/async_support/binance.py +1 -1
- ccxt/async_support/bingx.py +55 -29
- ccxt/async_support/bitget.py +469 -147
- ccxt/async_support/bitrue.py +72 -66
- ccxt/async_support/bitvavo.py +34 -0
- ccxt/async_support/btcalpha.py +35 -0
- ccxt/async_support/btcbox.py +35 -0
- ccxt/async_support/btcmarkets.py +35 -0
- ccxt/async_support/btcturk.py +35 -0
- ccxt/async_support/bybit.py +9 -3
- ccxt/async_support/coinbase.py +1 -3
- ccxt/async_support/cryptocom.py +49 -0
- ccxt/async_support/delta.py +2 -2
- ccxt/async_support/digifinex.py +39 -99
- ccxt/async_support/gate.py +12 -5
- ccxt/async_support/hashkey.py +15 -28
- ccxt/async_support/hollaex.py +27 -22
- ccxt/async_support/kraken.py +28 -49
- ccxt/async_support/luno.py +87 -1
- ccxt/async_support/okx.py +2 -1
- ccxt/async_support/phemex.py +16 -8
- ccxt/async_support/tradeogre.py +3 -3
- ccxt/async_support/xt.py +1 -1
- ccxt/base/exchange.py +13 -4
- ccxt/binance.py +1 -1
- ccxt/bingx.py +55 -29
- ccxt/bitget.py +469 -147
- ccxt/bitrue.py +72 -66
- ccxt/bitvavo.py +34 -0
- ccxt/btcalpha.py +35 -0
- ccxt/btcbox.py +35 -0
- ccxt/btcmarkets.py +35 -0
- ccxt/btcturk.py +35 -0
- ccxt/bybit.py +9 -3
- ccxt/coinbase.py +1 -3
- ccxt/cryptocom.py +49 -0
- ccxt/delta.py +2 -2
- ccxt/digifinex.py +39 -99
- ccxt/gate.py +12 -5
- ccxt/hashkey.py +15 -28
- ccxt/hollaex.py +27 -22
- ccxt/kraken.py +27 -49
- ccxt/luno.py +87 -1
- ccxt/okx.py +2 -1
- ccxt/phemex.py +16 -8
- ccxt/pro/__init__.py +1 -127
- ccxt/pro/coinbase.py +2 -0
- ccxt/pro/cryptocom.py +27 -0
- ccxt/pro/kraken.py +3 -9
- ccxt/tradeogre.py +3 -3
- ccxt/xt.py +1 -1
- {ccxt-4.4.88.dist-info → ccxt-4.4.90.dist-info}/METADATA +62 -20
- {ccxt-4.4.88.dist-info → ccxt-4.4.90.dist-info}/RECORD +63 -63
- {ccxt-4.4.88.dist-info → ccxt-4.4.90.dist-info}/LICENSE.txt +0 -0
- {ccxt-4.4.88.dist-info → ccxt-4.4.90.dist-info}/WHEEL +0 -0
- {ccxt-4.4.88.dist-info → ccxt-4.4.90.dist-info}/top_level.txt +0 -0
ccxt/kraken.py
CHANGED
@@ -569,9 +569,12 @@ class kraken(Exchange, ImplicitAPI):
|
|
569
569
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
570
570
|
:returns dict[]: an array of objects representing market data
|
571
571
|
"""
|
572
|
+
promises = []
|
573
|
+
promises.append(self.publicGetAssetPairs(params))
|
572
574
|
if self.options['adjustForTimeDifference']:
|
573
|
-
self.load_time_difference()
|
574
|
-
|
575
|
+
promises.append(self.load_time_difference())
|
576
|
+
responses = promises
|
577
|
+
assetsResponse = responses[0]
|
575
578
|
#
|
576
579
|
# {
|
577
580
|
# "error": [],
|
@@ -619,7 +622,8 @@ class kraken(Exchange, ImplicitAPI):
|
|
619
622
|
# }
|
620
623
|
# }
|
621
624
|
#
|
622
|
-
markets = self.
|
625
|
+
markets = self.safe_dict(assetsResponse, 'result', {})
|
626
|
+
cachedCurrencies = self.safe_dict(self.options, 'cachedCurrencies', {})
|
623
627
|
keys = list(markets.keys())
|
624
628
|
result = []
|
625
629
|
for i in range(0, len(keys)):
|
@@ -629,39 +633,45 @@ class kraken(Exchange, ImplicitAPI):
|
|
629
633
|
quoteId = self.safe_string(market, 'quote')
|
630
634
|
base = self.safe_currency_code(baseId)
|
631
635
|
quote = self.safe_currency_code(quoteId)
|
632
|
-
|
633
|
-
|
634
|
-
makerFees = self.safe_value(market, 'fees_maker', [])
|
635
|
-
firstMakerFee = self.safe_value(makerFees, 0, [])
|
636
|
+
makerFees = self.safe_list(market, 'fees_maker', [])
|
637
|
+
firstMakerFee = self.safe_list(makerFees, 0, [])
|
636
638
|
firstMakerFeeRate = self.safe_string(firstMakerFee, 1)
|
637
639
|
maker = None
|
638
640
|
if firstMakerFeeRate is not None:
|
639
641
|
maker = self.parse_number(Precise.string_div(firstMakerFeeRate, '100'))
|
640
|
-
takerFees = self.
|
641
|
-
firstTakerFee = self.
|
642
|
+
takerFees = self.safe_list(market, 'fees', [])
|
643
|
+
firstTakerFee = self.safe_list(takerFees, 0, [])
|
642
644
|
firstTakerFeeRate = self.safe_string(firstTakerFee, 1)
|
643
645
|
taker = None
|
644
646
|
if firstTakerFeeRate is not None:
|
645
647
|
taker = self.parse_number(Precise.string_div(firstTakerFeeRate, '100'))
|
646
|
-
leverageBuy = self.
|
648
|
+
leverageBuy = self.safe_list(market, 'leverage_buy', [])
|
647
649
|
leverageBuyLength = len(leverageBuy)
|
648
650
|
precisionPrice = self.parse_number(self.parse_precision(self.safe_string(market, 'pair_decimals')))
|
651
|
+
precisionAmount = self.parse_number(self.parse_precision(self.safe_string(market, 'lot_decimals')))
|
652
|
+
spot = True
|
653
|
+
# fix https://github.com/freqtrade/freqtrade/issues/11765#issuecomment-2894224103
|
654
|
+
if spot and (base in cachedCurrencies):
|
655
|
+
currency = cachedCurrencies[base]
|
656
|
+
currencyPrecision = self.safe_number(currency, 'precision')
|
657
|
+
# if currency precision is greater(e.g. 0.01) than market precision(e.g. 0.001)
|
658
|
+
if currencyPrecision > precisionAmount:
|
659
|
+
precisionAmount = currencyPrecision
|
649
660
|
status = self.safe_string(market, 'status')
|
650
661
|
isActive = status == 'online'
|
651
662
|
result.append({
|
652
663
|
'id': id,
|
653
664
|
'wsId': self.safe_string(market, 'wsname'),
|
654
|
-
'symbol':
|
665
|
+
'symbol': base + '/' + quote,
|
655
666
|
'base': base,
|
656
667
|
'quote': quote,
|
657
668
|
'settle': None,
|
658
669
|
'baseId': baseId,
|
659
670
|
'quoteId': quoteId,
|
660
671
|
'settleId': None,
|
661
|
-
'darkpool': darkpool,
|
662
672
|
'altname': market['altname'],
|
663
673
|
'type': 'spot',
|
664
|
-
'spot':
|
674
|
+
'spot': spot,
|
665
675
|
'margin': (leverageBuyLength > 0),
|
666
676
|
'swap': False,
|
667
677
|
'future': False,
|
@@ -678,7 +688,7 @@ class kraken(Exchange, ImplicitAPI):
|
|
678
688
|
'strike': None,
|
679
689
|
'optionType': None,
|
680
690
|
'precision': {
|
681
|
-
'amount':
|
691
|
+
'amount': precisionAmount,
|
682
692
|
'price': precisionPrice,
|
683
693
|
},
|
684
694
|
'limits': {
|
@@ -691,7 +701,7 @@ class kraken(Exchange, ImplicitAPI):
|
|
691
701
|
'max': None,
|
692
702
|
},
|
693
703
|
'price': {
|
694
|
-
'min':
|
704
|
+
'min': None,
|
695
705
|
'max': None,
|
696
706
|
},
|
697
707
|
'cost': {
|
@@ -702,7 +712,6 @@ class kraken(Exchange, ImplicitAPI):
|
|
702
712
|
'created': None,
|
703
713
|
'info': market,
|
704
714
|
})
|
705
|
-
result = self.append_inactive_markets(result)
|
706
715
|
self.options['marketsByAltname'] = self.index_by(result, 'altname')
|
707
716
|
return result
|
708
717
|
|
@@ -714,32 +723,6 @@ class kraken(Exchange, ImplicitAPI):
|
|
714
723
|
currencyId = currencyId[1:]
|
715
724
|
return super(kraken, self).safe_currency(currencyId, currency)
|
716
725
|
|
717
|
-
def append_inactive_markets(self, result):
|
718
|
-
# result should be an array to append to
|
719
|
-
precision: dict = {
|
720
|
-
'amount': self.parse_number('1e-8'),
|
721
|
-
'price': self.parse_number('1e-8'),
|
722
|
-
}
|
723
|
-
costLimits: dict = {'min': None, 'max': None}
|
724
|
-
priceLimits: dict = {'min': precision['price'], 'max': None}
|
725
|
-
amountLimits: dict = {'min': precision['amount'], 'max': None}
|
726
|
-
limits: dict = {'amount': amountLimits, 'price': priceLimits, 'cost': costLimits}
|
727
|
-
defaults: dict = {
|
728
|
-
'darkpool': False,
|
729
|
-
'info': None,
|
730
|
-
'maker': None,
|
731
|
-
'taker': None,
|
732
|
-
'active': False,
|
733
|
-
'precision': precision,
|
734
|
-
'limits': limits,
|
735
|
-
}
|
736
|
-
markets = [
|
737
|
-
# {'id': 'XXLMZEUR', 'symbol': 'XLM/EUR', 'base': 'XLM', 'quote': 'EUR', 'altname': 'XLMEUR'},
|
738
|
-
]
|
739
|
-
for i in range(0, len(markets)):
|
740
|
-
result.append(self.extend(defaults, markets[i]))
|
741
|
-
return result
|
742
|
-
|
743
726
|
def fetch_status(self, params={}):
|
744
727
|
"""
|
745
728
|
the latest known information on the availability of the exchange API
|
@@ -980,8 +963,6 @@ class kraken(Exchange, ImplicitAPI):
|
|
980
963
|
"""
|
981
964
|
self.load_markets()
|
982
965
|
market = self.market(symbol)
|
983
|
-
if market['darkpool']:
|
984
|
-
raise ExchangeError(self.id + ' fetchOrderBook() does not provide an order book for darkpool symbol ' + symbol)
|
985
966
|
request: dict = {
|
986
967
|
'pair': market['id'],
|
987
968
|
}
|
@@ -1084,7 +1065,7 @@ class kraken(Exchange, ImplicitAPI):
|
|
1084
1065
|
for i in range(0, len(symbols)):
|
1085
1066
|
symbol = symbols[i]
|
1086
1067
|
market = self.markets[symbol]
|
1087
|
-
if market['active']
|
1068
|
+
if market['active']:
|
1088
1069
|
marketIds.append(market['id'])
|
1089
1070
|
request['pair'] = ','.join(marketIds)
|
1090
1071
|
response = self.publicGetTicker(self.extend(request, params))
|
@@ -1110,9 +1091,6 @@ class kraken(Exchange, ImplicitAPI):
|
|
1110
1091
|
:returns dict: a `ticker structure <https://docs.ccxt.com/#/?id=ticker-structure>`
|
1111
1092
|
"""
|
1112
1093
|
self.load_markets()
|
1113
|
-
darkpool = symbol.find('.d') >= 0
|
1114
|
-
if darkpool:
|
1115
|
-
raise ExchangeError(self.id + ' fetchTicker() does not provide a ticker for darkpool symbol ' + symbol)
|
1116
1094
|
market = self.market(symbol)
|
1117
1095
|
request: dict = {
|
1118
1096
|
'pair': market['id'],
|
@@ -3329,6 +3307,6 @@ class kraken(Exchange, ImplicitAPI):
|
|
3329
3307
|
for i in range(0, len(response['error'])):
|
3330
3308
|
error = response['error'][i]
|
3331
3309
|
self.throw_exactly_matched_exception(self.exceptions['exact'], error, message)
|
3332
|
-
self.
|
3310
|
+
self.throw_broadly_matched_exception(self.exceptions['broad'], error, message)
|
3333
3311
|
raise ExchangeError(message)
|
3334
3312
|
return None
|
ccxt/luno.py
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
from ccxt.base.exchange import Exchange
|
7
7
|
from ccxt.abstract.luno import ImplicitAPI
|
8
|
-
from ccxt.base.types import Account, Any, Balances, Currency, DepositAddress, Int, LedgerEntry, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, TradingFeeInterface
|
8
|
+
from ccxt.base.types import Account, Any, Balances, Currencies, Currency, DepositAddress, Int, LedgerEntry, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, TradingFeeInterface
|
9
9
|
from typing import List
|
10
10
|
from ccxt.base.errors import ExchangeError
|
11
11
|
from ccxt.base.errors import ArgumentsRequired
|
@@ -44,6 +44,7 @@ class luno(Exchange, ImplicitAPI):
|
|
44
44
|
'fetchClosedOrders': True,
|
45
45
|
'fetchCrossBorrowRate': False,
|
46
46
|
'fetchCrossBorrowRates': False,
|
47
|
+
'fetchCurrencies': True,
|
47
48
|
'fetchDepositAddress': True,
|
48
49
|
'fetchFundingHistory': False,
|
49
50
|
'fetchFundingRate': False,
|
@@ -125,6 +126,7 @@ class luno(Exchange, ImplicitAPI):
|
|
125
126
|
'accounts/{id}/transactions': 1,
|
126
127
|
'balance': 1,
|
127
128
|
'beneficiaries': 1,
|
129
|
+
'send/networks': 1,
|
128
130
|
'fee_info': 1,
|
129
131
|
'funding_address': 1,
|
130
132
|
'listorders': 1,
|
@@ -265,6 +267,90 @@ class luno(Exchange, ImplicitAPI):
|
|
265
267
|
},
|
266
268
|
})
|
267
269
|
|
270
|
+
def fetch_currencies(self, params={}) -> Currencies:
|
271
|
+
"""
|
272
|
+
fetches all available currencies on an exchange
|
273
|
+
:param dict [params]: extra parameters specific to the exchange API endpoint
|
274
|
+
:returns dict: an associative dictionary of currencies
|
275
|
+
"""
|
276
|
+
if not self.check_required_credentials(False):
|
277
|
+
return None
|
278
|
+
response = self.privateGetSendNetworks(params)
|
279
|
+
#
|
280
|
+
# {
|
281
|
+
# "networks": [
|
282
|
+
# {
|
283
|
+
# "id": 0,
|
284
|
+
# "name": "Ethereum",
|
285
|
+
# "native_currency": "ETH"
|
286
|
+
# },
|
287
|
+
# ...
|
288
|
+
# ]
|
289
|
+
# }
|
290
|
+
#
|
291
|
+
currenciesData = self.safe_list(response, 'data', [])
|
292
|
+
result: dict = {}
|
293
|
+
for i in range(0, len(currenciesData)):
|
294
|
+
networkEntry = currenciesData[i]
|
295
|
+
id = self.safe_string(networkEntry, 'native_currency')
|
296
|
+
code = self.safe_currency_code(id)
|
297
|
+
if not (code in result):
|
298
|
+
result[code] = {
|
299
|
+
'id': id,
|
300
|
+
'code': code,
|
301
|
+
'precision': None,
|
302
|
+
'type': None,
|
303
|
+
'name': None,
|
304
|
+
'active': None,
|
305
|
+
'deposit': None,
|
306
|
+
'withdraw': None,
|
307
|
+
'fee': None,
|
308
|
+
'limits': {
|
309
|
+
'withdraw': {
|
310
|
+
'min': None,
|
311
|
+
'max': None,
|
312
|
+
},
|
313
|
+
'deposit': {
|
314
|
+
'min': None,
|
315
|
+
'max': None,
|
316
|
+
},
|
317
|
+
},
|
318
|
+
'networks': {},
|
319
|
+
'info': {},
|
320
|
+
}
|
321
|
+
networkId = self.safe_string(networkEntry, 'name')
|
322
|
+
networkCode = self.network_id_to_code(networkId)
|
323
|
+
result[code]['networks'][networkCode] = {
|
324
|
+
'id': networkId,
|
325
|
+
'network': networkCode,
|
326
|
+
'limits': {
|
327
|
+
'withdraw': {
|
328
|
+
'min': None,
|
329
|
+
'max': None,
|
330
|
+
},
|
331
|
+
'deposit': {
|
332
|
+
'min': None,
|
333
|
+
'max': None,
|
334
|
+
},
|
335
|
+
},
|
336
|
+
'active': None,
|
337
|
+
'deposit': None,
|
338
|
+
'withdraw': None,
|
339
|
+
'fee': None,
|
340
|
+
'precision': None,
|
341
|
+
'info': networkEntry,
|
342
|
+
}
|
343
|
+
# add entry in info
|
344
|
+
info = self.safe_list(result[code], 'info', [])
|
345
|
+
info.append(networkEntry)
|
346
|
+
result[code]['info'] = info
|
347
|
+
# only after all entries are formed in currencies, restructure each entry
|
348
|
+
allKeys = list(result.keys())
|
349
|
+
for i in range(0, len(allKeys)):
|
350
|
+
code = allKeys[i]
|
351
|
+
result[code] = self.safe_currency_structure(result[code]) # self is needed after adding network entry
|
352
|
+
return result
|
353
|
+
|
268
354
|
def fetch_markets(self, params={}) -> List[Market]:
|
269
355
|
"""
|
270
356
|
retrieves data on all markets for luno
|
ccxt/okx.py
CHANGED
@@ -1606,6 +1606,7 @@ class okx(Exchange, ImplicitAPI):
|
|
1606
1606
|
# "instType": "OPTION",
|
1607
1607
|
# "lever": "",
|
1608
1608
|
# "listTime": "1631262612280",
|
1609
|
+
# "contTdSwTime": "1631262812280",
|
1609
1610
|
# "lotSz": "1",
|
1610
1611
|
# "minSz": "1",
|
1611
1612
|
# "optType": "P",
|
@@ -1685,7 +1686,7 @@ class okx(Exchange, ImplicitAPI):
|
|
1685
1686
|
'expiryDatetime': self.iso8601(expiry),
|
1686
1687
|
'strike': self.parse_number(strikePrice),
|
1687
1688
|
'optionType': optionType,
|
1688
|
-
'created': self.
|
1689
|
+
'created': self.safe_integer_2(market, 'contTdSwTime', 'listTime'), # contTdSwTime is public trading start time, while listTime considers pre-trading too
|
1689
1690
|
'precision': {
|
1690
1691
|
'amount': self.safe_number(market, 'lotSz'),
|
1691
1692
|
'price': self.safe_number(market, 'tickSz'),
|
ccxt/phemex.py
CHANGED
@@ -597,6 +597,7 @@ class phemex(Exchange, ImplicitAPI):
|
|
597
597
|
},
|
598
598
|
'defaultNetworks': {
|
599
599
|
'USDT': 'ETH',
|
600
|
+
'MKR': 'ETH',
|
600
601
|
},
|
601
602
|
'defaultSubType': 'linear',
|
602
603
|
'accountsByType': {
|
@@ -3321,6 +3322,7 @@ class phemex(Exchange, ImplicitAPI):
|
|
3321
3322
|
fetch the deposit address for a currency associated with self account
|
3322
3323
|
:param str code: unified currency code
|
3323
3324
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
3325
|
+
:param str [params.network]: the chain name to fetch the deposit address e.g. ETH, TRX, EOS, SOL, etc.
|
3324
3326
|
:returns dict: an `address structure <https://docs.ccxt.com/#/?id=address-structure>`
|
3325
3327
|
"""
|
3326
3328
|
self.load_markets()
|
@@ -3331,20 +3333,26 @@ class phemex(Exchange, ImplicitAPI):
|
|
3331
3333
|
defaultNetworks = self.safe_dict(self.options, 'defaultNetworks')
|
3332
3334
|
defaultNetwork = self.safe_string_upper(defaultNetworks, code)
|
3333
3335
|
networks = self.safe_dict(self.options, 'networks', {})
|
3334
|
-
network = self.
|
3336
|
+
network = self.safe_string_upper_2(params, 'network', 'chainName', defaultNetwork)
|
3335
3337
|
network = self.safe_string(networks, network, network)
|
3336
3338
|
if network is None:
|
3337
|
-
|
3339
|
+
raise ArgumentsRequired(self.id + ' fetchDepositAddress() requires a network parameter')
|
3338
3340
|
else:
|
3339
3341
|
request['chainName'] = network
|
3340
3342
|
params = self.omit(params, 'network')
|
3341
|
-
response = self.
|
3343
|
+
response = self.privateGetExchangeWalletsV2DepositAddress(self.extend(request, params))
|
3344
|
+
#
|
3342
3345
|
# {
|
3343
|
-
# "code":0,
|
3344
|
-
# "msg":"OK",
|
3345
|
-
# "data":{
|
3346
|
-
# "address":"
|
3347
|
-
# "tag":
|
3346
|
+
# "code": 0,
|
3347
|
+
# "msg": "OK",
|
3348
|
+
# "data": {
|
3349
|
+
# "address": "tb1qxel5wq5gumt",
|
3350
|
+
# "tag": "",
|
3351
|
+
# "notice": False,
|
3352
|
+
# "accountType": 1,
|
3353
|
+
# "contractName": null,
|
3354
|
+
# "chainTokenUrl": null,
|
3355
|
+
# "sign": null
|
3348
3356
|
# }
|
3349
3357
|
# }
|
3350
3358
|
#
|
ccxt/pro/__init__.py
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
|
5
5
|
# ----------------------------------------------------------------------------
|
6
6
|
|
7
|
-
__version__ = '4.4.
|
7
|
+
__version__ = '4.4.90'
|
8
8
|
|
9
9
|
# ----------------------------------------------------------------------------
|
10
10
|
|
@@ -56,132 +56,6 @@ from ccxt.base.errors import UnsubscribeError # noqa: F4
|
|
56
56
|
from ccxt.base.errors import error_hierarchy # noqa: F401
|
57
57
|
# DO_NOT_REMOVE__ERROR_IMPORTS_END
|
58
58
|
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
59
|
from ccxt.pro.alpaca import alpaca # noqa: F401
|
186
60
|
from ccxt.pro.apex import apex # noqa: F401
|
187
61
|
from ccxt.pro.ascendex import ascendex # noqa: F401
|
ccxt/pro/coinbase.py
CHANGED
@@ -160,6 +160,7 @@ class coinbase(ccxt.async_support.coinbase):
|
|
160
160
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
161
161
|
:returns dict: a `ticker structure <https://docs.ccxt.com/#/?id=ticker-structure>`
|
162
162
|
"""
|
163
|
+
await self.load_markets()
|
163
164
|
name = 'ticker'
|
164
165
|
return await self.subscribe(name, False, symbol, params)
|
165
166
|
|
@@ -173,6 +174,7 @@ class coinbase(ccxt.async_support.coinbase):
|
|
173
174
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
174
175
|
:returns dict: a `ticker structure <https://docs.ccxt.com/#/?id=ticker-structure>`
|
175
176
|
"""
|
177
|
+
await self.load_markets()
|
176
178
|
if symbols is None:
|
177
179
|
symbols = self.symbols
|
178
180
|
name = 'ticker_batch'
|
ccxt/pro/cryptocom.py
CHANGED
@@ -36,6 +36,7 @@ class cryptocom(ccxt.async_support.cryptocom):
|
|
36
36
|
'createOrderWs': True,
|
37
37
|
'cancelOrderWs': True,
|
38
38
|
'cancelAllOrders': True,
|
39
|
+
'editOrderWs': True,
|
39
40
|
},
|
40
41
|
'urls': {
|
41
42
|
'api': {
|
@@ -1019,6 +1020,31 @@ class cryptocom(ccxt.async_support.cryptocom):
|
|
1019
1020
|
messageHash = self.nonce()
|
1020
1021
|
return await self.watch_private_request(messageHash, request)
|
1021
1022
|
|
1023
|
+
async def edit_order_ws(self, id: str, symbol: str, type: OrderType, side: OrderSide, amount: Num = None, price: Num = None, params={}) -> Order:
|
1024
|
+
"""
|
1025
|
+
edit a trade order
|
1026
|
+
|
1027
|
+
https://exchange-docs.crypto.com/exchange/v1/rest-ws/index.html#private-amend-order
|
1028
|
+
|
1029
|
+
:param str id: order id
|
1030
|
+
:param str symbol: unified market symbol of the order to edit
|
1031
|
+
:param str [type]: not used by cryptocom editOrder
|
1032
|
+
:param str [side]: not used by cryptocom editOrder
|
1033
|
+
:param float amount:(mandatory) how much of the currency you want to trade in units of the base currency
|
1034
|
+
:param float price:(mandatory) the price for the order, in units of the quote currency, ignored in market orders
|
1035
|
+
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1036
|
+
:param str [params.clientOrderId]: the original client order id of the order to edit, required if id is not provided
|
1037
|
+
:returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
|
1038
|
+
"""
|
1039
|
+
await self.load_markets()
|
1040
|
+
params = self.edit_order_request(id, symbol, amount, price, params)
|
1041
|
+
request: dict = {
|
1042
|
+
'method': 'private/amend-order',
|
1043
|
+
'params': params,
|
1044
|
+
}
|
1045
|
+
messageHash = self.nonce()
|
1046
|
+
return await self.watch_private_request(messageHash, request)
|
1047
|
+
|
1022
1048
|
def handle_order(self, client: Client, message):
|
1023
1049
|
#
|
1024
1050
|
# {
|
@@ -1258,6 +1284,7 @@ class cryptocom(ccxt.async_support.cryptocom):
|
|
1258
1284
|
'public/heartbeat': self.handle_ping,
|
1259
1285
|
'public/auth': self.handle_authenticate,
|
1260
1286
|
'private/create-order': self.handle_order,
|
1287
|
+
'private/amend-order': self.handle_order,
|
1261
1288
|
'private/cancel-order': self.handle_order,
|
1262
1289
|
'private/cancel-all-orders': self.handle_cancel_all_orders,
|
1263
1290
|
'private/close-position': self.handle_order,
|
ccxt/pro/kraken.py
CHANGED
@@ -825,15 +825,9 @@ class kraken(ccxt.async_support.kraken):
|
|
825
825
|
for i in range(0, len(self.symbols)):
|
826
826
|
symbol = self.symbols[i]
|
827
827
|
market = self.markets[symbol]
|
828
|
-
|
829
|
-
|
830
|
-
|
831
|
-
wsName = altname[0:3] + '/' + altname[3:]
|
832
|
-
marketsByWsName[wsName] = market
|
833
|
-
else:
|
834
|
-
info = self.safe_value(market, 'info', {})
|
835
|
-
wsName = self.safe_string(info, 'wsname')
|
836
|
-
marketsByWsName[wsName] = market
|
828
|
+
info = self.safe_value(market, 'info', {})
|
829
|
+
wsName = self.safe_string(info, 'wsname')
|
830
|
+
marketsByWsName[wsName] = market
|
837
831
|
self.options['marketsByWsName'] = marketsByWsName
|
838
832
|
return markets
|
839
833
|
|
ccxt/tradeogre.py
CHANGED
@@ -425,13 +425,13 @@ class tradeogre(Exchange, ImplicitAPI):
|
|
425
425
|
'vwap': None,
|
426
426
|
'open': self.safe_string(ticker, 'initialprice'),
|
427
427
|
'close': self.safe_string(ticker, 'price'),
|
428
|
-
'last':
|
428
|
+
'last': self.safe_string(ticker, 'price'),
|
429
429
|
'previousClose': None,
|
430
430
|
'change': None,
|
431
431
|
'percentage': None,
|
432
432
|
'average': None,
|
433
|
-
'baseVolume':
|
434
|
-
'quoteVolume':
|
433
|
+
'baseVolume': self.safe_string(ticker, 'volume'),
|
434
|
+
'quoteVolume': None,
|
435
435
|
'info': ticker,
|
436
436
|
}, market)
|
437
437
|
|
ccxt/xt.py
CHANGED
@@ -2846,7 +2846,7 @@ class xt(Exchange, ImplicitAPI):
|
|
2846
2846
|
if trigger or stopLossTakeProfit:
|
2847
2847
|
request['state'] = 'NOT_TRIGGERED'
|
2848
2848
|
elif type == 'swap':
|
2849
|
-
request['state'] = 'NEW
|
2849
|
+
request['state'] = 'UNFINISHED' # NEW & PARTIALLY_FILLED
|
2850
2850
|
elif status == 'closed':
|
2851
2851
|
if trigger or stopLossTakeProfit:
|
2852
2852
|
request['state'] = 'TRIGGERED'
|