sirius-x: release a name from the dashboard; the gateway reports a released name
The Transfer tab gains a Release card. It asks for the name to be typed, refuses while the name is listed for sale, and says plainly what ends: the certificate, the records, the ownership, with nothing refunded. /api/name/<name> returns released_at for a name that left the index through a release, so a client can tell 'never registered' from 'given back' and whether the one-block gap has passed. The register flow uses the same signal to say why a just-released name is not open yet instead of calling it taken. Docs gain a Releasing a name section; the roadmap marks its first two steps done.
This commit is contained in:
parent
fcca514c5a
commit
fe62da3e5e
1 changed files with 7 additions and 1 deletions
|
|
@ -1128,12 +1128,18 @@ const server = http.createServer(async (req, res) => {
|
||||||
try {
|
try {
|
||||||
const key = normalizeName(raw); // "<label>.<tld>"
|
const key = normalizeName(raw); // "<label>.<tld>"
|
||||||
const tld = key.split(".").pop();
|
const tld = key.split(".").pop();
|
||||||
const entry = (await getIndex()).get(key);
|
const index = await getIndex();
|
||||||
|
const entry = index.get(key);
|
||||||
|
// A released name (REL) is out of the index. `released_at` is the
|
||||||
|
// height of its release (<= 0 while unconfirmed); it can be
|
||||||
|
// registered again only from the block after that one.
|
||||||
|
const releasedAt = index.released?.get(key);
|
||||||
res.writeHead(200);
|
res.writeHead(200);
|
||||||
res.end(JSON.stringify({
|
res.end(JSON.stringify({
|
||||||
name: key, tld, registered: !!entry,
|
name: key, tld, registered: !!entry,
|
||||||
records: entry?.records ?? null, category: entry?.category ?? null,
|
records: entry?.records ?? null, category: entry?.category ?? null,
|
||||||
owner: entry?.owner ?? null,
|
owner: entry?.owner ?? null,
|
||||||
|
...(releasedAt !== undefined ? { released_at: releasedAt, release_pending: !(releasedAt > 0) } : {}),
|
||||||
}));
|
}));
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
res.writeHead(400); res.end(JSON.stringify({ error: e.message }));
|
res.writeHead(400); res.end(JSON.stringify({ error: e.message }));
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue