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

useInitializeEscrow

Deploy the escrow contract and define the escrow properties.

useDeployEscrow

Build an unsigned deploy transaction for a new v2 escrow. Returns unsignedXdr plus the predicted contractId.

Import

import { useDeployEscrow } from "@trustless-work/escrow";
// or
import { useDeployEscrow } from "@trustless-work/escrow/hooks/rest";

Signature

function useDeployEscrow(): {
  deployEscrow: (
    payload: DeploySingleReleaseEscrowPayload | DeployMultiReleaseEscrowPayload,
    type: EscrowType,
    attribution?: AttributionHeaders,
  ) => Promise<DeployEscrowResponse>;
};

Returns DeployEscrowResponse: { unsignedXdr, txHash, contractId }.

Single vs multi

DeploySingleReleaseEscrowPayload: signer, engagementId, title, description, amount, platformFee, roles (Roles), milestones (SingleReleaseMilestonePayload[]), trustline (DeployTrustline).

await deployEscrow(payload, "single-release");

DeployMultiReleaseEscrowPayload: same fields except no top-level amount; roles is MultiReleaseRoles; each milestone includes amount + receiver.

await deployEscrow(payload, "multi-release");

Deploy trustline shape: { contractId, symbol } (Soroban SAC C… + asset code). Optional attribution maps to X-TW-Platform / X-TW-Subject.

Example