oxarchive 0.5.2__tar.gz → 0.5.3__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.
- {oxarchive-0.5.2 → oxarchive-0.5.3}/PKG-INFO +7 -9
- {oxarchive-0.5.2 → oxarchive-0.5.3}/README.md +6 -8
- {oxarchive-0.5.2 → oxarchive-0.5.3}/oxarchive/__init__.py +1 -1
- {oxarchive-0.5.2 → oxarchive-0.5.3}/oxarchive/resources/trades.py +9 -5
- {oxarchive-0.5.2 → oxarchive-0.5.3}/pyproject.toml +1 -1
- {oxarchive-0.5.2 → oxarchive-0.5.3}/.gitignore +0 -0
- {oxarchive-0.5.2 → oxarchive-0.5.3}/oxarchive/client.py +0 -0
- {oxarchive-0.5.2 → oxarchive-0.5.3}/oxarchive/exchanges.py +0 -0
- {oxarchive-0.5.2 → oxarchive-0.5.3}/oxarchive/http.py +0 -0
- {oxarchive-0.5.2 → oxarchive-0.5.3}/oxarchive/resources/__init__.py +0 -0
- {oxarchive-0.5.2 → oxarchive-0.5.3}/oxarchive/resources/candles.py +0 -0
- {oxarchive-0.5.2 → oxarchive-0.5.3}/oxarchive/resources/funding.py +0 -0
- {oxarchive-0.5.2 → oxarchive-0.5.3}/oxarchive/resources/instruments.py +0 -0
- {oxarchive-0.5.2 → oxarchive-0.5.3}/oxarchive/resources/liquidations.py +0 -0
- {oxarchive-0.5.2 → oxarchive-0.5.3}/oxarchive/resources/openinterest.py +0 -0
- {oxarchive-0.5.2 → oxarchive-0.5.3}/oxarchive/resources/orderbook.py +0 -0
- {oxarchive-0.5.2 → oxarchive-0.5.3}/oxarchive/types.py +0 -0
- {oxarchive-0.5.2 → oxarchive-0.5.3}/oxarchive/websocket.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: oxarchive
|
|
3
|
-
Version: 0.5.
|
|
3
|
+
Version: 0.5.3
|
|
4
4
|
Summary: Official Python SDK for 0xarchive - Hyperliquid Historical Data API
|
|
5
5
|
Project-URL: Homepage, https://0xarchive.io
|
|
6
6
|
Project-URL: Documentation, https://0xarchive.io/docs/sdks
|
|
@@ -211,9 +211,6 @@ history = client.lighter.orderbook.history(
|
|
|
211
211
|
The trades API uses cursor-based pagination for efficient retrieval of large datasets.
|
|
212
212
|
|
|
213
213
|
```python
|
|
214
|
-
# Get recent trades
|
|
215
|
-
recent = client.hyperliquid.trades.recent("BTC", limit=100)
|
|
216
|
-
|
|
217
214
|
# Get trade history with cursor-based pagination
|
|
218
215
|
result = client.hyperliquid.trades.list("ETH", start="2024-01-01", end="2024-01-02", limit=1000)
|
|
219
216
|
trades = result.data
|
|
@@ -232,8 +229,7 @@ while result.next_cursor:
|
|
|
232
229
|
# Filter by side
|
|
233
230
|
buys = client.hyperliquid.trades.list("BTC", start=..., end=..., side="buy")
|
|
234
231
|
|
|
235
|
-
# Async
|
|
236
|
-
recent = await client.hyperliquid.trades.arecent("BTC")
|
|
232
|
+
# Async version
|
|
237
233
|
result = await client.hyperliquid.trades.alist("ETH", start=..., end=...)
|
|
238
234
|
```
|
|
239
235
|
|
|
@@ -641,9 +637,11 @@ from oxarchive.resources.trades import CursorResponse
|
|
|
641
637
|
|
|
642
638
|
client = Client(api_key="ox_your_api_key")
|
|
643
639
|
|
|
644
|
-
orderbook: OrderBook = client.orderbook.get("BTC")
|
|
645
|
-
|
|
646
|
-
|
|
640
|
+
orderbook: OrderBook = client.hyperliquid.orderbook.get("BTC")
|
|
641
|
+
result: CursorResponse = client.hyperliquid.trades.list("BTC", start=..., end=...)
|
|
642
|
+
|
|
643
|
+
# Lighter has real-time data, so recent() is available
|
|
644
|
+
recent: list[Trade] = client.lighter.trades.recent("BTC")
|
|
647
645
|
|
|
648
646
|
# Lighter granularity type hint
|
|
649
647
|
granularity: LighterGranularity = "10s"
|
|
@@ -174,9 +174,6 @@ history = client.lighter.orderbook.history(
|
|
|
174
174
|
The trades API uses cursor-based pagination for efficient retrieval of large datasets.
|
|
175
175
|
|
|
176
176
|
```python
|
|
177
|
-
# Get recent trades
|
|
178
|
-
recent = client.hyperliquid.trades.recent("BTC", limit=100)
|
|
179
|
-
|
|
180
177
|
# Get trade history with cursor-based pagination
|
|
181
178
|
result = client.hyperliquid.trades.list("ETH", start="2024-01-01", end="2024-01-02", limit=1000)
|
|
182
179
|
trades = result.data
|
|
@@ -195,8 +192,7 @@ while result.next_cursor:
|
|
|
195
192
|
# Filter by side
|
|
196
193
|
buys = client.hyperliquid.trades.list("BTC", start=..., end=..., side="buy")
|
|
197
194
|
|
|
198
|
-
# Async
|
|
199
|
-
recent = await client.hyperliquid.trades.arecent("BTC")
|
|
195
|
+
# Async version
|
|
200
196
|
result = await client.hyperliquid.trades.alist("ETH", start=..., end=...)
|
|
201
197
|
```
|
|
202
198
|
|
|
@@ -604,9 +600,11 @@ from oxarchive.resources.trades import CursorResponse
|
|
|
604
600
|
|
|
605
601
|
client = Client(api_key="ox_your_api_key")
|
|
606
602
|
|
|
607
|
-
orderbook: OrderBook = client.orderbook.get("BTC")
|
|
608
|
-
|
|
609
|
-
|
|
603
|
+
orderbook: OrderBook = client.hyperliquid.orderbook.get("BTC")
|
|
604
|
+
result: CursorResponse = client.hyperliquid.trades.list("BTC", start=..., end=...)
|
|
605
|
+
|
|
606
|
+
# Lighter has real-time data, so recent() is available
|
|
607
|
+
recent: list[Trade] = client.lighter.trades.recent("BTC")
|
|
610
608
|
|
|
611
609
|
# Lighter granularity type hint
|
|
612
610
|
granularity: LighterGranularity = "10s"
|
|
@@ -14,17 +14,17 @@ class TradesResource:
|
|
|
14
14
|
Trades API resource.
|
|
15
15
|
|
|
16
16
|
Example:
|
|
17
|
-
>>> # Get recent trades
|
|
18
|
-
>>> trades = client.trades.recent("BTC")
|
|
19
|
-
>>>
|
|
20
17
|
>>> # Get trade history with cursor-based pagination (recommended)
|
|
21
|
-
>>> result = client.trades.list("BTC", start="2024-01-01", end="2024-01-02")
|
|
18
|
+
>>> result = client.hyperliquid.trades.list("BTC", start="2024-01-01", end="2024-01-02")
|
|
22
19
|
>>> trades = result.data
|
|
23
20
|
>>>
|
|
24
21
|
>>> # Get all pages
|
|
25
22
|
>>> while result.next_cursor:
|
|
26
|
-
... result = client.trades.list("BTC", start="2024-01-01", end="2024-01-02", cursor=result.next_cursor)
|
|
23
|
+
... result = client.hyperliquid.trades.list("BTC", start="2024-01-01", end="2024-01-02", cursor=result.next_cursor)
|
|
27
24
|
... trades.extend(result.data)
|
|
25
|
+
>>>
|
|
26
|
+
>>> # Get recent trades (Lighter only - has real-time data)
|
|
27
|
+
>>> recent = client.lighter.trades.recent("BTC")
|
|
28
28
|
"""
|
|
29
29
|
|
|
30
30
|
def __init__(self, http: HttpClient, base_path: str = "/v1"):
|
|
@@ -135,6 +135,10 @@ class TradesResource:
|
|
|
135
135
|
"""
|
|
136
136
|
Get most recent trades for a coin.
|
|
137
137
|
|
|
138
|
+
Note: This method is only available for Lighter (client.lighter.trades.recent())
|
|
139
|
+
which has real-time data ingestion. Hyperliquid uses hourly backfill so this
|
|
140
|
+
endpoint is not available for Hyperliquid.
|
|
141
|
+
|
|
138
142
|
Args:
|
|
139
143
|
coin: The coin symbol (e.g., 'BTC', 'ETH')
|
|
140
144
|
limit: Number of trades to return (default: 100)
|
|
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
|