<!--
{
  "availability" : [

  ],
  "documentType" : "symbol",
  "framework" : "BitcoinKernel",
  "identifier" : "/documentation/BitcoinKernel/ContextOptions",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "BitcoinKernel"
    ],
    "preciseIdentifier" : "s:13BitcoinKernel14ContextOptionsC"
  },
  "title" : "ContextOptions"
}
-->

# ContextOptions

Builder for constructing a [`Context`](/documentation/BitcoinKernel/Context) — configure, then pass to
[`init(options:)`](/documentation/BitcoinKernel/Context/init(options:)).

```
final class ContextOptions
```

## Overview

A one-shot builder: each setter replaces the previous value for that
property. Defaults produce a mainnet context with no callbacks (see
[`init(options:)`](/documentation/BitcoinKernel/Context/init(options:)) for the implications). Set the chain type
first, attach callbacks, then build the context.

> Warning: Not thread-safe. Configure on a single thread before creating
> the context; the resulting ``doc://BitcoinKernel/documentation/BitcoinKernel/Context`` is thread-safe but building
> `ContextOptions` concurrently is undefined.

Wraps the opaque `btck_ContextOptions` type; `deinit` calls
`btck_context_options_destroy` when the last Swift reference drops.