CompactBlockDownloading
public protocol CompactBlockDownloading
Represents what a compact block downloaded should provide to its clients
-
Downloads and stores the given block range. Non-Blocking
Declaration
Swift
func downloadBlockRange( _ heightRange: CompactBlockRange, completion: @escaping (Error?) -> Void )
-
Remove newer blocks and go back to the given height
Declaration
Swift
func rewind(to height: BlockHeight, completion: @escaping (Error?) -> Void)
Parameters
height
the given height to rewind to
completion
block to be executed after completing rewind
-
returns the height of the latest compact block stored locally BlockHeight.empty() if no blocks are stored yet non-blocking
Declaration
Swift
func lastDownloadedBlockHeight(result: @escaping (Result<BlockHeight, Error>) -> Void)
-
Returns the last height on the blockchain Non-blocking
Declaration
Swift
func latestBlockHeight(result: @escaping (Result<BlockHeight, Error>) -> Void)
-
Downloads and stores the given block range. Blocking
Declaration
Swift
func downloadBlockRange(_ range: CompactBlockRange) throws
-
Restore the download progress up to the given height.
Declaration
Swift
func rewind(to height: BlockHeight) throws
-
Returns the height of the latest compact block stored locally. BlockHeight.empty() if no blocks are stored yet Blocking
Declaration
Swift
func lastDownloadedBlockHeight() throws -> BlockHeight
-
Returns the latest block height Blocking
Declaration
Swift
func latestBlockHeight() throws -> BlockHeight
-
Gets the transaction for the Id given
Throws
An error if the fetch failedDeclaration
Swift
func fetchTransaction(txId: Data) throws -> TransactionEntity
Parameters
txId
Data representing the transaction Id
Return Value
a transaction entity with the requested transaction
-
Gets the transaction for the Id given
Declaration
Swift
func fetchTransaction(txId: Data, result: @escaping (Result<TransactionEntity, Error>) -> Void)
Parameters
txId
Data representing the transaction Id
result
a handler for the result of the operation
-
Undocumented
Declaration
Swift
func fetchUnspentTransactionOutputs(tAddress: String, startHeight: BlockHeight) throws -> [UnspentTransactionOutputEntity]
-
Undocumented
Declaration
Swift
func fetchUnspentTransactionOutputs(tAddress: String, startHeight: BlockHeight, result: @escaping (Result<[UnspentTransactionOutputEntity], Error>) -> Void)
-
Undocumented
Declaration
Swift
func fetchUnspentTransactionOutputs(tAddresses: [String], startHeight: BlockHeight) throws -> [UnspentTransactionOutputEntity]
-
Undocumented
Declaration
Swift
func fetchUnspentTransactionOutputs(tAddresses: [String], startHeight: BlockHeight, result: @escaping (Result<[UnspentTransactionOutputEntity], Error>) -> Void)
-
Undocumented
Declaration
Swift
func closeConnection()