@apibara/starknet
This package contains the StarkNet streams Protobuf definitions. Use this package to decode the data received by one of the StarkNet streams.
Installation#
Install the package from npm:
npm add @apibara/starknet@0.1
Example#
import { Block } from '@apibara/starknet'function handleData(message) {// decode raw bytes in `Data` messages.if (message.data?.data?.value) {const block = Block.decode(message.data.data.value)console.log(`${block.blockNumber} ${block.transactions.length}`)}}