aboutsummaryrefslogtreecommitdiffstats
path: root/src/routes/launch/purchase/+page.server.js
blob: 48c5c7d3bdc94e6836e7f3e83ee0ab750e719d7c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import { auth, get, post } from '$lib/utils';
import tickets from "$lib/tickets";

export const load = () => get('/ticket');

export const actions = {
	default: async ({ cookies, request }) => {
		let { ticket } = Object.fromEntries(await request.formData());

		let r = await post(
			'/assets',
			{
				name: 'Launch Party Ticket',
				ticker: 'LPT',
				precision: 0,
				asset_amount: '1',
				token_amount: 0,
				domain: 'coinos.io',
        filename: tickets[ticket],
			},
			auth(cookies)
		);

		console.log(r);
	}
};