tangled
alpha
login
or
join now
ciaran.co.za
/
cumulus
0
fork
atom
A Prediction Market on the AT Protocol
0
fork
atom
overview
issues
pulls
pipelines
feat(core/api.ts): prevent bets if market has a resolution
Ciaran
1 week ago
d9a0a226
cde4ce14
+3
1 changed file
expand all
collapse all
unified
split
src
core
api.ts
+3
src/core/api.ts
···
95
95
const existing = await db.query.betsTable.findFirst({ where: eq(betsTable.uri, uri) });
96
96
if (existing) return;
97
97
98
98
+
const resolution = await db.query.resolutionsTable.findFirst({ where: eq(resolutionsTable.uri, market.uri) });
99
99
+
if (resolution?.uri) return;
100
100
+
98
101
const indexedMarket = await db.query.marketsTable.findFirst({ where: eq(marketsTable.uri, market.uri), columns: { closesAt: true } });
99
102
if (!indexedMarket || (new Date() > indexedMarket.closesAt)) return;
100
103