Skip to main content
type UseGetSwapPriceReturnType = {
  data:   | GetSwapPriceResult
     | SwapUnavailableResult
     | undefined;
  status: Status;
  error: Error | undefined;
  refetch: () => void;
  reset: () => void;
};
Return type of the useGetSwapPrice hook.

Properties

PropertyTypeDescription
data| GetSwapPriceResult | SwapUnavailableResult | undefinedThe most recent result from getSwapPrice. Cleared when the token pair, network, account, or userId changes. Preserved as stale data during re-fetches triggered by amount or slippage changes.
statusStatusThe status of the getSwapPrice function.
errorError | undefinedThe error returned from the getSwapPrice function.
refetch() => voidA function to refetch the swap price.
reset() => voidA function to reset the state of the hook.