import { AppIdentifier, IInitializeParameters, IOpenModalParameters, IOpenOnboardingModalParameters, ISetFiltersParameters, ISetJWTParameters, ISetNavigateParameters, ISetThemeParameters, ISetUserOnboardingJWTParameters, IZeroHashSDK } from "./types"; declare global { interface Window { /** * Version of zh-web-sdk loaded on the host page. Embedded * `@zerohash-sdk/*` web components read this and forward it to their * iframe Faro logs as `zh_web_sdk_version`. Absent when the new SDKs * are embedded directly without zh-web-sdk. */ __ZH_WEB_SDK_VERSION__?: string; } } export declare class ZeroHashSDK implements IZeroHashSDK { private rootQuerySelector; private onboardingInitialized; /** * initializedApps is a map that keeps track of which apps have been initialized. * This might grow as we start supporting new apps. */ private initializedApps; /** * Sets up the ZeroHash SDK and appends the ZeroHash DOM elements onto the page. * * For more information, see {@code IInitializeParameters} */ constructor({ zeroHashOnboardingURL, rootQuerySelector, userOnboardingJWT, cryptoWithdrawalsJWT, fiatDepositsJWT, fiatWithdrawalsJWT, cryptoBuyJWT, cryptoSellJWT, fundJWT, profileJWT, cryptoAccountLinkJWT, cryptoAccountLinkPayoutsJWT, payoutsJWT, payJWT, fiatAccountLinkJWT, travelRuleJWT, zeroHashAppsURL, env, theme, }: IInitializeParameters); /** * setJWT sets the JWT for the appIdentifier provided. * The JWT should be the JWT provided by ZeroHash via the platform * API proxied through your servers. As ZeroHash cannot authenticate * your users' requests, it is paramount that the user be authenticated * and validated on your servers, and exchanged for the JWT using your * API key. DO NOT have the JWT exchange logic be on your front-end. * * As a precaution, we may restrict traffic to the JWT exchange API to * whitelisted IPs that come from your server. */ setJWT({ jwt, appIdentifier }: ISetJWTParameters): void; setFilters({ filters, appIdentifier }: ISetFiltersParameters): void; /** * Sets the navigate field for the appIdentifier provided. Currently this is * specific to Onboarding and is used to navigate to a specific page within the App. */ setNavigate({ appIdentifier, navigate }: ISetNavigateParameters): void; /** * setTheme updates the theme forwarded to new @zerohash-sdk/*-react * components. Accepts 'light', 'dark', or 'auto'. Has no effect on the * legacy iframe path or the Connect Auth (Fund) component. */ setTheme({ theme }: ISetThemeParameters): void; /** * setUserOnboardingJWT sets the JWT to be whatever value is provided. * The JWT should be the UserJWT provided by ZeroHash via the platform * API proxied through your servers. As ZeroHash cannot authenticate * your users' requests, it is paramount that the user be authenticated * and validated on your servers, and exchanged for the JWT using your * API key. DO NOT have the JWT exchange logic be on your front-end. * * As a precaution, we may restrict traffic to the JWT exchange API to * whitelisted IPs that come from your server. * @deprecated in favor of setJWT({jwt: , appIdentifier: "onboarding"}) */ setUserOnboardingJWT(params: ISetUserOnboardingJWTParameters): void; /** * isOnboardingModalOpen returns true if the onboarding modal is open, * false otherwise * @deprecated in favor of isModalOpen("onboarding") */ isOnboardingModalOpen(): boolean; /** * isModalOpen returns true if the modal is open, * for the appIdentifier provided, false otherwise */ isModalOpen(appIdentifier: AppIdentifier): boolean; /** * closeModal hides the modal for the appIdentifier provided. */ closeModal(appIdentifier: AppIdentifier): void; /** * openModal opens the modal for the appIdentifier provided. * * When the JWT payload contains `use_new_sdk: true`, the modal renders * the corresponding `@zerohash-sdk/*-react` npm package instead of the * legacy iframe. Apps that don't yet have a published React package * (e.g. crypto-account-link) fall back to the iframe automatically. */ openModal({ jwt, appIdentifier, filters, navigate, depositId, walletAddress, }: IOpenModalParameters): void; /** * openOnboardingModal opens the onboarding modal * @deprecated in favor of openModal({appIdentifier: "onboarding", jwt: }) */ openOnboardingModal(params: IOpenOnboardingModalParameters): void; /** * closeOnboardingModalModal hides the onboarding modal * @deprecated in favor of closeModal("onboarding") */ closeOnboardingModal(): void; } /** * Test-only: clear the set-once `_newSdkOrigin` pin so suites that * construct `ZeroHashSDK` multiple times can exercise different envs in * isolation. Not exported from the package; tests import it directly. */ export declare function _resetNewSdkOriginForTests(): void; export default ZeroHashSDK; export * from "./types";