A Prediction Market on the AT Protocol

feat(jetstream/index.ts): add awaits

Ciaran 237bf4ba 6ece8ef4

+7 -7
+1 -1
src/core/api.ts
··· 1 1 import 'dotenv/config'; 2 2 import { ZaCoCiaranCumulusBet, ZaCoCiaranCumulusMarket, ZaCoCiaranCumulusResolution } from '../../generated/typescript'; 3 - import { is, type ActorIdentifier, type Did } from '@atcute/lexicons'; 3 + import { is, type Did } from '@atcute/lexicons'; 4 4 import type { CreateCommit, DeleteCommit } from '@atcute/jetstream'; 5 5 import { DEFAULT_MARKET_COLS, DEFAULT_BET_COLS, DEFAULT_RESOLUTION_COLS, marketsTable, betsTable, resolutionsTable } from '@/db' 6 6 import { eq } from 'drizzle-orm';
+6 -6
src/jetstream/index.ts
··· 19 19 20 20 async function handleCreate(did: Did, commit: CreateCommit) { 21 21 console.log("Handling Create Commit:", createUri(did, commit.collection, commit.rkey)); 22 - tryCreateMarket(did, commit); 23 - tryCreateBet(did, commit); 24 - tryCreateResolution(did, commit); 22 + await tryCreateMarket(did, commit); 23 + await tryCreateBet(did, commit); 24 + await tryCreateResolution(did, commit); 25 25 } 26 26 27 27 async function handleDelete(did: Did, commit: DeleteCommit) { 28 28 console.log("Handling Delete Commit:", createUri(did, commit.collection, commit.rkey)); 29 - tryDeleteMarket(did, commit); 30 - tryDeleteBet(did, commit); 31 - tryDeleteResolution(did, commit); 29 + await tryDeleteMarket(did, commit); 30 + await tryDeleteBet(did, commit); 31 + await tryDeleteResolution(did, commit); 32 32 } 33 33 34 34 for await (const event of jetstream) {