From 653a5e333a0722c69ab68ae8b32d5941a13675ee Mon Sep 17 00:00:00 2001 From: martbost Date: Tue, 8 Sep 2026 08:33:46 -0500 Subject: [PATCH] Amoy rehearsal: faucet points testers to the public Amoy faucet anvil_setBalance doesn't exist on Amoy. The faucet now connects the wallet, copies the address, and opens faucet.polygon.technology so testers fund their own wallet with test POL (choose Polygon Amoy). Server endpoint returns the faucet link + address instead of minting balance. Co-Authored-By: Claude Opus 4.8 --- public/assets/my.js | 12 +++++++----- public/my.html | 10 +++++----- server.js | 16 +++++----------- 3 files changed, 17 insertions(+), 21 deletions(-) diff --git a/public/assets/my.js b/public/assets/my.js index 5cf1b21..899dede 100644 --- a/public/assets/my.js +++ b/public/assets/my.js @@ -1416,12 +1416,14 @@ await render(); })); if ($('faucetBtn')) $('faucetBtn').addEventListener('click', busy($('faucetBtn'), async () => { - IAP.status('Connect your wallet to receive test POL…'); + IAP.status('Connect your wallet first…'); const addr = await IAPWallet.connect(); - const r = await api('/api/my/faucet', { address: addr }); - const pol = (Number(BigInt(r.balanceWei) / (10n ** 15n)) / 1000).toFixed(3); - $('faucetInfo').textContent = 'Funded — balance ' + pol + ' test-POL. Head to Buy packages.'; - IAP.status('Your wallet now holds test POL. Go buy a package.', 'ok'); + let copied = false; + try { await navigator.clipboard.writeText(addr); copied = true; } catch (e) {} + window.open('https://faucet.polygon.technology/', '_blank', 'noopener'); + $('faucetInfo').innerHTML = 'Your address ' + addr.slice(0, 8) + '…' + addr.slice(-6) + '' + + (copied ? ' is copied' : '') + '. On the faucet, choose Polygon Amoy, paste your address, and request POL. Then come back and buy.'; + IAP.status('Faucet opened in a new tab. Choose Polygon Amoy, paste your address, and request test POL.', 'ok'); })); $('activateBtn').addEventListener('click', busy($('activateBtn'), async () => { const me = await (await fetch('/api/me')).json(); diff --git a/public/my.html b/public/my.html index d47fddd..28196a2 100644 --- a/public/my.html +++ b/public/my.html @@ -639,10 +639,10 @@