useFundEscrow
Allows users to deposit funds into an existing escrow contract, securing them until the agreed conditions are met.
Usage
This custom hook exposes a mutation function to fund and escrow.
Description of Return Values
isPending
A boolean status flag indicating whether the mutation is currently in progress. Useful for showing loaders or disabling UI elements during the process.isError
A boolean status flag that becomestrue
if the mutation fails.isSuccess
A boolean status flag that becomestrue
once the mutation completes successfully.
Mutation Function
fundEscrow
This is the main mutation function. Internally, it wrapsmutate
ormutateAsync
and is responsible for building and returning an unsigned transaction based on the provided payload.
Argument:
FundEscrowPayload
: An object containing the required fields to fund an escrow.
Return Value:
unsignedTransaction
: An object representing the constructed transaction, ready to be signed by your wallet and broadcast.
Usage Example
Last updated
Was this helpful?