<!--
{
  "availability" : [

  ],
  "documentType" : "symbol",
  "framework" : "BitcoinKernel",
  "identifier" : "/documentation/BitcoinKernel/EsploraBlockSource/block(for:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "BitcoinKernel"
    ],
    "preciseIdentifier" : "s:13BitcoinKernel18EsploraBlockSourceV5block3forAA0D0C10Foundation4DataV_tYaKF"
  },
  "title" : "block(for:)"
}
-->

# block(for:)

The full consensus-serialized block for the given hash.

```
func block(for hash: Data) async throws -> Block
```

## Parameters

`hash`

32-byte block hash in internal byte order.

## Return Value

A [`Block`](/documentation/BitcoinKernel/Block) ready to pass to
[`processBlock(_:)`](/documentation/BitcoinKernel/ChainstateManager/processBlock(_:)).

## Discussion> Throws: ``doc://BitcoinKernel/documentation/BitcoinKernel/BlockSourceError/notFound`` if the hash is unknown;
> ``doc://BitcoinKernel/documentation/BitcoinKernel/BlockSourceError/invalidResponse(_:)`` if the body doesn’t
> round-trip through the kernel’s block parser.