Escrow Information
REST Reads
Typed helpers for Core GET /escrows*. Pair each hook with TanStack Query (or your own cache).
Import from @trustless-work/escrow, @trustless-work/escrow/hooks, or @trustless-work/escrow/hooks/rest.
Hooks
useListEscrows
GET /escrows
useGetEscrow
GET /escrows/:contractId
useGetEscrowDetails
GET /escrows/details?contractIds=
useListEscrowEvents
GET /escrows/:contractId/events
useGetEscrowMilestones
GET /escrows/:contractId/milestones
useGetEscrowsMilestones
GET /escrows/milestones?contractIds=
useGetEscrowsFinancial
GET /escrows/financial?contractIds=
Quick example
import { useListEscrows, useGetEscrow } from "@trustless-work/escrow/hooks/rest";
import { useQuery } from "@tanstack/react-query";
const { listEscrows } = useListEscrows();
const { getEscrow } = useGetEscrow();
useQuery({
queryKey: ["escrows", "mine"],
queryFn: () => listEscrows({ scope: "mine", limit: 20 }),
});
useQuery({
queryKey: ["escrow", contractId],
queryFn: () => getEscrow(contractId),
enabled: !!contractId,
});Filters & pagination
ListEscrowsParams: scope, status, contractType, engagementId, contractIds, participant, role, platformId, subjectId, createdAfter, createdBefore, limit, cursor, sort, order.
Use
scope: "mine" | "all"for segmentation (not per-escrow access grants).List/events return a keyset page:
{ data, hasMore, nextCursor }.
Read-model shapes
EscrowSummary
List/detail row: contractId, type, status, balance, asset, camelCased snapshot
EscrowDetail
{ escrow, events, deposits }
EscrowFinancial
Batch financial: deposited / released / pending / balance
EscrowEvent
Indexed event — no UUID event id
EscrowDeposit
Deposit row — no UUID deposit id
Amounts on reads are human decimal strings. Prefer GraphQL when you need nested financial + deposits + events in one call — see GraphQL.