useGetEscrowDetails
useGetEscrowDetails
Batch escrow details (GET /escrows/details).
Import
import { useGetEscrowDetails } from "@trustless-work/escrow/hooks/rest";Signature
function useGetEscrowDetails(): {
getEscrowDetails: (
params: BatchContractIdsParams | string[],
) => Promise<BatchEscrowDetailsResponse>;
};Accepts { contractIds: string[] } or a bare string[].
Returns { data: EscrowDetailsItem[] }.
Example
import { useGetEscrowDetails } from "@trustless-work/escrow/hooks/rest";
import { useQuery } from "@tanstack/react-query";
const { getEscrowDetails } = useGetEscrowDetails();
const { data } = useQuery({
queryKey: ["escrow-details", contractIds],
queryFn: () => getEscrowDetails({ contractIds }),
enabled: contractIds.length > 0,
});
// or: getEscrowDetails(contractIds)