Skip to content

TypeScript

There is no Slipstream-only SDK to learn: Yellowstone's own Node.js client, @triton-one/yellowstone-grpc, streams from Slipstream unchanged.

npm i @triton-one/yellowstone-grpc

Create the client with your region's endpoint (https://slipstream-fra2.reflow.xyz today) and an API key as the x-token, connect, then subscribe with a request.

import Client, { CommitmentLevel, type SubscribeRequest } from "@triton-one/yellowstone-grpc";

const client = new Client(process.env.SLIPSTREAM_ENDPOINT!, process.env.SLIPSTREAM_KEY, undefined);
await client.connect();

const request: SubscribeRequest = {
  accounts: {},
  slots: {},
  transactions: {
    jupiter: { accountInclude: ["JUP6LkbZbjS1jKKwapdHNy74zcZ3tLUZoi5QNyVTaV4"], accountExclude: [], accountRequired: [], vote: false, failed: false },
  },
  transactionsStatus: {},
  blocks: {},
  blocksMeta: {},
  entry: {},
  accountsDataSlice: [],
  commitment: CommitmentLevel.PROCESSED,
};

const stream = await client.subscribe(request);
stream.on("data", (update) => {
  if (update.transaction) console.log(update.transaction.slot, update.filters);
});
stream.on("error", (err) => console.error(err));

To change what you receive, write a new request to the same stream with stream.write(request). The client's README covers reconnecting with subscribeWithReconnect() and compressed account filters for very large account sets.