Repository navigation
feat(payments): Internal transfers between own balances in Advanced mode (MO-1125) - #1683
Draft
HashEngineering wants to merge 27 commits into
Draft
HashEngineering wants to merge 27 commits into
HashEngineering wants to merge 27 commits into
Conversation
Contributor
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Contributor
|
🕓 Review not started yet because this PR is a draft.
Commit 64e6c6e. Normal review starts when eligible; priority review starts as soon as a slot is available. |
…ode (MO-1125) The Advanced payments Internal tab is now an internal-transfer screen (Figma DashPay iOS 3333:10699): pick From and To among Core, Shielded, Platform and Identity, enter an amount (DASH or fiat, Max), and confirm through the same confirm/sending/result UI as External Send. No address is entered: the transfer pays the wallet's own destination for the To balance; transfers to Core use an unadvertised internal-chain address. Supported now: Core->Shielded (self-shield), Core->Identity, Shielded->Core/Platform/Identity, Platform->Shielded (self-shield), Platform->Identity, Identity->Core/Platform. Core->Platform, Platform->Core and Identity->Shielded show as not available yet (no app wrapper / SDK support). History entry (AC14) is deferred. - InternalTransferModels/Service/ServiceImpl: pair matrix, own destination resolution (fail closed), wallet-id pinning, routes. - InternalTransferExecutor: application-scoped with its own durable in-flight marker, sibling of ExternalSendExecutor. - Shared confirm components moved out of ExternalSendScreen. - Internal tab always shown in Advanced mode; basic mode unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…125) - Identity -> Platform resolves the wallet's own Platform address through a wallet-pinned SDK address-store read that does not need the shielded runtime, so the pair works with the shielded flag off. - A chosen or restored pair is dropped only on confirmed absence (hasIdentity == false / shielded flag == false); an unreadable shielded flag is now null (unknown), not false. - Focused InternalTransferExecutor tests for the durable in-flight marker. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…125) - Gate the Internal tab's BackHandler on the page being RESUMED, so Back on another Advanced Payments tab no longer closes a hidden sheet. - Confirm validates the captured request (pair, wallet, balance/limit) instead of the live fiat-derived form; a refusal closes the sheet with a visible message, and submit re-checks after authentication. - Re-render the fiat text of a Max or pinned amount when the exchange rate changes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
HashEngineering
force-pushed
the
feat/advanced-internal-transfer
branch
from
November 9, 2026 14:16
350b289 to
30c360c
Compare
Route the Internal Platform → Core pair through the External Send's partial Platform withdrawal (#1680) to the wallet's own unadvertised Core address, pinned to the confirmed wallet, like Shielded → Core and Identity → Core. No pre-send fee or Max, as in External Send. Core → Platform and Identity → Shielded stay unavailable. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…igation (MO-1125) The Internal tab is a pager page of AdvancedPaymentsFragment, whose destination keeps MainActivity's bottom navigation drawn over the bottom of the nav host, so the "Transfer from/to" picker, the confirm sheet and the sending card were partly hidden under it. Host them in their own full-screen window (selected page only), as the app's other sheets over the bottom navigation are. External Send, which has no bottom navigation, is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- The overlay window now covers the screen and pads itself by the system bars, so the scrim meets the status bar with no undimmed strip. - The Internal page leaves the bottom navigation's height free, so the keypad's Continue is no longer drawn under it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Basic (non-Advanced) Payments shows only Receive | Send; Internal transfers live in Advanced mode. A saved Internal tab opens Receive. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…l-transfer Brings in #1680's fee/Max/read cleanup and applies the same cleanup here: - estimateFee / maxSendable keyed on balance kinds replace the estimateFeeForPair / maxSendableForPair twins; InternalTransferService .estimateFee drops its unused amount; one public balanceKindOf. - The Internal and External sources share top-level ownIdentityIdOrThrow, shieldedEnabledOrThrow, startedWalletManager and boundWalletIdOrNull instead of duplicate bodies. - shieldFromWallet / shieldFromCredits / unshieldToCredits take an optional expectedWalletIdHex in place of the three *Pinned twins. - AdvancedPaymentsFragment uses its fixed tab set directly; the constant-only ViewModel and dynamic-tab plumbing are gone, and shieldedEnabledFlow moves next to ReceiveViewModel, its only user. - pickerBalances / hasShieldedLeg are shared; identity id length uses IDENTITY_ID_LENGTH. - InternalTransferFragment remembers its actions; currencyCodesFor is shared and remembered per fiat code. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Closing a Sent, "may have gone through" (including the one shown after a process restart) or other terminal outcome now pops back to Home, the way the External Send does since 5610dfc. Not sent stays on the Internal tab so the user can retry. The outcome is read before acknowledging, only the selected pager page navigates, and it falls back to a single pop when Home is not on the back stack. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…appears The From/To picker, the confirm sheet, the sending overlay and the outcome dialog are drawn in their own windows, which stayed above the lock screen (dismissDialogsForLockScreen only dismisses DialogFragments). InternalTransferFragment is now LockScreenAware: on lock the picker and the confirm sheet close (the amount is kept), and the sending overlay and the outcome are withheld, not acknowledged, until LockScreenActivity.walletLocked turns false. A running transfer continues on the app scope. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…place The Advanced payments screen now shows MainActivity's bottom navigation on the Receive tab only; Internal and Send hide it, re-applied after the destination listener when the screen becomes current again. Without the bar, the Internal transfer's picker, confirm sheet and sending overlay are drawn in place in the screen, as the External Send does, and AboveBottomNavigation (a separate dialog window) and the 60dp bottom padding are gone. The lock screen now covers those overlays, so on lock only the outcome dialog (its own window) is withheld until unlock. Verified on a testnet emulator: bar per tab, return from External Send, picker Back, confirm sheet above the system navigation. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # wallet/src/de/schildbach/wallet/ui/payments/send/ExternalSendScreen.kt
# Conflicts: # wallet/src/de/schildbach/wallet/ui/payments/AdvancedPaymentsFragment.kt # wallet/src/de/schildbach/wallet/ui/payments/internal/InternalTransferScreen.kt # wallet/test/de/schildbach/wallet/ui/payments/AdvancedPaymentsTabsTest.kt
…d-internal-transfer
…o feat/advanced-internal-transfer # Conflicts: # wallet/src/de/schildbach/wallet/ui/dashpay/utils/DashPayConfig.kt # wallet/src/de/schildbach/wallet/ui/payments/send/ExternalSendExecutor.kt # wallet/src/de/schildbach/wallet/ui/payments/send/ExternalSendScreen.kt
InternalTransferExecutor now mirrors ExternalSendExecutor's wipe handling: a wallet-wipe listener plus a generation counter, so a finished, restarted or late-completing transfer of the wiped wallet is never shown to, and never touches the in-flight marker of, the next wallet. InternalTransferServiceImpl's own routes (Core -> Shielded, Shielded -> Platform, Platform -> Shielded) now submit under FundingSelectionLock.withSharedSubmission with the bound-wallet check inside the hold; delegated routes already take it in ExternalSendService.send. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
LockScreenActivity registered its Back callback with the activity as LifecycleOwner. Such a callback is removed at ON_STOP and re-added at ON_START, which the activity reaches after its fragments, so after any screen-off it sat above every fragment and Compose BackHandler and took Back from them (Advanced Payments: Back left the screen instead of closing the balance picker or confirm sheet, and skipped acknowledging an outcome). The activity's Back is now added once without a LifecycleOwner, so it stays the lowest priority, and removed in onDestroy. A second callback, enabled only while the lock screen is displayed and re-added on top when it comes up, keeps Back from reaching the screens it covers. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
External Send (#1680) now funds a Platform address from Core (fundFromAssetLockExternal), so the Internal pair matrix allows Core -> Platform. The route already delegated to External Send with the wallet's own Platform address; fee (paid on top), Max, pending-funding resume and the wipe barrier all come from External Send. Identity -> Shielded is now the only pair not supported yet. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
External Send supports Identity -> Shielded (identityShieldTo, Type 21), so the Internal pair matrix now allows every pair of two different balances; NOT_SUPPORTED_YET and internalTransferPairSupported are gone. The Shielded-destination routing used to send every non-Core source to the Platform-credits self-shield. Identity now delegates to External Send with the wallet's own default shielded address, read by the new ShieldedBalanceService.ownShieldedAddressOf, which is pinned to the confirmed wallet and fails closed (Not sent, nothing called). Platform -> Shielded keeps its self route. As in External Send, an identity source has no fee estimate and no Max. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…hield
The SDK refuses shieldedShieldFromIdentityToRecipient when the recipient
belongs to the wallet's own shielded account ("use the self-shield entry
point"), so the External Send delegate added in the previous commit was
Not sent on a device. Wrap shieldedShieldFromIdentity (Type 21, no
recipient) as ShieldedBalanceService.shieldFromIdentity, mirroring
shieldFromIdentityToAddress through runShieldedWrite, and route Internal
Identity -> Shielded to it as a self route under the wipe barrier, with the
own identity checked as SDK-managed first. ownShieldedAddressOf is removed.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…o feat/advanced-internal-transfer
As d4a6e58 did for External Send: every Throwable-passing log in InternalTransferExecutor and InternalTransferServiceImpl now logs only safeErrorSummary (error class names and a native code), never an exception message or stack trace, which can name a recipient or identity. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…o feat/advanced-internal-transfer # Conflicts: # wallet/src/de/schildbach/wallet/ui/payments/send/ExternalSendScreen.kt # wallet/src/de/schildbach/wallet/ui/payments/send/ExternalSendViewModel.kt
A Shielded -> Core Max withdraws the Max itself and the asset unlock's Core fee comes out of it, so the own Core balance receives the Max minus WITHDRAWAL_CORE_FEE_DUFFS. Internal's confirm sheet showed the full Max as received and a total of Max + fee (the Core fee counted twice). It now uses External Send's rule, shared as withdrawalCoreFeeIncluded / amountAfterWithdrawalCoreFee: amount shown = Max - Core fee, total = that + fee. The send was already right and is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Issue being fixed or feature implemented
MO-1125 Internal Transfers. In Advanced mode, the Internal tab of Advanced Payments moves Dash between the user's own balances: Core, Shielded, Platform and Identity. The design is Figma
DashPay - iOSnode 3333:10699, adapted to Android Compose.This PR is stacked on #1680 (External Send) and targets
feat/advanced-external-send. Basic mode (Advanced off): the Payments screen now shows only Receive | Send; the Internal tab is hidden (a saved Internal tab opens Receive).PaymentsInternalFragmentandShieldedBalanceActivitystay in the code; the invite and username "Shield first" options still openShieldedBalanceActivity.What was done?
ui/payments/internal/):InternalTransferFragment,InternalTransferScreenandInternalTransferViewModel(singleUIState, Hilt).ExternalSendScreenintoSendConfirmComponents.kt.InternalTransferServiceresolves the transfer route for each pair:InternalTransferExecutorkeeps a durable in-flight marker (DashPayConfig.INTERNAL_TRANSFER_IN_FLIGHT). It works the same way asExternalSendExecutor, whose marker key is now a parameter.ShieldedBalanceService:shieldFromWalletPinned,shieldFromCreditsPinned,unshieldToCreditsPinnedandownPlatformAddressOf. The last one doesn't need the shielded runtime.Pairs
The two ⛔ pairs show as "not available yet", because the SDK has no usable route for them yet:
fundFromAssetLockwith resume.Deferred
How Has This Been Tested?
Unit tests:
InternalTransferViewModelTestInternalTransferServiceImplTestInternalTransferExecutorTestInternalTransferModelsTestAdvancedPaymentsTabsTestThe External Send suites (
ExternalSendViewModelTest,ExternalSendServiceImplTestandExternalSendModelsTest) still pass.ktlintFormatis clean.Not yet tested on a device.
Two local pre-review rounds were run with GPT-6.1 Sol:
Round 1: 2 blocking findings and 1 suggestion, fixed in a87dc22.
Round 2: 3 blocking findings, fixed in 350b289:
These fixes have not been reviewed again locally.
Known sibling issue:
ExternalSendViewModelin #1680 has the same two problems as the round-2 confirm and fiat-rate findings. They are left for that PR.Breaking Changes
None.
Checklist:
🤖 Generated with Claude Code