def get_client(exchange, authkeys=None):
    key = None
    secret = None
    if authkeys is not None:
        try:
            key = codecs.decode(authkeys[exchange]['API_KEY'], 'rot_13')
            secret = codecs.decode(authkeys[exchange]['API_SECRET'], 'rot_13')
        except:
            pass
    if exchange.lower() == 'surbtc':
        return SURBTC.Standard(key=key, secret=secret)
    elif exchange.lower() == 'kraken':
        return Kraken.Standard(key=key, secret=secret)
    elif exchange.lower() == 'bitfinex':
        return Bitfinex.Standard(key=key, secret=secret)
    elif exchange.lower() == 'cryptomkt':
        return CryptoMKT.Standard()
    else:
        raise
Exemple #2
0
 def client(self) -> Bitfinex.Auth:
     return Bitfinex.Auth(**self.credentials, **self.client_params)
Exemple #3
0
 def client_v1(self) -> Bitfinex.Public:
     return Bitfinex.Public(**self.client_params)
Exemple #4
0
 def setUp(self):
     self.client = Bitfinex.Auth('BAD_KEY', 'BAD_SECRET')
Exemple #5
0
 def setUp(self):
     self.client = Bitfinex.Auth(API_KEY, API_SECRET)
Exemple #6
0
 def setUp(self):
     self.client = Bitfinex.Public()
Exemple #7
0
 def test_key_secret(self):
     self.assertRaises(ValueError, lambda: Bitfinex.Auth())
Exemple #8
0
 def test_key_secret(self):
     with self.assertRaises(TypeError):
         Bitfinex.Auth()