Skip to content

useAddRequestAddAssetIntention ​

Adds a request to add an asset intention. Wraps addRequestAddAssetIntention and stores the resulting intention in the context store.

Import ​

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

Example ​

ts
const { addRequestAddAssetIntention } = useAddRequestAddAssetIntention();
addRequestAddAssetIntention({
  address: "0x0000000000000000000000000000000000000000",
  runeId: "840000:1",
  amount: 1000000n,
});

Parameters ​

NameTypeDescription
configConfig(optional) Custom configuration to override the default.
storeMidlContextStore(optional) Custom store to override the default.

Returns ​

NameTypeDescription
addRequestAddAssetIntention(variables: AddRequestAddAssetIntentionVariables) => voidMutation function to add the intention.
addRequestAddAssetIntentionAsync(variables: AddRequestAddAssetIntentionVariables) => Promise<TransactionIntention>Async mutation function.
...restobjectAdditional mutation state from React Query.

AddRequestAddAssetIntentionVariables ​

NameTypeDescription
address0x${string}ERC20 contract address.
runeIdstringThe rune ID to associate with the asset.
amountbigintAmount of the rune to deposit.
fromstring (optional)BTC address to use for the intention.
resetboolean (optional)If true, clears existing intentions before adding the new one.

Released under the MIT License