Skip to content

useFinalizeBTCTransaction ​

Prepares a Bitcoin transaction for the provided intentions. Calculates gas limits for EVM transactions, total fees, and transfers. Handles both BTC and rune transfers.

Import ​

ts
import { useFinalizeBTCTransaction } from "@midl/executor-react";

Example ​

ts
const { finalizeBTCTransaction } = useFinalizeBTCTransaction();
finalizeBTCTransaction({ feeRate: 10 });

Parameters ​

NameTypeDescription
mutationUseMutationOptions (optional)Mutation options for React Query.
configConfig (optional)Custom configuration to override the default.
storeMidlContextStore (optional)Custom store to override the default.

Returns ​

NameTypeDescription
finalizeBTCTransaction(variables: FinalizeMutationVariables) => voidFunction to initiate finalizing BTC transactions.
finalizeBTCTransactionAsync(variables: FinalizeMutationVariables) => Promise<EdictRuneResponse | TransferBTCResponse>Async function to finalize BTC transactions.
...restobjectAdditional mutation state from React Query.

FinalizeMutationVariables ​

NameTypeDescription
stateOverrideStateOverride (optional)State override to estimate the cost of the transaction.
assetsToWithdrawSizenumber (optional)Number of assets to withdraw (for fee calculation).
feeRatenumber (optional)Custom fee rate in sats/vB.
skipEstimateGasMultiboolean (optional)If true, skip the gas estimation for EVM transactions.
fromstring (optional)BTC address used to sign the transactions.

Released under the MIT License