diff --git a/cli/src/main/kotlin/com/vitorpamplona/amethyst/cli/Context.kt b/cli/src/main/kotlin/com/vitorpamplona/amethyst/cli/Context.kt index f135e6b407..36cc92a817 100644 --- a/cli/src/main/kotlin/com/vitorpamplona/amethyst/cli/Context.kt +++ b/cli/src/main/kotlin/com/vitorpamplona/amethyst/cli/Context.kt @@ -330,6 +330,17 @@ class Context( relaysOf(identity.pubKeyHex)?.writeRelaysNorm()?.takeIf { it.isNotEmpty() }?.toSet() ?: DefaultNIP65RelaySet + /** + * NIP-65 *read* (inbox) relays for this account — "where others reach me". + * Mirrors the Android app's NIP-65 inbox set (the `notificationRelays` + * flow). Used as the default `relay` tags advertised in a kind:10019 + * nutzap-info event. Falls back to [outboxRelays] when no read relays are + * marked. + */ + suspend fun nip65ReadRelays(): Set = + relaysOf(identity.pubKeyHex)?.readRelaysNorm()?.takeIf { it.isNotEmpty() }?.toSet() + ?: outboxRelays() + /** * DM inbox relays (NIP-17 kind:10050) for this account. Falls back * to [DefaultDMRelayList] when no kind:10050 has been seen. diff --git a/cli/src/main/kotlin/com/vitorpamplona/amethyst/cli/commands/cashu/CashuWalletCommands.kt b/cli/src/main/kotlin/com/vitorpamplona/amethyst/cli/commands/cashu/CashuWalletCommands.kt index 3d0a9d32d2..88e2fb40ba 100644 --- a/cli/src/main/kotlin/com/vitorpamplona/amethyst/cli/commands/cashu/CashuWalletCommands.kt +++ b/cli/src/main/kotlin/com/vitorpamplona/amethyst/cli/commands/cashu/CashuWalletCommands.kt @@ -72,10 +72,11 @@ object CashuWalletCommands { Context.open(dataDir).use { ctx -> ctx.prepare() - // Match Amethyst: kind:10019 advertises the account's outbox - // relays as nutzap-receiving relays unless the caller overrides - // with --relay, so senders publish nutzaps where we actually read. - val nutzapRelays = explicitRelays.ifEmpty { ctx.outboxRelays().toList() } + // Match Amethyst: kind:10019 advertises the account's NIP-65 + // inbox (read) relays as nutzap-receiving relays unless the caller + // overrides with --relay, so senders publish kind:9321 where we + // read incoming events. + val nutzapRelays = explicitRelays.ifEmpty { ctx.nip65ReadRelays().toList() } val created = try { ctx.cashuOps().publishWalletEvents(mints, privkey, nutzapRelays)