Expand ecash explorer capabilities
Add Fedimint discovery, dual SQLite/Postgres storage, richer review handling, and generated social imagery.
This commit is contained in:
+13
-2
@@ -1,4 +1,4 @@
|
||||
import type { Health, MintDetail, MintListItem, Stats } from '@cashumints/shared';
|
||||
import type { FedimintDetail, Health, MintDetail, MintListItem, Stats } from '@cashumints/shared';
|
||||
|
||||
/**
|
||||
* Build-time API base. Islands use PUBLIC_API_BASE (see api-client.ts) so the browser
|
||||
@@ -15,10 +15,21 @@ async function get<T>(path: string): Promise<T> {
|
||||
/**
|
||||
* Build-time fetches. A failure here fails the build on purpose: shipping a site with
|
||||
* an empty mint list would be worse than not shipping.
|
||||
*
|
||||
* `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.
|
||||
*/
|
||||
export const fetchMints = (): Promise<MintListItem[]> => get<MintListItem[]>('/api/mints');
|
||||
export const fetchMints = (): Promise<MintListItem[]> => get<MintListItem[]>('/api/mints?type=cashu');
|
||||
export const fetchFedimints = (): Promise<MintListItem[]> =>
|
||||
get<MintListItem[]>('/api/mints?type=fedimint');
|
||||
export const fetchMint = (host: string): Promise<MintDetail> =>
|
||||
get<MintDetail>(`/api/mints/${encodeURIComponent(host)}`);
|
||||
/** 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 fetchStats = (): Promise<Stats> => get<Stats>('/api/stats');
|
||||
|
||||
/** Health is allowed to be down at build time: the ticker just renders without it. */
|
||||
|
||||
Reference in New Issue
Block a user