useListEscrowEvents
useListEscrowEvents
Import
import { useListEscrowEvents } from "@trustless-work/escrow/hooks/rest";Signature
function useListEscrowEvents(): {
listEscrowEvents: (
contractId: string,
params?: ListEscrowEventsParams,
) => Promise<ListEscrowEventsResponse>;
};Example
import { useListEscrowEvents } from "@trustless-work/escrow/hooks/rest";
import { useQuery } from "@tanstack/react-query";
const { listEscrowEvents } = useListEscrowEvents();
const { data } = useQuery({
queryKey: ["escrow-events", contractId],
queryFn: () =>
listEscrowEvents(contractId, { limit: 30, order: "desc" }),
enabled: !!contractId,
});