diff --git a/api/verify.js b/api/verify.js index db9d01a..9126d99 100644 --- a/api/verify.js +++ b/api/verify.js @@ -233,8 +233,9 @@ async function handleEligibility(req, res) { const ip = req.headers['x-forwarded-for'] || req.headers['x-real-ip'] || 'unknown'; if (!rateOk(ip + ':eligibility', 20)) return res.status(429).json({ error: 'Too many requests. Try again in 1 minute.' }); - const rawAddr = (req.query || {}).address; - const rawBtc = (req.query || {}).btc; + const query = req.query || {}; + const rawAddr = query.address || query.stxAddress; + const rawBtc = query.btc; if (!rawAddr || typeof rawAddr !== 'string') return res.status(400).json({ error: 'Missing ?address= parameter' }); if (!/^S[PMTN][A-Z0-9]{38,41}$/.test(rawAddr)) return res.status(400).json({ error: 'Invalid Stacks address format' }); @@ -365,7 +366,7 @@ module.exports = async function handler(req, res) { if (path.endsWith('/genesis')) return handleGenesis(req, res); if (path.endsWith('/holder')) return handleHolder(req, res); - if (path.endsWith('/eligibility')) return handleEligibility(req, res); + if (path.endsWith('/eligibility') || path.endsWith('/check')) return handleEligibility(req, res); if (path.endsWith('/recent-mints')) return handleRecentMints(req, res); return res.status(404).json({ error: 'Not found' }); diff --git a/vercel.json b/vercel.json index 7623628..dae1dca 100644 --- a/vercel.json +++ b/vercel.json @@ -95,6 +95,10 @@ "src": "/api/attest", "dest": "/api/attest.js" }, + { + "src": "/api/check", + "dest": "/api/verify.js" + }, { "src": "/api/eligibility", "dest": "/api/verify.js"