Skip to content

Add claim-rewards action and UI for staking#148

Merged
DRadmir merged 4 commits intomainfrom
139-monad-claim-reward-issue
Apr 15, 2026
Merged

Add claim-rewards action and UI for staking#148
DRadmir merged 4 commits intomainfrom
139-monad-claim-reward-issue

Conversation

@DRadmir
Copy link
Copy Markdown
Contributor

@DRadmir DRadmir commented Apr 15, 2026

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

Simulator Screenshot - iPhone 17 Pro - 2026-04-15 at 13 31 25 Simulator Screenshot - iPhone 17 Pro - 2026-04-15 at 13 31 36 Simulator Screenshot - iPhone 17 Pro - 2026-04-15 at 13 32 27

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.
@DRadmir DRadmir self-assigned this Apr 15, 2026
currency = assetInfo.price?.currency ?: Currency.USD,
)
) {
override val maxFraction: Int get() = asset.decimals
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do recheck maxFraction override to asset.decimals - this changes the formatting behavior for every consumer of that UI model.

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
Copy link
Copy Markdown
Contributor

@gemdev111 gemdev111 Apr 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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           
      }

DRadmir added 3 commits April 15, 2026 23:25
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.
@DRadmir DRadmir merged commit 20e60bc into main Apr 15, 2026
3 checks passed
@DRadmir DRadmir deleted the 139-monad-claim-reward-issue branch April 15, 2026 18:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Monad claim reward issue

2 participants