helius-python 0.0.2__py3-none-any.whl → 0.0.3__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.
helius/client.py CHANGED
@@ -1,3 +1,4 @@
1
+ import os
1
2
  from typing import Annotated, Any, Literal
2
3
 
3
4
  import httpx
@@ -38,7 +39,11 @@ class HeliusClient:
38
39
  api_key: str | None = None,
39
40
  ) -> None:
40
41
  self.base_url = base_url
41
- self.api_key = api_key or dotenv_values().get("HELIUS_API_KEY")
42
+ self.api_key = (
43
+ api_key
44
+ or os.environ.get("HELIUS_API_KEY")
45
+ or dotenv_values().get("HELIUS_API_KEY")
46
+ )
42
47
  if not self.api_key:
43
48
  raise ValueError("No API key provided.")
44
49
  self._client = httpx.Client(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: helius-python
3
- Version: 0.0.2
3
+ Version: 0.0.3
4
4
  Summary: Typed Python client for the Helius API
5
5
  Project-URL: Homepage, https://github.com/markosnarinian/helius-python
6
6
  Project-URL: Issues, https://github.com/markosnarinian/helius-python/issues
@@ -83,8 +83,14 @@ from helius.client import HeliusClient
83
83
  client = HeliusClient(api_key="YOUR_HELIUS_API_KEY")
84
84
  ```
85
85
 
86
- or set it in a `.env` file at the project root and let the client pick it up
87
- automatically:
86
+ or set `HELIUS_API_KEY` as an environment variable:
87
+
88
+ ```bash
89
+ export HELIUS_API_KEY=your_helius_api_key
90
+ ```
91
+
92
+ You can also set it in a `.env` file at the project root and let the client
93
+ pick it up automatically:
88
94
 
89
95
  ```env
90
96
  HELIUS_API_KEY=your_helius_api_key
@@ -93,7 +99,7 @@ HELIUS_API_KEY=your_helius_api_key
93
99
  ```python
94
100
  from helius.client import HeliusClient
95
101
 
96
- client = HeliusClient() # reads HELIUS_API_KEY from .env
102
+ client = HeliusClient() # reads HELIUS_API_KEY from the environment or .env
97
103
  ```
98
104
 
99
105
  ## Usage
@@ -145,7 +151,7 @@ instance is garbage-collected. Prefer `with` or `close()` regardless.
145
151
  | Argument | Default | Notes |
146
152
  | --------- | ------------------------------------ | --------------------------------------------------------------------------------------------- |
147
153
  | `base_url`| `"https://mainnet.helius-rpc.com"` | Override to point at devnet, staging, or a custom Helius endpoint. |
148
- | `api_key` | `None` → falls back to `HELIUS_API_KEY` in a `.env` file | If neither is provided, the constructor raises `ValueError`. |
154
+ | `api_key` | `None` → falls back to `HELIUS_API_KEY` from the environment, then `.env` | If none is provided, the constructor raises `ValueError`. |
149
155
 
150
156
  Per-method RPC parameters (`commitment`, `encoding`, `min_context_slot`, etc.)
151
157
  are left unset by default — the Helius/Solana server defaults apply unless you
@@ -0,0 +1,7 @@
1
+ helius/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
+ helius/client.py,sha256=QDKUpPVCEwex3sqolQ9IhjzQG7T4fRuqXIrFrmQ2_Fk,33323
3
+ helius/models.py,sha256=X6aLhpAIvVccgCIJE_h2TO0RRdBI26EmaGNylT11Y3A,5082
4
+ helius_python-0.0.3.dist-info/METADATA,sha256=aoFsMDwzUYp8CO3B8sk1X5tagyAcOKzSoVTX5L_WHw0,11248
5
+ helius_python-0.0.3.dist-info/WHEEL,sha256=QccIxa26bgl1E6uMy58deGWi-0aeIkkangHcxk2kWfw,87
6
+ helius_python-0.0.3.dist-info/licenses/LICENSE,sha256=bZc2EDmq_GsWH77uK8LBn1kqqrOPcp2f9p-ys9bYa1E,1072
7
+ helius_python-0.0.3.dist-info/RECORD,,
@@ -1,7 +0,0 @@
1
- helius/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- helius/client.py,sha256=SIczNqX2U_3ULM9-yO3ba3MOWMog4rtS6qkvXoDH_mQ,33229
3
- helius/models.py,sha256=X6aLhpAIvVccgCIJE_h2TO0RRdBI26EmaGNylT11Y3A,5082
4
- helius_python-0.0.2.dist-info/METADATA,sha256=SIJl_uxSTfuf2-X5vw9ftK2vJwhFWzVfXKW2m6tsdYo,11097
5
- helius_python-0.0.2.dist-info/WHEEL,sha256=QccIxa26bgl1E6uMy58deGWi-0aeIkkangHcxk2kWfw,87
6
- helius_python-0.0.2.dist-info/licenses/LICENSE,sha256=bZc2EDmq_GsWH77uK8LBn1kqqrOPcp2f9p-ys9bYa1E,1072
7
- helius_python-0.0.2.dist-info/RECORD,,