Result of useOpenTrove, the write shape with a named openTrove action.

interface UseOpenTroveResult {
    data: undefined | WriteResult;
    error: null | MusdError;
    hash: null | `0x${string}`;
    isError: boolean;
    isPending: boolean;
    isSuccess: boolean;
    mutate: (params: OpenTroveParams) => void;
    mutateAsync: (params: OpenTroveParams) => Promise<WriteResult>;
    openTrove: (params: OpenTroveParams) => void;
    openTroveAsync: (params: OpenTroveParams) => Promise<WriteResult>;
    reset: () => void;
}

Hierarchy (View Summary)

Properties

data: undefined | WriteResult

The full core result (e.g. RedeemResult carries truncatedAmount + fee).

error: null | MusdError

The core's typed MusdError, or null.

hash: null | `0x${string}`

The submitted tx hash (once available), or null.

isError: boolean

true if the write failed (see error).

isPending: boolean

true while the write is in flight.

isSuccess: boolean

true once the write has been submitted successfully.

mutate: (params: OpenTroveParams) => void

Fire the write (fire-and-forget; track via isPending/isSuccess/error).

mutateAsync: (params: OpenTroveParams) => Promise<WriteResult>

Promise-returning variant (resolves to the result, or rejects with the typed error).

openTrove: (params: OpenTroveParams) => void

Open a Trove (alias of mutate).

openTroveAsync: (params: OpenTroveParams) => Promise<WriteResult>

Promise-returning openTrove (alias of mutateAsync).

reset: () => void

Reset the mutation back to idle.