Make tycho_client a python package, small bugfixes

This commit is contained in:
Thales Lima
2024-07-19 04:19:34 +02:00
committed by tvinagre
parent 13c1db8171
commit e0c1ba3b50
29 changed files with 122 additions and 37 deletions

View File

@@ -0,0 +1,38 @@
# Tycho Adapter
This repository contains the Tycho Adapter, a tool that allows you to interact with the Tycho API.
## Installation
### Prerequisites
- Python 3.9
### Install with pip
```shell
# Create conda environment
conda create -n tycho pip python=3.9
# Activate environment
conda activate tycho
# Install packages
pip install -r requirements.txt
```
## Usage
```python
from tycho_client.tycho.decoders import ThirdPartyPoolTychoDecoder
from tycho_client.tycho.models import Blockchain
from tycho_client.tycho.tycho_adapter import TychoPoolStateStreamAdapter
decoder = ThirdPartyPoolTychoDecoder(
"MyProtocolSwapAdapter.evm.runtime", minimum_gas=0, hard_limit=False
)
stream_adapter = TychoPoolStateStreamAdapter(
tycho_url="0.0.0.0:4242",
protocol="my_protocol",
decoder=decoder,
blockchain=Blockchain.ethereum,
)
```