Member lookups through the network hub (Marty 2026-11-14: "want everything looped through the hub to verify membership"): hubpeople.js asks POST /v1/resolve (ref / wallet / hub id, signed as bannerline, cached 5 minutes, 2.5 s timeout, hub skipped 30 s after a failure); netMember / nameOf ask the hub first and InstantAdPay's /api/network/member only when the hub is unreachable (wallet-aliases.json still first). Sponsor pick: the hub network sponsor for the wallet that will own the spot (the buy page asks /api/sponsor?for=<owner> just before the buy; else the signed-in wallet), resolved to a wallet by hub id, nearest up the network line who owns a spot here, none = no sponsor; then the /w/ welcome line (usernames resolved through the hub), then the ?ref= cookie. Admin status shows hubLookup. join.js?v=20261114h. Smoke 91/91 (stand-in hub + stand-in InstantAdPay)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
martbost
2026-11-14 09:25:46 -06:00
parent 7c2aab8f65
commit 57e733b55d
5 changed files with 167 additions and 11 deletions
+5
View File
@@ -25,6 +25,11 @@
BL.status('');
try {
await loadQuote(); if (!q || q.error) throw new Error('No price right now. Try again in a minute.');
// the network hub knows many buyers' sponsors (Marty 2026-11-14): ask for the wallet that will own the spot, right before the buy
try {
const owner = forAddr || await BLWallet.activeAddress(await BLWallet.connect());
if (owner) { const s2 = await BL.getJSON('/api/sponsor?for=' + encodeURIComponent(owner)); if (s2 && !s2.error) { sponsor = s2.address && s2.member ? s2.address : null; $('sponsor').textContent = sponsor ? BL.short(sponsor) : 'none'; } }
} catch (e) { /* keep the sponsor shown on the page */ }
BL.status('Confirm the payment in your wallet. The contract refunds anything above the price in the same transaction.');
const r = forAddr ? await BLWallet.buyFor(forAddr, sponsor, q.sendWei) : await BLWallet.buy(sponsor, q.sendWei);
if (r.receipt.status !== '0x1') throw new Error('The transaction reverted. Nothing was charged except gas.');
+1 -1
View File
@@ -50,6 +50,6 @@
</main>
<script src="/assets/common.js?v=20261114a"></script>
<script src="/assets/wallet.js?v=1"></script>
<script src="/assets/join.js?v=z1"></script>
<script src="/assets/join.js?v=20261114h"></script>
</body>
</html>