LightWalletService
public protocol LightWalletService
Undocumented
-
returns the info for this lightwalletd server (blocking)
Declaration
Swift
func getInfo() throws -> LightWalletdInfo
-
returns the info for this lightwalletd server
Declaration
Swift
func getInfo(result: @escaping (Result<LightWalletdInfo, LightWalletServiceError>) -> Void)
-
Return the latest block height known to the service.
Declaration
Swift
func latestBlockHeight(result: @escaping (Result<BlockHeight, LightWalletServiceError>) -> Void)
Parameters
result
a result containing the height or an Error
-
Return the latest block height known to the service.
Declaration
Swift
func latestBlockHeight() throws -> BlockHeight
Parameters
result
a result containing the height or an Error
-
Return the given range of blocks.
- Parameter range: the inclusive range to fetch. For instance if 1..5 is given, then every block in that will be fetched, including 1 and 5.
Non blocking
Declaration
Swift
func blockRange(_ range: CompactBlockRange, result: @escaping (Result<[ZcashCompactBlock], LightWalletServiceError>) -> Void)
-
Return the given range of blocks.
- Parameter range: the inclusive range to fetch. For instance if 1..5 is given, then every block in that will be fetched, including 1 and 5.
blocking
Declaration
Swift
func blockRange(_ range: CompactBlockRange) throws -> [ZcashCompactBlock]
-
Undocumented
Declaration
Swift
@discardableResult func blockStream( startHeight: BlockHeight, endHeight: BlockHeight, result: @escaping (Result<GRPCResult, LightWalletServiceError>) -> Void, handler: @escaping (ZcashCompactBlock) -> Void, progress: @escaping (BlockProgress) -> Void ) -> CancellableCall
-
Submits a raw transaction over lightwalletd. Non-Blocking
Declaration
Swift
func submit(spendTransaction: Data, result: @escaping (Result<LightWalletServiceResponse, LightWalletServiceError>) -> Void)
Parameters
spendTransaction
data representing the transaction to be sent
result
escaping closure that takes a result containing either LightWalletServiceResponse or LightWalletServiceError
-
Submits a raw transaction over lightwalletd. Blocking
Throws
LightWalletServiceErrorDeclaration
Swift
func submit(spendTransaction: Data) throws -> LightWalletServiceResponse
Parameters
spendTransaction
data representing the transaction to be sent
Return Value
LightWalletServiceResponse
-
Gets a transaction by id
Throws
LightWalletServiceErrorDeclaration
Swift
func fetchTransaction(txId: Data) throws -> TransactionEntity
Parameters
txId
data representing the transaction ID
Return Value
LightWalletServiceResponse
-
Gets a transaction by id
Throws
LightWalletServiceErrorDeclaration
Swift
func fetchTransaction( txId: Data, result: @escaping (Result<TransactionEntity, LightWalletServiceError>) -> Void )
Parameters
txId
data representing the transaction ID
result
handler for the result
Return Value
LightWalletServiceResponse
-
Undocumented
Declaration
Swift
func fetchUTXOs( for tAddress: String, height: BlockHeight ) throws -> [UnspentTransactionOutputEntity]
-
Undocumented
Declaration
Swift
func fetchUTXOs( for tAddress: String, height: BlockHeight, result: @escaping(Result<[UnspentTransactionOutputEntity], LightWalletServiceError>) -> Void )
-
Undocumented
Declaration
Swift
func fetchUTXOs( for tAddresses: [String], height: BlockHeight ) throws -> [UnspentTransactionOutputEntity]
-
Undocumented
Declaration
Swift
func fetchUTXOs( for tAddresses: [String], height: BlockHeight, result: @escaping(Result<[UnspentTransactionOutputEntity], LightWalletServiceError>) -> Void )
-
Undocumented
Declaration
Swift
func closeConnection()