https://strapi-matic.poly.market/markets
Browse filesit is calling this endpoint which is incorrect
script.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
|
| 2 |
// Configuration
|
| 3 |
-
const GAMMA_API = 'https://
|
| 4 |
const CLOB_API = 'https://clob.polymarket.com/markets';
|
| 5 |
const DATA_API = 'https://data-api.polymarket.com/trades?limit=5';
|
| 6 |
const DEFAULT_PARAMS = {
|
|
@@ -52,13 +52,17 @@ async function fetchMarkets() {
|
|
| 52 |
url.searchParams.append(key, value);
|
| 53 |
});
|
| 54 |
|
| 55 |
-
// Fetch from
|
| 56 |
-
let response = await fetch(url
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 62 |
title: market.question,
|
| 63 |
category: market.category,
|
| 64 |
volume: parseFloat(market.volumeNum),
|
|
|
|
| 1 |
|
| 2 |
// Configuration
|
| 3 |
+
const GAMMA_API = 'https://strapi-matic.poly.market/markets';
|
| 4 |
const CLOB_API = 'https://clob.polymarket.com/markets';
|
| 5 |
const DATA_API = 'https://data-api.polymarket.com/trades?limit=5';
|
| 6 |
const DEFAULT_PARAMS = {
|
|
|
|
| 52 |
url.searchParams.append(key, value);
|
| 53 |
});
|
| 54 |
|
| 55 |
+
// Fetch from Polymarket API
|
| 56 |
+
let response = await fetch(url, {
|
| 57 |
+
headers: {
|
| 58 |
+
'Accept': 'application/json',
|
| 59 |
+
'Content-Type': 'application/json'
|
| 60 |
+
}
|
| 61 |
+
});
|
| 62 |
+
if (!response.ok) throw new Error('Gamma API failed');
|
| 63 |
+
const data = await response.json();
|
| 64 |
+
marketsData = data.map(market => ({
|
| 65 |
+
id: market.id,
|
| 66 |
title: market.question,
|
| 67 |
category: market.category,
|
| 68 |
volume: parseFloat(market.volumeNum),
|