@moonpay/platform-sdk-core 1.0.2 → 1.2.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.cjs CHANGED
@@ -22,6 +22,7 @@ var src_exports = {};
22
22
  __export(src_exports, {
23
23
  FRAME_PATHS: () => FRAME_PATHS,
24
24
  apiFetch: () => apiFetch,
25
+ applyThemeParam: () => applyThemeParam,
25
26
  buildFrameUrl: () => buildFrameUrl,
26
27
  createClientContext: () => createClientContext,
27
28
  createClientCore: () => createClientCore,
@@ -37,6 +38,7 @@ __export(src_exports, {
37
38
  getTransaction: () => getTransaction,
38
39
  listTransactions: () => listTransactions,
39
40
  submitIdentityFiles: () => submitIdentityFiles,
41
+ themeParams: () => themeParams,
40
42
  updateIdentity: () => updateIdentity,
41
43
  verifyIdentity: () => verifyIdentity
42
44
  });
@@ -1626,6 +1628,18 @@ function buildFrameUrl(path, query = {}, options = {}) {
1626
1628
  }
1627
1629
  return url.href;
1628
1630
  }
1631
+ function themeParams(theme) {
1632
+ return theme?.appearance ? { theme: theme.appearance } : {};
1633
+ }
1634
+ function applyThemeParam(url, theme) {
1635
+ if (!theme?.appearance)
1636
+ return url;
1637
+ const parsed = new URL(url);
1638
+ if (!parsed.searchParams.has("theme")) {
1639
+ parsed.searchParams.set("theme", theme.appearance);
1640
+ }
1641
+ return parsed.href;
1642
+ }
1629
1643
  /*! Bundled license information:
1630
1644
 
1631
1645
  @noble/ciphers/esm/utils.js: