DIAMOND
Launch

API reference

Live stream

One server-sent events connection carries every payment, round, burn, fee inflow and trade as it happens.

Connect#

GET/api/streamtext/event-stream
js
const es = new EventSource("https://diamond.church/api/stream");
es.onmessage = (m) => {
  const ev = JSON.parse(m.data); // { type, data, at }
  if (ev.type === "payout") console.log(ev.data.length, "payments");
};

The server sends a comment every 20 seconds to keep the connection open and asks clients to reconnect after 3 seconds.

Events#

ts
type LiveEvent =
  | { type: "payout";  data: PayoutRow[] }
  | { type: "round";   data: RoundRow }
  | { type: "burn";    data: { id: number; sol: number; tokens: number;
                               buySignature: string | null; burnSignature: string | null; at: string } }
  | { type: "fees";    data: { mint: string; symbol: string; sol: number;
                               holdersSol: number; burnSol: number; platformSol: number } }
  | { type: "trade";   data: { mint: string; symbol: string; sol: number; buy: boolean; wallet: string } }
  | { type: "coin";    data: { mint: string; symbol: string; status: "launching" | "live" | "paused" } }
  | { type: "airdrop"; data: AirdropRound }
  | { type: "config";  data: Partial<PublicConfig> };
Docs