Exemplo n.º 1
0
    def __init__(self, config: dict) -> None:
        global _API, _API_V2, _EXCHANGE_CONF

        _EXCHANGE_CONF.update(config)
        _API = _Bittrex(
            api_key=_EXCHANGE_CONF['key'],
            api_secret=_EXCHANGE_CONF['secret'],
            calls_per_second=1,
        )
        _API_V2 = _Bittrex(
            api_key=_EXCHANGE_CONF['key'],
            api_secret=_EXCHANGE_CONF['secret'],
            calls_per_second=1,
            api_version=API_V2_0,
        )
Exemplo n.º 2
0
    def __init__(self, config: dict) -> None:
        global _API, _API_V2, _EXCHANGE_CONF

        _EXCHANGE_CONF.update(config)
        _API = _Bittrex(api_key=_EXCHANGE_CONF['key'],
                        api_secret=_EXCHANGE_CONF['secret'],
                        calls_per_second=1,
                        api_version=API_V1_1,
                        dispatch=custom_requests)
        _API_V2 = _Bittrex(api_key=_EXCHANGE_CONF['key'],
                           api_secret=_EXCHANGE_CONF['secret'],
                           calls_per_second=1,
                           api_version=API_V2_0,
                           dispatch=custom_requests)
        self.cached_ticker = {}
Exemplo n.º 3
0
    def __init__(self, config: dict) -> None:
        global _API, _API_V2, _EXCHANGE_CONF

        _EXCHANGE_CONF.update(config)
        _API = _Bittrex(
            api_key=_EXCHANGE_CONF['key'],
            api_secret=_EXCHANGE_CONF['secret'],
            calls_per_second=1,
            api_version=API_V1_1,
            dispatch=custom_requests
        )
        _API_V2 = _Bittrex(
            api_key=_EXCHANGE_CONF['key'],
            api_secret=_EXCHANGE_CONF['secret'],
            calls_per_second=1,
            api_version=API_V2_0,
            dispatch=custom_requests
        )
        self.cached_ticker = {}
Exemplo n.º 4
0
    def __init__(self, config: dict) -> None:
        global _API, _EXCHANGE_CONF

        _EXCHANGE_CONF.update(config)
        _API = _Bittrex(api_key=_EXCHANGE_CONF['key'],
                        api_secret=_EXCHANGE_CONF['secret'])

        # Check if all pairs are available
        markets = self.get_markets()
        exchange_name = self.name
        for pair in _EXCHANGE_CONF['pair_whitelist']:
            if pair not in markets:
                raise RuntimeError('Pair {} is not available at {}'.format(
                    pair, exchange_name))
Exemplo n.º 5
0
    def __init__(self, config: dict) -> None:
        global _API, _EXCHANGE_CONF

        _EXCHANGE_CONF.update(config)
        _API = _Bittrex(api_key=_EXCHANGE_CONF['key'],
                        api_secret=_EXCHANGE_CONF['secret'])
Exemplo n.º 6
0
 def __init__(self):
     with open("key/bittrex.json") as secrets_file:
         secrets = json.load(secrets_file)
     self.client = _Bittrex(
         api_key=secrets['key'], api_secret=secrets['secret'])
     self.logger = initialize_logger(self.__class__.__name__.upper())