@moonpay/platform-sdk-core 1.9.0 → 1.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -169,6 +169,25 @@ declare function themeParams(theme?: ThemeOptions): Record<string, string>;
169
169
  * (or partner-embedded) theme always wins over the client default.
170
170
  */
171
171
  declare function applyThemeParam(url: string, theme?: ThemeOptions): string;
172
+ /**
173
+ * Presentation modes honoured by every visible MoonPay frame: `bare` (flat,
174
+ * no backdrop or close button — for hosts that supply their own chrome) or
175
+ * `modal` (the animated sheet-with-backdrop treatment). Left unset, the frame
176
+ * applies its own default.
177
+ */
178
+ type PresentationMode = 'bare' | 'modal';
179
+ /**
180
+ * Query params for a presentation mode. Returns `{}` when unset, so it
181
+ * spreads cleanly into a frame URL's query object and the frame's own
182
+ * default applies.
183
+ */
184
+ declare function presentationParams(presentation?: PresentationMode): Record<string, string>;
185
+ /**
186
+ * Set the `presentation` query param on an already-built frame URL (e.g. a
187
+ * challenge URL supplied via a quote's `challenge` event) — unless the URL
188
+ * already carries one.
189
+ */
190
+ declare function applyPresentationParam(url: string, presentation?: PresentationMode): string;
172
191
 
173
192
  interface CoreClientOptions extends ClientContextOptions, UrlBuilderOptions {
174
193
  /**
@@ -313,4 +332,4 @@ declare function isTrustedFrameOrigin(origin: string): boolean;
313
332
  */
314
333
  declare function isTrustedFrameUrl(value: string): boolean;
315
334
 
316
- export { type ClientContext, type ClientContextOptions, type CoreClient, type CoreClientOptions, FRAME_PATHS, type FrameHandle, type FrameOptions, type FrameOrchestratorOptions, type FrameTransport, type KeyPair, type ListAssetsParams, type ListTransactionsParams, TRUSTED_FRAME_ORIGIN_PATTERNS, type ThemeOptions, type UrlBuilderOptions, apiFetch, applyThemeParam, buildFrameUrl, createClientContext, createClientCore, createFrameOrchestrator, createIdentity, decryptCredentials, deletePaymentMethod, generateKeyPair, getAssets, getCustomer, getCustomerUploadUrl, getIdentity, getIdentityUploadUrl, getPaymentMethods, getQuote, getTransaction, isTrustedFrameOrigin, isTrustedFrameUrl, listTransactions, submitCustomerFiles, submitCustomerKyc, submitIdentityFiles, themeParams, updateIdentity, verifyIdentity };
335
+ export { type ClientContext, type ClientContextOptions, type CoreClient, type CoreClientOptions, FRAME_PATHS, type FrameHandle, type FrameOptions, type FrameOrchestratorOptions, type FrameTransport, type KeyPair, type ListAssetsParams, type ListTransactionsParams, type PresentationMode, TRUSTED_FRAME_ORIGIN_PATTERNS, type ThemeOptions, type UrlBuilderOptions, apiFetch, applyPresentationParam, applyThemeParam, buildFrameUrl, createClientContext, createClientCore, createFrameOrchestrator, createIdentity, decryptCredentials, deletePaymentMethod, generateKeyPair, getAssets, getCustomer, getCustomerUploadUrl, getIdentity, getIdentityUploadUrl, getPaymentMethods, getQuote, getTransaction, isTrustedFrameOrigin, isTrustedFrameUrl, listTransactions, presentationParams, submitCustomerFiles, submitCustomerKyc, submitIdentityFiles, themeParams, updateIdentity, verifyIdentity };
package/dist/index.d.ts CHANGED
@@ -169,6 +169,25 @@ declare function themeParams(theme?: ThemeOptions): Record<string, string>;
169
169
  * (or partner-embedded) theme always wins over the client default.
170
170
  */
171
171
  declare function applyThemeParam(url: string, theme?: ThemeOptions): string;
172
+ /**
173
+ * Presentation modes honoured by every visible MoonPay frame: `bare` (flat,
174
+ * no backdrop or close button — for hosts that supply their own chrome) or
175
+ * `modal` (the animated sheet-with-backdrop treatment). Left unset, the frame
176
+ * applies its own default.
177
+ */
178
+ type PresentationMode = 'bare' | 'modal';
179
+ /**
180
+ * Query params for a presentation mode. Returns `{}` when unset, so it
181
+ * spreads cleanly into a frame URL's query object and the frame's own
182
+ * default applies.
183
+ */
184
+ declare function presentationParams(presentation?: PresentationMode): Record<string, string>;
185
+ /**
186
+ * Set the `presentation` query param on an already-built frame URL (e.g. a
187
+ * challenge URL supplied via a quote's `challenge` event) — unless the URL
188
+ * already carries one.
189
+ */
190
+ declare function applyPresentationParam(url: string, presentation?: PresentationMode): string;
172
191
 
173
192
  interface CoreClientOptions extends ClientContextOptions, UrlBuilderOptions {
174
193
  /**
@@ -313,4 +332,4 @@ declare function isTrustedFrameOrigin(origin: string): boolean;
313
332
  */
314
333
  declare function isTrustedFrameUrl(value: string): boolean;
315
334
 
316
- export { type ClientContext, type ClientContextOptions, type CoreClient, type CoreClientOptions, FRAME_PATHS, type FrameHandle, type FrameOptions, type FrameOrchestratorOptions, type FrameTransport, type KeyPair, type ListAssetsParams, type ListTransactionsParams, TRUSTED_FRAME_ORIGIN_PATTERNS, type ThemeOptions, type UrlBuilderOptions, apiFetch, applyThemeParam, buildFrameUrl, createClientContext, createClientCore, createFrameOrchestrator, createIdentity, decryptCredentials, deletePaymentMethod, generateKeyPair, getAssets, getCustomer, getCustomerUploadUrl, getIdentity, getIdentityUploadUrl, getPaymentMethods, getQuote, getTransaction, isTrustedFrameOrigin, isTrustedFrameUrl, listTransactions, submitCustomerFiles, submitCustomerKyc, submitIdentityFiles, themeParams, updateIdentity, verifyIdentity };
335
+ export { type ClientContext, type ClientContextOptions, type CoreClient, type CoreClientOptions, FRAME_PATHS, type FrameHandle, type FrameOptions, type FrameOrchestratorOptions, type FrameTransport, type KeyPair, type ListAssetsParams, type ListTransactionsParams, type PresentationMode, TRUSTED_FRAME_ORIGIN_PATTERNS, type ThemeOptions, type UrlBuilderOptions, apiFetch, applyPresentationParam, applyThemeParam, buildFrameUrl, createClientContext, createClientCore, createFrameOrchestrator, createIdentity, decryptCredentials, deletePaymentMethod, generateKeyPair, getAssets, getCustomer, getCustomerUploadUrl, getIdentity, getIdentityUploadUrl, getPaymentMethods, getQuote, getTransaction, isTrustedFrameOrigin, isTrustedFrameUrl, listTransactions, presentationParams, submitCustomerFiles, submitCustomerKyc, submitIdentityFiles, themeParams, updateIdentity, verifyIdentity };
package/dist/index.js CHANGED
@@ -1664,10 +1664,22 @@ function applyThemeParam(url, theme) {
1664
1664
  }
1665
1665
  return parsed.href;
1666
1666
  }
1667
+ function presentationParams(presentation) {
1668
+ return presentation ? { presentation } : {};
1669
+ }
1670
+ function applyPresentationParam(url, presentation) {
1671
+ if (!presentation) return url;
1672
+ const parsed = new URL(url);
1673
+ if (!parsed.searchParams.has("presentation")) {
1674
+ parsed.searchParams.set("presentation", presentation);
1675
+ }
1676
+ return parsed.href;
1677
+ }
1667
1678
  export {
1668
1679
  FRAME_PATHS,
1669
1680
  TRUSTED_FRAME_ORIGIN_PATTERNS,
1670
1681
  apiFetch,
1682
+ applyPresentationParam,
1671
1683
  applyThemeParam,
1672
1684
  buildFrameUrl,
1673
1685
  createClientContext,
@@ -1688,6 +1700,7 @@ export {
1688
1700
  isTrustedFrameOrigin,
1689
1701
  isTrustedFrameUrl,
1690
1702
  listTransactions,
1703
+ presentationParams,
1691
1704
  submitCustomerFiles,
1692
1705
  submitCustomerKyc,
1693
1706
  submitIdentityFiles,