mirror of
https://github.com/freqtrade/freqtrade.git
synced 2025-11-29 00:23:07 +00:00
@@ -139,6 +139,23 @@ EXCHANGES = {
|
||||
"leverage_tiers_public": False,
|
||||
"leverage_in_spot_market": True,
|
||||
"trades_lookback_hours": 12,
|
||||
"sample_balances": {
|
||||
"exchange_response": {
|
||||
"result": {
|
||||
"ADA": {"balance": "0.00000000", "hold_trade": "0.00000000"},
|
||||
"ADA.F": {"balance": "2.00000000", "hold_trade": "0.00000000"},
|
||||
"XBT": {"balance": "0.00060000", "hold_trade": "0.00000000"},
|
||||
"XBT.F": {"balance": "0.00100000", "hold_trade": "0.00000000"},
|
||||
}
|
||||
},
|
||||
"expected": {
|
||||
"ADA": {"free": 0.0, "total": 0.0, "used": 0.0},
|
||||
"ADA.F": {"free": 2.0, "total": 2.0, "used": 0.0},
|
||||
"BTC": {"free": 0.0006, "total": 0.0006, "used": 0.0},
|
||||
# XBT.F should be mapped to BTC.F
|
||||
"XBT.F": {"free": 0.001, "total": 0.001, "used": 0.0},
|
||||
},
|
||||
},
|
||||
},
|
||||
"kucoin": {
|
||||
"pair": "XRP/USDT",
|
||||
|
||||
@@ -114,6 +114,19 @@ class TestCCXTExchange:
|
||||
else:
|
||||
pytest.skip(f"No sample Trades available for exchange {exchange_name}")
|
||||
|
||||
def test_ccxt_balances_parse(self, exchange: EXCHANGE_FIXTURE_TYPE):
|
||||
exch, exchange_name = exchange
|
||||
if balance_response := EXCHANGES[exchange_name].get("sample_balances"):
|
||||
balances = exch._api.parse_balance(balance_response["exchange_response"])
|
||||
expected = balance_response["expected"]
|
||||
for currency, balance in expected.items():
|
||||
assert currency in balances
|
||||
assert isinstance(balance, dict)
|
||||
assert balance == balances[currency]
|
||||
pass
|
||||
else:
|
||||
pytest.skip(f"No sample Balances available for exchange {exchange_name}")
|
||||
|
||||
def test_ccxt_fetch_tickers(self, exchange: EXCHANGE_FIXTURE_TYPE):
|
||||
exch, exchangename = exchange
|
||||
pair = EXCHANGES[exchangename]["pair"]
|
||||
|
||||
Reference in New Issue
Block a user