MCPcopy Create free account
hub / github.com/AmazingAng/PolyWorld / checkGeoBlock

Function checkGeoBlock

src/components/OrderForm.tsx:92–103  ·  view source on GitHub ↗

Check Polymarket geo-restriction directly from the browser. * Must be called from client so Polymarket sees the user's real IP. * @see https://docs.polymarket.com/api-reference/geoblock

()

Source from the content-addressed store, hash-verified

90 * Must be called from client so Polymarket sees the user's real IP.
91 * @see https://docs.polymarket.com/api-reference/geoblock */
92async function checkGeoBlock(): Promise<{ blocked: boolean; country?: string }> {
93 try {
94 const res = await fetch("https://polymarket.com/api/geoblock", {
95 signal: AbortSignal.timeout(5_000),
96 });
97 if (!res.ok) return { blocked: false };
98 const data = await res.json();
99 return { blocked: data?.blocked === true, country: data?.country };
100 } catch {
101 return { blocked: false };
102 }
103}
104
105interface OrderFormProps {
106 tokenId: string;

Callers 1

OrderFormFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected