The raw update object from the gRPC subscribe() stream.
Optional parser configuration.
Parsed update with type discriminant, or null if the update
was filtered out (e.g. vote transaction with skipVotes: true).
import { parseGeyserUpdate } from '@oobe-protocol-labs/synapse-client-sdk/grpc';
stream.on('data', (raw) => {
const parsed = parseGeyserUpdate(raw);
if (!parsed) return; // filtered out
switch (parsed.type) {
case 'transaction':
console.log(parsed.data.signature, parsed.data.programsInvoked);
break;
case 'account':
console.log(parsed.data.pubkey, parsed.data.sol);
break;
case 'slot':
console.log(parsed.data.slot, parsed.data.status);
break;
}
});
Parse any raw Geyser subscription update into a typed discriminated union.
This is the main entry point — pass any raw update message from the gRPC stream and get back a fully parsed, typed object.