Files
akkounts/app/services/nostr_manager/discover_user_relays.rb
T
raucao a9045fa413 WIP: Improve Nostr user metadata fetching
Use a multi-step process, caching results in between, while informing
the user about the current steps/progress
2026-08-11 18:16:58 -06:00

22 lines
459 B
Ruby

module NostrManager
class DiscoverUserRelays < NostrManagerService
def initialize(pubkey:, relays: nil)
@pubkey = pubkey
@relays = relays.present? ? relays : Setting.nostr_discovery_relays
end
def call
filter = Nostr::Filter.new(
authors: [@pubkey],
kinds: [10002],
limit: 1,
)
NostrManager::FetchLatestEvent.call(
relays: @relays,
filter: filter
)
end
end
end