diff --git a/README.md b/README.md index d53fd3d..bf5988a 100755 --- a/README.md +++ b/README.md @@ -24,6 +24,7 @@ with `YourApiKeyToken` is your provided API key token from EtherScan.io To install the package to your computer, simply run the following command in the base directory: python3 -m pip install py-etherscan-api + python3 setup.py install --prefix=/usr/local ## Available bindings diff --git a/etherscan/accounts.py b/etherscan/accounts.py index 2bf7177..8552479 100755 --- a/etherscan/accounts.py +++ b/etherscan/accounts.py @@ -72,7 +72,10 @@ def get_transaction_page(self, page=1, offset=10000, sort='asc', self.url_dict[self.OFFSET] = str(offset) self.url_dict[self.SORT] = sort self.build_url() - req = self.connect() + try: + req = self.connect() + except EmptyResponse: + req = {'result': []} return req['result'] def get_all_transactions(self, offset=10000, sort='asc', diff --git a/etherscan/client.py b/etherscan/client.py index 0802433..ab03857 100755 --- a/etherscan/client.py +++ b/etherscan/client.py @@ -116,11 +116,11 @@ def connect(self): # Check for empty response if req.text: data = req.json() - status = data.get('status') - if status == '1' or self.check_keys_api(data): - return data - else: - raise EmptyResponse(data.get('message', 'no message')) + # status = data.get('status') + # if status == '1' or self.check_keys_api(data): + return data + else: + raise EmptyResponse('no message') raise BadRequest( "Problem with connection, status code: %s" % req.status_code)