API reference
Live stream
Server-sent events for counted hits, rounds, payouts, buybacks and deposits, as they happen.
Connect#
GET/api/streamtext/event-stream
js
const es = new EventSource("https://blastball.christmas/api/stream");
es.onmessage = (m) => {
const { type, data, at } = JSON.parse(m.data);
if (type === "hits") console.log(data.length, "new hits");
};Each message is one JSON object { type, data, at }. A comment ping arrives every 20 seconds; the browser reconnects on its own after 3 seconds.
Events#
| type | data |
|---|---|
hits | Array of counted hits (same rows as /api/hits), sent in small batches |
round | { id, status } when a round opens, closes or settles |
payout | Array of payout rows as they are sent and confirmed |
buyback | { roundId, symbol, sol, tokens, signature } after a burn |
deposit | { mint, symbol, sol, kind } when fees or a gift reach the pot |
coin | { mint, symbol, status } when the house token is picked up or changes |
config | Changed public settings (CA, links, rules) |
Stream or poll#
The stream carries events, not the round clock. For the countdown, the live pot and people online, poll /api/game every few seconds and refetch it after a round, payout or deposit event.