fix: Minor fixes - Solana (#2737)
* fix: Minor fixes * refactor: handle updates to connectivity status for swipe to send button * fix: Remove Future.wait
David Adegoke committed
Dec 24, 2025 at 04:24 UTC
f5754ed2d36cfb2784aa33e6c9f26daa67822f32
6 files changed
+46
-35
cw_solana/lib/solana_client.dart
+1
-1
@@ -458,7 +458,7 @@ class SolanaWalletClient {
458
}
459
460
if (i + batchSize < signatures.length) {
461
- await Future.delayed(const Duration(milliseconds: 300));
461
+ await Future.delayed(const Duration(milliseconds: 100));
462
}
463
}
464
cw_solana/lib/solana_wallet.dart
+3
-2
@@ -145,6 +145,7 @@ abstract class SolanaWalletBase
145
146
await walletAddresses.init();
147
await transactionHistory.init();
148
+
149
await save();
150
}
151
@@ -227,8 +228,8 @@ abstract class SolanaWalletBase
228
await _updateBalance();
229
230
final transactionCurrency = balance.keys.firstWhere(
230
- (currency) =>
231
- currency.title == credentials.currency.title &&
231
+ (currency) =>
232
+ currency.title == credentials.currency.title &&
233
currency.tag == credentials.currency.tag,
234
orElse: () => throw Exception(
235
'Currency ${credentials.currency.title} ${credentials.currency.tag} is not accessible in the wallet, try to enable it first.'));
lib/src/screens/dashboard/pages/address_page.dart
+5
-7
@@ -144,13 +144,11 @@ class AddressPage extends BasePage {
144
child: Column(
145
children: <Widget>[
146
Expanded(
147
- child: Observer(
148
- builder: (_) => QRWidget(
149
- formKey: _formKey,
150
- addressListViewModel: addressListViewModel,
151
- amountTextFieldFocusNode: _cryptoAmountFocus,
152
- amountController: _amountController,
153
- ),
147
+ child: QRWidget(
148
+ formKey: _formKey,
149
+ addressListViewModel: addressListViewModel,
150
+ amountTextFieldFocusNode: _cryptoAmountFocus,
151
+ amountController: _amountController,
152
),
153
),
154
SizedBox(height: 16),
lib/src/screens/send/send_page.dart
+28
-24
@@ -576,30 +576,34 @@ class SendPage extends BasePage {
576
isDismissible: false,
577
isScrollControlled: true,
578
builder: (BuildContext bottomSheetContext) {
579
- return ConfirmSendingBottomSheet(
580
- key: ValueKey('send_page_confirm_sending_bottom_sheet_key'),
581
- titleText: S.of(bottomSheetContext).confirm_transaction,
582
- accessibleNavigationModeSlideActionButtonText: S.of(bottomSheetContext).send,
583
- footerType: FooterType.slideActionButton,
584
- isSlideActionEnabled: sendViewModel.isReadyForSend,
585
- walletType: sendViewModel.walletType,
586
- titleIconPath: sendViewModel.selectedCryptoCurrency.iconPath,
587
- currency: sendViewModel.selectedCryptoCurrency,
588
- amount: S.of(bottomSheetContext).send_amount,
589
- amountValue: sendViewModel.pendingTransaction!.amountFormatted,
590
- fiatAmountValue: sendViewModel.pendingTransactionFiatAmountFormatted,
591
- fee: isEVMCompatibleChain(sendViewModel.walletType)
592
- ? S.of(bottomSheetContext).send_estimated_fee
593
- : S.of(bottomSheetContext).send_fee,
594
- feeValue: sendViewModel.pendingTransaction!.feeFormatted,
595
- feeFiatAmount: sendViewModel.pendingTransactionFeeFiatAmountFormatted,
596
- outputs: sendViewModel.outputs,
597
- onSlideActionComplete: () async {
598
- Navigator.of(bottomSheetContext).pop(true);
599
- sendViewModel.commitTransaction(context);
600
- },
601
- change: sendViewModel.pendingTransaction!.change,
602
- isOpenCryptoPay: sendViewModel.ocpRequest != null,
579
+ return Observer(
580
+ builder: (_) => ConfirmSendingBottomSheet(
581
+ key: ValueKey('send_page_confirm_sending_bottom_sheet_key'),
582
+ titleText: S.of(bottomSheetContext).confirm_transaction,
583
+ accessibleNavigationModeSlideActionButtonText:
584
+ S.of(bottomSheetContext).send,
585
+ footerType: FooterType.slideActionButton,
586
+ isSlideActionEnabled: sendViewModel.isReadyForSend,
587
+ walletType: sendViewModel.walletType,
588
+ titleIconPath: sendViewModel.selectedCryptoCurrency.iconPath,
589
+ currency: sendViewModel.selectedCryptoCurrency,
590
+ amount: S.of(bottomSheetContext).send_amount,
591
+ amountValue: sendViewModel.pendingTransaction!.amountFormatted,
592
+ fiatAmountValue: sendViewModel.pendingTransactionFiatAmountFormatted,
593
+ fee: isEVMCompatibleChain(sendViewModel.walletType)
594
+ ? S.of(bottomSheetContext).send_estimated_fee
595
+ : S.of(bottomSheetContext).send_fee,
596
+ feeValue: sendViewModel.pendingTransaction!.feeFormatted,
597
+ feeFiatAmount:
598
+ sendViewModel.pendingTransactionFeeFiatAmountFormatted,
599
+ outputs: sendViewModel.outputs,
600
+ onSlideActionComplete: () async {
601
+ Navigator.of(bottomSheetContext).pop(true);
602
+ sendViewModel.commitTransaction(context);
603
+ },
604
+ change: sendViewModel.pendingTransaction!.change,
605
+ isOpenCryptoPay: sendViewModel.ocpRequest != null,
606
+ ),
607
);
608
},
609
);
lib/src/widgets/standard_slide_button_widget.dart
+1
-1
@@ -113,7 +113,7 @@ class StandardSlideButtonState extends State<StandardSlideButton> {
113
child: Icon(
114
key: ValueKey('standard_slide_button_widget_slider_icon_key'),
115
Icons.arrow_forward,
116
- color: Theme.of(context).colorScheme.onSurface,
116
+ color: widget.isDisabled ? Theme.of(context).colorScheme.onSurface.withOpacity(0.2) : Theme.of(context).colorScheme.onSurface,
117
),
118
),
119
),
lib/view_model/send/send_view_model.dart
+8
@@ -1053,6 +1053,14 @@ abstract class SendViewModelBase extends WalletChangeListenerViewModel with Stor
1053
return S.current.solana_invalid_data_message;
1054
}
1055
1056
+ if (errorMessage.contains('Blockhash not found') ||
1057
+ errorMessage.contains('BlockhashNotFound') ||
1058
+ errorMessage.contains('BlockhashMNotFound')) {
1059
+ return 'Transaction failed because its recent blockhash expired. '
1060
+ 'Please retry your send; if this keeps happening, try again in '
1061
+ 'a few seconds or switch to a different Solana node.';
1062
+ }
1063
+
1064
return errorMessage;
1065
}
1066
if (walletType == WalletType.ethereum ||