diff --git a/lib/bloc/coins_bloc/coins_bloc.dart b/lib/bloc/coins_bloc/coins_bloc.dart index 9b0fc9824c..5653c61c90 100644 --- a/lib/bloc/coins_bloc/coins_bloc.dart +++ b/lib/bloc/coins_bloc/coins_bloc.dart @@ -156,15 +156,16 @@ class CoinsBloc extends Bloc { await emit.forEach( coinUpdateStream, onData: (Coin coin) { - if (!state.walletCoins.containsKey(coin.abbr)) { + final key = coin.id.id; + if (!state.walletCoins.containsKey(key)) { _log.warning( 'Coin ${coin.abbr} not found in wallet coins, skipping update', ); return state; } return state.copyWith( - walletCoins: {...state.walletCoins, coin.id.id: coin}, - coins: {...state.coins, coin.id.id: coin}, + walletCoins: {...state.walletCoins, key: coin}, + coins: {...state.coins, key: coin}, ); }, ); diff --git a/lib/bloc/coins_bloc/coins_repo.dart b/lib/bloc/coins_bloc/coins_repo.dart index 9907caacca..f0fd2830da 100644 --- a/lib/bloc/coins_bloc/coins_repo.dart +++ b/lib/bloc/coins_bloc/coins_repo.dart @@ -775,10 +775,16 @@ class CoinsRepo { spendable: newSpendable, ); + final updatedCoin = coin.copyWith(sendableBalance: newSpendable); + + // Broadcast the updated balance so non-streaming assets still emit + // real-time change events through the same path as streaming assets. + _broadcastBalanceChange(updatedCoin); + // Yield updated coin with new balance // We still set both the deprecated fields and rely on the SDK // for future access to maintain backward compatibility - yield coin.copyWith(sendableBalance: newSpendable); + yield updatedCoin; } } catch (e, s) { _log.warning('Failed to update balance for ${coin.id}', e, s); diff --git a/sdk b/sdk index 2da6d29f3d..b4750cf981 160000 --- a/sdk +++ b/sdk @@ -1 +1 @@ -Subproject commit 2da6d29f3db70c654281b565ab58dc76bc39694a +Subproject commit b4750cf981dfe1119bb2cf949f5e5741fa93d136