@@ -113,6 +113,35 @@ export const DisputeOpenedPayloadSchema = WebhookEnvelopeSchema.extend({
113113
114114export type DisputeOpenedPayload = z . infer < typeof DisputeOpenedPayloadSchema > ;
115115
116+ // ---------------------------------------------------------------------------
117+ // prediction.confirmed
118+ // ---------------------------------------------------------------------------
119+
120+ /**
121+ * Emitted when the predictionsConfirmer worker detects a matching indexer
122+ * event for a pending prediction and transitions it to confirmed.
123+ *
124+ * The dispatcher fans this event out to every subscription which subscribes to
125+ * "prediction.confirmed" or "*".
126+ */
127+ export const PredictionConfirmedPayloadSchema = WebhookEnvelopeSchema . extend ( {
128+ event : z . literal ( "prediction.confirmed" ) ,
129+ /** UUID of the confirmed prediction. */
130+ predictionId : z . string ( ) . uuid ( ) ,
131+ /** Primary key of the market the prediction belongs to. */
132+ marketId : z . string ( ) ,
133+ /** UUID of the user who made the prediction. */
134+ userId : z . string ( ) . uuid ( ) ,
135+ /** The outcome the user predicted (e.g. "yes" or "no"). */
136+ outcome : z . string ( ) ,
137+ /** The amount staked on the prediction (string to preserve precision). */
138+ amount : z . string ( ) ,
139+ /** On-chain transaction hash of the bet_placed event. */
140+ txHash : z . string ( ) ,
141+ } ) ;
142+
143+ export type PredictionConfirmedPayload = z . infer < typeof PredictionConfirmedPayloadSchema > ;
144+
116145// ---------------------------------------------------------------------------
117146// Catalog registry
118147// ---------------------------------------------------------------------------
@@ -130,6 +159,7 @@ export type DisputeOpenedPayload = z.infer<typeof DisputeOpenedPayloadSchema>;
130159export const WEBHOOK_EVENT_SCHEMAS = {
131160 "market.resolved" : MarketResolvedPayloadSchema ,
132161 "dispute.opened" : DisputeOpenedPayloadSchema ,
162+ "prediction.confirmed" : PredictionConfirmedPayloadSchema ,
133163} as const ;
134164
135165/** All registered event-type strings, derived from the catalog at compile time. */
@@ -141,7 +171,8 @@ export type WebhookEventType = keyof typeof WEBHOOK_EVENT_SCHEMAS;
141171/** Union of every concrete payload type. */
142172export type WebhookPayload =
143173 | MarketResolvedPayload
144- | DisputeOpenedPayload ;
174+ | DisputeOpenedPayload
175+ | PredictionConfirmedPayload ;
145176
146177// ---------------------------------------------------------------------------
147178// Validation helpers
0 commit comments