# `ExWapp.Session.Outbound.IQRequests`
[🔗](https://github.com/elchemista/ex_wapp/blob/v0.1.5/lib/ex_wapp/session/outbound/iq_requests.ex#L1)

Effect boundary for outbound USync, prekey, and group-info IQ requests.

The caller supplies the transport send function. Receives and timeouts run in
the caller process, preserving the existing session-worker mailbox contract.

# `request_state`

```elixir
@type request_state() :: %{
  :store =&gt; term(),
  optional(:runtime_cfg) =&gt; map() | nil,
  optional(atom()) =&gt; term()
}
```

# `send_node_fun`

```elixir
@type send_node_fun() :: (ExWapp.Binary.Node.t() -&gt; :ok | {:error, term()})
```

# `fetch_prekey`

```elixir
@spec fetch_prekey(
  request_state(),
  String.t(),
  ExWapp.Signal.SessionStore.t(),
  send_node_fun()
) :: ExWapp.Session.Outbound.Prekeys.fetch_result()
```

Fetches a prekey for one device JID.

# `fetch_prekeys_batch`

```elixir
@spec fetch_prekeys_batch(
  request_state(),
  [String.t(), ...],
  ExWapp.Signal.SessionStore.t(),
  send_node_fun()
) :: ExWapp.Session.Outbound.Prekeys.fetch_result()
```

Fetches prekeys for several device JIDs in one IQ request.

# `query_devices`

```elixir
@spec query_devices(request_state(), [String.t()], send_node_fun()) ::
  {:ok, map()} | {:error, term()}
```

Queries the linked-device map and persists the successful USync result.

# `query_group_info`

```elixir
@spec query_group_info(request_state(), String.t(), send_node_fun()) ::
  {:ok, ExWapp.Session.Outbound.Group.group_info()} | {:error, term()}
```

Queries current group participants and addressing mode.

---

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