export { F as FORWARDED_ERROR_FIELDS, c as POST_MESSAGE_INTERACTIVE_AUTH_TIMEOUT_MS, d as POST_MESSAGE_PREPARE_SIGNING_TIMEOUT_MS, e as POST_MESSAGE_REQUEST_TIMEOUT_MS, b as PostMessageClient, a as PostMessageMethod, f as PostMessageServer, P as PostMessageType, g as getPostMessageRequestTimeout } from '../post-message-ufv3D_fs.js'; import { CommercePaymentMethod, CommerceCurrency, PrepareCommerceFundingParams, CommerceFundingSession, KmsWrapBroker, SdkSettings } from '../types/index.js'; /** Matches a lowercase- or uppercase-hex-encoded 32-byte Ed25519 key. */ declare const ED25519_HEX_KEY: RegExp; /** * Get the appropriate MoonX API URL based on environment configuration */ declare const getMoonXApiUrl: () => string; declare const COMMERCE_FRAME_SOURCE = "moonx-commerce"; declare const COMMERCE_PARENT_SOURCE = "moonx-commerce-parent"; declare const COMMERCE_READY_TIMEOUT_MS = 20000; declare const COMMERCE_ORIGINS: { readonly main: "https://moonpay.hel.io"; readonly staging: "https://commerce.moonpay-staging.com"; }; declare function isRecord(value: unknown): value is Record; declare function isCommercePaymentMethod(value: unknown): value is CommercePaymentMethod; declare function parseCommercePaymentMethods(value: unknown): CommercePaymentMethod[]; declare function isCommerceDepositId(value: unknown): value is string; declare function isCommerceChain(value: unknown): value is string; /** Validate routing intent without changing its environment or destination. */ declare function parseCommerceFundingParams(value: unknown): PrepareCommerceFundingParams; declare function parseCommerceCurrency(value: unknown): CommerceCurrency; /** Map backend currency fields at the HTTP boundary. */ declare function parseCommerceCurrencyResponse(value: unknown): CommerceCurrency; declare function matchesCommerceAsset(currency: CommerceCurrency, asset?: string): boolean; /** Validate each frame boundary and retain the verified receiving destination. */ declare function parseCommerceSession(value: unknown, useSandbox: boolean, requested?: Pick): CommerceFundingSession; type CommerceEvent = { type: "onReady" | "onSuccess"; } | { type: "onHeightChanged"; height: number; } | { type: "onError"; message: string; }; /** Drop vendor details, unknown events, and non-finite heights. */ declare function parseCommerceEvent(value: unknown): CommerceEvent | null; /** Origin alone does not identify a frame. Require its current window and instance too. */ declare function matchesCommerceFrame(event: { origin: string; source: unknown; data: unknown; }, expected: { origin: string; source: unknown; instanceId?: string; messageSource?: string; }): boolean; declare const getIframeUrl: (path?: string, iframeUrlOverride?: string) => string; declare const getIframeOrigin: (url: string) => string; declare const isKmsWrapBroker: (value: unknown) => value is KmsWrapBroker; declare const isAwsRegion: (value: unknown) => value is string; /** * Whether an app's settings describe a KMS wrap route that can actually run. * * The enable bit alone is not enough. The iframe derives a broker and region * descriptor from these same settings and rejects an enabled configuration * whose broker or region is missing or malformed, so treating the bit as * sufficient lets a caller offer to skip the only passkey while the recovery * route it is trading against cannot be reached. */ declare const kmsWrapConfigUsable: (settings: Pick | null | undefined) => boolean; interface NativeHostChannel { postMessage(data: string): void; } /** The native host channel, or null in a browser context. */ declare const getNativeHost: () => NativeHostChannel | null; /** Whether the page is hosted by a native mobile SDK's WebView. */ declare const isNativeHost: () => boolean; /** * Reserved key in the SDK → iframe `theme` query-param map. Its value is a JSON * array of font-stylesheet URLs (NOT a CSS custom property); the iframe applier * injects them as `` rather than calling `setProperty`. * * Lives in `@moon-x/core` so the producer (react-sdk's `serializeThemeVars`) and * the consumer (the iframe's `applyThemeParam`) share one source of truth — a * rename is then a compile error on both sides instead of a silent wire-contract * drift. */ declare const FONT_URLS_KEY = "__moonxFontUrls"; /** @internal Tokens carried by GET_DEK_INFO.signing_tokens, never a public signing option. */ type SigningPresenceTokens = { sign: { token: string; expires_at: number; }; keyshare_read: { token: string; expires_at: number; }; }; /** @internal Validate the fixed, short-lived signing preparation response. */ declare function parseSigningPresenceTokens(value: unknown): SigningPresenceTokens; /** * The iframe app's /export-key page reports its content height so the modal * around it can size the frame to fit: a parent can't measure a cross-origin * document. Both sides use these, so the message can't drift between them. */ declare const EXPORT_FRAME_MESSAGE_SOURCE = "moonx-export-key"; /** Clamp: a bad value must not collapse the frame or blow up the modal. */ declare const EXPORT_FRAME_MIN_HEIGHT = 48; declare const EXPORT_FRAME_MAX_HEIGHT = 720; interface ExportFrameResizeMessage { source: typeof EXPORT_FRAME_MESSAGE_SOURCE; type: "resize"; height: number; } /** What the export page posts to its parent when its content height changes. */ declare const exportFrameResizeMessage: (height: number) => ExportFrameResizeMessage; /** * The height a `message` event asks the export frame to take, or `null` when * it isn't a resize from that frame. Only accepted from the frame's own * window and the iframe app's origin, so no other frame can resize it. */ declare function readExportFrameHeight(event: { origin: string; source: unknown; data: unknown; }, frame: { origin: string | null; window: unknown; }): number | null; /** * The base language of a BCP 47 or POSIX locale tag, lower-cased: "es-419", * "pt_BR" and "zh-Hant" give "es", "pt" and "zh". Undefined when the tag * doesn't start with a two- or three-letter language. The SDK, the iframe * pages and React Native all resolve languages through this, so a tag means * the same thing on every surface. */ declare function baseLanguage(tag: string | null | undefined): string | undefined; /** `tag`'s base language when `supported` lists it, else `fallback`. */ declare function resolveLanguage(tag: string | null | undefined, supported: readonly T[], fallback: T): T; export { COMMERCE_FRAME_SOURCE, COMMERCE_ORIGINS, COMMERCE_PARENT_SOURCE, COMMERCE_READY_TIMEOUT_MS, type CommerceEvent, ED25519_HEX_KEY, EXPORT_FRAME_MAX_HEIGHT, EXPORT_FRAME_MESSAGE_SOURCE, EXPORT_FRAME_MIN_HEIGHT, type ExportFrameResizeMessage, FONT_URLS_KEY, type NativeHostChannel, type SigningPresenceTokens, baseLanguage, exportFrameResizeMessage, getIframeOrigin, getIframeUrl, getMoonXApiUrl, getNativeHost, isAwsRegion, isCommerceChain, isCommerceDepositId, isCommercePaymentMethod, isKmsWrapBroker, isNativeHost, isRecord, kmsWrapConfigUsable, matchesCommerceAsset, matchesCommerceFrame, parseCommerceCurrency, parseCommerceCurrencyResponse, parseCommerceEvent, parseCommerceFundingParams, parseCommercePaymentMethods, parseCommerceSession, parseSigningPresenceTokens, readExportFrameHeight, resolveLanguage };