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

useGraphqlListEscrows

useGraphqlListEscrows

GraphQL escrows(...) — keyset list (twin of REST GET /escrows).

Import

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

Signature

function useGraphqlListEscrows(): {
  listEscrows: (
    variables?: GraphqlListEscrowsVariables,
  ) => Promise</* GraphqlEscrowPage */>;
};

GraphqlListEscrowsVariables mirrors REST list filters: scope, status, contractType, engagementId, contractIds, participant, role, platformId, subjectId, createdAfter, createdBefore, limit, cursor, sort, order.

Example

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

const { listEscrows } = useGraphqlListEscrows();

const { data } = useQuery({
  queryKey: ["gql-escrows", "mine"],
  queryFn: () =>
    listEscrows({
      scope: "mine",
      limit: 20,
      sort: "createdAt",
      order: "desc",
    }),
});

// data → GraphqlEscrowPage (items + cursor fields)

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