# SDK

The [SDK](https://github.com/longgammalabs/onchain-lob-sdk) provides interfaces to communicate with the Onchain LOB API. Here is a description of the TypeScript version of the SDK.

The main object to start with is `OnchainLobClient`. It holds information about the Onchain LOB API endpoints and the user transaction signing interface.

All methods to interact with the spot market are available in the `OnchainLobSpot` class.

The SDK also provides type and interface definitions for the objects used.

## Getting Started

### Prerequisites

* [Node.js](https://nodejs.org) version 20.10.0 or later
* [npm](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm) or [Yarn](https://yarnpkg.com/)

### Installation

1. Install the SDK package

   ```sh
   npm install onchain-lob-sdk
   ```
2. Install the [ws](https://github.com/websockets/ws) package if you going to use it in the Node.js environment

   ```sh
   npm install ws
   ```


---

# Agent Instructions: 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:

```
GET https://docs.xpressprotocol.com/for-developers/sdk.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
