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.
Files changed (37) hide show
  1. {liquidtrading_python-0.1.0 → liquidtrading_python-0.1.1}/PKG-INFO +2 -2
  2. {liquidtrading_python-0.1.0 → liquidtrading_python-0.1.1}/PUBLISHING.md +3 -3
  3. {liquidtrading_python-0.1.0 → liquidtrading_python-0.1.1}/README.md +1 -1
  4. {liquidtrading_python-0.1.0 → liquidtrading_python-0.1.1}/docs/SDK.md +2 -29
  5. {liquidtrading_python-0.1.0 → liquidtrading_python-0.1.1}/liquidtrading/constants.py +1 -1
  6. {liquidtrading_python-0.1.0 → liquidtrading_python-0.1.1}/pyproject.toml +1 -1
  7. {liquidtrading_python-0.1.0 → liquidtrading_python-0.1.1}/scripts/create_test_keys.py +7 -6
  8. {liquidtrading_python-0.1.0 → liquidtrading_python-0.1.1}/tests/test_integration.py +10 -3
  9. {liquidtrading_python-0.1.0 → liquidtrading_python-0.1.1}/uv.lock +1 -1
  10. {liquidtrading_python-0.1.0 → liquidtrading_python-0.1.1}/.gitignore +0 -0
  11. {liquidtrading_python-0.1.0 → liquidtrading_python-0.1.1}/.python-version +0 -0
  12. {liquidtrading_python-0.1.0 → liquidtrading_python-0.1.1}/.uv-cache/.gitignore +0 -0
  13. {liquidtrading_python-0.1.0 → liquidtrading_python-0.1.1}/.uv-cache/.lock +0 -0
  14. {liquidtrading_python-0.1.0 → liquidtrading_python-0.1.1}/.uv-cache/CACHEDIR.TAG +0 -0
  15. {liquidtrading_python-0.1.0 → liquidtrading_python-0.1.1}/.uv-cache/sdists-v9/.git +0 -0
  16. {liquidtrading_python-0.1.0 → liquidtrading_python-0.1.1}/.uv-cache/sdists-v9/.gitignore +0 -0
  17. {liquidtrading_python-0.1.0 → liquidtrading_python-0.1.1}/examples/smoke_demo.py +0 -0
  18. {liquidtrading_python-0.1.0 → liquidtrading_python-0.1.1}/liquid/__init__.py +0 -0
  19. {liquidtrading_python-0.1.0 → liquidtrading_python-0.1.1}/liquidtrading/__init__.py +0 -0
  20. {liquidtrading_python-0.1.0 → liquidtrading_python-0.1.1}/liquidtrading/auth.py +0 -0
  21. {liquidtrading_python-0.1.0 → liquidtrading_python-0.1.1}/liquidtrading/client.py +0 -0
  22. {liquidtrading_python-0.1.0 → liquidtrading_python-0.1.1}/liquidtrading/demo.py +0 -0
  23. {liquidtrading_python-0.1.0 → liquidtrading_python-0.1.1}/liquidtrading/errors.py +0 -0
  24. {liquidtrading_python-0.1.0 → liquidtrading_python-0.1.1}/liquidtrading/http.py +0 -0
  25. {liquidtrading_python-0.1.0 → liquidtrading_python-0.1.1}/liquidtrading/models.py +0 -0
  26. {liquidtrading_python-0.1.0 → liquidtrading_python-0.1.1}/scripts/run_smoke_demo.sh +0 -0
  27. {liquidtrading_python-0.1.0 → liquidtrading_python-0.1.1}/tests/__init__.py +0 -0
  28. {liquidtrading_python-0.1.0 → liquidtrading_python-0.1.1}/tests/conftest.py +0 -0
  29. {liquidtrading_python-0.1.0 → liquidtrading_python-0.1.1}/tests/package_smoke_test.py +0 -0
  30. {liquidtrading_python-0.1.0 → liquidtrading_python-0.1.1}/tests/test_auth.py +0 -0
  31. {liquidtrading_python-0.1.0 → liquidtrading_python-0.1.1}/tests/test_client.py +0 -0
  32. {liquidtrading_python-0.1.0 → liquidtrading_python-0.1.1}/tests/test_compat_imports.py +0 -0
  33. {liquidtrading_python-0.1.0 → liquidtrading_python-0.1.1}/tests/test_demo.py +0 -0
  34. {liquidtrading_python-0.1.0 → liquidtrading_python-0.1.1}/tests/test_errors.py +0 -0
  35. {liquidtrading_python-0.1.0 → liquidtrading_python-0.1.1}/tests/test_http.py +0 -0
  36. {liquidtrading_python-0.1.0 → liquidtrading_python-0.1.1}/tests/test_models.py +0 -0
  37. {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.0
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 (public)
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.0"
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.0 -m "liquidtrading-python v0.1.0"
77
- git push origin liquidtrading-python-v0.1.0
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.
@@ -73,7 +73,7 @@ See PUBLISHING.md
73
73
 
74
74
  ## Methods
75
75
 
76
- ### Market Data (public)
76
+ ### Market Data (read scope)
77
77
 
78
78
  ```python
79
79
  client.get_markets() # list[dict]
@@ -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
- The SDK includes transfer methods today:
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
- ### `withdraw(amount: float, destination: str) -> dict[str, Any]`
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
 
@@ -4,7 +4,7 @@ DEFAULT_BASE_URL = "https://api.liquid.trade"
4
4
  DEFAULT_TIMEOUT = 30.0
5
5
  DEFAULT_MAX_RETRIES = 0
6
6
  DEFAULT_RETRY_BACKOFF = 0.5
7
- SDK_VERSION = "0.1.0"
7
+ SDK_VERSION = "0.1.1"
8
8
  SDK_PACKAGE_NAME = "liquidtrading-python"
9
9
 
10
10
  HEADER_API_KEY = "X-Liquid-Key"
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "liquidtrading-python"
7
- version = "0.1.0"
7
+ version = "0.1.1"
8
8
  description = "Python SDK for the Liquid trading API"
9
9
  readme = "README.md"
10
10
  license = "MIT"
@@ -15,9 +15,9 @@ import os
15
15
  import sys
16
16
  from pathlib import Path
17
17
 
18
- # Add server to path so we can import its modules
19
- SERVER_DIR = Path(__file__).resolve().parent.parent.parent / "combined" / "liquidserver"
20
- sys.path.insert(0, str(SERVER_DIR))
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(SERVER_DIR / ".env")
29
+ load_dotenv(COMBINED_DIR / ".env")
30
30
 
31
31
  from prisma import Prisma
32
32
 
33
- db_url = 'postgresql://neondb_owner:npg_RU4mwxz8PlTN@ep-little-sun-a15wmjvy-pooler.ap-southeast-1.aws.neon.tech/neondb?sslmode=require&channel_binding=require'
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: DEV_DATABASE_URL not set in combined/.env")
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 == "filled"
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
 
@@ -122,7 +122,7 @@ wheels = [
122
122
 
123
123
  [[package]]
124
124
  name = "liquidtrading-python"
125
- version = "0.1.0"
125
+ version = "0.1.1"
126
126
  source = { editable = "." }
127
127
  dependencies = [
128
128
  { name = "httpx" },