tristero 0.3.0__tar.gz → 0.3.2__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.
Files changed (27) hide show
  1. {tristero-0.3.0 → tristero-0.3.2}/PKG-INFO +93 -12
  2. {tristero-0.3.0 → tristero-0.3.2}/README.md +92 -11
  3. {tristero-0.3.0 → tristero-0.3.2}/pyproject.toml +1 -1
  4. {tristero-0.3.0 → tristero-0.3.2}/src/tristero.egg-info/PKG-INFO +93 -12
  5. {tristero-0.3.0 → tristero-0.3.2}/LICENSE +0 -0
  6. {tristero-0.3.0 → tristero-0.3.2}/setup.cfg +0 -0
  7. {tristero-0.3.0 → tristero-0.3.2}/src/tristero/__init__.py +0 -0
  8. {tristero-0.3.0 → tristero-0.3.2}/src/tristero/api.py +0 -0
  9. {tristero-0.3.0 → tristero-0.3.2}/src/tristero/client.py +0 -0
  10. {tristero-0.3.0 → tristero-0.3.2}/src/tristero/config.py +0 -0
  11. {tristero-0.3.0 → tristero-0.3.2}/src/tristero/data.py +0 -0
  12. {tristero-0.3.0 → tristero-0.3.2}/src/tristero/eip712/__init__.py +0 -0
  13. {tristero-0.3.0 → tristero-0.3.2}/src/tristero/eip712/eip712_auto.py +0 -0
  14. {tristero-0.3.0 → tristero-0.3.2}/src/tristero/eip712/eip712_struct.py +0 -0
  15. {tristero-0.3.0 → tristero-0.3.2}/src/tristero/eip712/escrow_utils.py +0 -0
  16. {tristero-0.3.0 → tristero-0.3.2}/src/tristero/eip712/nested_types.py +0 -0
  17. {tristero-0.3.0 → tristero-0.3.2}/src/tristero/eip712/simple_types.py +0 -0
  18. {tristero-0.3.0 → tristero-0.3.2}/src/tristero/files/__init__.py +0 -0
  19. {tristero-0.3.0 → tristero-0.3.2}/src/tristero/files/chains.json +0 -0
  20. {tristero-0.3.0 → tristero-0.3.2}/src/tristero/files/erc20_abi.json +0 -0
  21. {tristero-0.3.0 → tristero-0.3.2}/src/tristero/files/permit2_abi.json +0 -0
  22. {tristero-0.3.0 → tristero-0.3.2}/src/tristero/permit2.py +0 -0
  23. {tristero-0.3.0 → tristero-0.3.2}/src/tristero/py.typed +0 -0
  24. {tristero-0.3.0 → tristero-0.3.2}/src/tristero.egg-info/SOURCES.txt +0 -0
  25. {tristero-0.3.0 → tristero-0.3.2}/src/tristero.egg-info/dependency_links.txt +0 -0
  26. {tristero-0.3.0 → tristero-0.3.2}/src/tristero.egg-info/requires.txt +0 -0
  27. {tristero-0.3.0 → tristero-0.3.2}/src/tristero.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: tristero
3
- Version: 0.3.0
3
+ Version: 0.3.2
4
4
  Summary: Library for trading on Tristero
5
5
  Author-email: pty1 <pty11@proton.me>
6
6
  Requires-Python: >=3.10
@@ -22,6 +22,23 @@ Dynamic: license-file
22
22
 
23
23
  This repository is home to Tristero's trading library.
24
24
 
25
+
26
+ ### How it works
27
+
28
+ Tristero supports two primary swap mechanisms:
29
+
30
+ #### Permit2 Swaps (EVM-to-EVM)
31
+ - **Quote & Approve** - Request a quote and approve tokens via Permit2 (gasless approval)
32
+ - **Sign & Submit** - Sign an EIP-712 order and submit for execution
33
+ - **Monitor** - Track swap progress via WebSocket updates
34
+
35
+ #### Feather Swaps (UTXO-based)
36
+ - **Quote & Deposit** - Request a quote to receive a deposit address
37
+ - **Manual Transfer** - Send funds to the provided deposit address
38
+ - **Monitor** - Track swap completion via WebSocket updates
39
+
40
+ This library provides both high-level convenience functions and lower-level components for precise control.
41
+
25
42
  ### Installation
26
43
  ```
27
44
  pip install tristero
@@ -181,18 +198,82 @@ async def main() -> None:
181
198
  asyncio.run(main())
182
199
  ```
183
200
 
184
- ### How it works
185
201
 
186
- Tristero supports two primary swap mechanisms:
202
+ #### Feather: Start (get deposit address)
187
203
 
188
- #### Permit2 Swaps (EVM-to-EVM)
189
- - **Quote & Approve** - Request a quote and approve tokens via Permit2 (gasless approval)
190
- - **Sign & Submit** - Sign an EIP-712 order and submit for execution
191
- - **Monitor** - Track swap progress via WebSocket updates
204
+ Feather swaps are deposit-based: you start an order to receive a `deposit_address`, send funds to it manually, then optionally wait for completion.
192
205
 
193
- #### Feather Swaps (UTXO-based)
194
- - **Quote & Deposit** - Request a quote to receive a deposit address
195
- - **Manual Transfer** - Send funds to the provided deposit address
196
- - **Monitor** - Track swap completion via WebSocket updates
206
+ Submit only:
197
207
 
198
- This library provides both high-level convenience functions and lower-level components for precise control.
208
+ ```py
209
+ import asyncio
210
+
211
+ from tristero import ChainID, TokenSpec, start_feather_swap
212
+
213
+
214
+ async def main() -> None:
215
+ # Example: ETH (native) -> XMR (native)
216
+ src_t = TokenSpec(chain_id=ChainID.ethereum, token_address="native")
217
+ dst_t = TokenSpec(chain_id=ChainID.monero, token_address="native")
218
+
219
+ # Replace with your own destination address on the destination chain.
220
+ dst_addr = "YOUR_XMR_ADDRESS"
221
+
222
+ swap = await start_feather_swap(
223
+ src_t=src_t,
224
+ dst_t=dst_t,
225
+ dst_addr=dst_addr,
226
+ raw_amount=100_000_000_000_000_000, # 0.1 ETH in wei
227
+ )
228
+
229
+ order_id = (
230
+ (swap.data or {}).get("id")
231
+ or (swap.data or {}).get("order_id")
232
+ or (swap.data or {}).get("orderId")
233
+ or ""
234
+ )
235
+
236
+ print("order_id:", order_id)
237
+ print("deposit_address:", swap.deposit_address)
238
+
239
+
240
+ asyncio.run(main())
241
+ ```
242
+
243
+ Submit + wait (WebSocket):
244
+
245
+ ```py
246
+ import asyncio
247
+
248
+ from tristero import ChainID, OrderType, TokenSpec, start_feather_swap, wait_for_completion
249
+
250
+
251
+ async def main() -> None:
252
+ src_t = TokenSpec(chain_id=ChainID.ethereum, token_address="native")
253
+ dst_t = TokenSpec(chain_id=ChainID.monero, token_address="native")
254
+ dst_addr = "YOUR_XMR_ADDRESS"
255
+
256
+ swap = await start_feather_swap(
257
+ src_t=src_t,
258
+ dst_t=dst_t,
259
+ dst_addr=dst_addr,
260
+ raw_amount=100_000_000_000_000_000,
261
+ )
262
+
263
+ order_id = (
264
+ (swap.data or {}).get("id")
265
+ or (swap.data or {}).get("order_id")
266
+ or (swap.data or {}).get("orderId")
267
+ or ""
268
+ )
269
+ if not order_id:
270
+ raise RuntimeError(f"Feather swap response missing order id: {swap.data}")
271
+
272
+ print("deposit_address:", swap.deposit_address)
273
+ print("Waiting for completion...")
274
+ completion = await wait_for_completion(order_id, order_type=OrderType.FEATHER)
275
+ print(completion)
276
+
277
+
278
+ asyncio.run(main())
279
+ ```
@@ -4,6 +4,23 @@
4
4
 
5
5
  This repository is home to Tristero's trading library.
6
6
 
7
+
8
+ ### How it works
9
+
10
+ Tristero supports two primary swap mechanisms:
11
+
12
+ #### Permit2 Swaps (EVM-to-EVM)
13
+ - **Quote & Approve** - Request a quote and approve tokens via Permit2 (gasless approval)
14
+ - **Sign & Submit** - Sign an EIP-712 order and submit for execution
15
+ - **Monitor** - Track swap progress via WebSocket updates
16
+
17
+ #### Feather Swaps (UTXO-based)
18
+ - **Quote & Deposit** - Request a quote to receive a deposit address
19
+ - **Manual Transfer** - Send funds to the provided deposit address
20
+ - **Monitor** - Track swap completion via WebSocket updates
21
+
22
+ This library provides both high-level convenience functions and lower-level components for precise control.
23
+
7
24
  ### Installation
8
25
  ```
9
26
  pip install tristero
@@ -163,18 +180,82 @@ async def main() -> None:
163
180
  asyncio.run(main())
164
181
  ```
165
182
 
166
- ### How it works
167
183
 
168
- Tristero supports two primary swap mechanisms:
184
+ #### Feather: Start (get deposit address)
169
185
 
170
- #### Permit2 Swaps (EVM-to-EVM)
171
- - **Quote & Approve** - Request a quote and approve tokens via Permit2 (gasless approval)
172
- - **Sign & Submit** - Sign an EIP-712 order and submit for execution
173
- - **Monitor** - Track swap progress via WebSocket updates
186
+ Feather swaps are deposit-based: you start an order to receive a `deposit_address`, send funds to it manually, then optionally wait for completion.
174
187
 
175
- #### Feather Swaps (UTXO-based)
176
- - **Quote & Deposit** - Request a quote to receive a deposit address
177
- - **Manual Transfer** - Send funds to the provided deposit address
178
- - **Monitor** - Track swap completion via WebSocket updates
188
+ Submit only:
179
189
 
180
- This library provides both high-level convenience functions and lower-level components for precise control.
190
+ ```py
191
+ import asyncio
192
+
193
+ from tristero import ChainID, TokenSpec, start_feather_swap
194
+
195
+
196
+ async def main() -> None:
197
+ # Example: ETH (native) -> XMR (native)
198
+ src_t = TokenSpec(chain_id=ChainID.ethereum, token_address="native")
199
+ dst_t = TokenSpec(chain_id=ChainID.monero, token_address="native")
200
+
201
+ # Replace with your own destination address on the destination chain.
202
+ dst_addr = "YOUR_XMR_ADDRESS"
203
+
204
+ swap = await start_feather_swap(
205
+ src_t=src_t,
206
+ dst_t=dst_t,
207
+ dst_addr=dst_addr,
208
+ raw_amount=100_000_000_000_000_000, # 0.1 ETH in wei
209
+ )
210
+
211
+ order_id = (
212
+ (swap.data or {}).get("id")
213
+ or (swap.data or {}).get("order_id")
214
+ or (swap.data or {}).get("orderId")
215
+ or ""
216
+ )
217
+
218
+ print("order_id:", order_id)
219
+ print("deposit_address:", swap.deposit_address)
220
+
221
+
222
+ asyncio.run(main())
223
+ ```
224
+
225
+ Submit + wait (WebSocket):
226
+
227
+ ```py
228
+ import asyncio
229
+
230
+ from tristero import ChainID, OrderType, TokenSpec, start_feather_swap, wait_for_completion
231
+
232
+
233
+ async def main() -> None:
234
+ src_t = TokenSpec(chain_id=ChainID.ethereum, token_address="native")
235
+ dst_t = TokenSpec(chain_id=ChainID.monero, token_address="native")
236
+ dst_addr = "YOUR_XMR_ADDRESS"
237
+
238
+ swap = await start_feather_swap(
239
+ src_t=src_t,
240
+ dst_t=dst_t,
241
+ dst_addr=dst_addr,
242
+ raw_amount=100_000_000_000_000_000,
243
+ )
244
+
245
+ order_id = (
246
+ (swap.data or {}).get("id")
247
+ or (swap.data or {}).get("order_id")
248
+ or (swap.data or {}).get("orderId")
249
+ or ""
250
+ )
251
+ if not order_id:
252
+ raise RuntimeError(f"Feather swap response missing order id: {swap.data}")
253
+
254
+ print("deposit_address:", swap.deposit_address)
255
+ print("Waiting for completion...")
256
+ completion = await wait_for_completion(order_id, order_type=OrderType.FEATHER)
257
+ print(completion)
258
+
259
+
260
+ asyncio.run(main())
261
+ ```
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "tristero"
3
- version = "0.3.0"
3
+ version = "0.3.2"
4
4
  description = "Library for trading on Tristero"
5
5
  readme = "README.md"
6
6
  authors = [
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: tristero
3
- Version: 0.3.0
3
+ Version: 0.3.2
4
4
  Summary: Library for trading on Tristero
5
5
  Author-email: pty1 <pty11@proton.me>
6
6
  Requires-Python: >=3.10
@@ -22,6 +22,23 @@ Dynamic: license-file
22
22
 
23
23
  This repository is home to Tristero's trading library.
24
24
 
25
+
26
+ ### How it works
27
+
28
+ Tristero supports two primary swap mechanisms:
29
+
30
+ #### Permit2 Swaps (EVM-to-EVM)
31
+ - **Quote & Approve** - Request a quote and approve tokens via Permit2 (gasless approval)
32
+ - **Sign & Submit** - Sign an EIP-712 order and submit for execution
33
+ - **Monitor** - Track swap progress via WebSocket updates
34
+
35
+ #### Feather Swaps (UTXO-based)
36
+ - **Quote & Deposit** - Request a quote to receive a deposit address
37
+ - **Manual Transfer** - Send funds to the provided deposit address
38
+ - **Monitor** - Track swap completion via WebSocket updates
39
+
40
+ This library provides both high-level convenience functions and lower-level components for precise control.
41
+
25
42
  ### Installation
26
43
  ```
27
44
  pip install tristero
@@ -181,18 +198,82 @@ async def main() -> None:
181
198
  asyncio.run(main())
182
199
  ```
183
200
 
184
- ### How it works
185
201
 
186
- Tristero supports two primary swap mechanisms:
202
+ #### Feather: Start (get deposit address)
187
203
 
188
- #### Permit2 Swaps (EVM-to-EVM)
189
- - **Quote & Approve** - Request a quote and approve tokens via Permit2 (gasless approval)
190
- - **Sign & Submit** - Sign an EIP-712 order and submit for execution
191
- - **Monitor** - Track swap progress via WebSocket updates
204
+ Feather swaps are deposit-based: you start an order to receive a `deposit_address`, send funds to it manually, then optionally wait for completion.
192
205
 
193
- #### Feather Swaps (UTXO-based)
194
- - **Quote & Deposit** - Request a quote to receive a deposit address
195
- - **Manual Transfer** - Send funds to the provided deposit address
196
- - **Monitor** - Track swap completion via WebSocket updates
206
+ Submit only:
197
207
 
198
- This library provides both high-level convenience functions and lower-level components for precise control.
208
+ ```py
209
+ import asyncio
210
+
211
+ from tristero import ChainID, TokenSpec, start_feather_swap
212
+
213
+
214
+ async def main() -> None:
215
+ # Example: ETH (native) -> XMR (native)
216
+ src_t = TokenSpec(chain_id=ChainID.ethereum, token_address="native")
217
+ dst_t = TokenSpec(chain_id=ChainID.monero, token_address="native")
218
+
219
+ # Replace with your own destination address on the destination chain.
220
+ dst_addr = "YOUR_XMR_ADDRESS"
221
+
222
+ swap = await start_feather_swap(
223
+ src_t=src_t,
224
+ dst_t=dst_t,
225
+ dst_addr=dst_addr,
226
+ raw_amount=100_000_000_000_000_000, # 0.1 ETH in wei
227
+ )
228
+
229
+ order_id = (
230
+ (swap.data or {}).get("id")
231
+ or (swap.data or {}).get("order_id")
232
+ or (swap.data or {}).get("orderId")
233
+ or ""
234
+ )
235
+
236
+ print("order_id:", order_id)
237
+ print("deposit_address:", swap.deposit_address)
238
+
239
+
240
+ asyncio.run(main())
241
+ ```
242
+
243
+ Submit + wait (WebSocket):
244
+
245
+ ```py
246
+ import asyncio
247
+
248
+ from tristero import ChainID, OrderType, TokenSpec, start_feather_swap, wait_for_completion
249
+
250
+
251
+ async def main() -> None:
252
+ src_t = TokenSpec(chain_id=ChainID.ethereum, token_address="native")
253
+ dst_t = TokenSpec(chain_id=ChainID.monero, token_address="native")
254
+ dst_addr = "YOUR_XMR_ADDRESS"
255
+
256
+ swap = await start_feather_swap(
257
+ src_t=src_t,
258
+ dst_t=dst_t,
259
+ dst_addr=dst_addr,
260
+ raw_amount=100_000_000_000_000_000,
261
+ )
262
+
263
+ order_id = (
264
+ (swap.data or {}).get("id")
265
+ or (swap.data or {}).get("order_id")
266
+ or (swap.data or {}).get("orderId")
267
+ or ""
268
+ )
269
+ if not order_id:
270
+ raise RuntimeError(f"Feather swap response missing order id: {swap.data}")
271
+
272
+ print("deposit_address:", swap.deposit_address)
273
+ print("Waiting for completion...")
274
+ completion = await wait_for_completion(order_id, order_type=OrderType.FEATHER)
275
+ print(completion)
276
+
277
+
278
+ asyncio.run(main())
279
+ ```
File without changes
File without changes
File without changes
File without changes
File without changes