Interface MusdWriteResult<TParams, TData>

Common wagmi-idiomatic write-hook shape. error is the core's typed MusdError.

interface MusdWriteResult<TParams, TData> {
    data: undefined | TData;
    error: null | MusdError;
    hash: null | `0x${string}`;
    isError: boolean;
    isPending: boolean;
    isSuccess: boolean;
    mutate: (params: TParams) => void;
    mutateAsync: (params: TParams) => Promise<TData>;
    reset: () => void;
}

Type Parameters

  • TParams
  • TData

Hierarchy (View Summary)

Properties

data: undefined | TData

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: TParams) => void

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

mutateAsync: (params: TParams) => Promise<TData>

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

reset: () => void

Reset the mutation back to idle.