diff options
Diffstat (limited to 'lib/invoices.ts')
| -rw-r--r-- | lib/invoices.ts | 19 |
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) { |
