Skip to content

pit: buy an unclaimed name from the page someone landed on - #148

Merged
ralyodio merged 1 commit into
mainfrom
feat/buy-now-subs
Jul 31, 2026
Merged

pit: buy an unclaimed name from the page someone landed on#148
ralyodio merged 1 commit into
mainfrom
feat/buy-now-subs

Conversation

@ralyodio

Copy link
Copy Markdown
Contributor

/n/<name> already told a visitor the name was unclaimed, then left them to find the pit, work out which ending it belongs to, and mint it there. The purchase flow existed the whole time — it just wasn't reachable from the one page where someone has already demonstrated they want the name.

Only offers what the checkout can honour

The price comes from quoteName, the same call startCheckout makes. So a button appears only when the click behind it would succeed — not for a name reserved in someone else's open checkout, or sold between the page rendering and the press.

Every refusal says which refusal it is

Verified live against a seeded server:

blue.forsale        Buy blue.forsale — $2
blue.mine           mint this name for nothing        (your own ending)
blue.free           is not for sale                   (owner set no price)
blue.nobodyhasthis  Claim the whole ending →          (ending unclaimed too)
signed out          Sign in to claim blue.forsale →

Four different problems with four different next steps; a single greyed-out button would tell you none of them. The last is the interesting one — it offers the whole ending, since at that point the name is free to whoever takes the namespace.

Your own ending offers nothing to pay for: minting under it is free, and charging would be selling someone what they already have.

279/279 pwa suite.

Not in this PR

Buy Now for endings — there's no purchase path for one at all. registerTld inserts a row and claiming is free; a button needs terms, expires_at and checkout first.

🤖 Generated with Claude Code

/n/<name> already told a visitor the name was unclaimed and then left them to
find the pit, work out which ending it belongs to, and mint it there. The
purchase flow existed the whole time; it just was not reachable from the one
page where someone has already demonstrated they want the name.

The price comes from quoteName — the same call the checkout makes — so a
button is only shown when the click behind it would actually succeed. A name
that is reserved in someone else's open checkout, or already sold between the
page rendering and the button being pressed, does not get one.

Every reason you cannot buy says which reason it is. "Not for sale", "sign in
first", "you own this ending", and "nobody holds the ending either" are four
different problems with four different next steps, and a single greyed-out
button would tell you none of them. The last one is the interesting case: it
offers the whole ending instead, because at that point the name is free to
whoever takes the namespace.

Your own ending offers nothing to pay for — minting under it is free, and
charging for that would be selling someone what they already have.

Rendered every branch against a live server: priced ending, own ending,
unpriced ending, unclaimed ending, and signed out.

279 across the pwa suite.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

vu1nz Security Review

0 finding(s) in PR #?

No security issues found.

@ralyodio
ralyodio merged commit 409d5f5 into main Jul 31, 2026
3 checks passed
@ralyodio ralyodio mentioned this pull request Jul 31, 2026
ralyodio added a commit that referenced this pull request Jul 31, 2026
* chore(release): v0.13.3

install.sh resolves releases/latest, so everything merged since v0.13.2 has
been sitting on main unreachable — `moshcode dns enable` exists in the source
and not in anyone's binary.

The headline is the DNS bridge (#141). Moshpit names now resolve for every
program on the machine, not just inside TronBrowser: each OS gets the mechanism
that routes ONE SUFFIX rather than the one that replaces the resolver —
/etc/resolver on macOS, systemd-resolved routing-only domains or dnsmasq on
Linux, an NRPT rule per namespace on Windows.

  moshcode dns enable / disable / status
  moshcode uninstall <engine|tool>          (#150, completion in #151)

The pit gained most of a namespace registry in between: key pins per name
(#137), pasted bulk claiming with per-line price and target (#138, #142, #143,
#146), all-numeric endings (#147), /n/<name> serving a name or a directory
(#145, #149), and Buy Now on an unclaimed name (#148).

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* chore: restore the em-dash the version bump escaped

The bump rewrote package.json through a JSON serialiser that defaults to ASCII,
turning the em-dash in `description` into —. Valid JSON and the same string
once parsed, but a gratuitous diff in a commit that should touch one line.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant