aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2022-09-26 11:34:05 -0700
committerAdam Soltys <[email protected]>2022-09-26 11:34:05 -0700
commit7881ecd6a4fcbb820ee1607f1e7f6fcc3ce15dfe (patch)
treeee412893ed38e042714ae53400074c0f3714193f
parentb195948670ec57c14cf51b92839a57b8f34c9194 (diff)
downloadcoinos-ui-7881ecd6a4fcbb820ee1607f1e7f6fcc3ce15dfe.tar.gz
coinos-ui-7881ecd6a4fcbb820ee1607f1e7f6fcc3ce15dfe.zip
use invoice uuid
-rw-r--r--src/routes/[username]/receive/+page.svelte4
-rw-r--r--src/routes/invoice/+server.js2
2 files changed, 3 insertions, 3 deletions
diff --git a/src/routes/[username]/receive/+page.svelte b/src/routes/[username]/receive/+page.svelte
index f10e0426..17b59f1f 100644
--- a/src/routes/[username]/receive/+page.svelte
+++ b/src/routes/[username]/receive/+page.svelte
@@ -75,12 +75,12 @@
let submit = async () => {
loading = true;
- let { id } = await post('/invoice', {
+ let { uuid } = await post('/invoice', {
amount,
rate: $selectedRate,
username: $page.params.username
});
- goto(`/invoice/${id}`);
+ goto(`/invoice/${uuid}`);
};
</script>
diff --git a/src/routes/invoice/+server.js b/src/routes/invoice/+server.js
index 1a196bcf..c408c4e5 100644
--- a/src/routes/invoice/+server.js
+++ b/src/routes/invoice/+server.js
@@ -7,7 +7,7 @@ export async function POST({ request, parent }) {
if (network === 'lightning') {
invoice.text = (await post('/lightning/invoice', { amount }, auth(request))).text;
} else {
- invoice.address = (await parent()).user.address;
+ invoice.address = (await get('/address?network=bitcoin&type=bech32')).address;
}
console.log("INVOICE", invoice)