Result of useRedeem. data is the RedeemResult ({ hash, truncatedAmount, fee }).

interface UseRedeemResult {
    data: undefined | RedeemResult;
    error: null | MusdError;
    hash: null | `0x${string}`;
    isError: boolean;
    isPending: boolean;
    isSuccess: boolean;
    mutate: (params: RedeemParams) => void;
    mutateAsync: (params: RedeemParams) => Promise<RedeemResult>;
    redeem: (params: RedeemParams) => void;
    redeemAsync: (params: RedeemParams) => Promise<RedeemResult>;
    reset: () => void;
}

Hierarchy (View Summary)

Properties

data: undefined | RedeemResult

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

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

mutateAsync: (params: RedeemParams) => Promise<RedeemResult>

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

redeem: (params: RedeemParams) => void

Redeem MUSD for BTC (alias of mutate).

redeemAsync: (params: RedeemParams) => Promise<RedeemResult>

Promise-returning redeem.

reset: () => void

Reset the mutation back to idle.