107 lines
4.9 KiB
Swift
107 lines
4.9 KiB
Swift
|
//
|
||
|
// DO NOT EDIT.
|
||
|
//
|
||
|
// Generated by the protocol buffer compiler.
|
||
|
// Source: darkside.proto
|
||
|
//
|
||
|
|
||
|
//
|
||
|
// Copyright 2018, gRPC Authors All rights reserved.
|
||
|
//
|
||
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
||
|
// you may not use this file except in compliance with the License.
|
||
|
// You may obtain a copy of the License at
|
||
|
//
|
||
|
// http://www.apache.org/licenses/LICENSE-2.0
|
||
|
//
|
||
|
// Unless required by applicable law or agreed to in writing, software
|
||
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
|
// See the License for the specific language governing permissions and
|
||
|
// limitations under the License.
|
||
|
//
|
||
|
import Dispatch
|
||
|
import Foundation
|
||
|
import SwiftGRPC
|
||
|
import SwiftProtobuf
|
||
|
@testable import ZcashLightClientKit
|
||
|
internal protocol DarksideStreamerDarksideGetIncomingTransactionsCall: ClientCallServerStreaming {
|
||
|
/// Do not call this directly, call `receive()` in the protocol extension below instead.
|
||
|
func _receive(timeout: DispatchTime) throws -> RawTransaction?
|
||
|
/// Call this to wait for a result. Nonblocking.
|
||
|
func receive(completion: @escaping (ResultOrRPCError<RawTransaction?>) -> Void) throws
|
||
|
}
|
||
|
|
||
|
internal extension DarksideStreamerDarksideGetIncomingTransactionsCall {
|
||
|
/// Call this to wait for a result. Blocking.
|
||
|
func receive(timeout: DispatchTime = .distantFuture) throws -> RawTransaction? { return try self._receive(timeout: timeout) }
|
||
|
}
|
||
|
|
||
|
fileprivate final class DarksideStreamerDarksideGetIncomingTransactionsCallBase: ClientCallServerStreamingBase<Empty, RawTransaction>, DarksideStreamerDarksideGetIncomingTransactionsCall {
|
||
|
override class var method: String { return "/cash.z.wallet.sdk.rpc.DarksideStreamer/DarksideGetIncomingTransactions" }
|
||
|
}
|
||
|
|
||
|
internal protocol DarksideStreamerDarksideSetStateCall: ClientCallUnary {}
|
||
|
|
||
|
fileprivate final class DarksideStreamerDarksideSetStateCallBase: ClientCallUnaryBase<DarksideState, Empty>, DarksideStreamerDarksideSetStateCall {
|
||
|
override class var method: String { return "/cash.z.wallet.sdk.rpc.DarksideStreamer/DarksideSetState" }
|
||
|
}
|
||
|
|
||
|
|
||
|
/// Instantiate DarksideStreamerServiceClient, then call methods of this protocol to make API calls.
|
||
|
internal protocol DarksideStreamerService: ServiceClient {
|
||
|
/// Asynchronous. Server-streaming.
|
||
|
/// Send the initial message.
|
||
|
/// Use methods on the returned object to get streamed responses.
|
||
|
func darksideGetIncomingTransactions(_ request: Empty, metadata customMetadata: Metadata, completion: ((CallResult) -> Void)?) throws -> DarksideStreamerDarksideGetIncomingTransactionsCall
|
||
|
|
||
|
/// Synchronous. Unary.
|
||
|
func darksideSetState(_ request: DarksideState, metadata customMetadata: Metadata) throws -> Empty
|
||
|
/// Asynchronous. Unary.
|
||
|
@discardableResult
|
||
|
func darksideSetState(_ request: DarksideState, metadata customMetadata: Metadata, completion: @escaping (Empty?, CallResult) -> Void) throws -> DarksideStreamerDarksideSetStateCall
|
||
|
|
||
|
}
|
||
|
|
||
|
internal extension DarksideStreamerService {
|
||
|
/// Asynchronous. Server-streaming.
|
||
|
func darksideGetIncomingTransactions(_ request: Empty, completion: ((CallResult) -> Void)?) throws -> DarksideStreamerDarksideGetIncomingTransactionsCall {
|
||
|
return try self.darksideGetIncomingTransactions(request, metadata: self.metadata, completion: completion)
|
||
|
}
|
||
|
|
||
|
/// Synchronous. Unary.
|
||
|
func darksideSetState(_ request: DarksideState) throws -> Empty {
|
||
|
return try self.darksideSetState(request, metadata: self.metadata)
|
||
|
}
|
||
|
/// Asynchronous. Unary.
|
||
|
@discardableResult
|
||
|
func darksideSetState(_ request: DarksideState, completion: @escaping (Empty?, CallResult) -> Void) throws -> DarksideStreamerDarksideSetStateCall {
|
||
|
return try self.darksideSetState(request, metadata: self.metadata, completion: completion)
|
||
|
}
|
||
|
|
||
|
}
|
||
|
|
||
|
internal final class DarksideStreamerServiceClient: ServiceClientBase, DarksideStreamerService {
|
||
|
/// Asynchronous. Server-streaming.
|
||
|
/// Send the initial message.
|
||
|
/// Use methods on the returned object to get streamed responses.
|
||
|
internal func darksideGetIncomingTransactions(_ request: Empty, metadata customMetadata: Metadata, completion: ((CallResult) -> Void)?) throws -> DarksideStreamerDarksideGetIncomingTransactionsCall {
|
||
|
return try DarksideStreamerDarksideGetIncomingTransactionsCallBase(channel)
|
||
|
.start(request: request, metadata: customMetadata, completion: completion)
|
||
|
}
|
||
|
|
||
|
/// Synchronous. Unary.
|
||
|
internal func darksideSetState(_ request: DarksideState, metadata customMetadata: Metadata) throws -> Empty {
|
||
|
return try DarksideStreamerDarksideSetStateCallBase(channel)
|
||
|
.run(request: request, metadata: customMetadata)
|
||
|
}
|
||
|
/// Asynchronous. Unary.
|
||
|
@discardableResult
|
||
|
internal func darksideSetState(_ request: DarksideState, metadata customMetadata: Metadata, completion: @escaping (Empty?, CallResult) -> Void) throws -> DarksideStreamerDarksideSetStateCall {
|
||
|
return try DarksideStreamerDarksideSetStateCallBase(channel)
|
||
|
.start(request: request, metadata: customMetadata, completion: completion)
|
||
|
}
|
||
|
|
||
|
}
|
||
|
|