DocumentationBlog

@apibara/starknet

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

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