Skip to content

addTxIntention

addTxIntention(config, store, intention, reset, publicKey?): Promise<TransactionIntention>

Add a transaction intention to the store

Import

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

Example

ts
const intention = await addTxIntention(config, store, {
  evmTransaction: {
    to: "0x...",
    data: "0x...",
  },
  value: 100n,
  hasDeposit: true,
});
console.log(intention);

Parameters

NameTypeDescription
configConfigThe configuration object
storeStoreThe store object
intentionPartialIntentionThe intention to add
reset?booleanIf true, the intentions array will be reset. Default is false
publicKey?stringPublic key to use to sign the transaction

PartialIntention

Defined in packages/executor/src/actions/addTxIntention.ts

Returns

Promise<TransactionIntention> - The added intention

TransactionIntention

NameTypeDescription
evmTransactionTransactionSerializableBTCEVM transaction to execute
signedEvmTransaction?stringSerialized signed EVM transaction
value?bigintNative token value to transfer to Midl
rune?{ id: string; value: bigint; }Rune id and value to transfer to Midl
hasRunesWithdraw?booleanIf true, the intention contains runes to withdraw
hasWithdraw?booleanIf true, the intention contains Bitcoin to withdraw
hasDeposit?booleanIf true, the intention contains a Bitcoin deposit
hasRunesDeposit?booleanIf true, the intention contains a Rune deposit