mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-11-30 11:54:22 +01:00
Merge branch 'dev' into cw-1440-new-buy-sell-flow
# Conflicts: # cw_core/lib/format_fixed.dart # cw_solana/lib/solana_client.dart # lib/cake_pay/src/widgets/rounded_overlay_cards_widget.dart # lib/di.dart # lib/new-ui/widgets/coins_page/assets_history/assets_history_section.dart # lib/new-ui/widgets/receive_page/receive_top_bar.dart # lib/solana/cw_solana.dart # lib/src/screens/buy/buy_sell_page.dart # lib/src/screens/connect_device/connect_device_page.dart # lib/view_model/buy/buy_sell_view_model.dart # lib/view_model/hardware_wallet/hardware_wallet_view_model.dart # lib/view_model/hardware_wallet/ledger_view_model.dart # lib/view_model/send/send_view_model.dart
This commit is contained in:
@@ -122,9 +122,13 @@ class CWSolana extends Solana {
|
||||
return CryptoCurrency.sol;
|
||||
}
|
||||
|
||||
return (wallet as SolanaWallet).splTokenCurrencies.firstWhere(
|
||||
(element) => transaction.amount.currency.symbol == element.symbol,
|
||||
);
|
||||
final token = (wallet as SolanaWallet).splTokenBySymbol(transaction.amount.currency.symbol);
|
||||
|
||||
if (token == null) {
|
||||
throw StateError('No SPL token for symbol ${transaction.amount.currency.symbol}');
|
||||
}
|
||||
|
||||
return token;
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -401,6 +405,15 @@ class CWSolana extends Solana {
|
||||
}
|
||||
|
||||
await Future.wait(tokenChecks);
|
||||
|
||||
final discoveredMints = result.newTokens
|
||||
.where((item) => item.token.enabled)
|
||||
.map((item) => item.token.mintAddress)
|
||||
.toList();
|
||||
|
||||
if (discoveredMints.isNotEmpty) {
|
||||
await wallet.updateSPLTokenTransactions(specificMints: discoveredMints);
|
||||
}
|
||||
} catch (_) {}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user