tristero 0.1.4__tar.gz → 0.1.6__tar.gz
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.
- {tristero-0.1.4 → tristero-0.1.6}/PKG-INFO +8 -8
- {tristero-0.1.4 → tristero-0.1.6}/pyproject.toml +8 -8
- {tristero-0.1.4 → tristero-0.1.6}/src/tristero/api.py +2 -2
- {tristero-0.1.4 → tristero-0.1.6}/src/tristero/client.py +2 -2
- {tristero-0.1.4 → tristero-0.1.6}/src/tristero/permit2.py +3 -3
- tristero-0.1.6/src/tristero/py.typed +0 -0
- {tristero-0.1.4 → tristero-0.1.6}/README.md +0 -0
- {tristero-0.1.4 → tristero-0.1.6}/src/tristero/__init__.py +0 -0
- {tristero-0.1.4 → tristero-0.1.6}/src/tristero/config.py +0 -0
- /tristero-0.1.4/src/tristero/py.typed → /tristero-0.1.6/src/tristero/files/__init__.py +0 -0
- {tristero-0.1.4 → tristero-0.1.6}/src/tristero/files/erc20_abi.json +0 -0
- {tristero-0.1.4 → tristero-0.1.6}/src/tristero/files/permit2_abi.json +0 -0
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: tristero
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.6
|
|
4
4
|
Summary: Library for trading on Tristero
|
|
5
5
|
Author: pty1
|
|
6
6
|
Author-email: pty1 <pty11@proton.me>
|
|
7
|
-
Requires-Dist: eth-account>=0.
|
|
8
|
-
Requires-Dist: httpx>=0.
|
|
9
|
-
Requires-Dist: pydantic>=2.
|
|
10
|
-
Requires-Dist: tenacity>=
|
|
11
|
-
Requires-Dist: web3>=
|
|
12
|
-
Requires-Dist: websockets>=
|
|
13
|
-
Requires-Python: >=3.
|
|
7
|
+
Requires-Dist: eth-account>=0.8.0
|
|
8
|
+
Requires-Dist: httpx>=0.23.0
|
|
9
|
+
Requires-Dist: pydantic>=2.0.0
|
|
10
|
+
Requires-Dist: tenacity>=8.0.0
|
|
11
|
+
Requires-Dist: web3>=6.0.0
|
|
12
|
+
Requires-Dist: websockets>=10.0
|
|
13
|
+
Requires-Python: >=3.10
|
|
14
14
|
Description-Content-Type: text/markdown
|
|
15
15
|
|
|
16
16
|
# Tristero
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "tristero"
|
|
3
|
-
version = "0.1.
|
|
3
|
+
version = "0.1.6"
|
|
4
4
|
description = "Library for trading on Tristero"
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
authors = [
|
|
7
7
|
{ name = "pty1", email = "pty11@proton.me" }
|
|
8
8
|
]
|
|
9
|
-
requires-python = ">=3.
|
|
9
|
+
requires-python = ">=3.10"
|
|
10
10
|
dependencies = [
|
|
11
|
-
"eth-account>=0.
|
|
12
|
-
"httpx>=0.
|
|
13
|
-
"pydantic>=2.
|
|
14
|
-
"tenacity>=
|
|
15
|
-
"web3>=
|
|
16
|
-
"websockets>=
|
|
11
|
+
"eth-account>=0.8.0",
|
|
12
|
+
"httpx>=0.23.0",
|
|
13
|
+
"pydantic>=2.0.0",
|
|
14
|
+
"tenacity>=8.0.0",
|
|
15
|
+
"web3>=6.0.0",
|
|
16
|
+
"websockets>=10.0"
|
|
17
17
|
]
|
|
18
18
|
|
|
19
19
|
[build-system]
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
from enum import Enum
|
|
2
|
-
from typing import Any
|
|
2
|
+
from typing import Any, Optional
|
|
3
3
|
import httpx
|
|
4
4
|
from websockets.asyncio.client import connect
|
|
5
5
|
from tristero.config import get_config
|
|
@@ -95,7 +95,7 @@ async def t_get(client: httpx.AsyncClient, url: str):
|
|
|
95
95
|
return handle_resp(resp)
|
|
96
96
|
|
|
97
97
|
|
|
98
|
-
async def t_post(client: httpx.AsyncClient, url: str, body: dict[str, Any]
|
|
98
|
+
async def t_post(client: httpx.AsyncClient, url: str, body: Optional[dict[str, Any]]):
|
|
99
99
|
resp = await client.post(url, headers=get_config().headers, json=body, timeout=20)
|
|
100
100
|
return handle_resp(resp)
|
|
101
101
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import asyncio
|
|
2
2
|
import json
|
|
3
3
|
import logging
|
|
4
|
-
from typing import Any, TypeVar
|
|
4
|
+
from typing import Any, Optional, TypeVar
|
|
5
5
|
|
|
6
6
|
from eth_account.signers.local import LocalAccount
|
|
7
7
|
from pydantic import BaseModel
|
|
@@ -121,7 +121,7 @@ async def execute_swap(
|
|
|
121
121
|
dst_t: TokenSpec,
|
|
122
122
|
raw_amount: int,
|
|
123
123
|
retry: bool = True,
|
|
124
|
-
timeout: float
|
|
124
|
+
timeout: Optional[float] = None
|
|
125
125
|
) -> dict[str, Any]:
|
|
126
126
|
"""Execute and wait for swap completion."""
|
|
127
127
|
order_id = await start_swap(
|
|
@@ -125,7 +125,7 @@ class SignatureData(BaseSchema, frozen=True):
|
|
|
125
125
|
message: PermitMessage
|
|
126
126
|
|
|
127
127
|
|
|
128
|
-
def first_zero_bit(n: int) -> int
|
|
128
|
+
def first_zero_bit(n: int) -> Optional[int]:
|
|
129
129
|
if n > 0 and (n & (n + 1)) == 0:
|
|
130
130
|
return None
|
|
131
131
|
return (n ^ (n + 1)).bit_length() - 1
|
|
@@ -158,7 +158,7 @@ async def prepare_data_for_signature(
|
|
|
158
158
|
buy_data: ChainData,
|
|
159
159
|
wallet_address: str,
|
|
160
160
|
quote: Quote,
|
|
161
|
-
destination_address: str
|
|
161
|
+
destination_address: Optional[str] = None,
|
|
162
162
|
) -> SignatureData:
|
|
163
163
|
"""
|
|
164
164
|
Prepare EIP-712 signature data for Permit2 witness transfer.
|
|
@@ -366,7 +366,7 @@ async def create_order(
|
|
|
366
366
|
dst_chain: ChainID,
|
|
367
367
|
dst_token: str,
|
|
368
368
|
raw_amount: int,
|
|
369
|
-
to_address: str
|
|
369
|
+
to_address: Optional[str] = None,
|
|
370
370
|
):
|
|
371
371
|
if not to_address:
|
|
372
372
|
to_address = account.address
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|