fix: ensure bech32 addresses use uppercase as per BIP 0173

- Adjusted QR code generation to use uppercase for bech32 addresses, aligning with BIP 0173 specifications for optimal QR encoding efficiency.
This commit is contained in:
Matheus Marrane 2025-01-05 14:23:52 -03:00 committed by Overtorment
parent 421b30a130
commit fdfb55d3e2

View file

@ -413,6 +413,12 @@ class DeeplinkSchemaMatch {
}
static bip21encode(address: string, options: TOptions): string {
//uppercase address if bech32 to satisfy BIP_0173
const isBech32 = address.startsWith('bc1');
if (isBech32) {
address = address.toUpperCase();
}
for (const key in options) {
if (key === 'label' && String(options[key]).replace(' ', '').length === 0) {
delete options[key];