import { PickedEventListeners } from '@dynamic-labs/message-transport'; import { UserInterfaceModuleMessages, userInterfaceEventNames } from '@dynamic-labs/webview-messages'; import type { UserFields } from '@dynamic-labs/sdk-api-core'; import { Core } from '../../client/core'; type UserInterfaceModuleMethods = { auth: { /** * Opens the auth flow UI. * * Resolves when our SDK receives the request. * Rejects if the request is not received. */ show: () => Promise; /** * Closes the auth flow UI. * * Resolves when our SDK receives the request. * Rejects if the request is not received. */ hide: () => Promise; }; userProfile: { /** * Opens the user profile UI. * * Resolves when our SDK receives the request. * Rejects if the request is not received. */ show: () => Promise; /** * Closes the user profile UI. * * Resolves when our SDK receives the request. * Rejects if the request is not received. */ hide: () => Promise; }; wallets: { revealEmbeddedWalletKey: UserInterfaceModuleMessages['revealEmbeddedWalletKey']; /** * Opens a view that allows the user to upgrade to MPC v3 wallets. * * Resolves when our SDK receives the request. * Rejects if the request is not received. */ promptUpgradeToDynamicWaasFlow: () => Promise; }; fundingOptions: { /** * Opens a screen with a list of funding options. * * Resolves when our SDK receives the request. * Rejects if the request is not received. */ show: () => Promise; /** * Closes the funding options screen. * * Resolves when our SDK receives the request. * Rejects if the request is not received. */ hide: () => Promise; }; updateUser: { /** * Opens the user update modal with specified fields. * * Resolves with the updated user fields when the user completes the update. * Rejects if the user cancels or if the request fails. */ show: (params: { fields: (keyof UserFields)[]; options?: { title?: string; subtitle?: string; submitText?: string; }; }) => Promise; }; mfa: { /** * Prompts the user to authenticate with MFA. * * Resolves with the MFA token when the user completes authentication. * Rejects if the user cancels or if the request fails. */ show: (params?: { createMfaToken?: boolean; }) => Promise; /** * Opens the MFA management screen. * * Resolves when our SDK receives the request. * Rejects if the request is not received. */ manage: { show: () => Promise; hide: () => Promise; }; /** * Opens the MFA choose type screen. * * Resolves when our SDK receives the request. * Rejects if the request is not received. */ chooseType: { show: () => Promise; hide: () => Promise; }; /** * Opens the MFA QR code screen. * * Resolves when our SDK receives the request. * Rejects if the request is not received. */ qrCode: { show: () => Promise; hide: () => Promise; }; /** * Opens the MFA OTP verification screen. * * Resolves when our SDK receives the request. * Rejects if the request is not received. */ otpVerification: { show: () => Promise; hide: () => Promise; }; /** * Opens the MFA view backup codes screen. * * Resolves when our SDK receives the request. * Rejects if the request is not received. */ viewBackupCodes: { show: () => Promise; hide: () => Promise; }; /** * Opens the MFA enter backup codes screen. * * Resolves when our SDK receives the request. * Rejects if the request is not received. */ enterBackupCodes: { show: () => Promise; hide: () => Promise; }; }; }; type PublicUserInterfaceModuleMessages = Pick; export type UserInterfaceModule = PickedEventListeners & UserInterfaceModuleMethods; export declare const createUserInterfaceModule: (core: Core) => UserInterfaceModule; export {};