blob: c77784d7f39732233238081fd3c76dd4edff0c35 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
import { json as json$1 } from '@sveltejs/kit';
import { post } from '$lib/utils';
import { user } from '$lib/store';
let network = 'lightning';
export async function POST({ request }) {
let { amount, rate, username, text } = await request.json();
if (!text) ({ text } = await post('/lightning/invoice', { amount }));
let { uuid: id } = await post('/invoice', {
invoice: { amount, currency: user.currency, network, rate, text },
user: { username }
});
return json$1({ id });
}
|