from bitquote_client.client.client import BitquoteClientImpl

from conio_sdk.logging.factory import LOGGING_FACTORY
from etc import settings


if settings.BITSCROOGE_INDEX_ID:
    from bitscrooge_client.client.client import BitscroogeClientImpl
    from bitscrooge_client.client.proto_client import BitscroogeProtoClientImpl
    _bitscrooge_client = BitscroogeClientImpl(
        settings.BITSCROOGE_URL,
        settings.BITSCROOGE_SECRET_KEY
    )
    quoting_client = BitscroogeProtoClientImpl(
        _bitscrooge_client,
        settings.BITSCROOGE_INDEX_ID,
        logger=LOGGING_FACTORY.wallet
    )
else:
    quoting_client = BitquoteClientImpl(
        settings.BITQUOTE_URL, settings.BITQUOTE_SECRET_KEY,
        settings.PRICE_SOURCE_EXCHANGE
    )
