helius-python 0.4.1__tar.gz → 0.5.0__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 (50) hide show
  1. {helius_python-0.4.1 → helius_python-0.5.0}/.github/ISSUE_TEMPLATE/bug_report.yml +1 -1
  2. {helius_python-0.4.1 → helius_python-0.5.0}/AGENTS.md +1 -1
  3. {helius_python-0.4.1 → helius_python-0.5.0}/CONTRIBUTING.md +1 -1
  4. {helius_python-0.4.1 → helius_python-0.5.0}/PKG-INFO +34 -31
  5. {helius_python-0.4.1 → helius_python-0.5.0}/README.md +33 -30
  6. {helius_python-0.4.1 → helius_python-0.5.0}/examples/solana_rpc/address_transactions.py +3 -3
  7. {helius_python-0.4.1 → helius_python-0.5.0}/examples/solana_rpc/address_transfers.py +3 -3
  8. {helius_python-0.4.1 → helius_python-0.5.0}/examples/solana_rpc/block_explorer.py +4 -6
  9. {helius_python-0.4.1 → helius_python-0.5.0}/examples/solana_rpc/devnet_airdrop.py +5 -3
  10. {helius_python-0.4.1 → helius_python-0.5.0}/examples/solana_rpc/network_status.py +2 -2
  11. {helius_python-0.4.1 → helius_python-0.5.0}/examples/solana_rpc/priority_fees.py +3 -3
  12. {helius_python-0.4.1 → helius_python-0.5.0}/examples/solana_rpc/stake_overview.py +2 -2
  13. {helius_python-0.4.1 → helius_python-0.5.0}/examples/solana_rpc/token_inspector.py +3 -3
  14. {helius_python-0.4.1 → helius_python-0.5.0}/examples/solana_rpc/transaction_inspector.py +2 -2
  15. {helius_python-0.4.1 → helius_python-0.5.0}/examples/solana_rpc/wallet_tracker.py +3 -3
  16. {helius_python-0.4.1 → helius_python-0.5.0}/pyproject.toml +1 -1
  17. {helius_python-0.4.1/src/helius/solana_rpc → helius_python-0.5.0/src/helius/rpc}/__init__.py +2 -2
  18. {helius_python-0.4.1/src/helius/solana_rpc → helius_python-0.5.0/src/helius/rpc}/client.py +1 -1
  19. {helius_python-0.4.1 → helius_python-0.5.0}/test_examples.py +26 -25
  20. {helius_python-0.4.1 → helius_python-0.5.0}/tests/unit/solana_rpc/test_client.py +3 -3
  21. {helius_python-0.4.1 → helius_python-0.5.0}/tests/unit/solana_rpc/test_models.py +1 -1
  22. {helius_python-0.4.1 → helius_python-0.5.0}/.editorconfig +0 -0
  23. {helius_python-0.4.1 → helius_python-0.5.0}/.github/ISSUE_TEMPLATE/config.yml +0 -0
  24. {helius_python-0.4.1 → helius_python-0.5.0}/.github/ISSUE_TEMPLATE/feature_request.yml +0 -0
  25. {helius_python-0.4.1 → helius_python-0.5.0}/.github/workflows/python-package.yml +0 -0
  26. {helius_python-0.4.1 → helius_python-0.5.0}/.github/workflows/python-publish.yml +0 -0
  27. {helius_python-0.4.1 → helius_python-0.5.0}/.gitignore +0 -0
  28. {helius_python-0.4.1 → helius_python-0.5.0}/CLAUDE.md +0 -0
  29. {helius_python-0.4.1 → helius_python-0.5.0}/LICENSE +0 -0
  30. {helius_python-0.4.1 → helius_python-0.5.0}/TODO.md +0 -0
  31. {helius_python-0.4.1 → helius_python-0.5.0}/examples/laserstream/websocket_logs.py +0 -0
  32. {helius_python-0.4.1 → helius_python-0.5.0}/examples/webhooks/webhook_crud.py +0 -0
  33. {helius_python-0.4.1 → helius_python-0.5.0}/examples/webhooks/webhook_receiver.py +0 -0
  34. {helius_python-0.4.1 → helius_python-0.5.0}/requirements.txt +0 -0
  35. {helius_python-0.4.1 → helius_python-0.5.0}/src/helius/__init__.py +0 -0
  36. {helius_python-0.4.1 → helius_python-0.5.0}/src/helius/admin/__init__.py +0 -0
  37. {helius_python-0.4.1 → helius_python-0.5.0}/src/helius/admin/admin.py +0 -0
  38. {helius_python-0.4.1 → helius_python-0.5.0}/src/helius/laserstream/websockets.py +0 -0
  39. {helius_python-0.4.1/src/helius/solana_rpc → helius_python-0.5.0/src/helius/rpc}/models.py +0 -0
  40. {helius_python-0.4.1 → helius_python-0.5.0}/src/helius/utils/__init__.py +0 -0
  41. {helius_python-0.4.1 → helius_python-0.5.0}/src/helius/utils/json_rpc_request.py +0 -0
  42. {helius_python-0.4.1 → helius_python-0.5.0}/src/helius/webhooks/__init__.py +0 -0
  43. {helius_python-0.4.1 → helius_python-0.5.0}/src/helius/webhooks/webhooks.py +0 -0
  44. {helius_python-0.4.1 → helius_python-0.5.0}/tests/fixtures/account.json +0 -0
  45. {helius_python-0.4.1 → helius_python-0.5.0}/tests/fixtures/supply.json +0 -0
  46. {helius_python-0.4.1 → helius_python-0.5.0}/tests/unit/admin/test_admin.py +0 -0
  47. {helius_python-0.4.1 → helius_python-0.5.0}/tests/unit/lasterstream/test_websockets.py +0 -0
  48. {helius_python-0.4.1 → helius_python-0.5.0}/tests/unit/utils/test_json_rpc_request.py +0 -0
  49. {helius_python-0.4.1 → helius_python-0.5.0}/tests/unit/webhooks/test_webhook.py +0 -0
  50. {helius_python-0.4.1 → helius_python-0.5.0}/tests/unit/webhooks/test_webhooks_api_client.py +0 -0
@@ -24,7 +24,7 @@ body:
24
24
  your API key.
25
25
  render: python
26
26
  placeholder: |
27
- from helius.solana_rpc import HeliusClient
27
+ from helius.rpc import HeliusClient
28
28
 
29
29
  with HeliusClient(api_key="...") as c:
30
30
  c.get_balance(public_key="...")
@@ -76,7 +76,7 @@ Skeleton:
76
76
  import json
77
77
  import httpx
78
78
  import respx
79
- from helius.solana_rpc import SolanaRpcClient
79
+ from helius.rpc import SolanaRpcClient
80
80
 
81
81
  @respx.mock
82
82
  def test_get_balance():
@@ -67,7 +67,7 @@ prior discussion; just send them.
67
67
  ## Codebase Conventions
68
68
 
69
69
  Please match the existing style of the codebase. Skim
70
- [`src/helius/solana_rpc.py`](src/helius/solana_rpc.py) and
70
+ [`src/helius/rpc.py`](src/helius/rpc.py) and
71
71
  [`src/helius/models.py`](src/helius/models.py) before writing new code. In
72
72
  particular:
73
73
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: helius-python
3
- Version: 0.4.1
3
+ Version: 0.5.0
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
@@ -123,7 +123,7 @@ Description-Content-Type: text/markdown
123
123
 
124
124
  ## Coverage
125
125
 
126
- The goal of this library is **support every function, method, endpoint,
126
+ The goal of this library is to **support every function, method, endpoint,
127
127
  and feature that Helius exposes.** If Helius ships it, this client
128
128
  wraps it.
129
129
 
@@ -161,6 +161,7 @@ being worked on.
161
161
  documented Helius API.
162
162
 
163
163
  ## Installation via PyPI
164
+
164
165
  ```bash
165
166
  pip install helius-python
166
167
  ```
@@ -170,7 +171,7 @@ pip install helius-python
170
171
  Pass your Helius API key explicitly:
171
172
 
172
173
  ```python
173
- from helius.solana_rpc import SolanaRpcClient
174
+ from helius.rpc import SolanaRpcClient
174
175
 
175
176
  client = SolanaRpcClient(api_key="YOUR_HELIUS_API_KEY")
176
177
  ```
@@ -189,7 +190,7 @@ HELIUS_API_KEY=your_helius_api_key
189
190
  ```
190
191
 
191
192
  ```python
192
- from helius.solana_rpc import SolanaRpcClient
193
+ from helius.rpc import SolanaRpcClient
193
194
 
194
195
  client = SolanaRpcClient() # reads HELIUS_API_KEY from the environment or .env
195
196
  ```
@@ -199,7 +200,7 @@ client = SolanaRpcClient() # reads HELIUS_API_KEY from the environment or .env
199
200
  ### As a context manager (recommended)
200
201
 
201
202
  ```python
202
- from helius.solana_rpc import SolanaRpcClient
203
+ from helius.rpc import SolanaRpcClient
203
204
 
204
205
  with SolanaRpcClient(api_key="YOUR_HELIUS_API_KEY") as client:
205
206
  _ctx, balance = client.get_balance("So11111111111111111111111111111111111111112")
@@ -219,7 +220,7 @@ If a `with` block doesn't fit your code structure (e.g. the client lives
219
220
  on a long-lived object), call `close()` yourself when you're done:
220
221
 
221
222
  ```python
222
- from helius.solana_rpc import SolanaRpcClient
223
+ from helius.rpc import SolanaRpcClient
223
224
 
224
225
  client = SolanaRpcClient(api_key="YOUR_HELIUS_API_KEY")
225
226
  try:
@@ -267,7 +268,7 @@ The method names map 1:1 to the Solana JSON-RPC spec, just converted to
267
268
  ## Status
268
269
 
269
270
  Actively expanding toward full coverage of the Helius API. See
270
- [`src/helius/solana_rpc/client.py`](src/helius/solana_rpc/client.py) for the
271
+ [`src/helius/rpc/client.py`](src/helius/rpc/client.py) for the
271
272
  current Solana JSON-RPC implementation; supported surfaces are listed below,
272
273
  and missing endpoints are tracked as issues and added continuously.
273
274
 
@@ -360,18 +361,18 @@ Each `*_subscribe` call returns the integer subscription id. Use
360
361
  them; both yield a `(context, notification, subscription)` tuple where
361
362
  `notification` is the model below.
362
363
 
363
- | Subscribe method | Unsubscribe method | Notification model | Helius docs |
364
- | ------------------------------- | --------------------------------- | ----------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
365
- | `account_subscribe(...)` | `account_unsubscribe(...)` | `AccountNotification` | [reference](https://www.helius.dev/docs/api-reference/rpc/websocket/accountsubscribe) |
366
- | `block_subscribe(...)` | `block_unsubscribe(...)` | `BlockNotification` | [reference](https://www.helius.dev/docs/api-reference/rpc/websocket/blocksubscribe) |
367
- | `logs_subscribe(...)` | `logs_unsubscribe(...)` | `LogsNotification` | [reference](https://www.helius.dev/docs/api-reference/rpc/websocket/logssubscribe) |
368
- | `program_subscribe(...)` | `program_unsubscribe(...)` | `ProgramNotification` | [reference](https://www.helius.dev/docs/api-reference/rpc/websocket/programsubscribe) |
369
- | `root_subscribe()` | `root_unsubscribe(...)` | `RootNotification` | [reference](https://www.helius.dev/docs/api-reference/rpc/websocket/rootsubscribe) |
370
- | `signature_subscribe(...)` | `signature_unsubscribe(...)` | `SignatureNotification` | [reference](https://www.helius.dev/docs/api-reference/rpc/websocket/signaturesubscribe) |
371
- | `slot_subscribe()` | `slot_unsubscribe(...)` | `SlotNotification` | [reference](https://www.helius.dev/docs/api-reference/rpc/websocket/slotsubscribe) |
372
- | `slots_updates_subscribe()` | `slots_updates_unsubscribe(...)` | `SlotsUpdatesNotification` | [reference](https://www.helius.dev/docs/api-reference/rpc/websocket/slotsupdatessubscribe) |
373
- | `vote_subscribe()` | `vote_unsubscribe(...)` | `VoteNotification` | [reference](https://www.helius.dev/docs/api-reference/rpc/websocket/votesubscribe) |
374
- | `transaction_subscribe(...)` | `transaction_unsubscribe(...)` | `TransactionNotification` | [reference](https://www.helius.dev/docs/api-reference/rpc/websocket/slotunsubscribe) |
364
+ | Subscribe method | Unsubscribe method | Notification model | Helius docs |
365
+ | ---------------------------- | -------------------------------- | -------------------------- | ------------------------------------------------------------------------------------------ |
366
+ | `account_subscribe(...)` | `account_unsubscribe(...)` | `AccountNotification` | [reference](https://www.helius.dev/docs/api-reference/rpc/websocket/accountsubscribe) |
367
+ | `block_subscribe(...)` | `block_unsubscribe(...)` | `BlockNotification` | [reference](https://www.helius.dev/docs/api-reference/rpc/websocket/blocksubscribe) |
368
+ | `logs_subscribe(...)` | `logs_unsubscribe(...)` | `LogsNotification` | [reference](https://www.helius.dev/docs/api-reference/rpc/websocket/logssubscribe) |
369
+ | `program_subscribe(...)` | `program_unsubscribe(...)` | `ProgramNotification` | [reference](https://www.helius.dev/docs/api-reference/rpc/websocket/programsubscribe) |
370
+ | `root_subscribe()` | `root_unsubscribe(...)` | `RootNotification` | [reference](https://www.helius.dev/docs/api-reference/rpc/websocket/rootsubscribe) |
371
+ | `signature_subscribe(...)` | `signature_unsubscribe(...)` | `SignatureNotification` | [reference](https://www.helius.dev/docs/api-reference/rpc/websocket/signaturesubscribe) |
372
+ | `slot_subscribe()` | `slot_unsubscribe(...)` | `SlotNotification` | [reference](https://www.helius.dev/docs/api-reference/rpc/websocket/slotsubscribe) |
373
+ | `slots_updates_subscribe()` | `slots_updates_unsubscribe(...)` | `SlotsUpdatesNotification` | [reference](https://www.helius.dev/docs/api-reference/rpc/websocket/slotsupdatessubscribe) |
374
+ | `vote_subscribe()` | `vote_unsubscribe(...)` | `VoteNotification` | [reference](https://www.helius.dev/docs/api-reference/rpc/websocket/votesubscribe) |
375
+ | `transaction_subscribe(...)` | `transaction_unsubscribe(...)` | `TransactionNotification` | [reference](https://www.helius.dev/docs/api-reference/rpc/websocket/transactionsubscribe) |
375
376
 
376
377
  ## Webhooks API
377
378
 
@@ -402,14 +403,14 @@ manual `close()`. The constructor defaults to
402
403
  from the environment or `.env` when `api_key` is omitted; optional
403
404
  `headers` and `proxy` arguments are also accepted.
404
405
 
405
- | REST operation | Python method | Helius docs |
406
- | -------------- | -------------------------- | ------------------------------------------------------------------------------------------------- |
407
- | Create webhook | `create_webhook(...)` | [reference](https://www.helius.dev/docs/api-reference/webhooks/create-webhook) |
408
- | Get webhook | `get_webhook(...)` | [reference](https://www.helius.dev/docs/api-reference/webhooks/get-webhook) |
409
- | List webhooks | `get_all_webhooks()` | [reference](https://www.helius.dev/docs/api-reference/webhooks/get-all-webhooks) |
410
- | Update webhook | `update_webhook(...)` | [reference](https://www.helius.dev/docs/api-reference/webhooks/update-webhook) |
411
- | Toggle webhook | `toggle_webhook(...)` | [reference](https://www.helius.dev/docs/api-reference/webhooks/toggle-webhook) |
412
- | Delete webhook | `delete_webhook(...)` | [reference](https://www.helius.dev/docs/api-reference/webhooks/delete-webhook) |
406
+ | REST operation | Python method | Helius docs |
407
+ | -------------- | --------------------- | -------------------------------------------------------------------------------- |
408
+ | Create webhook | `create_webhook(...)` | [reference](https://www.helius.dev/docs/api-reference/webhooks/create-webhook) |
409
+ | Get webhook | `get_webhook(...)` | [reference](https://www.helius.dev/docs/api-reference/webhooks/get-webhook) |
410
+ | List webhooks | `get_all_webhooks()` | [reference](https://www.helius.dev/docs/api-reference/webhooks/get-all-webhooks) |
411
+ | Update webhook | `update_webhook(...)` | [reference](https://www.helius.dev/docs/api-reference/webhooks/update-webhook) |
412
+ | Toggle webhook | `toggle_webhook(...)` | [reference](https://www.helius.dev/docs/api-reference/webhooks/toggle-webhook) |
413
+ | Delete webhook | `delete_webhook(...)` | [reference](https://www.helius.dev/docs/api-reference/webhooks/delete-webhook) |
413
414
 
414
415
  ## Admin API
415
416
 
@@ -432,14 +433,16 @@ supports the context-manager protocol, a manual `close()`, and reads
432
433
  `HELIUS_API_KEY` from the environment or `.env`.
433
434
 
434
435
  ## AI
435
- AI was used to assist in the development of this project, which was started beacause I needed a Helius client written in Python myself for another project. It has eliminated the need to perform repetitive tasks, such as writing functions that are similar to those written by hand before them. It has also been useful in drafting and updating the documentation (exclusively README.md at the time of writing), writing tests and examples.
436
- That said, AI-generated code is reviewed in full, line-by-line by human(s) against the Helius API specifications.
436
+
437
+ AI was used to assist in the development of this project, which was started because I needed a Helius client written in Python myself for another project. It has eliminated the need to perform repetitive tasks, such as writing functions that are similar to those written by hand before them. It has also been useful in drafting and updating the documentation (exclusively README.md at the time of writing), writing tests and examples.
438
+ That said, AI-generated code is reviewed in full, line-by-line by me against the Helius API specifications.
437
439
 
438
440
  To roughly describe my approach to using AI in this project, I generally write the code by hand, which makes it easy to structure the code well and maintain an intuitive understanding of how the code works. Then, when I got to the part where I had to implement 100+ similar Python functions, I turned to AI to write the massive part of the codebase, while I reviewed the result at the same time.
439
441
 
440
442
  To sum up:
441
- - I generally structure** and write a good part of what I'm programming by hand, including boilerplate.
442
- - I find it best to prompt agents to implement very limited functionality within narrow scope, performing something closer to pair-programming.
443
+
444
+ - I generally structure and write a good part of what I'm programming by hand, including boilerplate.
445
+ - I find it best to prompt agents to implement very limited functionality within narrow a scope, performing something closer to pair-programming.
443
446
  - Even though at least half the LoC in this project are hand-typed, I find that AI is incredibly capable, can be enjoyable to use, but most importantly, using AI allows me to focus my time and energy on what matters.
444
447
 
445
448
  By the way, this README section is completely brain-made and hand-typed.
@@ -101,7 +101,7 @@
101
101
 
102
102
  ## Coverage
103
103
 
104
- The goal of this library is **support every function, method, endpoint,
104
+ The goal of this library is to **support every function, method, endpoint,
105
105
  and feature that Helius exposes.** If Helius ships it, this client
106
106
  wraps it.
107
107
 
@@ -139,6 +139,7 @@ being worked on.
139
139
  documented Helius API.
140
140
 
141
141
  ## Installation via PyPI
142
+
142
143
  ```bash
143
144
  pip install helius-python
144
145
  ```
@@ -148,7 +149,7 @@ pip install helius-python
148
149
  Pass your Helius API key explicitly:
149
150
 
150
151
  ```python
151
- from helius.solana_rpc import SolanaRpcClient
152
+ from helius.rpc import SolanaRpcClient
152
153
 
153
154
  client = SolanaRpcClient(api_key="YOUR_HELIUS_API_KEY")
154
155
  ```
@@ -167,7 +168,7 @@ HELIUS_API_KEY=your_helius_api_key
167
168
  ```
168
169
 
169
170
  ```python
170
- from helius.solana_rpc import SolanaRpcClient
171
+ from helius.rpc import SolanaRpcClient
171
172
 
172
173
  client = SolanaRpcClient() # reads HELIUS_API_KEY from the environment or .env
173
174
  ```
@@ -177,7 +178,7 @@ client = SolanaRpcClient() # reads HELIUS_API_KEY from the environment or .env
177
178
  ### As a context manager (recommended)
178
179
 
179
180
  ```python
180
- from helius.solana_rpc import SolanaRpcClient
181
+ from helius.rpc import SolanaRpcClient
181
182
 
182
183
  with SolanaRpcClient(api_key="YOUR_HELIUS_API_KEY") as client:
183
184
  _ctx, balance = client.get_balance("So11111111111111111111111111111111111111112")
@@ -197,7 +198,7 @@ If a `with` block doesn't fit your code structure (e.g. the client lives
197
198
  on a long-lived object), call `close()` yourself when you're done:
198
199
 
199
200
  ```python
200
- from helius.solana_rpc import SolanaRpcClient
201
+ from helius.rpc import SolanaRpcClient
201
202
 
202
203
  client = SolanaRpcClient(api_key="YOUR_HELIUS_API_KEY")
203
204
  try:
@@ -245,7 +246,7 @@ The method names map 1:1 to the Solana JSON-RPC spec, just converted to
245
246
  ## Status
246
247
 
247
248
  Actively expanding toward full coverage of the Helius API. See
248
- [`src/helius/solana_rpc/client.py`](src/helius/solana_rpc/client.py) for the
249
+ [`src/helius/rpc/client.py`](src/helius/rpc/client.py) for the
249
250
  current Solana JSON-RPC implementation; supported surfaces are listed below,
250
251
  and missing endpoints are tracked as issues and added continuously.
251
252
 
@@ -338,18 +339,18 @@ Each `*_subscribe` call returns the integer subscription id. Use
338
339
  them; both yield a `(context, notification, subscription)` tuple where
339
340
  `notification` is the model below.
340
341
 
341
- | Subscribe method | Unsubscribe method | Notification model | Helius docs |
342
- | ------------------------------- | --------------------------------- | ----------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
343
- | `account_subscribe(...)` | `account_unsubscribe(...)` | `AccountNotification` | [reference](https://www.helius.dev/docs/api-reference/rpc/websocket/accountsubscribe) |
344
- | `block_subscribe(...)` | `block_unsubscribe(...)` | `BlockNotification` | [reference](https://www.helius.dev/docs/api-reference/rpc/websocket/blocksubscribe) |
345
- | `logs_subscribe(...)` | `logs_unsubscribe(...)` | `LogsNotification` | [reference](https://www.helius.dev/docs/api-reference/rpc/websocket/logssubscribe) |
346
- | `program_subscribe(...)` | `program_unsubscribe(...)` | `ProgramNotification` | [reference](https://www.helius.dev/docs/api-reference/rpc/websocket/programsubscribe) |
347
- | `root_subscribe()` | `root_unsubscribe(...)` | `RootNotification` | [reference](https://www.helius.dev/docs/api-reference/rpc/websocket/rootsubscribe) |
348
- | `signature_subscribe(...)` | `signature_unsubscribe(...)` | `SignatureNotification` | [reference](https://www.helius.dev/docs/api-reference/rpc/websocket/signaturesubscribe) |
349
- | `slot_subscribe()` | `slot_unsubscribe(...)` | `SlotNotification` | [reference](https://www.helius.dev/docs/api-reference/rpc/websocket/slotsubscribe) |
350
- | `slots_updates_subscribe()` | `slots_updates_unsubscribe(...)` | `SlotsUpdatesNotification` | [reference](https://www.helius.dev/docs/api-reference/rpc/websocket/slotsupdatessubscribe) |
351
- | `vote_subscribe()` | `vote_unsubscribe(...)` | `VoteNotification` | [reference](https://www.helius.dev/docs/api-reference/rpc/websocket/votesubscribe) |
352
- | `transaction_subscribe(...)` | `transaction_unsubscribe(...)` | `TransactionNotification` | [reference](https://www.helius.dev/docs/api-reference/rpc/websocket/slotunsubscribe) |
342
+ | Subscribe method | Unsubscribe method | Notification model | Helius docs |
343
+ | ---------------------------- | -------------------------------- | -------------------------- | ------------------------------------------------------------------------------------------ |
344
+ | `account_subscribe(...)` | `account_unsubscribe(...)` | `AccountNotification` | [reference](https://www.helius.dev/docs/api-reference/rpc/websocket/accountsubscribe) |
345
+ | `block_subscribe(...)` | `block_unsubscribe(...)` | `BlockNotification` | [reference](https://www.helius.dev/docs/api-reference/rpc/websocket/blocksubscribe) |
346
+ | `logs_subscribe(...)` | `logs_unsubscribe(...)` | `LogsNotification` | [reference](https://www.helius.dev/docs/api-reference/rpc/websocket/logssubscribe) |
347
+ | `program_subscribe(...)` | `program_unsubscribe(...)` | `ProgramNotification` | [reference](https://www.helius.dev/docs/api-reference/rpc/websocket/programsubscribe) |
348
+ | `root_subscribe()` | `root_unsubscribe(...)` | `RootNotification` | [reference](https://www.helius.dev/docs/api-reference/rpc/websocket/rootsubscribe) |
349
+ | `signature_subscribe(...)` | `signature_unsubscribe(...)` | `SignatureNotification` | [reference](https://www.helius.dev/docs/api-reference/rpc/websocket/signaturesubscribe) |
350
+ | `slot_subscribe()` | `slot_unsubscribe(...)` | `SlotNotification` | [reference](https://www.helius.dev/docs/api-reference/rpc/websocket/slotsubscribe) |
351
+ | `slots_updates_subscribe()` | `slots_updates_unsubscribe(...)` | `SlotsUpdatesNotification` | [reference](https://www.helius.dev/docs/api-reference/rpc/websocket/slotsupdatessubscribe) |
352
+ | `vote_subscribe()` | `vote_unsubscribe(...)` | `VoteNotification` | [reference](https://www.helius.dev/docs/api-reference/rpc/websocket/votesubscribe) |
353
+ | `transaction_subscribe(...)` | `transaction_unsubscribe(...)` | `TransactionNotification` | [reference](https://www.helius.dev/docs/api-reference/rpc/websocket/transactionsubscribe) |
353
354
 
354
355
  ## Webhooks API
355
356
 
@@ -380,14 +381,14 @@ manual `close()`. The constructor defaults to
380
381
  from the environment or `.env` when `api_key` is omitted; optional
381
382
  `headers` and `proxy` arguments are also accepted.
382
383
 
383
- | REST operation | Python method | Helius docs |
384
- | -------------- | -------------------------- | ------------------------------------------------------------------------------------------------- |
385
- | Create webhook | `create_webhook(...)` | [reference](https://www.helius.dev/docs/api-reference/webhooks/create-webhook) |
386
- | Get webhook | `get_webhook(...)` | [reference](https://www.helius.dev/docs/api-reference/webhooks/get-webhook) |
387
- | List webhooks | `get_all_webhooks()` | [reference](https://www.helius.dev/docs/api-reference/webhooks/get-all-webhooks) |
388
- | Update webhook | `update_webhook(...)` | [reference](https://www.helius.dev/docs/api-reference/webhooks/update-webhook) |
389
- | Toggle webhook | `toggle_webhook(...)` | [reference](https://www.helius.dev/docs/api-reference/webhooks/toggle-webhook) |
390
- | Delete webhook | `delete_webhook(...)` | [reference](https://www.helius.dev/docs/api-reference/webhooks/delete-webhook) |
384
+ | REST operation | Python method | Helius docs |
385
+ | -------------- | --------------------- | -------------------------------------------------------------------------------- |
386
+ | Create webhook | `create_webhook(...)` | [reference](https://www.helius.dev/docs/api-reference/webhooks/create-webhook) |
387
+ | Get webhook | `get_webhook(...)` | [reference](https://www.helius.dev/docs/api-reference/webhooks/get-webhook) |
388
+ | List webhooks | `get_all_webhooks()` | [reference](https://www.helius.dev/docs/api-reference/webhooks/get-all-webhooks) |
389
+ | Update webhook | `update_webhook(...)` | [reference](https://www.helius.dev/docs/api-reference/webhooks/update-webhook) |
390
+ | Toggle webhook | `toggle_webhook(...)` | [reference](https://www.helius.dev/docs/api-reference/webhooks/toggle-webhook) |
391
+ | Delete webhook | `delete_webhook(...)` | [reference](https://www.helius.dev/docs/api-reference/webhooks/delete-webhook) |
391
392
 
392
393
  ## Admin API
393
394
 
@@ -410,14 +411,16 @@ supports the context-manager protocol, a manual `close()`, and reads
410
411
  `HELIUS_API_KEY` from the environment or `.env`.
411
412
 
412
413
  ## AI
413
- AI was used to assist in the development of this project, which was started beacause I needed a Helius client written in Python myself for another project. It has eliminated the need to perform repetitive tasks, such as writing functions that are similar to those written by hand before them. It has also been useful in drafting and updating the documentation (exclusively README.md at the time of writing), writing tests and examples.
414
- That said, AI-generated code is reviewed in full, line-by-line by human(s) against the Helius API specifications.
414
+
415
+ AI was used to assist in the development of this project, which was started because I needed a Helius client written in Python myself for another project. It has eliminated the need to perform repetitive tasks, such as writing functions that are similar to those written by hand before them. It has also been useful in drafting and updating the documentation (exclusively README.md at the time of writing), writing tests and examples.
416
+ That said, AI-generated code is reviewed in full, line-by-line by me against the Helius API specifications.
415
417
 
416
418
  To roughly describe my approach to using AI in this project, I generally write the code by hand, which makes it easy to structure the code well and maintain an intuitive understanding of how the code works. Then, when I got to the part where I had to implement 100+ similar Python functions, I turned to AI to write the massive part of the codebase, while I reviewed the result at the same time.
417
419
 
418
420
  To sum up:
419
- - I generally structure** and write a good part of what I'm programming by hand, including boilerplate.
420
- - I find it best to prompt agents to implement very limited functionality within narrow scope, performing something closer to pair-programming.
421
+
422
+ - I generally structure and write a good part of what I'm programming by hand, including boilerplate.
423
+ - I find it best to prompt agents to implement very limited functionality within narrow a scope, performing something closer to pair-programming.
421
424
  - Even though at least half the LoC in this project are hand-typed, I find that AI is incredibly capable, can be enjoyable to use, but most importantly, using AI allows me to focus my time and energy on what matters.
422
425
 
423
426
  By the way, this README section is completely brain-made and hand-typed.
@@ -6,8 +6,8 @@ either compact signature rows or full transaction payloads with pagination.
6
6
  Usage:
7
7
 
8
8
  export HELIUS_API_KEY=your_helius_api_key
9
- python examples/solana_rpc/address_transactions.py <ADDRESS> [--limit 10]
10
- python examples/solana_rpc/address_transactions.py <ADDRESS> --full --limit 5
9
+ python examples/rpc/address_transactions.py <ADDRESS> [--limit 10]
10
+ python examples/rpc/address_transactions.py <ADDRESS> --full --limit 5
11
11
 
12
12
  Docs:
13
13
  https://www.helius.dev/docs/getting-data/get-transactions-for-address
@@ -25,7 +25,7 @@ import sys
25
25
 
26
26
  import httpx
27
27
 
28
- from helius.solana_rpc import SolanaRpcClient
28
+ from helius.rpc import SolanaRpcClient
29
29
 
30
30
 
31
31
  def format_time(block_time: int | None) -> str:
@@ -6,8 +6,8 @@ Uses Helius's `getTransfersByAddress` RPC method exposed by this client as
6
6
  Usage:
7
7
 
8
8
  export HELIUS_API_KEY=your_helius_api_key
9
- python examples/solana_rpc/address_transfers.py <ADDRESS> [--limit 20]
10
- python examples/solana_rpc/address_transfers.py <ADDRESS> --direction in --mint <MINT>
9
+ python examples/rpc/address_transfers.py <ADDRESS> [--limit 20]
10
+ python examples/rpc/address_transfers.py <ADDRESS> --direction in --mint <MINT>
11
11
 
12
12
  Docs:
13
13
  https://www.helius.dev/docs/getting-data/get-transfers-by-address
@@ -25,7 +25,7 @@ import sys
25
25
 
26
26
  import httpx
27
27
 
28
- from helius.solana_rpc import SolanaRpcClient
28
+ from helius.rpc import SolanaRpcClient
29
29
 
30
30
 
31
31
  def format_time(block_time: int) -> str:
@@ -8,8 +8,8 @@ breakdown of successful vs. failed transactions plus total fees paid.
8
8
  Usage:
9
9
 
10
10
  export HELIUS_API_KEY=your_helius_api_key
11
- python examples/solana_rpc/block_explorer.py
12
- python examples/solana_rpc/block_explorer.py --slot 250000000
11
+ python examples/rpc/block_explorer.py
12
+ python examples/rpc/block_explorer.py --slot 250000000
13
13
 
14
14
  Uses (with `with`):
15
15
  get_slot, get_block.
@@ -21,7 +21,7 @@ import argparse
21
21
  import datetime as dt
22
22
  import sys
23
23
 
24
- from helius.solana_rpc import SolanaRpcClient
24
+ from helius.rpc import SolanaRpcClient
25
25
 
26
26
  LAMPORTS_PER_SOL = 1_000_000_000
27
27
 
@@ -73,9 +73,7 @@ def main() -> int:
73
73
  print(f"\nTransactions : {total:,} total")
74
74
  print(f" succeeded : {succeeded:,}")
75
75
  print(f" failed : {failed:,}")
76
- print(
77
- f"Total fees : {fees / LAMPORTS_PER_SOL:.9f} SOL " f"({fees:,} lamports)"
78
- )
76
+ print(f"Total fees : {fees / LAMPORTS_PER_SOL:.9f} SOL ({fees:,} lamports)")
79
77
 
80
78
  if block.rewards:
81
79
  print(f"\nRewards ({len(block.rewards)}):")
@@ -7,7 +7,7 @@ polls `getSignatureStatuses` until the airdrop transaction reaches a
7
7
  Usage:
8
8
 
9
9
  export HELIUS_API_KEY=your_helius_api_key
10
- python examples/solana_rpc/devnet_airdrop.py <WALLET_ADDRESS> [--sol 1.0]
10
+ python examples/rpc/devnet_airdrop.py <WALLET_ADDRESS> [--sol 1.0]
11
11
 
12
12
  Note:
13
13
  `requestAirdrop` is only available on Devnet and Testnet — never on
@@ -26,7 +26,7 @@ import time
26
26
 
27
27
  import httpx
28
28
 
29
- from helius.solana_rpc import SolanaRpcClient
29
+ from helius.rpc import SolanaRpcClient
30
30
 
31
31
  LAMPORTS_PER_SOL = 1_000_000_000
32
32
  DEVNET_URL = "https://devnet.helius-rpc.com"
@@ -67,7 +67,9 @@ def main() -> int:
67
67
  try:
68
68
  print(f"Requesting {args.sol} SOL airdrop to {args.address} on devnet...")
69
69
  try:
70
- signature = client.request_airdrop(public_key=args.address, lamports=lamports)
70
+ signature = client.request_airdrop(
71
+ public_key=args.address, lamports=lamports
72
+ )
71
73
  except httpx.HTTPStatusError as exc:
72
74
  print(
73
75
  f"HTTP {exc.response.status_code}: devnet airdrop request was rejected.",
@@ -7,7 +7,7 @@ recent-performance summary (avg TPS over the last samples).
7
7
  Usage:
8
8
 
9
9
  export HELIUS_API_KEY=your_helius_api_key
10
- python examples/solana_rpc/network_status.py
10
+ python examples/rpc/network_status.py
11
11
 
12
12
  Uses (with `with`):
13
13
  get_health, get_version, get_slot, get_block_height, get_epoch_info,
@@ -18,7 +18,7 @@ from __future__ import annotations
18
18
 
19
19
  import sys
20
20
 
21
- from helius.solana_rpc import SolanaRpcClient
21
+ from helius.rpc import SolanaRpcClient
22
22
 
23
23
 
24
24
  def main() -> int:
@@ -12,8 +12,8 @@ sample only counts transactions that locked those accounts as writable
12
12
  Usage:
13
13
 
14
14
  export HELIUS_API_KEY=your_helius_api_key
15
- python examples/solana_rpc/priority_fees.py
16
- python examples/solana_rpc/priority_fees.py --account <PUBKEY> --account <PUBKEY>
15
+ python examples/rpc/priority_fees.py
16
+ python examples/rpc/priority_fees.py --account <PUBKEY> --account <PUBKEY>
17
17
 
18
18
  Uses (with `with`):
19
19
  get_recent_prioritization_fees.
@@ -25,7 +25,7 @@ import argparse
25
25
  import statistics
26
26
  import sys
27
27
 
28
- from helius.solana_rpc import SolanaRpcClient
28
+ from helius.rpc import SolanaRpcClient
29
29
 
30
30
 
31
31
  def percentile(sorted_values: list[int], pct: float) -> int:
@@ -7,7 +7,7 @@ validator set (top 10 by stake).
7
7
  Usage:
8
8
 
9
9
  export HELIUS_API_KEY=your_helius_api_key
10
- python examples/solana_rpc/stake_overview.py
10
+ python examples/rpc/stake_overview.py
11
11
 
12
12
  Uses (with `try/finally`):
13
13
  get_inflation_rate, get_inflation_governor, get_supply,
@@ -20,7 +20,7 @@ import sys
20
20
 
21
21
  import httpx
22
22
 
23
- from helius.solana_rpc import SolanaRpcClient
23
+ from helius.rpc import SolanaRpcClient
24
24
 
25
25
  LAMPORTS_PER_SOL = 1_000_000_000
26
26
 
@@ -7,11 +7,11 @@ Given a mint address, prints:
7
7
  Usage:
8
8
 
9
9
  export HELIUS_API_KEY=your_helius_api_key
10
- python examples/solana_rpc/token_inspector.py <MINT_ADDRESS>
10
+ python examples/rpc/token_inspector.py <MINT_ADDRESS>
11
11
 
12
12
  Example with a small-holder-count mint:
13
13
 
14
- python examples/solana_rpc/token_inspector.py J5iyNuTa6zqqA62Xe4h1VBvcBW5CTSNNva3QPh8DU5RV
14
+ python examples/rpc/token_inspector.py J5iyNuTa6zqqA62Xe4h1VBvcBW5CTSNNva3QPh8DU5RV
15
15
 
16
16
  Note:
17
17
  Very large mints may be rejected by `getTokenLargestAccounts` if the
@@ -28,7 +28,7 @@ import sys
28
28
 
29
29
  import httpx
30
30
 
31
- from helius.solana_rpc import SolanaRpcClient
31
+ from helius.rpc import SolanaRpcClient
32
32
 
33
33
 
34
34
  def main() -> int:
@@ -7,7 +7,7 @@ involved, and any log messages emitted by the on-chain programs.
7
7
  Usage:
8
8
 
9
9
  export HELIUS_API_KEY=your_helius_api_key
10
- python examples/solana_rpc/transaction_inspector.py <SIGNATURE>
10
+ python examples/rpc/transaction_inspector.py <SIGNATURE>
11
11
 
12
12
  Uses (with `with`):
13
13
  get_transaction.
@@ -19,7 +19,7 @@ import argparse
19
19
  import datetime as dt
20
20
  import sys
21
21
 
22
- from helius.solana_rpc import SolanaRpcClient
22
+ from helius.rpc import SolanaRpcClient
23
23
 
24
24
  LAMPORTS_PER_SOL = 1_000_000_000
25
25
 
@@ -3,11 +3,11 @@
3
3
  Usage:
4
4
 
5
5
  export HELIUS_API_KEY=your_helius_api_key
6
- python examples/solana_rpc/wallet_tracker.py <WALLET_ADDRESS> [--limit 20]
6
+ python examples/rpc/wallet_tracker.py <WALLET_ADDRESS> [--limit 20]
7
7
 
8
8
  Example (Helius's own treasury-ish address, replace with any):
9
9
 
10
- python examples/solana_rpc/wallet_tracker.py 7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU
10
+ python examples/rpc/wallet_tracker.py 7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU
11
11
 
12
12
  It prints:
13
13
  - SOL balance (in SOL, not lamports)
@@ -23,7 +23,7 @@ import argparse
23
23
  import datetime as dt
24
24
  import sys
25
25
 
26
- from helius.solana_rpc import SolanaRpcClient
26
+ from helius.rpc import SolanaRpcClient
27
27
 
28
28
  # SPL Token program ID — used to list every token account owned by a wallet.
29
29
  TOKEN_PROGRAM_ID = "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"
@@ -10,7 +10,7 @@ build-backend = "hatchling.build"
10
10
 
11
11
  [project]
12
12
  name = "helius-python"
13
- version = "0.4.1"
13
+ version = "0.5.0"
14
14
  authors = [
15
15
  { name="Markos Narinian", email="manarinian@gmail.com" },
16
16
  ]
@@ -1,5 +1,5 @@
1
- from helius.solana_rpc.client import SolanaRpcClient
2
- from helius.solana_rpc.models import (
1
+ from helius.rpc.client import SolanaRpcClient
2
+ from helius.rpc.models import (
3
3
  Account,
4
4
  Block,
5
5
  BlockCommitment,
@@ -5,7 +5,7 @@ import httpx
5
5
  from dotenv import dotenv_values
6
6
  from pydantic import Field, TypeAdapter, validate_call
7
7
 
8
- from helius.solana_rpc.models import (
8
+ from helius.rpc.models import (
9
9
  Account,
10
10
  Block,
11
11
  BlockCommitment,
@@ -22,7 +22,6 @@ import sys
22
22
  from dataclasses import dataclass, field
23
23
  from pathlib import Path
24
24
 
25
-
26
25
  ROOT = Path(__file__).resolve().parent
27
26
  PYTHONPATH = str(ROOT / "src")
28
27
  USE_COLOR = "NO_COLOR" not in os.environ
@@ -35,9 +34,7 @@ RESET = "\033[0m"
35
34
 
36
35
  SYSTEM_PROGRAM = "11111111111111111111111111111111"
37
36
  SMALL_MINT = "J5iyNuTa6zqqA62Xe4h1VBvcBW5CTSNNva3QPh8DU5RV"
38
- KNOWN_SIGNATURE = (
39
- "eqRntqi1tjXv1zEGBM5btQGWoxWc73XXGDJXjxLE65Atj6T6qzNnJf5LyTbUoGXHS9TzeAnQniAre48SjcJft9f"
40
- )
37
+ KNOWN_SIGNATURE = "eqRntqi1tjXv1zEGBM5btQGWoxWc73XXGDJXjxLE65Atj6T6qzNnJf5LyTbUoGXHS9TzeAnQniAre48SjcJft9f"
41
38
  DEVNET_ADDRESS = "7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU"
42
39
 
43
40
 
@@ -51,9 +48,9 @@ class ExampleTest:
51
48
 
52
49
  TESTS = [
53
50
  ExampleTest(
54
- name="solana_rpc/address_transactions",
51
+ name="rpc/address_transactions",
55
52
  args=[
56
- "examples/solana_rpc/address_transactions.py",
53
+ "examples/rpc/address_transactions.py",
57
54
  SYSTEM_PROGRAM,
58
55
  "--limit",
59
56
  "1",
@@ -61,9 +58,9 @@ TESTS = [
61
58
  ],
62
59
  ),
63
60
  ExampleTest(
64
- name="solana_rpc/address_transfers",
61
+ name="rpc/address_transfers",
65
62
  args=[
66
- "examples/solana_rpc/address_transfers.py",
63
+ "examples/rpc/address_transfers.py",
67
64
  SYSTEM_PROGRAM,
68
65
  "--limit",
69
66
  "1",
@@ -71,14 +68,14 @@ TESTS = [
71
68
  ],
72
69
  ),
73
70
  ExampleTest(
74
- name="solana_rpc/block_explorer",
75
- args=["examples/solana_rpc/block_explorer.py", "--slot", "423563000"],
71
+ name="rpc/block_explorer",
72
+ args=["examples/rpc/block_explorer.py", "--slot", "423563000"],
76
73
  timeout=90,
77
74
  ),
78
75
  ExampleTest(
79
- name="solana_rpc/devnet_airdrop",
76
+ name="rpc/devnet_airdrop",
80
77
  args=[
81
- "examples/solana_rpc/devnet_airdrop.py",
78
+ "examples/rpc/devnet_airdrop.py",
82
79
  DEVNET_ADDRESS,
83
80
  "--sol",
84
81
  "0.000000001",
@@ -88,38 +85,42 @@ TESTS = [
88
85
  ],
89
86
  ),
90
87
  ExampleTest(
91
- name="solana_rpc/network_status",
92
- args=["examples/solana_rpc/network_status.py"],
88
+ name="rpc/network_status",
89
+ args=["examples/rpc/network_status.py"],
93
90
  ),
94
91
  ExampleTest(
95
- name="solana_rpc/priority_fees",
96
- args=["examples/solana_rpc/priority_fees.py"],
92
+ name="rpc/priority_fees",
93
+ args=["examples/rpc/priority_fees.py"],
97
94
  ),
98
95
  ExampleTest(
99
- name="solana_rpc/stake_overview",
100
- args=["examples/solana_rpc/stake_overview.py"],
96
+ name="rpc/stake_overview",
97
+ args=["examples/rpc/stake_overview.py"],
101
98
  timeout=120,
102
99
  ),
103
100
  ExampleTest(
104
- name="solana_rpc/token_inspector",
105
- args=["examples/solana_rpc/token_inspector.py", SMALL_MINT],
101
+ name="rpc/token_inspector",
102
+ args=["examples/rpc/token_inspector.py", SMALL_MINT],
106
103
  timeout=90,
107
104
  ),
108
105
  ExampleTest(
109
- name="solana_rpc/transaction_inspector",
110
- args=["examples/solana_rpc/transaction_inspector.py", KNOWN_SIGNATURE],
106
+ name="rpc/transaction_inspector",
107
+ args=["examples/rpc/transaction_inspector.py", KNOWN_SIGNATURE],
111
108
  timeout=90,
112
109
  ),
113
110
  ExampleTest(
114
- name="solana_rpc/wallet_tracker",
115
- args=["examples/solana_rpc/wallet_tracker.py", SYSTEM_PROGRAM, "--limit", "1"],
111
+ name="rpc/wallet_tracker",
112
+ args=["examples/rpc/wallet_tracker.py", SYSTEM_PROGRAM, "--limit", "1"],
116
113
  timeout=120,
117
114
  ),
118
115
  ExampleTest(
119
116
  name="laserstream/websocket_logs",
120
117
  args=["examples/laserstream/websocket_logs.py", "--count", "1"],
121
118
  timeout=45,
122
- external_failure_markers=("TimeoutError: timed out", "403 Forbidden", "HTTP 403"),
119
+ external_failure_markers=(
120
+ "TimeoutError: timed out",
121
+ "403 Forbidden",
122
+ "HTTP 403",
123
+ ),
123
124
  ),
124
125
  ExampleTest(
125
126
  name="webhooks/webhook_crud",
@@ -4,8 +4,8 @@ import httpx
4
4
  import pytest
5
5
  import respx
6
6
 
7
- from helius.solana_rpc import SolanaRpcClient
8
- from helius.solana_rpc.models import Account
7
+ from helius.rpc import SolanaRpcClient
8
+ from helius.rpc.models import Account
9
9
 
10
10
  ACCOUNT_VALUE = {
11
11
  "lamports": 5_000_000_000,
@@ -797,7 +797,7 @@ def test_get_minimum_balance_for_rent_exemption():
797
797
  @respx.mock
798
798
  def test_get_multiple_accounts():
799
799
  # Asserts correct upstream API shape {"dataSlice": {...}}.
800
- # Will FAIL until solana_rpc.py:449-450 is fixed to send dataSlice as a nested object.
800
+ # Will FAIL until rpc.py:449-450 is fixed to send dataSlice as a nested object.
801
801
  route = mock_rpc({"context": {"slot": 341197247}, "value": [ACCOUNT_VALUE]})
802
802
  with SolanaRpcClient(api_key="test") as client:
803
803
  context, accounts = client.get_multiple_accounts(
@@ -1,4 +1,4 @@
1
- from helius.solana_rpc.models import (
1
+ from helius.rpc.models import (
2
2
  Account,
3
3
  Block,
4
4
  BlockCommitment,
File without changes
File without changes
File without changes
File without changes