Skip to content

Commit

Permalink
Use the liquidnetwork: protocol for liquid QRs
Browse files Browse the repository at this point in the history
  • Loading branch information
shesek committed Aug 6, 2020
1 parent 0af3aca commit 6f252e5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion client/src/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { nativeAssetId } from './const'
const BLIND_PREFIX = +process.env.BLIND_PREFIX || 0x0c
, reHash256 = /^[a-f0-9]{64}$/i
, reBech32 = /^[a-z]{1,83}1[ac-hj-np-z02-9]{6,100}$/
, qrPrefix = process.env.IS_ELEMENTS ? 'liquidnetwork' : 'bitcoin'

// not null or undefined
export const notNully = x => x != null
Expand Down Expand Up @@ -87,7 +88,7 @@ export const processGoAddr =
}

export const makeAddressQR = addr => {
let qrstr = `bitcoin:${addr}`
let qrstr = `${qrPrefix}:${addr}`
return qrcode.toDataURL(
// upper-case bech32 addresses to enable the compact qr encoding mode
reBech32.test(addr) ? qrstr.toUpperCase() : qrstr
Expand Down

0 comments on commit 6f252e5

Please sign in to comment.