helius-python 0.0.4__tar.gz → 0.1.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 (28) hide show
  1. {helius_python-0.0.4 → helius_python-0.1.0}/PKG-INFO +1 -1
  2. {helius_python-0.0.4 → helius_python-0.1.0}/pyproject.toml +1 -1
  3. {helius_python-0.0.4 → helius_python-0.1.0}/src/helius/client.py +38 -40
  4. {helius_python-0.0.4 → helius_python-0.1.0}/.editorconfig +0 -0
  5. {helius_python-0.0.4 → helius_python-0.1.0}/.github/workflows/python-package.yml +0 -0
  6. {helius_python-0.0.4 → helius_python-0.1.0}/.github/workflows/python-publish.yml +0 -0
  7. {helius_python-0.0.4 → helius_python-0.1.0}/.gitignore +0 -0
  8. {helius_python-0.0.4 → helius_python-0.1.0}/AGENTS.md +0 -0
  9. {helius_python-0.0.4 → helius_python-0.1.0}/CLAUDE.md +0 -0
  10. {helius_python-0.0.4 → helius_python-0.1.0}/CONTRIBUTING.md +0 -0
  11. {helius_python-0.0.4 → helius_python-0.1.0}/LICENSE +0 -0
  12. {helius_python-0.0.4 → helius_python-0.1.0}/README.md +0 -0
  13. {helius_python-0.0.4 → helius_python-0.1.0}/examples/block_explorer.py +0 -0
  14. {helius_python-0.0.4 → helius_python-0.1.0}/examples/devnet_airdrop.py +0 -0
  15. {helius_python-0.0.4 → helius_python-0.1.0}/examples/network_status.py +0 -0
  16. {helius_python-0.0.4 → helius_python-0.1.0}/examples/priority_fees.py +0 -0
  17. {helius_python-0.0.4 → helius_python-0.1.0}/examples/stake_overview.py +0 -0
  18. {helius_python-0.0.4 → helius_python-0.1.0}/examples/token_inspector.py +0 -0
  19. {helius_python-0.0.4 → helius_python-0.1.0}/examples/transaction_inspector.py +0 -0
  20. {helius_python-0.0.4 → helius_python-0.1.0}/examples/wallet_tracker.py +0 -0
  21. {helius_python-0.0.4 → helius_python-0.1.0}/requirements.txt +0 -0
  22. {helius_python-0.0.4 → helius_python-0.1.0}/src/helius/__init__.py +0 -0
  23. {helius_python-0.0.4 → helius_python-0.1.0}/src/helius/models.py +0 -0
  24. {helius_python-0.0.4 → helius_python-0.1.0}/tests/fixtures/account.json +0 -0
  25. {helius_python-0.0.4 → helius_python-0.1.0}/tests/fixtures/supply.json +0 -0
  26. {helius_python-0.0.4 → helius_python-0.1.0}/tests/unit/test_helius_client.py +0 -0
  27. {helius_python-0.0.4 → helius_python-0.1.0}/tests/unit/test_models.py +0 -0
  28. {helius_python-0.0.4 → helius_python-0.1.0}/tests/unit/test_rpc_request.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: helius-python
3
- Version: 0.0.4
3
+ Version: 0.1.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
@@ -10,7 +10,7 @@ build-backend = "hatchling.build"
10
10
 
11
11
  [project]
12
12
  name = "helius-python"
13
- version = "0.0.4"
13
+ version = "0.1.0"
14
14
  authors = [
15
15
  { name="Markos Narinian", email="manarinian@gmail.com" },
16
16
  ]
@@ -28,10 +28,8 @@ from helius.models import (
28
28
 
29
29
 
30
30
  class HeliusClient:
31
- # BUG: check which endpoints return meaningful data in context
32
- # BUG: handle helius errors that do not show by HTTP response code
31
+ # TODO: handle helius errors that do not show by HTTP response code
33
32
  # TODO: check all http methods and all guides and implement pagination and other non-implemented features
34
- # TODO: consider refactoring | None = None to Optional[] = None
35
33
  def __init__(
36
34
  self,
37
35
  *,
@@ -69,7 +67,7 @@ class HeliusClient:
69
67
  return response.json()
70
68
 
71
69
  def get_account_info(
72
- self,
70
+ self, *,
73
71
  public_key: str,
74
72
  commitment: Literal["finalized", "confirmed", "processed"] | None = None,
75
73
  encoding: (
@@ -106,7 +104,7 @@ class HeliusClient:
106
104
  return context, account_info
107
105
 
108
106
  def get_balance(
109
- self,
107
+ self, *,
110
108
  public_key: str,
111
109
  commitment: Literal["finalized", "confirmed", "processed"] | None = None,
112
110
  min_context_slot: int | None = None,
@@ -124,7 +122,7 @@ class HeliusClient:
124
122
  return context, value
125
123
 
126
124
  def get_block(
127
- self,
125
+ self, *,
128
126
  slot: int,
129
127
  commitment: Literal["finalized", "confirmed"] | None = None,
130
128
  encoding: Literal["jsonParsed", "base58", "base64", "base64+std"] | None = None,
@@ -149,7 +147,7 @@ class HeliusClient:
149
147
  return block
150
148
 
151
149
  def get_block_commitment(
152
- self,
150
+ self, *,
153
151
  slot: int,
154
152
  ) -> BlockCommitment:
155
153
  request = RpcRequest(method="getBlockCommitment").add(slot).build()
@@ -158,7 +156,7 @@ class HeliusClient:
158
156
  return block_commitment
159
157
 
160
158
  def get_block_height(
161
- self,
159
+ self, *,
162
160
  commitment: Literal["finalized", "confirmed", "processed"] | None = None,
163
161
  min_context_slot: int | None = None,
164
162
  ) -> int:
@@ -172,7 +170,7 @@ class HeliusClient:
172
170
  return response["result"]
173
171
 
174
172
  def get_block_production(
175
- self,
173
+ self, *,
176
174
  commitment: Literal["finalized", "confirmed", "processed"] | None = None,
177
175
  first_slot: int | None = None,
178
176
  last_slot: int | None = None,
@@ -207,7 +205,7 @@ class HeliusClient:
207
205
  return context, value
208
206
 
209
207
  def get_blocks(
210
- self,
208
+ self, *,
211
209
  start_slot: int,
212
210
  end_slot: int | None,
213
211
  commitment: Literal["finalized", "confirmed", "processed"] | None = None,
@@ -227,7 +225,7 @@ class HeliusClient:
227
225
  return response["result"]
228
226
 
229
227
  def get_blocks_with_limit(
230
- self,
228
+ self, *,
231
229
  start_slot: int,
232
230
  limit: int,
233
231
  commitment: Literal["finalized", "confirmed", "processed"] | None = None,
@@ -242,7 +240,7 @@ class HeliusClient:
242
240
  response = self._send(request)
243
241
  return response["result"]
244
242
 
245
- def get_block_time(self, slot: int) -> int | None:
243
+ def get_block_time(self, *, slot: int) -> int | None:
246
244
  request = RpcRequest(method="getBlockTime").add(slot).build()
247
245
  response = self._send(request)
248
246
  return response["result"]
@@ -255,7 +253,7 @@ class HeliusClient:
255
253
  return cluster_nodes
256
254
 
257
255
  def get_epoch_info(
258
- self,
256
+ self, *,
259
257
  commitment: Literal["finalized", "confirmed", "processed"] | None = None,
260
258
  min_context_slot: int | None = None,
261
259
  ) -> EpochInfo:
@@ -276,7 +274,7 @@ class HeliusClient:
276
274
  return epoch_schedule
277
275
 
278
276
  def get_fee_for_message(
279
- self,
277
+ self, *,
280
278
  message: str,
281
279
  commitment: Literal["finalized", "confirmed", "processed"] | None = None,
282
280
  min_context_slot: int | None = None,
@@ -323,7 +321,7 @@ class HeliusClient:
323
321
  return identity
324
322
 
325
323
  def get_inflation_governor(
326
- self,
324
+ self, *,
327
325
  commitment: Literal["finalized", "confirmed", "processed"] | None = None,
328
326
  ) -> InflationGovernor:
329
327
  request = (
@@ -344,7 +342,7 @@ class HeliusClient:
344
342
  # TODO: getInflationReward
345
343
 
346
344
  def get_largest_accounts(
347
- self,
345
+ self, *,
348
346
  commitment: Literal["finalized", "confirmed", "processed"] | None = None,
349
347
  filter: Literal["circulating", "nonCirculating"] | None = None,
350
348
  ) -> tuple[dict, list[LamportAccount]]:
@@ -362,7 +360,7 @@ class HeliusClient:
362
360
  return context, largest_accounts
363
361
 
364
362
  def get_latest_blockhash(
365
- self,
363
+ self, *,
366
364
  commitment: Literal["finalized", "confirmed", "processed"] | None = None,
367
365
  min_context_slot: int | None = None,
368
366
  ) -> tuple[dict, str, int]:
@@ -380,7 +378,7 @@ class HeliusClient:
380
378
  return context, blockhash, last_valid_block_height
381
379
 
382
380
  def get_leader_schedule(
383
- self,
381
+ self, *,
384
382
  slot: int | None = None,
385
383
  commitment: Literal["finalized", "confirmed", "processed"] | None = None,
386
384
  identity: str | None = None,
@@ -409,7 +407,7 @@ class HeliusClient:
409
407
  return result
410
408
 
411
409
  def get_minimum_balance_for_rent_exemption(
412
- self,
410
+ self, *,
413
411
  data_length: int,
414
412
  commitment: Literal["finalized", "confirmed", "processed"] | None = None,
415
413
  ) -> int:
@@ -424,7 +422,7 @@ class HeliusClient:
424
422
  return result
425
423
 
426
424
  def get_multiple_accounts(
427
- self,
425
+ self, *,
428
426
  pubkeys: list[str],
429
427
  commitment: Literal["finalized", "confirmed", "processed"] | None = None,
430
428
  encoding: (
@@ -468,7 +466,7 @@ class HeliusClient:
468
466
 
469
467
  @validate_call
470
468
  def get_program_accounts(
471
- self,
469
+ self, *,
472
470
  program_id: str,
473
471
  commitment: Literal["confirmed", "finalized", "processed"] | None = None,
474
472
  min_context_slot: int | None = None,
@@ -509,7 +507,7 @@ class HeliusClient:
509
507
  return [(i["pubkey"], Account.model_validate(i["account"])) for i in result]
510
508
 
511
509
  def get_recent_performance_samples(
512
- self,
510
+ self, *,
513
511
  limit: int | None = None,
514
512
  ) -> list[PerformanceSample]:
515
513
  request = RpcRequest(method="getRecentPerformanceSamples").add(limit).build()
@@ -518,7 +516,7 @@ class HeliusClient:
518
516
  return ta.validate_python(response["result"])
519
517
 
520
518
  def get_recent_prioritization_fees(
521
- self,
519
+ self, *,
522
520
  locked_writable_accounts: list[str] | None = None,
523
521
  ) -> list[tuple[int, int]]:
524
522
  request = (
@@ -531,7 +529,7 @@ class HeliusClient:
531
529
 
532
530
  @validate_call
533
531
  def get_signatures_for_address(
534
- self,
532
+ self, *,
535
533
  address: str,
536
534
  limit: Annotated[int, Field(ge=1, le=1000)] = 1000,
537
535
  before: str | None = None,
@@ -555,7 +553,7 @@ class HeliusClient:
555
553
  return transaction_signatures
556
554
 
557
555
  def get_signature_statuses(
558
- self,
556
+ self, *,
559
557
  signatures: list[str],
560
558
  search_transaction_history: bool | None = None,
561
559
  ) -> tuple[dict, list[SignatureStatus | None]]:
@@ -574,7 +572,7 @@ class HeliusClient:
574
572
  return context, signature_statuses
575
573
 
576
574
  def get_slot(
577
- self,
575
+ self, *,
578
576
  commitment: Literal["finalized", "confirmed", "processed"] | None = None,
579
577
  min_context_slot: int | None = None,
580
578
  ) -> int:
@@ -588,7 +586,7 @@ class HeliusClient:
588
586
  return response["result"]
589
587
 
590
588
  def get_slot_leader(
591
- self,
589
+ self, *,
592
590
  commitment: Literal["finalized", "confirmed", "processed"] | None = None,
593
591
  min_context_slot: int | None = None,
594
592
  ) -> str:
@@ -603,7 +601,7 @@ class HeliusClient:
603
601
 
604
602
  @validate_call
605
603
  def get_slot_leaders(
606
- self,
604
+ self, *,
607
605
  start_slot: int,
608
606
  limit: Annotated[int, Field(ge=1, le=5000)],
609
607
  ) -> list[str]:
@@ -612,7 +610,7 @@ class HeliusClient:
612
610
  return response["result"]
613
611
 
614
612
  def get_stake_minimum_delegation(
615
- self,
613
+ self, *,
616
614
  commitment: Literal["finalized", "confirmed", "processed"] | None = None,
617
615
  ) -> tuple[dict, int]:
618
616
  request = (
@@ -626,7 +624,7 @@ class HeliusClient:
626
624
  return context, value
627
625
 
628
626
  def get_supply(
629
- self,
627
+ self, *,
630
628
  commitment: Literal["finalized", "confirmed", "processed"] | None = None,
631
629
  exclude_non_circulating_accounts_list: bool | None = None,
632
630
  ) -> tuple[dict, Supply]:
@@ -647,7 +645,7 @@ class HeliusClient:
647
645
  # TODO: use getProgramAccountsV2 which supports pagination
648
646
 
649
647
  def get_token_account_balance(
650
- self,
648
+ self, *,
651
649
  token_account: str,
652
650
  commitment: Literal["finalized", "confirmed", "processed"] | None = None,
653
651
  ) -> tuple[dict, TokenAccountBalance]:
@@ -663,7 +661,7 @@ class HeliusClient:
663
661
  return context, balance
664
662
 
665
663
  def get_token_accounts_by_delegate(
666
- self,
664
+ self, *,
667
665
  delegate_pub_key: str,
668
666
  mint: str | None = None,
669
667
  program_id: str | None = None,
@@ -712,7 +710,7 @@ class HeliusClient:
712
710
  return context, token_accounts
713
711
 
714
712
  def get_token_accounts_by_owner(
715
- self,
713
+ self, *,
716
714
  owner_pub_key: str,
717
715
  mint: str | None = None,
718
716
  program_id: str | None = None,
@@ -763,7 +761,7 @@ class HeliusClient:
763
761
  # TODO: use getTokenAccountsByOwnerV2 and do pagination
764
762
 
765
763
  def get_token_largest_accounts(
766
- self,
764
+ self, *,
767
765
  mint: str,
768
766
  commitment: Literal["finalized", "confirmed", "processed"] | None = None,
769
767
  ) -> tuple[dict, list[TokenAccount]]:
@@ -780,7 +778,7 @@ class HeliusClient:
780
778
  return context, largest_accounts
781
779
 
782
780
  def get_token_supply(
783
- self,
781
+ self, *,
784
782
  mint_address: str,
785
783
  commitment: Literal["finalized", "confirmed", "processed"] | None = None,
786
784
  ) -> tuple[dict, TokenSupply]:
@@ -796,7 +794,7 @@ class HeliusClient:
796
794
  return context, token_supply
797
795
 
798
796
  def get_transaction(
799
- self,
797
+ self, *,
800
798
  transaction_signature: str,
801
799
  commitment: Literal["finalized", "confirmed"] | None = None,
802
800
  encoding: Literal["json", "jsonParsed", "base58", "base64"] | None = None,
@@ -815,7 +813,7 @@ class HeliusClient:
815
813
  return transaction
816
814
 
817
815
  def get_transaction_count(
818
- self,
816
+ self, *,
819
817
  commitment: Literal["finalized", "confirmed", "processed"] | None = None,
820
818
  min_context_slot: int | None = None,
821
819
  ) -> int:
@@ -835,7 +833,7 @@ class HeliusClient:
835
833
  return result["solana-core"], result["feature-set"]
836
834
 
837
835
  def get_vote_accounts(
838
- self,
836
+ self, *,
839
837
  commitment: Literal["finalized", "confirmed", "processed"] | None = None,
840
838
  vote_pubkey: str | None = None,
841
839
  keep_unstaked_delinquents: bool | None = None,
@@ -856,7 +854,7 @@ class HeliusClient:
856
854
  return current, delinquent
857
855
 
858
856
  def is_blockhash_valid(
859
- self,
857
+ self, *,
860
858
  blockhash: str,
861
859
  commitment: Literal["finalized", "confirmed", "processed"] | None = None,
862
860
  min_context_slot: int | None = None,
@@ -874,7 +872,7 @@ class HeliusClient:
874
872
  return context, value
875
873
 
876
874
  def request_airdrop(
877
- self,
875
+ self, *,
878
876
  public_key: str,
879
877
  lamports: int,
880
878
  commitment: Literal["finalized", "confirmed", "processed"] | None = None,
File without changes
File without changes
File without changes
File without changes
File without changes