diff --git a/public/assets/my.js b/public/assets/my.js index f638c92..8672eab 100644 --- a/public/assets/my.js +++ b/public/assets/my.js @@ -9,6 +9,7 @@ $('boRehearsal').hidden = false; $('boRehearsal').innerHTML = 'Testnet rehearsal · ' + c.chainName; } + if (c.rehearsal && $('faucetCard')) $('faucetCard').hidden = false; } catch (e) {} async function api(path, body) { @@ -1191,6 +1192,14 @@ IAP.status('Wallet linked. Earnings pay there from now on.', 'ok'); await render(); })); + if ($('faucetBtn')) $('faucetBtn').addEventListener('click', busy($('faucetBtn'), async () => { + IAP.status('Connect your wallet to receive test POL…'); + 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'); + })); $('activateBtn').addEventListener('click', busy($('activateBtn'), async () => { const me = await (await fetch('/api/me')).json(); IAP.status('Confirm the free activation in your wallet…'); diff --git a/public/my.html b/public/my.html index 9355e45..72c426d 100644 --- a/public/my.html +++ b/public/my.html @@ -4,7 +4,7 @@
This is the rehearsal chain, so purchases use valueless test POL, not real money. + Tap below to top your connected wallet up to 10 test-POL, then buy a package and watch the payouts + move on the live ledger exactly like the real chain will.
++
+…