Skip to content

feat(payments): balance-row receive sheet with full internal transfer routes - #817

Merged
QuantumExplorer merged 1 commit into
swift-sdk-integrationfrom
feat/receive-internal-transfer-sheet
Jul 16, 2026
Merged

QuantumExplorer merged 1 commit into
swift-sdk-integrationfrom
feat/receive-internal-transfer-sheet

Conversation

@QuantumExplorer

Copy link
Copy Markdown
Member

What

The home balance rows' receive (↓) arrows now open a focused two-tab sheet — Receive QR + embedded Internal transfer — for the tapped balance, and the internal transfer engine gains the missing Core↔Platform routes, completing the 6-route matrix between Transparent, Platform, and Shielded balances.

Receive sheet (new surface)

  • ↓ on Transparent/Platform/Shielded opens a sheet with a hero selector (Receive | Internal) as its top chrome; grabber dismisses. The full 3-tab landing (with Send) is unchanged for the Receive/Send shortcuts.
  • Receive tab: QR preselected to the tapped balance. The network toggle gains Shielded — the wallet's default Orchard payment address (shieldedDefaultAddress, bech32m dash1…/tdash1… with the 0x10 type byte). The Send toggle deliberately does not gain it.
  • Internal tab: the transfer form embedded directly — destination pinned as the bottom card, source picker above, no swap badge. Route follows the receive toggle so the To card and the executed transfer can never disagree.

Internal transfer routes

  • InternalTransferRoute (6 routes) is now the canonical model for validation, fee reserves, Max, and execution; the confirm sheet derives labels, fee rows, step checklists, and timing/privacy tips from it.
  • Core → Platform: AssetLockAddressTopUp (funding type 4) asset lock via PlatformAddressSyncCoordinator.fundFromCore, with lock-status polling and resume-on-retry (a committed lock is never stranded).
  • Platform → Core: partial amounts pay out exactly the requested value via explicit input selection (new swift-sdk wrapper, committed in the platform repo — see note); Max routes through the AUTO full-balance withdrawal. The preflight feeds the fee headroom, Max amount, and the confirm sheet's fee row.

History rows

  • Internal transfers render their route: source icon + destination badge (Core→Shielded, Shielded→Core). Shielded→Core payouts are titled "Shielded withdrawal" instead of a plain "Received".

Fixes shaken out

  • Transparent-row arrows + balance long-press were dead: the home SwiftUI content captured the shortcuts delegate before HomeViewController assigned it. Now resolved at tap time.
  • Syncing alert clipped its OK button when the async peers section grew (sizingOptions = .intrinsicContentSize).
  • Payments landing carried a phantom ~50pt top inset from BaseNavigationController re-showing a transparent nav bar (NavigationBarDisplayable conformance).
  • topController() didn't recurse into presentedViewController, so the PIN prompt silently failed to present over stacked sheets — every auth-gated transfer from the new sheet reported "Authentication failed". One-line traversal fix; hardens all "present from the top" callers.
  • Transfer screen scrolls its upper content at tight heights; keypad stays pinned.

Copy/format

Cards read Transparent/Platform/Shielded; card balances cap at 5 fraction digits (display only); unit pills show DASH + the active fiat code (e.g. THB).

Cross-repo dependency

The partial withdrawal uses a new Swift-only wrapper in the platform repo (ManagedPlatformAddressWallet.withdraw(accountIndex:coreAddress:inputs:signer:), commit 5043b867c9 on v4.1-dev-local). No FFI/xcframework rebuild required — the FFI entry point already ships. Needs upstreaming with the rest of the platform pin per DASHSYNC_MIGRATION.md.

Testing

Testnet smoke on the QA-iPhone16 simulator: receive QRs for all three balances; Core→Shielded, Shielded→Core, Core→Platform (25 tDASH end-to-end incl. PIN gate, lock polling, balance refresh), Platform→Core partial + Max preflight; sync alert; landing layouts. Unit-test target is pre-existing-broken per CLAUDE.md — verification standard was clean dashpay build + testnet smoke of touched flows.

🤖 Generated with Claude Code

… routes

Home balance rows: every row's receive (down) arrow now opens a focused
two-tab sheet — a Receive QR for the tapped balance and an embedded
Internal transfer form — instead of routing Platform/Shielded straight
into the transfer screen. The hero selector (Receive | Internal) is the
sheet's top chrome (no X/title row); the destination card stays pinned
at the bottom of the transfer form with the source rows above it and no
swap badge. The full three-tab landing (with Send) is unchanged for the
Receive/Send shortcuts.

Receive: the landing's network toggle gains Shielded — the wallet's
default Orchard payment address, read via shieldedDefaultAddress and
bech32m-encoded for display (HRP dash/tdash + 0x10 type byte). The Send
toggle deliberately does not gain it (ChainNetworkToggle now takes an
options list).

Internal transfers: InternalTransferRoute (six routes) becomes the
canonical model for validation, fees, and execution. New Core↔Platform
legs complete the matrix:
 - Core → Platform via an AssetLockAddressTopUp (funding type 4) asset
   lock through PlatformAddressSyncCoordinator.fundFromCore, with
   status polling and resume-on-retry so a committed lock is never
   stranded.
 - Platform → Core credit withdrawals: partial amounts pay out exactly
   the requested value via explicit input selection (new swift-sdk
   wrapper over platform_address_wallet_withdraw_to_address; committed
   in the platform repo), while Max uses the AUTO full-balance path.
   The withdrawal preflight feeds fee headroom, the Max amount, and the
   confirm sheet's exact fee row.
The confirm sheet derives labels, fee estimates, step checklists, and
timing/privacy tips from the route.

Transaction history: internal transfers now carry their route — a
source icon with a destination badge (Core → Shielded, Shielded → Core)
— and Shielded → Core payouts are titled "Shielded withdrawal" instead
of a plain "Received".

Fixes shaken out along the way:
 - Transparent-row arrows and balance long-press did nothing: the home
   SwiftUI content captured the shortcuts delegate before the
   controller assigned it; resolve it at tap time instead.
 - Syncing alert clipped its OK button once the async peers section
   grew the content: hosting controller now tracks intrinsic size.
 - Phantom ~50pt top inset on the payments landing: it never opted out
   of BaseNavigationController's bar re-show pass (NavigationBarDisplayable).
 - topController() stopped one level into the presentation stack, so
   the PIN prompt silently failed to present over stacked sheets
   ("Authentication failed" on every gated transfer from the new sheet).
 - Transfer screen fits small heights by scrolling its upper content
   while the keypad stays pinned.

UI copy: transfer cards read Transparent/Platform/Shielded (no
"balance"), card amounts cap at 5 fraction digits (display only), and
the amount unit pills show DASH plus the active fiat code.

Co-Authored-By: Claude Fable 5 <[email protected]>
@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 447df1c2-4b0f-41c5-877a-d5f2e7482361

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/receive-internal-transfer-sheet

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@QuantumExplorer
QuantumExplorer merged commit 0798a91 into swift-sdk-integration Jul 16, 2026
1 check failed
@QuantumExplorer
QuantumExplorer deleted the feat/receive-internal-transfer-sheet branch August 7, 2026 08:23
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.

1 participant