> For the complete documentation index, see [llms.txt](https://docs.zkbob.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.zkbob.com/implementation/client-library-sdk/account-less-mode-operations/client-library-status.md).

# Client Library Status

The `ZkBobClient` object can be in various states throughout its lifecycle. To enable the application to understand what is happening in the library and respond appropriately to changes in its state, the set of states are introduced and organized into a state machine.

<figure><img src="/files/6GUXgcJCcEbQRG95cQJO" alt=""><figcaption><p>The client library state machine</p></figcaption></figure>

You can use your own callback to get the status changes in time. You can set it on client instantination or later with the object's field `stateCallback` of type [ClientStateCallback](/implementation/client-library-sdk/common-types.md#client-library-state-callback). You can also remove it to stop status monitoring.

```typescript
public stateCallback?: ClientStateCallback;
```

The following routines are introduced to monitor the client's state.

## <mark style="background-color:green;">Getting the Client State</mark>

```typescript
getState(): ClientState
```

### Returns

[ClientState](/implementation/client-library-sdk/common-types.md#client-library-state-callback) enum member.

### Example

```typescript
const st = zkClient.getState();
if (st == ClientState.StateUpdating || st == ClientState.StateUpdatingContinuous) {
   console.log('Please wait while local state becomes up-to-dated');
}
// output: Please wait while local state becomes up-to-dated
```

## <mark style="background-color:green;">Getting the Client Continuous State Progress</mark>

```typescript
getProgress(): number | undefined;
```

### Returns

`number` which represents progress for continuous states (from 0.0 to 1.0) or `undefined` for non-continuous states.

### Example

```typescript
const st = zkClient.getState();
const pr = zkClient.getProgress();
if (st == ClientState.StateUpdating) {
   const progressStr = (pr !== undefined ? `(${(pr * 100.0).toFixed(1)}%)` : '');
   console.log(`Please wait while local state becomes up-to-dated ${progressStr}`);
}
// output: Please wait while local state becomes up-to-dated (42.0%)
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.zkbob.com/implementation/client-library-sdk/account-less-mode-operations/client-library-status.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
