tristero 0.1.3__py3-none-any.whl → 0.1.5__py3-none-any.whl
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/api.py +2 -2
- tristero/client.py +2 -2
- tristero/files/__init__.py +0 -0
- tristero/permit2.py +3 -3
- {tristero-0.1.3.dist-info → tristero-0.1.5.dist-info}/METADATA +4 -5
- tristero-0.1.5.dist-info/RECORD +12 -0
- tristero-0.1.3.dist-info/RECORD +0 -11
- {tristero-0.1.3.dist-info → tristero-0.1.5.dist-info}/WHEEL +0 -0
tristero/api.py
CHANGED
|
@@ -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
|
|
tristero/client.py
CHANGED
|
@@ -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(
|
|
File without changes
|
tristero/permit2.py
CHANGED
|
@@ -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
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: tristero
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.5
|
|
4
4
|
Summary: Library for trading on Tristero
|
|
5
5
|
Author: pty1
|
|
6
6
|
Author-email: pty1 <pty11@proton.me>
|
|
@@ -10,7 +10,7 @@ Requires-Dist: pydantic>=2.12.4
|
|
|
10
10
|
Requires-Dist: tenacity>=9.1.2
|
|
11
11
|
Requires-Dist: web3>=7.14.0
|
|
12
12
|
Requires-Dist: websockets>=15.0.1
|
|
13
|
-
Requires-Python: >=3.
|
|
13
|
+
Requires-Python: >=3.10
|
|
14
14
|
Description-Content-Type: text/markdown
|
|
15
15
|
|
|
16
16
|
# Tristero
|
|
@@ -51,9 +51,8 @@ result = await execute_swap(
|
|
|
51
51
|
### How it works
|
|
52
52
|
|
|
53
53
|
Tristero swaps happen in two steps:
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
2. Submit & Fill - Submit the signed order to be filled at a later date
|
|
54
|
+
- **Quote & Sign** - Request a quote from the server and sign it with your private key
|
|
55
|
+
- **Submit & Fill** - Submit the signed order to be filled at a later date
|
|
57
56
|
|
|
58
57
|
This library provides both high-level convenience functions and lower-level components for precise control.
|
|
59
58
|
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
tristero/__init__.py,sha256=Jmbdg3LwOD4rrO0eerQTmn-wO-Sr4xRZ2r_RtM4iNDg,315
|
|
2
|
+
tristero/api.py,sha256=E5CyEbEZjeEpptJ2C5570g-ZD02PWE73USTz5v-uKss,5520
|
|
3
|
+
tristero/client.py,sha256=nro5d9z5cAZOWSgF3s43UcFPMrTqbFk4DxIWo14u7-Y,4086
|
|
4
|
+
tristero/config.py,sha256=_0PP2gufvq_t-gdKqDrxht2BxoWpNiGXk4m_u57WOYY,530
|
|
5
|
+
tristero/files/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
6
|
+
tristero/files/erc20_abi.json,sha256=jvsJ6aCwhMcmo3Yy1ajt5lPl_nTRg7tv-tGj87xzTOg,12800
|
|
7
|
+
tristero/files/permit2_abi.json,sha256=NV0AUUA9kqFPk56njvRRzUyjBhrBncKIMd3PrSH0LCc,17817
|
|
8
|
+
tristero/permit2.py,sha256=9uEgwwBfYnEzkbIv0jbLybXnthdzHPrZ-gAzzg_a6j4,11338
|
|
9
|
+
tristero/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
10
|
+
tristero-0.1.5.dist-info/WHEEL,sha256=eh7sammvW2TypMMMGKgsM83HyA_3qQ5Lgg3ynoecH3M,79
|
|
11
|
+
tristero-0.1.5.dist-info/METADATA,sha256=TakQaHuRMrwdXSnvaZAs0DvB6U2RW4YmUx-UzX3pNoE,4389
|
|
12
|
+
tristero-0.1.5.dist-info/RECORD,,
|
tristero-0.1.3.dist-info/RECORD
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
tristero/__init__.py,sha256=Jmbdg3LwOD4rrO0eerQTmn-wO-Sr4xRZ2r_RtM4iNDg,315
|
|
2
|
-
tristero/api.py,sha256=l4Qk_MJnu77bOjiqIdS7DYQbAg-JvYWBYpSmpeyFXEU,5507
|
|
3
|
-
tristero/client.py,sha256=DEcupVyEbPf78JDu-FrG8a60JlNQM0B10BsfieH8ddE,4073
|
|
4
|
-
tristero/config.py,sha256=_0PP2gufvq_t-gdKqDrxht2BxoWpNiGXk4m_u57WOYY,530
|
|
5
|
-
tristero/files/erc20_abi.json,sha256=jvsJ6aCwhMcmo3Yy1ajt5lPl_nTRg7tv-tGj87xzTOg,12800
|
|
6
|
-
tristero/files/permit2_abi.json,sha256=NV0AUUA9kqFPk56njvRRzUyjBhrBncKIMd3PrSH0LCc,17817
|
|
7
|
-
tristero/permit2.py,sha256=pOqNNZjd78QTHxhAPXjyN5NxBbXd5hF4o0pWP8WDvco,11329
|
|
8
|
-
tristero/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
9
|
-
tristero-0.1.3.dist-info/WHEEL,sha256=eh7sammvW2TypMMMGKgsM83HyA_3qQ5Lgg3ynoecH3M,79
|
|
10
|
-
tristero-0.1.3.dist-info/METADATA,sha256=NZVmaIbM6f_JeJdDdDw691UPAj_6JWNXnTrut35XvxI,4384
|
|
11
|
-
tristero-0.1.3.dist-info/RECORD,,
|
|
File without changes
|