> 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/types/responses.md).

# Responses

Read-model rows, snapshots, list params, and build/send transaction responses.

List and detail rows use **decimal strings** for money fields. Build/send responses return unsigned XDR or submit results.

### Transaction responses

Returned by **build** (unsigned XDR) and **send** (after wallet signs).

```ts
type BuildTransactionResponse = {
  unsignedXdr: string;
  txHash: string;
};

type DeployEscrowResponse = {
  unsignedXdr: string;
  txHash: string;
  contractId: string; // predicted C… address before submit
};

type SendTransactionResponse = {
  txHash: string;
  ledger: number;
  contractId?: string;
  escrow?: Escrow | EscrowSummary;
  code?: "STELLAR_TX_SUBMITTED" | "STELLAR_TX_SUBMITTED_INDEXER_LAGGING";
  message?: string;
};
```

### Asset — `EscrowAsset`

```ts
type EscrowAsset = {
  name: string | null;
  address: string | null;
  contractId: string | null;
};
```

### List / detail row — `EscrowSummary`

```ts
type EscrowSummary = {
  network: string;
  contractId: string;
  type: EscrowType;
  engagementId: string;
  status: EscrowStatus;
  amount: string | null; // decimal string; both flavors; null until first projection
  balance: string;            // deposited − released (always present)
  asset: EscrowAsset | null;
  lastLedgerSeq: string;
  createdAt: string;
  updatedAt: string;
  snapshot: EscrowSnapshot;   // title, roles, milestones, …
};
```

### Snapshot (inside `EscrowSummary`)

{% tabs %}
{% tab title="Single-release snapshot" %}

```ts
type SingleReleaseEscrowSnapshot = {
  title: string;
  description: string;
  engagementId: string;
  trustline: Trustline;
  platformFee: string; // decimal string
  amount: string;
  roles: Roles;
  milestones: SingleReleaseMilestone[];
  dispute?: Dispute;
  released?: boolean;
  flags?: Record<string, unknown>;
};
```

{% endtab %}

{% tab title="Multi-release snapshot" %}

```ts
type MultiReleaseEscrowSnapshot = {
  title: string;
  description: string;
  engagementId: string;
  trustline: Trustline;
  platformFee: string;
  roles: MultiReleaseRoles;
  milestones: Array<{
    description: string;
    amount: string; // decimal string on reads
    receiver: string;
    status?: string;
    evidence?: string;
    approvalsTarget?: number;
    approvals?: MilestoneApprovals;
    released?: boolean;
    dispute?: {
      isDisputed: boolean;
      reason: string;
      resolved: boolean;
    };
  }>;
  flags?: Record<string, unknown>;
};
```

{% endtab %}
{% endtabs %}

```ts
type EscrowSnapshot = SingleReleaseEscrowSnapshot | MultiReleaseEscrowSnapshot;
```

### Detail — `EscrowDetail` / `GetEscrowResponse`

```ts
type EscrowEvent = {
  kind: string;
  actor: string | null;
  ledgerSeq: string;
  txHash: string;
  ledgerClosedAt: string;
  topics: string[];
  payload: Record<string, unknown>;
};

type EscrowDeposit = {
  fromAddress: string;
  amount: string;
  asset: string;
  txHash?: string;
  ledgerSeq?: string;
  ledgerClosedAt?: string;
};

type EscrowDetail = {
  escrow: EscrowSummary;
  events: EscrowEvent[];
  deposits: EscrowDeposit[];
};
```

### Pagination — `KeysetPage`

```ts
type KeysetPage = {
  data: EscrowSummary[]; // or EscrowEvent[] for events
  hasMore: boolean;
  nextCursor: string | null;
};

type ListEscrowsResponse = KeysetPage; // data: EscrowSummary[]
type ListEscrowEventsResponse = KeysetPage; // data: EscrowEvent[]
```

### Batch helpers

```ts
type EscrowDetailsItem = {
  escrow: EscrowSummary;
  deposits: EscrowDeposit[];
};

type BatchEscrowDetailsResponse = {
  data: EscrowDetailsItem[];
};

type EscrowMilestones = {
  contractId: string;
  type: EscrowType;
  milestones: SingleReleaseMilestone[] | MultiReleaseMilestone[];
};

type EscrowFinancial = {
  contractId: string;
  type: EscrowType;
  asset: string;
  platformFee: string;
  amount: string | null; // decimal string; null until first projection
  totalDeposited: string;
  totalReleased: string;
  pendingRelease: string;
  nextRelease: { milestoneIndex: number | null; amount: string } | null;
  balance: string;
};
```

### List query — `ListEscrowsParams`

```ts
type ListEscrowsParams = {
  scope?: "mine" | "all";
  status?: EscrowStatus;
  type?: EscrowType; // "single-release" | "multi-release"; matches response `type`
  engagementId?: string;
  contractIds?: string[];
  participant?: string;
  role?: Role;
  platformId?: string;
  subjectId?: string;
  createdAfter?: string;
  createdBefore?: string;
  limit?: number;
  cursor?: string;
  sort?: "createdAt" | "updatedAt";
  order?: "asc" | "desc";
};

type BatchContractIdsParams = {
  contractIds: string[];
};

type ListEscrowEventsParams = {
  limit?: number;
  order?: "asc" | "desc";
  cursor?: string;
};
```

{% hint style="info" %}
Entity field definitions: Entities. Operate bodies: Payloads.
{% endhint %}


---

# 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/types/responses.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.
