diff --git a/PrismAgent/Sources/Protocols/Invitation/V2/InvitationRunner.swift b/PrismAgent/Sources/Protocols/Invitation/V2/InvitationRunner.swift new file mode 100644 index 00000000..7fb92829 --- /dev/null +++ b/PrismAgent/Sources/Protocols/Invitation/V2/InvitationRunner.swift @@ -0,0 +1,17 @@ +import Domain +import Foundation + +class InvitationRunner { + private let mercury: Mercury + private let url: URL + + init(mercury: Mercury, url: URL) { + self.mercury = mercury + self.url = url + } + + func run() async throws -> Message { + let messageString = try OutOfBandParser().parseMessage(url: url) + return try await mercury.unpackMessage(msg: messageString, options: .expectDecryptByAllKeys).result + } +}