Exemplo n.º 1
0
 def _set_credentials(self):
     """
     Sets gdax credentials via secure keyring storage.
     :return:
     """
     c = Credentials()
     c.configure_object_vars(self, c.GDAX, 'api_key',
                             ['api_secret', 'api_passphrase'])
Exemplo n.º 2
0
 def __init__(self, email=None, password=None, **kwargs):
     self.email = email
     self._kwargs = kwargs
     self._smtp = None
     self.password = password
     if not all((email, password)):
         c = Credentials()
         c.configure_object_vars(
             self, c.GMAIL, 'email', ['password'])
         self._kwargs['password'] = self.password
Exemplo n.º 3
0
    def __init__(self, key=None, secret=None):
        self.key = key
        self.secret = secret
        self.public = ['GetCurrencies', 'GetTradePairs', 'GetMarkets',
                       'GetMarket', 'GetMarketHistory', 'GetMarketOrders', 'GetMarketOrderGroups']
        self.private = ['GetBalance', 'GetDepositAddress', 'GetOpenOrders',
                        'GetTradeHistory', 'GetTransactions', 'SubmitTrade',
                        'CancelTrade', 'SubmitTip', 'SubmitWithdraw', 'SubmitTransfer']

        if not all((key, secret)):
            c = Credentials()
            c.configure_object_vars(
                self, c.CRYPTOPIA,
                'key', ['secret'])
Exemplo n.º 4
0
    def __init__(self,
                 api_key=None,
                 api_secret=None,
                 base_api_uri=None,
                 api_version=None):
        self.api_key = None
        self.api_secret = None
        if not all((api_key, api_secret)):
            from stocklook.utils.security import Credentials
            creds = Credentials(allow_input=True)
            creds.configure_object_vars(self, creds.COINBASE, 'api_key',
                                        ['api_secret'])

        CBClient.__init__(self,
                          api_key=api_key,
                          api_secret=api_secret,
                          base_api_uri=base_api_uri,
                          api_version=api_version)

        self._pmt_methods = None
        self._accounts = None
Exemplo n.º 5
0
    def __init__(self,
                 base_url=None,
                 symbol=None,
                 apiKey=None,
                 apiSecret=None,
                 orderIDPrefix='mm_bitmex_',
                 shouldWSAuth=True,
                 postOnly=False,
                 timeout=7):
        """Init connector."""
        self.logger = logging.getLogger('root')
        self.base_url = base_url
        self.symbol = symbol
        self.postOnly = postOnly
        self.apiKey = apiKey
        self.apiSecret = apiSecret
        if not all((apiKey, apiSecret)):
            c = Credentials()
            c.configure_object_vars(self, c.BITMEX, 'apiKey', ['apiSecret'])

        if len(orderIDPrefix) > 13:
            raise ValueError(
                "settings.ORDERID_PREFIX must be at most 13 characters long!")
        self.orderIDPrefix = orderIDPrefix
        self.retries = 0  # initialize counter

        # Prepare HTTPS session
        self.session = requests.Session()
        # These headers are always sent
        self.session.headers.update(
            {'user-agent': 'liquidbot-' + constants.VERSION})
        self.session.headers.update({'content-type': 'application/json'})
        self.session.headers.update({'accept': 'application/json'})

        # Create websocket for streaming data
        self.ws = BitMEXWebsocket()
        self.ws.connect(base_url, symbol, shouldAuth=shouldWSAuth)

        self.timeout = timeout
Exemplo n.º 6
0
 def __init__(self, key=None, secret=None):
     self.api_key = key
     self.secret = secret
     if not all((key, secret)):
         c = Credentials()
         c.configure_object_vars(self, c.POLONIEX, 'api_key', ['secret'])