> For the complete documentation index, see [llms.txt](https://docs.trustlesswork.com/trustless-work/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.trustlesswork.com/trustless-work/v2-en/escrow-js-sdk/introduction.md).

# Introduction

Framework-agnostic JavaScript/TypeScript client for Trustless Work Core API v2 escrows.

**`@trustless-work/escrow-js`** — Framework-agnostic JavaScript/TypeScript client for Trustless Work **Core API v2** escrows.

| Surface           | What it does                                                  |
| ----------------- | ------------------------------------------------------------- |
| **REST operate**  | Build unsigned XDR → you sign → `sendTransaction`             |
| **REST reads**    | `GET /escrows*` (list, detail, events, milestones, financial) |
| **GraphQL reads** | `POST /graphql` (`escrow` / `escrows`)                        |

Identity is always **`contractId`** (Soroban `C…`). Escrow types: `single-release` | `multi-release`.

Works in **Node.js 18+**, **NestJS**, **Angular**, **Vue**, **browser**, and any JS runtime with `fetch`. Zero runtime dependencies.

{% hint style="info" %}
Auth, users, platforms, wallets, admin, and access grants are **out of scope** for this package.
{% endhint %}

### Quick links

<table data-view="cards"><thead><tr><th>Title</th><th data-card-target data-type="content-ref">Link</th></tr></thead><tbody><tr><td>Getting started</td><td></td></tr><tr><td>Architecture</td><td></td></tr><tr><td>Operate</td><td></td></tr><tr><td>Escrow Information</td><td></td></tr><tr><td>GraphQL</td><td></td></tr><tr><td>Runtimes</td><td></td></tr><tr><td>NPM package</td><td><a href="https://www.npmjs.com/package/@trustless-work/escrow-js">https://www.npmjs.com/package/@trustless-work/escrow-js</a></td></tr></tbody></table>

### What you'll do with the SDK

* Deploy escrows with `deployEscrow` — single-release or multi-release.
* Fund, update, manage milestones, approve, release, dispute, resolve, and withdraw.
* Read escrows via REST or GraphQL.
* Submit signed XDR with `sendTransaction`.

{% hint style="warning" %}
Read amounts are **human decimal strings** (e.g. `"250.5"`). Do **not** divide by `1e7`. Operate payloads still use human **numbers**.
{% endhint %}

### Environment

`development` and `mainNet` currently both point at:

```
https://beta.api.trustlesswork.com
```

Pass any Core API `baseURL` string when you need another host. Get an API key from the Trustless Work dApp.

### Coming from React?

See Migration from React SDK for the hook → method map and shared Core v2 contract.


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.trustlesswork.com/trustless-work/v2-en/escrow-js-sdk/introduction.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
