Skip to content

finalizeBTCTransaction

finalizeBTCTransaction(config, store, client, options): Promise<EdictRuneResponse | TransferBTCResponse >

Prepares BTC transaction for the intentions. Calculates gas limits for EVM transactions, total fees and transfers.

If options.shouldComplete is true, adds a complete transaction to the intentions.

Import

ts
import { finalizeBTCTransaction } from "@midl-xyz/midl-js-executor";

Example

ts
import { createPublicClient } from "viem";

const client = createPublicClient({
  chain, // midl chain
  transport, // http transport for midl chain
});

const tx = await finalizeBTCTransaction(config, store, client, {
  shouldComplete: true,
});

Parameters

NameTypeDescription
configConfigThe configuration object
storeStoreThe store object
clientobjectEVM client or provider
optionsFinalizeBTCTransactionOptionsThe options for the request

FinalizeBTCTransactionOptions

NameTypeDescription
stateOverride?StateOverrideState override for EVM transactions
publicKey?stringPublic key of the account to use for signing
gasPrice?bigintGas price for EVM transactions
shouldComplete?booleanIf true, send complete transaction
feeRateMultiplier?numberFee rate multiplier for the transaction
assetsToWithdraw?[Address] | [Address, Address]Array of ERC20 assets to withdraw

Returns

Promise<EdictRuneResponse | TransferBTCResponse >

BTC transaction response