Skip to main content

This package contains the pb2 files necessary to interact with Bitquery Kafka Protobuf messages

Project description

Bitquery Protobuf Kafka Package

A Python library containing pb2 files to simplify parsing blockchain data (Solana, EVM & Tron) from Bitquery Kafka Streams using Protobuf messages.

Read more on Bitquery onchain data streams here

Installation

Install easily via pip:

pip install bitquery-pb2-kafka-package

Usage

You can import and use the protobuf-generated Python classes like this:

▶️ Price Index

Read about the new price index stream here

from price_index import price_index_pb2, trades_pb2, marketdata_pb2

# Price index updates (currency, token, and pair price updates)
price_feed = price_index_pb2.PriceIndexMessage()

# Trades stream
trades_msg = trades_pb2.TradesMessage()

▶️ Solana

from solana import block_message_pb2

# Create a Solana BlockMessage instance
block_message = block_message_pb2.BlockMessage()

# Set fields
block_message.field_name = "value"

# Serialize to bytes
serialized = block_message.SerializeToString()

# Deserialize from bytes
msg = block_message_pb2.BlockMessage()
msg.ParseFromString(serialized)

print(msg)

▶️ EVM

from evm import block_message_pb2

# Create an EVM BlockMessage instance
evm_block = block_message_pb2.BlockMessage()

# Set fields
evm_block.field_name = "value"

# Serialize and Deserialize
data = evm_block.SerializeToString()
decoded = block_message_pb2.BlockMessage()
decoded.ParseFromString(data)

print(decoded)

▶️ Tron

from tron import block_message_pb2

# Create a Tron BlockMessage instance
tron_block = block_message_pb2.BlockMessage()

# Set fields
tron_block.field_name = "value"

# Serialize and Deserialize
data = tron_block.SerializeToString()
decoded = block_message_pb2.BlockMessage()
decoded.ParseFromString(data)

print(decoded)

Available Protobuf Messages

Price Index

  • price_index_pb2.PriceIndexMessage — top-level message with CurrencyUpdates, TokenUpdates, and PairUpdates
  • price_index_pb2.PairUpdate — pair-level price update with market, currency, token, and price data
  • price_index_pb2.CurrencyUpdate — currency-level price update
  • price_index_pb2.TokenUpdate — token-level price update with ranking
  • trades_pb2.TradesMessage — stream of trades with pair, amounts, price, trader, and transaction info
  • trades_pb2.Trade — individual trade with Side (Buy/Sell), Price, PriceInUsd, and amounts
  • marketdata_pb2.MarketdataMessage — currency price buckets from external sources (e.g. CryptoRank)

Solana

  • block_message_pb2.BlockMessage
  • dex_block_message_pb2.DexBlockMessage
  • ohlc_message_pb2.OhlcMessage
  • parsed_idl_block_message_pb2.ParsedIdlBlockMessage
  • token_block_message_pb2.TokenBlockMessage

EVM

  • block_message_pb2.BlockMessage
  • dex_block_message_pb2.DexBlockMessage
  • parsed_abi_block_message_pb2.ParsedAbiBlockMessage
  • token_block_message_pb2.TokenBlockMessage
  • dex_pool_block_message_pb2.DexPoolBlockMessage
  • prediction_market_block_message_pb2.PredictionMarketBlockMessage

Tron

  • block_message_pb2.BlockMessage
  • dex_block_message_pb2.DexBlockMessage
  • parsed_abi_block_message_pb2.ParsedAbiBlockMessage
  • token_block_message_pb2.TokenBlockMessage

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bitquery_pb2_kafka_package-0.2.28.tar.gz (20.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bitquery_pb2_kafka_package-0.2.28-py3-none-any.whl (39.5 kB view details)

Uploaded Python 3

File details

Details for the file bitquery_pb2_kafka_package-0.2.28.tar.gz.

File metadata

File hashes

Hashes for bitquery_pb2_kafka_package-0.2.28.tar.gz
Algorithm Hash digest
SHA256 e6b0be5fb5af006c92a1e528d9436a7bd71f607181673b338d116f21594c6509
MD5 71842a1e097f9ee311c90753d1a2e204
BLAKE2b-256 fa4f311fa9bf4b2412966085d9658604f6fc2b2c1321fa04459c75fe914c063f

See more details on using hashes here.

File details

Details for the file bitquery_pb2_kafka_package-0.2.28-py3-none-any.whl.

File metadata

File hashes

Hashes for bitquery_pb2_kafka_package-0.2.28-py3-none-any.whl
Algorithm Hash digest
SHA256 77a54f02954ec7ba3d21dec8472ad98ab2b489f1c6449ff63ceddeba2be4e988
MD5 e1f0fa3c0f63700abe234dee7a922404
BLAKE2b-256 be47478ce35075ca442a2772fa66d71e682aaec524d9012c5b7bff3e6f7df591

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page