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

useChangeMilestoneStatus

Responsible for modifying the "status" property of a specific milestone in the escrow.

useChangeMilestoneStatus

Batch change milestone status (and optional evidence). Works for both escrow types.

Import

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

Signature

function useChangeMilestoneStatus(): {
  changeMilestoneStatus: (
    payload: ChangeMilestoneStatusPayload,
    type: EscrowType,
  ) => Promise<BuildTransactionResponse>;
};

ChangeMilestoneStatusPayload:

{
  contractId: string;
  serviceProvider: string;
  updates: Array<{
    index: number;
    newStatus: string;
    newEvidence?: string;
  }>;
}

Returns BuildTransactionResponse: { unsignedXdr, txHash }.

Single vs multi

Same payload and batch API for both types — pass the matching EscrowType.

Example