ccxt 4.4.51__py2.py3-none-any.whl → 4.4.53__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/binance.py +0 -1
- ccxt/abstract/binancecoinm.py +0 -1
- ccxt/abstract/binanceus.py +0 -1
- ccxt/abstract/binanceusdm.py +0 -1
- ccxt/ace.py +3 -0
- ccxt/alpaca.py +5 -0
- ccxt/ascendex.py +2 -1
- ccxt/async_support/__init__.py +1 -1
- ccxt/async_support/ace.py +3 -0
- ccxt/async_support/alpaca.py +5 -0
- ccxt/async_support/ascendex.py +2 -1
- ccxt/async_support/base/exchange.py +20 -3
- ccxt/async_support/bigone.py +5 -0
- ccxt/async_support/binance.py +55 -69
- ccxt/async_support/bingx.py +25 -29
- ccxt/async_support/bit2c.py +3 -0
- ccxt/async_support/bitbank.py +3 -0
- ccxt/async_support/bitbns.py +3 -0
- ccxt/async_support/bitfinex.py +6 -1
- ccxt/async_support/bitflyer.py +6 -1
- ccxt/async_support/bitget.py +8 -4
- ccxt/async_support/bithumb.py +3 -1
- ccxt/async_support/bitmart.py +22 -12
- ccxt/async_support/bitmex.py +99 -93
- ccxt/async_support/bitopro.py +7 -2
- ccxt/async_support/bitrue.py +4 -0
- ccxt/async_support/bitso.py +5 -2
- ccxt/async_support/bitstamp.py +3 -0
- ccxt/async_support/bitteam.py +5 -0
- ccxt/async_support/bitvavo.py +4 -0
- ccxt/async_support/blockchaincom.py +4 -0
- ccxt/async_support/blofin.py +3 -0
- ccxt/async_support/btcalpha.py +5 -0
- ccxt/async_support/btcbox.py +3 -2
- ccxt/async_support/btcmarkets.py +5 -0
- ccxt/async_support/btcturk.py +3 -0
- ccxt/async_support/bybit.py +10 -4
- ccxt/async_support/cex.py +2 -0
- ccxt/async_support/coinbase.py +19 -12
- ccxt/async_support/coinbaseexchange.py +5 -0
- ccxt/async_support/coinbaseinternational.py +21 -2
- ccxt/async_support/coincatch.py +3 -0
- ccxt/async_support/coincheck.py +2 -0
- ccxt/async_support/coinex.py +5 -1
- ccxt/async_support/coinlist.py +5 -0
- ccxt/async_support/coinmate.py +4 -0
- ccxt/async_support/coinmetro.py +9 -5
- ccxt/async_support/coinone.py +3 -0
- ccxt/async_support/coinsph.py +4 -0
- ccxt/async_support/coinspot.py +1 -0
- ccxt/async_support/cryptocom.py +5 -0
- ccxt/async_support/currencycom.py +3 -0
- ccxt/async_support/defx.py +5 -0
- ccxt/async_support/delta.py +4 -1
- ccxt/async_support/deribit.py +16 -5
- ccxt/async_support/digifinex.py +10 -5
- ccxt/async_support/ellipx.py +9 -5
- ccxt/async_support/exmo.py +6 -3
- ccxt/async_support/gate.py +5 -1
- ccxt/async_support/gemini.py +3 -0
- ccxt/async_support/hashkey.py +5 -4
- ccxt/async_support/hitbtc.py +6 -2
- ccxt/async_support/hollaex.py +7 -2
- ccxt/async_support/htx.py +8 -1
- ccxt/async_support/huobijp.py +5 -0
- ccxt/async_support/hyperliquid.py +6 -1
- ccxt/async_support/idex.py +5 -1
- ccxt/async_support/independentreserve.py +4 -0
- ccxt/async_support/indodax.py +3 -0
- ccxt/async_support/kraken.py +6 -4
- ccxt/async_support/krakenfutures.py +5 -2
- ccxt/async_support/kucoin.py +13 -6
- ccxt/async_support/kucoinfutures.py +5 -1
- ccxt/async_support/kuna.py +3 -0
- ccxt/async_support/latoken.py +4 -0
- ccxt/async_support/lbank.py +6 -1
- ccxt/async_support/luno.py +6 -1
- ccxt/async_support/lykke.py +4 -0
- ccxt/async_support/mercado.py +4 -0
- ccxt/async_support/mexc.py +10 -9
- ccxt/async_support/ndax.py +6 -1
- ccxt/async_support/novadax.py +5 -0
- ccxt/async_support/oceanex.py +6 -2
- ccxt/async_support/okcoin.py +4 -0
- ccxt/async_support/okx.py +17 -5
- ccxt/async_support/onetrading.py +4 -0
- ccxt/async_support/oxfun.py +3 -0
- ccxt/async_support/p2b.py +3 -0
- ccxt/async_support/paradex.py +8 -2
- ccxt/async_support/phemex.py +10 -4
- ccxt/async_support/poloniex.py +6 -3
- ccxt/async_support/poloniexfutures.py +5 -1
- ccxt/async_support/probit.py +4 -0
- ccxt/async_support/timex.py +4 -0
- ccxt/async_support/tokocrypto.py +5 -0
- ccxt/async_support/tradeogre.py +2 -0
- ccxt/async_support/upbit.py +5 -2
- ccxt/async_support/vertex.py +6 -2
- ccxt/async_support/wavesexchange.py +20 -3
- ccxt/async_support/wazirx.py +2 -0
- ccxt/async_support/whitebit.py +5 -4
- ccxt/async_support/woo.py +15 -5
- ccxt/async_support/woofipro.py +21 -7
- ccxt/async_support/xt.py +5 -0
- ccxt/async_support/yobit.py +5 -2
- ccxt/async_support/zaif.py +2 -0
- ccxt/async_support/zonda.py +2 -0
- ccxt/base/exchange.py +113 -50
- ccxt/base/types.py +1 -1
- ccxt/bigone.py +5 -0
- ccxt/binance.py +55 -69
- ccxt/bingx.py +25 -29
- ccxt/bit2c.py +3 -0
- ccxt/bitbank.py +3 -0
- ccxt/bitbns.py +3 -0
- ccxt/bitfinex.py +6 -1
- ccxt/bitflyer.py +6 -1
- ccxt/bitget.py +8 -4
- ccxt/bithumb.py +3 -1
- ccxt/bitmart.py +22 -12
- ccxt/bitmex.py +99 -93
- ccxt/bitopro.py +7 -2
- ccxt/bitrue.py +4 -0
- ccxt/bitso.py +5 -2
- ccxt/bitstamp.py +3 -0
- ccxt/bitteam.py +5 -0
- ccxt/bitvavo.py +4 -0
- ccxt/blockchaincom.py +4 -0
- ccxt/blofin.py +3 -0
- ccxt/btcalpha.py +5 -0
- ccxt/btcbox.py +3 -2
- ccxt/btcmarkets.py +5 -0
- ccxt/btcturk.py +3 -0
- ccxt/bybit.py +10 -4
- ccxt/cex.py +2 -0
- ccxt/coinbase.py +19 -12
- ccxt/coinbaseexchange.py +5 -0
- ccxt/coinbaseinternational.py +21 -2
- ccxt/coincatch.py +3 -0
- ccxt/coincheck.py +2 -0
- ccxt/coinex.py +5 -1
- ccxt/coinlist.py +5 -0
- ccxt/coinmate.py +4 -0
- ccxt/coinmetro.py +9 -5
- ccxt/coinone.py +3 -0
- ccxt/coinsph.py +4 -0
- ccxt/coinspot.py +1 -0
- ccxt/cryptocom.py +5 -0
- ccxt/currencycom.py +3 -0
- ccxt/defx.py +5 -0
- ccxt/delta.py +4 -1
- ccxt/deribit.py +16 -5
- ccxt/digifinex.py +10 -5
- ccxt/ellipx.py +9 -5
- ccxt/exmo.py +6 -3
- ccxt/gate.py +5 -1
- ccxt/gemini.py +3 -0
- ccxt/hashkey.py +5 -4
- ccxt/hitbtc.py +6 -2
- ccxt/hollaex.py +7 -2
- ccxt/htx.py +8 -1
- ccxt/huobijp.py +5 -0
- ccxt/hyperliquid.py +6 -1
- ccxt/idex.py +5 -1
- ccxt/independentreserve.py +4 -0
- ccxt/indodax.py +3 -0
- ccxt/kraken.py +6 -4
- ccxt/krakenfutures.py +5 -2
- ccxt/kucoin.py +13 -6
- ccxt/kucoinfutures.py +5 -1
- ccxt/kuna.py +3 -0
- ccxt/latoken.py +4 -0
- ccxt/lbank.py +6 -1
- ccxt/luno.py +6 -1
- ccxt/lykke.py +4 -0
- ccxt/mercado.py +4 -0
- ccxt/mexc.py +10 -9
- ccxt/ndax.py +6 -1
- ccxt/novadax.py +5 -0
- ccxt/oceanex.py +6 -2
- ccxt/okcoin.py +4 -0
- ccxt/okx.py +17 -5
- ccxt/onetrading.py +4 -0
- ccxt/oxfun.py +3 -0
- ccxt/p2b.py +3 -0
- ccxt/paradex.py +8 -2
- ccxt/phemex.py +10 -4
- ccxt/poloniex.py +6 -3
- ccxt/poloniexfutures.py +5 -1
- ccxt/pro/__init__.py +1 -1
- ccxt/pro/bitcoincom.py +1 -4
- ccxt/pro/bitopro.py +1 -1
- ccxt/probit.py +4 -0
- ccxt/test/tests_async.py +57 -31
- ccxt/test/tests_sync.py +57 -31
- ccxt/timex.py +4 -0
- ccxt/tokocrypto.py +5 -0
- ccxt/tradeogre.py +2 -0
- ccxt/upbit.py +5 -2
- ccxt/vertex.py +6 -2
- ccxt/wavesexchange.py +20 -3
- ccxt/wazirx.py +2 -0
- ccxt/whitebit.py +5 -4
- ccxt/woo.py +15 -5
- ccxt/woofipro.py +21 -7
- ccxt/xt.py +5 -0
- ccxt/yobit.py +5 -2
- ccxt/zaif.py +2 -0
- ccxt/zonda.py +2 -0
- {ccxt-4.4.51.dist-info → ccxt-4.4.53.dist-info}/METADATA +225 -140
- {ccxt-4.4.51.dist-info → ccxt-4.4.53.dist-info}/RECORD +215 -224
- ccxt/static_dependencies/ethereum/abi/py.typed +0 -0
- ccxt/static_dependencies/ethereum/account/py.typed +0 -0
- ccxt/static_dependencies/ethereum/hexbytes/py.typed +0 -0
- ccxt/static_dependencies/ethereum/typing/py.typed +0 -0
- ccxt/static_dependencies/ethereum/utils/py.typed +0 -0
- ccxt/static_dependencies/lark/py.typed +0 -0
- ccxt/static_dependencies/marshmallow/py.typed +0 -0
- ccxt/static_dependencies/marshmallow_dataclass/py.typed +0 -0
- ccxt/static_dependencies/marshmallow_oneofschema/py.typed +0 -0
- {ccxt-4.4.51.dist-info → ccxt-4.4.53.dist-info}/LICENSE.txt +0 -0
- {ccxt-4.4.51.dist-info → ccxt-4.4.53.dist-info}/WHEEL +0 -0
- {ccxt-4.4.51.dist-info → ccxt-4.4.53.dist-info}/top_level.txt +0 -0
ccxt/async_support/zaif.py
CHANGED
@@ -166,6 +166,7 @@ class zaif(Exchange, ImplicitAPI):
|
|
166
166
|
'limit': None,
|
167
167
|
'trigger': False,
|
168
168
|
'trailing': False,
|
169
|
+
'symbolRequired': False,
|
169
170
|
},
|
170
171
|
'fetchOrders': None, # todo
|
171
172
|
'fetchClosedOrders': {
|
@@ -176,6 +177,7 @@ class zaif(Exchange, ImplicitAPI):
|
|
176
177
|
'untilDays': 100000, # todo
|
177
178
|
'trigger': False,
|
178
179
|
'trailing': False,
|
180
|
+
'symbolRequired': False,
|
179
181
|
},
|
180
182
|
'fetchOHLCV': None,
|
181
183
|
},
|
ccxt/async_support/zonda.py
CHANGED
@@ -334,6 +334,7 @@ class zonda(Exchange, ImplicitAPI):
|
|
334
334
|
'limit': None,
|
335
335
|
'daysBack': 100000, # todo
|
336
336
|
'untilDays': 100000, # todo
|
337
|
+
'symbolRequired': False,
|
337
338
|
},
|
338
339
|
'fetchOrder': None,
|
339
340
|
'fetchOpenOrders': {
|
@@ -341,6 +342,7 @@ class zonda(Exchange, ImplicitAPI):
|
|
341
342
|
'limit': 100,
|
342
343
|
'trigger': False,
|
343
344
|
'trailing': False,
|
345
|
+
'symbolRequired': False,
|
344
346
|
},
|
345
347
|
'fetchOrders': None,
|
346
348
|
'fetchClosedOrders': None, # todo
|
ccxt/base/exchange.py
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
|
5
5
|
# -----------------------------------------------------------------------------
|
6
6
|
|
7
|
-
__version__ = '4.4.
|
7
|
+
__version__ = '4.4.53'
|
8
8
|
|
9
9
|
# -----------------------------------------------------------------------------
|
10
10
|
|
@@ -2361,9 +2361,17 @@ class Exchange(object):
|
|
2361
2361
|
if fromStart:
|
2362
2362
|
if limit > arrayLength:
|
2363
2363
|
limit = arrayLength
|
2364
|
-
array = self.array_slice(array, 0, limit) if ascending else self.array_slice(array, -limit)
|
2364
|
+
# array = self.array_slice(array, 0, limit) if ascending else self.array_slice(array, -limit)
|
2365
|
+
if ascending:
|
2366
|
+
array = self.array_slice(array, 0, limit)
|
2367
|
+
else:
|
2368
|
+
array = self.array_slice(array, -limit)
|
2365
2369
|
else:
|
2366
|
-
array = self.array_slice(array, -limit) if ascending else self.array_slice(array, 0, limit)
|
2370
|
+
# array = self.array_slice(array, -limit) if ascending else self.array_slice(array, 0, limit)
|
2371
|
+
if ascending:
|
2372
|
+
array = self.array_slice(array, -limit)
|
2373
|
+
else:
|
2374
|
+
array = self.array_slice(array, 0, limit)
|
2367
2375
|
return array
|
2368
2376
|
|
2369
2377
|
def filter_by_since_limit(self, array: List[object], since: Int = None, limit: Int = None, key: IndexType = 'timestamp', tail=False):
|
@@ -2741,36 +2749,17 @@ class Exchange(object):
|
|
2741
2749
|
|
2742
2750
|
def features_generator(self):
|
2743
2751
|
#
|
2744
|
-
# the exchange-specific features can be something like self, where we support 'string' aliases too:
|
2752
|
+
# in the exchange-specific features can be something like self, where we support 'string' aliases too:
|
2745
2753
|
#
|
2746
2754
|
# {
|
2747
|
-
# '
|
2755
|
+
# 'my' : {
|
2748
2756
|
# 'createOrder' : {...},
|
2749
|
-
# 'fetchOrders' : {...},
|
2750
2757
|
# },
|
2751
2758
|
# 'swap': {
|
2752
|
-
# 'linear':
|
2753
|
-
#
|
2754
|
-
#
|
2755
|
-
# 'future': {
|
2756
|
-
# 'linear': 'myItem',
|
2757
|
-
# 'inverse': 'myItem',
|
2758
|
-
# }
|
2759
|
-
# }
|
2760
|
-
#
|
2761
|
-
#
|
2762
|
-
#
|
2763
|
-
# self method would regenerate the blank features tree, eg:
|
2764
|
-
#
|
2765
|
-
# {
|
2766
|
-
# "spot": {
|
2767
|
-
# "createOrder": None,
|
2768
|
-
# "fetchBalance": None,
|
2769
|
-
# ...
|
2759
|
+
# 'linear': {
|
2760
|
+
# 'extends': my',
|
2761
|
+
# },
|
2770
2762
|
# },
|
2771
|
-
# "swap": {
|
2772
|
-
# ...
|
2773
|
-
# }
|
2774
2763
|
# }
|
2775
2764
|
#
|
2776
2765
|
if self.features is None:
|
@@ -2806,13 +2795,13 @@ class Exchange(object):
|
|
2806
2795
|
extendObj = self.features_mapper(initialFeatures, extendsStr)
|
2807
2796
|
featuresObj = self.deep_extend(extendObj, featuresObj)
|
2808
2797
|
#
|
2809
|
-
# corrections
|
2798
|
+
# ### corrections ###
|
2810
2799
|
#
|
2800
|
+
# createOrder
|
2811
2801
|
if 'createOrder' in featuresObj:
|
2812
2802
|
value = self.safe_dict(featuresObj['createOrder'], 'attachedStopLossTakeProfit')
|
2813
|
-
|
2814
|
-
|
2815
|
-
featuresObj['createOrder']['takeProfit'] = value
|
2803
|
+
featuresObj['createOrder']['stopLoss'] = value
|
2804
|
+
featuresObj['createOrder']['takeProfit'] = value
|
2816
2805
|
if marketType == 'spot':
|
2817
2806
|
# default 'hedged': False
|
2818
2807
|
featuresObj['createOrder']['hedged'] = False
|
@@ -2822,6 +2811,15 @@ class Exchange(object):
|
|
2822
2811
|
# default 'GTC' to True
|
2823
2812
|
if self.safe_bool(featuresObj['createOrder']['timeInForce'], 'GTC') is None:
|
2824
2813
|
featuresObj['createOrder']['timeInForce']['GTC'] = True
|
2814
|
+
# other methods
|
2815
|
+
keys = list(featuresObj.keys())
|
2816
|
+
for i in range(0, len(keys)):
|
2817
|
+
key = keys[i]
|
2818
|
+
featureBlock = featuresObj[key]
|
2819
|
+
if not self.in_array(key, ['sandbox']) and featureBlock is not None:
|
2820
|
+
# default "symbolRequired" to False to all methods(except `createOrder`)
|
2821
|
+
if not ('symbolRequired' in featureBlock):
|
2822
|
+
featureBlock['symbolRequired'] = self.in_array(key, ['createOrder', 'createOrders', 'fetchOHLCV'])
|
2825
2823
|
return featuresObj
|
2826
2824
|
|
2827
2825
|
def orderbook_checksum_message(self, symbol: Str):
|
@@ -3058,7 +3056,9 @@ class Exchange(object):
|
|
3058
3056
|
for i in range(0, len(marketValues)):
|
3059
3057
|
value = marketValues[i]
|
3060
3058
|
if value['id'] in self.markets_by_id:
|
3061
|
-
(self.markets_by_id[value['id']])
|
3059
|
+
marketsByIdArray = (self.markets_by_id[value['id']])
|
3060
|
+
marketsByIdArray.append(value)
|
3061
|
+
self.markets_by_id[value['id']] = marketsByIdArray
|
3062
3062
|
else:
|
3063
3063
|
self.markets_by_id[value['id']] = [value]
|
3064
3064
|
market = self.deep_extend(self.safe_market_structure(), {
|
@@ -3413,13 +3413,16 @@ class Exchange(object):
|
|
3413
3413
|
results = []
|
3414
3414
|
if isinstance(orders, list):
|
3415
3415
|
for i in range(0, len(orders)):
|
3416
|
-
|
3416
|
+
parsed = self.parse_order(orders[i], market) # don't inline self call
|
3417
|
+
order = self.extend(parsed, params)
|
3417
3418
|
results.append(order)
|
3418
3419
|
else:
|
3419
3420
|
ids = list(orders.keys())
|
3420
3421
|
for i in range(0, len(ids)):
|
3421
3422
|
id = ids[i]
|
3422
|
-
|
3423
|
+
idExtended = self.extend({'id': id}, orders[id])
|
3424
|
+
parsedOrder = self.parse_order(idExtended, market) # don't inline these calls
|
3425
|
+
order = self.extend(parsedOrder, params)
|
3423
3426
|
results.append(order)
|
3424
3427
|
results = self.sort_by(results, 'timestamp')
|
3425
3428
|
symbol = market['symbol'] if (market is not None) else None
|
@@ -3768,12 +3771,18 @@ class Exchange(object):
|
|
3768
3771
|
result[volume] = []
|
3769
3772
|
for i in range(0, len(ohlcvs)):
|
3770
3773
|
ts = ohlcvs[i][0] if ms else self.parse_to_int(ohlcvs[i][0] / 1000)
|
3771
|
-
result[timestamp]
|
3772
|
-
|
3773
|
-
result[
|
3774
|
-
|
3775
|
-
result[
|
3776
|
-
|
3774
|
+
resultTimestamp = result[timestamp]
|
3775
|
+
resultTimestamp.append(ts)
|
3776
|
+
resultOpen = result[open]
|
3777
|
+
resultOpen.append(ohlcvs[i][1])
|
3778
|
+
resultHigh = result[high]
|
3779
|
+
resultHigh.append(ohlcvs[i][2])
|
3780
|
+
resultLow = result[low]
|
3781
|
+
resultLow.append(ohlcvs[i][3])
|
3782
|
+
resultClose = result[close]
|
3783
|
+
resultClose.append(ohlcvs[i][4])
|
3784
|
+
resultVolume = result[volume]
|
3785
|
+
resultVolume.append(ohlcvs[i][5])
|
3777
3786
|
return result
|
3778
3787
|
|
3779
3788
|
def fetch_web_endpoint(self, method, endpointMethod, returnAsJson, startRegex=None, endRegex=None):
|
@@ -3787,14 +3796,18 @@ class Exchange(object):
|
|
3787
3796
|
maxRetries = self.safe_value(options, 'webApiRetries', 10)
|
3788
3797
|
response = None
|
3789
3798
|
retry = 0
|
3799
|
+
shouldBreak = False
|
3790
3800
|
while(retry < maxRetries):
|
3791
3801
|
try:
|
3792
3802
|
response = getattr(self, endpointMethod)({})
|
3803
|
+
shouldBreak = True
|
3793
3804
|
break
|
3794
3805
|
except Exception as e:
|
3795
3806
|
retry = retry + 1
|
3796
3807
|
if retry == maxRetries:
|
3797
3808
|
raise e
|
3809
|
+
if shouldBreak:
|
3810
|
+
break # self is needed because of GO
|
3798
3811
|
content = response
|
3799
3812
|
if startRegex is not None:
|
3800
3813
|
splitted_by_start = content.split(startRegex)
|
@@ -4274,12 +4287,19 @@ class Exchange(object):
|
|
4274
4287
|
objects = self.to_array(objects)
|
4275
4288
|
# return all of them if no values were passed
|
4276
4289
|
if values is None or not values:
|
4277
|
-
return self.index_by(objects, key) if indexed else objects
|
4290
|
+
# return self.index_by(objects, key) if indexed else objects
|
4291
|
+
if indexed:
|
4292
|
+
return self.index_by(objects, key)
|
4293
|
+
else:
|
4294
|
+
return objects
|
4278
4295
|
results = []
|
4279
4296
|
for i in range(0, len(objects)):
|
4280
4297
|
if self.in_array(objects[i][key], values):
|
4281
4298
|
results.append(objects[i])
|
4282
|
-
return self.index_by(results, key) if indexed else results
|
4299
|
+
# return self.index_by(results, key) if indexed else results
|
4300
|
+
if indexed:
|
4301
|
+
return self.index_by(results, key)
|
4302
|
+
return results
|
4283
4303
|
|
4284
4304
|
def fetch2(self, path, api: Any = 'public', method='GET', params={}, headers: Any = None, body: Any = None, config={}):
|
4285
4305
|
if self.enableRateLimit:
|
@@ -4304,8 +4324,9 @@ class Exchange(object):
|
|
4304
4324
|
self.log('Request failed with the error: ' + str(e) + ', retrying ' + (i + str(1)) + ' of ' + str(retries) + '...')
|
4305
4325
|
if (retryDelay is not None) and (retryDelay != 0):
|
4306
4326
|
self.sleep(retryDelay)
|
4307
|
-
continue
|
4308
|
-
|
4327
|
+
# continue #check self
|
4328
|
+
if i >= retries:
|
4329
|
+
raise e
|
4309
4330
|
return None # self line is never reached, but exists for c# value return requirement
|
4310
4331
|
|
4311
4332
|
def request(self, path, api: Any = 'public', method='GET', params={}, headers: Any = None, body: Any = None, config={}):
|
@@ -4464,7 +4485,7 @@ class Exchange(object):
|
|
4464
4485
|
'precision': None,
|
4465
4486
|
})
|
4466
4487
|
|
4467
|
-
def safe_market(self, marketId: Str, market: Market = None, delimiter: Str = None, marketType: Str = None):
|
4488
|
+
def safe_market(self, marketId: Str = None, market: Market = None, delimiter: Str = None, marketType: Str = None):
|
4468
4489
|
result = self.safe_market_structure({
|
4469
4490
|
'symbol': marketId,
|
4470
4491
|
'marketId': marketId,
|
@@ -4629,9 +4650,8 @@ class Exchange(object):
|
|
4629
4650
|
return [value2, params]
|
4630
4651
|
|
4631
4652
|
def handle_option(self, methodName: str, optionName: str, defaultValue=None):
|
4632
|
-
|
4633
|
-
|
4634
|
-
return result
|
4653
|
+
res = self.handle_option_and_params({}, methodName, optionName, defaultValue)
|
4654
|
+
return self.safe_value(res, 0)
|
4635
4655
|
|
4636
4656
|
def handle_market_type_and_params(self, methodName: str, market: Market = None, params={}, defaultValue=None):
|
4637
4657
|
"""
|
@@ -4801,6 +4821,18 @@ class Exchange(object):
|
|
4801
4821
|
def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, params={}):
|
4802
4822
|
raise NotSupported(self.id + ' createOrder() is not supported yet')
|
4803
4823
|
|
4824
|
+
def create_convert_trade(self, id: str, fromCode: str, toCode: str, amount: Num = None, params={}):
|
4825
|
+
raise NotSupported(self.id + ' createConvertTrade() is not supported yet')
|
4826
|
+
|
4827
|
+
def fetch_convert_trade(self, id: str, code: Str = None, params={}):
|
4828
|
+
raise NotSupported(self.id + ' fetchConvertTrade() is not supported yet')
|
4829
|
+
|
4830
|
+
def fetch_convert_trade_history(self, code: Str = None, since: Int = None, limit: Int = None, params={}):
|
4831
|
+
raise NotSupported(self.id + ' fetchConvertTradeHistory() is not supported yet')
|
4832
|
+
|
4833
|
+
def fetch_position_mode(self, symbol: Str = None, params={}):
|
4834
|
+
raise NotSupported(self.id + ' fetchPositionMode() is not supported yet')
|
4835
|
+
|
4804
4836
|
def create_trailing_amount_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, trailingAmount=None, trailingTriggerPrice=None, params={}):
|
4805
4837
|
"""
|
4806
4838
|
create a trailing order by providing the symbol, type, side, amount, price and trailingAmount
|
@@ -5392,10 +5424,14 @@ class Exchange(object):
|
|
5392
5424
|
return self.create_order_ws(symbol, 'market', 'sell', amount, None, params)
|
5393
5425
|
|
5394
5426
|
def cost_to_precision(self, symbol: str, cost):
|
5427
|
+
if cost is None:
|
5428
|
+
return None
|
5395
5429
|
market = self.market(symbol)
|
5396
5430
|
return self.decimal_to_precision(cost, TRUNCATE, market['precision']['price'], self.precisionMode, self.paddingMode)
|
5397
5431
|
|
5398
5432
|
def price_to_precision(self, symbol: str, price):
|
5433
|
+
if price is None:
|
5434
|
+
return None
|
5399
5435
|
market = self.market(symbol)
|
5400
5436
|
result = self.decimal_to_precision(price, ROUND, market['precision']['price'], self.precisionMode, self.paddingMode)
|
5401
5437
|
if result == '0':
|
@@ -5403,6 +5439,8 @@ class Exchange(object):
|
|
5403
5439
|
return result
|
5404
5440
|
|
5405
5441
|
def amount_to_precision(self, symbol: str, amount):
|
5442
|
+
if amount is None:
|
5443
|
+
return None
|
5406
5444
|
market = self.market(symbol)
|
5407
5445
|
result = self.decimal_to_precision(amount, TRUNCATE, market['precision']['amount'], self.precisionMode, self.paddingMode)
|
5408
5446
|
if result == '0':
|
@@ -5410,6 +5448,8 @@ class Exchange(object):
|
|
5410
5448
|
return result
|
5411
5449
|
|
5412
5450
|
def fee_to_precision(self, symbol: str, fee):
|
5451
|
+
if fee is None:
|
5452
|
+
return None
|
5413
5453
|
market = self.market(symbol)
|
5414
5454
|
return self.decimal_to_precision(fee, ROUND, market['precision']['price'], self.precisionMode, self.paddingMode)
|
5415
5455
|
|
@@ -5641,14 +5681,16 @@ class Exchange(object):
|
|
5641
5681
|
results = []
|
5642
5682
|
if isinstance(tickers, list):
|
5643
5683
|
for i in range(0, len(tickers)):
|
5644
|
-
|
5684
|
+
parsedTicker = self.parse_ticker(tickers[i])
|
5685
|
+
ticker = self.extend(parsedTicker, params)
|
5645
5686
|
results.append(ticker)
|
5646
5687
|
else:
|
5647
5688
|
marketIds = list(tickers.keys())
|
5648
5689
|
for i in range(0, len(marketIds)):
|
5649
5690
|
marketId = marketIds[i]
|
5650
5691
|
market = self.safe_market(marketId)
|
5651
|
-
|
5692
|
+
parsed = self.parse_ticker(tickers[marketId], market)
|
5693
|
+
ticker = self.extend(parsed, params)
|
5652
5694
|
results.append(ticker)
|
5653
5695
|
symbols = self.market_symbols(symbols)
|
5654
5696
|
return self.filter_by_array(results, 'symbol', symbols)
|
@@ -5728,6 +5770,27 @@ class Exchange(object):
|
|
5728
5770
|
symbol = None if (market is None) else market['symbol']
|
5729
5771
|
return self.filter_by_symbol_since_limit(sorted, symbol, since, limit)
|
5730
5772
|
|
5773
|
+
def handle_trigger_direction_and_params(self, params, exchangeSpecificKey: Str = None, allowEmpty: Bool = False):
|
5774
|
+
"""
|
5775
|
+
@ignore
|
5776
|
+
:returns [str, dict]: the trigger-direction value and omited params
|
5777
|
+
"""
|
5778
|
+
triggerDirection = self.safe_string(params, 'triggerDirection')
|
5779
|
+
exchangeSpecificDefined = (exchangeSpecificKey is not None) and (exchangeSpecificKey in params)
|
5780
|
+
if triggerDirection is not None:
|
5781
|
+
params = self.omit(params, 'triggerDirection')
|
5782
|
+
# raise exception if:
|
5783
|
+
# A) if provided value is not unified(support old "up/down" strings too)
|
5784
|
+
# B) if exchange specific "trigger direction key"(eg. "stopPriceSide") was not provided
|
5785
|
+
if not self.in_array(triggerDirection, ['ascending', 'descending', 'up', 'down', 'above', 'below']) and not exchangeSpecificDefined and not allowEmpty:
|
5786
|
+
raise ArgumentsRequired(self.id + ' createOrder() : trigger orders require params["triggerDirection"] to be either "ascending" or "descending"')
|
5787
|
+
# if old format was provided, overwrite to new
|
5788
|
+
if triggerDirection == 'up' or triggerDirection == 'above':
|
5789
|
+
triggerDirection = 'ascending'
|
5790
|
+
elif triggerDirection == 'down' or triggerDirection == 'below':
|
5791
|
+
triggerDirection = 'descending'
|
5792
|
+
return [triggerDirection, params]
|
5793
|
+
|
5731
5794
|
def handle_trigger_and_params(self, params):
|
5732
5795
|
isTrigger = self.safe_bool_2(params, 'trigger', 'stop')
|
5733
5796
|
if isTrigger:
|
ccxt/base/types.py
CHANGED
ccxt/bigone.py
CHANGED
@@ -336,17 +336,20 @@ class bigone(Exchange, ImplicitAPI):
|
|
336
336
|
'limit': 200,
|
337
337
|
'daysBack': None,
|
338
338
|
'untilDays': None,
|
339
|
+
'symbolRequired': True,
|
339
340
|
},
|
340
341
|
'fetchOrder': {
|
341
342
|
'marginMode': False,
|
342
343
|
'trigger': False,
|
343
344
|
'trailing': False,
|
345
|
+
'symbolRequired': False,
|
344
346
|
},
|
345
347
|
'fetchOpenOrders': {
|
346
348
|
'marginMode': False,
|
347
349
|
'limit': 200,
|
348
350
|
'trigger': False,
|
349
351
|
'trailing': False,
|
352
|
+
'symbolRequired': True,
|
350
353
|
},
|
351
354
|
'fetchOrders': {
|
352
355
|
'marginMode': False,
|
@@ -355,6 +358,7 @@ class bigone(Exchange, ImplicitAPI):
|
|
355
358
|
'untilDays': None,
|
356
359
|
'trigger': False,
|
357
360
|
'trailing': False,
|
361
|
+
'symbolRequired': True,
|
358
362
|
},
|
359
363
|
'fetchClosedOrders': {
|
360
364
|
'marginMode': False,
|
@@ -364,6 +368,7 @@ class bigone(Exchange, ImplicitAPI):
|
|
364
368
|
'untilDays': None,
|
365
369
|
'trigger': False,
|
366
370
|
'trailing': False,
|
371
|
+
'symbolRequired': True,
|
367
372
|
},
|
368
373
|
'fetchOHLCV': {
|
369
374
|
'limit': 500,
|