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

useGetEscrowsMilestones

useGetEscrowsMilestones

Batch milestones (GET /escrows/milestones).

Import

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

Signature

function useGetEscrowsMilestones(): {
  getEscrowsMilestones: (
    params: BatchContractIdsParams | string[],
  ) => Promise<BatchEscrowMilestonesResponse>;
};

Accepts { contractIds: string[] } or a bare string[].

Returns { data: EscrowMilestones[] }.

Example

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

const { getEscrowsMilestones } = useGetEscrowsMilestones();

const { data } = useQuery({
  queryKey: ["escrows-milestones", contractIds],
  queryFn: () => getEscrowsMilestones({ contractIds }),
  enabled: contractIds.length > 0,
});