following and unfollowing
Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
@@ -227,6 +227,11 @@ func decode_nostr_event(txt: String) -> NostrResponse? {
|
||||
return decode_data(Data(txt.utf8))
|
||||
}
|
||||
|
||||
func encode_json<T: Encodable>(_ val: T) -> String? {
|
||||
let encoder = JSONEncoder()
|
||||
return (try? encoder.encode(val)).map { String(decoding: $0, as: UTF8.self) }
|
||||
}
|
||||
|
||||
func decode_data<T: Decodable>(_ data: Data) -> T? {
|
||||
let decoder = JSONDecoder()
|
||||
do {
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
struct RelayInfo {
|
||||
struct RelayInfo: Codable {
|
||||
let read: Bool
|
||||
let write: Bool
|
||||
|
||||
|
||||
Reference in New Issue
Block a user