Skip to content

Commit

Permalink
Merge pull request #28 from EtWnn/develop
Browse files Browse the repository at this point in the history
Release 0.1.3
  • Loading branch information
EtWnn authored Dec 29, 2021
2 parents 28f1b44 + 789d0cb commit 8344975
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 21 deletions.
13 changes: 10 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
==============================
Welcome to ScanWatch 0.1.2
Welcome to ScanWatch 0.1.3
==============================

Note
Expand All @@ -18,6 +18,13 @@ This library is a local tracker of transactions for the Ethereum chain and the B
It is a simple interface with the `etherscan <https://etherscan.io>`_ and the
`bscscan <https://bscscan.com>`_ APIs and will save locally the results to gain time and avoid over-calling the APIs.

Announcement
------------

If you previously used this library with a version inferior to 0.1.3,
please head `here <https://github.com/EtWnn/ScanWatch/discussions/25>`_ to correct a potential bug in the database.


Quick Tour
----------

Expand All @@ -44,7 +51,7 @@ Example for Ethereum:

.. code:: python
from ScanWatch import ScanManager
from ScanWatch.ScanManager import ScanManager
from ScanWatch.utils.enums import NETWORK
api_token = "<ETH_API_TOKEN>"
Expand All @@ -56,7 +63,7 @@ Example for BSC:

.. code:: python
from ScanWatch import ScanManager
from ScanWatch.ScanManager import ScanManager
from ScanWatch.utils.enums import NETWORK
api_token = "<BSC_API_TOKEN>"
Expand Down
4 changes: 1 addition & 3 deletions ScanWatch/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
__author__ = 'EtWnn'
__version__ = '0.1.2'

from ScanWatch.ScanManager import ScanManager
__version__ = '0.1.3'
11 changes: 4 additions & 7 deletions ScanWatch/storage/ScanDataBase.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,16 +78,13 @@ def get_last_block_number(self, address: str, nt_type: NETWORK, net: str, tr_typ
:rtype: int
"""
table = get_transaction_table(address, nt_type, net, tr_type)
selection = f"MAX({table.blockNumber})"
result = self.get_conditions_rows(table, selection=selection)
selection = str(table.blockNumber)
query = self.get_conditions_rows(table, selection=selection)
default = 0
try:
result = result[0][0]
except IndexError:
return max([int(e[0]) for e in query])
except ValueError:
return default
if result is None:
return default
return int(result)



4 changes: 4 additions & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
setuptools~=58.0.4
sphinx~=4.3.2
sphinx_rtd_theme~=1.0.0
twine~=3.7.1
9 changes: 3 additions & 6 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
requests
appdirs
tqdm
sphinx
sphinx_rtd_theme
twine
appdirs~=1.4.4
requests~=2.26.0
tqdm~=4.62.3
8 changes: 6 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,22 @@
with open(os.path.join(this_directory, 'ScanWatch/__init__.py'), encoding='utf-8') as f:
exec(f.read(), about)

with open("requirements.txt") as file:
requirements_content = file.read()
requirements = requirements_content.split('\n')

setup(
name='ScanWatch',
version=about['__version__'],
packages=['ScanWatch', 'ScanWatch.storage', 'ScanWatch.utils'],
url='https://github.com/EtWnn/ScanWatch',
author='EtWnn',
author_email='',
author_email='[email protected]',
license='MIT',
description='Local tracker of an eth address for ETH and BSC scan',
long_description=long_description,
long_description_content_type='text/x-rst',
install_requires=['requests', 'appdirs', 'tqdm'],
install_requires=requirements,
keywords='eth bsc wallet save tracking history ethereum tracker binance smartchain smart chain',
classifiers=[
'Intended Audience :: Developers',
Expand Down

0 comments on commit 8344975

Please sign in to comment.