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

useFundEscrow

Allows users to deposit funds into an existing escrow contract, securing them until the agreed conditions are met.

useFundEscrow

Fund an existing escrow by contractId.

Import

import { useFundEscrow } from "@trustless-work/escrow";
// or
import { useFundEscrow } from "@trustless-work/escrow/hooks/rest";

Signature

function useFundEscrow(): {
  fundEscrow: (
    payload: FundEscrowPayload,
    type: EscrowType,
  ) => Promise<BuildTransactionResponse>;
};

FundEscrowPayload: { amount: number; contractId: string; signer: string }.

Returns BuildTransactionResponse: { unsignedXdr, txHash }.

Single vs multi

Pass "single-release" or "multi-release" as type. The payload shape is the same for both.

Example