Add claim-rewards action and UI for staking#148
Merged
Conversation
Implement the claim-rewards flow across Android and iOS: expose canClaimRewards/canClaimAllRewards flags, add claim action handlers and navigation, and update UI to show a chevron and clickable reward rows only when claiming is allowed. Changes include: update Delegation and Stake view models (Android/Kotlin & iOS/Swift) to compute claimability and build claim params, add ClaimRewards case to DelegationActionType (iOS), extend StakeAction with a claimable flag, pass modifiers and chevron display to PropertyAssetBalanceItem, and show/hide actionable reward list items. Add Chain-level config accessors (claimAllAvailable / supportClaimAllRewards) and a RewardsInfoUIModel maxFraction override. Also add tools:replace for dataExtractionRules in AndroidManifest to resolve manifest merge. These edits enable conditional display and handling of reward claims and respect chain-config flags for claiming behavior.
gemdev111
reviewed
Apr 15, 2026
| currency = assetInfo.price?.currency ?: Currency.USD, | ||
| ) | ||
| ) { | ||
| override val maxFraction: Int get() = asset.decimals |
Contributor
There was a problem hiding this comment.
Do recheck maxFraction override to asset.decimals - this changes the formatting behavior for every consumer of that UI model.
gemdev111
approved these changes
Apr 15, 2026
gemdev111
reviewed
Apr 15, 2026
| itemsPositioned(actions) { position, item -> | ||
| val title = when (item) { | ||
| is StakeAction.Rewards -> R.string.transfer_rewards_title | ||
| is StakeAction.Rewards -> if (item.claimable) R.string.transfer_claim_rewards_title else R.string.transfer_rewards_title |
Contributor
There was a problem hiding this comment.
probably move R res. to ext StakeActionExt.kt ?
get() = when (this) {
is StakeAction.Rewards ->
if (claimable)
R.string.transfer_claim_rewards_title
else
R.string.transfer_rewards_title
StakeAction.Stake ->
R.string.transfer_stake_title
StakeAction.Freeze ->
R.string.transfer_freeze_title
StakeAction.Unfreeze ->
R.string.transfer_unfreeze_title
}
gemdev111
approved these changes
Apr 15, 2026
Implement end-to-end support for claiming staking rewards across Android and iOS. Key changes: use delegation rewards when available in TransactionBalanceService; refactor stake UI/VM flows so rewards either auto-confirm (when chain supports claim-all or only one rewarded delegation) or open an amount input to pick validator/amount; introduce ValidatorsSource to drive validator list for rewards vs chain validators; update Amount/Validator view models and screens to handle rewards selection and to show asset balance for claim flows; add AmountType.claimRewards and related mapping in AmountStakeViewModel; remove obsolete claimable flag from StakeAction. Overall this aligns UX and business logic for claiming rewards and consolidates validator sourcing and balance calculation.
…claim-reward-issue
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
Core: new can_claim_all_rewards flag in StakeChainConfig (true for Cosmos/Tron, false for Monad).
StakeScene: rewards row always shown when rewards > 0; clickable "Claim Rewards" + chevron only when chain supports batch claim, otherwise info-only "Rewards".
DelegationScene: rewards row clickable → claims for that single validator.
Android: RewardsInfoUIModel uses full decimals so dust renders correctly (matches iOS).
Android: tools:replace="android:dataExtractionRules" fixes pre-existing manifest merge conflict.
Fix: #139