internet-court/internet-court-skill / vendored/sendaifun/helius
helius
VerifiedBuild Solana applications with Helius infrastructure. Covers transaction sending (Sender), asset/NFT queries (DAS API), real-time streaming (WebSockets, Laserstream), event pipelines (webhooks), priority fees, wallet analysis, and agent onboarding.
| File | Kind | Size |
|---|---|---|
| LICENSE | other | 11.1 KB |
| SKILL.md | skill md | 10.7 KB |
| references/das.md | markdown | 9.0 KB |
| references/enhanced-transactions.md | markdown | 14.7 KB |
| references/laserstream.md | markdown | 10.4 KB |
| references/onboarding.md | markdown | 8.6 KB |
| references/priority-fees.md | markdown | 7.7 KB |
| references/sender.md | markdown | 14.0 KB |
| references/wallet-api.md | markdown | 10.2 KB |
| references/webhooks.md | markdown | 12.2 KB |
| references/websockets.md | markdown | 13.3 KB |
references/laserstream.md
View on GitHub# LaserStream — High-Performance gRPC Streaming
## What LaserStream Is
LaserStream is a next-generation gRPC streaming service for Solana data. It is a drop-in replacement for Yellowstone gRPC with significant advantages:
- **Ultra-low latency**: taps directly into Solana leaders to receive shreds as they're produced
- **24-hour historical replay**: replay up to 216,000 slots (~24 hours) of data after disconnections via `from_slot`
- **Auto-reconnect**: built-in reconnection with automatic replay of missed data via the SDKs
- **Multi-node failover**: redundant node clusters with automatic load balancing
- **40x faster** than JavaScript Yellowstone clients (Rust core with zero-copy NAPI bindings)
- **9 global regions** for minimal latency
- **Mainnet requires Professional plan** ($999/mo); Devnet available on Developer+ plans
- 3 credits per 0.1 MB of streamed data (uncompressed)
## MCP Tools and SDK Workflow
LaserStream has two MCP tools that work together with the SDK:
1. **`getLaserstreamInfo`** — Returns current capabilities, regional endpoints, pricing, and SDK info. Use this first to check plan requirements and choose the right region.
2. **`laserstreamSubscribe`** — Validates subscription parameters and generates the correct subscription config JSON + ready-to-use SDK code example. Use this to build the subscription.
**Important**: The MCP tools are config generators, not live streams. gRPC streams cannot run over MCP's stdio protocol. The workflow is:
1. Use `getLaserstreamInfo` to get endpoint and capability details
2. Use `laserstreamSubscribe` with the user's requirements to generate the correct subscription config and SDK code
3. The generated code uses the `helius-laserstream` SDK — place it in the user's application code where the actual gRPC stream will run
ALWAYS use the MCP tools first to generate correct configs, then embed the SDK code they produce into the user's project.
## Endpoints
Choose the region closest to your infrastructure:
### Mainnet
| Region | Location | Endpoint |
|---|---|---|
| ewr | Newark, NJ | `https://laserstream-mainnet-ewr.helius-rpc.com` |
| pitt | Pittsburgh | `https://laserstream-mainnet-pitt.helius-rpc.com` |
| slc | Salt Lake City | `https://laserstream-mainnet-slc.helius-rpc.com` |
| lax | Los Angeles | `https://laserstream-mainnet-lax.helius-rpc.com` |
| lon | London | `https://laserstream-mainnet-lon.helius-rpc.com` |
| ams | Amsterdam | `https://laserstream-mainnet-ams.helius-rpc.com` |
| fra | Frankfurt | `https://laserstream-mainnet-fra.helius-rpc.com` |
| tyo | Tokyo | `https://laserstream-mainnet-tyo.helius-rpc.com` |
| sgp | Singapore | `https://laserstream-mainnet-sgp.helius-rpc.com` |
### Devnet
```
https://laserstream-devnet-ewr.helius-rpc.com
```
## Subscription Types
LaserStream supports 7 subscription types that can be combined in a single request:
| Type | What It Streams | Key Filters |
|---|---|---|
| **accounts** | Account data changes | `account` (pubkey list), `owner` (program list), `filters` (memcmp, datasize, lamports) |
| **transactions** | Full transaction data | `account_include`, `account_exclude`, `account_required`, `vote`, `failed` |
| **transactions_status** | Tx status only (lighter) | Same filters as transactions |
| **slots** | Slot progress | `filter_by_commitment`, `interslot_updates` |
| **blocks** | Full block data | `account_include`, `include_transactions`, `include_accounts`, `include_entries` |
| **blocks_meta** | Block metadata only (lighter) | None (all blocks) |
| **entry** | Block entries | None (all entries) |
### Commitment Levels
All subscriptions support:
- `PROCESSED` (0): processed by current node — fastest, least certainty
- `CONFIRMED` (1): confirmed by supermajority — good default
- `FINALIZED` (2): finalized by cluster — most certain, higher latency
### Historical Replay
Set `from_slot` to replay data from a past slot (up to 216,000 slots / ~24 hours back). The SDK handles this automatically on reconnection.
## Implementation Pattern — Using the LaserStream SDK
ALWAYS start by calling the `laserstreamSubscribe` MCP tool with the user's requirements. It will generate validated config and SDK code. The example below shows what the generated code looks like.
The `helius-laserstream` SDK is the recommended way to connect. It handles reconnection, historical replay, and optimized data handling automatically.
```typescript
import { subscribe, CommitmentLevel } from 'helius-laserstream';
const config = {
apiKey: "your-helius-api-key",
endpoint: "https://laserstream-mainnet-ewr.helius-rpc.com",
};
// Subscribe to transactions for specific accounts
const request = {
transactions: {
client: "my-app",
accountInclude: ["TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"],
accountExclude: [],
accountRequired: [],
vote: false,
failed: false,
},
commitment: CommitmentLevel.CONFIRMED,
};
await subscribe(
config,
request,
(data) => {
console.log("Update:", data);
},
(error) => {
console.error("Error:", error);
}
);
```
SDK repo: `https://github.com/helius-labs/laserstream-sdk`
## Transaction Filtering
Transaction subscriptions support three address filter types:
- **`account_include`**: transactions must involve ANY of these addresses (OR logic, up to 10M pubkeys)
- **`account_exclude`**: exclude transactions involving these addresses
- **`account_required`**: transactions must involve ALL of these addresses (AND logic)
```json
{
"transactions": {
"account_include": ["PROGRAM_ID_1", "PROGRAM_ID_2"],
"account_exclude": ["VOTE_PROGRAM"],
"account_required": ["MUST_HAVE_THIS_ACCOUNT"],
"vote": false,
"failed": false
},
"commitment": 1
}
```
## Account Filtering
Account subscriptions support:
- **`account`**: specific pubkeys to monitor
- **`owner`**: monitor all accounts owned by these programs
- **`filters`**: advanced filtering on account data
- `memcmp`: match bytes at a specific offset
- `datasize`: exact account data size in bytes
- `token_account_state`: filter to only token accounts
- `lamports`: filter by SOL balance (`eq`, `ne`, `lt`, `gt`)
```json
{
"accounts": {
"my-label": {
"account": ["SPECIFIC_PUBKEY"],
"owner": ["TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"],
"filters": {
"datasize": 165,
"token_account_state": true
},
"nonempty_txn_signature": true
}
},
"commitment": 1
}
```
## Migrating from Yellowstone gRPC
LaserStream is a drop-in replacement. Just change the endpoint and auth token:
```typescript
// Before: Yellowstone gRPC
const connection = new GeyserConnection(
"your-current-endpoint.com",
{ token: "your-current-token" }
);
// After: LaserStream
const connection = new GeyserConnection(
"https://laserstream-mainnet-ewr.helius-rpc.com",
{ token: "your-helius-api-key" }
);
```
All existing Yellowstone gRPC code works unchanged.
## Utility Methods
LaserStream also provides standard gRPC utility methods:
| Method | Description |
|---|---|
| `GetBlockHeight` | Current block height |
| `GetLatestBlockhash` | Latest blockhash + last valid block height |
| `GetSlot` | Current slot number |
| `GetVersion` | API and Solana node version info |
| `IsBlockhashValid` | Check if a blockhash is still valid |
| `Ping` | Connection health check |
## LaserStream vs Enhanced WebSockets
| Feature | LaserStream | Enhanced WebSockets |
|---|---|---|
| Protocol | gRPC | WebSocket |
| Latency | Lowest (shred-level) | Low (1.5-2x faster than standard WS) |
| Historical replay | Yes (24 hours) | No |
| Auto-reconnect | Built-in with replay | Manual |
| Plan required | Professional (mainnet) | Business+ |
| Max pubkeys | 10M | 50K |
| Best for | Indexers, bots, high-throughput pipelines | Real-time UIs, dashboards, monitoring |
| SDK | `helius-laserstream` | Raw WebSocket |
| Yellowstone compatible | Yes (drop-in) | No |
**Use LaserStream when**: you're building an indexer, high-frequency trading system, or anything that needs the lowest possible latency, historical replay, or processes high data volumes.
**Use Enhanced WebSockets when**: you're building a real-time UI, dashboard, or monitoring tool that needs simpler WebSocket-based integration and doesn't need historical replay.
Use the `getLatencyComparison` MCP tool to show the user detailed tradeoffs.
## Common Patterns
### Monitor a specific program
```json
{
"transactions": {
"account_include": ["YOUR_PROGRAM_ID"],
"vote": false,
"failed": false
},
"commitment": 1
}
```
### Stream all token transfers
```json
{
"transactions": {
"account_include": ["TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"],
"vote": false,
"failed": false
},
"commitment": 1
}
```
### Track account balance changes
```json
{
"accounts": {
"balance-watch": {
"account": ["WALLET_ADDRESS_1", "WALLET_ADDRESS_2"],
"nonempty_txn_signature": true
}
},
"commitment": 1
}
```
### Combined subscription with historical replay
```json
{
"accounts": {
"my-accounts": {
"account": ["PUBKEY"],
"nonempty_txn_signature": true
}
},
"slots": {
"filter_by_commitment": true
},
"commitment": 2,
"from_slot": 139000000,
"ping": { "id": 123 }
}
```
## Best Practices
- ALWAYS use the `laserstreamSubscribe` MCP tool to generate subscription configs — it validates parameters and produces correct SDK code
- Choose the closest regional endpoint to minimize latency
- Use the LaserStream SDK (`helius-laserstream`) — it handles reconnection and replay automatically
- Filter aggressively — only subscribe to accounts/transactions you need to minimize data transfer and credit usage
- Use `CONFIRMED` commitment for most use cases; `FINALIZED` only when absolute certainty is required
- For partial account data, use `accounts_data_slice` to reduce bandwidth (specify offset + length)
- Implement ping messages for connection health monitoring in long-running subscriptions
- Use `transactions_status` instead of `transactions` when you only need status (lighter payload)
## Common Mistakes
- Using LaserStream for simple real-time features that Enhanced WebSockets can handle (unnecessary complexity)
- Not setting `from_slot` after reconnection (misses data during the disconnect gap)
- Subscribing to all transactions without filters (massive data volume and credit burn)
- Forgetting that mainnet requires the Professional plan
- Using `PROCESSED` commitment for financial decisions (can be rolled back)
- Not choosing the closest regional endpoint (adds unnecessary latency)
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| writing-skillsobra/superpowersUse when creating new skills, editing existing skills, or verifying skills work before deployment | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| xlsxanthropics/skillsUse this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing .xlsx, .xlsm, .xltx, .csv, or .tsv file (e.g., adding columns, computing formulas, formatting, charting, cleaning messy data); create a new spreadsheet from scratch or from other data sources; or convert between tabular file formats. Trigger especially when the user references a spreadsheet file by name or path — even casually (like "the xlsx in my downloads") — and wants something done to it or produced from it. Also trigger for cleaning or restructuring messy tabular data files (malformed rows, misplaced headers, junk data) into proper spreadsheets. The deliverable must be a spreadsheet file. Do NOT trigger when the primary deliverable is a Word document, HTML report, standalone Python script, database pipeline, or Google Sheets API integration, even if tabular data is involved. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| shipping-and-launchaddyosmani/agent-skillsPrepares production launches. Use when preparing to deploy to production, or when asking what needs to be in place before shipping. Use when you need a pre-launch checklist, when setting up monitoring, when planning a staged rollout, or when you need a rollback strategy. | Stars: 119k | Updated | Claude CodeCodex | Verified | Install |
| childhoodthedotmack/claude-memBabysit a shipped release after merge, publication, or deployment. Verify published packages, production behavior, installed plugins, and late CI or user reports until the observation window is clean; use babysit for PR readiness before release. | Stars: 118k | Updated | Claude CodeCodex | Verified | Install |