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
795c83ee88
commit
3418871a70
2 changed files with 14 additions and 6 deletions
|
|
@ -283,3 +283,16 @@ Deno.test('GET /wallet must be successful', {
|
||||||
balance: 100,
|
balance: 100,
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Deno.test('GET /mints must be successful', {}, async () => {
|
||||||
|
const app = new Hono<AppEnv>().route('/', cashuApp);
|
||||||
|
|
||||||
|
const response = await app.request('/mints', {
|
||||||
|
method: 'GET',
|
||||||
|
});
|
||||||
|
|
||||||
|
const body = await response.json();
|
||||||
|
|
||||||
|
assertEquals(response.status, 200);
|
||||||
|
assertEquals(body, { mints: [] });
|
||||||
|
});
|
||||||
|
|
|
||||||
|
|
@ -19,12 +19,6 @@ type Wallet = z.infer<typeof walletSchema>;
|
||||||
|
|
||||||
const app = new Hono().use('*', storeMiddleware, signerMiddleware);
|
const app = new Hono().use('*', storeMiddleware, signerMiddleware);
|
||||||
|
|
||||||
// CASHU_MINTS = ['https://mint.cashu.io/1', 'https://mint.cashu.io/2', 'https://mint.cashu.io/3']
|
|
||||||
|
|
||||||
// Mint: https://github.com/cashubtc/nuts/blob/main/06.md
|
|
||||||
|
|
||||||
// app.get('/mints') -> Mint[]
|
|
||||||
|
|
||||||
// app.delete('/wallet') -> 204
|
// app.delete('/wallet') -> 204
|
||||||
|
|
||||||
// app.post(swapMiddleware, '/nutzap');
|
// app.post(swapMiddleware, '/nutzap');
|
||||||
|
|
@ -167,6 +161,7 @@ app.get('/wallet', requireNip44Signer, swapNutzapsMiddleware, async (c) => {
|
||||||
|
|
||||||
/** Get mints set by the CASHU_MINTS environment variable. */
|
/** Get mints set by the CASHU_MINTS environment variable. */
|
||||||
app.get('/mints', (c) => {
|
app.get('/mints', (c) => {
|
||||||
|
// TODO: Return full Mint information: https://github.com/cashubtc/nuts/blob/main/06.md
|
||||||
const mints = Conf.cashuMints;
|
const mints = Conf.cashuMints;
|
||||||
|
|
||||||
return c.json({ mints }, 200);
|
return c.json({ mints }, 200);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue