eth-portfolio 0.5.7__cp312-cp312-win32.whl
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.
Potentially problematic release.
This version of eth-portfolio might be problematic. Click here for more details.
- eth_portfolio/__init__.py +24 -0
- eth_portfolio/_argspec.cp312-win32.pyd +0 -0
- eth_portfolio/_argspec.py +43 -0
- eth_portfolio/_cache.py +119 -0
- eth_portfolio/_config.cp312-win32.pyd +0 -0
- eth_portfolio/_config.py +4 -0
- eth_portfolio/_db/__init__.py +0 -0
- eth_portfolio/_db/decorators.py +147 -0
- eth_portfolio/_db/entities.py +311 -0
- eth_portfolio/_db/utils.py +616 -0
- eth_portfolio/_decimal.py +154 -0
- eth_portfolio/_decorators.py +84 -0
- eth_portfolio/_exceptions.py +65 -0
- eth_portfolio/_ledgers/__init__.py +0 -0
- eth_portfolio/_ledgers/address.py +924 -0
- eth_portfolio/_ledgers/portfolio.py +328 -0
- eth_portfolio/_loaders/__init__.py +33 -0
- eth_portfolio/_loaders/_nonce.cp312-win32.pyd +0 -0
- eth_portfolio/_loaders/_nonce.py +193 -0
- eth_portfolio/_loaders/balances.cp312-win32.pyd +0 -0
- eth_portfolio/_loaders/balances.py +95 -0
- eth_portfolio/_loaders/token_transfer.py +215 -0
- eth_portfolio/_loaders/transaction.py +240 -0
- eth_portfolio/_loaders/utils.cp312-win32.pyd +0 -0
- eth_portfolio/_loaders/utils.py +67 -0
- eth_portfolio/_shitcoins.cp312-win32.pyd +0 -0
- eth_portfolio/_shitcoins.py +342 -0
- eth_portfolio/_stableish.cp312-win32.pyd +0 -0
- eth_portfolio/_stableish.py +42 -0
- eth_portfolio/_submodules.py +72 -0
- eth_portfolio/_utils.py +215 -0
- eth_portfolio/_ydb/__init__.py +0 -0
- eth_portfolio/_ydb/token_transfers.py +145 -0
- eth_portfolio/address.py +396 -0
- eth_portfolio/buckets.py +212 -0
- eth_portfolio/constants.cp312-win32.pyd +0 -0
- eth_portfolio/constants.py +87 -0
- eth_portfolio/portfolio.py +662 -0
- eth_portfolio/protocols/__init__.py +64 -0
- eth_portfolio/protocols/_base.py +107 -0
- eth_portfolio/protocols/convex.py +17 -0
- eth_portfolio/protocols/dsr.py +50 -0
- eth_portfolio/protocols/lending/README.md +6 -0
- eth_portfolio/protocols/lending/__init__.py +50 -0
- eth_portfolio/protocols/lending/_base.py +56 -0
- eth_portfolio/protocols/lending/compound.py +186 -0
- eth_portfolio/protocols/lending/liquity.py +108 -0
- eth_portfolio/protocols/lending/maker.py +110 -0
- eth_portfolio/protocols/lending/unit.py +44 -0
- eth_portfolio/protocols/liquity.py +17 -0
- eth_portfolio/py.typed +0 -0
- eth_portfolio/structs/__init__.py +43 -0
- eth_portfolio/structs/modified.py +69 -0
- eth_portfolio/structs/structs.py +626 -0
- eth_portfolio/typing/__init__.py +1418 -0
- eth_portfolio/typing/balance/single.py +176 -0
- eth_portfolio-0.5.7.dist-info/METADATA +26 -0
- eth_portfolio-0.5.7.dist-info/RECORD +83 -0
- eth_portfolio-0.5.7.dist-info/WHEEL +5 -0
- eth_portfolio-0.5.7.dist-info/entry_points.txt +2 -0
- eth_portfolio-0.5.7.dist-info/top_level.txt +3 -0
- eth_portfolio__mypyc.cp312-win32.pyd +0 -0
- eth_portfolio_scripts/__init__.py +17 -0
- eth_portfolio_scripts/_args.py +26 -0
- eth_portfolio_scripts/_logging.py +14 -0
- eth_portfolio_scripts/_portfolio.py +209 -0
- eth_portfolio_scripts/_utils.py +106 -0
- eth_portfolio_scripts/balances.cp312-win32.pyd +0 -0
- eth_portfolio_scripts/balances.py +56 -0
- eth_portfolio_scripts/docker/.grafana/dashboards/Portfolio/Balances.json +1962 -0
- eth_portfolio_scripts/docker/.grafana/dashboards/dashboards.yaml +10 -0
- eth_portfolio_scripts/docker/.grafana/datasources/datasources.yml +11 -0
- eth_portfolio_scripts/docker/__init__.cp312-win32.pyd +0 -0
- eth_portfolio_scripts/docker/__init__.py +16 -0
- eth_portfolio_scripts/docker/check.cp312-win32.pyd +0 -0
- eth_portfolio_scripts/docker/check.py +66 -0
- eth_portfolio_scripts/docker/docker-compose.yaml +61 -0
- eth_portfolio_scripts/docker/docker_compose.cp312-win32.pyd +0 -0
- eth_portfolio_scripts/docker/docker_compose.py +97 -0
- eth_portfolio_scripts/main.py +118 -0
- eth_portfolio_scripts/py.typed +1 -0
- eth_portfolio_scripts/victoria/__init__.py +72 -0
- eth_portfolio_scripts/victoria/types.py +38 -0
|
Binary file
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
from argparse import Namespace
|
|
2
|
+
from datetime import datetime, timezone
|
|
3
|
+
from typing import Final
|
|
4
|
+
|
|
5
|
+
import a_sync
|
|
6
|
+
import a_sync.asyncio
|
|
7
|
+
from eth_typing import HexAddress
|
|
8
|
+
|
|
9
|
+
from eth_portfolio_scripts import docker
|
|
10
|
+
from eth_portfolio_scripts._utils import aiter_timestamps, parse_timedelta
|
|
11
|
+
|
|
12
|
+
_UTC: Final = timezone.utc
|
|
13
|
+
|
|
14
|
+
create_task: Final = a_sync.create_task
|
|
15
|
+
yield_to_loop: Final = a_sync.asyncio.sleep0
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
@docker.ensure_containers
|
|
19
|
+
async def export_balances(
|
|
20
|
+
args: Namespace,
|
|
21
|
+
custom_buckets: dict[HexAddress, str] | None = None,
|
|
22
|
+
) -> None:
|
|
23
|
+
import dank_mids
|
|
24
|
+
|
|
25
|
+
from eth_portfolio_scripts._portfolio import ExportablePortfolio
|
|
26
|
+
|
|
27
|
+
if args.daemon is True:
|
|
28
|
+
raise NotImplementedError("This feature must be implemented")
|
|
29
|
+
|
|
30
|
+
interval = parse_timedelta(args.interval)
|
|
31
|
+
portfolio = ExportablePortfolio(
|
|
32
|
+
args.wallet,
|
|
33
|
+
label=args.label,
|
|
34
|
+
start_block=args.first_tx_block,
|
|
35
|
+
concurrency=args.concurrency,
|
|
36
|
+
custom_buckets=custom_buckets,
|
|
37
|
+
load_prices=False,
|
|
38
|
+
)
|
|
39
|
+
|
|
40
|
+
if export_start_block := args.export_start_block or args.first_tx_block:
|
|
41
|
+
start_ts = await dank_mids.eth.get_block_timestamp(export_start_block)
|
|
42
|
+
start = datetime.fromtimestamp(start_ts, tz=timezone.utc)
|
|
43
|
+
else:
|
|
44
|
+
start = None
|
|
45
|
+
|
|
46
|
+
print(f"Exporting {portfolio}")
|
|
47
|
+
async for ts in aiter_timestamps(start=start, interval=interval, run_forever=True):
|
|
48
|
+
create_task(
|
|
49
|
+
coro=portfolio.export_snapshot(ts, sync=False),
|
|
50
|
+
name=f"eth-portfolio export snapshot {ts}",
|
|
51
|
+
skip_gc_until_done=True,
|
|
52
|
+
)
|
|
53
|
+
# get some work in before yielding the next task
|
|
54
|
+
await yield_to_loop()
|
|
55
|
+
await yield_to_loop()
|
|
56
|
+
await yield_to_loop()
|