// // CombineSynchronizer.swift // // // Created by Michal Fousek on 16.03.2023. // import Combine import Foundation /// This defines a Combine-based API for the SDK. It's expected that the implementation of this protocol is only a very thin layer that translates /// async API defined in `Synchronizer` to Combine-based API. And it doesn't do anything else. It's here so each client can choose the API that suits /// its case the best. /// /// If you are looking for documentation for a specific method or property look for it in the `Synchronizer` protocol. public protocol CombineSynchronizer { var alias: ZcashSynchronizerAlias { get } var latestState: SynchronizerState { get } var connectionState: ConnectionState { get } var stateStream: AnyPublisher { get } var eventStream: AnyPublisher { get } func prepare( with seed: [UInt8]?, walletBirthday: BlockHeight, for walletMode: WalletInitMode ) -> SinglePublisher func start(retry: Bool) -> CompletablePublisher func stop() func getSaplingAddress(accountIndex: Int) -> SinglePublisher func getUnifiedAddress(accountIndex: Int) -> SinglePublisher func getTransparentAddress(accountIndex: Int) -> SinglePublisher func sendToAddress( spendingKey: UnifiedSpendingKey, zatoshi: Zatoshi, toAddress: Recipient, memo: Memo? ) -> SinglePublisher func shieldFunds( spendingKey: UnifiedSpendingKey, memo: Memo, shieldingThreshold: Zatoshi ) -> SinglePublisher var allTransactions: SinglePublisher<[ZcashTransaction.Overview], Never> { get } var sentTransactions: SinglePublisher<[ZcashTransaction.Overview], Never> { get } var receivedTransactions: SinglePublisher<[ZcashTransaction.Overview], Never> { get } func paginatedTransactions(of kind: TransactionKind) -> PaginatedTransactionRepository func getMemos(for transaction: ZcashTransaction.Overview) -> SinglePublisher<[Memo], Error> func getRecipients(for transaction: ZcashTransaction.Overview) -> SinglePublisher<[TransactionRecipient], Never> func allTransactions(from transaction: ZcashTransaction.Overview, limit: Int) -> SinglePublisher<[ZcashTransaction.Overview], Error> func latestHeight() -> SinglePublisher func refreshUTXOs(address: TransparentAddress, from height: BlockHeight) -> SinglePublisher func getAccountBalance(accountIndex: Int) -> SinglePublisher func rewind(_ policy: RewindPolicy) -> CompletablePublisher func wipe() -> CompletablePublisher }