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

useWithdrawRemainingFunds

In a multi-release escrow, when some funds are locked, you can use this hook to release the remaining funds

useWithdrawRemainingFunds

Withdraw remaining funds after release/dispute flows leave a balance.

Import

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

Signature

function useWithdrawRemainingFunds(): {
  withdrawRemainingFunds: (
    payload:
      | SingleReleaseWithdrawRemainingFundsPayload
      | MultiReleaseWithdrawRemainingFundsPayload,
    type: EscrowType,
  ) => Promise<BuildTransactionResponse>;
};

Both payload types alias the resolve-dispute shape: { contractId, disputeResolver, distributions } (multi does not add milestoneIndexes on the TypeScript type — same as single).

Returns BuildTransactionResponse: { unsignedXdr, txHash }.

Example