RPC Streamer
Installation
deno add jsr:@colibri/rpc-streamerOverview
Quick Start
Streaming Events
import { RPCStreamer } from "@colibri/rpc-streamer";
import { EventFilter, EventType } from "@colibri/core";
const streamer = RPCStreamer.event({
rpcUrl: "https://soroban-testnet.stellar.org",
archiveRpcUrl: "https://archive-rpc.example.com",
filters: [new EventFilter({ type: EventType.Contract })],
});
await streamer.start(
async (event) => {
console.log(`Event ${event.id} from contract ${event.contractId}`);
},
{ startLedger: 1000000 },
);Streaming Ledgers
Static Factory Methods
RPCStreamer.event(config)
RPCStreamer.event(config)RPCStreamer.ledger(config)
RPCStreamer.ledger(config)Streaming Modes
Auto Mode (start)
start)Live-Only Mode (startLive)
startLive)Archive-Only Mode (startArchive)
startArchive)Configuration
Streamer Options
Option
Default
Description
Start Options
Stopping and Resuming
Building Custom Streamers
Error Handling
Code
Description
Examples
Last updated