Skip to content

useSignIntention

Signs a transaction intention.

Import

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

Example

ts
const { signIntention } = useSignIntention();
signIntention({ intention, txId });

Parameters

NameTypeDescription
configConfig (optional)Custom configuration to override the default.
storeMidlContextStore (optional)Custom store to override the default.
mutationUseMutationOptions (optional)Mutation options for React Query.
options.protocolSignMessageProtocol (optional)Protocol to use for signing the intention.
options.fromstring (optional)BTC address used to sign the transactions.
options.noncenumber (optional)Starting nonce for the intentions.

Returns

NameTypeDescription
signIntention(variables: SignIntentionVariables) => voidFunction to sign a specific transaction intention.
signIntentionAsync(variables: SignIntentionVariables) => Promise<SignIntentionResponse>Async function to sign an intention.
intentionsTransactionIntention[] The current list of transaction intentions.
...restobjectAdditional mutation state from React Query.

SignIntentionVariables

NameTypeDescription
intentionTransactionIntentionThe intention to sign.
txIdstringTransaction hash of the BTC transaction .

Released under the MIT License