Apibara Typescript SDK

API Reference


This package contains the StarkNet streams Protobuf definitions. Use this package to decode the data received by one of the StarkNet streams.


Install the package from npm:

npm add @apibara/starknet@0.1


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}`)