From 82bad3a951f25f6be16d63c0a1a402445efd41b8 Mon Sep 17 00:00:00 2001 From: OmarHatem Date: Wed, 11 Dec 2024 19:30:56 +0200 Subject: [PATCH] fix regex for xrp and wow --- lib/core/address_validator.dart | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/core/address_validator.dart b/lib/core/address_validator.dart index c122a872b..387b91dcc 100644 --- a/lib/core/address_validator.dart +++ b/lib/core/address_validator.dart @@ -80,7 +80,7 @@ class AddressValidator extends TextValidator { case CryptoCurrency.shib: pattern = '0x[0-9a-zA-Z]+'; case CryptoCurrency.xrp: - pattern = '[0-9a-zA-Z]{34}|X[0-9a-zA-Z]{46}'; + pattern = '[0-9a-zA-Z]{34}|[0-9a-zA-Z]{33}|X[0-9a-zA-Z]{46}'; case CryptoCurrency.xhv: pattern = 'hvx|hvi|hvs[0-9a-zA-Z]+'; case CryptoCurrency.xag: @@ -282,10 +282,14 @@ class AddressValidator extends TextValidator { switch (type) { case CryptoCurrency.xmr: - case CryptoCurrency.wow: pattern = '(4[0-9a-zA-Z]{94})' '|(8[0-9a-zA-Z]{94})' '|([0-9a-zA-Z]{106})'; + case CryptoCurrency.wow: + pattern = '(W[0-9a-zA-Z]{94})' + '|(W[0-9a-zA-Z]{94})' + '|(W[0-9a-zA-Z]{96})' + '|([0-9a-zA-Z]{106})'; case CryptoCurrency.btc: pattern = '${P2pkhAddress.regex.pattern}|${P2shAddress.regex.pattern}|${P2wpkhAddress.regex.pattern}|${P2trAddress.regex.pattern}|${P2wshAddress.regex.pattern}|${SilentPaymentAddress.regex.pattern}';