fix: Minor fixes - Solana (#2737)

* fix: Minor fixes

* refactor: handle updates to connectivity status for swipe to send button

* fix: Remove Future.wait
This commit is contained in:
David Adegoke
2025-12-24 04:24:23 +01:00
committed by GitHub
parent ab0e3b65ed
commit f5754ed2d3
6 changed files with 46 additions and 35 deletions
+1 -1
View File
@@ -458,7 +458,7 @@ class SolanaWalletClient {
}
if (i + batchSize < signatures.length) {
await Future.delayed(const Duration(milliseconds: 300));
await Future.delayed(const Duration(milliseconds: 100));
}
}
+3 -2
View File
@@ -145,6 +145,7 @@ abstract class SolanaWalletBase
await walletAddresses.init();
await transactionHistory.init();
await save();
}
@@ -227,8 +228,8 @@ abstract class SolanaWalletBase
await _updateBalance();
final transactionCurrency = balance.keys.firstWhere(
(currency) =>
currency.title == credentials.currency.title &&
(currency) =>
currency.title == credentials.currency.title &&
currency.tag == credentials.currency.tag,
orElse: () => throw Exception(
'Currency ${credentials.currency.title} ${credentials.currency.tag} is not accessible in the wallet, try to enable it first.'));
@@ -144,13 +144,11 @@ class AddressPage extends BasePage {
child: Column(
children: <Widget>[
Expanded(
child: Observer(
builder: (_) => QRWidget(
formKey: _formKey,
addressListViewModel: addressListViewModel,
amountTextFieldFocusNode: _cryptoAmountFocus,
amountController: _amountController,
),
child: QRWidget(
formKey: _formKey,
addressListViewModel: addressListViewModel,
amountTextFieldFocusNode: _cryptoAmountFocus,
amountController: _amountController,
),
),
SizedBox(height: 16),
+28 -24
View File
@@ -576,30 +576,34 @@ class SendPage extends BasePage {
isDismissible: false,
isScrollControlled: true,
builder: (BuildContext bottomSheetContext) {
return ConfirmSendingBottomSheet(
key: ValueKey('send_page_confirm_sending_bottom_sheet_key'),
titleText: S.of(bottomSheetContext).confirm_transaction,
accessibleNavigationModeSlideActionButtonText: S.of(bottomSheetContext).send,
footerType: FooterType.slideActionButton,
isSlideActionEnabled: sendViewModel.isReadyForSend,
walletType: sendViewModel.walletType,
titleIconPath: sendViewModel.selectedCryptoCurrency.iconPath,
currency: sendViewModel.selectedCryptoCurrency,
amount: S.of(bottomSheetContext).send_amount,
amountValue: sendViewModel.pendingTransaction!.amountFormatted,
fiatAmountValue: sendViewModel.pendingTransactionFiatAmountFormatted,
fee: isEVMCompatibleChain(sendViewModel.walletType)
? S.of(bottomSheetContext).send_estimated_fee
: S.of(bottomSheetContext).send_fee,
feeValue: sendViewModel.pendingTransaction!.feeFormatted,
feeFiatAmount: sendViewModel.pendingTransactionFeeFiatAmountFormatted,
outputs: sendViewModel.outputs,
onSlideActionComplete: () async {
Navigator.of(bottomSheetContext).pop(true);
sendViewModel.commitTransaction(context);
},
change: sendViewModel.pendingTransaction!.change,
isOpenCryptoPay: sendViewModel.ocpRequest != null,
return Observer(
builder: (_) => ConfirmSendingBottomSheet(
key: ValueKey('send_page_confirm_sending_bottom_sheet_key'),
titleText: S.of(bottomSheetContext).confirm_transaction,
accessibleNavigationModeSlideActionButtonText:
S.of(bottomSheetContext).send,
footerType: FooterType.slideActionButton,
isSlideActionEnabled: sendViewModel.isReadyForSend,
walletType: sendViewModel.walletType,
titleIconPath: sendViewModel.selectedCryptoCurrency.iconPath,
currency: sendViewModel.selectedCryptoCurrency,
amount: S.of(bottomSheetContext).send_amount,
amountValue: sendViewModel.pendingTransaction!.amountFormatted,
fiatAmountValue: sendViewModel.pendingTransactionFiatAmountFormatted,
fee: isEVMCompatibleChain(sendViewModel.walletType)
? S.of(bottomSheetContext).send_estimated_fee
: S.of(bottomSheetContext).send_fee,
feeValue: sendViewModel.pendingTransaction!.feeFormatted,
feeFiatAmount:
sendViewModel.pendingTransactionFeeFiatAmountFormatted,
outputs: sendViewModel.outputs,
onSlideActionComplete: () async {
Navigator.of(bottomSheetContext).pop(true);
sendViewModel.commitTransaction(context);
},
change: sendViewModel.pendingTransaction!.change,
isOpenCryptoPay: sendViewModel.ocpRequest != null,
),
);
},
);
@@ -113,7 +113,7 @@ class StandardSlideButtonState extends State<StandardSlideButton> {
child: Icon(
key: ValueKey('standard_slide_button_widget_slider_icon_key'),
Icons.arrow_forward,
color: Theme.of(context).colorScheme.onSurface,
color: widget.isDisabled ? Theme.of(context).colorScheme.onSurface.withOpacity(0.2) : Theme.of(context).colorScheme.onSurface,
),
),
),
+8
View File
@@ -1053,6 +1053,14 @@ abstract class SendViewModelBase extends WalletChangeListenerViewModel with Stor
return S.current.solana_invalid_data_message;
}
if (errorMessage.contains('Blockhash not found') ||
errorMessage.contains('BlockhashNotFound') ||
errorMessage.contains('BlockhashMNotFound')) {
return 'Transaction failed because its recent blockhash expired. '
'Please retry your send; if this keeps happening, try again in '
'a few seconds or switch to a different Solana node.';
}
return errorMessage;
}
if (walletType == WalletType.ethereum ||