feat(ui): Identities screen on the main menu under Wallets#828
Merged
Conversation
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>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
…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>
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.
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
PersistentIdentitystore (network-scoped viaPersistentIdentity.predicate(network:), ordered by identity index) — the same rows the example app renders.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.identityGetrefreshes the balance anddpnsGetUsernamebackfills a missing DPNS name (silent 404s, mirroring the example app), then persists via the SDK'supdateBalance/updateDpnsNamemutators.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
DWGlobalOptionsmirror writes + notification chain a finished registration performs (avatar appears, Join banner retires). Nameless identities stay list-only until Join DashPay completes the name.Notes
IdentitiesViewModel; the screen renders row models only.Test plan
dashpaysimulator build (arm64); installed on QA-iPhone16🤖 Generated with Claude Code