sumittechmero commited on
Commit
03fe710
·
verified ·
1 Parent(s): 77a0b16

https://strapi-matic.poly.market/markets

Browse files

it is calling this endpoint which is incorrect

Files changed (1) hide show
  1. script.js +12 -8
script.js CHANGED
@@ -1,6 +1,6 @@
1
 
2
  // Configuration
3
- const GAMMA_API = 'https://gamma-api.polymarket.com/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,13 +52,17 @@ async function fetchMarkets() {
52
  url.searchParams.append(key, value);
53
  });
54
 
55
- // Fetch from Gamma API first
56
- let response = await fetch(url);
57
- if (!response.ok) throw new Error('Gamma API failed');
58
-
59
- const { markets } = await response.json();
60
- marketsData = markets.map(market => ({
61
- id: market.id,
 
 
 
 
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),