Exemplo n.º 1
0
    def __init__(self,
                 api_key=None,
                 api_secret=None,
                 base_api_uri=None,
                 api_version=None):

        if not all((api_key, api_secret)):
            from stocklook.utils.security import Credentials
            creds = Credentials(allow_input=True)
            if api_key is None:
                try:
                    api_key = creds.data['COINBASE_KEY']
                except KeyError:
                    warn("Set dict(stocklook.config.config) with "
                         "COINBASE_KEY to avoid inputting it manually.")

            # This will be input manually if not available.
            api_secret = creds.get(creds.COINBASE, username=api_key, api=False)
            if api_key is None:
                api_key = creds.data[creds.COINBASE]

        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.º 2
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.º 3
0
 def __init__(self, api_key: str, api_secret: str):
     Client.__init__(self, api_key=api_key, api_secret=api_secret)