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
Name | Type | Description |
---|---|---|
config | Config | The configuration object |
store | Store | The store object |
intention | PartialIntention | The intention to add |
reset? | boolean | If true, the intentions array will be reset. Default is false |
publicKey? | string | Public key to use to sign the transaction |
PartialIntention
Defined in packages/executor/src/actions/addTxIntention.ts
Returns
Promise
<TransactionIntention
> - The added intention
TransactionIntention
Name | Type | Description |
---|---|---|
evmTransaction | TransactionSerializableBTC | EVM transaction to execute |
signedEvmTransaction? | string | Serialized signed EVM transaction |
value? | bigint | Native token value to transfer to Midl |
rune? | { id: string; value: bigint; } | Rune id and value to transfer to Midl |
hasRunesWithdraw? | boolean | If true, the intention contains runes to withdraw |
hasWithdraw? | boolean | If true, the intention contains Bitcoin to withdraw |
hasDeposit? | boolean | If true, the intention contains a Bitcoin deposit |
hasRunesDeposit? | boolean | If true, the intention contains a Rune deposit |