From fdfb55d3e259c05bf7523c7308de0f1b8529f923 Mon Sep 17 00:00:00 2001 From: Matheus Marrane Date: Sun, 5 Jan 2025 14:23:52 -0300 Subject: [PATCH] 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. --- class/deeplink-schema-match.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/class/deeplink-schema-match.ts b/class/deeplink-schema-match.ts index 1b36387ad..27d3c0c20 100644 --- a/class/deeplink-schema-match.ts +++ b/class/deeplink-schema-match.ts @@ -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];