diff --git a/.env.example b/.env.example index 2db75af3..e9da2ead 100644 --- a/.env.example +++ b/.env.example @@ -5,6 +5,7 @@ SEQUENCER_URL=https://testnet.seq.snapshot.org KEYCARD_URL=https://keycard.snapshot.org KEYCARD_SECRET= SCORE_API_URL=https://score.snapshot.org +# If you need unlimited access to score-api, use `https://score.snapshot.org?apiKey=...` SIDEKICK_URL=https://sh5.co SENTRY_DSN= SENTRY_TRACE_SAMPLE_RATE= diff --git a/src/graphql/operations/vp.ts b/src/graphql/operations/vp.ts index 5efefbfd..db3c19f3 100644 --- a/src/graphql/operations/vp.ts +++ b/src/graphql/operations/vp.ts @@ -1,6 +1,8 @@ import snapshot from '@snapshot-labs/snapshot.js'; import db from '../../helpers/mysql'; +const scoreAPIUrl = process.env.SCORE_API_URL || 'https://score.snapshot.org'; + export default async function (_parent, { voter, space, proposal }) { if (proposal) { const query = `SELECT * FROM proposals WHERE id = ?`; @@ -12,7 +14,8 @@ export default async function (_parent, { voter, space, proposal }) { JSON.parse(p.strategies), p.snapshot, space, - p.delegation === 1 + p.delegation === 1, + { url: scoreAPIUrl } ); } else if (space) { const query = `SELECT settings FROM spaces WHERE id = ? AND deleted = 0 LIMIT 1`; @@ -25,7 +28,8 @@ export default async function (_parent, { voter, space, proposal }) { s.strategies, 'latest', space, - s.delegation === 1 + s.delegation === 1, + { url: scoreAPIUrl } ); }