# client_context

Returns the state identity and hydration status carried by a CLIENT, including its kind, chain, block, chain profile, and identity hash.

Canonical HTML: <https://determica.com/docs/functions/client_context>

- Kind: scalar function
- Category: [Clients and state contexts](/docs/category/clients-and-state-contexts.md)
- Tags: Client

Returns the state identity and hydration status carried by a CLIENT, including its kind, chain, block, chain profile, and identity hash.

## Overload 1: client_context(CLIENT)

```sql
client_context(CLIENT)
```

Inspects CLIENT identity locally and does not perform a chain read.

- Kind: scalar
- Execution context: Offline
- Behavior: Inspect Context
- Execution modes: Live Client, Pinned Client, Execution Client
- Input shape: Scalar Arguments
- Planning contract: Runtime
- Cardinality: One Per Input
- Determinism: Deterministic
- Return shape: Scalar
- Schema stability: Fixed
- Stability: Stable
- Side effects: None documented

### Requirements

- client_state_context

### Inputs

- `client` (CLIENT; required; positional) — Live, pinned, or execution CLIENT to inspect.

### Returns

CLIENT context

Returns a STRUCT with state_kind, chain_id, chain_profile, chain_profile_version, block_number, block_hash, state_identity_hash, and hydration_binding_status.

- `context` (STRUCT(state_kind VARCHAR, chain_id UBIGINT, chain_profile VARCHAR, chain_profile_version UINTEGER, block_number UBIGINT, block_hash BYTES32, state_identity_hash BYTES32, hydration_binding_status VARCHAR))

CLIENT context. Returns a STRUCT with state_kind, chain_id, chain_profile, chain_profile_version, block_number, block_hash, state_identity_hash, and hydration_binding_status.

## Guidance

### Context fields

The STRUCT reports durable state identity separately from the attached TRANSPORT.

- state_kind is live, pinned, or execution.
- chain_id identifies the EVM chain.
- chain_profile and chain_profile_version identify the execution and canonicality profile.
- A pinned CLIENT sets block_number and block_hash.
- state_identity_hash is the hash of the durable state identity.
- hydration_binding_status reports whether a TRANSPORT is attached.

## Additional examples

```sql
SELECT client_context($client) AS context;
```
