dao-treasury 0.0.59__cp312-cp312-win_amd64.whl → 0.0.66__cp312-cp312-win_amd64.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.
Binary file
dao_treasury/_docker.py CHANGED
@@ -14,17 +14,17 @@ This is the main entry for all Docker-based orchestration.
14
14
  """
15
15
 
16
16
  import logging
17
- from importlib import resources
18
- import subprocess
19
17
  from functools import wraps
20
- from typing import Any, Callable, Coroutine, Final, Iterable, Tuple, TypeVar, List
18
+ from importlib import resources
19
+ from typing import Any, Callable, Coroutine, Final, Literal, Tuple, TypeVar, List
21
20
 
22
21
  import eth_portfolio_scripts.docker
22
+ from eth_portfolio_scripts.docker import docker_compose
23
23
  from typing_extensions import ParamSpec
24
24
 
25
25
  logger: Final = logging.getLogger(__name__)
26
26
 
27
- compose_file: Final = str(
27
+ COMPOSE_FILE: Final = str(
28
28
  resources.files("dao_treasury").joinpath("docker-compose.yaml")
29
29
  )
30
30
  """The path of dao-treasury's docker-compose.yaml file on your machine"""
@@ -55,7 +55,7 @@ def up(*services: str) -> None:
55
55
  # eth-portfolio containers must be started first so dao-treasury can attach to the eth-portfolio docker network
56
56
  eth_portfolio_scripts.docker.up("victoria-metrics")
57
57
  build(*services)
58
- print(f"starting the {', '.join(services) if services else 'grafana'} container(s)")
58
+ _print_notice("starting", services)
59
59
  _exec_command(["up", "-d", *services])
60
60
 
61
61
 
@@ -72,6 +72,7 @@ def down() -> None:
72
72
  See Also:
73
73
  :func:`up`
74
74
  """
75
+ print("stopping all dao-treasury containers")
75
76
  _exec_command(["down"])
76
77
 
77
78
 
@@ -90,10 +91,24 @@ def build(*services: str) -> None:
90
91
  :func:`up`
91
92
  :func:`_exec_command`
92
93
  """
93
- print("building the grafana containers")
94
+ _print_notice("building", services)
94
95
  _exec_command(["build", *services])
95
96
 
96
97
 
98
+ def _print_notice(
99
+ doing: Literal["building", "starting"], services: Tuple[str, ...]
100
+ ) -> None:
101
+ if len(services) == 1:
102
+ container = services[0]
103
+ print(f"{doing} the {container} container")
104
+ elif len(services) == 2:
105
+ first, second = services
106
+ print(f"{doing} the {first} and {second} containers")
107
+ else:
108
+ *all_but_last, last = services
109
+ print(f"{doing} the {', '.join(all_but_last)}, and {last} containers")
110
+
111
+
97
112
  _P = ParamSpec("_P")
98
113
  _T = TypeVar("_T")
99
114
 
@@ -174,17 +189,6 @@ def _exec_command(command: List[str], *, compose_options: Tuple[str, ...] = ())
174
189
  See Also:
175
190
  :func:`check_system`
176
191
  """
177
- eth_portfolio_scripts.docker.check_system()
178
- try:
179
- subprocess.check_output(
180
- ["docker", "compose", *compose_options, "-f", compose_file, *command]
181
- )
182
- except (subprocess.CalledProcessError, FileNotFoundError) as e:
183
- try:
184
- subprocess.check_output(
185
- ["docker-compose", *compose_options, "-f", compose_file, *command]
186
- )
187
- except (subprocess.CalledProcessError, FileNotFoundError) as _e:
188
- raise RuntimeError(
189
- f"Error occurred while running {' '.join(command)}: {_e}"
190
- ) from _e
192
+ docker_compose._exec_command(
193
+ command, compose_file=COMPOSE_FILE, compose_options=compose_options
194
+ )
Binary file
Binary file
Binary file
dao_treasury/db.py CHANGED
@@ -18,6 +18,7 @@ and creating SQL views for reporting.
18
18
 
19
19
  import typing
20
20
  from asyncio import Semaphore
21
+ from collections import OrderedDict
21
22
  from decimal import Decimal, InvalidOperation
22
23
  from functools import lru_cache
23
24
  from logging import getLogger
@@ -75,6 +76,9 @@ from dao_treasury.constants import CHAINID
75
76
  from dao_treasury.types import TxGroupDbid, TxGroupName
76
77
 
77
78
 
79
+ EventItem = _EventItem[_EventItem[OrderedDict[str, Any]]]
80
+
81
+
78
82
  SQLITE_DIR = Path(path.expanduser("~")) / ".dao-treasury"
79
83
  """Path to the directory in the user's home where the DAO treasury SQLite database is stored."""
80
84
 
@@ -250,6 +254,10 @@ class Address(DbEntity):
250
254
  def contract(self) -> Contract:
251
255
  return Contract(self.address)
252
256
 
257
+ @property
258
+ def contract_coro(self) -> Coroutine[Any, Any, Contract]:
259
+ return Contract.coroutine(self.address)
260
+
253
261
  @staticmethod
254
262
  @lru_cache(maxsize=None)
255
263
  def get_dbid(address: HexAddress) -> int:
@@ -420,6 +428,10 @@ class Token(DbEntity):
420
428
  def contract(self) -> Contract:
421
429
  return Contract(self.address.address)
422
430
 
431
+ @property
432
+ def contract_coro(self) -> Coroutine[Any, Any, Contract]:
433
+ return Contract.coroutine(self.address.address)
434
+
423
435
  @property
424
436
  def scale(self) -> int:
425
437
  """Base for division according to `decimals`, e.g., `10**decimals`.
@@ -734,6 +746,10 @@ class TreasuryTx(DbEntity):
734
746
  """Human-readable label for the sender address."""
735
747
  return self.from_address.nickname or self.from_address.address # type: ignore [union-attr]
736
748
 
749
+ @property
750
+ def token_address(self) -> ChecksumAddress:
751
+ return self.token.address.address
752
+
737
753
  @property
738
754
  def symbol(self) -> str:
739
755
  """Ticker symbol for the transferred token."""
@@ -755,10 +771,10 @@ class TreasuryTx(DbEntity):
755
771
  @overload
756
772
  def get_events(
757
773
  self, event_name: str, sync: Literal[False]
758
- ) -> Coroutine[Any, Any, _EventItem]: ...
774
+ ) -> Coroutine[Any, Any, EventItem]: ...
759
775
  @overload
760
- def get_events(self, event_name: str, sync: bool = True) -> _EventItem: ...
761
- def get_events(self, event_name: str, sync: bool = True) -> _EventItem:
776
+ def get_events(self, event_name: str, sync: bool = True) -> EventItem: ...
777
+ def get_events(self, event_name: str, sync: bool = True) -> EventItem:
762
778
  if not sync:
763
779
  return _EVENTS_THREADS.run(self.get_events, event_name)
764
780
  try:
@@ -5,7 +5,7 @@ networks:
5
5
 
6
6
  services:
7
7
  grafana:
8
- image: grafana/grafana:12.2.0
8
+ image: grafana/grafana:12.2.1
9
9
  ports:
10
10
  - 127.0.0.1:${DAO_TREASURY_GRAFANA_PORT:-3004}:3000
11
11
  environment:
Binary file
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dao_treasury
3
- Version: 0.0.59
3
+ Version: 0.0.66
4
4
  Summary: Produce comprehensive financial reports for your on-chain org
5
5
  Classifier: Development Status :: 3 - Alpha
6
6
  Classifier: Intended Audience :: Developers
@@ -14,8 +14,7 @@ Classifier: Operating System :: OS Independent
14
14
  Classifier: Topic :: Software Development :: Libraries
15
15
  Requires-Python: >=3.10,<3.13
16
16
  Description-Content-Type: text/markdown
17
- Requires-Dist: eth-portfolio-temp<0.3,>=0.2.11
18
- Requires-Dist: ypricemagic>=4.10.0
17
+ Requires-Dist: eth-portfolio-temp==0.2.17
19
18
  Dynamic: classifier
20
19
  Dynamic: description
21
20
  Dynamic: description-content-type
@@ -42,7 +41,7 @@ DAO Treasury is a comprehensive financial reporting and treasury management solu
42
41
  - First, you will need to bring your own archive node. This can be one you run yourself, or one from one of the common providers (Tenderly, Alchemy, QuickNode, etc.). Your archive node must have tracing enabled (free-tier Alchemy nodes do not support this option).
43
42
  - You must configure a [brownie network](https://eth-brownie.readthedocs.io/en/stable/network-management.html) to use your RPC.
44
43
  - You will need an auth token for [Etherscan](https://etherscan.io/)'s API. Follow their [guide](https://docs.etherscan.io/etherscan-v2/getting-an-api-key) to get your key, and set env var `ETHERSCAN_TOKEN` with its value.
45
- - You'll also need [Docker](https://www.docker.com/get-started/) installed on your system. If on MacOS, you will need to leave Docker Desktop open while Yearn Treasury is running.
44
+ - You'll also need [Docker](https://www.docker.com/get-started/) installed on your system. If on MacOS, you will need to leave Docker Desktop open while DAO Treasury is running.
46
45
 
47
46
  ## Installation
48
47
 
@@ -1,20 +1,20 @@
1
- dao_treasury__mypyc.cp312-win_amd64.pyd,sha256=1JupOD2BcDkSfWP4M0QllNrffuKSDyKQSgu1FNj_h6A,480768
1
+ dao_treasury__mypyc.cp312-win_amd64.pyd,sha256=i8e40eRo0ujfcgKSC3_hrXpKfIZDzqpFqBJHeh9YZ-k,480256
2
2
  dao_treasury/ENVIRONMENT_VARIABLES.py,sha256=LS_D4ALB3BO-vYKyh1tzRHi10QBE6f654Zy8pmJ_xPY,656
3
3
  dao_treasury/__init__.py,sha256=ai8iALE_Zv43O9cH1jkNJ39bzhr60kBDX6L7C4Nj9FA,1539
4
- dao_treasury/_docker.cp312-win_amd64.pyd,sha256=HVQTiyqbjU1gFF6KWAy8Vgjxu9TQc5WDkkkwins7itI,10752
5
- dao_treasury/_docker.py,sha256=UFMN-TIBUQBheMIhIhSMhaq7UFgt6ubUcfzwPNap_6o,6098
6
- dao_treasury/_nicknames.cp312-win_amd64.pyd,sha256=zgBrPdjIfKaBYPZ8sOiSyJOQxY47eWjZ70k0-m0-IiY,10752
4
+ dao_treasury/_docker.cp312-win_amd64.pyd,sha256=Fchwrkc9SqRJWPVs-lBFtjOo8WBqV1iKZuFSMWoz2EY,10752
5
+ dao_treasury/_docker.py,sha256=Rki3eLKOmsNxN3nF-gmbM9UQV49SY7ToEHZboL_HYvA,6118
6
+ dao_treasury/_nicknames.cp312-win_amd64.pyd,sha256=pmFPiO8xqzl1sBIOkQht1W7G0ZCPZychnOUx57v59Q4,10752
7
7
  dao_treasury/_nicknames.py,sha256=n8c-JZhORYymCMv6jsC96IthAzAhpslyEn-KCk_YiSM,1049
8
- dao_treasury/_wallet.cp312-win_amd64.pyd,sha256=bKHcMGx3c6IDvtSpK2SjTmTTVYj4p-EDrf0IFnxbP_k,10752
8
+ dao_treasury/_wallet.cp312-win_amd64.pyd,sha256=B11PP8Q1VHBW6LhkGFbXjLT5ojxxcZInAaX9lkK-lqU,10752
9
9
  dao_treasury/_wallet.py,sha256=nHBAKFJstdKuYbvpskGVx2KU80YrZHGHsEh5V3TwIHs,10712
10
- dao_treasury/constants.cp312-win_amd64.pyd,sha256=C-4dTlluWc67RpH2sXzv997jjHMJl-vwcpH-wcfA43M,10752
10
+ dao_treasury/constants.cp312-win_amd64.pyd,sha256=cgrCvcRHxewrCoTiw9jFKNducSSXpzz6vE1XDIGNeXw,10752
11
11
  dao_treasury/constants.py,sha256=-T0oPw7lC5YeaiplHAtYL-2ss7knvKrJKQ1LCc8kX8g,1483
12
- dao_treasury/db.py,sha256=GhWwFYgSgnySsOLARn1aRBoPoYKxGvY8pInBMeVtogc,50262
13
- dao_treasury/docker-compose.yaml,sha256=jt1RjPzR3unoBXiCq_2144t7cNXK6NwyiSjjcXbHnLU,1350
12
+ dao_treasury/db.py,sha256=4Vc_U3mmrG8hOpsuDcgCQQuwGyL3pyfYH2jjktDXx48,50734
13
+ dao_treasury/docker-compose.yaml,sha256=wNNE9xmkchcV-nJxzrmUkbUA0CW1qgdGQKJ7uw2P8nU,1350
14
14
  dao_treasury/main.py,sha256=w7VBmBwNBYjOkz2LpT4_9FZ1CI8AVcr4vyfr1wZVk5Q,8458
15
15
  dao_treasury/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
16
16
  dao_treasury/treasury.py,sha256=wh4wESLbYSHjcfpa-sW5TIqa5pSC9Y_7Id8tzLzJLaw,7414
17
- dao_treasury/types.cp312-win_amd64.pyd,sha256=kwr8-WoEuDrKl4zzX9VwdB7gpUfvVLwXTfofo98pvgA,10752
17
+ dao_treasury/types.cp312-win_amd64.pyd,sha256=1_LkZf2mnhDc5MDZnfG3YyD4cVpHYEtJ-orrj59B__w,10752
18
18
  dao_treasury/types.py,sha256=KFz4WKPp4t_RBwIT6YGwOcgbzw8tdHIOcXTFsUA0pJA,3818
19
19
  dao_treasury/.grafana/provisioning/dashboards/dashboards.yaml,sha256=NfmmICGLVfIrI8ulzUTUYc7wFetk2v-x6eaoYHnCvQc,1914
20
20
  dao_treasury/.grafana/provisioning/dashboards/breakdowns/Expenses.json,sha256=gxfPI4eO3PDPe70Yx7_dN0Yx5isvgy-MKe-fizBClMw,16879
@@ -28,27 +28,27 @@ dao_treasury/.grafana/provisioning/dashboards/treasury/Current Treasury Assets.j
28
28
  dao_treasury/.grafana/provisioning/dashboards/treasury/Historical Treasury Balances.json,sha256=7qVXn2PjeBIp2pFRbVfxA4PeWxhhVKQCr4qIPZoIj90,133963
29
29
  dao_treasury/.grafana/provisioning/dashboards/treasury/Operating Cashflow.json,sha256=fYkiZ37Eg2vu9dPJavCZXPPtX6-rTDbJwE_Ougpo2Mk,15828
30
30
  dao_treasury/.grafana/provisioning/datasources/datasources.yaml,sha256=gLmJsOkEXNzWRDibShfHFySWeuExW-dSB_U0OSfH868,344
31
- dao_treasury/sorting/__init__.cp312-win_amd64.pyd,sha256=YuDGCoJ-LeXmBpVXFKZSRFRUf9O9l48nhrrnkGLkdCU,10752
31
+ dao_treasury/sorting/__init__.cp312-win_amd64.pyd,sha256=lFYVYW-2xysU-iUwTUQSblE7EbrqtUOUdYgg-FOwBf4,10752
32
32
  dao_treasury/sorting/__init__.py,sha256=_uxM_FE1paM8oDAhDdHSyhDwnrlxCYX_lGn2DOqCaHU,10666
33
- dao_treasury/sorting/_matchers.cp312-win_amd64.pyd,sha256=pO2cWDGJqSUVLG2BkpYXXS-ZUEr1CPscu97H9xRosY4,10752
33
+ dao_treasury/sorting/_matchers.cp312-win_amd64.pyd,sha256=-KG3_rs4c9I9CCxJ4Azc6SQSqudRVaFtbU2RwbxlqhM,10752
34
34
  dao_treasury/sorting/_matchers.py,sha256=ACi6aXZCKW5OTiztsID7CXCGJounj5c6ivhOCg2436M,14392
35
- dao_treasury/sorting/_rules.cp312-win_amd64.pyd,sha256=ZIe3WrWxKQnh5Bg09AbPcXtHj7Hvhz3JLDWN6HEHHaQ,10752
35
+ dao_treasury/sorting/_rules.cp312-win_amd64.pyd,sha256=QOFmeTctgdPi5JvYYGalmOjHeKt2F6FiCHDADZCwuH0,10752
36
36
  dao_treasury/sorting/_rules.py,sha256=DxhdUgpS0q0LWeLl9W1Bjn5LZz9z4OLA03vQllPMH9k,9229
37
- dao_treasury/sorting/factory.cp312-win_amd64.pyd,sha256=cuXKxGHVtwJcO47prvzcOaegFIf4iQCrHbyyxp7Cgb0,10752
37
+ dao_treasury/sorting/factory.cp312-win_amd64.pyd,sha256=tWKv7Z0qFR6kfk8g6sh2Nf2jZ99zMyZBTLyCVagIW8U,10752
38
38
  dao_treasury/sorting/factory.py,sha256=zlJ18xlMTxv8ACV6_MimCVIDsw3K5AZcyvKaNYY7R14,10484
39
- dao_treasury/sorting/rule.cp312-win_amd64.pyd,sha256=9rzU6I75akpIqJ5Iifne49IwlpRkZ8vwVmuMA_NMVCQ,10752
39
+ dao_treasury/sorting/rule.cp312-win_amd64.pyd,sha256=zwXYAVanJ-IGp_agLp_lc4ATWXD_VgAM0xOUUNebZHA,10752
40
40
  dao_treasury/sorting/rule.py,sha256=wbL8s0-6dxcCKghUtEDSkLDBnyvggsJ3gt_RawQ6kB4,11972
41
- dao_treasury/sorting/rules/__init__.cp312-win_amd64.pyd,sha256=wR2SZBJWKWf4Us5CIokXZG9kU1_R6bpqCQMouyjweRs,10752
41
+ dao_treasury/sorting/rules/__init__.cp312-win_amd64.pyd,sha256=J8bGTfrtdSj6Sy4H3XE12yTiZQ2acHUgSd8BCsGA4vs,10752
42
42
  dao_treasury/sorting/rules/__init__.py,sha256=hcLfejOEwD8RaM2RE-38Ej6_WkvL9BVGvIIGY848E6E,49
43
- dao_treasury/sorting/rules/ignore/__init__.cp312-win_amd64.pyd,sha256=63bXI3XAIv-eXi9GkfHlqusaNzHmebwfCCfo-MiYtrA,10752
43
+ dao_treasury/sorting/rules/ignore/__init__.cp312-win_amd64.pyd,sha256=p3xs71TniuekcrQxpc8exwBvN9W7tyi4w721oW0R9Hg,10752
44
44
  dao_treasury/sorting/rules/ignore/__init__.py,sha256=16THKoGdj6qfkkytuCFVG_R1M6KSErMI4AVE1p0ukS4,58
45
- dao_treasury/sorting/rules/ignore/llamapay.cp312-win_amd64.pyd,sha256=J_lTWxK1pfEjvn-5xOBsAY8RCqomm61bxPTZVNPVSGo,10752
45
+ dao_treasury/sorting/rules/ignore/llamapay.cp312-win_amd64.pyd,sha256=Z6SeCJijOtUAo9z3eMRXoUQIhUuxzLwMVCwTOiX3wnw,10752
46
46
  dao_treasury/sorting/rules/ignore/llamapay.py,sha256=aYyAJRlmv419IeaqkcV5o3ffx0UVfteU0lTl80j0BGo,783
47
- dao_treasury/streams/__init__.cp312-win_amd64.pyd,sha256=hF8_DOw0Ca6XCIwsyEaCcU1bA9cB5YcFZStalC-ia6Q,10752
47
+ dao_treasury/streams/__init__.cp312-win_amd64.pyd,sha256=jI8g2gh-bw1h0YvfD4I3FTLyFZYswayTPXCBsrJCrJ8,10752
48
48
  dao_treasury/streams/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
49
- dao_treasury/streams/llamapay.cp312-win_amd64.pyd,sha256=TiEyDmDIJMPHuaNIRx0rqvl_nuxX7_VWwZu501mhlZM,10752
49
+ dao_treasury/streams/llamapay.cp312-win_amd64.pyd,sha256=j7OOeq8jqYM-u92Xi9gGgfVvQPlpquTgW2RbzxIWaaM,10752
50
50
  dao_treasury/streams/llamapay.py,sha256=rO1Mh2ndTziR6pnRkKHnQ22a_Yx9PM_-BG7I4dspEZ8,13535
51
- dao_treasury-0.0.59.dist-info/METADATA,sha256=W8MUMmCPB_XjIKmVoMDyszUQbw4dXcAPTT8sj8ZCnms,7274
52
- dao_treasury-0.0.59.dist-info/WHEEL,sha256=8UP9x9puWI0P1V_d7K2oMTBqfeLNm21CTzZ_Ptr0NXU,101
53
- dao_treasury-0.0.59.dist-info/top_level.txt,sha256=CV8aYytuSYplDhLVY4n0GphckdysXCd1lHmbqfsPxNk,33
54
- dao_treasury-0.0.59.dist-info/RECORD,,
51
+ dao_treasury-0.0.66.dist-info/METADATA,sha256=nRELLkqPXQ9txn_xT6V8ozMHyivB-Hr6QrR7eEUXG2o,7231
52
+ dao_treasury-0.0.66.dist-info/WHEEL,sha256=8UP9x9puWI0P1V_d7K2oMTBqfeLNm21CTzZ_Ptr0NXU,101
53
+ dao_treasury-0.0.66.dist-info/top_level.txt,sha256=CV8aYytuSYplDhLVY4n0GphckdysXCd1lHmbqfsPxNk,33
54
+ dao_treasury-0.0.66.dist-info/RECORD,,
Binary file