open-index/open-npm huggingface dataset:
npm package: @shreder_xyz/grpc-client
Description: Shreder Node.js Client. Shreder is the fastest way to get block updates and receive transaction data on Solana.
Author: Shreder XYZ
Latest version: 0.0.5

# 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:

- [Git](https://git-scm.com/) for cloning the repository
- [Node.js](https://nodejs.org/) for building the project

### Usage
1. **Install package**
    ```bash
      npm install @shreder_xyz/grpc-client
    ```

2.  **Add import**
    ```typescript
      import Client, {
        type SubscribeTransactionsRequest,
      } from "@shreder_xyz/grpc-client";
    ```
    
3. **Write a logic**

    ```typescript
      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](https://github.com/shrederxyz/shreder-nodejs-example)

Shreder website: https://shreder.xyz/
Discord: https://discord.gg/8qEGZKPVDV
X: https://x.com/ShrederXyz