useGetEscrowMilestones
useGetEscrowMilestones
Import
import { useGetEscrowMilestones } from "@trustless-work/escrow/hooks/rest";Signature
function useGetEscrowMilestones(): {
getEscrowMilestones: (
contractId: string,
) => Promise<GetEscrowMilestonesResponse>;
};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,
});