Zealy quest checks for the games (Marty 2026-11-05: game quests are important): /api/quest/zealy/game passes once the account has earned any network-game reward (gamepass.activity = grants and POL in the ledger), /api/quest/zealy/gamepass passes while a Game Pass is active (gamepass.flag). Read-only, same key and 200/400 contract as the other checks
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -3170,7 +3170,7 @@ const server = http.createServer(async (req, res) => {
|
||||
}
|
||||
// -- quest-site checks (Marty 2026-11-04: Zealy first). Zealy POSTs { accounts: { email?, wallet? } } with X-Api-Key;
|
||||
// 200 = the member may claim, 400 + message = shown to them. Read-only: looks members up, never changes anything.
|
||||
const questM = p.match(/^\/api\/quest\/zealy\/(account|wallet|member)$/);
|
||||
const questM = p.match(/^\/api\/quest\/zealy\/(account|wallet|member|game|gamepass)$/);
|
||||
if (questM && req.method === 'POST') {
|
||||
const key = process.env.QUEST_API_KEY || '';
|
||||
if (!key) return json(res, 503, { message: 'Quest checks are not switched on yet.' });
|
||||
@@ -3183,6 +3183,8 @@ const server = http.createServer(async (req, res) => {
|
||||
if (!acct) return json(res, 400, { message: em ? 'No InstantAdPay account uses ' + em + '. Join free at ' + JOIN + ' with this email, then claim again.' : 'No InstantAdPay account is linked to this wallet. Join free at ' + JOIN + ' and link this wallet in your dashboard, then claim again.' });
|
||||
if (questM[1] === 'wallet' && !acct.address) return json(res, 400, { message: 'Your InstantAdPay account has no Polygon wallet linked yet. Sign in at instantadpay.com/my, link your wallet, then claim again.' });
|
||||
if (questM[1] === 'member' && !acct.memberId) return json(res, 400, { message: 'Your InstantAdPay account is not an on-chain member yet. Get your first package at instantadpay.com/my, then claim again.' });
|
||||
if (questM[1] === 'game' && !(gamepass.activity(acct.email).grants > 0)) return json(res, 400, { message: 'No game rewards on your InstantAdPay account yet. Open any network game from instantadpay.com/games, sign in with your InstantAdPay account and earn your first reward, then claim again.' });
|
||||
if (questM[1] === 'gamepass' && !gamepass.flag(acct.email).active) return json(res, 400, { message: 'Your InstantAdPay account has no active Game Pass. Get one in your dashboard at instantadpay.com/my, then claim again.' });
|
||||
console.log('quest check ok', questM[1], b && b.questId ? String(b.questId).slice(0, 40) : '');
|
||||
return json(res, 200, { message: 'Verified on InstantAdPay. Thanks for joining!' });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user