Root declarations: Me, Profile, Crypto and Vault
Every state, derive, resource, mutation and task that app.contract declares for the me, profile, crypto and vault packages, one line each.

This page lists the last four decl blocks of the root contract. They all concern the identities held on the device.

Me (lines 208-238)

Name

Kind

Meaning

meName, meConfirmed

state

Create form: key name and the confirmation switch

meImportText

state

Import field. Never persisted: "it may be a recovery phrase or key"

meImportName, meRenameDraft

state, persist

Name drafts that survive a reload

meServerDraft

state

Custom server field

meAimed

state

The account a remove confirmation targets

meServers

state string[], persist

Custom servers connected before. The two presets are never stored

meExportFor

state

The account the shown key export belongs to

meIds

resource meIdentities(), MeIdentity[]

Keys on this device, without secrets

meProfiles

resource meProfileNames(server, meIds.map(i => i.accountId))

Published names and icons

meImportCheck

resource meCheckImport(meImportText), MeCheck

Live validation of the import text

meWords

mutation, MeWords

A fresh 12 word mnemonic

meCreated

mutation, refreshes meIds, then meAfterAdd

Create an identity

meImported

mutation, refreshes meIds, then meAfterImport

Import an identity

meRemoved

mutation, refreshes meIds, then meAfterRemove

Remove a key

meServerChecked

mutation, then meAfterServer

Probe a server before selecting it

meExported

mutation, MeExport

Reveal a key export

meRenamed

mutation, refreshes meIds

Rename a key

meCreateError, meImportError, meServerError, meRenameError

derive

error of each reply

meWordList, meMnemonic, meExportText

derive

Unwrapped mutation values

Sources are in Me: sources and import logic, storage in Identity.

Profile (lines 239-245)

Name

Kind

Meaning

profileUid

derive

The :uid of a top profile-edit route, else ""

profileData

resource profileLoad(server, profileUid, top(nav).id), ProfilePage

The published name and summary. The visit id forces a fresh read per visit

profileSaved

mutation, refreshes meProfiles, authors, docs, then profileAfterSave

Publishes the profile

profileReady

derive

The loaded page is for this account and server

profileError

derive

Reply error, only if account, server and visit all match

See Profile.

Crypto (lines 246-248)

Name

Kind

Meaning

cryptoCheck

resource cryptoSelfTest(), CryptoSelfTest

A hidden runtime parity check of key derivation, signing, AEAD and gzip inside the data module runtime. No screen draws it. crypto.test.contract reads it

See Crypto.

Vault (lines 250-273)

Name

Kind

Meaning

vaultURL

state

Vault address field, default https://hyper.media/vault

vaultNow

state

Wall clock for the connect countdown

vaultPage

resource exactPage(), VaultPage

Host page facts. Only visibilityState is read

vaultStatus

resource vaultRead(meIds) with time.epochAtZero, VaultStatus

Vault mode, lock, connection, ids

vaultStarted

mutation, refreshes vaultStatus, then vaultAfterStart

Starts the connect ceremony

vaultChanged

mutation, refreshes vaultStatus, meIds, then vaultAfterChange

Every vault command

vaultEdited

mutation, queue, refreshes vaultStatus, meIds

Local key edits, one at a time in order

vaultBusy

derive

Any of the three mutations is pending

vaultTrackMe

task, keyed on the identity list

after(1, vaultMeChanged)

vaultPoll

task, when pending and page visible

every(2000, vaultPollTick)

vaultCountdownTick

task, when pending

every(1000, vaultClock)

vaultSyncTimer

task, when connected, unlocked, visible

every(30000, vaultSyncTick)

vaultForeground

task, same gate

after(1, vaultSyncTick): sync on return to foreground

vaultRestoreIdentities

task, key = vaultStatus.ids.join(",")

after(1, vaultRefreshIdentities)

vaultConnectedReturn

task, when connected on vault-connect

after(2000, back)

User stories

The code described here exists to deliver these stories. Each story lists this page in its Trace (traceability).

Do you like what you are reading? Subscribe to receive updates.

Unsubscribe anytime

Comments