示例#1
0
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
示例#2
0
 def client(self) -> Bitfinex.Auth:
     return Bitfinex.Auth(**self.credentials, **self.client_params)
示例#3
0
 def client_v1(self) -> Bitfinex.Public:
     return Bitfinex.Public(**self.client_params)
示例#4
0
 def setUp(self):
     self.client = Bitfinex.Auth('BAD_KEY', 'BAD_SECRET')
示例#5
0
 def setUp(self):
     self.client = Bitfinex.Auth(API_KEY, API_SECRET)
示例#6
0
 def setUp(self):
     self.client = Bitfinex.Public()
示例#7
0
 def test_key_secret(self):
     self.assertRaises(ValueError, lambda: Bitfinex.Auth())
示例#8
0
 def test_key_secret(self):
     with self.assertRaises(TypeError):
         Bitfinex.Auth()