Create structure
This commit is contained in:
0
tycho/README.md
Normal file
0
tycho/README.md
Normal file
0
tycho/requirements.txt
Normal file
0
tycho/requirements.txt
Normal file
0
tycho/tycho/__init__.py
Normal file
0
tycho/tycho/__init__.py
Normal file
11
tycho/tycho/constants.py
Normal file
11
tycho/tycho/constants.py
Normal file
@@ -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"""
|
||||||
9
tycho/tycho/decoders.py
Normal file
9
tycho/tycho/decoders.py
Normal file
@@ -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
|
||||||
0
tycho/tycho/exceptions.py
Normal file
0
tycho/tycho/exceptions.py
Normal file
20
tycho/tycho/models.py
Normal file
20
tycho/tycho/models.py
Normal file
@@ -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
|
||||||
Reference in New Issue
Block a user