ccxt 4.2.30__py2.py3-none-any.whl → 4.2.34__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.
Potentially problematic release.
This version of ccxt might be problematic. Click here for more details.
- ccxt/__init__.py +1 -1
- ccxt/abstract/coinbase.py +10 -0
- ccxt/abstract/okx.py +12 -1
- ccxt/ace.py +4 -3
- ccxt/alpaca.py +1 -1
- ccxt/ascendex.py +6 -6
- ccxt/async_support/__init__.py +1 -1
- ccxt/async_support/ace.py +4 -3
- ccxt/async_support/alpaca.py +1 -1
- ccxt/async_support/ascendex.py +6 -6
- ccxt/async_support/base/exchange.py +62 -39
- ccxt/async_support/bigone.py +25 -5
- ccxt/async_support/binance.py +17 -16
- ccxt/async_support/bingx.py +10 -9
- ccxt/async_support/bit2c.py +13 -1
- ccxt/async_support/bitbank.py +2 -2
- ccxt/async_support/bitbns.py +1 -1
- ccxt/async_support/bitfinex.py +5 -5
- ccxt/async_support/bitfinex2.py +386 -40
- ccxt/async_support/bitflyer.py +5 -5
- ccxt/async_support/bitforex.py +4 -1
- ccxt/async_support/bitget.py +11 -11
- ccxt/async_support/bithumb.py +2 -2
- ccxt/async_support/bitmart.py +9 -9
- ccxt/async_support/bitmex.py +3 -3
- ccxt/async_support/bitopro.py +2 -2
- ccxt/async_support/bitrue.py +8 -8
- ccxt/async_support/bitso.py +4 -4
- ccxt/async_support/bitstamp.py +2 -2
- ccxt/async_support/bitteam.py +1 -1
- ccxt/async_support/bitvavo.py +3 -3
- ccxt/async_support/bl3p.py +1 -1
- ccxt/async_support/blockchaincom.py +3 -3
- ccxt/async_support/btcalpha.py +1 -1
- ccxt/async_support/btcbox.py +1 -1
- ccxt/async_support/btcmarkets.py +2 -2
- ccxt/async_support/btcturk.py +1 -1
- ccxt/async_support/bybit.py +9 -9
- ccxt/async_support/cex.py +1 -1
- ccxt/async_support/coinbase.py +16 -6
- ccxt/async_support/coinbasepro.py +2 -2
- ccxt/async_support/coincheck.py +1 -1
- ccxt/async_support/coinex.py +9 -9
- ccxt/async_support/coinlist.py +4 -4
- ccxt/async_support/coinmate.py +2 -2
- ccxt/async_support/coinmetro.py +2 -2
- ccxt/async_support/coinone.py +1 -1
- ccxt/async_support/coinsph.py +2 -2
- ccxt/async_support/coinspot.py +1 -1
- ccxt/async_support/cryptocom.py +14 -14
- ccxt/async_support/currencycom.py +1 -1
- ccxt/async_support/delta.py +2 -2
- ccxt/async_support/deribit.py +5 -4
- ccxt/async_support/digifinex.py +6 -6
- ccxt/async_support/exmo.py +2 -2
- ccxt/async_support/gate.py +41 -37
- ccxt/async_support/gemini.py +2 -2
- ccxt/async_support/hitbtc.py +5 -5
- ccxt/async_support/hollaex.py +2 -2
- ccxt/async_support/htx.py +11 -11
- ccxt/async_support/huobijp.py +4 -4
- ccxt/async_support/idex.py +2 -2
- ccxt/async_support/independentreserve.py +2 -2
- ccxt/async_support/indodax.py +2 -2
- ccxt/async_support/kraken.py +45 -5
- ccxt/async_support/krakenfutures.py +8 -5
- ccxt/async_support/kucoin.py +8 -8
- ccxt/async_support/kucoinfutures.py +4 -4
- ccxt/async_support/kuna.py +2 -2
- ccxt/async_support/latoken.py +3 -3
- ccxt/async_support/lbank.py +5 -4
- ccxt/async_support/luno.py +1 -1
- ccxt/async_support/lykke.py +2 -2
- ccxt/async_support/mercado.py +2 -2
- ccxt/async_support/mexc.py +7 -6
- ccxt/async_support/ndax.py +2 -2
- ccxt/async_support/novadax.py +4 -4
- ccxt/async_support/oceanex.py +1 -1
- ccxt/async_support/okcoin.py +5 -5
- ccxt/async_support/okx.py +26 -12
- ccxt/async_support/onetrading.py +2 -2
- ccxt/async_support/p2b.py +1 -1
- ccxt/async_support/paymium.py +3 -3
- ccxt/async_support/phemex.py +13 -13
- ccxt/async_support/poloniex.py +4 -4
- ccxt/async_support/poloniexfutures.py +4 -1
- ccxt/async_support/probit.py +5 -5
- ccxt/async_support/timex.py +2 -2
- ccxt/async_support/tokocrypto.py +4 -4
- ccxt/async_support/upbit.py +2 -2
- ccxt/async_support/wavesexchange.py +4 -3
- ccxt/async_support/wazirx.py +1 -1
- ccxt/async_support/whitebit.py +6 -6
- ccxt/async_support/woo.py +6 -6
- ccxt/async_support/yobit.py +41 -2
- ccxt/async_support/zaif.py +2 -2
- ccxt/async_support/zonda.py +4 -4
- ccxt/base/exchange.py +77 -44
- ccxt/base/types.py +10 -0
- ccxt/bigone.py +25 -5
- ccxt/binance.py +17 -16
- ccxt/bingx.py +10 -9
- ccxt/bit2c.py +13 -1
- ccxt/bitbank.py +2 -2
- ccxt/bitbns.py +1 -1
- ccxt/bitfinex.py +5 -5
- ccxt/bitfinex2.py +386 -40
- ccxt/bitflyer.py +5 -5
- ccxt/bitforex.py +4 -1
- ccxt/bitget.py +11 -11
- ccxt/bithumb.py +2 -2
- ccxt/bitmart.py +9 -9
- ccxt/bitmex.py +3 -3
- ccxt/bitopro.py +2 -2
- ccxt/bitrue.py +8 -8
- ccxt/bitso.py +4 -4
- ccxt/bitstamp.py +2 -2
- ccxt/bitteam.py +1 -1
- ccxt/bitvavo.py +3 -3
- ccxt/bl3p.py +1 -1
- ccxt/blockchaincom.py +3 -3
- ccxt/btcalpha.py +1 -1
- ccxt/btcbox.py +1 -1
- ccxt/btcmarkets.py +2 -2
- ccxt/btcturk.py +1 -1
- ccxt/bybit.py +9 -9
- ccxt/cex.py +1 -1
- ccxt/coinbase.py +16 -6
- ccxt/coinbasepro.py +2 -2
- ccxt/coincheck.py +1 -1
- ccxt/coinex.py +9 -9
- ccxt/coinlist.py +4 -4
- ccxt/coinmate.py +2 -2
- ccxt/coinmetro.py +2 -2
- ccxt/coinone.py +1 -1
- ccxt/coinsph.py +2 -2
- ccxt/coinspot.py +1 -1
- ccxt/cryptocom.py +14 -14
- ccxt/currencycom.py +1 -1
- ccxt/delta.py +2 -2
- ccxt/deribit.py +5 -4
- ccxt/digifinex.py +6 -6
- ccxt/exmo.py +2 -2
- ccxt/gate.py +41 -37
- ccxt/gemini.py +2 -2
- ccxt/hitbtc.py +5 -5
- ccxt/hollaex.py +2 -2
- ccxt/htx.py +11 -11
- ccxt/huobijp.py +4 -4
- ccxt/idex.py +2 -2
- ccxt/independentreserve.py +2 -2
- ccxt/indodax.py +2 -2
- ccxt/kraken.py +45 -5
- ccxt/krakenfutures.py +8 -5
- ccxt/kucoin.py +8 -8
- ccxt/kucoinfutures.py +4 -4
- ccxt/kuna.py +2 -2
- ccxt/latoken.py +3 -3
- ccxt/lbank.py +5 -4
- ccxt/luno.py +1 -1
- ccxt/lykke.py +2 -2
- ccxt/mercado.py +2 -2
- ccxt/mexc.py +7 -6
- ccxt/ndax.py +2 -2
- ccxt/novadax.py +4 -4
- ccxt/oceanex.py +1 -1
- ccxt/okcoin.py +5 -5
- ccxt/okx.py +26 -12
- ccxt/onetrading.py +2 -2
- ccxt/p2b.py +1 -1
- ccxt/paymium.py +3 -3
- ccxt/phemex.py +13 -13
- ccxt/poloniex.py +4 -4
- ccxt/poloniexfutures.py +4 -1
- ccxt/pro/__init__.py +1 -1
- ccxt/pro/alpaca.py +8 -4
- ccxt/pro/ascendex.py +1 -2
- ccxt/pro/binance.py +14 -10
- ccxt/pro/bingx.py +1 -1
- ccxt/pro/bitfinex.py +21 -22
- ccxt/pro/bitfinex2.py +13 -15
- ccxt/pro/bitget.py +3 -1
- ccxt/pro/bitmart.py +3 -7
- ccxt/pro/bitmex.py +4 -6
- ccxt/pro/bitopro.py +2 -4
- ccxt/pro/bitrue.py +1 -1
- ccxt/pro/bitstamp.py +2 -3
- ccxt/pro/bitvavo.py +10 -5
- ccxt/pro/blockchaincom.py +22 -22
- ccxt/pro/bybit.py +5 -5
- ccxt/pro/cex.py +7 -7
- ccxt/pro/coinbase.py +3 -2
- ccxt/pro/coinbasepro.py +1 -1
- ccxt/pro/coinex.py +15 -13
- ccxt/pro/currencycom.py +5 -6
- ccxt/pro/deribit.py +4 -4
- ccxt/pro/exmo.py +15 -13
- ccxt/pro/gate.py +1 -1
- ccxt/pro/gemini.py +4 -2
- ccxt/pro/hitbtc.py +10 -9
- ccxt/pro/hollaex.py +2 -2
- ccxt/pro/htx.py +6 -6
- ccxt/pro/huobijp.py +3 -4
- ccxt/pro/idex.py +1 -1
- ccxt/pro/independentreserve.py +14 -13
- ccxt/pro/kraken.py +10 -14
- ccxt/pro/krakenfutures.py +10 -6
- ccxt/pro/kucoin.py +10 -10
- ccxt/pro/kucoinfutures.py +11 -10
- ccxt/pro/lbank.py +10 -10
- ccxt/pro/luno.py +12 -14
- ccxt/pro/mexc.py +3 -2
- ccxt/pro/ndax.py +7 -11
- ccxt/pro/okcoin.py +7 -10
- ccxt/pro/okx.py +6 -9
- ccxt/pro/onetrading.py +16 -15
- ccxt/pro/p2b.py +5 -3
- ccxt/pro/phemex.py +16 -11
- ccxt/pro/poloniex.py +6 -4
- ccxt/pro/poloniexfutures.py +13 -9
- ccxt/pro/probit.py +15 -12
- ccxt/pro/upbit.py +8 -8
- ccxt/pro/wazirx.py +6 -3
- ccxt/pro/woo.py +9 -7
- ccxt/probit.py +5 -5
- ccxt/test/base/test_order_book.py +7 -7
- ccxt/test/base/test_shared_methods.py +1 -1
- ccxt/test/test_async.py +86 -36
- ccxt/test/test_sync.py +86 -36
- ccxt/timex.py +2 -2
- ccxt/tokocrypto.py +4 -4
- ccxt/upbit.py +2 -2
- ccxt/wavesexchange.py +4 -3
- ccxt/wazirx.py +1 -1
- ccxt/whitebit.py +6 -6
- ccxt/woo.py +6 -6
- ccxt/yobit.py +41 -2
- ccxt/zaif.py +2 -2
- ccxt/zonda.py +4 -4
- {ccxt-4.2.30.dist-info → ccxt-4.2.34.dist-info}/METADATA +10 -10
- ccxt-4.2.34.dist-info/RECORD +438 -0
- ccxt-4.2.30.dist-info/RECORD +0 -438
- {ccxt-4.2.30.dist-info → ccxt-4.2.34.dist-info}/WHEEL +0 -0
- {ccxt-4.2.30.dist-info → ccxt-4.2.34.dist-info}/top_level.txt +0 -0
ccxt/test/test_async.py
CHANGED
@@ -27,7 +27,7 @@ import asyncio
|
|
27
27
|
from ccxt.base.errors import NotSupported
|
28
28
|
from ccxt.base.errors import ProxyError
|
29
29
|
from ccxt.base.errors import OperationFailed
|
30
|
-
from ccxt.base.errors import ExchangeError
|
30
|
+
# from ccxt.base.errors import ExchangeError
|
31
31
|
from ccxt.base.errors import ExchangeNotAvailable
|
32
32
|
from ccxt.base.errors import OnMaintenance
|
33
33
|
from ccxt.base.errors import AuthenticationError
|
@@ -128,6 +128,7 @@ class baseMainTestClass():
|
|
128
128
|
response_tests_failed = False
|
129
129
|
response_tests = False
|
130
130
|
ws_tests = False
|
131
|
+
load_keys = False
|
131
132
|
skipped_methods = {}
|
132
133
|
check_public_tests = {}
|
133
134
|
test_files = {}
|
@@ -146,6 +147,9 @@ def dump(*args):
|
|
146
147
|
print(' '.join([str(arg) for arg in args]))
|
147
148
|
|
148
149
|
|
150
|
+
def convert_ascii(str):
|
151
|
+
return str # stub
|
152
|
+
|
149
153
|
def json_parse(elem):
|
150
154
|
return json.loads(elem)
|
151
155
|
|
@@ -270,6 +274,7 @@ class testMainClass(baseMainTestClass):
|
|
270
274
|
self.private_test = get_cli_arg_value('--private')
|
271
275
|
self.private_test_only = get_cli_arg_value('--privateOnly')
|
272
276
|
self.sandbox = get_cli_arg_value('--sandbox')
|
277
|
+
self.load_keys = get_cli_arg_value('--loadKeys')
|
273
278
|
self.ws_tests = get_cli_arg_value('--ws')
|
274
279
|
|
275
280
|
async def init(self, exchange_id, symbol_argv):
|
@@ -288,11 +293,12 @@ class testMainClass(baseMainTestClass):
|
|
288
293
|
await self.run_broker_id_tests()
|
289
294
|
return
|
290
295
|
symbol_str = symbol_argv if symbol_argv is not None else 'all'
|
291
|
-
|
296
|
+
exchange_object = {
|
292
297
|
'exchange': exchange_id,
|
293
298
|
'symbol': symbol_str,
|
294
299
|
'isWs': self.ws_tests,
|
295
|
-
}
|
300
|
+
}
|
301
|
+
dump(self.new_line + '' + self.new_line + '' + '[INFO] TESTING ', self.ext, json_stringify(exchange_object), self.new_line)
|
296
302
|
exchange_args = {
|
297
303
|
'verbose': self.verbose,
|
298
304
|
'debug': self.debug,
|
@@ -300,6 +306,8 @@ class testMainClass(baseMainTestClass):
|
|
300
306
|
'timeout': 30000,
|
301
307
|
}
|
302
308
|
exchange = init_exchange(exchange_id, exchange_args, self.ws_tests)
|
309
|
+
if exchange.alias:
|
310
|
+
exit_script(0)
|
303
311
|
await self.import_files(exchange)
|
304
312
|
assert len(list(self.test_files.keys())) > 0, 'Test files were not loaded' # ensure test files are found & filled
|
305
313
|
self.expand_settings(exchange)
|
@@ -373,7 +381,7 @@ class testMainClass(baseMainTestClass):
|
|
373
381
|
# others
|
374
382
|
timeout = exchange.safe_value(skipped_settings_for_exchange, 'timeout')
|
375
383
|
if timeout is not None:
|
376
|
-
exchange.timeout = timeout
|
384
|
+
exchange.timeout = exchange.parse_to_int(timeout)
|
377
385
|
if get_cli_arg_value('--useProxy'):
|
378
386
|
exchange.http_proxy = exchange.safe_string(skipped_settings_for_exchange, 'httpProxy')
|
379
387
|
exchange.https_proxy = exchange.safe_string(skipped_settings_for_exchange, 'httpsProxy')
|
@@ -445,6 +453,7 @@ class testMainClass(baseMainTestClass):
|
|
445
453
|
# if it was passed successfully, add to the list of successfull tests
|
446
454
|
if is_public:
|
447
455
|
self.checked_public_tests[method_name] = True
|
456
|
+
return
|
448
457
|
|
449
458
|
async def test_safe(self, method_name, exchange, args=[], is_public=False):
|
450
459
|
# `testSafe` method does not throw an exception, instead mutes it. The reason we
|
@@ -505,6 +514,7 @@ class testMainClass(baseMainTestClass):
|
|
505
514
|
else:
|
506
515
|
dump('[TEST_FAILURE]', exception_message(e), self.exchange_hint(exchange), method_name, args_stringified)
|
507
516
|
return False
|
517
|
+
return True
|
508
518
|
|
509
519
|
async def run_public_tests(self, exchange, symbol):
|
510
520
|
tests = {
|
@@ -701,7 +711,7 @@ class testMainClass(baseMainTestClass):
|
|
701
711
|
dump('[INFO] Skipping private tests', 'Keys not found')
|
702
712
|
return
|
703
713
|
code = self.get_exchange_code(exchange)
|
704
|
-
# if (exchange.
|
714
|
+
# if (exchange.deepExtendedTest) {
|
705
715
|
# await test ('InvalidNonce', exchange, symbol);
|
706
716
|
# await test ('OrderNotFound', exchange, symbol);
|
707
717
|
# await test ('InvalidOrder', exchange, symbol);
|
@@ -778,7 +788,7 @@ class testMainClass(baseMainTestClass):
|
|
778
788
|
exception = e
|
779
789
|
# if exception was set, then throw it
|
780
790
|
if exception:
|
781
|
-
|
791
|
+
error_message = '[TEST_FAILURE] Failed ' + proxy_test_name + ' : ' + exception_message(exception)
|
782
792
|
|
783
793
|
async def start_test(self, exchange, symbol):
|
784
794
|
# we do not need to test aliases
|
@@ -881,9 +891,9 @@ class testMainClass(baseMainTestClass):
|
|
881
891
|
|
882
892
|
def assert_new_and_stored_output(self, exchange, skip_keys, new_output, stored_output, strict_type_check=True, asserting_key=None):
|
883
893
|
if is_null_value(new_output) and is_null_value(stored_output):
|
884
|
-
return
|
894
|
+
return True
|
885
895
|
if not new_output and not stored_output:
|
886
|
-
return
|
896
|
+
return True
|
887
897
|
if (isinstance(stored_output, dict)) and (isinstance(new_output, dict)):
|
888
898
|
stored_output_keys = list(stored_output.keys())
|
889
899
|
new_output_keys = list(new_output.keys())
|
@@ -915,7 +925,7 @@ class testMainClass(baseMainTestClass):
|
|
915
925
|
new_output_string = str(sanitized_new_output) if sanitized_new_output else 'undefined'
|
916
926
|
stored_output_string = str(sanitized_stored_output) if sanitized_stored_output else 'undefined'
|
917
927
|
message_error = 'output value mismatch:' + new_output_string + ' != ' + stored_output_string
|
918
|
-
if strict_type_check:
|
928
|
+
if strict_type_check and (self.lang != 'C#'):
|
919
929
|
# upon building the request we want strict type check to make sure all the types are correct
|
920
930
|
# when comparing the response we want to allow some flexibility, because a 50.0 can be equal to 50 after saving it to the json file
|
921
931
|
self.assert_static_error(sanitized_new_output == sanitized_stored_output, message_error, stored_output, new_output, asserting_key)
|
@@ -924,11 +934,34 @@ class testMainClass(baseMainTestClass):
|
|
924
934
|
is_string = (isinstance(sanitized_new_output, str)) or (isinstance(sanitized_stored_output, str))
|
925
935
|
is_undefined = (sanitized_new_output is None) or (sanitized_stored_output is None) # undefined is a perfetly valid value
|
926
936
|
if is_boolean or is_string or is_undefined:
|
927
|
-
self.
|
937
|
+
if self.lang == 'C#':
|
938
|
+
# tmp c# number comparsion
|
939
|
+
is_number = False
|
940
|
+
try:
|
941
|
+
exchange.parse_to_numeric(sanitized_new_output)
|
942
|
+
is_number = True
|
943
|
+
except Exception as e:
|
944
|
+
# if we can't parse it to number, then it's not a number
|
945
|
+
is_number = False
|
946
|
+
if is_number:
|
947
|
+
self.assert_static_error(exchange.parse_to_numeric(sanitized_new_output) == exchange.parse_to_numeric(sanitized_stored_output), message_error, stored_output, new_output, asserting_key)
|
948
|
+
return True
|
949
|
+
else:
|
950
|
+
self.assert_static_error(convert_ascii(new_output_string) == convert_ascii(stored_output_string), message_error, stored_output, new_output, asserting_key)
|
951
|
+
return True
|
952
|
+
else:
|
953
|
+
self.assert_static_error(convert_ascii(new_output_string) == convert_ascii(stored_output_string), message_error, stored_output, new_output, asserting_key)
|
954
|
+
return True
|
928
955
|
else:
|
929
|
-
|
930
|
-
|
931
|
-
|
956
|
+
if self.lang == 'C#':
|
957
|
+
stringified_new_output = exchange.number_to_string(sanitized_new_output)
|
958
|
+
stringified_stored_output = exchange.number_to_string(sanitized_stored_output)
|
959
|
+
self.assert_static_error(str(stringified_new_output) == str(stringified_stored_output), message_error, stored_output, new_output, asserting_key)
|
960
|
+
else:
|
961
|
+
numeric_new_output = exchange.parse_to_numeric(new_output_string)
|
962
|
+
numeric_stored_output = exchange.parse_to_numeric(stored_output_string)
|
963
|
+
self.assert_static_error(numeric_new_output == numeric_stored_output, message_error, stored_output, new_output, asserting_key)
|
964
|
+
return True # c# requ
|
932
965
|
|
933
966
|
def assert_static_request_output(self, exchange, type, skip_keys, stored_url, request_url, stored_output, new_output):
|
934
967
|
if stored_url != request_url:
|
@@ -952,12 +985,12 @@ class testMainClass(baseMainTestClass):
|
|
952
985
|
new_url_params = self.urlencoded_to_dict(new_url_query)
|
953
986
|
self.assert_new_and_stored_output(exchange, skip_keys, new_url_params, stored_url_params)
|
954
987
|
return
|
955
|
-
if type == 'json':
|
988
|
+
if type == 'json' and (stored_output is not None) and (new_output is not None):
|
956
989
|
if isinstance(stored_output, str):
|
957
990
|
stored_output = json_parse(stored_output)
|
958
991
|
if isinstance(new_output, str):
|
959
992
|
new_output = json_parse(new_output)
|
960
|
-
elif type == 'urlencoded':
|
993
|
+
elif type == 'urlencoded' and (stored_output is not None) and (new_output is not None):
|
961
994
|
stored_output = self.urlencoded_to_dict(stored_output)
|
962
995
|
new_output = self.urlencoded_to_dict(new_output)
|
963
996
|
elif type == 'both':
|
@@ -1071,8 +1104,9 @@ class testMainClass(baseMainTestClass):
|
|
1071
1104
|
skip_keys = exchange.safe_value(exchange_data, 'skipKeys', [])
|
1072
1105
|
await self.test_method_statically(exchange, method, result, type, skip_keys)
|
1073
1106
|
# reset options
|
1074
|
-
exchange.options = old_exchange_options
|
1107
|
+
exchange.options = exchange.deep_extend(old_exchange_options, {})
|
1075
1108
|
await close(exchange)
|
1109
|
+
return True # in c# methods that will be used with promiseAll need to return something
|
1076
1110
|
|
1077
1111
|
async def test_exchange_response_statically(self, exchange_name, exchange_data, test_name=None):
|
1078
1112
|
exchange = self.init_offline_exchange(exchange_name)
|
@@ -1092,16 +1126,20 @@ class testMainClass(baseMainTestClass):
|
|
1092
1126
|
is_disabled = exchange.safe_value(result, 'disabled', False)
|
1093
1127
|
if is_disabled:
|
1094
1128
|
continue
|
1129
|
+
is_disabled_c_sharp = exchange.safe_value(result, 'disabledCS', False)
|
1130
|
+
if is_disabled_c_sharp and (self.lang == 'C#'):
|
1131
|
+
continue
|
1095
1132
|
is_disabled_php = exchange.safe_value(result, 'disabledPHP', False)
|
1096
|
-
if is_disabled_php and (self.
|
1133
|
+
if is_disabled_php and (self.lang == 'PHP'):
|
1097
1134
|
continue
|
1098
1135
|
if (test_name is not None) and (test_name != description):
|
1099
1136
|
continue
|
1100
1137
|
skip_keys = exchange.safe_value(exchange_data, 'skipKeys', [])
|
1101
1138
|
await self.test_response_statically(exchange, method, skip_keys, result)
|
1102
1139
|
# reset options
|
1103
|
-
exchange.options = old_exchange_options
|
1140
|
+
exchange.options = exchange.deep_extend(old_exchange_options, {})
|
1104
1141
|
await close(exchange)
|
1142
|
+
return True # in c# methods that will be used with promiseAll need to return something
|
1105
1143
|
|
1106
1144
|
def get_number_of_tests_from_exchange(self, exchange, exchange_data):
|
1107
1145
|
sum = 0
|
@@ -1171,7 +1209,7 @@ class testMainClass(baseMainTestClass):
|
|
1171
1209
|
except Exception as e:
|
1172
1210
|
spot_order_request = self.urlencoded_to_dict(exchange.last_request_body)
|
1173
1211
|
client_order_id = spot_order_request['newClientOrderId']
|
1174
|
-
assert client_order_id.startswith(spot_id), 'spot clientOrderId does not start with spotId'
|
1212
|
+
assert client_order_id.startswith(str(spot_id)), 'spot clientOrderId does not start with spotId'
|
1175
1213
|
swap_id = 'x-xcKtGhcu'
|
1176
1214
|
swap_order_request = None
|
1177
1215
|
try:
|
@@ -1184,10 +1222,11 @@ class testMainClass(baseMainTestClass):
|
|
1184
1222
|
except Exception as e:
|
1185
1223
|
swap_inverse_order_request = self.urlencoded_to_dict(exchange.last_request_body)
|
1186
1224
|
client_order_id_spot = swap_order_request['newClientOrderId']
|
1187
|
-
assert client_order_id_spot.startswith(swap_id), 'swap clientOrderId does not start with swapId'
|
1225
|
+
assert client_order_id_spot.startswith(str(swap_id)), 'swap clientOrderId does not start with swapId'
|
1188
1226
|
client_order_id_inverse = swap_inverse_order_request['newClientOrderId']
|
1189
|
-
assert client_order_id_inverse.startswith(swap_id), 'swap clientOrderIdInverse does not start with swapId'
|
1227
|
+
assert client_order_id_inverse.startswith(str(swap_id)), 'swap clientOrderIdInverse does not start with swapId'
|
1190
1228
|
await close(exchange)
|
1229
|
+
return True
|
1191
1230
|
|
1192
1231
|
async def test_okx(self):
|
1193
1232
|
exchange = self.init_offline_exchange('okx')
|
@@ -1198,7 +1237,7 @@ class testMainClass(baseMainTestClass):
|
|
1198
1237
|
except Exception as e:
|
1199
1238
|
spot_order_request = json_parse(exchange.last_request_body)
|
1200
1239
|
client_order_id = spot_order_request[0]['clOrdId'] # returns order inside array
|
1201
|
-
assert client_order_id.startswith(id), 'spot clientOrderId does not start with id'
|
1240
|
+
assert client_order_id.startswith(str(id)), 'spot clientOrderId does not start with id'
|
1202
1241
|
assert spot_order_request[0]['tag'] == id, 'id different from spot tag'
|
1203
1242
|
swap_order_request = None
|
1204
1243
|
try:
|
@@ -1206,9 +1245,10 @@ class testMainClass(baseMainTestClass):
|
|
1206
1245
|
except Exception as e:
|
1207
1246
|
swap_order_request = json_parse(exchange.last_request_body)
|
1208
1247
|
client_order_id_spot = swap_order_request[0]['clOrdId']
|
1209
|
-
assert client_order_id_spot.startswith(id), 'swap clientOrderId does not start with id'
|
1248
|
+
assert client_order_id_spot.startswith(str(id)), 'swap clientOrderId does not start with id'
|
1210
1249
|
assert swap_order_request[0]['tag'] == id, 'id different from swap tag'
|
1211
1250
|
await close(exchange)
|
1251
|
+
return True
|
1212
1252
|
|
1213
1253
|
async def test_cryptocom(self):
|
1214
1254
|
exchange = self.init_offline_exchange('cryptocom')
|
@@ -1221,6 +1261,7 @@ class testMainClass(baseMainTestClass):
|
|
1221
1261
|
request = json_parse(exchange.last_request_body)
|
1222
1262
|
assert request['params']['broker_id'] == id, 'id different from broker_id'
|
1223
1263
|
await close(exchange)
|
1264
|
+
return True
|
1224
1265
|
|
1225
1266
|
async def test_bybit(self):
|
1226
1267
|
exchange = self.init_offline_exchange('bybit')
|
@@ -1234,6 +1275,7 @@ class testMainClass(baseMainTestClass):
|
|
1234
1275
|
req_headers = exchange.last_request_headers
|
1235
1276
|
assert req_headers['Referer'] == id, 'id not in headers'
|
1236
1277
|
await close(exchange)
|
1278
|
+
return True
|
1237
1279
|
|
1238
1280
|
async def test_kucoin(self):
|
1239
1281
|
exchange = self.init_offline_exchange('kucoin')
|
@@ -1248,19 +1290,21 @@ class testMainClass(baseMainTestClass):
|
|
1248
1290
|
id = 'ccxt'
|
1249
1291
|
assert req_headers['KC-API-PARTNER'] == id, 'id not in headers'
|
1250
1292
|
await close(exchange)
|
1293
|
+
return True
|
1251
1294
|
|
1252
1295
|
async def test_kucoinfutures(self):
|
1253
|
-
|
1296
|
+
exchange = self.init_offline_exchange('kucoinfutures')
|
1254
1297
|
req_headers = None
|
1255
1298
|
id = 'ccxtfutures'
|
1256
|
-
assert
|
1257
|
-
assert
|
1299
|
+
assert exchange.options['partner']['future']['id'] == id, 'id not in options'
|
1300
|
+
assert exchange.options['partner']['future']['key'] == '1b327198-f30c-4f14-a0ac-918871282f15', 'key not in options'
|
1258
1301
|
try:
|
1259
|
-
await
|
1302
|
+
await exchange.create_order('BTC/USDT:USDT', 'limit', 'buy', 1, 20000)
|
1260
1303
|
except Exception as e:
|
1261
|
-
req_headers =
|
1304
|
+
req_headers = exchange.last_request_headers
|
1262
1305
|
assert req_headers['KC-API-PARTNER'] == id, 'id not in headers'
|
1263
|
-
await close(
|
1306
|
+
await close(exchange)
|
1307
|
+
return True
|
1264
1308
|
|
1265
1309
|
async def test_bitget(self):
|
1266
1310
|
exchange = self.init_offline_exchange('bitget')
|
@@ -1273,6 +1317,7 @@ class testMainClass(baseMainTestClass):
|
|
1273
1317
|
req_headers = exchange.last_request_headers
|
1274
1318
|
assert req_headers['X-CHANNEL-API-CODE'] == id, 'id not in headers'
|
1275
1319
|
await close(exchange)
|
1320
|
+
return True
|
1276
1321
|
|
1277
1322
|
async def test_mexc(self):
|
1278
1323
|
exchange = self.init_offline_exchange('mexc')
|
@@ -1286,6 +1331,7 @@ class testMainClass(baseMainTestClass):
|
|
1286
1331
|
req_headers = exchange.last_request_headers
|
1287
1332
|
assert req_headers['source'] == id, 'id not in headers'
|
1288
1333
|
await close(exchange)
|
1334
|
+
return True
|
1289
1335
|
|
1290
1336
|
async def test_htx(self):
|
1291
1337
|
exchange = self.init_offline_exchange('htx')
|
@@ -1297,7 +1343,7 @@ class testMainClass(baseMainTestClass):
|
|
1297
1343
|
except Exception as e:
|
1298
1344
|
spot_order_request = json_parse(exchange.last_request_body)
|
1299
1345
|
client_order_id = spot_order_request['client-order-id']
|
1300
|
-
assert client_order_id.startswith(id), 'spot clientOrderId does not start with id'
|
1346
|
+
assert client_order_id.startswith(str(id)), 'spot clientOrderId does not start with id'
|
1301
1347
|
# swap test
|
1302
1348
|
swap_order_request = None
|
1303
1349
|
try:
|
@@ -1310,10 +1356,11 @@ class testMainClass(baseMainTestClass):
|
|
1310
1356
|
except Exception as e:
|
1311
1357
|
swap_inverse_order_request = json_parse(exchange.last_request_body)
|
1312
1358
|
client_order_id_spot = swap_order_request['channel_code']
|
1313
|
-
assert client_order_id_spot.startswith(id), 'swap channel_code does not start with id'
|
1359
|
+
assert client_order_id_spot.startswith(str(id)), 'swap channel_code does not start with id'
|
1314
1360
|
client_order_id_inverse = swap_inverse_order_request['channel_code']
|
1315
|
-
assert client_order_id_inverse.startswith(id), 'swap inverse channel_code does not start with id'
|
1361
|
+
assert client_order_id_inverse.startswith(str(id)), 'swap inverse channel_code does not start with id'
|
1316
1362
|
await close(exchange)
|
1363
|
+
return True
|
1317
1364
|
|
1318
1365
|
async def test_woo(self):
|
1319
1366
|
exchange = self.init_offline_exchange('woo')
|
@@ -1325,7 +1372,7 @@ class testMainClass(baseMainTestClass):
|
|
1325
1372
|
except Exception as e:
|
1326
1373
|
spot_order_request = self.urlencoded_to_dict(exchange.last_request_body)
|
1327
1374
|
broker_id = spot_order_request['broker_id']
|
1328
|
-
assert broker_id.startswith(id), 'broker_id does not start with id'
|
1375
|
+
assert broker_id.startswith(str(id)), 'broker_id does not start with id'
|
1329
1376
|
# swap test
|
1330
1377
|
stop_order_request = None
|
1331
1378
|
try:
|
@@ -1335,8 +1382,9 @@ class testMainClass(baseMainTestClass):
|
|
1335
1382
|
except Exception as e:
|
1336
1383
|
stop_order_request = json_parse(exchange.last_request_body)
|
1337
1384
|
client_order_id_spot = stop_order_request['brokerId']
|
1338
|
-
assert client_order_id_spot.startswith(id), 'brokerId does not start with id'
|
1385
|
+
assert client_order_id_spot.startswith(str(id)), 'brokerId does not start with id'
|
1339
1386
|
await close(exchange)
|
1387
|
+
return True
|
1340
1388
|
|
1341
1389
|
async def test_bitmart(self):
|
1342
1390
|
exchange = self.init_offline_exchange('bitmart')
|
@@ -1350,6 +1398,7 @@ class testMainClass(baseMainTestClass):
|
|
1350
1398
|
req_headers = exchange.last_request_headers
|
1351
1399
|
assert req_headers['X-BM-BROKER-ID'] == id, 'id not in headers'
|
1352
1400
|
await close(exchange)
|
1401
|
+
return True
|
1353
1402
|
|
1354
1403
|
async def test_coinex(self):
|
1355
1404
|
exchange = self.init_offline_exchange('coinex')
|
@@ -1361,8 +1410,9 @@ class testMainClass(baseMainTestClass):
|
|
1361
1410
|
except Exception as e:
|
1362
1411
|
spot_order_request = json_parse(exchange.last_request_body)
|
1363
1412
|
client_order_id = spot_order_request['client_id']
|
1364
|
-
assert client_order_id.startswith(id), 'clientOrderId does not start with id'
|
1413
|
+
assert client_order_id.startswith(str(id)), 'clientOrderId does not start with id'
|
1365
1414
|
await close(exchange)
|
1415
|
+
return True
|
1366
1416
|
|
1367
1417
|
async def test_bingx(self):
|
1368
1418
|
exchange = self.init_offline_exchange('bingx')
|
@@ -1386,7 +1436,7 @@ class testMainClass(baseMainTestClass):
|
|
1386
1436
|
except Exception as e:
|
1387
1437
|
request = json_parse(exchange.last_request_body)
|
1388
1438
|
client_order_id = request['clOrdID']
|
1389
|
-
assert client_order_id.startswith(id), 'clOrdID does not start with id'
|
1439
|
+
assert client_order_id.startswith(str(id)), 'clOrdID does not start with id'
|
1390
1440
|
await close(exchange)
|
1391
1441
|
|
1392
1442
|
# ***** AUTO-TRANSPILER-END *****
|