# LightWalletService

    public protocol LightWalletService

Undocumented

- `getInfo()`

  returns the info for this lightwalletd server (blocking)

  #### Declaration

  Swift

      func getInfo() throws -> LightWalletdInfo

- `getInfo(result:)`

  returns the info for this lightwalletd server

  #### Declaration

  Swift

      func getInfo(result: @escaping (Result<LightWalletdInfo, LightWalletServiceError>) -> Void)

- `latestBlockHeight(result:)`

  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

- `latestBlockHeight()`

  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

- `blockRange(_:result:)`

  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)

- `blockRange(_:)`

  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]

- `blockStream(startHeight:endHeight:result:handler:progress:)`

  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

- `submit(spendTransaction:result:)`

  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

- `submit(spendTransaction:)`

  Submits a raw transaction over lightwalletd. Blocking

  Throws

  LightWalletServiceError

  #### Declaration

  Swift

      func submit(spendTransaction: Data) throws -> LightWalletServiceResponse

  #### Parameters

  `spendTransaction` | data representing the transaction to be sent

  #### Return Value

  LightWalletServiceResponse

- `fetchTransaction(txId:)`

  Gets a transaction by id

  Throws

  LightWalletServiceError

  #### Declaration

  Swift

      func fetchTransaction(txId: Data) throws -> TransactionEntity

  #### Parameters

  `txId` | data representing the transaction ID

  #### Return Value

  LightWalletServiceResponse

- `fetchTransaction(txId:result:)`

  Gets a transaction by id

  Throws

  LightWalletServiceError

  #### Declaration

  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

- `fetchUTXOs(for:height:)`

  Undocumented

  #### Declaration

  Swift

      func fetchUTXOs(
          for tAddress: String,
          height: BlockHeight
      ) throws -> [UnspentTransactionOutputEntity]

- `fetchUTXOs(for:height:result:)`

  Undocumented

  #### Declaration

  Swift

      func fetchUTXOs(
          for tAddress: String,
          height: BlockHeight,
          result: @escaping(Result<[UnspentTransactionOutputEntity], LightWalletServiceError>) -> Void
      )

- `fetchUTXOs(for:height:)`

  Undocumented

  #### Declaration

  Swift

      func fetchUTXOs(
          for tAddresses: [String],
          height: BlockHeight
      ) throws -> [UnspentTransactionOutputEntity]

- `fetchUTXOs(for:height:result:)`

  Undocumented

  #### Declaration

  Swift

      func fetchUTXOs(
          for tAddresses: [String],
          height: BlockHeight,
          result: @escaping(Result<[UnspentTransactionOutputEntity], LightWalletServiceError>) -> Void
      )

- `closeConnection()`

  Undocumented

  #### Declaration

  Swift

      func closeConnection()

© 2022 Francisco Gindre and Jack Grigg. All rights reserved. (Last updated: 2022-04-07)

Generated by jazzy ♪♫ v0.14.2, a Realm project.