Metadata-Version: 2.3
Name: tristero
Version: 0.1.2
Summary: Library for trading on Tristero
Author: pty1
Author-email: pty1 <pty11@proton.me>
Requires-Dist: eth-account>=0.13.7
Requires-Dist: httpx>=0.28.1
Requires-Dist: pydantic>=2.12.4
Requires-Dist: tenacity>=9.1.2
Requires-Dist: web3>=7.14.0
Requires-Dist: websockets>=15.0.1
Requires-Python: >=3.13
Description-Content-Type: text/markdown

# Tristero
[![PyPI version](https://badge.fury.io/py/tristero.svg)](https://badge.fury.io/py/tristero)
[![Python Support](https://img.shields.io/pypi/pyversions/tristero.svg)](https://pypi.org/project/tristero/)

This repository is home to Tristero's trading library.

### Installation
```
pip install tristero
```

### Usage

You can get started making swaps on Tristero as easily as:

```py
import os
from tristero.client import TokenSpec, execute_swap, wait_for_completion
from eth_account import Account
from web3 import AsyncWeb3
from tristero.api import ChainID

private_key = os.getenv("EVM_PRIVATE_KEY")
account = Account.from_key(private_key)
w3 = AsyncWeb3(AsyncWeb3.AsyncHTTPProvider("https://arbitrum-one-rpc.publicnode.com")) # adjust RPC endpoint as needed

res = await execute_swap(
    w3,
    account,
    TokenSpec(chain_id=ChainID.arbitrum, token_address="0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9"), # USDT0(arbitrum)
    TokenSpec(chain_id=ChainID.base, token_address="0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"), # USDC(base)
    10000000 # Raw token amount (no decimals). You can calculate this with amount * (10 ** decimals)
)
```