aboutsummaryrefslogtreecommitdiffstats
path: root/lib/invoices.ts
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2025-11-26 22:36:59 -0800
committerAdam Soltys <[email protected]>2026-02-06 08:58:10 -0800
commitbc953b56f3908e3a557976b9029b617dad751755 (patch)
tree6e65399fd615c6cf5c7e9382b212a707531e4886 /lib/invoices.ts
parente95e3b8e35a858cc200de6c0b74e3e172e4f6d6e (diff)
downloadcoinos-server-bc953b56f3908e3a557976b9029b617dad751755.tar.gz
coinos-server-bc953b56f3908e3a557976b9029b617dad751755.zip
ark
Diffstat (limited to 'lib/invoices.ts')
-rw-r--r--lib/invoices.ts19
1 files changed, 9 insertions, 10 deletions
diff --git a/lib/invoices.ts b/lib/invoices.ts
index 9666d217..6ddffe54 100644
--- a/lib/invoices.ts
+++ b/lib/invoices.ts
@@ -63,17 +63,16 @@ export const generate = async ({ invoice, user }) => {
let text;
let paymentHash;
- if (account.seed) {
- if (type !== PaymentType.ark) {
- type = PaymentType.bitcoin;
- const node = rpc({ ...config[type], wallet: aid });
- hash = await node.getNewAddress({ address_type });
- text = bip21(hash, invoice);
+ if (account.type === "ark") {
+ type = PaymentType.ark;
+ text = account.arkAddress;
+ } else if (account.seed) {
+ type = PaymentType.bitcoin;
+ const node = rpc({ ...config[type], wallet: aid });
+ hash = await node.getNewAddress({ address_type });
+ text = bip21(hash, invoice);
- ({ hdkeypath: path } = await node.getAddressInfo(hash));
- } else {
- text = hash;
- }
+ ({ hdkeypath: path } = await node.getAddressInfo(hash));
} else if (type === PaymentType.lightning) {
let r;
if (bolt11) {