#!/usr/bin/env python

import asyncio
import logging
from typing import (
    Optional
)
from hummingbot.core.data_type.user_stream_tracker_data_source import UserStreamTrackerDataSource
from hummingbot.logger import HummingbotLogger
from hummingbot.core.data_type.user_stream_tracker import UserStreamTracker
from hummingbot.core.utils.async_utils import (
    safe_ensure_future,
    safe_gather,
)
from .openware_api_user_stream_data_source import OpenwareAPIUserStreamDataSource
#from openware.client import Client as OpenwareClient
from hummingbot.connector.exchange.openware.lib.client import Client as OpenwareClient

class OpenwareUserStreamTracker(UserStreamTracker):
    _bust_logger: Optional[HummingbotLogger] = None

    @classmethod
    def logger(cls) -> HummingbotLogger:
        if cls._bust_logger is None:
            cls._bust_logger = logging.getLogger(__name__)
        return cls._bust_logger

    def __init__(self, openware_client: Optional[OpenwareClient] = None, domain: str = "com"):
        super().__init__()
        self._openware_client: OpenwareClient = openware_client
        self._ev_loop: asyncio.events.AbstractEventLoop = asyncio.get_event_loop()
        self._data_source: Optional[UserStreamTrackerDataSource] = None
        self._user_stream_tracking_task: Optional[asyncio.Task] = None
        self._domain = domain

    @property
    def data_source(self) -> UserStreamTrackerDataSource:
        if not self._data_source:
            self._data_source = OpenwareAPIUserStreamDataSource(openware_client=self._openware_client, domain=self._domain)
        return self._data_source

    @property
    def exchange_name(self) -> str:
        if self._domain == "com":
            return "openware"
        else:
            return f"openware_{self._domain}"

    async def start(self):
        self._user_stream_tracking_task = safe_ensure_future(
            self.data_source.listen_for_user_stream(self._ev_loop, self._user_stream)
        )
        await safe_gather(self._user_stream_tracking_task)

32012553b903126cf09aed20c5803884a72a5ac6
<mask token>


class OpenwareUserStreamTracker(UserStreamTracker):
    _bust_logger: Optional[HummingbotLogger] = None
    <mask token>
    <mask token>
    <mask token>
    <mask token>

    async def start(self):
        self._user_stream_tracking_task = safe_ensure_future(self.
            data_source.listen_for_user_stream(self._ev_loop, self.
            _user_stream))
        await safe_gather(self._user_stream_tracking_task)

<mask token>


class OpenwareUserStreamTracker(UserStreamTracker):
    _bust_logger: Optional[HummingbotLogger] = None

    @classmethod
    def logger(cls) ->HummingbotLogger:
        if cls._bust_logger is None:
            cls._bust_logger = logging.getLogger(__name__)
        return cls._bust_logger
    <mask token>

    @property
    def data_source(self) ->UserStreamTrackerDataSource:
        if not self._data_source:
            self._data_source = OpenwareAPIUserStreamDataSource(openware_client
                =self._openware_client, domain=self._domain)
        return self._data_source

    @property
    def exchange_name(self) ->str:
        if self._domain == 'com':
            return 'openware'
        else:
            return f'openware_{self._domain}'

    async def start(self):
        self._user_stream_tracking_task = safe_ensure_future(self.
            data_source.listen_for_user_stream(self._ev_loop, self.
            _user_stream))
        await safe_gather(self._user_stream_tracking_task)

<mask token>


class OpenwareUserStreamTracker(UserStreamTracker):
    _bust_logger: Optional[HummingbotLogger] = None

    @classmethod
    def logger(cls) ->HummingbotLogger:
        if cls._bust_logger is None:
            cls._bust_logger = logging.getLogger(__name__)
        return cls._bust_logger

    def __init__(self, openware_client: Optional[OpenwareClient]=None,
        domain: str='com'):
        super().__init__()
        self._openware_client: OpenwareClient = openware_client
        self._ev_loop: asyncio.events.AbstractEventLoop = (asyncio.
            get_event_loop())
        self._data_source: Optional[UserStreamTrackerDataSource] = None
        self._user_stream_tracking_task: Optional[asyncio.Task] = None
        self._domain = domain

    @property
    def data_source(self) ->UserStreamTrackerDataSource:
        if not self._data_source:
            self._data_source = OpenwareAPIUserStreamDataSource(openware_client
                =self._openware_client, domain=self._domain)
        return self._data_source

    @property
    def exchange_name(self) ->str:
        if self._domain == 'com':
            return 'openware'
        else:
            return f'openware_{self._domain}'

    async def start(self):
        self._user_stream_tracking_task = safe_ensure_future(self.
            data_source.listen_for_user_stream(self._ev_loop, self.
            _user_stream))
        await safe_gather(self._user_stream_tracking_task)

import asyncio
import logging
from typing import Optional
from hummingbot.core.data_type.user_stream_tracker_data_source import UserStreamTrackerDataSource
from hummingbot.logger import HummingbotLogger
from hummingbot.core.data_type.user_stream_tracker import UserStreamTracker
from hummingbot.core.utils.async_utils import safe_ensure_future, safe_gather
from .openware_api_user_stream_data_source import OpenwareAPIUserStreamDataSource
from hummingbot.connector.exchange.openware.lib.client import Client as OpenwareClient


class OpenwareUserStreamTracker(UserStreamTracker):
    _bust_logger: Optional[HummingbotLogger] = None

    @classmethod
    def logger(cls) ->HummingbotLogger:
        if cls._bust_logger is None:
            cls._bust_logger = logging.getLogger(__name__)
        return cls._bust_logger

    def __init__(self, openware_client: Optional[OpenwareClient]=None,
        domain: str='com'):
        super().__init__()
        self._openware_client: OpenwareClient = openware_client
        self._ev_loop: asyncio.events.AbstractEventLoop = (asyncio.
            get_event_loop())
        self._data_source: Optional[UserStreamTrackerDataSource] = None
        self._user_stream_tracking_task: Optional[asyncio.Task] = None
        self._domain = domain

    @property
    def data_source(self) ->UserStreamTrackerDataSource:
        if not self._data_source:
            self._data_source = OpenwareAPIUserStreamDataSource(openware_client
                =self._openware_client, domain=self._domain)
        return self._data_source

    @property
    def exchange_name(self) ->str:
        if self._domain == 'com':
            return 'openware'
        else:
            return f'openware_{self._domain}'

    async def start(self):
        self._user_stream_tracking_task = safe_ensure_future(self.
            data_source.listen_for_user_stream(self._ev_loop, self.
            _user_stream))
        await safe_gather(self._user_stream_tracking_task)

#!/usr/bin/env python

import asyncio
import logging
from typing import (
    Optional
)
from hummingbot.core.data_type.user_stream_tracker_data_source import UserStreamTrackerDataSource
from hummingbot.logger import HummingbotLogger
from hummingbot.core.data_type.user_stream_tracker import UserStreamTracker
from hummingbot.core.utils.async_utils import (
    safe_ensure_future,
    safe_gather,
)
from .openware_api_user_stream_data_source import OpenwareAPIUserStreamDataSource
#from openware.client import Client as OpenwareClient
from hummingbot.connector.exchange.openware.lib.client import Client as OpenwareClient

class OpenwareUserStreamTracker(UserStreamTracker):
    _bust_logger: Optional[HummingbotLogger] = None

    @classmethod
    def logger(cls) -> HummingbotLogger:
        if cls._bust_logger is None:
            cls._bust_logger = logging.getLogger(__name__)
        return cls._bust_logger

    def __init__(self, openware_client: Optional[OpenwareClient] = None, domain: str = "com"):
        super().__init__()
        self._openware_client: OpenwareClient = openware_client
        self._ev_loop: asyncio.events.AbstractEventLoop = asyncio.get_event_loop()
        self._data_source: Optional[UserStreamTrackerDataSource] = None
        self._user_stream_tracking_task: Optional[asyncio.Task] = None
        self._domain = domain

    @property
    def data_source(self) -> UserStreamTrackerDataSource:
        if not self._data_source:
            self._data_source = OpenwareAPIUserStreamDataSource(openware_client=self._openware_client, domain=self._domain)
        return self._data_source

    @property
    def exchange_name(self) -> str:
        if self._domain == "com":
            return "openware"
        else:
            return f"openware_{self._domain}"

    async def start(self):
        self._user_stream_tracking_task = safe_ensure_future(
            self.data_source.listen_for_user_stream(self._ev_loop, self._user_stream)
        )
        await safe_gather(self._user_stream_tracking_task)
