# `ExWapp.Pairing`
[🔗](https://github.com/elchemista/ex_wapp/blob/v0.1.5/lib/ex_wapp/pairing.ex#L1)

Implements the QR-code based pairing handshake used by WhatsApp Web.

# `state`

```elixir
@type state() :: %{
  status: :idle | :waiting_for_scan | :waiting_for_code | :paired,
  ref: String.t() | nil,
  store: ExWapp.Store.t(),
  req_id: String.t() | nil
}
```

Aggregate structure that keeps temporary pairing data.

# `apply_node`

```elixir
@spec apply_node(state(), ExWapp.Binary.binary_node()) :: {state(), [term()]}
```

Applies a decoded node and returns the updated state plus pairing events.

# `new`

```elixir
@spec new(ExWapp.Store.t()) :: state()
```

Returns the initial pairing state.

# `qr_from_ref`

```elixir
@spec qr_from_ref(state(), binary()) :: String.t()
```

Turns the server-provided ref into a QR string.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
