aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2025-01-15 12:45:31 -0800
committerAdam Soltys <[email protected]>2025-01-15 12:45:31 -0800
commit273afd10bb321c1ac23ce14aba9f61b6ffe1e910 (patch)
tree204fc74ab91522f2731debd435a420657cb781f5 /lib
parentf850f8f2a5b9a6ee9c038d5231bdb9c2db98fad0 (diff)
downloadcoinos-server-273afd10bb321c1ac23ce14aba9f61b6ffe1e910.tar.gz
coinos-server-273afd10bb321c1ac23ce14aba9f61b6ffe1e910.zip
sign endpoint
Diffstat (limited to 'lib')
-rw-r--r--lib/invoices.ts7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/invoices.ts b/lib/invoices.ts
index 0957231a..b158592c 100644
--- a/lib/invoices.ts
+++ b/lib/invoices.ts
@@ -13,6 +13,7 @@ const lq = rpc(config.liquid);
export const generate = async ({ invoice, user }) => {
let {
+ address_type = "bech32",
bolt11,
aid,
currency,
@@ -60,7 +61,7 @@ export const generate = async ({ invoice, user }) => {
if (account.seed) {
type = "bitcoin";
const node = rpc({ ...config[type], wallet: aid });
- hash = await node.getNewAddress();
+ hash = await node.getNewAddress({ address_type });
text = bip21(hash, invoice);
({ hdkeypath: path } = await node.getAddressInfo(hash));
@@ -100,10 +101,10 @@ export const generate = async ({ invoice, user }) => {
await s(`invoice:${r.offer_id}`, id);
} else if (type === types.bitcoin) {
- hash = await bc.getNewAddress();
+ hash = await bc.getNewAddress({ address_type });
text = bip21(hash, invoice);
} else if (type === types.liquid) {
- hash = await lq.getNewAddress();
+ hash = await lq.getNewAddress({ address_type });
text = bip21(hash, invoice);
} else if (type === types.internal) {
hash = id;