Skip to content

Commit 2d2a1dd

Browse files
committed
feat: allow dashes in wallet uri scheme
monero_wallet worked. now monero-wallet works, too there's a frustrating variety of xmr wallet uri schemes: some with underscores, some with dashes
1 parent c8e50d7 commit 2d2a1dd

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

lib/utilities/address_utils.dart

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,13 @@ class AddressUtils {
198198
static Map<String, dynamic>? _parseWalletUri(String uri) {
199199
final String scheme;
200200
final Map<String, dynamic> parsedData = {};
201+
202+
final rawScheme = uri.split(":")[0];
203+
final normalizedScheme = rawScheme.replaceAll("-", "_");
204+
if (normalizedScheme != rawScheme) {
205+
uri = normalizedScheme + uri.substring(rawScheme.length);
206+
}
207+
201208
if (uri.split(":")[0].contains("_")) {
202209
// We need to check if the uri is compatible because RFC 3986
203210
// does not allow underscores in the scheme.

0 commit comments

Comments
 (0)