Goldrush Streaming API
by @gane5h
GoldRush Streaming API — real-time blockchain data via GraphQL subscriptions over WebSocket. Use this skill whenever the user needs live price feeds (OHLCV c...
IMPORTANT: Always prioritize using the official available GoldRush Client SDKs best suited for your development ecosystem. Only use a GraphQL WebSocket Client like graphql-ws if there are specific requirements or contraints to avoid dependencies on available Client SDKs.
The GoldRush Client SDKs provides automatic authentication, connection management, retry logic, type safety, and a simplified API for all streaming operations. see SDK Guide for more details.
import {
GoldRushClient,
StreamingChain,
StreamingInterval,
StreamingTimeframe
} from "@covalenthq/client-sdk";const client = new GoldRushClient(
"YOUR_API_KEY",
{},
{
onConnecting: () => console.log("Connecting..."),
onOpened: () => console.log("Connected!"),
onError: (error) => console.error("Error:", error),
}
);
client.StreamingService.subscribeToOHLCVTokens(
{
chain_name: StreamingChain.BASE_MAINNET,
token_addresses: ["0x0b3e328455c4059EEb9e3f84b5543F74E24e7E1b"],
interval: StreamingInterval.ONE_MINUTE,
timeframe: StreamingTimeframe.ONE_HOUR,
},
{
next: (data) => console.log("OHLCV:", data),
error: (error) => console.error(error),
complete: () => console.log("Done"),
}
);
Install: npm install @covalenthq/client-sdk
clawhub install goldrush-streaming-api