liquidtrading-python 0.1.0__tar.gz → 0.1.1__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.
- {liquidtrading_python-0.1.0 → liquidtrading_python-0.1.1}/PKG-INFO +2 -2
- {liquidtrading_python-0.1.0 → liquidtrading_python-0.1.1}/PUBLISHING.md +3 -3
- {liquidtrading_python-0.1.0 → liquidtrading_python-0.1.1}/README.md +1 -1
- {liquidtrading_python-0.1.0 → liquidtrading_python-0.1.1}/docs/SDK.md +2 -29
- {liquidtrading_python-0.1.0 → liquidtrading_python-0.1.1}/liquidtrading/constants.py +1 -1
- {liquidtrading_python-0.1.0 → liquidtrading_python-0.1.1}/pyproject.toml +1 -1
- {liquidtrading_python-0.1.0 → liquidtrading_python-0.1.1}/scripts/create_test_keys.py +7 -6
- {liquidtrading_python-0.1.0 → liquidtrading_python-0.1.1}/tests/test_integration.py +10 -3
- {liquidtrading_python-0.1.0 → liquidtrading_python-0.1.1}/uv.lock +1 -1
- {liquidtrading_python-0.1.0 → liquidtrading_python-0.1.1}/.gitignore +0 -0
- {liquidtrading_python-0.1.0 → liquidtrading_python-0.1.1}/.python-version +0 -0
- {liquidtrading_python-0.1.0 → liquidtrading_python-0.1.1}/.uv-cache/.gitignore +0 -0
- {liquidtrading_python-0.1.0 → liquidtrading_python-0.1.1}/.uv-cache/.lock +0 -0
- {liquidtrading_python-0.1.0 → liquidtrading_python-0.1.1}/.uv-cache/CACHEDIR.TAG +0 -0
- {liquidtrading_python-0.1.0 → liquidtrading_python-0.1.1}/.uv-cache/sdists-v9/.git +0 -0
- {liquidtrading_python-0.1.0 → liquidtrading_python-0.1.1}/.uv-cache/sdists-v9/.gitignore +0 -0
- {liquidtrading_python-0.1.0 → liquidtrading_python-0.1.1}/examples/smoke_demo.py +0 -0
- {liquidtrading_python-0.1.0 → liquidtrading_python-0.1.1}/liquid/__init__.py +0 -0
- {liquidtrading_python-0.1.0 → liquidtrading_python-0.1.1}/liquidtrading/__init__.py +0 -0
- {liquidtrading_python-0.1.0 → liquidtrading_python-0.1.1}/liquidtrading/auth.py +0 -0
- {liquidtrading_python-0.1.0 → liquidtrading_python-0.1.1}/liquidtrading/client.py +0 -0
- {liquidtrading_python-0.1.0 → liquidtrading_python-0.1.1}/liquidtrading/demo.py +0 -0
- {liquidtrading_python-0.1.0 → liquidtrading_python-0.1.1}/liquidtrading/errors.py +0 -0
- {liquidtrading_python-0.1.0 → liquidtrading_python-0.1.1}/liquidtrading/http.py +0 -0
- {liquidtrading_python-0.1.0 → liquidtrading_python-0.1.1}/liquidtrading/models.py +0 -0
- {liquidtrading_python-0.1.0 → liquidtrading_python-0.1.1}/scripts/run_smoke_demo.sh +0 -0
- {liquidtrading_python-0.1.0 → liquidtrading_python-0.1.1}/tests/__init__.py +0 -0
- {liquidtrading_python-0.1.0 → liquidtrading_python-0.1.1}/tests/conftest.py +0 -0
- {liquidtrading_python-0.1.0 → liquidtrading_python-0.1.1}/tests/package_smoke_test.py +0 -0
- {liquidtrading_python-0.1.0 → liquidtrading_python-0.1.1}/tests/test_auth.py +0 -0
- {liquidtrading_python-0.1.0 → liquidtrading_python-0.1.1}/tests/test_client.py +0 -0
- {liquidtrading_python-0.1.0 → liquidtrading_python-0.1.1}/tests/test_compat_imports.py +0 -0
- {liquidtrading_python-0.1.0 → liquidtrading_python-0.1.1}/tests/test_demo.py +0 -0
- {liquidtrading_python-0.1.0 → liquidtrading_python-0.1.1}/tests/test_errors.py +0 -0
- {liquidtrading_python-0.1.0 → liquidtrading_python-0.1.1}/tests/test_http.py +0 -0
- {liquidtrading_python-0.1.0 → liquidtrading_python-0.1.1}/tests/test_models.py +0 -0
- {liquidtrading_python-0.1.0 → liquidtrading_python-0.1.1}/tests/test_package_exports.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: liquidtrading-python
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.1
|
|
4
4
|
Summary: Python SDK for the Liquid trading API
|
|
5
5
|
License-Expression: MIT
|
|
6
6
|
Requires-Python: >=3.9
|
|
@@ -86,7 +86,7 @@ See PUBLISHING.md
|
|
|
86
86
|
|
|
87
87
|
## Methods
|
|
88
88
|
|
|
89
|
-
### Market Data (
|
|
89
|
+
### Market Data (read scope)
|
|
90
90
|
|
|
91
91
|
```python
|
|
92
92
|
client.get_markets() # list[dict]
|
|
@@ -31,7 +31,7 @@ Pending publishers let the first successful upload create the project. They do n
|
|
|
31
31
|
Edit [pyproject.toml](/Users/raymondcosgrove/Liquid/Public%20Apis/liquidtrading-python/pyproject.toml) and bump:
|
|
32
32
|
|
|
33
33
|
```toml
|
|
34
|
-
version = "0.1.
|
|
34
|
+
version = "0.1.1"
|
|
35
35
|
```
|
|
36
36
|
|
|
37
37
|
### 2. Run the SDK tests
|
|
@@ -73,8 +73,8 @@ python -c "from liquidtrading import LiquidClient; print(LiquidClient)"
|
|
|
73
73
|
Create and push a tag that starts with `liquidtrading-python-v`:
|
|
74
74
|
|
|
75
75
|
```bash
|
|
76
|
-
git tag -a liquidtrading-python-v0.1.
|
|
77
|
-
git push origin liquidtrading-python-v0.1.
|
|
76
|
+
git tag -a liquidtrading-python-v0.1.1 -m "liquidtrading-python v0.1.1"
|
|
77
|
+
git push origin liquidtrading-python-v0.1.1
|
|
78
78
|
```
|
|
79
79
|
|
|
80
80
|
That tag triggers the same workflow, but publishes to PyPI instead of TestPyPI.
|
|
@@ -197,12 +197,7 @@ Some older SDK comments and examples describe market-data methods as public. The
|
|
|
197
197
|
|
|
198
198
|
### Transfer Routes
|
|
199
199
|
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
- `withdraw`
|
|
203
|
-
- `get_transfer_history`
|
|
204
|
-
|
|
205
|
-
Those routes exist in the server code, but the current public API app does not mount the transfers router yet. Against the current deployed public API, transfer methods may fail until that router is enabled.
|
|
200
|
+
Older SDK docs referenced transfer methods, but the current public API does not expose transfer routes. If you are targeting the current deployed Liquid public API, do not rely on `withdraw` or transfer-history methods being available.
|
|
206
201
|
|
|
207
202
|
## Method Reference
|
|
208
203
|
|
|
@@ -410,29 +405,7 @@ Returned fields:
|
|
|
410
405
|
|
|
411
406
|
## Transfers
|
|
412
407
|
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
Rules:
|
|
416
|
-
|
|
417
|
-
- `amount` must be positive
|
|
418
|
-
- `destination` must be a valid Ethereum address
|
|
419
|
-
|
|
420
|
-
### `get_transfer_history(limit: int = 50, offset: int = 0) -> TransferPage`
|
|
421
|
-
|
|
422
|
-
Returned fields:
|
|
423
|
-
|
|
424
|
-
- `transfers`
|
|
425
|
-
- `total`
|
|
426
|
-
- `offset`
|
|
427
|
-
- `limit`
|
|
428
|
-
|
|
429
|
-
Each transfer contains:
|
|
430
|
-
|
|
431
|
-
- `id`
|
|
432
|
-
- `type`
|
|
433
|
-
- `amount`
|
|
434
|
-
- `method`
|
|
435
|
-
- `destination`
|
|
408
|
+
Transfer routes are not currently exposed by the deployed Liquid public API. Older drafts of this SDK documentation mentioned `withdraw` and transfer-history methods, but those should be treated as unavailable unless the server explicitly reintroduces transfer endpoints.
|
|
436
409
|
- `transaction_hash`
|
|
437
410
|
- `created_at`
|
|
438
411
|
|
|
@@ -15,9 +15,9 @@ import os
|
|
|
15
15
|
import sys
|
|
16
16
|
from pathlib import Path
|
|
17
17
|
|
|
18
|
-
# Add
|
|
19
|
-
|
|
20
|
-
sys.path.insert(0, str(
|
|
18
|
+
# Add combined repo root to path so we can import server modules
|
|
19
|
+
COMBINED_DIR = Path(__file__).resolve().parent.parent.parent / "combined"
|
|
20
|
+
sys.path.insert(0, str(COMBINED_DIR))
|
|
21
21
|
|
|
22
22
|
SDK_DIR = Path(__file__).resolve().parent.parent
|
|
23
23
|
ENV_FILE = SDK_DIR / ".env"
|
|
@@ -26,13 +26,14 @@ ENV_FILE = SDK_DIR / ".env"
|
|
|
26
26
|
async def main() -> None:
|
|
27
27
|
from dotenv import load_dotenv
|
|
28
28
|
|
|
29
|
-
load_dotenv(
|
|
29
|
+
load_dotenv(COMBINED_DIR / ".env")
|
|
30
30
|
|
|
31
31
|
from prisma import Prisma
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
is_dev = os.environ.get("MODAL_ENVIRONMENT") == "dev"
|
|
34
|
+
db_url = os.environ.get("DEV_DATABASE_URL") if is_dev else os.environ.get("DATABASE_URL")
|
|
34
35
|
if not db_url:
|
|
35
|
-
print("ERROR:
|
|
36
|
+
print("ERROR: selected database URL is not set in combined/.env/environment")
|
|
36
37
|
sys.exit(1)
|
|
37
38
|
|
|
38
39
|
prisma = Prisma(datasource={"url": db_url})
|
|
@@ -14,6 +14,7 @@ LIQUID_TEST_TRADE_SECRET for those tests.
|
|
|
14
14
|
from __future__ import annotations
|
|
15
15
|
|
|
16
16
|
import os
|
|
17
|
+
import time
|
|
17
18
|
|
|
18
19
|
import pytest
|
|
19
20
|
|
|
@@ -110,10 +111,16 @@ class TestTradingEndpoints:
|
|
|
110
111
|
order = trade_client.place_order(
|
|
111
112
|
"BTC-PERP", "buy", type="market", size=10.0, leverage=5,
|
|
112
113
|
)
|
|
113
|
-
assert order.status
|
|
114
|
+
assert order.status in ("filled", "accepted")
|
|
115
|
+
|
|
116
|
+
btc_positions = []
|
|
117
|
+
for _ in range(5):
|
|
118
|
+
positions = trade_client.get_positions()
|
|
119
|
+
btc_positions = [p for p in positions if p.symbol == "BTC-PERP"]
|
|
120
|
+
if btc_positions:
|
|
121
|
+
break
|
|
122
|
+
time.sleep(0.5)
|
|
114
123
|
|
|
115
|
-
positions = trade_client.get_positions()
|
|
116
|
-
btc_positions = [p for p in positions if p.symbol == "BTC-PERP"]
|
|
117
124
|
assert len(btc_positions) > 0
|
|
118
125
|
assert btc_positions[0].side == "long"
|
|
119
126
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|