relay: introduce ephemeral relays

Epehmeral relays are relays that are connected in your relay pool but
not a part of your official relay list. This will be used by
nostr-wallet-connect to communicate with an NWC relay to pay invoices.
This commit is contained in:
William Casarin
2023-05-09 18:39:00 -07:00
parent 1da0a8ee52
commit 7267662330

View File

@@ -10,8 +10,16 @@ import Foundation
public struct RelayInfo: Codable {
let read: Bool
let write: Bool
let ephemeral: Bool
init(read: Bool, write: Bool, ephemeral: Bool = false) {
self.read = read
self.write = write
self.ephemeral = ephemeral
}
static let rw = RelayInfo(read: true, write: true)
static let rw = RelayInfo(read: true, write: true, ephemeral: false)
static let ephemeral = RelayInfo(read: true, write: true, ephemeral: true)
}
public struct RelayDescriptor {