Package-level declarations

Types

Link copied to clipboard
@Singleton
class DustBackupStateStore @Inject constructor(context: Context)

SINGLE owner of the durable dust-backup choice — the tri-state {never-chosen / enabled / opted-out} that was previously two independent pref keys + two StateFlows hand-synced at five call sites inside WalletPanelViewModel. A singleton so the restore gate (a com.midnight.kuira.sdk.walletruntime.DustRestoreGate impl, which outlives any ViewModel) and the panel VM read/write the SAME live state: a gate-committed toggle is instantly visible to the UI, and the wallet's upload-time prefs supplier (com.midnight.kuira.sdk.MidnightWallet.walletBackupPrefsProvider) always reads current truth — no pushed snapshot to go stale.

Link copied to clipboard
@Singleton
class DustRestoreGateImpl @Inject constructor(driveAuth: DriveAuthManager, backupState: DustBackupStateStore, identityProvenance: IdentityProvenanceStore) : DustRestoreGate

The bundled wallet UI's DustRestoreGate (roadmap #61). Contract (canonical copy on MidnightSdk.Builder.dustRestoreGate): consent resolution ONLY, never a wallet sync call. A @Singleton (not ViewModel state) so it exists before any SDK build and survives every panel lifecycle — no registration race, nothing to clobber on ViewModel teardown.

Link copied to clipboard
sealed interface RestoreUiState

UI state for the restore-from-phrase flow (#252).

Link copied to clipboard
sealed interface SendUiState

Send-flow UI state for the Send screen (#240).

Link copied to clipboard

Which pill's gear opened the shared Settings overlay.

Link copied to clipboard
data class SigilChipUi(val label: String, val status: String, val didShort: String, val didFull: String, val tone: SigilChipUi.Tone = Tone.Neutral)

Sample-able UI model for the sigil chip's tiers.

Link copied to clipboard
object ThemeStore

Durable store for the chosen appearance theme — a single id in the wallet's existing SharedPreferences file (no new dependency, survives process death). The UI keeps an in-memory mirror for instant recomposition; this is the source of truth read on first launch.

Link copied to clipboard
data class WalletBalanceUi(val nightTotal: String, val publicNight: String, val privateNight: String?, val statusLabel: String, val dust: String?, val dustRegistered: Boolean)

Display model for WalletBalanceCompact. Pre-formatted strings keep the component pure UI (no SDK types) so it previews and reuses freely.

Link copied to clipboard
data class WalletChipUi(val night: String, val unshielded: String, val shielded: String, val dust: String, val dustRegistered: Boolean, val synced: Boolean, val network: String, val syncing: Boolean = false, val syncProgress: Float? = null)

Sample-able UI model for the wallet chip's tiers.

Link copied to clipboard
sealed interface WalletOverlay

The full-screen wallet overlays the SDK can surface on top of a host's content.

Link copied to clipboard

UI-navigation state holder for the wallet's full-screen overlays.

Link copied to clipboard
data class WalletPanelColors(val pillBackground: Color, val pillBorder: Color, val onPill: Color, val onPillDim: Color, val sheetBackground: Color, val onSheet: Color, val onSheetDim: Color, val onSheetSubtle: Color, val accent: Color, val error: Color, val button: Color, val onButton: Color, val buttonDisabled: Color, val onButtonDisabled: Color, val positive: Color = MidnightColors.SuccessText)

Color tokens for WalletStatusPanel. Host apps can pass a custom palette to theme the wallet panel; Default matches the dark-themed example apps already in this repo.

Link copied to clipboard
class WalletPanelViewModel @Inject constructor(sdkProvider: MidnightSdkProvider, sigilStateStore: SigilStateStore, driveAuth: DriveAuthManager, sessionLock: SessionLock, networkStore: NetworkPreferenceStore, appContext: Context, appDataProvider: Optional<AppDataBackupProvider>, backupState: DustBackupStateStore, restoreGate: DustRestoreGateImpl, identityProvenance: IdentityProvenanceStore) : ViewModel

Wallet panel presenter: drives the canonical WalletConfig and translates SDK / seed state into WalletStatus for the panel UI.

Link copied to clipboard
Link copied to clipboard
data class WalletSyncProgress(val fraction: Float?, val label: String)

Wallet-sync progress for the sheet's WalletSyncIndicator.

Link copied to clipboard
data class WalletTheme(val id: String, val label: String, val colors: WalletPanelColors)

A pickable appearance theme: a display name + the full WalletPanelColors it maps to.

Link copied to clipboard

The built-in appearance themes, in display order. Default (Kuira monochrome) is first and is the fallback for an unknown/absent persisted id.

Properties

Link copied to clipboard

Ambient WalletOverlayController. Default is a real-but-orphaned controller whose open/close simply flip state nobody renders — so a standalone pill that is NOT wrapped in WalletOverlayHost never crashes; it just can't surface the overlays (a standalone WalletStatusPanel() with no host has nowhere to put a full screen).

Functions

Link copied to clipboard
fun QrCode(text: String, size: Dp, modifier: Modifier = Modifier)

Renders a QR code for text as a square bitmap.

Link copied to clipboard
fun WalletAppShell(modifier: Modifier = Modifier, secureWindow: Boolean = true, appVersion: String? = null, content: @Composable () -> Unit)

Recommended root wrapper for a host that drops in the SDK's wallet UI.

Link copied to clipboard
fun WalletBalanceCompact(ui: WalletBalanceUi, syncProgress: WalletSyncProgress?, colors: WalletPanelColors, onReceive: () -> Unit, onRefresh: () -> Unit, onRegister: () -> Unit, modifier: Modifier = Modifier, busy: Boolean = false, onSend: () -> Unit? = null)

Compact wallet balance — the SDK/example-app density of the Kuira balance "flag": a NIGHT hero card (headline total + an equal-weight public/private split + an elegant ⟳ refresh), a slim DUST row with its own Register affordance, and Send / Receive quick actions. Stateless + themeable.

Link copied to clipboard
fun WalletBalanceError(message: String, colors: WalletPanelColors, onRetry: () -> Unit, modifier: Modifier = Modifier)

Balance error — keeps the card frame, states the failure, offers Retry.

Link copied to clipboard
fun WalletBalanceLoading(colors: WalletPanelColors, modifier: Modifier = Modifier)

First-load skeleton — shimmer placeholders shaped like the real cards.

Link copied to clipboard
fun WalletOverlayHost(modifier: Modifier = Modifier, appVersion: String? = null, content: @Composable () -> Unit)

Root host for the wallet's full-screen overlays (Send / Receive / Settings, with Recovery nested inside Settings).

Link copied to clipboard
fun WalletStatusPanel(initialNetwork: MidnightNetwork = MidnightNetwork.UNDEPLOYED, modifier: Modifier = Modifier, colors: WalletPanelColors = WalletPanelColors.Default, viewModel: WalletPanelViewModel = hiltViewModel(), onNetworkChange: (MidnightNetwork) -> Unit = {}, enabled: Boolean = true, openSheetSignal: Int = 0, lightMode: Boolean = false, onToggleLightMode: () -> Unit? = null, pill: @Composable (WalletChipUi, onTap: () -> Unit, onSend: () -> Unit, onReceive: () -> Unit) -> Unit? = null)

Drop-in wallet panel for example apps.

Link copied to clipboard
fun WalletSyncIndicator(progress: Float?, label: String, colors: WalletPanelColors, modifier: Modifier = Modifier)

Labelled wallet-sync progress: a stage label on the left, the live percentage on the right (when determinate), and the branded RunnerDustProgress track below. This is the one reusable sync indicator — the wallet pill and example apps feed it real progress digits instead of each rolling its own bar.