@shreder_xyz/grpc-client
v0.0.5
Published
Shreder Node.js Client. Shreder is the fastest way to get block updates and receive transaction data on Solana.
Maintainers
Readme
Shreder grpc client
Shreder is the fastest way to get block updates and receive transaction data on Solana. Basically, Shreder is a shred streaming service. We stream raw transaction data (shreds) directly to your app — no polling, no delays. Shreder allows you to receive streaming data with Solana network transactions in real-time (0 block).
Prerequisites
Before you begin, make sure you have the following installed:
Usage
Install package
npm install @shreder_xyz/grpc-clientAdd import
import Client, { type SubscribeTransactionsRequest, } from "@shreder_xyz/grpc-client";Write a logic
const client = new Client("http://localhost:9991", {}); const stream = await client.subscribe(); const streamClosed = new Promise<void>((resolve, reject) => { stream.on("error", (error) => { reject(error); stream.end(); }); stream.on("end", () => { resolve(); }); stream.on("close", () => { resolve(); }); }); stream.on("data", (data) => { console.log(data); }); const request: SubscribeTransactionsRequest = { transactions: { pumpfun: { accountInclude: [], accountExclude: [], accountRequired: ["6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P"], //PumpFun example }, }, }; await new Promise<void>((resolve, reject) => { stream.write(request, (err) => { if (err === null || err === undefined) { resolve(); } else { reject(err); } }); }).catch((reason) => { console.error(reason); throw reason; }); await streamClosed;
For complete example please visit our github
Shreder website: https://shreder.xyz/ Discord: https://discord.gg/8qEGZKPVDV X: https://x.com/ShrederXyz
