feat: add KeyPackage Relays section to AllRelayListScreen

Adds a new section after DM Relays that lets users manage the relays
advertised in their MIP-00 KeyPackage Relay List (kind 10051). Mirrors
the existing DM Relay pattern: state in KeyPackageRelayListState,
backup in AccountSettings, and a ViewModel/view pair for the section.

https://claude.ai/code/session_01B7kTUFAPvWarWd6fvQKNBy
This commit is contained in:
Claude
2026-04-17 18:51:57 +00:00
parent f92655e645
commit c7a3c5c4a3
8 changed files with 324 additions and 1 deletions
@@ -69,6 +69,21 @@ class KeyPackageRelayListEvent(
signer: NostrSigner,
createdAt: Long = TimeUtils.now(),
): KeyPackageRelayListEvent = signer.sign(createdAt, KIND, createTagArray(relays), "")
suspend fun updateRelayList(
earlierVersion: KeyPackageRelayListEvent,
relays: List<NormalizedRelayUrl>,
signer: NostrSigner,
createdAt: Long = TimeUtils.now(),
): KeyPackageRelayListEvent {
val tags =
earlierVersion.tags
.filter { it.isEmpty() || it[0] != RelayTag.TAG_NAME }
.plus(relays.map { RelayTag.assemble(it) })
.toTypedArray()
return signer.sign(createdAt, KIND, tags, earlierVersion.content)
}
}
}