diff --git a/Sources/ElixxirDAppsSDK/Fact.swift b/Sources/ElixxirDAppsSDK/Fact.swift index ecf0e64de5565c4fb58ee367b2ca77fd72167189..7d8dc591d1f336eddeaf17ee68c95f4a6ce52f25 100644 --- a/Sources/ElixxirDAppsSDK/Fact.swift +++ b/Sources/ElixxirDAppsSDK/Fact.swift @@ -19,21 +19,21 @@ extension Fact: Codable { case type = "Type" } - static func decode(_ data: Data) throws -> Fact { + public static func decode(_ data: Data) throws -> Fact { try JSONDecoder().decode(Self.self, from: data) } - func encode() throws -> Data { + public func encode() throws -> Data { try JSONEncoder().encode(self) } } extension Array where Element == Fact { - static func decode(_ data: Data) throws -> [Fact] { + public static func decode(_ data: Data) throws -> [Fact] { try JSONDecoder().decode(Self.self, from: data) } - func encode() throws -> Data { + public func encode() throws -> Data { try JSONEncoder().encode(self) } } diff --git a/Sources/ElixxirDAppsSDK/Message.swift b/Sources/ElixxirDAppsSDK/Message.swift index b2c13b7d4d7e19cac79ee01950b62ec63d74d11a..c554d1191a726d040a64ce430538eceb398f8e8b 100644 --- a/Sources/ElixxirDAppsSDK/Message.swift +++ b/Sources/ElixxirDAppsSDK/Message.swift @@ -47,11 +47,11 @@ extension Message: Codable { case roundId = "RoundId" } - static func decode(_ data: Data) throws -> Message { + public static func decode(_ data: Data) throws -> Message { try JSONDecoder().decode(Self.self, from: data) } - func encode() throws -> Data { + public func encode() throws -> Data { try JSONEncoder().encode(self) } } diff --git a/Sources/ElixxirDAppsSDK/MessageSendReport.swift b/Sources/ElixxirDAppsSDK/MessageSendReport.swift index 8ac2038b6006f93ca4494553226dcfe2c3ddc88b..0e3a6bf0901a36cb2aa5fc52a6b0969f86b795d6 100644 --- a/Sources/ElixxirDAppsSDK/MessageSendReport.swift +++ b/Sources/ElixxirDAppsSDK/MessageSendReport.swift @@ -23,11 +23,11 @@ extension MessageSendReport: Codable { case timestamp = "Timestamp" } - static func decode(_ data: Data) throws -> MessageSendReport { + public static func decode(_ data: Data) throws -> MessageSendReport { try JSONDecoder().decode(Self.self, from: data) } - func encode() throws -> Data { + public func encode() throws -> Data { try JSONEncoder().encode(self) } } diff --git a/Sources/ElixxirDAppsSDK/ReceptionIdentity.swift b/Sources/ElixxirDAppsSDK/ReceptionIdentity.swift index ed11ddca523a3244ad3ae93a43166f0eb40bde0f..d0c1571e5451edb9a08890a61b1969fc4358348f 100644 --- a/Sources/ElixxirDAppsSDK/ReceptionIdentity.swift +++ b/Sources/ElixxirDAppsSDK/ReceptionIdentity.swift @@ -27,11 +27,11 @@ extension ReceptionIdentity: Codable { case dhKeyPrivate = "DHKeyPrivate" } - static func decode(_ data: Data) throws -> ReceptionIdentity { + public static func decode(_ data: Data) throws -> ReceptionIdentity { try JSONDecoder().decode(Self.self, from: data) } - func encode() throws -> Data { + public func encode() throws -> Data { try JSONEncoder().encode(self) } } diff --git a/Sources/ElixxirDAppsSDK/RestlikeMessage.swift b/Sources/ElixxirDAppsSDK/RestlikeMessage.swift index 414a74b48162920f831b5703eb20dc0b10df1ef7..65b63786066e4e8a275f2d0c048bb05896f845ff 100644 --- a/Sources/ElixxirDAppsSDK/RestlikeMessage.swift +++ b/Sources/ElixxirDAppsSDK/RestlikeMessage.swift @@ -35,11 +35,11 @@ extension RestlikeMessage: Codable { case error = "Error" } - static func decode(_ data: Data) throws -> RestlikeMessage { + public static func decode(_ data: Data) throws -> RestlikeMessage { try JSONDecoder().decode(Self.self, from: data) } - func encode() throws -> Data { + public func encode() throws -> Data { try JSONEncoder().encode(self) } }