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

useGetEscrowMilestones

useGetEscrowMilestones

Milestones for one escrow (GET /escrows/:contractId/milestones).

Import

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

Signature

function useGetEscrowMilestones(): {
  getEscrowMilestones: (
    contractId: string,
  ) => Promise<GetEscrowMilestonesResponse>;
};

GetEscrowMilestonesResponse = EscrowMilestones (typed milestone list for that contract).

Example

import { useGetEscrowMilestones } from "@trustless-work/escrow/hooks/rest";
import { useQuery } from "@tanstack/react-query";

const { getEscrowMilestones } = useGetEscrowMilestones();

const { data } = useQuery({
  queryKey: ["escrow-milestones", contractId],
  queryFn: () => getEscrowMilestones(contractId),
  enabled: !!contractId,
});

For multiple contracts in one call, use useGetEscrowsMilestones.