feat: create GET '/api/v1/ditto/cashu/mints' endpoint

This commit is contained in:
P. Reis 2025-02-12 16:33:56 -03:00
parent 7095519198
commit 96a16a9fd0
2 changed files with 11 additions and 0 deletions

View file

@ -295,6 +295,10 @@ class Conf {
static get preferredLanguages(): LanguageCode[] | undefined {
return Deno.env.get('DITTO_LANGUAGES')?.split(',')?.filter(ISO6391.validate);
}
/** Mints to be displayed in the UI when the user decides to create a wallet.*/
static get cashuMints(): string[] {
return Deno.env.get('CASHU_MINTS')?.split(',') ?? [];
}
/** Translation provider used to translate posts. */
static get translationProvider(): string | undefined {
return Deno.env.get('TRANSLATION_PROVIDER');

View file

@ -165,4 +165,11 @@ app.get('/wallet', requireNip44Signer, swapNutzapsMiddleware, async (c) => {
return c.json(walletEntity, 200);
});
/** Get mints set by the CASHU_MINTS environment variable. */
app.get('/mints', (c) => {
const mints = Conf.cashuMints;
return c.json({ mints }, 200);
});
export default app;