sol-parser-sdk-python 0.4.4__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.
Files changed (54) hide show
  1. sol_parser/__init__.py +400 -0
  2. sol_parser/account_dispatcher.py +209 -0
  3. sol_parser/account_fillers/__init__.py +5 -0
  4. sol_parser/account_fillers/bonk.py +30 -0
  5. sol_parser/account_fillers/meteora.py +51 -0
  6. sol_parser/account_fillers/orca.py +40 -0
  7. sol_parser/account_fillers/pumpfun.py +97 -0
  8. sol_parser/account_fillers/pumpswap.py +93 -0
  9. sol_parser/account_fillers/raydium.py +119 -0
  10. sol_parser/accounts/__init__.py +461 -0
  11. sol_parser/accounts/rpc_wallet.py +64 -0
  12. sol_parser/accounts/utils.py +71 -0
  13. sol_parser/check_migration.py +18 -0
  14. sol_parser/clock.py +10 -0
  15. sol_parser/common/__init__.py +27 -0
  16. sol_parser/dex_parsers.py +2576 -0
  17. sol_parser/entries_decode.py +186 -0
  18. sol_parser/env_config.py +215 -0
  19. sol_parser/event_types.py +1750 -0
  20. sol_parser/geyser_pb2.py +148 -0
  21. sol_parser/geyser_pb2_grpc.py +398 -0
  22. sol_parser/grpc/__init__.py +61 -0
  23. sol_parser/grpc/geyser_connect.py +42 -0
  24. sol_parser/grpc/subscribe_builder.py +133 -0
  25. sol_parser/grpc/transaction_meta.py +183 -0
  26. sol_parser/grpc_client.py +870 -0
  27. sol_parser/grpc_instruction_parser.py +318 -0
  28. sol_parser/grpc_types.py +919 -0
  29. sol_parser/inner_instruction_parser.py +281 -0
  30. sol_parser/instr/__init__.py +15 -0
  31. sol_parser/instr_account_utils.py +58 -0
  32. sol_parser/instructions.py +1026 -0
  33. sol_parser/json_util.py +41 -0
  34. sol_parser/log_instr_dedup.py +284 -0
  35. sol_parser/logs/__init__.py +15 -0
  36. sol_parser/merger.py +233 -0
  37. sol_parser/order_buffer.py +171 -0
  38. sol_parser/parser.py +300 -0
  39. sol_parser/pumpfun_fee_enrich.py +75 -0
  40. sol_parser/rpc_parser.py +655 -0
  41. sol_parser/rust_api_inventory.py +42 -0
  42. sol_parser/rust_event_json.py +50 -0
  43. sol_parser/shredstream_client.py +191 -0
  44. sol_parser/shredstream_pb2.py +40 -0
  45. sol_parser/shredstream_pb2_grpc.py +81 -0
  46. sol_parser/shredstream_pumpfun.py +296 -0
  47. sol_parser/solana_storage_pb2.py +75 -0
  48. sol_parser/solana_storage_pb2_grpc.py +24 -0
  49. sol_parser/u128_parity.py +115 -0
  50. sol_parser/verify_discriminators.py +85 -0
  51. sol_parser_sdk_python-0.4.4.dist-info/METADATA +14 -0
  52. sol_parser_sdk_python-0.4.4.dist-info/RECORD +54 -0
  53. sol_parser_sdk_python-0.4.4.dist-info/WHEEL +4 -0
  54. sol_parser_sdk_python-0.4.4.dist-info/entry_points.txt +4 -0
@@ -0,0 +1,148 @@
1
+ # -*- coding: utf-8 -*-
2
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
3
+ # NO CHECKED-IN PROTOBUF GENCODE
4
+ # source: geyser.proto
5
+ # Protobuf Python Version: 6.31.0
6
+ """Generated protocol buffer code."""
7
+ from google.protobuf import descriptor as _descriptor
8
+ from google.protobuf import descriptor_pool as _descriptor_pool
9
+ from google.protobuf import runtime_version as _runtime_version
10
+ from google.protobuf import symbol_database as _symbol_database
11
+ from google.protobuf.internal import builder as _builder
12
+ _runtime_version.ValidateProtobufRuntimeVersion(
13
+ _runtime_version.Domain.PUBLIC,
14
+ 6,
15
+ 31,
16
+ 0,
17
+ '',
18
+ 'geyser.proto'
19
+ )
20
+ # @@protoc_insertion_point(imports)
21
+
22
+ _sym_db = _symbol_database.Default()
23
+
24
+
25
+ from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2
26
+ from . import solana_storage_pb2 as solana__storage__pb2
27
+
28
+ from .solana_storage_pb2 import *
29
+
30
+ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0cgeyser.proto\x12\x06geyser\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x14solana-storage.proto\"\x9c\n\n\x10SubscribeRequest\x12\x38\n\x08\x61\x63\x63ounts\x18\x01 \x03(\x0b\x32&.geyser.SubscribeRequest.AccountsEntry\x12\x32\n\x05slots\x18\x02 \x03(\x0b\x32#.geyser.SubscribeRequest.SlotsEntry\x12@\n\x0ctransactions\x18\x03 \x03(\x0b\x32*.geyser.SubscribeRequest.TransactionsEntry\x12M\n\x13transactions_status\x18\n \x03(\x0b\x32\x30.geyser.SubscribeRequest.TransactionsStatusEntry\x12\x34\n\x06\x62locks\x18\x04 \x03(\x0b\x32$.geyser.SubscribeRequest.BlocksEntry\x12=\n\x0b\x62locks_meta\x18\x05 \x03(\x0b\x32(.geyser.SubscribeRequest.BlocksMetaEntry\x12\x32\n\x05\x65ntry\x18\x08 \x03(\x0b\x32#.geyser.SubscribeRequest.EntryEntry\x12\x30\n\ncommitment\x18\x06 \x01(\x0e\x32\x17.geyser.CommitmentLevelH\x00\x88\x01\x01\x12\x46\n\x13\x61\x63\x63ounts_data_slice\x18\x07 \x03(\x0b\x32).geyser.SubscribeRequestAccountsDataSlice\x12/\n\x04ping\x18\t \x01(\x0b\x32\x1c.geyser.SubscribeRequestPingH\x01\x88\x01\x01\x12\x16\n\tfrom_slot\x18\x0b \x01(\x04H\x02\x88\x01\x01\x1aW\n\rAccountsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x35\n\x05value\x18\x02 \x01(\x0b\x32&.geyser.SubscribeRequestFilterAccounts:\x02\x38\x01\x1aQ\n\nSlotsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x32\n\x05value\x18\x02 \x01(\x0b\x32#.geyser.SubscribeRequestFilterSlots:\x02\x38\x01\x1a_\n\x11TransactionsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x39\n\x05value\x18\x02 \x01(\x0b\x32*.geyser.SubscribeRequestFilterTransactions:\x02\x38\x01\x1a\x65\n\x17TransactionsStatusEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x39\n\x05value\x18\x02 \x01(\x0b\x32*.geyser.SubscribeRequestFilterTransactions:\x02\x38\x01\x1aS\n\x0b\x42locksEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x33\n\x05value\x18\x02 \x01(\x0b\x32$.geyser.SubscribeRequestFilterBlocks:\x02\x38\x01\x1a[\n\x0f\x42locksMetaEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x37\n\x05value\x18\x02 \x01(\x0b\x32(.geyser.SubscribeRequestFilterBlocksMeta:\x02\x38\x01\x1aQ\n\nEntryEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x32\n\x05value\x18\x02 \x01(\x0b\x32#.geyser.SubscribeRequestFilterEntry:\x02\x38\x01\x42\r\n\x0b_commitmentB\x07\n\x05_pingB\x0c\n\n_from_slot\"\xbf\x01\n\x1eSubscribeRequestFilterAccounts\x12\x0f\n\x07\x61\x63\x63ount\x18\x02 \x03(\t\x12\r\n\x05owner\x18\x03 \x03(\t\x12=\n\x07\x66ilters\x18\x04 \x03(\x0b\x32,.geyser.SubscribeRequestFilterAccountsFilter\x12#\n\x16nonempty_txn_signature\x18\x05 \x01(\x08H\x00\x88\x01\x01\x42\x19\n\x17_nonempty_txn_signature\"\xf3\x01\n$SubscribeRequestFilterAccountsFilter\x12\x44\n\x06memcmp\x18\x01 \x01(\x0b\x32\x32.geyser.SubscribeRequestFilterAccountsFilterMemcmpH\x00\x12\x12\n\x08\x64\x61tasize\x18\x02 \x01(\x04H\x00\x12\x1d\n\x13token_account_state\x18\x03 \x01(\x08H\x00\x12H\n\x08lamports\x18\x04 \x01(\x0b\x32\x34.geyser.SubscribeRequestFilterAccountsFilterLamportsH\x00\x42\x08\n\x06\x66ilter\"y\n*SubscribeRequestFilterAccountsFilterMemcmp\x12\x0e\n\x06offset\x18\x01 \x01(\x04\x12\x0f\n\x05\x62ytes\x18\x02 \x01(\x0cH\x00\x12\x10\n\x06\x62\x61se58\x18\x03 \x01(\tH\x00\x12\x10\n\x06\x62\x61se64\x18\x04 \x01(\tH\x00\x42\x06\n\x04\x64\x61ta\"m\n,SubscribeRequestFilterAccountsFilterLamports\x12\x0c\n\x02\x65q\x18\x01 \x01(\x04H\x00\x12\x0c\n\x02ne\x18\x02 \x01(\x04H\x00\x12\x0c\n\x02lt\x18\x03 \x01(\x04H\x00\x12\x0c\n\x02gt\x18\x04 \x01(\x04H\x00\x42\x05\n\x03\x63mp\"\x8f\x01\n\x1bSubscribeRequestFilterSlots\x12!\n\x14\x66ilter_by_commitment\x18\x01 \x01(\x08H\x00\x88\x01\x01\x12\x1e\n\x11interslot_updates\x18\x02 \x01(\x08H\x01\x88\x01\x01\x42\x17\n\x15_filter_by_commitmentB\x14\n\x12_interslot_updates\"\xd2\x01\n\"SubscribeRequestFilterTransactions\x12\x11\n\x04vote\x18\x01 \x01(\x08H\x00\x88\x01\x01\x12\x13\n\x06\x66\x61iled\x18\x02 \x01(\x08H\x01\x88\x01\x01\x12\x16\n\tsignature\x18\x05 \x01(\tH\x02\x88\x01\x01\x12\x17\n\x0f\x61\x63\x63ount_include\x18\x03 \x03(\t\x12\x17\n\x0f\x61\x63\x63ount_exclude\x18\x04 \x03(\t\x12\x18\n\x10\x61\x63\x63ount_required\x18\x06 \x03(\tB\x07\n\x05_voteB\t\n\x07_failedB\x0c\n\n_signature\"\xd9\x01\n\x1cSubscribeRequestFilterBlocks\x12\x17\n\x0f\x61\x63\x63ount_include\x18\x01 \x03(\t\x12!\n\x14include_transactions\x18\x02 \x01(\x08H\x00\x88\x01\x01\x12\x1d\n\x10include_accounts\x18\x03 \x01(\x08H\x01\x88\x01\x01\x12\x1c\n\x0finclude_entries\x18\x04 \x01(\x08H\x02\x88\x01\x01\x42\x17\n\x15_include_transactionsB\x13\n\x11_include_accountsB\x12\n\x10_include_entries\"\"\n SubscribeRequestFilterBlocksMeta\"\x1d\n\x1bSubscribeRequestFilterEntry\"C\n!SubscribeRequestAccountsDataSlice\x12\x0e\n\x06offset\x18\x01 \x01(\x04\x12\x0e\n\x06length\x18\x02 \x01(\x04\"\"\n\x14SubscribeRequestPing\x12\n\n\x02id\x18\x01 \x01(\x05\"\xb5\x04\n\x0fSubscribeUpdate\x12\x0f\n\x07\x66ilters\x18\x01 \x03(\t\x12\x31\n\x07\x61\x63\x63ount\x18\x02 \x01(\x0b\x32\x1e.geyser.SubscribeUpdateAccountH\x00\x12+\n\x04slot\x18\x03 \x01(\x0b\x32\x1b.geyser.SubscribeUpdateSlotH\x00\x12\x39\n\x0btransaction\x18\x04 \x01(\x0b\x32\".geyser.SubscribeUpdateTransactionH\x00\x12\x46\n\x12transaction_status\x18\n \x01(\x0b\x32(.geyser.SubscribeUpdateTransactionStatusH\x00\x12-\n\x05\x62lock\x18\x05 \x01(\x0b\x32\x1c.geyser.SubscribeUpdateBlockH\x00\x12+\n\x04ping\x18\x06 \x01(\x0b\x32\x1b.geyser.SubscribeUpdatePingH\x00\x12+\n\x04pong\x18\t \x01(\x0b\x32\x1b.geyser.SubscribeUpdatePongH\x00\x12\x36\n\nblock_meta\x18\x07 \x01(\x0b\x32 .geyser.SubscribeUpdateBlockMetaH\x00\x12-\n\x05\x65ntry\x18\x08 \x01(\x0b\x32\x1c.geyser.SubscribeUpdateEntryH\x00\x12.\n\ncreated_at\x18\x0b \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x0e\n\x0cupdate_oneof\"o\n\x16SubscribeUpdateAccount\x12\x33\n\x07\x61\x63\x63ount\x18\x01 \x01(\x0b\x32\".geyser.SubscribeUpdateAccountInfo\x12\x0c\n\x04slot\x18\x02 \x01(\x04\x12\x12\n\nis_startup\x18\x03 \x01(\x08\"\xc8\x01\n\x1aSubscribeUpdateAccountInfo\x12\x0e\n\x06pubkey\x18\x01 \x01(\x0c\x12\x10\n\x08lamports\x18\x02 \x01(\x04\x12\r\n\x05owner\x18\x03 \x01(\x0c\x12\x12\n\nexecutable\x18\x04 \x01(\x08\x12\x12\n\nrent_epoch\x18\x05 \x01(\x04\x12\x0c\n\x04\x64\x61ta\x18\x06 \x01(\x0c\x12\x15\n\rwrite_version\x18\x07 \x01(\x04\x12\x1a\n\rtxn_signature\x18\x08 \x01(\x0cH\x00\x88\x01\x01\x42\x10\n\x0e_txn_signature\"\x8f\x01\n\x13SubscribeUpdateSlot\x12\x0c\n\x04slot\x18\x01 \x01(\x04\x12\x13\n\x06parent\x18\x02 \x01(\x04H\x00\x88\x01\x01\x12\"\n\x06status\x18\x03 \x01(\x0e\x32\x12.geyser.SlotStatus\x12\x17\n\ndead_error\x18\x04 \x01(\tH\x01\x88\x01\x01\x42\t\n\x07_parentB\r\n\x0b_dead_error\"g\n\x1aSubscribeUpdateTransaction\x12;\n\x0btransaction\x18\x01 \x01(\x0b\x32&.geyser.SubscribeUpdateTransactionInfo\x12\x0c\n\x04slot\x18\x02 \x01(\x04\"\xd8\x01\n\x1eSubscribeUpdateTransactionInfo\x12\x11\n\tsignature\x18\x01 \x01(\x0c\x12\x0f\n\x07is_vote\x18\x02 \x01(\x08\x12?\n\x0btransaction\x18\x03 \x01(\x0b\x32*.solana.storage.ConfirmedBlock.Transaction\x12\x42\n\x04meta\x18\x04 \x01(\x0b\x32\x34.solana.storage.ConfirmedBlock.TransactionStatusMeta\x12\r\n\x05index\x18\x05 \x01(\x04\"\xa1\x01\n SubscribeUpdateTransactionStatus\x12\x0c\n\x04slot\x18\x01 \x01(\x04\x12\x11\n\tsignature\x18\x02 \x01(\x0c\x12\x0f\n\x07is_vote\x18\x03 \x01(\x08\x12\r\n\x05index\x18\x04 \x01(\x04\x12<\n\x03\x65rr\x18\x05 \x01(\x0b\x32/.solana.storage.ConfirmedBlock.TransactionError\"\xa0\x04\n\x14SubscribeUpdateBlock\x12\x0c\n\x04slot\x18\x01 \x01(\x04\x12\x11\n\tblockhash\x18\x02 \x01(\t\x12\x37\n\x07rewards\x18\x03 \x01(\x0b\x32&.solana.storage.ConfirmedBlock.Rewards\x12@\n\nblock_time\x18\x04 \x01(\x0b\x32,.solana.storage.ConfirmedBlock.UnixTimestamp\x12@\n\x0c\x62lock_height\x18\x05 \x01(\x0b\x32*.solana.storage.ConfirmedBlock.BlockHeight\x12\x13\n\x0bparent_slot\x18\x07 \x01(\x04\x12\x18\n\x10parent_blockhash\x18\x08 \x01(\t\x12\"\n\x1a\x65xecuted_transaction_count\x18\t \x01(\x04\x12<\n\x0ctransactions\x18\x06 \x03(\x0b\x32&.geyser.SubscribeUpdateTransactionInfo\x12\x1d\n\x15updated_account_count\x18\n \x01(\x04\x12\x34\n\x08\x61\x63\x63ounts\x18\x0b \x03(\x0b\x32\".geyser.SubscribeUpdateAccountInfo\x12\x15\n\rentries_count\x18\x0c \x01(\x04\x12-\n\x07\x65ntries\x18\r \x03(\x0b\x32\x1c.geyser.SubscribeUpdateEntry\"\xe2\x02\n\x18SubscribeUpdateBlockMeta\x12\x0c\n\x04slot\x18\x01 \x01(\x04\x12\x11\n\tblockhash\x18\x02 \x01(\t\x12\x37\n\x07rewards\x18\x03 \x01(\x0b\x32&.solana.storage.ConfirmedBlock.Rewards\x12@\n\nblock_time\x18\x04 \x01(\x0b\x32,.solana.storage.ConfirmedBlock.UnixTimestamp\x12@\n\x0c\x62lock_height\x18\x05 \x01(\x0b\x32*.solana.storage.ConfirmedBlock.BlockHeight\x12\x13\n\x0bparent_slot\x18\x06 \x01(\x04\x12\x18\n\x10parent_blockhash\x18\x07 \x01(\t\x12\"\n\x1a\x65xecuted_transaction_count\x18\x08 \x01(\x04\x12\x15\n\rentries_count\x18\t \x01(\x04\"\x9d\x01\n\x14SubscribeUpdateEntry\x12\x0c\n\x04slot\x18\x01 \x01(\x04\x12\r\n\x05index\x18\x02 \x01(\x04\x12\x12\n\nnum_hashes\x18\x03 \x01(\x04\x12\x0c\n\x04hash\x18\x04 \x01(\x0c\x12\"\n\x1a\x65xecuted_transaction_count\x18\x05 \x01(\x04\x12\"\n\x1astarting_transaction_index\x18\x06 \x01(\x04\"\x15\n\x13SubscribeUpdatePing\"!\n\x13SubscribeUpdatePong\x12\n\n\x02id\x18\x01 \x01(\x05\"\x1c\n\x1aSubscribeReplayInfoRequest\"O\n\x1bSubscribeReplayInfoResponse\x12\x1c\n\x0f\x66irst_available\x18\x01 \x01(\x04H\x00\x88\x01\x01\x42\x12\n\x10_first_available\"\x1c\n\x0bPingRequest\x12\r\n\x05\x63ount\x18\x01 \x01(\x05\"\x1d\n\x0cPongResponse\x12\r\n\x05\x63ount\x18\x01 \x01(\x05\"\\\n\x19GetLatestBlockhashRequest\x12\x30\n\ncommitment\x18\x01 \x01(\x0e\x32\x17.geyser.CommitmentLevelH\x00\x88\x01\x01\x42\r\n\x0b_commitment\"^\n\x1aGetLatestBlockhashResponse\x12\x0c\n\x04slot\x18\x01 \x01(\x04\x12\x11\n\tblockhash\x18\x02 \x01(\t\x12\x1f\n\x17last_valid_block_height\x18\x03 \x01(\x04\"X\n\x15GetBlockHeightRequest\x12\x30\n\ncommitment\x18\x01 \x01(\x0e\x32\x17.geyser.CommitmentLevelH\x00\x88\x01\x01\x42\r\n\x0b_commitment\".\n\x16GetBlockHeightResponse\x12\x14\n\x0c\x62lock_height\x18\x01 \x01(\x04\"Q\n\x0eGetSlotRequest\x12\x30\n\ncommitment\x18\x01 \x01(\x0e\x32\x17.geyser.CommitmentLevelH\x00\x88\x01\x01\x42\r\n\x0b_commitment\"\x1f\n\x0fGetSlotResponse\x12\x0c\n\x04slot\x18\x01 \x01(\x04\"\x13\n\x11GetVersionRequest\"%\n\x12GetVersionResponse\x12\x0f\n\x07version\x18\x01 \x01(\t\"m\n\x17IsBlockhashValidRequest\x12\x11\n\tblockhash\x18\x01 \x01(\t\x12\x30\n\ncommitment\x18\x02 \x01(\x0e\x32\x17.geyser.CommitmentLevelH\x00\x88\x01\x01\x42\r\n\x0b_commitment\"7\n\x18IsBlockhashValidResponse\x12\x0c\n\x04slot\x18\x01 \x01(\x04\x12\r\n\x05valid\x18\x02 \x01(\x08*>\n\x0f\x43ommitmentLevel\x12\r\n\tPROCESSED\x10\x00\x12\r\n\tCONFIRMED\x10\x01\x12\r\n\tFINALIZED\x10\x02*\xa1\x01\n\nSlotStatus\x12\x12\n\x0eSLOT_PROCESSED\x10\x00\x12\x12\n\x0eSLOT_CONFIRMED\x10\x01\x12\x12\n\x0eSLOT_FINALIZED\x10\x02\x12\x1d\n\x19SLOT_FIRST_SHRED_RECEIVED\x10\x03\x12\x12\n\x0eSLOT_COMPLETED\x10\x04\x12\x15\n\x11SLOT_CREATED_BANK\x10\x05\x12\r\n\tSLOT_DEAD\x10\x06\x32\xf5\x04\n\x06Geyser\x12\x44\n\tSubscribe\x12\x18.geyser.SubscribeRequest\x1a\x17.geyser.SubscribeUpdate\"\x00(\x01\x30\x01\x12`\n\x13SubscribeReplayInfo\x12\".geyser.SubscribeReplayInfoRequest\x1a#.geyser.SubscribeReplayInfoResponse\"\x00\x12\x33\n\x04Ping\x12\x13.geyser.PingRequest\x1a\x14.geyser.PongResponse\"\x00\x12]\n\x12GetLatestBlockhash\x12!.geyser.GetLatestBlockhashRequest\x1a\".geyser.GetLatestBlockhashResponse\"\x00\x12Q\n\x0eGetBlockHeight\x12\x1d.geyser.GetBlockHeightRequest\x1a\x1e.geyser.GetBlockHeightResponse\"\x00\x12<\n\x07GetSlot\x12\x16.geyser.GetSlotRequest\x1a\x17.geyser.GetSlotResponse\"\x00\x12W\n\x10IsBlockhashValid\x12\x1f.geyser.IsBlockhashValidRequest\x1a .geyser.IsBlockhashValidResponse\"\x00\x12\x45\n\nGetVersion\x12\x19.geyser.GetVersionRequest\x1a\x1a.geyser.GetVersionResponse\"\x00\x42;Z9github.com/rpcpool/yellowstone-grpc/examples/golang/protoP\x01\x62\x06proto3')
31
+
32
+ _globals = globals()
33
+ _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
34
+ _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'geyser_pb2', _globals)
35
+ if not _descriptor._USE_C_DESCRIPTORS:
36
+ _globals['DESCRIPTOR']._loaded_options = None
37
+ _globals['DESCRIPTOR']._serialized_options = b'Z9github.com/rpcpool/yellowstone-grpc/examples/golang/proto'
38
+ _globals['_SUBSCRIBEREQUEST_ACCOUNTSENTRY']._loaded_options = None
39
+ _globals['_SUBSCRIBEREQUEST_ACCOUNTSENTRY']._serialized_options = b'8\001'
40
+ _globals['_SUBSCRIBEREQUEST_SLOTSENTRY']._loaded_options = None
41
+ _globals['_SUBSCRIBEREQUEST_SLOTSENTRY']._serialized_options = b'8\001'
42
+ _globals['_SUBSCRIBEREQUEST_TRANSACTIONSENTRY']._loaded_options = None
43
+ _globals['_SUBSCRIBEREQUEST_TRANSACTIONSENTRY']._serialized_options = b'8\001'
44
+ _globals['_SUBSCRIBEREQUEST_TRANSACTIONSSTATUSENTRY']._loaded_options = None
45
+ _globals['_SUBSCRIBEREQUEST_TRANSACTIONSSTATUSENTRY']._serialized_options = b'8\001'
46
+ _globals['_SUBSCRIBEREQUEST_BLOCKSENTRY']._loaded_options = None
47
+ _globals['_SUBSCRIBEREQUEST_BLOCKSENTRY']._serialized_options = b'8\001'
48
+ _globals['_SUBSCRIBEREQUEST_BLOCKSMETAENTRY']._loaded_options = None
49
+ _globals['_SUBSCRIBEREQUEST_BLOCKSMETAENTRY']._serialized_options = b'8\001'
50
+ _globals['_SUBSCRIBEREQUEST_ENTRYENTRY']._loaded_options = None
51
+ _globals['_SUBSCRIBEREQUEST_ENTRYENTRY']._serialized_options = b'8\001'
52
+ _globals['_COMMITMENTLEVEL']._serialized_start=6299
53
+ _globals['_COMMITMENTLEVEL']._serialized_end=6361
54
+ _globals['_SLOTSTATUS']._serialized_start=6364
55
+ _globals['_SLOTSTATUS']._serialized_end=6525
56
+ _globals['_SUBSCRIBEREQUEST']._serialized_start=80
57
+ _globals['_SUBSCRIBEREQUEST']._serialized_end=1388
58
+ _globals['_SUBSCRIBEREQUEST_ACCOUNTSENTRY']._serialized_start=719
59
+ _globals['_SUBSCRIBEREQUEST_ACCOUNTSENTRY']._serialized_end=806
60
+ _globals['_SUBSCRIBEREQUEST_SLOTSENTRY']._serialized_start=808
61
+ _globals['_SUBSCRIBEREQUEST_SLOTSENTRY']._serialized_end=889
62
+ _globals['_SUBSCRIBEREQUEST_TRANSACTIONSENTRY']._serialized_start=891
63
+ _globals['_SUBSCRIBEREQUEST_TRANSACTIONSENTRY']._serialized_end=986
64
+ _globals['_SUBSCRIBEREQUEST_TRANSACTIONSSTATUSENTRY']._serialized_start=988
65
+ _globals['_SUBSCRIBEREQUEST_TRANSACTIONSSTATUSENTRY']._serialized_end=1089
66
+ _globals['_SUBSCRIBEREQUEST_BLOCKSENTRY']._serialized_start=1091
67
+ _globals['_SUBSCRIBEREQUEST_BLOCKSENTRY']._serialized_end=1174
68
+ _globals['_SUBSCRIBEREQUEST_BLOCKSMETAENTRY']._serialized_start=1176
69
+ _globals['_SUBSCRIBEREQUEST_BLOCKSMETAENTRY']._serialized_end=1267
70
+ _globals['_SUBSCRIBEREQUEST_ENTRYENTRY']._serialized_start=1269
71
+ _globals['_SUBSCRIBEREQUEST_ENTRYENTRY']._serialized_end=1350
72
+ _globals['_SUBSCRIBEREQUESTFILTERACCOUNTS']._serialized_start=1391
73
+ _globals['_SUBSCRIBEREQUESTFILTERACCOUNTS']._serialized_end=1582
74
+ _globals['_SUBSCRIBEREQUESTFILTERACCOUNTSFILTER']._serialized_start=1585
75
+ _globals['_SUBSCRIBEREQUESTFILTERACCOUNTSFILTER']._serialized_end=1828
76
+ _globals['_SUBSCRIBEREQUESTFILTERACCOUNTSFILTERMEMCMP']._serialized_start=1830
77
+ _globals['_SUBSCRIBEREQUESTFILTERACCOUNTSFILTERMEMCMP']._serialized_end=1951
78
+ _globals['_SUBSCRIBEREQUESTFILTERACCOUNTSFILTERLAMPORTS']._serialized_start=1953
79
+ _globals['_SUBSCRIBEREQUESTFILTERACCOUNTSFILTERLAMPORTS']._serialized_end=2062
80
+ _globals['_SUBSCRIBEREQUESTFILTERSLOTS']._serialized_start=2065
81
+ _globals['_SUBSCRIBEREQUESTFILTERSLOTS']._serialized_end=2208
82
+ _globals['_SUBSCRIBEREQUESTFILTERTRANSACTIONS']._serialized_start=2211
83
+ _globals['_SUBSCRIBEREQUESTFILTERTRANSACTIONS']._serialized_end=2421
84
+ _globals['_SUBSCRIBEREQUESTFILTERBLOCKS']._serialized_start=2424
85
+ _globals['_SUBSCRIBEREQUESTFILTERBLOCKS']._serialized_end=2641
86
+ _globals['_SUBSCRIBEREQUESTFILTERBLOCKSMETA']._serialized_start=2643
87
+ _globals['_SUBSCRIBEREQUESTFILTERBLOCKSMETA']._serialized_end=2677
88
+ _globals['_SUBSCRIBEREQUESTFILTERENTRY']._serialized_start=2679
89
+ _globals['_SUBSCRIBEREQUESTFILTERENTRY']._serialized_end=2708
90
+ _globals['_SUBSCRIBEREQUESTACCOUNTSDATASLICE']._serialized_start=2710
91
+ _globals['_SUBSCRIBEREQUESTACCOUNTSDATASLICE']._serialized_end=2777
92
+ _globals['_SUBSCRIBEREQUESTPING']._serialized_start=2779
93
+ _globals['_SUBSCRIBEREQUESTPING']._serialized_end=2813
94
+ _globals['_SUBSCRIBEUPDATE']._serialized_start=2816
95
+ _globals['_SUBSCRIBEUPDATE']._serialized_end=3381
96
+ _globals['_SUBSCRIBEUPDATEACCOUNT']._serialized_start=3383
97
+ _globals['_SUBSCRIBEUPDATEACCOUNT']._serialized_end=3494
98
+ _globals['_SUBSCRIBEUPDATEACCOUNTINFO']._serialized_start=3497
99
+ _globals['_SUBSCRIBEUPDATEACCOUNTINFO']._serialized_end=3697
100
+ _globals['_SUBSCRIBEUPDATESLOT']._serialized_start=3700
101
+ _globals['_SUBSCRIBEUPDATESLOT']._serialized_end=3843
102
+ _globals['_SUBSCRIBEUPDATETRANSACTION']._serialized_start=3845
103
+ _globals['_SUBSCRIBEUPDATETRANSACTION']._serialized_end=3948
104
+ _globals['_SUBSCRIBEUPDATETRANSACTIONINFO']._serialized_start=3951
105
+ _globals['_SUBSCRIBEUPDATETRANSACTIONINFO']._serialized_end=4167
106
+ _globals['_SUBSCRIBEUPDATETRANSACTIONSTATUS']._serialized_start=4170
107
+ _globals['_SUBSCRIBEUPDATETRANSACTIONSTATUS']._serialized_end=4331
108
+ _globals['_SUBSCRIBEUPDATEBLOCK']._serialized_start=4334
109
+ _globals['_SUBSCRIBEUPDATEBLOCK']._serialized_end=4878
110
+ _globals['_SUBSCRIBEUPDATEBLOCKMETA']._serialized_start=4881
111
+ _globals['_SUBSCRIBEUPDATEBLOCKMETA']._serialized_end=5235
112
+ _globals['_SUBSCRIBEUPDATEENTRY']._serialized_start=5238
113
+ _globals['_SUBSCRIBEUPDATEENTRY']._serialized_end=5395
114
+ _globals['_SUBSCRIBEUPDATEPING']._serialized_start=5397
115
+ _globals['_SUBSCRIBEUPDATEPING']._serialized_end=5418
116
+ _globals['_SUBSCRIBEUPDATEPONG']._serialized_start=5420
117
+ _globals['_SUBSCRIBEUPDATEPONG']._serialized_end=5453
118
+ _globals['_SUBSCRIBEREPLAYINFOREQUEST']._serialized_start=5455
119
+ _globals['_SUBSCRIBEREPLAYINFOREQUEST']._serialized_end=5483
120
+ _globals['_SUBSCRIBEREPLAYINFORESPONSE']._serialized_start=5485
121
+ _globals['_SUBSCRIBEREPLAYINFORESPONSE']._serialized_end=5564
122
+ _globals['_PINGREQUEST']._serialized_start=5566
123
+ _globals['_PINGREQUEST']._serialized_end=5594
124
+ _globals['_PONGRESPONSE']._serialized_start=5596
125
+ _globals['_PONGRESPONSE']._serialized_end=5625
126
+ _globals['_GETLATESTBLOCKHASHREQUEST']._serialized_start=5627
127
+ _globals['_GETLATESTBLOCKHASHREQUEST']._serialized_end=5719
128
+ _globals['_GETLATESTBLOCKHASHRESPONSE']._serialized_start=5721
129
+ _globals['_GETLATESTBLOCKHASHRESPONSE']._serialized_end=5815
130
+ _globals['_GETBLOCKHEIGHTREQUEST']._serialized_start=5817
131
+ _globals['_GETBLOCKHEIGHTREQUEST']._serialized_end=5905
132
+ _globals['_GETBLOCKHEIGHTRESPONSE']._serialized_start=5907
133
+ _globals['_GETBLOCKHEIGHTRESPONSE']._serialized_end=5953
134
+ _globals['_GETSLOTREQUEST']._serialized_start=5955
135
+ _globals['_GETSLOTREQUEST']._serialized_end=6036
136
+ _globals['_GETSLOTRESPONSE']._serialized_start=6038
137
+ _globals['_GETSLOTRESPONSE']._serialized_end=6069
138
+ _globals['_GETVERSIONREQUEST']._serialized_start=6071
139
+ _globals['_GETVERSIONREQUEST']._serialized_end=6090
140
+ _globals['_GETVERSIONRESPONSE']._serialized_start=6092
141
+ _globals['_GETVERSIONRESPONSE']._serialized_end=6129
142
+ _globals['_ISBLOCKHASHVALIDREQUEST']._serialized_start=6131
143
+ _globals['_ISBLOCKHASHVALIDREQUEST']._serialized_end=6240
144
+ _globals['_ISBLOCKHASHVALIDRESPONSE']._serialized_start=6242
145
+ _globals['_ISBLOCKHASHVALIDRESPONSE']._serialized_end=6297
146
+ _globals['_GEYSER']._serialized_start=6528
147
+ _globals['_GEYSER']._serialized_end=7157
148
+ # @@protoc_insertion_point(module_scope)
@@ -0,0 +1,398 @@
1
+ # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
2
+ """Client and server classes corresponding to protobuf-defined services."""
3
+ import grpc
4
+ import warnings
5
+
6
+ from . import geyser_pb2 as geyser__pb2
7
+
8
+ GRPC_GENERATED_VERSION = '1.73.1'
9
+ GRPC_VERSION = grpc.__version__
10
+ _version_not_supported = False
11
+
12
+ try:
13
+ from grpc._utilities import first_version_is_lower
14
+ _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION)
15
+ except ImportError:
16
+ _version_not_supported = True
17
+
18
+ if _version_not_supported:
19
+ raise RuntimeError(
20
+ f'The grpc package installed is at version {GRPC_VERSION},'
21
+ + f' but the generated code in geyser_pb2_grpc.py depends on'
22
+ + f' grpcio>={GRPC_GENERATED_VERSION}.'
23
+ + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}'
24
+ + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.'
25
+ )
26
+
27
+
28
+ class GeyserStub(object):
29
+ """Missing associated documentation comment in .proto file."""
30
+
31
+ def __init__(self, channel):
32
+ """Constructor.
33
+
34
+ Args:
35
+ channel: A grpc.Channel.
36
+ """
37
+ self.Subscribe = channel.stream_stream(
38
+ '/geyser.Geyser/Subscribe',
39
+ request_serializer=geyser__pb2.SubscribeRequest.SerializeToString,
40
+ response_deserializer=geyser__pb2.SubscribeUpdate.FromString,
41
+ _registered_method=True)
42
+ self.SubscribeReplayInfo = channel.unary_unary(
43
+ '/geyser.Geyser/SubscribeReplayInfo',
44
+ request_serializer=geyser__pb2.SubscribeReplayInfoRequest.SerializeToString,
45
+ response_deserializer=geyser__pb2.SubscribeReplayInfoResponse.FromString,
46
+ _registered_method=True)
47
+ self.Ping = channel.unary_unary(
48
+ '/geyser.Geyser/Ping',
49
+ request_serializer=geyser__pb2.PingRequest.SerializeToString,
50
+ response_deserializer=geyser__pb2.PongResponse.FromString,
51
+ _registered_method=True)
52
+ self.GetLatestBlockhash = channel.unary_unary(
53
+ '/geyser.Geyser/GetLatestBlockhash',
54
+ request_serializer=geyser__pb2.GetLatestBlockhashRequest.SerializeToString,
55
+ response_deserializer=geyser__pb2.GetLatestBlockhashResponse.FromString,
56
+ _registered_method=True)
57
+ self.GetBlockHeight = channel.unary_unary(
58
+ '/geyser.Geyser/GetBlockHeight',
59
+ request_serializer=geyser__pb2.GetBlockHeightRequest.SerializeToString,
60
+ response_deserializer=geyser__pb2.GetBlockHeightResponse.FromString,
61
+ _registered_method=True)
62
+ self.GetSlot = channel.unary_unary(
63
+ '/geyser.Geyser/GetSlot',
64
+ request_serializer=geyser__pb2.GetSlotRequest.SerializeToString,
65
+ response_deserializer=geyser__pb2.GetSlotResponse.FromString,
66
+ _registered_method=True)
67
+ self.IsBlockhashValid = channel.unary_unary(
68
+ '/geyser.Geyser/IsBlockhashValid',
69
+ request_serializer=geyser__pb2.IsBlockhashValidRequest.SerializeToString,
70
+ response_deserializer=geyser__pb2.IsBlockhashValidResponse.FromString,
71
+ _registered_method=True)
72
+ self.GetVersion = channel.unary_unary(
73
+ '/geyser.Geyser/GetVersion',
74
+ request_serializer=geyser__pb2.GetVersionRequest.SerializeToString,
75
+ response_deserializer=geyser__pb2.GetVersionResponse.FromString,
76
+ _registered_method=True)
77
+
78
+
79
+ class GeyserServicer(object):
80
+ """Missing associated documentation comment in .proto file."""
81
+
82
+ def Subscribe(self, request_iterator, context):
83
+ """Missing associated documentation comment in .proto file."""
84
+ context.set_code(grpc.StatusCode.UNIMPLEMENTED)
85
+ context.set_details('Method not implemented!')
86
+ raise NotImplementedError('Method not implemented!')
87
+
88
+ def SubscribeReplayInfo(self, request, context):
89
+ """Missing associated documentation comment in .proto file."""
90
+ context.set_code(grpc.StatusCode.UNIMPLEMENTED)
91
+ context.set_details('Method not implemented!')
92
+ raise NotImplementedError('Method not implemented!')
93
+
94
+ def Ping(self, request, context):
95
+ """Missing associated documentation comment in .proto file."""
96
+ context.set_code(grpc.StatusCode.UNIMPLEMENTED)
97
+ context.set_details('Method not implemented!')
98
+ raise NotImplementedError('Method not implemented!')
99
+
100
+ def GetLatestBlockhash(self, request, context):
101
+ """Missing associated documentation comment in .proto file."""
102
+ context.set_code(grpc.StatusCode.UNIMPLEMENTED)
103
+ context.set_details('Method not implemented!')
104
+ raise NotImplementedError('Method not implemented!')
105
+
106
+ def GetBlockHeight(self, request, context):
107
+ """Missing associated documentation comment in .proto file."""
108
+ context.set_code(grpc.StatusCode.UNIMPLEMENTED)
109
+ context.set_details('Method not implemented!')
110
+ raise NotImplementedError('Method not implemented!')
111
+
112
+ def GetSlot(self, request, context):
113
+ """Missing associated documentation comment in .proto file."""
114
+ context.set_code(grpc.StatusCode.UNIMPLEMENTED)
115
+ context.set_details('Method not implemented!')
116
+ raise NotImplementedError('Method not implemented!')
117
+
118
+ def IsBlockhashValid(self, request, context):
119
+ """Missing associated documentation comment in .proto file."""
120
+ context.set_code(grpc.StatusCode.UNIMPLEMENTED)
121
+ context.set_details('Method not implemented!')
122
+ raise NotImplementedError('Method not implemented!')
123
+
124
+ def GetVersion(self, request, context):
125
+ """Missing associated documentation comment in .proto file."""
126
+ context.set_code(grpc.StatusCode.UNIMPLEMENTED)
127
+ context.set_details('Method not implemented!')
128
+ raise NotImplementedError('Method not implemented!')
129
+
130
+
131
+ def add_GeyserServicer_to_server(servicer, server):
132
+ rpc_method_handlers = {
133
+ 'Subscribe': grpc.stream_stream_rpc_method_handler(
134
+ servicer.Subscribe,
135
+ request_deserializer=geyser__pb2.SubscribeRequest.FromString,
136
+ response_serializer=geyser__pb2.SubscribeUpdate.SerializeToString,
137
+ ),
138
+ 'SubscribeReplayInfo': grpc.unary_unary_rpc_method_handler(
139
+ servicer.SubscribeReplayInfo,
140
+ request_deserializer=geyser__pb2.SubscribeReplayInfoRequest.FromString,
141
+ response_serializer=geyser__pb2.SubscribeReplayInfoResponse.SerializeToString,
142
+ ),
143
+ 'Ping': grpc.unary_unary_rpc_method_handler(
144
+ servicer.Ping,
145
+ request_deserializer=geyser__pb2.PingRequest.FromString,
146
+ response_serializer=geyser__pb2.PongResponse.SerializeToString,
147
+ ),
148
+ 'GetLatestBlockhash': grpc.unary_unary_rpc_method_handler(
149
+ servicer.GetLatestBlockhash,
150
+ request_deserializer=geyser__pb2.GetLatestBlockhashRequest.FromString,
151
+ response_serializer=geyser__pb2.GetLatestBlockhashResponse.SerializeToString,
152
+ ),
153
+ 'GetBlockHeight': grpc.unary_unary_rpc_method_handler(
154
+ servicer.GetBlockHeight,
155
+ request_deserializer=geyser__pb2.GetBlockHeightRequest.FromString,
156
+ response_serializer=geyser__pb2.GetBlockHeightResponse.SerializeToString,
157
+ ),
158
+ 'GetSlot': grpc.unary_unary_rpc_method_handler(
159
+ servicer.GetSlot,
160
+ request_deserializer=geyser__pb2.GetSlotRequest.FromString,
161
+ response_serializer=geyser__pb2.GetSlotResponse.SerializeToString,
162
+ ),
163
+ 'IsBlockhashValid': grpc.unary_unary_rpc_method_handler(
164
+ servicer.IsBlockhashValid,
165
+ request_deserializer=geyser__pb2.IsBlockhashValidRequest.FromString,
166
+ response_serializer=geyser__pb2.IsBlockhashValidResponse.SerializeToString,
167
+ ),
168
+ 'GetVersion': grpc.unary_unary_rpc_method_handler(
169
+ servicer.GetVersion,
170
+ request_deserializer=geyser__pb2.GetVersionRequest.FromString,
171
+ response_serializer=geyser__pb2.GetVersionResponse.SerializeToString,
172
+ ),
173
+ }
174
+ generic_handler = grpc.method_handlers_generic_handler(
175
+ 'geyser.Geyser', rpc_method_handlers)
176
+ server.add_generic_rpc_handlers((generic_handler,))
177
+ server.add_registered_method_handlers('geyser.Geyser', rpc_method_handlers)
178
+
179
+
180
+ # This class is part of an EXPERIMENTAL API.
181
+ class Geyser(object):
182
+ """Missing associated documentation comment in .proto file."""
183
+
184
+ @staticmethod
185
+ def Subscribe(request_iterator,
186
+ target,
187
+ options=(),
188
+ channel_credentials=None,
189
+ call_credentials=None,
190
+ insecure=False,
191
+ compression=None,
192
+ wait_for_ready=None,
193
+ timeout=None,
194
+ metadata=None):
195
+ return grpc.experimental.stream_stream(
196
+ request_iterator,
197
+ target,
198
+ '/geyser.Geyser/Subscribe',
199
+ geyser__pb2.SubscribeRequest.SerializeToString,
200
+ geyser__pb2.SubscribeUpdate.FromString,
201
+ options,
202
+ channel_credentials,
203
+ insecure,
204
+ call_credentials,
205
+ compression,
206
+ wait_for_ready,
207
+ timeout,
208
+ metadata,
209
+ _registered_method=True)
210
+
211
+ @staticmethod
212
+ def SubscribeReplayInfo(request,
213
+ target,
214
+ options=(),
215
+ channel_credentials=None,
216
+ call_credentials=None,
217
+ insecure=False,
218
+ compression=None,
219
+ wait_for_ready=None,
220
+ timeout=None,
221
+ metadata=None):
222
+ return grpc.experimental.unary_unary(
223
+ request,
224
+ target,
225
+ '/geyser.Geyser/SubscribeReplayInfo',
226
+ geyser__pb2.SubscribeReplayInfoRequest.SerializeToString,
227
+ geyser__pb2.SubscribeReplayInfoResponse.FromString,
228
+ options,
229
+ channel_credentials,
230
+ insecure,
231
+ call_credentials,
232
+ compression,
233
+ wait_for_ready,
234
+ timeout,
235
+ metadata,
236
+ _registered_method=True)
237
+
238
+ @staticmethod
239
+ def Ping(request,
240
+ target,
241
+ options=(),
242
+ channel_credentials=None,
243
+ call_credentials=None,
244
+ insecure=False,
245
+ compression=None,
246
+ wait_for_ready=None,
247
+ timeout=None,
248
+ metadata=None):
249
+ return grpc.experimental.unary_unary(
250
+ request,
251
+ target,
252
+ '/geyser.Geyser/Ping',
253
+ geyser__pb2.PingRequest.SerializeToString,
254
+ geyser__pb2.PongResponse.FromString,
255
+ options,
256
+ channel_credentials,
257
+ insecure,
258
+ call_credentials,
259
+ compression,
260
+ wait_for_ready,
261
+ timeout,
262
+ metadata,
263
+ _registered_method=True)
264
+
265
+ @staticmethod
266
+ def GetLatestBlockhash(request,
267
+ target,
268
+ options=(),
269
+ channel_credentials=None,
270
+ call_credentials=None,
271
+ insecure=False,
272
+ compression=None,
273
+ wait_for_ready=None,
274
+ timeout=None,
275
+ metadata=None):
276
+ return grpc.experimental.unary_unary(
277
+ request,
278
+ target,
279
+ '/geyser.Geyser/GetLatestBlockhash',
280
+ geyser__pb2.GetLatestBlockhashRequest.SerializeToString,
281
+ geyser__pb2.GetLatestBlockhashResponse.FromString,
282
+ options,
283
+ channel_credentials,
284
+ insecure,
285
+ call_credentials,
286
+ compression,
287
+ wait_for_ready,
288
+ timeout,
289
+ metadata,
290
+ _registered_method=True)
291
+
292
+ @staticmethod
293
+ def GetBlockHeight(request,
294
+ target,
295
+ options=(),
296
+ channel_credentials=None,
297
+ call_credentials=None,
298
+ insecure=False,
299
+ compression=None,
300
+ wait_for_ready=None,
301
+ timeout=None,
302
+ metadata=None):
303
+ return grpc.experimental.unary_unary(
304
+ request,
305
+ target,
306
+ '/geyser.Geyser/GetBlockHeight',
307
+ geyser__pb2.GetBlockHeightRequest.SerializeToString,
308
+ geyser__pb2.GetBlockHeightResponse.FromString,
309
+ options,
310
+ channel_credentials,
311
+ insecure,
312
+ call_credentials,
313
+ compression,
314
+ wait_for_ready,
315
+ timeout,
316
+ metadata,
317
+ _registered_method=True)
318
+
319
+ @staticmethod
320
+ def GetSlot(request,
321
+ target,
322
+ options=(),
323
+ channel_credentials=None,
324
+ call_credentials=None,
325
+ insecure=False,
326
+ compression=None,
327
+ wait_for_ready=None,
328
+ timeout=None,
329
+ metadata=None):
330
+ return grpc.experimental.unary_unary(
331
+ request,
332
+ target,
333
+ '/geyser.Geyser/GetSlot',
334
+ geyser__pb2.GetSlotRequest.SerializeToString,
335
+ geyser__pb2.GetSlotResponse.FromString,
336
+ options,
337
+ channel_credentials,
338
+ insecure,
339
+ call_credentials,
340
+ compression,
341
+ wait_for_ready,
342
+ timeout,
343
+ metadata,
344
+ _registered_method=True)
345
+
346
+ @staticmethod
347
+ def IsBlockhashValid(request,
348
+ target,
349
+ options=(),
350
+ channel_credentials=None,
351
+ call_credentials=None,
352
+ insecure=False,
353
+ compression=None,
354
+ wait_for_ready=None,
355
+ timeout=None,
356
+ metadata=None):
357
+ return grpc.experimental.unary_unary(
358
+ request,
359
+ target,
360
+ '/geyser.Geyser/IsBlockhashValid',
361
+ geyser__pb2.IsBlockhashValidRequest.SerializeToString,
362
+ geyser__pb2.IsBlockhashValidResponse.FromString,
363
+ options,
364
+ channel_credentials,
365
+ insecure,
366
+ call_credentials,
367
+ compression,
368
+ wait_for_ready,
369
+ timeout,
370
+ metadata,
371
+ _registered_method=True)
372
+
373
+ @staticmethod
374
+ def GetVersion(request,
375
+ target,
376
+ options=(),
377
+ channel_credentials=None,
378
+ call_credentials=None,
379
+ insecure=False,
380
+ compression=None,
381
+ wait_for_ready=None,
382
+ timeout=None,
383
+ metadata=None):
384
+ return grpc.experimental.unary_unary(
385
+ request,
386
+ target,
387
+ '/geyser.Geyser/GetVersion',
388
+ geyser__pb2.GetVersionRequest.SerializeToString,
389
+ geyser__pb2.GetVersionResponse.FromString,
390
+ options,
391
+ channel_credentials,
392
+ insecure,
393
+ call_credentials,
394
+ compression,
395
+ wait_for_ready,
396
+ timeout,
397
+ metadata,
398
+ _registered_method=True)
@@ -0,0 +1,61 @@
1
+ """对齐 Rust ``sol_parser_sdk::grpc`` 子模块的 Python 入口。"""
2
+
3
+ from .subscribe_builder import (
4
+ build_subscribe_request,
5
+ build_subscribe_request_with_commitment,
6
+ build_subscribe_transaction_filters_named,
7
+ )
8
+ from .transaction_meta import (
9
+ collect_account_keys_bs58,
10
+ collect_watch_transfer_counterparty_pairs,
11
+ heuristic_sol_counterparties_for_watched_keys,
12
+ lamport_balance_deltas,
13
+ pubkey_bytes_to_bs58,
14
+ spl_token_counterparty_by_owner,
15
+ token_balance_raw_amount,
16
+ try_yellowstone_signature,
17
+ )
18
+ from .geyser_connect import GeyserConnectConfig, connect_yellowstone_geyser
19
+
20
+ # 与 Rust 一致:从 types 再导出常用名(grpc/mod.rs)
21
+ from ..grpc_types import (
22
+ AccountFilter,
23
+ ClientConfig,
24
+ EventType as StreamingEventType,
25
+ EventTypeFilter,
26
+ OrderMode,
27
+ Protocol,
28
+ SlotFilter,
29
+ TransactionFilter,
30
+ account_filter_memcmp,
31
+ )
32
+
33
+ EventType = StreamingEventType
34
+
35
+ __all__ = [
36
+ "build_subscribe_request",
37
+ "build_subscribe_request_with_commitment",
38
+ "build_subscribe_transaction_filters_named",
39
+ "pubkey_bytes_to_bs58",
40
+ "collect_account_keys_bs58",
41
+ "lamport_balance_deltas",
42
+ "heuristic_sol_counterparties_for_watched_keys",
43
+ "spl_token_counterparty_by_owner",
44
+ "token_balance_raw_amount",
45
+ "collect_watch_transfer_counterparty_pairs",
46
+ "try_yellowstone_signature",
47
+ "GeyserConnectConfig",
48
+ "connect_yellowstone_geyser",
49
+ "YellowstoneGrpc",
50
+ "Subscription",
51
+ ]
52
+
53
+ # 延迟导入避免循环依赖
54
+ def __getattr__(name: str):
55
+ if name == "YellowstoneGrpc":
56
+ from ..grpc_client import YellowstoneGrpc
57
+ return YellowstoneGrpc
58
+ if name == "Subscription":
59
+ from ..grpc_client import Subscription
60
+ return Subscription
61
+ raise AttributeError(name)
@@ -0,0 +1,42 @@
1
+ """对齐 Rust ``grpc/geyser_connect.rs``:Geyser gRPC 连接配置(Python 侧用 ``grpc`` + aio)。"""
2
+
3
+ from __future__ import annotations
4
+
5
+ from dataclasses import dataclass
6
+ from typing import Any, Optional
7
+
8
+
9
+ @dataclass
10
+ class GeyserConnectConfig:
11
+ """对齐 Rust ``GeyserConnectConfig``。"""
12
+ connect_timeout_s: float = 8.0
13
+ max_decoding_message_size: int = 1024 * 1024 * 1024
14
+ x_token: Optional[str] = None
15
+
16
+
17
+ async def connect_yellowstone_geyser(endpoint: str, config: Optional[GeyserConnectConfig] = None) -> Any:
18
+ """建立 gRPC channel + Geyser stub(对齐 Rust 连接语义;返回 ``(channel, stub)`` 元组)。"""
19
+ import grpc
20
+ from grpc import aio
21
+
22
+ from .grpc_client import normalize_grpc_endpoint
23
+
24
+ cfg = config or GeyserConnectConfig()
25
+ opts = [
26
+ ("grpc.max_receive_message_length", cfg.max_decoding_message_size),
27
+ ("grpc.max_send_message_length", cfg.max_decoding_message_size),
28
+ ]
29
+ target, use_tls = normalize_grpc_endpoint(endpoint, True)
30
+ if use_tls:
31
+ creds = grpc.ssl_channel_credentials()
32
+ channel = aio.secure_channel(target, creds, options=opts)
33
+ else:
34
+ channel = aio.insecure_channel(target, options=opts)
35
+ try:
36
+ from .. import geyser_pb2_grpc
37
+ except ImportError as e:
38
+ raise ImportError("需要 geyser_pb2_grpc") from e
39
+ return channel, geyser_pb2_grpc.GeyserStub(channel)
40
+
41
+
42
+ __all__ = ["GeyserConnectConfig", "connect_yellowstone_geyser"]