Implement NostrNetworkManager and UserRelayListManager
This commit implements a new layer called NostrNetworkManager, responsible for managing interactions with the Nostr network, and providing a higher level API that is easier and more secure to use for the layer above it. It also integrates it with the rest of the app, by moving RelayPool and PostBox into NostrNetworkManager, along with all their usages. Changelog-Added: Added NIP-65 relay list support Changelog-Changed: Improved robustness of relay list handling Signed-off-by: Daniel D’Aquino <daniel@daquino.me>
This commit is contained in:
1 parent
0ec2b05070
commit
3a0acfaba1
60 files changed
+837
-398
No files matched your search
@@ -309,7 +309,7 @@ public func nscript_nostr_cmd(interp: UnsafeMutablePointer<wasm_interp>?, cmd: I
|
||||
|
||||
func nscript_add_relay(script: NostrScript, relay: String) -> Bool {
|
||||
guard let url = RelayURL(relay) else { return false }
|
||||
let desc = RelayPool.RelayDescriptor(url: url, info: .rw, variant: .ephemeral)
|
||||
let desc = RelayPool.RelayDescriptor(url: url, info: .readWrite, variant: .ephemeral)
|
||||
return (try? script.pool.add_relay(desc)) != nil
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user