From ba2fbfe2901db35bb0cc688757f7e88dc52ff7b6 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Sun, 15 Feb 2026 16:58:08 -0800 Subject: fix custodial bitcoin sends --- routes/payments.ts | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) (limited to 'routes') diff --git a/routes/payments.ts b/routes/payments.ts index 6bed1309..4bdd0d30 100644 --- a/routes/payments.ts +++ b/routes/payments.ts @@ -89,13 +89,23 @@ export default { aid, }); } else { - p = await sendInternal({ - invoice, - amount, - memo, - recipient, - sender: user, - }); + // Check if recipient account is non-custodial (vault) + const recipientAccount = invoice?.aid ? await g(`account:${invoice.aid}`) : null; + if (recipientAccount?.pubkey || recipientAccount?.seed) { + p = await sendOnchain({ + amount: amount || invoice.amount, + address: invoice.hash, + user, + }); + } else { + p = await sendInternal({ + invoice, + amount, + memo, + recipient, + sender: user, + }); + } } } else if (fund) { p = await debit({ -- cgit v1.2.3