Ship LNURL mint pages, indexing UI, and reviews rewrite.

Add lnurl list/detail routes, OG fixtures, i18n strings, and the write/
index client flows so the site surfaces the new mint type end to end.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
michilis
2026-08-22 03:44:43 +02:00
co-authored by Cursor
parent 2a9444942b
commit c74c7fc187
66 changed files with 7603 additions and 1241 deletions
+32 -4
View File
@@ -1,4 +1,7 @@
import type { FedimintDetail, Health, MintDetail, MintListItem, Stats } from '@cashumints/shared';
import { ECOSYSTEMS } from '@cashumints/shared';
import type {
FedimintDetail, Health, LnurlDetail, MintDetail, MintListItem, Stats,
} from '@cashumints/shared';
/**
* Build-time API base. Islands use PUBLIC_API_BASE (see api-client.ts) so the browser
@@ -18,9 +21,9 @@ async function get<T>(path: string): Promise<T> {
*
* `fetchMints` asks for `type=cashu` rather than for everything, which is what keeps
* /mints, the mint pages, the home page grid and the sitemap's mint entries meaning
* exactly what they meant before federations were indexed. Federations are their own
* call, their own pages and their own count; nothing has to filter a mixed list and
* nothing silently grew.
* exactly what they meant before federations were indexed. Each ecosystem is its own
* call, its own pages and its own count; nothing has to filter a mixed list and nothing
* silently grew when a second or a third was added.
*/
export const fetchMints = (): Promise<MintListItem[]> => get<MintListItem[]>('/api/mints?type=cashu');
export const fetchFedimints = (): Promise<MintListItem[]> =>
@@ -30,8 +33,33 @@ export const fetchMint = (host: string): Promise<MintDetail> =>
/** The same endpoint, typed for a federation's flattened fields. */
export const fetchFedimint = (host: string): Promise<FedimintDetail> =>
get<FedimintDetail>(`/api/mints/${encodeURIComponent(host)}`);
export const fetchLnurlMints = (): Promise<MintListItem[]> =>
get<MintListItem[]>('/api/mints?type=lnurl');
/** The same endpoint again, typed for an LNURL mint's flattened fields. */
export const fetchLnurlMint = (host: string): Promise<LnurlDetail> =>
get<LnurlDetail>(`/api/mints/${encodeURIComponent(host)}`);
export const fetchStats = (): Promise<Stats> => get<Stats>('/api/stats');
/**
* Every ecosystem's listing, in `ECOSYSTEMS` order, fetched together.
*
* For the pages that are about *all* of them rather than one — /reviews and the home
* page's review strip — where naming each ecosystem's fetch by hand is exactly the kind
* of list that gets one entry short. The filter pills on /reviews are already built from
* `ECOSYSTEMS`, so before this existed a new ecosystem got a pill that could never match
* anything: the pill came from that list and the data did not. This closes that gap, and
* a fourth ecosystem now needs no edit on either side.
*
* One request per ecosystem rather than a single unfiltered `/api/mints`, deliberately:
* the per-type responses are what every other page already asks for, so they are warm in
* the API's own path, and a caller gets them back already grouped.
*/
export async function fetchAllListings(): Promise<MintListItem[][]> {
return Promise.all(
ECOSYSTEMS.map((type) => get<MintListItem[]>(`/api/mints?type=${encodeURIComponent(type)}`)),
);
}
/** Health is allowed to be down at build time: the ticker just renders without it. */
export async function fetchHealth(): Promise<Health | null> {
try {