# `ZenWebsocket.Examples.Docs.JsonRpcClient`
[🔗](https://github.com/ZenHive/zen_websocket/blob/v0.4.2/lib/zen_websocket/examples/docs/json_rpc_client.ex#L1)

JSON-RPC client example from documentation.

Demonstrates how to make JSON-RPC calls over WebSocket connections.
The ZenWebsocket.Client automatically handles request/response 
correlation for JSON-RPC messages - no manual correlation needed!

# `call_method`

```elixir
@spec call_method(ZenWebsocket.Client.t(), String.t(), map() | nil, timeout()) ::
  {:ok, term()} | {:error, term()}
```

Makes a synchronous JSON-RPC call.

The Client automatically handles JSON-RPC correlation - when sending a message
with an "id" field, it tracks the request and returns the correlated response.

# `cast_method`

```elixir
@spec cast_method(ZenWebsocket.Client.t(), String.t(), map() | nil) ::
  :ok | {:error, term()}
```

Makes an async JSON-RPC call without waiting for response.

# `echo`

Echo test method

# `get_balance`

Get account balance

# `get_server_time`

Get server timestamp

# `handle_message`

```elixir
@spec handle_message(map() | String.t()) :: {:ok, map()} | {:error, term()} | :ignore
```

Processes incoming WebSocket messages and returns JSON-RPC responses.

---

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