Messages
{
"type": "join",
"room": "pm:event:polymarket:btc-updown-5m-1785347100"
}{
"type": "leave",
"room": "pm:event:polymarket:btc-updown-5m-1785347100"
}{
"type": "message",
"room": "pm:event:polymarket:btc-updown-5m-1785347100",
"data": {
"type": "trade",
"channel": "trades",
"exchange": "polymarket",
"marketId": "1234567890",
"timestamp": 1785347120123
}
}Prediction Markets — Feeds
Actualizaciones de un evento de predicción por WebSocket
Actualizaciones que no son de estado de un evento de predicción, normalmente trades, por WebSocket de Datastream. Para volumen, usa la sala :volume.
WSS
/
SDK Example
import { Datastream } from '@solana-tracker/data-api';
const dataStream = new Datastream({
wsUrl: 'wss://datastream.solanatracker.io/YOUR_API_KEY',
});
dataStream.on('error', console.error);
await dataStream.connect();
const sub = dataStream.subscribe.pm.event('kalshi', 'EVENT_TICKER').all().on((data) => {
console.log(data);
});
// sub.unsubscribe();
Messages
{
"type": "join",
"room": "pm:event:polymarket:btc-updown-5m-1785347100"
}{
"type": "leave",
"room": "pm:event:polymarket:btc-updown-5m-1785347100"
}{
"type": "message",
"room": "pm:event:polymarket:btc-updown-5m-1785347100",
"data": {
"type": "trade",
"channel": "trades",
"exchange": "polymarket",
"marketId": "1234567890",
"timestamp": 1785347120123
}
}apiKey
type:httpApiKey
API key for authentication. Include your Datastream key in the connection URL: wss://datastream.solanatracker.io/{DATASTREAM_KEY}
joinEventFeed
type:object
Subscribe to all events for one event
leaveEventFeed
type:object
Unsubscribe from Event Feed
eventFeedMessage
type:object
Event Feed update
¿Esta página le ayudó?