UNPKG

@funkit/connect

Version:

Funkit Connect SDK elevates DeFi apps via web2 sign-ins and one-click checkouts.

31 lines (30 loc) 1.14 kB
import type { Address } from 'viem'; import type { ErrorNotification } from '~/components/FunNotification/FunNotification'; import { type PaymentMethodInfo } from '~/domains/paymentMethods'; export interface MoonpayDepositData { depositToken: string; depositTokenAmount: number; depositTokenChainId: string; } export interface PostCheckoutError extends ErrorNotification { disableContinue: boolean; durationMs?: number; } export interface PostCheckoutSuccessData { depositAddress: Address; moonpayData: MoonpayDepositData; paymentMethodInfo: PaymentMethodInfo; isSendingToQr: boolean; } interface UsePostCheckoutOptions { onSuccess(data: PostCheckoutSuccessData): void; } interface UsePostCheckoutResult { handlePostCheckout(depositAddress: Address): Promise<void>; isPostCheckoutLoading: boolean; postCheckoutError: PostCheckoutError | null; postCheckoutStepMessage: string | null; } export declare function toPostCheckoutError(error: unknown): PostCheckoutError; export declare function usePostCheckout({ onSuccess, }: UsePostCheckoutOptions): UsePostCheckoutResult; export {};