For the complete documentation index, see llms.txt. This page is also available as Markdown.

Escrows

REST operate methods — build unsigned XDR, sign with your wallet, then send.

Operate methods call Core build endpoints. Each returns an unsigned XDR. You sign it, then submit with sendTransaction.

Import from @trustless-work/escrow-js or @trustless-work/escrow-js/rest.

Methods

Method
Action

deployEscrow

Create escrow (unsignedXdr + predicted contractId)

fundEscrow

Fund

updateEscrow

Update properties

changeMilestoneStatus

Status / evidence (batch)

approveMilestones

Approve (batch)

approveAndReleaseMilestones

Approve + release (multi-release)

manageMilestones

Add / edit milestones

releaseFunds

Release

startDispute

Start dispute

resolveDispute

Resolve dispute (distributions)

withdrawRemainingFunds

Withdraw remaining

Most operate methods take (payload, type) where type is "single-release" | "multi-release". Multi-only helpers (approveAndReleaseMilestones, releaseMilestones, disputeMilestones) omit the type argument.

Pattern

const { unsignedXdr } = await client.rest.fundEscrow(payload, "single-release");
const signedXdr = await signWithWallet(unsignedXdr);
const result = await client.rest.sendTransaction(signedXdr);

Response types

Step
Type

Deploy build

DeployEscrowResponse → { unsignedXdr, txHash, contractId }

Other builds

BuildTransactionResponse → { unsignedXdr, txHash }

Submit

SendTransactionResponse

Error handling: Errors. Payload types: Types.