Skip to content

useAddRuneERC20Intention

Adds a Rune to the Midl network. Wraps addRuneERC20Intention and exposes a React Query mutation for creating a transaction intention.

Import

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

Example

ts
const { addRuneERC20 } = useAddRuneERC20Intention();

addRuneERC20({ runeId: "840000:1", reset: true });

Parameters

NameTypeDescription
configConfig(optional) Custom configuration to override the default.
storeMidlContextStore(optional) Custom Midl store.
mutationobject(optional) React Query UseMutationOptions (minus mutationFn). You can pass callbacks like onSuccess, onError, etc.

Returns

NameTypeDescription
addRuneERC20(variables: AddRuneERC20IntentionVariables) => voidMutation function to add a Rune intention.
addRuneERC20Async(variables: AddRuneERC20IntentionVariables) => Promise<TransactionIntention>Async mutation function.
...restobjectAdditional mutation state from React Query.

AddRuneERC20IntentionVariables

NameTypeDescription
runeIdstringThe rune name or ID to add.
resetboolean (optional)If true the current intentions array is replaced instead of appended to.

Released under the MIT License