// // Copyright (c) 2020-2021 MobileCoin. All rights reserved. // import Foundation import GRPC import LibMobileCoin protocol AuthHttpCallable { var requester: RestApiRequester { get } func auth( _ request: Attest_AuthMessage, callOptions: HTTPCallOptions?, completion: @escaping (HttpCallResult) -> Void) } protocol AuthHttpCallee { func auth( _ request: Attest_AuthMessage, callOptions: HTTPCallOptions? ) -> HTTPUnaryCall } protocol QueryHttpCallee { func query( _ request: Attest_Message, callOptions: HTTPCallOptions? ) -> HTTPUnaryCall } protocol OutputsHttpCallee { func getOutputs( _ request: Attest_Message, callOptions: HTTPCallOptions? ) -> HTTPUnaryCall } protocol CheckKeyImagesCallee { func checkKeyImages( _ request: Attest_Message, callOptions: HTTPCallOptions? ) -> HTTPUnaryCall } struct AuthHttpCallableWrapper: HttpCallable { let authCallable: AuthHttpCallable let requester: RestApiRequester func call( request: Attest_AuthMessage, callOptions: HTTPCallOptions?, completion: @escaping (HttpCallResult) -> Void ) { authCallable.auth(request, callOptions: callOptions, completion: completion) } }