aboutsummaryrefslogtreecommitdiffstats
path: root/src/routes/send
diff options
context:
space:
mode:
Diffstat (limited to 'src/routes/send')
-rw-r--r--src/routes/send/bitcoin/[address]/+page.server.js9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/routes/send/bitcoin/[address]/+page.server.js b/src/routes/send/bitcoin/[address]/+page.server.js
index fa440394..4cc3736d 100644
--- a/src/routes/send/bitcoin/[address]/+page.server.js
+++ b/src/routes/send/bitcoin/[address]/+page.server.js
@@ -1,8 +1,11 @@
import { redirect } from '@sveltejs/kit';
+import { btc as asset, auth, post } from '$lib/utils';
+
export const actions = {
default: async ({ request }) => {
- let form = Object.fromEntries(await request.formData());
- console.log('send bitcoin', form);
- throw redirect(307, '/');
+ let { address, amount } = Object.fromEntries(await request.formData());
+ let { tx } = await post('/bitcoin/fee', { address, amount, asset }, auth(request));
+ await post('/bitcoin/send', { address, tx }, auth(request));
+ throw redirect(307, '/sent');
}
};