@funkit/connect
Version:
Funkit Connect SDK elevates DeFi apps via web2 sign-ins and one-click checkouts.
24 lines (23 loc) • 1.08 kB
TypeScript
import type { ErrorNotification } from '~/components/FunNotification/FunNotification';
interface UseQuoteRefreshOptions {
/**
* Freeze the latest quote state, e.g. so we do not change the quote mid-confirmation
*/
isOnHold: boolean;
/**
* Controls in what interval to refresh the quote data in case of a hard refresh, in case of pre-loading it controls when to set the data, should be more than `BEFORE_COUNTDOWN_ENDS_SEC` by at least 10 seconds to provide the API the time needed to complete the call
*/
refreshIntervalSeconds: number;
}
interface UseQuoteRefreshResult {
/** Quoting state indicated a bit in advance for UX reasons */
isRefreshing: boolean;
isQuoting: boolean;
countdown: React.ReactNode;
quoteError: ErrorNotification | null;
quoteStepMessage: string | null;
/** Safe to call asynchronously */
refreshQuote(ignorePreloaded?: boolean): Promise<void>;
}
export declare function useQuoteRefresh({ isOnHold, refreshIntervalSeconds, }: UseQuoteRefreshOptions): UseQuoteRefreshResult;
export {};