mirror of
https://gitlab.com/soapbox-pub/ditto.git
synced 2025-12-06 11:29:46 +00:00
feat: create GET '/api/v1/ditto/cashu/mints' endpoint
This commit is contained in:
parent
7095519198
commit
96a16a9fd0
2 changed files with 11 additions and 0 deletions
|
|
@ -295,6 +295,10 @@ class Conf {
|
||||||
static get preferredLanguages(): LanguageCode[] | undefined {
|
static get preferredLanguages(): LanguageCode[] | undefined {
|
||||||
return Deno.env.get('DITTO_LANGUAGES')?.split(',')?.filter(ISO6391.validate);
|
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. */
|
/** Translation provider used to translate posts. */
|
||||||
static get translationProvider(): string | undefined {
|
static get translationProvider(): string | undefined {
|
||||||
return Deno.env.get('TRANSLATION_PROVIDER');
|
return Deno.env.get('TRANSLATION_PROVIDER');
|
||||||
|
|
|
||||||
|
|
@ -165,4 +165,11 @@ app.get('/wallet', requireNip44Signer, swapNutzapsMiddleware, async (c) => {
|
||||||
return c.json(walletEntity, 200);
|
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;
|
export default app;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue