From 81380a32aedfb815bc9a5cab831470e529367af6 Mon Sep 17 00:00:00 2001 From: Vitor Pamplona Date: Mon, 23 Mar 2026 13:03:18 -0400 Subject: [PATCH] Fixes POCO phone's removal of the + sign in NWC --- .../nip47WalletConnect/Nip47WalletConnect.kt | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip47WalletConnect/Nip47WalletConnect.kt b/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip47WalletConnect/Nip47WalletConnect.kt index 53eb83d7f..73a106017 100644 --- a/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip47WalletConnect/Nip47WalletConnect.kt +++ b/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip47WalletConnect/Nip47WalletConnect.kt @@ -32,10 +32,22 @@ import kotlinx.serialization.Serializable class Nip47WalletConnect { companion object { + fun fix(uri: String): String { + var newUri = uri + + // POCO Phones seem to remove the + sign from the scheme + if (uri.startsWith("nostr walletconnect")) { + newUri = uri.replaceFirst("nostr walletconnect", "nostr+walletconnect") + } else if (uri.startsWith("amethyst walletconnect")) { + newUri = uri.replaceFirst("amethyst walletconnect", "amethyst+walletconnect") + } + + return newUri + } + fun parse(uri: String): Nip47URINorm { // nostr+walletconnect://b889ff5b...?relay=wss%3A%2F%2Frelay.damus.io&secret=...&lud16=user@example.com - - val url = UriParser(uri) + val url = UriParser(fix(uri)) if (url.scheme() != "nostrwalletconnect" && url.scheme() != "nostr+walletconnect" && url.scheme() != "amethyst+walletconnect") { throw IllegalArgumentException("Not a Wallet Connect QR Code")