Skip to content

feat(ui): observed incoming Platform-address payments in the home history - #842

Merged
QuantumExplorer merged 1 commit into
swift-sdk-integrationfrom
feat/platform-address-history
Jul 17, 2026
Merged

QuantumExplorer merged 1 commit into
swift-sdk-integrationfrom
feat/platform-address-history

Conversation

@QuantumExplorer

Copy link
Copy Markdown
Member

Problem

When someone pays one of the wallet's Platform addresses, the balance changes but nothing appears in the home history — confusing ("where did this money come from?"). There's no SDK-persisted platform payment stream to render: the BLAST sync surfaces absolute per-address balances, and its per-pass event carries only aggregate counters.

Approach — an observational ledger (honest v1)

App-side recording, no SDK/FFI changes (PlatformAddressActivityStore.swift, new app-SQLite migration):

  • Baseline + ledger: per-(wallet, network, address) balance baseline; after every BLAST pass the recorder diffs the fresh snapshot against it and records unattributed increases as received activity. Works with today's full-rescan syncing and gets sharper once platform #4142 (incremental recent-changes fix) deploys.
  • First observation seeds silently — recording a standing balance as "received today" would be fabricated history.
  • Own internal moves don't double-show next to their existing history rows:
    • net-zero passes → intra-wallet shuffle, baseline only;
    • internal unshields → exact match on decoded destination address + net amount (principal − fee);
    • Transparent→Platform top-ups → exact match on the asset lock's recipientPlatformAddressHash.
  • Decreases move the baseline silently (own spends have their own representations).

UI

  • Received rows (creditcard icon + down-arrow badge, shortened address pill, live fiat) interleave by day with Core and shielded rows; they ride the Received filter category (shielded filtering refactored onto a shared passesCategoryFilter).
  • Detail sheet: copyable address, balance after, date, and the honest caveats — Platform payments carry no sender, and the timestamp is when the wallet observed the change (a payment landing while the app is closed records at next launch).
  • The recorder posts its own reload signal (SQLite inserts are invisible to the SwiftData-save trigger the rest of the history uses).

Known limits (by design, documented in the store header)

  • Observation-time attribution, no block heights; history starts at install.
  • Two same-pass payments to one address record as one combined row.

Test plan

  • dashpay arm64-sim build green (both targets); installed on QA-iPhone16 + iPhone 16 Pro; migration applied and baselines seeded silently on both (2 / 3 funded addresses, 0 activity rows — no fabricated history)
  • Send tDASH from one device to the other's Platform address (tdash1…) → Received row appears on the receiver within a sync pass (full rescan until #4142 deploys), with correct amount/fiat and the address pill
  • Internal transfer Shielded→Platform → NO duplicate Received row (only the Unshielded row)
  • Internal transfer Transparent→Platform → NO duplicate Received row (only the Core transfer row)
  • Filter → Received includes the platform rows

🤖 Generated with Claude Code

…tory

A third party paying one of the wallet's Platform addresses changed
the balance with NOTHING in the home history — the SDK persists no
per-payment platform event stream (the BLAST sync surfaces absolute
per-address balances; its sync event carries only aggregate counters).

Close the gap observationally, app-side:

- PlatformAddressActivityStore (app SQLite, new migration): a
  per-(wallet, network, address) balance baseline plus an append-only
  ledger of observed increases. After every BLAST pass the recorder
  diffs the snapshot against the baseline; unattributed increases
  record as received activity. First observation seeds the baseline
  silently — recording a standing balance as "received today" would
  be fabricated history.
- Own internal moves are suppressed so they don't double-show next to
  their existing rows: net-zero passes (intra-wallet shuffles),
  internal unshields (exact match on decoded destination address +
  net amount), and Transparent→Platform top-ups (exact match on the
  asset lock's recipient address hash).
- Home history renders the ledger as Received rows (creditcard icon,
  shortened address pill, live fiat) interleaved by day with Core and
  shielded rows; they ride the .received filter category via a shared
  passesCategoryFilter (shielded filter refactored onto it). Tapping
  opens a detail sheet with the copyable address, balance after, and
  the honest caveats: no sender attribution, observation-time
  stamping.
- The recorder posts platformAddressActivityRecorded (the SQLite
  insert is invisible to the SwiftData save trigger) and the home
  view model reloads on it.

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

coderabbitai Bot commented Jul 17, 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: 6cbcdf4e-0175-458b-9f89-556967e042e6

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/platform-address-history

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 a276980 into swift-sdk-integration Jul 17, 2026
1 check passed
@QuantumExplorer
QuantumExplorer deleted the feat/platform-address-history branch August 7, 2026 08:22
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