Skip to main content
type UseSwapReturnType = {
  swap: (options: ExecuteSwapOptions) => Promise<void>;
  data:   | SwapTransactionData
     | undefined;
  status: Status;
  error: Error | undefined;
  reset: () => void;
};
Return type of the useSwap hook.

Properties

PropertyTypeDescription
swap(options: ExecuteSwapOptions) => Promise<void>The function to execute a swap.
data| SwapTransactionData | undefinedThe data returned from the swap function.
statusStatusThe status of the swap function.
errorError | undefinedThe error returned from the swap function or due to polling the user operation.
reset() => voidResets the hook to its initial idle state, clearing data, error, and status.