23 e.preventDefault();
24 setResult(null);
25 const res = await fetch("/analyze", {
26 method: "POST",
27 headers: { "content-type": "application/json" },
36 setStatus("Placing bets...");
37
38 const res = await fetch("/betAll", {
39 method: "POST",
40 headers: { "content-type": "application/json" },
133
134 const apiUrl = `https://manifold.markets/api/v0/slug/${slug}`;
135 const res = await fetch(apiUrl);
136 if (!res.ok) return new Response(`Failed to fetch market: ${res.statusText}`, { status: 500 });
137
138 const data = await res.json();
157
158 const apiUrl = `https://manifold.markets/api/v0/slug/${slug}`;
159 const res = await fetch(apiUrl);
160 if (!res.ok) return new Response(`Failed to fetch market: ${res.statusText}`, { status: 500 });
161
162 const data = await res.json();
167 const results: any[] = [];
168 for (const ans of data.answers) {
169 const betRes = await fetch("https://manifold.markets/api/v0/bet", {
170 method: "POST",
171 headers: {