aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2023-12-29 23:12:05 -0800
committerAdam Soltys <[email protected]>2023-12-29 23:12:05 -0800
commita8fdbec965b1e5c8741e7b6011820f8d640a9b80 (patch)
tree7dc6e3b5de242e1c7641e8a3766dc0374f2c0a53 /src
parentfae074a054b1a5ba923ab7c2da173734bfa6a6a0 (diff)
downloadcoinos-ui-a8fdbec965b1e5c8741e7b6011820f8d640a9b80.tar.gz
coinos-ui-a8fdbec965b1e5c8741e7b6011820f8d640a9b80.zip
get txid from payment hash
Diffstat (limited to 'src')
-rw-r--r--src/routes/(app)/payment/[id]/+page.svelte19
-rw-r--r--src/routes/(app)/send/bitcoin/[address]/+page.svelte3
-rw-r--r--src/routes/(app)/send/bitcoin/[address]/[amount]/[...feeRate]/+page.svelte3
-rw-r--r--src/routes/(app)/send/invoice/[id]/+page.svelte2
-rw-r--r--src/routes/(app)/sent/+page.svelte4
5 files changed, 23 insertions, 8 deletions
diff --git a/src/routes/(app)/payment/[id]/+page.svelte b/src/routes/(app)/payment/[id]/+page.svelte
index df33c323..aaf056a3 100644
--- a/src/routes/(app)/payment/[id]/+page.svelte
+++ b/src/routes/(app)/payment/[id]/+page.svelte
@@ -22,7 +22,19 @@
let { user, payment: p } = data;
let { username } = user;
- let { id, hash, amount, created, rate, type, ref, tip, ourfee, fee, currency } = p;
+ let {
+ id,
+ hash,
+ amount,
+ created,
+ rate,
+ type,
+ ref,
+ tip,
+ ourfee,
+ fee,
+ currency,
+ } = p;
let a = Math.abs(amount);
let print = async () => {
@@ -31,7 +43,6 @@
};
fee = fee || 0;
- let [txid, vout] = ref.split(':');
let direction = "";
onMount(() => {
@@ -142,7 +153,9 @@
<span class="text-lg text-secondary">Txid</span>
<div class="flex">
<div>
- <a href={`${expl}/tx/${txid}#vout=${vout}`} target="_blank" rel="noreferrer">{txid}</a>
+ <a href={`${expl}/tx/${hash}`} target="_blank" rel="noreferrer"
+ >{hash}</a
+ >
</div>
<button
class="flex font-bold hover:opacity-80 mb-auto my-auto"
diff --git a/src/routes/(app)/send/bitcoin/[address]/+page.svelte b/src/routes/(app)/send/bitcoin/[address]/+page.svelte
index 976be5f6..bd54cf83 100644
--- a/src/routes/(app)/send/bitcoin/[address]/+page.svelte
+++ b/src/routes/(app)/send/bitcoin/[address]/+page.svelte
@@ -4,7 +4,7 @@
import Numpad from "$comp/Numpad.svelte";
import { page } from "$app/stores";
import { rate } from "$lib/store";
- import { back, s } from "$lib/utils";
+ import { back, fail, s } from "$lib/utils";
export let data;
@@ -49,6 +49,7 @@
<form action={`/send/bitcoin/${address}/${amount}`}>
<button
+ use:focus
bind:this={submit}
type="submit"
class="opacity-100 hover:opacity-80 rounded-2xl border py-3 font-bold mt-2 bg-black text-white px-4 w-24"
diff --git a/src/routes/(app)/send/bitcoin/[address]/[amount]/[...feeRate]/+page.svelte b/src/routes/(app)/send/bitcoin/[address]/[amount]/[...feeRate]/+page.svelte
index a5811e3c..84506e6b 100644
--- a/src/routes/(app)/send/bitcoin/[address]/[amount]/[...feeRate]/+page.svelte
+++ b/src/routes/(app)/send/bitcoin/[address]/[amount]/[...feeRate]/+page.svelte
@@ -5,7 +5,7 @@
import Icon from "$comp/Icon.svelte";
import Spinner from "$comp/Spinner.svelte";
import { page } from "$app/stores";
- import { fiat as toFiat, f, s, sat, closest } from "$lib/utils";
+ import { fiat as toFiat, f, focus, s, sat, closest } from "$lib/utils";
import { pin } from "$lib/store";
import { goto, invalidate } from "$app/navigation";
import { rate } from "$lib/store";
@@ -122,6 +122,7 @@
<div class="flex justify-center gap-2">
<button
+ use:focus
bind:this={submit}
type="submit"
class="opacity-100 hover:opacity-80 rounded-2xl border py-3 font-bold mt-2 bg-black text-white px-4 w-24"
diff --git a/src/routes/(app)/send/invoice/[id]/+page.svelte b/src/routes/(app)/send/invoice/[id]/+page.svelte
index 6970d74b..c2163a81 100644
--- a/src/routes/(app)/send/invoice/[id]/+page.svelte
+++ b/src/routes/(app)/send/invoice/[id]/+page.svelte
@@ -1,4 +1,4 @@
- <script>
+<script>
import { onDestroy, onMount } from "svelte";
import { t } from "$lib/translations";
import { goto, invalidateAll } from "$app/navigation";
diff --git a/src/routes/(app)/sent/+page.svelte b/src/routes/(app)/sent/+page.svelte
index e2d297de..136bd395 100644
--- a/src/routes/(app)/sent/+page.svelte
+++ b/src/routes/(app)/sent/+page.svelte
@@ -1,5 +1,5 @@
<script>
- import { fiat, f, s, sat, sats } from "$lib/utils";
+ import { fiat, f, focus, s, sat, sats } from "$lib/utils";
import { scale } from "svelte/transition";
import Icon from "$comp/Icon.svelte";
import { toast } from "@zerodevx/svelte-toast";
@@ -43,7 +43,7 @@
</h3>
</div>
-<a href={`/${username}/payments`}>
+<a href={`/${username}/payments`} use:focus>
<div class="opacity-0 w-screen h-screen fixed top-0 left-0 z-50" />
</a>