diff --git a/tycho/README.md b/tycho/README.md new file mode 100644 index 0000000..e69de29 diff --git a/tycho/requirements.txt b/tycho/requirements.txt new file mode 100644 index 0000000..e69de29 diff --git a/tycho/tycho/__init__.py b/tycho/tycho/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tycho/tycho/constants.py b/tycho/tycho/constants.py new file mode 100644 index 0000000..1dc7c1a --- /dev/null +++ b/tycho/tycho/constants.py @@ -0,0 +1,11 @@ +from pathlib import Path +from typing import Final + +TYCHO_CLIENT_FOLDER = Path(__file__) / "bins" +TYCHO_CLIENT_LOG_FOLDER = TYCHO_CLIENT_FOLDER / "logs" + +EXTERNAL_ACCOUNT: Final[str] = "0xf847a638E44186F3287ee9F8cAF73FF4d4B80784" +"""This is a dummy address used as a transaction sender""" +UINT256_MAX: Final[int] = 2 ** 256 - 1 +MAX_BALANCE: Final[int] = UINT256_MAX // 2 +"""0.5 of the maximal possible balance to avoid overflow errors""" diff --git a/tycho/tycho/decoders.py b/tycho/tycho/decoders.py new file mode 100644 index 0000000..73c1479 --- /dev/null +++ b/tycho/tycho/decoders.py @@ -0,0 +1,9 @@ +from tycho.tycho.models import EVMBlock + + +class ThirdPartyPoolTychoDecoder: + """ThirdPartyPool decoder for protocol messages from the Tycho feed""" + + def decode_snapshot(self, message, block: EVMBlock): + """Decode a message from the Tycho feed""" + pass diff --git a/tycho/tycho/exceptions.py b/tycho/tycho/exceptions.py new file mode 100644 index 0000000..e69de29 diff --git a/tycho/tycho/models.py b/tycho/tycho/models.py new file mode 100644 index 0000000..a71deb8 --- /dev/null +++ b/tycho/tycho/models.py @@ -0,0 +1,20 @@ +import datetime +from enum import Enum +from pydantic import BaseModel, Field + + +class Blockchain(Enum): + ethereum = "ethereum" + arbitrum = "arbitrum" + polygon = "polygon" + zksync = "zksync" + + +class EVMBlock(BaseModel): + id: int + ts: datetime.datetime = Field(default_factory=datetime.datetime.utcnow) + hash_: str + + +class ThirdPartyPool: + pass