From 40fc5fe98c08357dff41539de48532d554aa73cb Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Sat, 14 Feb 2026 15:46:09 -0800 Subject: custodial ark sends --- src/components/Account.svelte | 2 +- src/components/InvoiceActions.svelte | 2 +- src/components/InvoiceTypes.svelte | 17 +++++++++++--- src/lib/ark.ts | 14 +++++++++++- src/locales/en.json | 6 ++--- src/routes/(app)/+layout.svelte | 21 +++++++++++++---- src/routes/(app)/[username]/(profile)/+page.svelte | 17 +++++--------- src/routes/(app)/account/[id]/+page.svelte | 26 ++++++++++------------ src/routes/(app)/invoice/[id]/+page.svelte | 2 +- 9 files changed, 68 insertions(+), 39 deletions(-) (limited to 'src') diff --git a/src/components/Account.svelte b/src/components/Account.svelte index b077c30b..adea5c70 100644 --- a/src/components/Account.svelte +++ b/src/components/Account.svelte @@ -146,7 +146,7 @@ {/if} -
+
{#if isArk} Ark diff --git a/src/components/InvoiceActions.svelte b/src/components/InvoiceActions.svelte index 53447fec..e7fb57e3 100644 --- a/src/components/InvoiceActions.svelte +++ b/src/components/InvoiceActions.svelte @@ -90,7 +90,7 @@ {/if} - {#if !account?.seed && !(account?.pubkey && account?.fingerprint)} + {#if !account?.seed && !(account?.pubkey && account?.fingerprint) && account?.type !== "ark"} + +
diff --git a/src/lib/ark.ts b/src/lib/ark.ts index b9902a5a..dcc42868 100644 --- a/src/lib/ark.ts +++ b/src/lib/ark.ts @@ -125,7 +125,19 @@ export const sendArk = async (address: string, amount: number) => { arkSending = true; try { - const txid = await wallet.sendBitcoin({ address, amount }); + let txid; + try { + txid = await wallet.sendBitcoin({ address, amount }); + } catch (e: any) { + if (e?.message?.includes("VTXO_ALREADY_REGISTERED")) { + await wallet.settle(); + const vtxos = await wallet.getVtxos({ spendableOnly: false }); + if (vtxos?.length) addProcessedVtxos(vtxos.map(vtxoKey)); + txid = await wallet.sendBitcoin({ address, amount }); + } else { + throw e; + } + } // Mark post-send VTXOs as processed so notifyIncomingFunds // ignores change VTXOs from this send diff --git a/src/locales/en.json b/src/locales/en.json index 9f23dd47..2ed0d54d 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -53,7 +53,7 @@ "revealMnemonic": "Reveal seed phrase", "regenerate": "Regenerate", "deleteAccount": "Delete account", - "addAccount": "Create a non-custodial account", + "addAccount": "Add account", "create": "Create", "import": "Import", "accountSetup": "Account setup", @@ -101,7 +101,7 @@ "dm": { "chatHeader": "Chats", "newChatHeader": "New Chat", - "header": "Direct Messages", + "header": "Messages", "searchPrompt": "username, nip-05 or pubkey", "findByUsername": "Find by username", "findByNIP05": "Find by NIP-05", @@ -244,7 +244,7 @@ "light": "Light", "about": "About", "docs": "Docs", - "dm": "Nostr Messages", + "dm": "Messages", "messages": "Messages", "funds": "Funds", "map": "Map", diff --git a/src/routes/(app)/+layout.svelte b/src/routes/(app)/+layout.svelte index 2c96fc7c..2d252385 100644 --- a/src/routes/(app)/+layout.svelte +++ b/src/routes/(app)/+layout.svelte @@ -1,5 +1,5 @@
-

{$t("payments.accountSettings")}

+

+ {#if account.type === "ark"} + Ark + {:else if seed} + + {:else} + Coinos + {/if} + {displayType} {$t("payments.accountSettings").toLowerCase()} +

-
- {$t("accounts.accountType")}: - {#if account.type === "ark"} - Ark - {:else if seed} - - {:else} - Coinos - {/if} - {displayType} -
@@ -213,7 +211,7 @@ {/if} - {#if seed} + {#if seed || account.type === "ark"}