diff options
Diffstat (limited to 'lib/utils.js')
| -rw-r--r-- | lib/utils.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/utils.js b/lib/utils.js index 1e12214b..0c382a0c 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -27,8 +27,9 @@ export const uniq = (a, k) => [...new Map(a.map((x) => [k(x), x])).values()]; export const pick = (O, K) => K.reduce((o, k) => (typeof O[k] !== "undefined" && (o[k] = O[k]), o), {}); -export const bip21 = (address, { amount, memo, tip }) => { - let url = amount || memo ? `bitcoin:${address}?` : address; +export const bip21 = (address, { amount, memo, tip, type }) => { + let network = { liquid: "liquidnetwork", bitcoin: "bitcoin" }[type]; + let url = amount || memo ? `${network}:${address}?` : address; if (amount) url += `amount=${((amount + tip) / SATS).toFixed(8)}${memo ? "&" : ""}`; if (memo) url += `message=${memo}`; |
