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.30.tar.gz (20.4 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.30-py3-none-any.whl (39.9 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for bitquery_pb2_kafka_package-0.2.30.tar.gz
Algorithm Hash digest
SHA256 8ecb41a02566d1e8e1e9da209ac2fd990b1f7b45e815aa05cb21d276774e9e54
MD5 014b5c5cc4b6c7aa4874997cdb935edf
BLAKE2b-256 2af9151bce5e8956f40c8cd1d018dbddfbbcef10d94b19f551fd9bbf1043f3d9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for bitquery_pb2_kafka_package-0.2.30-py3-none-any.whl
Algorithm Hash digest
SHA256 83416c339310bd36d9aa28b38d8a11d6f0eeaf161b802e5c30de41ef84ace49c
MD5 c795887b4f467e7664398820bf825efd
BLAKE2b-256 2858d6bb8ce703a3f909158b139093ca1de89eb90ebe9844d0db4c14d574cc6f

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