Skip to content

feat(ui): Identities screen on the main menu under Wallets#828

Merged
QuantumExplorer merged 4 commits into
swift-sdk-integrationfrom
feat/menu-identities
Jul 16, 2026
Merged

feat(ui): Identities screen on the main menu under Wallets#828
QuantumExplorer merged 4 commits into
swift-sdk-integrationfrom
feat/menu-identities

Conversation

@QuantumExplorer

@QuantumExplorer QuantumExplorer commented Jul 16, 2026

Copy link
Copy Markdown
Member

Summary

Adds an Identities entry to the More menu, directly under Wallets, showing the device's Dash Platform identities for the current network. Heavily modeled on the SwiftExampleApp's Identities tab, adapted to dashwallet's menu/screen conventions.

List

  • Reads the SwiftDashSDK PersistentIdentity store (network-scoped via PersistentIdentity.predicate(network:), ordered by identity index) — the same rows the example app renders.
  • Each row: display name (alias → main DPNS name → DPNS name → truncated id) with a ⭐ for the pinned main name, alias subtitle, truncated base58 id, credits balance with the Dash glyph, and Masternode / Evonode / Local-Only badges.
  • Empty state explains identities appear after username registration (dashwallet's create-identity path is the existing Join DashPay flow — deliberately not duplicated here).

Detail sheet

Tap a row → compact sheet: full copyable identity id, balance (full precision), type, Local Only / On Network status, owning wallet, identity index, public-key count, and every owned username.

Refresh

Pull-to-refresh or the header button: per identity, sdk.identityGet refreshes the balance and dpnsGetUsername backfills a missing DPNS name (silent 404s, mirroring the example app), then persists via the SDK's updateBalance/updateDpnsName mutators.

Find identities (explicit command)

The refresh only polishes known rows — it can't discover an identity this device has never seen. A header button (and an empty-state button, where the restored-wallet case lives) runs the example app's "Re-scan for Identities": ManagedPlatformWallet.discoverIdentities(startIndex: 0), the DIP-9 gap-limit scan of the active wallet's identity-authentication tree against Platform. Discoveries persist via the SDK persister; on a hit the list reloads and the balance/username refresh backfills the new rows. Outcome reported in an alert.

When the scan surfaces the active wallet's pinned identity (index 0) with a username, the app adopts it into DashPay mode — the same DWGlobalOptions mirror writes + notification chain a finished registration performs (avatar appears, Join banner retires). Nameless identities stay list-only until Join DashPay completes the name.

Notes

  • MVVM per the SwiftUI-first guardrail — all SDK/SwiftData access in IdentitiesViewModel; the screen renders row models only.
  • No create/load/remove flows from the example app: creation belongs to the Join DashPay flow, and local identity removal has different keychain semantics in dashwallet.

Test plan

  • Clean dashpay simulator build (arm64); installed on QA-iPhone16
  • More → Identities shows the registered identity with DPNS name and balance; refresh updates after a top-up
  • Empty state on a wallet with no identity

🤖 Generated with Claude Code

Lists the device's Dash Platform identities for the current network from
the SwiftDashSDK PersistentIdentity store — modeled on the
SwiftExampleApp's Identities tab: DPNS name with a star for the pinned
main name, alias subtitle, credits balance, truncated base58 id, and
Masternode/Evonode/Local-Only badges, rendered in the WalletsScreen card
style. Tapping a row opens a compact detail sheet (copyable full id,
balance, type, status, owning wallet, identity index, key count, owned
usernames). Pull-to-refresh (or the header button) re-fetches balances
via sdk.identityGet and backfills missing DPNS names via
dpnsGetUsername, mirroring the example app's per-row refresh. All SDK
access lives in IdentitiesViewModel.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@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: 530e990d-172b-4ed5-a5db-a15648944c62

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/menu-identities

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 and others added 3 commits July 17, 2026 01:42
…ep both Identity* string keys

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The refresh only polishes rows already in the local store; it can never
DISCOVER an identity this device has not seen (reinstall, imported
recovery phrase, registration made on another device with the same
seed). Add the example app's "Re-scan for Identities" as an explicit
command: a header button (and an empty-state button, where the restored-
wallet case actually lives) runs the DIP-9 gap-limit scan of the active
wallet's identity-authentication tree against Platform via
ManagedPlatformWallet.discoverIdentities(startIndex: 0). Discoveries are
persisted by the SDK persister; on a hit the screen reloads and the
regular balance/username refresh backfills the fresh rows. The outcome
("Found N new identities" / none) is reported in an alert.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Find-identities discoveries were list-only: the SwiftData row appeared,
but the app's DashPay state (home avatar, profile, Join banner) is keyed
on the DWGlobalOptions dashpayUsername/registrationCompleted mirror plus
the registration-status notification chain, none of which discovery
touched. After a successful scan (and the DPNS backfill that names the
fresh rows), an identity at the ACTIVE wallet's pinned slot (index 0)
that owns a username now performs the same completion mirror writes and
posts the bridge's stateChangedNotification — DWDashPayModel rebuilds
and cascades the canonical notification, exactly like a finished
registration. Nameless identities stay list-only (Join DashPay later
completes the name; IdentityCreate is skipped); an already-set mirror is
never clobbered.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@QuantumExplorer
QuantumExplorer merged commit 220d45b into swift-sdk-integration Jul 16, 2026
3 checks passed
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