defistream 1.1.0__py3-none-any.whl → 1.1.1__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.
- defistream/client.py +4 -0
- {defistream-1.1.0.dist-info → defistream-1.1.1.dist-info}/METADATA +30 -4
- {defistream-1.1.0.dist-info → defistream-1.1.1.dist-info}/RECORD +5 -5
- {defistream-1.1.0.dist-info → defistream-1.1.1.dist-info}/WHEEL +0 -0
- {defistream-1.1.0.dist-info → defistream-1.1.1.dist-info}/licenses/LICENSE +0 -0
defistream/client.py
CHANGED
|
@@ -289,6 +289,8 @@ class DeFiStream(BaseClient):
|
|
|
289
289
|
if response.status_code >= 400:
|
|
290
290
|
self._handle_error_response(response)
|
|
291
291
|
data = response.json()
|
|
292
|
+
if isinstance(data, list):
|
|
293
|
+
return data
|
|
292
294
|
return data.get("decoders", [])
|
|
293
295
|
|
|
294
296
|
|
|
@@ -377,4 +379,6 @@ class AsyncDeFiStream(BaseClient):
|
|
|
377
379
|
if response.status_code >= 400:
|
|
378
380
|
self._handle_error_response(response)
|
|
379
381
|
data = response.json()
|
|
382
|
+
if isinstance(data, list):
|
|
383
|
+
return data
|
|
380
384
|
return data.get("decoders", [])
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: defistream
|
|
3
|
-
Version: 1.1.
|
|
3
|
+
Version: 1.1.1
|
|
4
4
|
Summary: Python client for the DeFiStream API
|
|
5
5
|
Project-URL: Homepage, https://defistream.dev
|
|
6
6
|
Project-URL: Documentation, https://docs.defistream.dev
|
|
@@ -336,6 +336,21 @@ for transfer in transfers:
|
|
|
336
336
|
|
|
337
337
|
> **Note:** `as_dict()` and `as_file("*.json")` use JSON format which has a **10,000 block limit**. For larger block ranges, use `as_df()` or `as_file()` with `.parquet` or `.csv` extensions, which support up to 1,000,000 blocks.
|
|
338
338
|
|
|
339
|
+
### Context Manager
|
|
340
|
+
|
|
341
|
+
Both sync and async clients support context managers to automatically close connections:
|
|
342
|
+
|
|
343
|
+
```python
|
|
344
|
+
# Sync
|
|
345
|
+
with DeFiStream() as client:
|
|
346
|
+
df = (
|
|
347
|
+
client.erc20.transfers("USDT")
|
|
348
|
+
.network("ETH")
|
|
349
|
+
.block_range(21000000, 21010000)
|
|
350
|
+
.as_df()
|
|
351
|
+
)
|
|
352
|
+
```
|
|
353
|
+
|
|
339
354
|
### Async Usage
|
|
340
355
|
|
|
341
356
|
```python
|
|
@@ -355,6 +370,14 @@ async def main():
|
|
|
355
370
|
asyncio.run(main())
|
|
356
371
|
```
|
|
357
372
|
|
|
373
|
+
### List Available Decoders
|
|
374
|
+
|
|
375
|
+
```python
|
|
376
|
+
client = DeFiStream()
|
|
377
|
+
decoders = client.decoders()
|
|
378
|
+
print(decoders) # ['native_token', 'erc20', 'aave', 'uniswap', 'lido', 'stader', 'threshold']
|
|
379
|
+
```
|
|
380
|
+
|
|
358
381
|
## Configuration
|
|
359
382
|
|
|
360
383
|
### Environment Variables
|
|
@@ -455,8 +478,11 @@ print(f"Request cost: {client.last_response.request_cost}")
|
|
|
455
478
|
| Method | Protocols | Description |
|
|
456
479
|
|--------|-----------|-------------|
|
|
457
480
|
| `.token(symbol)` | ERC20 | Token symbol (USDT, USDC) or contract address (required) |
|
|
458
|
-
| `.sender(
|
|
459
|
-
| `.receiver(
|
|
481
|
+
| `.sender(*addrs)` | ERC20, Native | Filter by sender address (multi-value) |
|
|
482
|
+
| `.receiver(*addrs)` | ERC20, Native | Filter by receiver address (multi-value) |
|
|
483
|
+
| `.involving(*addrs)` | All | Filter by any involved address (multi-value) |
|
|
484
|
+
| `.from_address(*addrs)` | ERC20, Native | Alias for `.sender()` |
|
|
485
|
+
| `.to_address(*addrs)` | ERC20, Native | Alias for `.receiver()` |
|
|
460
486
|
| `.min_amount(amt)` | ERC20, Native | Minimum transfer amount |
|
|
461
487
|
| `.max_amount(amt)` | ERC20, Native | Maximum transfer amount |
|
|
462
488
|
| `.eth_market_type(type)` | AAVE | Market type for ETH: 'Core', 'Prime', 'EtherFi' |
|
|
@@ -477,7 +503,7 @@ Filter events by entity names or categories using the labels database. Available
|
|
|
477
503
|
| `.receiver_label(label)` | ERC20, Native | Filter receiver by label substring |
|
|
478
504
|
| `.receiver_category(cat)` | ERC20, Native | Filter receiver by category |
|
|
479
505
|
|
|
480
|
-
**Multi-value support:**
|
|
506
|
+
**Multi-value support:** Pass multiple values as separate arguments (e.g., `.sender_label("Binance", "Coinbase")`) or as a comma-separated string (e.g., `.sender_label("Binance,Coinbase")`). Both forms are equivalent.
|
|
481
507
|
|
|
482
508
|
**Mutual exclusivity:** Within each slot (involving/sender/receiver), only one of address/label/category can be set. `involving*` filters cannot be combined with `sender*`/`receiver*` filters.
|
|
483
509
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
defistream/__init__.py,sha256=h-ca8lWZyPYPDd-rFTvO9J2ptW_p-SvspvgmgAe_wIc,1089
|
|
2
|
-
defistream/client.py,sha256=
|
|
2
|
+
defistream/client.py,sha256=14Md_GOmzijBxhPPKuTRQbm7d7iXyL6OvWR7AQitY88,12835
|
|
3
3
|
defistream/exceptions.py,sha256=_GxZQ18_YvXFtmNHeddWV8fHPIllHgFeP7fP0CmHF1k,1492
|
|
4
4
|
defistream/models.py,sha256=Zw3DHAISxB6pivKybNzyHXR5IcRwvTZl23DHbjfyKwM,622
|
|
5
5
|
defistream/protocols.py,sha256=5_bYd46lDy-mK6LZ8sTGW0Z2IVH4g0cQ5rBbbOXsw0U,15368
|
|
6
6
|
defistream/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
7
7
|
defistream/query.py,sha256=yzrVfeRDZqoTYdQtj7SoYa7yd-NfO8heQ85YxhefU7c,22904
|
|
8
|
-
defistream-1.1.
|
|
9
|
-
defistream-1.1.
|
|
10
|
-
defistream-1.1.
|
|
11
|
-
defistream-1.1.
|
|
8
|
+
defistream-1.1.1.dist-info/METADATA,sha256=XznMYpoLXcIf6rn_NqOWpR8lUnFZGwfbLv17zRa1GkE,13657
|
|
9
|
+
defistream-1.1.1.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
10
|
+
defistream-1.1.1.dist-info/licenses/LICENSE,sha256=72DWAof8dMePfFQmfaswClW5d-sE6k7p-7VpuSKLmU4,1067
|
|
11
|
+
defistream-1.1.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|