Helius SDK - v3.4.0
    Preparing search index...

    Interface ParsedStreamsClient

    Client for Helius Parsed Streams.

    Parsed Streams pushes confirmed transactions that match a server-side filter (program, instruction name, account, account role), already decoded through Helius's IDL catalog. It is the real-time counterpart to Parsed Events and the successor to enhanced transaction webhooks. 1 credit per delivered event.

    Delivery is at most once: the server does not replay what confirmed while a connection was down. This client reconnects and resubscribes automatically when the server closes the connection (idle timeout, deploy, network edge), and reports the last slot it delivered through onReconnect so you can backfill the gap from RPC if you need to.

    import { makeParsedStreamsClient } from "helius-sdk/websockets/parsedStreams";

    const streams = makeParsedStreamsClient("your-api-key", {
    onReconnect: ({ lastSlot }) => console.log("reconnected; backfill after", lastSlot),
    });

    const sub = await streams.parsedTransactionSubscribe({
    programs: ["JUP6LkbZbjS1jKKwapdHNy74zcZ3tLUZoi5QNyVTaV4"],
    });

    for await (const { value } of sub) {
    for (const i of value.matchedIndexes ?? []) {
    const ix = value.instructions[i];
    console.log(value.transaction.signature, ix.instructionName, ix.decoded?.args);
    }
    }
    interface ParsedStreamsClient {
        close(): void;
        describeProgram(program: string): Promise<ProgramDescription>;
        parsedTransactionSubscribe<D extends ParsedStreamDetails = "full">(
            filter: ParsedTransactionFilter,
            options?: ParsedTransactionSubscribeOptions<D>,
        ): Promise<ParsedTransactionSubscription<ParsedStreamValue<D>>>;
        parsedTransactionUnsubscribe(subscriptionId: number): Promise<boolean>;
    }
    Index

    Methods

    • List a program's instruction names, events, and account roles. Pass the program address. A catalog name also works, but names can be ambiguous across program versions, so check id in the result. Opens a short-lived connection to the discovery endpoint.

      Parameters

      • program: string

      Returns Promise<ProgramDescription>

    • Unsubscribe by current subscription id.

      Parameters

      • subscriptionId: number

      Returns Promise<boolean>