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 @@