diff --git a/sdk/src/wallet/operations/balance.rs b/sdk/src/wallet/operations/balance.rs index 56a8d28a80..e9efdbfd80 100644 --- a/sdk/src/wallet/operations/balance.rs +++ b/sdk/src/wallet/operations/balance.rs @@ -69,6 +69,10 @@ where output_id.transaction_id().slot_index(), slot_index, )?; + // Add mana rewards + if let Ok(response) = self.client().get_output_mana_rewards(output_id, slot_index).await { + balance.mana.rewards += response.rewards; + } // Add storage deposit balance.required_storage_deposit.account += storage_cost; @@ -98,6 +102,10 @@ where Output::Delegation(delegation) => { // Add amount balance.base_coin.total += delegation.amount(); + // Add mana rewards + if let Ok(response) = self.client().get_output_mana_rewards(output_id, slot_index).await { + balance.mana.rewards += response.rewards; + } // Add storage deposit balance.required_storage_deposit.delegation += storage_cost; if !wallet_data.locked_outputs.contains(output_id) { diff --git a/sdk/src/wallet/types/balance.rs b/sdk/src/wallet/types/balance.rs index 2454f2dc04..facdc4e150 100644 --- a/sdk/src/wallet/types/balance.rs +++ b/sdk/src/wallet/types/balance.rs @@ -85,6 +85,8 @@ pub struct ManaBalance { pub(crate) total: DecayedMana, /// Available mana. pub(crate) available: DecayedMana, + /// Mana rewards. + pub(crate) rewards: u64, } #[derive(Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize, CopyGetters, derive_more::AddAssign)]