eth-portfolio-temp 0.0.38.dev0__tar.gz → 0.1.1.dev0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/.github/workflows/mypy.yaml +1 -1
- {eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/.github/workflows/release.yaml +3 -1
- {eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/PKG-INFO +2 -2
- {eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/eth_portfolio/_db/utils.py +1 -1
- {eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/eth_portfolio/_loaders/_nonce.py +4 -4
- {eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/eth_portfolio/_ydb/token_transfers.py +29 -15
- {eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/eth_portfolio/address.py +2 -1
- {eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/eth_portfolio/buckets.py +2 -2
- {eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/eth_portfolio/typing/__init__.py +2 -2
- {eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/eth_portfolio_scripts/_portfolio.py +3 -3
- {eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/eth_portfolio_scripts/victoria/__init__.py +3 -0
- {eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/eth_portfolio_temp.egg-info/PKG-INFO +2 -2
- {eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/eth_portfolio_temp.egg-info/requires.txt +2 -2
- {eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/pyproject.toml +9 -1
- {eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/requirements.txt +2 -2
- {eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/setup.py +1 -4
- {eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/.env.sample +0 -0
- {eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/.github/workflows/black.yaml +0 -0
- {eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/.github/workflows/compile.yaml +0 -0
- {eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/.github/workflows/deploy_docs.yaml +0 -0
- {eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/.gitignore +0 -0
- {eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/Makefile +0 -0
- {eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/README.md +0 -0
- {eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/brownie-config.yaml +0 -0
- {eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/docs/Makefile +0 -0
- {eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/docs/_build/html/_static/alabaster.css +0 -0
- {eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/docs/_build/html/_static/basic.css +0 -0
- {eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/docs/_build/html/_static/custom.css +0 -0
- {eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/docs/_build/html/_static/doctools.js +0 -0
- {eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/docs/_build/html/_static/documentation_options.js +0 -0
- {eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/docs/_build/html/_static/file.png +0 -0
- {eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/docs/_build/html/_static/language_data.js +0 -0
- {eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/docs/_build/html/_static/minus.png +0 -0
- {eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/docs/_build/html/_static/plus.png +0 -0
- {eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/docs/_build/html/_static/pygments.css +0 -0
- {eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/docs/_build/html/_static/searchtools.js +0 -0
- {eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/docs/_build/html/_static/sphinx_highlight.js +0 -0
- {eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/docs/caching.rst +0 -0
- {eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/docs/conf.py +0 -0
- {eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/docs/exporter.rst +0 -0
- {eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/docs/index.rst +0 -0
- {eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/docs/make.bat +0 -0
- {eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/docs/new-protocols.rst +0 -0
- {eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/eth_portfolio/__init__.py +0 -0
- {eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/eth_portfolio/_argspec.py +0 -0
- {eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/eth_portfolio/_cache.py +0 -0
- {eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/eth_portfolio/_config.py +0 -0
- {eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/eth_portfolio/_db/__init__.py +0 -0
- {eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/eth_portfolio/_db/decorators.py +0 -0
- {eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/eth_portfolio/_db/entities.py +0 -0
- {eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/eth_portfolio/_decimal.py +0 -0
- {eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/eth_portfolio/_decorators.py +0 -0
- {eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/eth_portfolio/_exceptions.py +0 -0
- {eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/eth_portfolio/_ledgers/__init__.py +0 -0
- {eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/eth_portfolio/_ledgers/address.py +0 -0
- {eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/eth_portfolio/_ledgers/portfolio.py +0 -0
- {eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/eth_portfolio/_loaders/__init__.py +0 -0
- {eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/eth_portfolio/_loaders/balances.py +0 -0
- {eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/eth_portfolio/_loaders/token_transfer.py +0 -0
- {eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/eth_portfolio/_loaders/transaction.py +0 -0
- {eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/eth_portfolio/_loaders/utils.py +0 -0
- {eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/eth_portfolio/_shitcoins.py +0 -0
- {eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/eth_portfolio/_stableish.py +0 -0
- {eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/eth_portfolio/_submodules.py +0 -0
- {eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/eth_portfolio/_utils.py +0 -0
- {eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/eth_portfolio/_ydb/__init__.py +0 -0
- {eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/eth_portfolio/constants.py +0 -0
- {eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/eth_portfolio/portfolio.py +0 -0
- {eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/eth_portfolio/protocols/__init__.py +0 -0
- {eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/eth_portfolio/protocols/_base.py +0 -0
- {eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/eth_portfolio/protocols/convex.py +0 -0
- {eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/eth_portfolio/protocols/dsr.py +0 -0
- {eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/eth_portfolio/protocols/lending/README.md +0 -0
- {eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/eth_portfolio/protocols/lending/__init__.py +0 -0
- {eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/eth_portfolio/protocols/lending/_base.py +0 -0
- {eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/eth_portfolio/protocols/lending/compound.py +0 -0
- {eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/eth_portfolio/protocols/lending/liquity.py +0 -0
- {eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/eth_portfolio/protocols/lending/maker.py +0 -0
- {eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/eth_portfolio/protocols/lending/unit.py +0 -0
- {eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/eth_portfolio/protocols/liquity.py +0 -0
- {eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/eth_portfolio/py.typed +0 -0
- {eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/eth_portfolio/structs/__init__.py +0 -0
- {eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/eth_portfolio/structs/modified.py +0 -0
- {eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/eth_portfolio/structs/structs.py +0 -0
- {eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/eth_portfolio/typing/balance/single.py +0 -0
- {eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/eth_portfolio_scripts/__init__.py +0 -0
- {eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/eth_portfolio_scripts/_args.py +0 -0
- {eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/eth_portfolio_scripts/_logging.py +0 -0
- {eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/eth_portfolio_scripts/_utils.py +0 -0
- {eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/eth_portfolio_scripts/balances.py +0 -0
- {eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/eth_portfolio_scripts/docker/.grafana/dashboards/Portfolio/Balances.json +0 -0
- {eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/eth_portfolio_scripts/docker/.grafana/dashboards/dashboards.yaml +0 -0
- {eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/eth_portfolio_scripts/docker/.grafana/datasources/datasources.yml +0 -0
- {eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/eth_portfolio_scripts/docker/__init__.py +0 -0
- {eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/eth_portfolio_scripts/docker/check.py +0 -0
- {eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/eth_portfolio_scripts/docker/docker-compose.yaml +0 -0
- {eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/eth_portfolio_scripts/docker/docker_compose.py +0 -0
- {eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/eth_portfolio_scripts/main.py +0 -0
- {eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/eth_portfolio_scripts/py.typed +0 -0
- {eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/eth_portfolio_scripts/victoria/types.py +0 -0
- {eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/eth_portfolio_temp.egg-info/SOURCES.txt +0 -0
- {eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/eth_portfolio_temp.egg-info/dependency_links.txt +0 -0
- {eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/eth_portfolio_temp.egg-info/entry_points.txt +0 -0
- {eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/eth_portfolio_temp.egg-info/not-zip-safe +0 -0
- {eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/eth_portfolio_temp.egg-info/top_level.txt +0 -0
- {eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/setup.cfg +0 -0
- {eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/tests/_test_completeness.py +0 -0
- {eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/tests/conftest.py +0 -0
- {eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/tests/fixtures.py +0 -0
- {eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/tests/protocols/test_external.py +0 -0
- {eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/tests/scripts/test_utils.py +0 -0
- {eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/tests/test_portfolio.py +0 -0
- {eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/tests/test_typing.py +0 -0
{eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/.github/workflows/release.yaml
RENAMED
|
@@ -104,6 +104,8 @@ jobs:
|
|
|
104
104
|
CIBW_ARCHS_WINDOWS: ${{ matrix.cibw_archs_windows || '' }}
|
|
105
105
|
# Which wheels to build for Linux (manylinux vs. musllinux)
|
|
106
106
|
CIBW_BUILD: ${{ matrix.cibw_build || '' }}
|
|
107
|
+
# Download wheels for deps, don't build from source
|
|
108
|
+
PIP_ONLY_BINARY: ":all:"
|
|
107
109
|
run: |
|
|
108
110
|
python -m cibuildwheel --output-dir wheelhouse
|
|
109
111
|
|
|
@@ -133,7 +135,7 @@ jobs:
|
|
|
133
135
|
- name: Install dependencies
|
|
134
136
|
run: |
|
|
135
137
|
python -m pip install --upgrade pip
|
|
136
|
-
pip install setuptools wheel twine mypy[mypyc]
|
|
138
|
+
pip install setuptools wheel twine mypy[mypyc] types-aiofiles
|
|
137
139
|
|
|
138
140
|
- name: Build sdist
|
|
139
141
|
run: |
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: eth_portfolio_temp
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.1.1.dev0
|
|
4
4
|
Summary: eth-portfolio makes it easy to analyze your portfolio.
|
|
5
5
|
Home-page: https://github.com/BobTheBuidler/eth-portfolio
|
|
6
6
|
Author: BobTheBuidler
|
|
7
7
|
Author-email: bobthebuidlerdefi@gmail.com
|
|
8
|
-
Requires-Python: >=3.
|
|
8
|
+
Requires-Python: >=3.10,<3.13
|
|
@@ -190,7 +190,7 @@ def is_token(address) -> bool:
|
|
|
190
190
|
|
|
191
191
|
async def _is_token(address) -> bool:
|
|
192
192
|
# just breaking a weird lock, dont mind me
|
|
193
|
-
if retval := await get_event_loop().run_in_executor(process, __is_token, address):
|
|
193
|
+
if retval := await get_event_loop().run_in_executor(process, __is_token, address): # type: ignore [name-defined]
|
|
194
194
|
logger.debug("%s is token")
|
|
195
195
|
else:
|
|
196
196
|
logger.debug("%s is not token")
|
{eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/eth_portfolio/_loaders/_nonce.py
RENAMED
|
@@ -2,7 +2,7 @@ import asyncio
|
|
|
2
2
|
import logging
|
|
3
3
|
from collections import defaultdict
|
|
4
4
|
from time import time
|
|
5
|
-
from typing import ClassVar, DefaultDict, Dict, Final, Tuple, final
|
|
5
|
+
from typing import ClassVar, DefaultDict, Dict, Final, Optional, Tuple, final
|
|
6
6
|
|
|
7
7
|
import a_sync
|
|
8
8
|
import dank_mids
|
|
@@ -145,7 +145,7 @@ async def _get_area(
|
|
|
145
145
|
return lo, hi
|
|
146
146
|
|
|
147
147
|
|
|
148
|
-
def _update_nonces(address: ChecksumAddress, nonce: Nonce, block: BlockNumber):
|
|
148
|
+
def _update_nonces(address: ChecksumAddress, nonce: Nonce, block: BlockNumber) -> None:
|
|
149
149
|
# if you are searching for `nonce` and you verified it occurs AT or ABOVE `block` call this fn.
|
|
150
150
|
if block > nonces[address][nonce]:
|
|
151
151
|
nonces[address][nonce] = block
|
|
@@ -178,13 +178,13 @@ def _get_num_chunks(range_size: int) -> int:
|
|
|
178
178
|
|
|
179
179
|
@final
|
|
180
180
|
class BlockCache:
|
|
181
|
-
block: ClassVar = 0
|
|
181
|
+
block: ClassVar[BlockNumber] = 0
|
|
182
182
|
updated_at: ClassVar = 0.0
|
|
183
183
|
lock: Final = asyncio.Lock()
|
|
184
184
|
ttl: Final = 5.0
|
|
185
185
|
|
|
186
186
|
|
|
187
|
-
async def get_block_number():
|
|
187
|
+
async def get_block_number() -> BlockNumber:
|
|
188
188
|
if now() - BlockCache.updated_at < BlockCache.ttl:
|
|
189
189
|
return BlockCache.block
|
|
190
190
|
async with BlockCache.lock:
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
from abc import abstractmethod
|
|
2
2
|
from asyncio import Task, create_task, sleep
|
|
3
3
|
from logging import DEBUG, getLogger
|
|
4
|
-
from typing import AsyncIterator, List
|
|
4
|
+
from typing import AsyncIterator, Final, List
|
|
5
5
|
|
|
6
6
|
import dank_mids
|
|
7
7
|
import evmspec
|
|
8
8
|
import y._db.log
|
|
9
9
|
from a_sync import ASyncIterable, ASyncIterator, as_yielded
|
|
10
10
|
from brownie import chain
|
|
11
|
+
from eth_typing import BlockNumber, ChecksumAddress
|
|
11
12
|
from faster_eth_utils import encode_hex
|
|
12
|
-
from y.datatypes import Address
|
|
13
13
|
from y.utils.events import ProcessedEvents
|
|
14
14
|
|
|
15
15
|
from eth_portfolio._loaders import load_token_transfer
|
|
@@ -28,9 +28,9 @@ except ImportError:
|
|
|
28
28
|
|
|
29
29
|
encode_address = lambda address: encode_hex(encode_single("address", str(address)))
|
|
30
30
|
|
|
31
|
-
logger = getLogger(__name__)
|
|
32
|
-
_logger_is_enabled_for = logger.isEnabledFor
|
|
33
|
-
_logger_log = logger._log
|
|
31
|
+
logger: Final = getLogger(__name__)
|
|
32
|
+
_logger_is_enabled_for: Final = logger.isEnabledFor
|
|
33
|
+
_logger_log: Final = logger._log
|
|
34
34
|
|
|
35
35
|
|
|
36
36
|
class _TokenTransfers(ProcessedEvents["Task[TokenTransfer]"]):
|
|
@@ -38,9 +38,14 @@ class _TokenTransfers(ProcessedEvents["Task[TokenTransfer]"]):
|
|
|
38
38
|
|
|
39
39
|
__slots__ = "address", "_load_prices"
|
|
40
40
|
|
|
41
|
-
def __init__(
|
|
42
|
-
self
|
|
43
|
-
|
|
41
|
+
def __init__(
|
|
42
|
+
self,
|
|
43
|
+
address: ChecksumAddress,
|
|
44
|
+
from_block: BlockNumber,
|
|
45
|
+
load_prices: bool = False,
|
|
46
|
+
) -> None:
|
|
47
|
+
self.address: Final = address
|
|
48
|
+
self._load_prices: Final = load_prices
|
|
44
49
|
super().__init__(topics=self._topics, from_block=from_block)
|
|
45
50
|
|
|
46
51
|
def __repr__(self) -> str:
|
|
@@ -51,7 +56,7 @@ class _TokenTransfers(ProcessedEvents["Task[TokenTransfer]"]):
|
|
|
51
56
|
def _topics(self) -> List: ...
|
|
52
57
|
|
|
53
58
|
@ASyncIterator.wrap # type: ignore [call-overload]
|
|
54
|
-
async def yield_thru_block(self, block) -> AsyncIterator["Task[TokenTransfer]"]:
|
|
59
|
+
async def yield_thru_block(self, block: BlockNumber) -> AsyncIterator["Task[TokenTransfer]"]:
|
|
55
60
|
if not _logger_is_enabled_for(DEBUG):
|
|
56
61
|
async for task in self._objects_thru(block=block):
|
|
57
62
|
yield task
|
|
@@ -119,18 +124,27 @@ class TokenTransfers(ASyncIterable[TokenTransfer]):
|
|
|
119
124
|
NOTE: These do not come back in chronologcal order.
|
|
120
125
|
"""
|
|
121
126
|
|
|
122
|
-
def __init__(
|
|
123
|
-
self
|
|
124
|
-
|
|
127
|
+
def __init__(
|
|
128
|
+
self,
|
|
129
|
+
address: ChecksumAddress,
|
|
130
|
+
from_block: BlockNumber,
|
|
131
|
+
load_prices: bool = False,
|
|
132
|
+
) -> None:
|
|
133
|
+
self.transfers_in: Final = InboundTokenTransfers(
|
|
134
|
+
address, from_block, load_prices=load_prices
|
|
135
|
+
)
|
|
136
|
+
self.transfers_out: Final = OutboundTokenTransfers(
|
|
137
|
+
address, from_block, load_prices=load_prices
|
|
138
|
+
)
|
|
125
139
|
|
|
126
|
-
async def __aiter__(self):
|
|
140
|
+
async def __aiter__(self) -> AsyncIterator["Task[TokenTransfer]"]:
|
|
127
141
|
async for transfer in self.__yield_thru_block(await dank_mids.eth.block_number):
|
|
128
142
|
yield transfer
|
|
129
143
|
|
|
130
|
-
def yield_thru_block(self, block:
|
|
144
|
+
def yield_thru_block(self, block: BlockNumber) -> ASyncIterator["Task[TokenTransfer]"]:
|
|
131
145
|
return ASyncIterator(self.__yield_thru_block(block))
|
|
132
146
|
|
|
133
|
-
def __yield_thru_block(self, block:
|
|
147
|
+
def __yield_thru_block(self, block: BlockNumber) -> AsyncIterator["Task[TokenTransfer]"]:
|
|
134
148
|
return as_yielded(
|
|
135
149
|
self.transfers_in.yield_thru_block(block), self.transfers_out.yield_thru_block(block)
|
|
136
150
|
)
|
|
@@ -23,6 +23,7 @@ import dank_mids
|
|
|
23
23
|
import eth_retry
|
|
24
24
|
import y
|
|
25
25
|
from a_sync.exceptions import MappingIsEmptyError
|
|
26
|
+
from eth_typing import BlockNumber
|
|
26
27
|
from y import convert
|
|
27
28
|
from y._decorators import stuck_coro_debugger
|
|
28
29
|
from y.datatypes import Address, Block
|
|
@@ -312,7 +313,7 @@ class PortfolioAddress(_LedgeredBase[AddressLedgerBase]):
|
|
|
312
313
|
return Balance(token=y.EEE_ADDRESS, block=block)
|
|
313
314
|
|
|
314
315
|
@stuck_coro_debugger
|
|
315
|
-
async def token_balances(self, block) -> TokenBalances:
|
|
316
|
+
async def token_balances(self, block: BlockNumber) -> TokenBalances:
|
|
316
317
|
"""
|
|
317
318
|
Retrieves the balances for all tokens in the wallet at a given block.
|
|
318
319
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import logging
|
|
2
|
-
from typing import Final, Optional, Set
|
|
2
|
+
from typing import Any, Final, Optional, Set
|
|
3
3
|
|
|
4
4
|
from a_sync import igather
|
|
5
5
|
from async_lru import alru_cache
|
|
@@ -76,7 +76,7 @@ async def get_token_bucket(token: AnyAddressType) -> str:
|
|
|
76
76
|
|
|
77
77
|
|
|
78
78
|
@alru_cache(maxsize=None)
|
|
79
|
-
async def _unwrap_token(token) -> ChecksumAddress:
|
|
79
|
+
async def _unwrap_token(token: Any) -> ChecksumAddress:
|
|
80
80
|
"""
|
|
81
81
|
Recursively unwrap a token to its underlying asset.
|
|
82
82
|
|
{eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/eth_portfolio/typing/__init__.py
RENAMED
|
@@ -46,7 +46,7 @@ from checksum_dict import DefaultChecksumDict
|
|
|
46
46
|
from eth_typing import BlockNumber
|
|
47
47
|
from pandas import DataFrame, concat
|
|
48
48
|
from typing_extensions import ParamSpec, Self
|
|
49
|
-
from y import ERC20
|
|
49
|
+
from y import Contract, ERC20
|
|
50
50
|
from y.datatypes import Address
|
|
51
51
|
|
|
52
52
|
from eth_portfolio._decimal import Decimal
|
|
@@ -393,7 +393,7 @@ class RemoteTokenBalances(DefaultDict[ProtocolLabel, TokenBalances], _SummableNo
|
|
|
393
393
|
)
|
|
394
394
|
self[remote] += token_balances # type: ignore [has-type]
|
|
395
395
|
|
|
396
|
-
def __setitem__(self, protocol: str, value: TokenBalances):
|
|
396
|
+
def __setitem__(self, protocol: str, value: TokenBalances) -> None:
|
|
397
397
|
"""
|
|
398
398
|
Sets the token balances for a given protocol.
|
|
399
399
|
|
{eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/eth_portfolio_scripts/_portfolio.py
RENAMED
|
@@ -71,7 +71,7 @@ class ExportablePortfolio(Portfolio):
|
|
|
71
71
|
return True
|
|
72
72
|
return False
|
|
73
73
|
|
|
74
|
-
async def export_snapshot(self, dt: datetime):
|
|
74
|
+
async def export_snapshot(self, dt: datetime) -> None:
|
|
75
75
|
log_debug("checking data at %s for %s", dt, self.label)
|
|
76
76
|
try:
|
|
77
77
|
if not await self.data_exists(dt, sync=False):
|
|
@@ -131,7 +131,7 @@ class ExportablePortfolio(Portfolio):
|
|
|
131
131
|
token: ChecksumAddress,
|
|
132
132
|
bal: Balance,
|
|
133
133
|
protocol: Optional[str] = None,
|
|
134
|
-
):
|
|
134
|
+
) -> Tuple[victoria.types.PrometheusItem, victoria.types.PrometheusItem]:
|
|
135
135
|
# TODO wallet nicknames in grafana
|
|
136
136
|
# wallet = KNOWN_ADDRESSES[wallet] if wallet in KNOWN_ADDRESSES else wallet
|
|
137
137
|
if protocol is not None:
|
|
@@ -172,7 +172,7 @@ class ExportablePortfolio(Portfolio):
|
|
|
172
172
|
)
|
|
173
173
|
|
|
174
174
|
|
|
175
|
-
async def _get_symbol(token) -> str:
|
|
175
|
+
async def _get_symbol(token: str) -> str:
|
|
176
176
|
if token == "ETH":
|
|
177
177
|
return "ETH"
|
|
178
178
|
try:
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: eth-portfolio-temp
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.1.1.dev0
|
|
4
4
|
Summary: eth-portfolio makes it easy to analyze your portfolio.
|
|
5
5
|
Home-page: https://github.com/BobTheBuidler/eth-portfolio
|
|
6
6
|
Author: BobTheBuidler
|
|
7
7
|
Author-email: bobthebuidlerdefi@gmail.com
|
|
8
|
-
Requires-Python: >=3.
|
|
8
|
+
Requires-Python: >=3.10,<3.13
|
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
[build-system]
|
|
2
|
-
requires = [
|
|
2
|
+
requires = [
|
|
3
|
+
"setuptools",
|
|
4
|
+
"wheel",
|
|
5
|
+
"mypy[mypyc]>=1.14.1,<1.17.1",
|
|
6
|
+
"types-aiofiles",
|
|
7
|
+
"eth-brownie==1.21.0; sys_platform=='Linux'",
|
|
8
|
+
"eth-typing==4.4.0",
|
|
9
|
+
"ez-a-sync>=0.32.7,<0.33",
|
|
10
|
+
]
|
|
3
11
|
|
|
4
12
|
[tool.mypy]
|
|
5
13
|
exclude = ["build/","cache/","env/"]
|
|
@@ -72,13 +72,11 @@ try:
|
|
|
72
72
|
"--install-types",
|
|
73
73
|
"--disable-error-code=unused-ignore",
|
|
74
74
|
"--disable-error-code=import-not-found",
|
|
75
|
-
"--disable-error-code=import-untyped",
|
|
76
75
|
# temporary
|
|
77
76
|
"--disable-error-code=call-arg",
|
|
78
77
|
"--disable-error-code=misc",
|
|
79
78
|
"--disable-error-code=type-arg",
|
|
80
79
|
"--disable-error-code=attr-defined",
|
|
81
|
-
"--disable-error-code=name-defined",
|
|
82
80
|
"--disable-error-code=no-any-return",
|
|
83
81
|
"--disable-error-code=arg-type",
|
|
84
82
|
"--disable-error-code=no-untyped-call",
|
|
@@ -95,7 +93,6 @@ try:
|
|
|
95
93
|
"--disable-error-code=dict-item",
|
|
96
94
|
"--disable-error-code=has-type",
|
|
97
95
|
"--disable-error-code=typeddict-item",
|
|
98
|
-
"--disable-error-code=str-bytes-safe",
|
|
99
96
|
"--disable-error-code=index",
|
|
100
97
|
],
|
|
101
98
|
)
|
|
@@ -107,7 +104,7 @@ except Exception as e: # fallback in case build fails
|
|
|
107
104
|
setup(
|
|
108
105
|
# NOTE: somebody stole our name on pypi, we have this placeholder until we steal it back
|
|
109
106
|
name="eth_portfolio_temp",
|
|
110
|
-
python_requires=">=3.
|
|
107
|
+
python_requires=">=3.10,<3.13",
|
|
111
108
|
# name="eth-portfolio",
|
|
112
109
|
packages=find_packages(),
|
|
113
110
|
use_scm_version={
|
|
File without changes
|
{eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/.github/workflows/black.yaml
RENAMED
|
File without changes
|
{eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/.github/workflows/compile.yaml
RENAMED
|
File without changes
|
{eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/.github/workflows/deploy_docs.yaml
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/docs/_build/html/_static/basic.css
RENAMED
|
File without changes
|
{eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/docs/_build/html/_static/custom.css
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/docs/_build/html/_static/file.png
RENAMED
|
File without changes
|
|
File without changes
|
{eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/docs/_build/html/_static/minus.png
RENAMED
|
File without changes
|
{eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/docs/_build/html/_static/plus.png
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/eth_portfolio/_db/__init__.py
RENAMED
|
File without changes
|
{eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/eth_portfolio/_db/decorators.py
RENAMED
|
File without changes
|
{eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/eth_portfolio/_db/entities.py
RENAMED
|
File without changes
|
|
File without changes
|
{eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/eth_portfolio/_decorators.py
RENAMED
|
File without changes
|
{eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/eth_portfolio/_exceptions.py
RENAMED
|
File without changes
|
{eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/eth_portfolio/_ledgers/__init__.py
RENAMED
|
File without changes
|
{eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/eth_portfolio/_ledgers/address.py
RENAMED
|
File without changes
|
{eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/eth_portfolio/_ledgers/portfolio.py
RENAMED
|
File without changes
|
{eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/eth_portfolio/_loaders/__init__.py
RENAMED
|
File without changes
|
{eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/eth_portfolio/_loaders/balances.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/eth_portfolio/_loaders/utils.py
RENAMED
|
File without changes
|
{eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/eth_portfolio/_shitcoins.py
RENAMED
|
File without changes
|
{eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/eth_portfolio/_stableish.py
RENAMED
|
File without changes
|
{eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/eth_portfolio/_submodules.py
RENAMED
|
File without changes
|
|
File without changes
|
{eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/eth_portfolio/_ydb/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/eth_portfolio/protocols/__init__.py
RENAMED
|
File without changes
|
{eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/eth_portfolio/protocols/_base.py
RENAMED
|
File without changes
|
{eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/eth_portfolio/protocols/convex.py
RENAMED
|
File without changes
|
{eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/eth_portfolio/protocols/dsr.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/eth_portfolio/protocols/liquity.py
RENAMED
|
File without changes
|
|
File without changes
|
{eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/eth_portfolio/structs/__init__.py
RENAMED
|
File without changes
|
{eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/eth_portfolio/structs/modified.py
RENAMED
|
File without changes
|
{eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/eth_portfolio/structs/structs.py
RENAMED
|
File without changes
|
|
File without changes
|
{eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/eth_portfolio_scripts/__init__.py
RENAMED
|
File without changes
|
{eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/eth_portfolio_scripts/_args.py
RENAMED
|
File without changes
|
{eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/eth_portfolio_scripts/_logging.py
RENAMED
|
File without changes
|
{eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/eth_portfolio_scripts/_utils.py
RENAMED
|
File without changes
|
{eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/eth_portfolio_scripts/balances.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/eth_portfolio_scripts/main.py
RENAMED
|
File without changes
|
{eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/eth_portfolio_scripts/py.typed
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/tests/_test_completeness.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/tests/protocols/test_external.py
RENAMED
|
File without changes
|
{eth_portfolio_temp-0.0.38.dev0 → eth_portfolio_temp-0.1.1.dev0}/tests/scripts/test_utils.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|