diff options
| author | Adam Soltys <[email protected]> | 2024-01-02 15:18:58 -0800 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2024-01-02 15:18:58 -0800 |
| commit | c4a7b68048d389cac3c68797ce4a44bca7979d17 (patch) | |
| tree | 81db583c95094fda89fc10559dcc63e00cdb9b5c /src/routes/(app)/send | |
| parent | 4e37c853b1014637f12455c44cb49861343ed918 (diff) | |
| download | coinos-ui-c4a7b68048d389cac3c68797ce4a44bca7979d17.tar.gz coinos-ui-c4a7b68048d389cac3c68797ce4a44bca7979d17.zip | |
liquid payments
Diffstat (limited to 'src/routes/(app)/send')
| -rw-r--r-- | src/routes/(app)/send/[...text]/+page.server.js | 4 | ||||
| -rw-r--r-- | src/routes/(app)/send/bitcoin/[address]/[amount]/[...feeRate]/+page.server.js | 8 |
2 files changed, 3 insertions, 9 deletions
diff --git a/src/routes/(app)/send/[...text]/+page.server.js b/src/routes/(app)/send/[...text]/+page.server.js index 3e6b7c13..73a44512 100644 --- a/src/routes/(app)/send/[...text]/+page.server.js +++ b/src/routes/(app)/send/[...text]/+page.server.js @@ -1,6 +1,6 @@ import { validate } from "bitcoin-address-validation"; import bip21 from "bip21"; -import { auth, get, post } from "$lib/utils"; +import { auth, get, isLiquid, post } from "$lib/utils"; import { fail, redirect } from "@sveltejs/kit"; import { PUBLIC_DOMAIN } from "$env/static/public"; @@ -46,7 +46,7 @@ let parse = async (t, host) => { } // bitcoin - if (validate(t)) { + if (validate(t) || isLiquid(t)) { try { ({ id, user } = await get(`/invoice/${t}`)); } catch (e) { diff --git a/src/routes/(app)/send/bitcoin/[address]/[amount]/[...feeRate]/+page.server.js b/src/routes/(app)/send/bitcoin/[address]/[amount]/[...feeRate]/+page.server.js index 86f9fde8..6f735f32 100644 --- a/src/routes/(app)/send/bitcoin/[address]/[amount]/[...feeRate]/+page.server.js +++ b/src/routes/(app)/send/bitcoin/[address]/[amount]/[...feeRate]/+page.server.js @@ -5,13 +5,7 @@ let seen = {}; export async function load({ params: { address, amount, feeRate }, cookies }) { try { - let fees = await fetch( - `https://mempool.space/api/v1/fees/recommended` - ).then((r) => r.json()); - - if (!feeRate) feeRate = fees.halfHourFee; - - let { fee, ourfee, hex } = await post( + let { fee, fees, ourfee, hex } = await post( "/bitcoin/fee", { address, amount, feeRate }, auth(cookies) |
