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

useGraphqlGetEscrow

useGraphqlGetEscrow

GraphQL escrow(contractId:) — detail with financial, deposits, and events.

Import

import { useGraphqlGetEscrow } from "@trustless-work/escrow/hooks/graphql";

Signature

function useGraphqlGetEscrow(): {
  getEscrow: (variables: GraphqlGetEscrowVariables) => Promise</* GraphqlEscrow */>;
};

GraphqlGetEscrowVariables:

{
  contractId: string;
  eventsLimit?: number;
  eventsCursor?: string;
  eventsOrder?: "asc" | "desc";
}

Example

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

const { getEscrow } = useGraphqlGetEscrow();

const { data } = useQuery({
  queryKey: ["gql-escrow", contractId, { eventsLimit: 20 }],
  queryFn: () =>
    getEscrow({
      contractId,
      eventsLimit: 20,
      eventsOrder: "desc",
    }),
  enabled: !!contractId,
});

Document constant: GRAPHQL_GET_ESCROW from @trustless-work/escrow/graphql.