bitquery-protobuf-schema
v2.2.0
Published
Returns Protobuf schemas for the data streamed and stored in S3 for a given topic
Maintainers
Readme
bitquery-protobuf-schema
bitquery-protobuf-schema is an NPM package by Bitquery that returns Protocol Buffers (Protobuf) schemas for the Bitquery Protobuf Kafka streams by providing the topic name. Bitquery is an onchain data provider firm that provides blockchain data solutions in the form of GraphQL APIs, Websocket and Kafka streams. The main purpose of this package is to avoid the hastle of downloading the .proto files again and again.
Installation
To install the package, use npm:
npm i bitquery-protobuf-schemaUsage
The usage for the following package is as follows.
const {loadProto} = require('bitquery-protobuf-schema');
let ParsedIdlBlockMessage;
let topic = '<topic>';
ParsedIdlBlockMessage = await loadProto(topic); This ParsedIdlBlockMessage variable can then be used for decoding the recieved Protobuf message as shown below, where message is a singular message recieved from the Bitquery Protobuf stream.
const buffer = message.value;
const decoded = ParsedIdlBlockMessage.decode(buffer);To get started with the Bitquery Protobuf Kaka streams contact - [email protected].
To read more about Bitquery Protobuf Kafka solutions checkout their official documentation.
