Add fix for bibox exchange

This commit is contained in:
hroff-1902 2019-11-13 19:50:54 +03:00
parent baea06eac7
commit e26bbc7de8
3 changed files with 29 additions and 0 deletions

View File

@ -15,3 +15,4 @@ from freqtrade.exchange.exchange import (market_is_active, # noqa: F401
symbol_is_pair)
from freqtrade.exchange.kraken import Kraken # noqa: F401
from freqtrade.exchange.binance import Binance # noqa: F401
from freqtrade.exchange.bibox import Bibox # noqa: F401

View File

@ -0,0 +1,21 @@
""" Bibox exchange subclass """
import logging
from typing import Dict
from freqtrade.exchange import Exchange
logger = logging.getLogger(__name__)
class Bibox(Exchange):
"""
Bibox exchange class. Contains adjustments needed for Freqtrade to work
with this exchange.
Please note that this exchange is not included in the list of exchanges
officially supported by the Freqtrade development team. So some features
may still not work as expected.
"""
# Adjust ccxt exchange API metadata info
_ccxt_has: Dict = {"fetchCurrencies": False}

View File

@ -30,6 +30,9 @@ class Exchange:
_config: Dict = {}
# Adjustments to ccxt exchange API metadata info (ccxt exchange `has` options)
_ccxt_has: Dict = {}
# Parameters to add directly to buy/sell calls (like agreeing to trading agreement)
_params: Dict = {}
@ -152,6 +155,10 @@ class Exchange:
except ccxt.BaseError as e:
raise OperationalException(f"Initialization of ccxt failed. Reason: {e}") from e
# Adjust ccxt API metadata info (`has` options) for the exchange
for k, v in self._ccxt_has.items():
api.has[k] = v
self.set_sandbox(api, exchange_config, name)
return api