{"id":48137,"library":"helius-laserstream","title":"helius-laserstream","description":"A high-performance TypeScript client for streaming real-time Solana data via Laserstream (gRPC-based Yellowstone fork). Version 0.3.2 supports automatic reconnection, slot tracking, account/transaction/block/slot subscriptions, and configurable replay. N-API Rust bindings provide low latency. Differentiates from WebSocket-based clients by offering gRPC streaming with higher throughput and advanced control over keepalive, flow control, and compression.","status":"active","version":"0.3.2","language":"javascript","source_language":"en","source_url":"https://github.com/helius-labs/laserstream","tags":["javascript","solana","laserstream","yellowstone","grpc","blockchain","napi","rust","streaming","typescript"],"install":[{"cmd":"npm install helius-laserstream","lang":"bash","label":"npm"},{"cmd":"yarn add helius-laserstream","lang":"bash","label":"yarn"},{"cmd":"pnpm add helius-laserstream","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"ESM-only; CommonJS require will fail unless using Node.js ESM-compatible import.","wrong":"const { subscribe } = require('helius-laserstream')","symbol":"subscribe","correct":"import { subscribe } from 'helius-laserstream'"},{"note":"Enum with values like CONFIRMED, FINALIZED, PROCESSED.","symbol":"CommitmentLevel","correct":"import { CommitmentLevel } from 'helius-laserstream'"},{"note":"Named export, not default. TypeScript type.","wrong":"import LaserstreamConfig from 'helius-laserstream'","symbol":"LaserstreamConfig","correct":"import { LaserstreamConfig } from 'helius-laserstream'"},{"note":"Optional config for gRPC channel options.","symbol":"ChannelOptions","correct":"import { ChannelOptions } from 'helius-laserstream'"},{"note":"Used with ChannelOptions for gRPC compression.","symbol":"CompressionAlgorithms","correct":"import { CompressionAlgorithms } from 'helius-laserstream'"}],"quickstart":{"code":"import { subscribe, CommitmentLevel, LaserstreamConfig } from 'helius-laserstream';\n\nasync function main() {\n  const config: LaserstreamConfig = {\n    apiKey: process.env.HELIUS_API_KEY ?? '',\n    endpoint: 'https://laserstream-mainnet-tyo.helius-rpc.com',\n  };\n\n  const request = {\n    slots: { client: {} },\n    commitment: CommitmentLevel.CONFIRMED,\n  };\n\n  const stream = await subscribe(\n    config,\n    request,\n    async (update) => {\n      console.log('Received:', update);\n    },\n    async (error) => {\n      console.error('Error:', error);\n    }\n  );\n\n  // Optional: await stream.done();\n}\n\nmain().catch(console.error);","lang":"typescript","description":"Sets up a basic slot subscription using Laserstream gRPC client with auto-reconnection."},"warnings":[{"fix":"Use await subscribe(...) and handle errors via the error callback or .catch() on the promise.","message":"The subscribe function returns a stream object that must be awaited before the connection is established. Do not call .catch() on the returned promise before awaiting.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Set config.replay = true (enabled) or false (disabled) explicitly.","message":"The LaserstreamConfig parameter 'replay' default behavior may change in future versions. Use explicit replay: true/false.","severity":"deprecated","affected_versions":">=0.2.0"},{"fix":"Use seconds (e.g., 20 for 20 seconds, not 20000).","message":"ChannelOptions fields like connectTimeoutSecs and keepAliveTimeoutSecs are in seconds, not milliseconds. Common mistake to pass milliseconds.","severity":"gotcha","affected_versions":">=0.3.0"},{"fix":"Ensure runtime supports native Node.js addons (e.g., AWS Lambda with N-API enabled).","message":"The gRPC client uses N-API and may fail to load in environments without native addon support (e.g., some serverless runtimes).","severity":"gotcha","affected_versions":">=0.1.0"}],"env_vars":null,"search_vec":"'0.3.2':25 'account/transaction/block/slot':31 'advanc':58 'api':38 'automat':27 'base':21,48 'bind':40 'blockchain':71 'client':9,49 'compress':65 'configur':34 'control':59,63 'data':16 'differenti':44 'flow':62 'fork':23 'grpc':20,52,70 'grpc-base':19 'helius':2 'helius-laserstream':1 'high':6 'high-perform':5 'higher':55 'javascript':66 'keepal':61 'laserstream':3,18,68 'latenc':43 'low':42 'n':37 'n-api':36 'napi':72 'offer':51 'perform':7 'provid':41 'real':13 'real-tim':12 'reconnect':28 'replay':35 'rust':39,73 'slot':29 'solana':15,67 'stream':11,53,74 'subscript':32 'support':26 'throughput':56 'time':14 'track':30 'typescript':8,75 'version':24 'via':17 'websocket':47 'websocket-bas':46 'yellowston':22,69","created_at":"2026-06-07T16:55:05.952015+00:00","updated_at":"2026-06-07T16:55:05.952015+00:00","problems":[{"fix":"Run 'npm install helius-laserstream' and use correct import.","cause":"Package not installed or incorrect import path.","error":"Error: Cannot find module 'helius-laserstream'"},{"fix":"Use 'import { subscribe } from 'helius-laserstream'' instead of 'import subscribe from ...'.","cause":"Default import instead of named import.","error":"TypeError: subscribe is not a function"},{"fix":"Verify the Laserstream endpoint URL and ensure you have network access.","cause":"Invalid endpoint or network issue.","error":"Error: connect ECONNREFUSED"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/helius-labs/laserstream/tree/main/javascript#readme","github":"https://github.com/helius-labs/laserstream","docs":null,"changelog":null,"pypi":null,"npm":"helius-laserstream","openapi_spec":null,"status_page":null,"smithery":null,"categories":["blockchain"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-07","next_check":"2026-09-05","install_tag":null}}