Install and configure
Use Node.js 20 or later. These examples target@triton-one/yellowstone-grpc 7.0.1. Keep the .mts extension when running them with tsx.
Create the subscription helper
Save this asstream.mts. It fills in the required request maps, replies to server pings, and closes the stream when the consumer exits. Disconnects are surfaced to the caller.
stream.mts
Receive block metadata
blocks.mts
Read the payload correctly
Public keys and signatures arrive as bytes; encode them with base58 for display. The client represents protobuf 64-bit integers as strings. Keep raw balances as strings orBigInt until formatting them.