mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2025-02-28 05:50:15 +00:00
do not allow taproot address as a simplex receiving address
This commit is contained in:
parent
87ca5b909d
commit
0e0f9803cb
1 changed files with 19 additions and 0 deletions
|
@ -154,6 +154,8 @@ class _BuyFormState extends ConsumerState<BuyForm> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
String _receivingAddressValidationErrorString = "";
|
||||||
|
|
||||||
void selectCrypto() async {
|
void selectCrypto() async {
|
||||||
if (ref.read(simplexProvider).supportedCryptos.isEmpty) {
|
if (ref.read(simplexProvider).supportedCryptos.isEmpty) {
|
||||||
bool shouldPop = false;
|
bool shouldPop = false;
|
||||||
|
@ -1218,6 +1220,15 @@ class _BuyFormState extends ConsumerState<BuyForm> {
|
||||||
_address = newValue;
|
_address = newValue;
|
||||||
setState(() {
|
setState(() {
|
||||||
_addressToggleFlag = newValue.isNotEmpty;
|
_addressToggleFlag = newValue.isNotEmpty;
|
||||||
|
|
||||||
|
// TODO [prio=low]: Validate address.
|
||||||
|
if (newValue.startsWith("bc1p")) {
|
||||||
|
// Display an error message or handle invalid address
|
||||||
|
_receivingAddressValidationErrorString =
|
||||||
|
"Taproot addresses are not allowed.";
|
||||||
|
} else {
|
||||||
|
_receivingAddressValidationErrorString = "";
|
||||||
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
focusNode: _receiveAddressFocusNode,
|
focusNode: _receiveAddressFocusNode,
|
||||||
|
@ -1430,6 +1441,14 @@ class _BuyFormState extends ConsumerState<BuyForm> {
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: isDesktop ? 10 : 4,
|
||||||
|
),
|
||||||
|
if (_receivingAddressValidationErrorString.isNotEmpty)
|
||||||
|
Text(
|
||||||
|
_receivingAddressValidationErrorString,
|
||||||
|
style: STextStyles.errorSmall(context),
|
||||||
|
),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: isDesktop ? 20 : 12,
|
height: isDesktop ? 20 : 12,
|
||||||
),
|
),
|
||||||
|
|
Loading…
Reference in a new issue