UNPKG

@funkit/connect

Version:

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

22 lines (21 loc) 810 B
/** * Opens an external flow (e.g. Meld, Swapped) in a centered popup. * * iOS and Safari block window.open() calls that don't happen synchronously * inside a user-gesture handler. Because the URL often isn't known until after * an async fetch, we open about:blank immediately (within the gesture), show a * spinner, and then set popup.location.href once the URL resolves. This keeps * us inside the trusted-event window while still supporting async URL fetching. * * Returns true if the popup was opened, false if it was blocked. */ export declare function openExternalFlowPopup(linkGetter: () => Promise<{ widgetUrl: string; }>, options: { dimensions: { width: number; height: number; }; loaderTheme: 'light' | 'dark'; loaderTitle: string; }): Promise<boolean>;