From 6ca2a5d8ed2e44d744635a5ed19b33dd1486a950 Mon Sep 17 00:00:00 2001 From: Matthew Fosse Date: Wed, 6 Mar 2024 08:08:56 -0800 Subject: [PATCH] review fixes --- lib/core/address_validator.dart | 4 +++- lib/entities/provider_types.dart | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/core/address_validator.dart b/lib/core/address_validator.dart index 0304db0d7..ee3ea7e9c 100644 --- a/lib/core/address_validator.dart +++ b/lib/core/address_validator.dart @@ -270,12 +270,14 @@ class AddressValidator extends TextValidator { '|([^0-9a-zA-Z]|^)8[0-9a-zA-Z]{94}([^0-9a-zA-Z]|\$)' '|([^0-9a-zA-Z]|^)[0-9a-zA-Z]{106}([^0-9a-zA-Z]|\$)'; case CryptoCurrency.btc: - case CryptoCurrency.btcln: return '([^0-9a-zA-Z]|^)([1mn][a-km-zA-HJ-NP-Z1-9]{25,34})([^0-9a-zA-Z]|\$)' //P2pkhAddress type '|([^0-9a-zA-Z]|^)([23][a-km-zA-HJ-NP-Z1-9]{25,34})([^0-9a-zA-Z]|\$)' //P2shAddress type '|([^0-9a-zA-Z]|^)((bc|tb)1q[ac-hj-np-z02-9]{25,39})([^0-9a-zA-Z]|\$)' //P2wpkhAddress type '|([^0-9a-zA-Z]|^)((bc|tb)1q[ac-hj-np-z02-9]{40,80})([^0-9a-zA-Z]|\$)' //P2wshAddress type '|([^0-9a-zA-Z]|^)((bc|tb)1p([ac-hj-np-z02-9]{39}|[ac-hj-np-z02-9]{59}|[ac-hj-np-z02-9]{8,89}))([^0-9a-zA-Z]|\$)'; //P2trAddress type + case CryptoCurrency.btcln: + // bolt11: + return '(lnbc|LNBC)([0-9]{1,}[a-zA-Z0-9]+)([^0-9a-zA-Z]|\$)'; case CryptoCurrency.ltc: return '([^0-9a-zA-Z]|^)^L[a-zA-Z0-9]{26,33}([^0-9a-zA-Z]|\$)' '|([^0-9a-zA-Z]|^)[LM][a-km-zA-HJ-NP-Z1-9]{26,33}([^0-9a-zA-Z]|\$)' diff --git a/lib/entities/provider_types.dart b/lib/entities/provider_types.dart index 9bdee457c..8f48c2bd4 100644 --- a/lib/entities/provider_types.dart +++ b/lib/entities/provider_types.dart @@ -55,7 +55,6 @@ class ProvidersHelper { case WalletType.monero: return [ProviderType.askEachTime, ProviderType.onramper, ProviderType.dfx]; case WalletType.bitcoin: - case WalletType.lightning: case WalletType.ethereum: return [ ProviderType.askEachTime, @@ -71,6 +70,7 @@ class ProvidersHelper { case WalletType.solana: return [ProviderType.askEachTime, ProviderType.onramper, ProviderType.robinhood]; case WalletType.none: + case WalletType.lightning: case WalletType.haven: return []; } @@ -79,7 +79,6 @@ class ProvidersHelper { static List getAvailableSellProviderTypes(WalletType walletType) { switch (walletType) { case WalletType.bitcoin: - case WalletType.lightning: case WalletType.ethereum: return [ ProviderType.askEachTime, @@ -102,6 +101,7 @@ class ProvidersHelper { case WalletType.monero: case WalletType.nano: case WalletType.banano: + case WalletType.lightning: case WalletType.none: case WalletType.haven: return [];