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) and market/trading data 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 / Market

Read about the new price index stream here

from market 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 / Market

  • 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.29.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.29-py3-none-any.whl (39.4 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for bitquery_pb2_kafka_package-0.2.29.tar.gz
Algorithm Hash digest
SHA256 99b9b37e703be76877b7812999e9693860f6922df4178f633d88ae41d7f911cc
MD5 4e9cda4625ec28de1d3dd0123493f241
BLAKE2b-256 7b734e44725940f780482c4d324861212c6b0b6bc683530b4ecd12540ab0c21b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for bitquery_pb2_kafka_package-0.2.29-py3-none-any.whl
Algorithm Hash digest
SHA256 edd9c7428937e1d796921833fdc33fdf257a64ce3edf629349ddf1fbc1f000c8
MD5 d4a5260a1bce5044328a4742ea018616
BLAKE2b-256 ae3aa261fc64417eb60765e6607289834fc5f19b293c0bcfe188e5a17b158692

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