@frak-labs/core-sdk 0.2.1-beta.b38eef2e → 0.2.1-beta.d04602ec

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.
Files changed (74) hide show
  1. package/README.md +1 -2
  2. package/cdn/bundle.js +55 -3
  3. package/dist/actions.cjs +1 -1
  4. package/dist/actions.d.cts +3 -3
  5. package/dist/actions.d.ts +3 -3
  6. package/dist/actions.js +1 -1
  7. package/dist/bundle.cjs +1 -1
  8. package/dist/bundle.d.cts +4 -4
  9. package/dist/bundle.d.ts +4 -4
  10. package/dist/bundle.js +1 -1
  11. package/dist/{computeLegacyProductId-CCAZvLa5.d.cts → computeLegacyProductId-fKvxbC4k.d.ts} +91 -37
  12. package/dist/{computeLegacyProductId-b5cUWdAm.d.ts → computeLegacyProductId-rYIvY4c3.d.cts} +91 -37
  13. package/dist/index.cjs +1 -1
  14. package/dist/index.d.cts +3 -3
  15. package/dist/index.d.ts +3 -3
  16. package/dist/index.js +1 -1
  17. package/dist/{openSso-B0g7-807.d.cts → openSso-CMZM06uR.d.ts} +258 -46
  18. package/dist/{openSso-CMzwvaCa.d.ts → openSso-CebB8mFv.d.cts} +258 -46
  19. package/dist/setupClient-B_XMB52l.cjs +13 -0
  20. package/dist/setupClient-jYx-fbxB.js +13 -0
  21. package/dist/siweAuthenticate-CWcVvP-G.cjs +1 -0
  22. package/dist/siweAuthenticate-DQfdb5UQ.js +1 -0
  23. package/dist/{siweAuthenticate-CnCZ7mok.d.ts → siweAuthenticate-Dc_Yg9Bg.d.cts} +102 -8
  24. package/dist/{siweAuthenticate-CVigMOxz.d.cts → siweAuthenticate-Ddhl-o4N.d.ts} +102 -8
  25. package/dist/trackEvent-Ce1XlsIE.js +1 -0
  26. package/dist/trackEvent-CvbJTTqA.cjs +1 -0
  27. package/package.json +8 -8
  28. package/src/actions/displayEmbeddedWallet.ts +6 -2
  29. package/src/actions/displayModal.ts +6 -2
  30. package/src/actions/displaySharingPage.ts +49 -0
  31. package/src/actions/ensureIdentity.ts +2 -2
  32. package/src/actions/getMerchantInformation.test.ts +13 -1
  33. package/src/actions/getMerchantInformation.ts +20 -5
  34. package/src/actions/getUserReferralStatus.ts +42 -0
  35. package/src/actions/index.ts +7 -1
  36. package/src/actions/referral/setupReferral.test.ts +79 -0
  37. package/src/actions/referral/setupReferral.ts +32 -0
  38. package/src/actions/trackPurchaseStatus.test.ts +32 -20
  39. package/src/actions/trackPurchaseStatus.ts +3 -5
  40. package/src/actions/wrapper/modalBuilder.test.ts +4 -2
  41. package/src/actions/wrapper/modalBuilder.ts +6 -8
  42. package/src/clients/createIFrameFrakClient.ts +148 -25
  43. package/src/clients/transports/iframeLifecycleManager.test.ts +0 -80
  44. package/src/clients/transports/iframeLifecycleManager.ts +0 -44
  45. package/src/index.ts +17 -4
  46. package/src/types/config.ts +10 -3
  47. package/src/types/index.ts +13 -1
  48. package/src/types/lifecycle/client.ts +22 -27
  49. package/src/types/lifecycle/iframe.ts +0 -8
  50. package/src/types/resolvedConfig.ts +122 -0
  51. package/src/types/rpc/displaySharingPage.ts +77 -0
  52. package/src/types/rpc/interaction.ts +4 -0
  53. package/src/types/rpc/userReferralStatus.ts +20 -0
  54. package/src/types/rpc.ts +42 -5
  55. package/src/utils/backendUrl.test.ts +2 -2
  56. package/src/utils/backendUrl.ts +1 -1
  57. package/src/utils/cache/index.ts +7 -0
  58. package/src/utils/cache/lruMap.test.ts +55 -0
  59. package/src/utils/cache/lruMap.ts +38 -0
  60. package/src/utils/cache/withCache.test.ts +162 -0
  61. package/src/utils/cache/withCache.ts +105 -0
  62. package/src/utils/inAppBrowser.ts +60 -0
  63. package/src/utils/index.ts +6 -4
  64. package/src/utils/sdkConfigStore.test.ts +405 -0
  65. package/src/utils/sdkConfigStore.ts +263 -0
  66. package/src/utils/sso.ts +3 -7
  67. package/dist/setupClient-CqTHGvVa.cjs +0 -13
  68. package/dist/setupClient-DTyvAPgh.js +0 -13
  69. package/dist/siweAuthenticate-BWmI2_TN.cjs +0 -1
  70. package/dist/siweAuthenticate-zczqxm0a.js +0 -1
  71. package/dist/trackEvent-CeLFVzZn.js +0 -1
  72. package/dist/trackEvent-Ew5r5zfI.cjs +0 -1
  73. package/src/utils/merchantId.test.ts +0 -653
  74. package/src/utils/merchantId.ts +0 -143
package/dist/actions.cjs CHANGED
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./trackEvent-Ew5r5zfI.cjs`),t=require(`./siweAuthenticate-BWmI2_TN.cjs`);exports.displayEmbeddedWallet=t.p,exports.displayModal=t.f,exports.ensureIdentity=t.d,exports.getMerchantInformation=t.u,exports.modalBuilder=t.r,exports.openSso=e.u,exports.prepareSso=t.l,exports.processReferral=t.s,exports.referralInteraction=t.o,exports.sendInteraction=t.c,exports.sendTransaction=t.n,exports.siweAuthenticate=t.t,exports.trackPurchaseStatus=t.a,exports.watchWalletStatus=t.i;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./trackEvent-CvbJTTqA.cjs`),t=require(`./siweAuthenticate-CWcVvP-G.cjs`);exports.REFERRAL_SUCCESS_EVENT=t.o,exports.displayEmbeddedWallet=t._,exports.displayModal=t.g,exports.displaySharingPage=t.h,exports.ensureIdentity=t.m,exports.getMerchantInformation=t.p,exports.getUserReferralStatus=t.f,exports.modalBuilder=t.r,exports.openSso=e.d,exports.prepareSso=t.d,exports.processReferral=t.l,exports.referralInteraction=t.c,exports.sendInteraction=t.u,exports.sendTransaction=t.n,exports.setupReferral=t.s,exports.siweAuthenticate=t.t,exports.trackPurchaseStatus=t.a,exports.watchWalletStatus=t.i;
@@ -1,3 +1,3 @@
1
- import { t as openSso } from "./openSso-B0g7-807.cjs";
2
- import { _ as displayModal, a as ModalBuilder, c as watchWalletStatus, d as referralInteraction, f as ProcessReferralOptions, g as ensureIdentity, h as getMerchantInformation, i as sendTransaction, l as trackPurchaseStatus, m as prepareSso, n as siweAuthenticate, o as ModalStepBuilder, p as processReferral, r as SendTransactionParams, s as modalBuilder, t as SiweAuthenticateModalParams, u as sendInteraction, v as displayEmbeddedWallet } from "./siweAuthenticate-CVigMOxz.cjs";
3
- export { type ModalBuilder, type ModalStepBuilder, type ProcessReferralOptions, type SendTransactionParams, type SiweAuthenticateModalParams, displayEmbeddedWallet, displayModal, ensureIdentity, getMerchantInformation, modalBuilder, openSso, prepareSso, processReferral, referralInteraction, sendInteraction, sendTransaction, siweAuthenticate, trackPurchaseStatus, watchWalletStatus };
1
+ import { t as openSso } from "./openSso-CebB8mFv.cjs";
2
+ import { S as displayEmbeddedWallet, _ as getUserReferralStatus, a as ModalBuilder, b as displaySharingPage, c as watchWalletStatus, d as REFERRAL_SUCCESS_EVENT, f as setupReferral, g as prepareSso, h as processReferral, i as sendTransaction, l as trackPurchaseStatus, m as ProcessReferralOptions, n as siweAuthenticate, o as ModalStepBuilder, p as referralInteraction, r as SendTransactionParams, s as modalBuilder, t as SiweAuthenticateModalParams, u as sendInteraction, v as getMerchantInformation, x as displayModal, y as ensureIdentity } from "./siweAuthenticate-Dc_Yg9Bg.cjs";
3
+ export { type ModalBuilder, type ModalStepBuilder, type ProcessReferralOptions, REFERRAL_SUCCESS_EVENT, type SendTransactionParams, type SiweAuthenticateModalParams, displayEmbeddedWallet, displayModal, displaySharingPage, ensureIdentity, getMerchantInformation, getUserReferralStatus, modalBuilder, openSso, prepareSso, processReferral, referralInteraction, sendInteraction, sendTransaction, setupReferral, siweAuthenticate, trackPurchaseStatus, watchWalletStatus };
package/dist/actions.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- import { t as openSso } from "./openSso-CMzwvaCa.js";
2
- import { _ as displayModal, a as ModalBuilder, c as watchWalletStatus, d as referralInteraction, f as ProcessReferralOptions, g as ensureIdentity, h as getMerchantInformation, i as sendTransaction, l as trackPurchaseStatus, m as prepareSso, n as siweAuthenticate, o as ModalStepBuilder, p as processReferral, r as SendTransactionParams, s as modalBuilder, t as SiweAuthenticateModalParams, u as sendInteraction, v as displayEmbeddedWallet } from "./siweAuthenticate-CnCZ7mok.js";
3
- export { type ModalBuilder, type ModalStepBuilder, type ProcessReferralOptions, type SendTransactionParams, type SiweAuthenticateModalParams, displayEmbeddedWallet, displayModal, ensureIdentity, getMerchantInformation, modalBuilder, openSso, prepareSso, processReferral, referralInteraction, sendInteraction, sendTransaction, siweAuthenticate, trackPurchaseStatus, watchWalletStatus };
1
+ import { t as openSso } from "./openSso-CMZM06uR.js";
2
+ import { S as displayEmbeddedWallet, _ as getUserReferralStatus, a as ModalBuilder, b as displaySharingPage, c as watchWalletStatus, d as REFERRAL_SUCCESS_EVENT, f as setupReferral, g as prepareSso, h as processReferral, i as sendTransaction, l as trackPurchaseStatus, m as ProcessReferralOptions, n as siweAuthenticate, o as ModalStepBuilder, p as referralInteraction, r as SendTransactionParams, s as modalBuilder, t as SiweAuthenticateModalParams, u as sendInteraction, v as getMerchantInformation, x as displayModal, y as ensureIdentity } from "./siweAuthenticate-Ddhl-o4N.js";
3
+ export { type ModalBuilder, type ModalStepBuilder, type ProcessReferralOptions, REFERRAL_SUCCESS_EVENT, type SendTransactionParams, type SiweAuthenticateModalParams, displayEmbeddedWallet, displayModal, displaySharingPage, ensureIdentity, getMerchantInformation, getUserReferralStatus, modalBuilder, openSso, prepareSso, processReferral, referralInteraction, sendInteraction, sendTransaction, setupReferral, siweAuthenticate, trackPurchaseStatus, watchWalletStatus };
package/dist/actions.js CHANGED
@@ -1 +1 @@
1
- import{u as e}from"./trackEvent-CeLFVzZn.js";import{a as t,c as n,d as r,f as i,i as a,l as o,n as s,o as c,p as l,r as u,s as d,t as f,u as p}from"./siweAuthenticate-zczqxm0a.js";export{l as displayEmbeddedWallet,i as displayModal,r as ensureIdentity,p as getMerchantInformation,u as modalBuilder,e as openSso,o as prepareSso,d as processReferral,c as referralInteraction,n as sendInteraction,s as sendTransaction,f as siweAuthenticate,t as trackPurchaseStatus,a as watchWalletStatus};
1
+ import{d as e}from"./trackEvent-Ce1XlsIE.js";import{_ as t,a as n,c as r,d as i,f as a,g as o,h as s,i as c,l,m as u,n as d,o as f,p,r as m,s as h,t as g,u as _}from"./siweAuthenticate-DQfdb5UQ.js";export{f as REFERRAL_SUCCESS_EVENT,t as displayEmbeddedWallet,o as displayModal,s as displaySharingPage,u as ensureIdentity,p as getMerchantInformation,a as getUserReferralStatus,m as modalBuilder,e as openSso,i as prepareSso,l as processReferral,r as referralInteraction,_ as sendInteraction,d as sendTransaction,h as setupReferral,g as siweAuthenticate,n as trackPurchaseStatus,c as watchWalletStatus};
package/dist/bundle.cjs CHANGED
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./trackEvent-Ew5r5zfI.cjs`),t=require(`./setupClient-CqTHGvVa.cjs`),n=require(`./siweAuthenticate-BWmI2_TN.cjs`);exports.DEEP_LINK_SCHEME=t.g,exports.DebugInfoGatherer=t.r,exports.FrakContextManager=e.a,exports.base64urlDecode=e.h,exports.base64urlEncode=e.g,exports.baseIframeProps=t.i,exports.clearMerchantIdCache=e.n,exports.compressJsonToB64=e.m,exports.computeLegacyProductId=e._,exports.createIFrameFrakClient=t.n,exports.createIframe=t.a,exports.decompressJsonFromB64=e.c,exports.displayEmbeddedWallet=n.p,exports.displayModal=n.f,exports.ensureIdentity=n.d,exports.fetchMerchantId=e.r,exports.findIframeInOpener=t.o,exports.formatAmount=t.c,exports.generateSsoUrl=e.p,exports.getBackendUrl=e.l,exports.getClientId=e.v,exports.getCurrencyAmountKey=t.s,exports.getMerchantInformation=n.u,exports.getSupportedCurrency=t.u,exports.getSupportedLocale=t.l,exports.isChromiumAndroid=t.f,exports.isFrakDeepLink=t.p,exports.isV1Context=e.o,exports.isV2Context=e.s,exports.locales=t.d,exports.modalBuilder=n.r,exports.openSso=e.u,exports.prepareSso=n.l,exports.processReferral=n.s,exports.referralInteraction=n.o,exports.resolveMerchantId=e.i,exports.sendInteraction=n.c,exports.sendTransaction=n.n,exports.setupClient=t.t,exports.siweAuthenticate=n.t,exports.ssoPopupFeatures=e.d,exports.ssoPopupName=e.f,exports.toAndroidIntentUrl=t.m,exports.trackEvent=e.t,exports.trackPurchaseStatus=n.a,exports.triggerDeepLinkWithFallback=t.h,exports.watchWalletStatus=n.i;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./trackEvent-CvbJTTqA.cjs`),t=require(`./setupClient-B_XMB52l.cjs`),n=require(`./siweAuthenticate-CWcVvP-G.cjs`);exports.DEEP_LINK_SCHEME=t.y,exports.DebugInfoGatherer=t.r,exports.FrakContextManager=e.r,exports.REFERRAL_SUCCESS_EVENT=n.o,exports.base64urlDecode=e.g,exports.base64urlEncode=e._,exports.baseIframeProps=t.s,exports.clearAllCache=e.s,exports.compressJsonToB64=e.h,exports.computeLegacyProductId=e.v,exports.createIFrameFrakClient=t.n,exports.createIframe=t.c,exports.decompressJsonFromB64=e.o,exports.displayEmbeddedWallet=n._,exports.displayModal=n.g,exports.displaySharingPage=n.h,exports.ensureIdentity=n.m,exports.findIframeInOpener=t.l,exports.formatAmount=t.d,exports.generateSsoUrl=e.m,exports.getBackendUrl=e.u,exports.getCache=e.c,exports.getClientId=e.y,exports.getCurrencyAmountKey=t.u,exports.getMerchantInformation=n.p,exports.getSupportedCurrency=t.p,exports.getSupportedLocale=t.f,exports.getUserReferralStatus=n.f,exports.isChromiumAndroid=t.h,exports.isFrakDeepLink=t.g,exports.isIOS=t.i,exports.isInAppBrowser=t.a,exports.isV1Context=e.i,exports.isV2Context=e.a,exports.locales=t.m,exports.modalBuilder=n.r,exports.openSso=e.d,exports.prepareSso=n.d,exports.processReferral=n.l,exports.redirectToExternalBrowser=t.o,exports.referralInteraction=n.c,exports.sdkConfigStore=e.n,exports.sendInteraction=n.u,exports.sendTransaction=n.n,exports.setupClient=t.t,exports.setupReferral=n.s,exports.siweAuthenticate=n.t,exports.ssoPopupFeatures=e.f,exports.ssoPopupName=e.p,exports.toAndroidIntentUrl=t._,exports.trackEvent=e.t,exports.trackPurchaseStatus=n.a,exports.triggerDeepLinkWithFallback=t.v,exports.watchWalletStatus=n.i,exports.withCache=e.l;
package/dist/bundle.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { A as SendTransactionModalStepType, B as PrepareSsoReturnType, C as EmbeddedViewActionSharing, D as ModalRpcStepsInput, E as ModalRpcMetadata, F as SiweAuthenticationParams, G as InteractionTypeKey, H as FinalActionType, I as LoginModalStepType, J as Currency, K as IFrameLifecycleEvent, L as OpenSsoParamsType, M as SendTransactionTxType, N as SiweAuthenticateModalStepType, O as ModalRpcStepsResultType, P as SiweAuthenticateReturnType, Q as LocalizedI18nConfig, R as OpenSsoReturnType, S as EmbeddedViewActionReferred, T as DisplayModalParamsType, U as FinalModalStepType, V as SsoMetadata, W as ModalStepMetadata, X as I18nConfig, Y as FrakWalletSdkConfig, Z as Language, _ as TokenAmountType, a as FrakContextV1, b as DisplayEmbeddedWalletResultType, c as isV2Context, d as IFrameTransport, f as IFrameRpcSchema, g as RewardTier, h as GetMerchantInformationReturnType, i as FrakContext, j as SendTransactionReturnType, k as ModalStepTypes, l as FrakClient, m as EstimatedReward, n as ssoPopupFeatures, o as FrakContextV2, p as WalletStatusReturnType, q as ClientLifecycleEvent, r as ssoPopupName, s as isV1Context, t as openSso, u as FrakLifecycleEvent, v as SendInteractionParamsType, w as LoggedInEmbeddedView, x as LoggedOutEmbeddedView, y as DisplayEmbeddedWalletParamsType, z as PrepareSsoParamsType } from "./openSso-B0g7-807.cjs";
2
- import { A as getBackendUrl, B as HashProtectedData, C as triggerDeepLinkWithFallback, D as base64urlDecode, E as compressJsonToB64, F as createIFrameFrakClient, I as TrackArrivalParams, L as TrackArrivalResult, M as locales, N as setupClient, O as base64urlEncode, P as DebugInfoGatherer, R as UtmParams, S as toAndroidIntentUrl, T as decompressJsonFromB64, V as KeyProvider, _ as formatAmount, a as CompressedSsoData, b as isChromiumAndroid, c as clearMerchantIdCache, d as baseIframeProps, f as createIframe, g as getCurrencyAmountKey, h as getSupportedCurrency, i as AppSpecificSsoMetadata, j as LocalesKey, k as getClientId, l as fetchMerchantId, m as getSupportedLocale, n as FrakEvent, o as FullSsoParams, p as findIframeInOpener, r as trackEvent, s as generateSsoUrl, t as computeLegacyProductId, u as resolveMerchantId, v as FrakContextManager, w as DEEP_LINK_SCHEME, x as isFrakDeepLink, y as DeepLinkFallbackOptions, z as CompressedData } from "./computeLegacyProductId-CCAZvLa5.cjs";
3
- import { _ as displayModal, a as ModalBuilder, c as watchWalletStatus, d as referralInteraction, f as ProcessReferralOptions, g as ensureIdentity, h as getMerchantInformation, i as sendTransaction, l as trackPurchaseStatus, m as prepareSso, n as siweAuthenticate, o as ModalStepBuilder, p as processReferral, r as SendTransactionParams, s as modalBuilder, t as SiweAuthenticateModalParams, u as sendInteraction, v as displayEmbeddedWallet } from "./siweAuthenticate-CVigMOxz.cjs";
4
- export { AppSpecificSsoMetadata, ClientLifecycleEvent, CompressedData, CompressedSsoData, Currency, DEEP_LINK_SCHEME, DebugInfoGatherer, DeepLinkFallbackOptions, DisplayEmbeddedWalletParamsType, DisplayEmbeddedWalletResultType, DisplayModalParamsType, EmbeddedViewActionReferred, EmbeddedViewActionSharing, EstimatedReward, FinalActionType, FinalModalStepType, FrakClient, FrakContext, FrakContextManager, FrakContextV1, FrakContextV2, FrakEvent, FrakLifecycleEvent, FrakWalletSdkConfig, FullSsoParams, GetMerchantInformationReturnType, HashProtectedData, I18nConfig, IFrameLifecycleEvent, IFrameRpcSchema, IFrameTransport, InteractionTypeKey, KeyProvider, Language, LocalesKey, LocalizedI18nConfig, LoggedInEmbeddedView, LoggedOutEmbeddedView, LoginModalStepType, ModalBuilder, ModalRpcMetadata, ModalRpcStepsInput, ModalRpcStepsResultType, ModalStepBuilder, ModalStepMetadata, ModalStepTypes, OpenSsoParamsType, OpenSsoReturnType, PrepareSsoParamsType, PrepareSsoReturnType, ProcessReferralOptions, RewardTier, SendInteractionParamsType, SendTransactionModalStepType, SendTransactionParams, SendTransactionReturnType, SendTransactionTxType, SiweAuthenticateModalParams, SiweAuthenticateModalStepType, SiweAuthenticateReturnType, SiweAuthenticationParams, SsoMetadata, TokenAmountType, TrackArrivalParams, TrackArrivalResult, UtmParams, WalletStatusReturnType, base64urlDecode, base64urlEncode, baseIframeProps, clearMerchantIdCache, compressJsonToB64, computeLegacyProductId, createIFrameFrakClient, createIframe, decompressJsonFromB64, displayEmbeddedWallet, displayModal, ensureIdentity, fetchMerchantId, findIframeInOpener, formatAmount, generateSsoUrl, getBackendUrl, getClientId, getCurrencyAmountKey, getMerchantInformation, getSupportedCurrency, getSupportedLocale, isChromiumAndroid, isFrakDeepLink, isV1Context, isV2Context, locales, modalBuilder, openSso, prepareSso, processReferral, referralInteraction, resolveMerchantId, sendInteraction, sendTransaction, setupClient, siweAuthenticate, ssoPopupFeatures, ssoPopupName, toAndroidIntentUrl, trackEvent, trackPurchaseStatus, triggerDeepLinkWithFallback, watchWalletStatus };
1
+ import { $ as ResolvedPlacement, A as ModalRpcMetadata, B as LoginModalStepType, C as EmbeddedViewActionReferred, D as DisplaySharingPageResultType, E as DisplaySharingPageParamsType, F as SendTransactionReturnType, G as SsoMetadata, H as OpenSsoReturnType, I as SendTransactionTxType, J as ModalStepMetadata, K as FinalActionType, L as SiweAuthenticateModalStepType, M as ModalRpcStepsResultType, N as ModalStepTypes, O as SharingPageProduct, P as SendTransactionModalStepType, Q as MerchantConfigResponse, R as SiweAuthenticateReturnType, S as LoggedOutEmbeddedView, T as LoggedInEmbeddedView, U as PrepareSsoParamsType, V as OpenSsoParamsType, W as PrepareSsoReturnType, X as IFrameLifecycleEvent, Y as InteractionTypeKey, Z as ClientLifecycleEvent, _ as RewardTier, a as FrakContextV1, at as Language, b as DisplayEmbeddedWalletParamsType, c as isV2Context, d as IFrameTransport, et as ResolvedSdkConfig, f as IFrameRpcSchema, g as GetMerchantInformationReturnType, h as EstimatedReward, i as FrakContext, it as I18nConfig, j as ModalRpcStepsInput, k as DisplayModalParamsType, l as FrakClient, m as UserReferralStatusType, n as ssoPopupFeatures, nt as Currency, o as FrakContextV2, ot as LocalizedI18nConfig, p as WalletStatusReturnType, q as FinalModalStepType, r as ssoPopupName, rt as FrakWalletSdkConfig, s as isV1Context, t as openSso, tt as SdkResolvedConfig, u as FrakLifecycleEvent, v as TokenAmountType, w as EmbeddedViewActionSharing, x as DisplayEmbeddedWalletResultType, y as SendInteractionParamsType, z as SiweAuthenticationParams } from "./openSso-CebB8mFv.cjs";
2
+ import { A as getClientId, B as TrackArrivalParams, C as toAndroidIntentUrl, D as compressJsonToB64, E as decompressJsonFromB64, F as LocalesKey, G as KeyProvider, H as UtmParams, I as locales, L as setupClient, M as getCache, N as withCache, O as base64urlDecode, P as getBackendUrl, R as DebugInfoGatherer, S as isFrakDeepLink, T as DEEP_LINK_SCHEME, U as CompressedData, V as TrackArrivalResult, W as HashProtectedData, _ as getCurrencyAmountKey, a as CompressedSsoData, b as DeepLinkFallbackOptions, c as sdkConfigStore, d as redirectToExternalBrowser, f as baseIframeProps, g as getSupportedCurrency, h as getSupportedLocale, i as AppSpecificSsoMetadata, j as clearAllCache, k as base64urlEncode, l as isIOS, m as findIframeInOpener, n as FrakEvent, o as FullSsoParams, p as createIframe, r as trackEvent, s as generateSsoUrl, t as computeLegacyProductId, u as isInAppBrowser, v as formatAmount, w as triggerDeepLinkWithFallback, x as isChromiumAndroid, y as FrakContextManager, z as createIFrameFrakClient } from "./computeLegacyProductId-rYIvY4c3.cjs";
3
+ import { S as displayEmbeddedWallet, _ as getUserReferralStatus, a as ModalBuilder, b as displaySharingPage, c as watchWalletStatus, d as REFERRAL_SUCCESS_EVENT, f as setupReferral, g as prepareSso, h as processReferral, i as sendTransaction, l as trackPurchaseStatus, m as ProcessReferralOptions, n as siweAuthenticate, o as ModalStepBuilder, p as referralInteraction, r as SendTransactionParams, s as modalBuilder, t as SiweAuthenticateModalParams, u as sendInteraction, v as getMerchantInformation, x as displayModal, y as ensureIdentity } from "./siweAuthenticate-Dc_Yg9Bg.cjs";
4
+ export { AppSpecificSsoMetadata, ClientLifecycleEvent, CompressedData, CompressedSsoData, Currency, DEEP_LINK_SCHEME, DebugInfoGatherer, DeepLinkFallbackOptions, DisplayEmbeddedWalletParamsType, DisplayEmbeddedWalletResultType, DisplayModalParamsType, DisplaySharingPageParamsType, DisplaySharingPageResultType, EmbeddedViewActionReferred, EmbeddedViewActionSharing, EstimatedReward, FinalActionType, FinalModalStepType, FrakClient, FrakContext, FrakContextManager, FrakContextV1, FrakContextV2, FrakEvent, FrakLifecycleEvent, FrakWalletSdkConfig, FullSsoParams, GetMerchantInformationReturnType, HashProtectedData, I18nConfig, IFrameLifecycleEvent, IFrameRpcSchema, IFrameTransport, InteractionTypeKey, KeyProvider, Language, LocalesKey, LocalizedI18nConfig, LoggedInEmbeddedView, LoggedOutEmbeddedView, LoginModalStepType, MerchantConfigResponse, ModalBuilder, ModalRpcMetadata, ModalRpcStepsInput, ModalRpcStepsResultType, ModalStepBuilder, ModalStepMetadata, ModalStepTypes, OpenSsoParamsType, OpenSsoReturnType, PrepareSsoParamsType, PrepareSsoReturnType, ProcessReferralOptions, REFERRAL_SUCCESS_EVENT, ResolvedPlacement, ResolvedSdkConfig, RewardTier, SdkResolvedConfig, SendInteractionParamsType, SendTransactionModalStepType, SendTransactionParams, SendTransactionReturnType, SendTransactionTxType, SharingPageProduct, SiweAuthenticateModalParams, SiweAuthenticateModalStepType, SiweAuthenticateReturnType, SiweAuthenticationParams, SsoMetadata, TokenAmountType, TrackArrivalParams, TrackArrivalResult, UserReferralStatusType, UtmParams, WalletStatusReturnType, base64urlDecode, base64urlEncode, baseIframeProps, clearAllCache, compressJsonToB64, computeLegacyProductId, createIFrameFrakClient, createIframe, decompressJsonFromB64, displayEmbeddedWallet, displayModal, displaySharingPage, ensureIdentity, findIframeInOpener, formatAmount, generateSsoUrl, getBackendUrl, getCache, getClientId, getCurrencyAmountKey, getMerchantInformation, getSupportedCurrency, getSupportedLocale, getUserReferralStatus, isChromiumAndroid, isFrakDeepLink, isIOS, isInAppBrowser, isV1Context, isV2Context, locales, modalBuilder, openSso, prepareSso, processReferral, redirectToExternalBrowser, referralInteraction, sdkConfigStore, sendInteraction, sendTransaction, setupClient, setupReferral, siweAuthenticate, ssoPopupFeatures, ssoPopupName, toAndroidIntentUrl, trackEvent, trackPurchaseStatus, triggerDeepLinkWithFallback, watchWalletStatus, withCache };
package/dist/bundle.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { A as SendTransactionModalStepType, B as PrepareSsoReturnType, C as EmbeddedViewActionSharing, D as ModalRpcStepsInput, E as ModalRpcMetadata, F as SiweAuthenticationParams, G as InteractionTypeKey, H as FinalActionType, I as LoginModalStepType, J as Currency, K as IFrameLifecycleEvent, L as OpenSsoParamsType, M as SendTransactionTxType, N as SiweAuthenticateModalStepType, O as ModalRpcStepsResultType, P as SiweAuthenticateReturnType, Q as LocalizedI18nConfig, R as OpenSsoReturnType, S as EmbeddedViewActionReferred, T as DisplayModalParamsType, U as FinalModalStepType, V as SsoMetadata, W as ModalStepMetadata, X as I18nConfig, Y as FrakWalletSdkConfig, Z as Language, _ as TokenAmountType, a as FrakContextV1, b as DisplayEmbeddedWalletResultType, c as isV2Context, d as IFrameTransport, f as IFrameRpcSchema, g as RewardTier, h as GetMerchantInformationReturnType, i as FrakContext, j as SendTransactionReturnType, k as ModalStepTypes, l as FrakClient, m as EstimatedReward, n as ssoPopupFeatures, o as FrakContextV2, p as WalletStatusReturnType, q as ClientLifecycleEvent, r as ssoPopupName, s as isV1Context, t as openSso, u as FrakLifecycleEvent, v as SendInteractionParamsType, w as LoggedInEmbeddedView, x as LoggedOutEmbeddedView, y as DisplayEmbeddedWalletParamsType, z as PrepareSsoParamsType } from "./openSso-CMzwvaCa.js";
2
- import { A as getBackendUrl, B as HashProtectedData, C as triggerDeepLinkWithFallback, D as base64urlDecode, E as compressJsonToB64, F as createIFrameFrakClient, I as TrackArrivalParams, L as TrackArrivalResult, M as locales, N as setupClient, O as base64urlEncode, P as DebugInfoGatherer, R as UtmParams, S as toAndroidIntentUrl, T as decompressJsonFromB64, V as KeyProvider, _ as formatAmount, a as CompressedSsoData, b as isChromiumAndroid, c as clearMerchantIdCache, d as baseIframeProps, f as createIframe, g as getCurrencyAmountKey, h as getSupportedCurrency, i as AppSpecificSsoMetadata, j as LocalesKey, k as getClientId, l as fetchMerchantId, m as getSupportedLocale, n as FrakEvent, o as FullSsoParams, p as findIframeInOpener, r as trackEvent, s as generateSsoUrl, t as computeLegacyProductId, u as resolveMerchantId, v as FrakContextManager, w as DEEP_LINK_SCHEME, x as isFrakDeepLink, y as DeepLinkFallbackOptions, z as CompressedData } from "./computeLegacyProductId-b5cUWdAm.js";
3
- import { _ as displayModal, a as ModalBuilder, c as watchWalletStatus, d as referralInteraction, f as ProcessReferralOptions, g as ensureIdentity, h as getMerchantInformation, i as sendTransaction, l as trackPurchaseStatus, m as prepareSso, n as siweAuthenticate, o as ModalStepBuilder, p as processReferral, r as SendTransactionParams, s as modalBuilder, t as SiweAuthenticateModalParams, u as sendInteraction, v as displayEmbeddedWallet } from "./siweAuthenticate-CnCZ7mok.js";
4
- export { AppSpecificSsoMetadata, ClientLifecycleEvent, CompressedData, CompressedSsoData, Currency, DEEP_LINK_SCHEME, DebugInfoGatherer, DeepLinkFallbackOptions, DisplayEmbeddedWalletParamsType, DisplayEmbeddedWalletResultType, DisplayModalParamsType, EmbeddedViewActionReferred, EmbeddedViewActionSharing, EstimatedReward, FinalActionType, FinalModalStepType, FrakClient, FrakContext, FrakContextManager, FrakContextV1, FrakContextV2, FrakEvent, FrakLifecycleEvent, FrakWalletSdkConfig, FullSsoParams, GetMerchantInformationReturnType, HashProtectedData, I18nConfig, IFrameLifecycleEvent, IFrameRpcSchema, IFrameTransport, InteractionTypeKey, KeyProvider, Language, LocalesKey, LocalizedI18nConfig, LoggedInEmbeddedView, LoggedOutEmbeddedView, LoginModalStepType, ModalBuilder, ModalRpcMetadata, ModalRpcStepsInput, ModalRpcStepsResultType, ModalStepBuilder, ModalStepMetadata, ModalStepTypes, OpenSsoParamsType, OpenSsoReturnType, PrepareSsoParamsType, PrepareSsoReturnType, ProcessReferralOptions, RewardTier, SendInteractionParamsType, SendTransactionModalStepType, SendTransactionParams, SendTransactionReturnType, SendTransactionTxType, SiweAuthenticateModalParams, SiweAuthenticateModalStepType, SiweAuthenticateReturnType, SiweAuthenticationParams, SsoMetadata, TokenAmountType, TrackArrivalParams, TrackArrivalResult, UtmParams, WalletStatusReturnType, base64urlDecode, base64urlEncode, baseIframeProps, clearMerchantIdCache, compressJsonToB64, computeLegacyProductId, createIFrameFrakClient, createIframe, decompressJsonFromB64, displayEmbeddedWallet, displayModal, ensureIdentity, fetchMerchantId, findIframeInOpener, formatAmount, generateSsoUrl, getBackendUrl, getClientId, getCurrencyAmountKey, getMerchantInformation, getSupportedCurrency, getSupportedLocale, isChromiumAndroid, isFrakDeepLink, isV1Context, isV2Context, locales, modalBuilder, openSso, prepareSso, processReferral, referralInteraction, resolveMerchantId, sendInteraction, sendTransaction, setupClient, siweAuthenticate, ssoPopupFeatures, ssoPopupName, toAndroidIntentUrl, trackEvent, trackPurchaseStatus, triggerDeepLinkWithFallback, watchWalletStatus };
1
+ import { $ as ResolvedPlacement, A as ModalRpcMetadata, B as LoginModalStepType, C as EmbeddedViewActionReferred, D as DisplaySharingPageResultType, E as DisplaySharingPageParamsType, F as SendTransactionReturnType, G as SsoMetadata, H as OpenSsoReturnType, I as SendTransactionTxType, J as ModalStepMetadata, K as FinalActionType, L as SiweAuthenticateModalStepType, M as ModalRpcStepsResultType, N as ModalStepTypes, O as SharingPageProduct, P as SendTransactionModalStepType, Q as MerchantConfigResponse, R as SiweAuthenticateReturnType, S as LoggedOutEmbeddedView, T as LoggedInEmbeddedView, U as PrepareSsoParamsType, V as OpenSsoParamsType, W as PrepareSsoReturnType, X as IFrameLifecycleEvent, Y as InteractionTypeKey, Z as ClientLifecycleEvent, _ as RewardTier, a as FrakContextV1, at as Language, b as DisplayEmbeddedWalletParamsType, c as isV2Context, d as IFrameTransport, et as ResolvedSdkConfig, f as IFrameRpcSchema, g as GetMerchantInformationReturnType, h as EstimatedReward, i as FrakContext, it as I18nConfig, j as ModalRpcStepsInput, k as DisplayModalParamsType, l as FrakClient, m as UserReferralStatusType, n as ssoPopupFeatures, nt as Currency, o as FrakContextV2, ot as LocalizedI18nConfig, p as WalletStatusReturnType, q as FinalModalStepType, r as ssoPopupName, rt as FrakWalletSdkConfig, s as isV1Context, t as openSso, tt as SdkResolvedConfig, u as FrakLifecycleEvent, v as TokenAmountType, w as EmbeddedViewActionSharing, x as DisplayEmbeddedWalletResultType, y as SendInteractionParamsType, z as SiweAuthenticationParams } from "./openSso-CMZM06uR.js";
2
+ import { A as getClientId, B as TrackArrivalParams, C as toAndroidIntentUrl, D as compressJsonToB64, E as decompressJsonFromB64, F as LocalesKey, G as KeyProvider, H as UtmParams, I as locales, L as setupClient, M as getCache, N as withCache, O as base64urlDecode, P as getBackendUrl, R as DebugInfoGatherer, S as isFrakDeepLink, T as DEEP_LINK_SCHEME, U as CompressedData, V as TrackArrivalResult, W as HashProtectedData, _ as getCurrencyAmountKey, a as CompressedSsoData, b as DeepLinkFallbackOptions, c as sdkConfigStore, d as redirectToExternalBrowser, f as baseIframeProps, g as getSupportedCurrency, h as getSupportedLocale, i as AppSpecificSsoMetadata, j as clearAllCache, k as base64urlEncode, l as isIOS, m as findIframeInOpener, n as FrakEvent, o as FullSsoParams, p as createIframe, r as trackEvent, s as generateSsoUrl, t as computeLegacyProductId, u as isInAppBrowser, v as formatAmount, w as triggerDeepLinkWithFallback, x as isChromiumAndroid, y as FrakContextManager, z as createIFrameFrakClient } from "./computeLegacyProductId-fKvxbC4k.js";
3
+ import { S as displayEmbeddedWallet, _ as getUserReferralStatus, a as ModalBuilder, b as displaySharingPage, c as watchWalletStatus, d as REFERRAL_SUCCESS_EVENT, f as setupReferral, g as prepareSso, h as processReferral, i as sendTransaction, l as trackPurchaseStatus, m as ProcessReferralOptions, n as siweAuthenticate, o as ModalStepBuilder, p as referralInteraction, r as SendTransactionParams, s as modalBuilder, t as SiweAuthenticateModalParams, u as sendInteraction, v as getMerchantInformation, x as displayModal, y as ensureIdentity } from "./siweAuthenticate-Ddhl-o4N.js";
4
+ export { AppSpecificSsoMetadata, ClientLifecycleEvent, CompressedData, CompressedSsoData, Currency, DEEP_LINK_SCHEME, DebugInfoGatherer, DeepLinkFallbackOptions, DisplayEmbeddedWalletParamsType, DisplayEmbeddedWalletResultType, DisplayModalParamsType, DisplaySharingPageParamsType, DisplaySharingPageResultType, EmbeddedViewActionReferred, EmbeddedViewActionSharing, EstimatedReward, FinalActionType, FinalModalStepType, FrakClient, FrakContext, FrakContextManager, FrakContextV1, FrakContextV2, FrakEvent, FrakLifecycleEvent, FrakWalletSdkConfig, FullSsoParams, GetMerchantInformationReturnType, HashProtectedData, I18nConfig, IFrameLifecycleEvent, IFrameRpcSchema, IFrameTransport, InteractionTypeKey, KeyProvider, Language, LocalesKey, LocalizedI18nConfig, LoggedInEmbeddedView, LoggedOutEmbeddedView, LoginModalStepType, MerchantConfigResponse, ModalBuilder, ModalRpcMetadata, ModalRpcStepsInput, ModalRpcStepsResultType, ModalStepBuilder, ModalStepMetadata, ModalStepTypes, OpenSsoParamsType, OpenSsoReturnType, PrepareSsoParamsType, PrepareSsoReturnType, ProcessReferralOptions, REFERRAL_SUCCESS_EVENT, ResolvedPlacement, ResolvedSdkConfig, RewardTier, SdkResolvedConfig, SendInteractionParamsType, SendTransactionModalStepType, SendTransactionParams, SendTransactionReturnType, SendTransactionTxType, SharingPageProduct, SiweAuthenticateModalParams, SiweAuthenticateModalStepType, SiweAuthenticateReturnType, SiweAuthenticationParams, SsoMetadata, TokenAmountType, TrackArrivalParams, TrackArrivalResult, UserReferralStatusType, UtmParams, WalletStatusReturnType, base64urlDecode, base64urlEncode, baseIframeProps, clearAllCache, compressJsonToB64, computeLegacyProductId, createIFrameFrakClient, createIframe, decompressJsonFromB64, displayEmbeddedWallet, displayModal, displaySharingPage, ensureIdentity, findIframeInOpener, formatAmount, generateSsoUrl, getBackendUrl, getCache, getClientId, getCurrencyAmountKey, getMerchantInformation, getSupportedCurrency, getSupportedLocale, getUserReferralStatus, isChromiumAndroid, isFrakDeepLink, isIOS, isInAppBrowser, isV1Context, isV2Context, locales, modalBuilder, openSso, prepareSso, processReferral, redirectToExternalBrowser, referralInteraction, sdkConfigStore, sendInteraction, sendTransaction, setupClient, setupReferral, siweAuthenticate, ssoPopupFeatures, ssoPopupName, toAndroidIntentUrl, trackEvent, trackPurchaseStatus, triggerDeepLinkWithFallback, watchWalletStatus, withCache };
package/dist/bundle.js CHANGED
@@ -1 +1 @@
1
- import{_ as e,a as t,c as n,d as r,f as i,g as a,h as o,i as s,l as c,m as l,n as u,o as d,p as f,r as p,s as m,t as h,u as g,v as _}from"./trackEvent-CeLFVzZn.js";import{a as v,c as y,d as b,f as x,g as S,h as C,i as w,l as T,m as E,n as D,o as O,p as k,r as A,s as j,t as M,u as N}from"./setupClient-DTyvAPgh.js";import{a as P,c as F,d as I,f as L,i as R,l as z,n as B,o as V,p as H,r as U,s as W,t as G,u as K}from"./siweAuthenticate-zczqxm0a.js";export{S as DEEP_LINK_SCHEME,A as DebugInfoGatherer,t as FrakContextManager,o as base64urlDecode,a as base64urlEncode,w as baseIframeProps,u as clearMerchantIdCache,l as compressJsonToB64,e as computeLegacyProductId,D as createIFrameFrakClient,v as createIframe,n as decompressJsonFromB64,H as displayEmbeddedWallet,L as displayModal,I as ensureIdentity,p as fetchMerchantId,O as findIframeInOpener,y as formatAmount,f as generateSsoUrl,c as getBackendUrl,_ as getClientId,j as getCurrencyAmountKey,K as getMerchantInformation,N as getSupportedCurrency,T as getSupportedLocale,x as isChromiumAndroid,k as isFrakDeepLink,d as isV1Context,m as isV2Context,b as locales,U as modalBuilder,g as openSso,z as prepareSso,W as processReferral,V as referralInteraction,s as resolveMerchantId,F as sendInteraction,B as sendTransaction,M as setupClient,G as siweAuthenticate,r as ssoPopupFeatures,i as ssoPopupName,E as toAndroidIntentUrl,h as trackEvent,P as trackPurchaseStatus,C as triggerDeepLinkWithFallback,R as watchWalletStatus};
1
+ import{_ as e,a as t,c as n,d as r,f as i,g as a,h as o,i as s,l as c,m as l,n as u,o as d,p as f,r as p,s as m,t as h,u as g,v as _,y as v}from"./trackEvent-Ce1XlsIE.js";import{_ as y,a as b,c as x,d as S,f as C,g as w,h as T,i as E,l as D,m as O,n as k,o as A,p as j,r as M,s as N,t as P,u as F,v as I,y as L}from"./setupClient-jYx-fbxB.js";import{_ as R,a as z,c as B,d as V,f as H,g as U,h as W,i as G,l as K,m as q,n as J,o as Y,p as X,r as Z,s as Q,t as $,u as ee}from"./siweAuthenticate-DQfdb5UQ.js";export{L as DEEP_LINK_SCHEME,M as DebugInfoGatherer,p as FrakContextManager,Y as REFERRAL_SUCCESS_EVENT,a as base64urlDecode,e as base64urlEncode,N as baseIframeProps,m as clearAllCache,o as compressJsonToB64,_ as computeLegacyProductId,k as createIFrameFrakClient,x as createIframe,d as decompressJsonFromB64,R as displayEmbeddedWallet,U as displayModal,W as displaySharingPage,q as ensureIdentity,D as findIframeInOpener,S as formatAmount,l as generateSsoUrl,g as getBackendUrl,n as getCache,v as getClientId,F as getCurrencyAmountKey,X as getMerchantInformation,j as getSupportedCurrency,C as getSupportedLocale,H as getUserReferralStatus,T as isChromiumAndroid,w as isFrakDeepLink,E as isIOS,b as isInAppBrowser,s as isV1Context,t as isV2Context,O as locales,Z as modalBuilder,r as openSso,V as prepareSso,K as processReferral,A as redirectToExternalBrowser,B as referralInteraction,u as sdkConfigStore,ee as sendInteraction,J as sendTransaction,P as setupClient,Q as setupReferral,$ as siweAuthenticate,i as ssoPopupFeatures,f as ssoPopupName,y as toAndroidIntentUrl,h as trackEvent,z as trackPurchaseStatus,I as triggerDeepLinkWithFallback,G as watchWalletStatus,c as withCache};
@@ -1,6 +1,6 @@
1
- import { J as Currency, V as SsoMetadata, Y as FrakWalletSdkConfig, _ as TokenAmountType, a as FrakContextV1, i as FrakContext, l as FrakClient, o as FrakContextV2, z as PrepareSsoParamsType } from "./openSso-B0g7-807.cjs";
2
- import { RpcMessage, RpcResponse } from "@frak-labs/frame-connector";
1
+ import { G as SsoMetadata, Q as MerchantConfigResponse, U as PrepareSsoParamsType, a as FrakContextV1, at as Language, i as FrakContext, l as FrakClient, nt as Currency, o as FrakContextV2, rt as FrakWalletSdkConfig, tt as SdkResolvedConfig, v as TokenAmountType } from "./openSso-CMZM06uR.js";
3
2
  import { Address, Hex } from "viem";
3
+ import { RpcMessage, RpcResponse } from "@frak-labs/frame-connector";
4
4
 
5
5
  //#region src/types/compression.d.ts
6
6
  /**
@@ -50,7 +50,7 @@ type TrackArrivalResult = {
50
50
  * Create a new iframe Frak client
51
51
  * @param args
52
52
  * @param args.config - The configuration to use for the Frak Wallet SDK.
53
- * When `config.domain` is set, it is forwarded to the iframe handshake so the listener resolves the correct merchant in tunneled/proxied environments (e.g. Shopify dev with Cloudflare tunnel).
53
+ * When `config.domain` is set, it is used to resolve the correct merchant config in tunneled/proxied environments (e.g. Shopify dev with Cloudflare tunnel).
54
54
  * @param args.iframe - The iframe to use for the communication
55
55
  * @returns The created Frak Client
56
56
  *
@@ -143,6 +143,50 @@ declare const locales: {
143
143
  */
144
144
  declare function getBackendUrl(walletUrl?: string): string;
145
145
  //#endregion
146
+ //#region src/utils/cache/withCache.d.ts
147
+ type WithCacheOptions = {
148
+ /** The key to cache the data against */cacheKey: string; /** Time in ms that cached data will remain valid. Default: 30_000 (30s). Set to 0 to disable caching. */
149
+ cacheTime?: number;
150
+ };
151
+ /**
152
+ * Returns the result of a given promise, and caches the result for
153
+ * subsequent invocations against a provided cache key.
154
+ *
155
+ * Also deduplicates concurrent calls — if multiple callers request the same
156
+ * cache key while the promise is pending, they share the same promise.
157
+ *
158
+ * @example
159
+ * ```ts
160
+ * // First call fetches, subsequent calls return cached data for 30s
161
+ * const data = await withCache(
162
+ * () => client.request({ method: "frak_getMerchantInformation" }),
163
+ * { cacheKey: "merchantInfo", cacheTime: 30_000 }
164
+ * );
165
+ * ```
166
+ */
167
+ declare function withCache<TData>(fn: () => Promise<TData>, {
168
+ cacheKey,
169
+ cacheTime
170
+ }: WithCacheOptions): Promise<TData>;
171
+ /**
172
+ * Get a cache handle for a specific key, useful for manual invalidation.
173
+ *
174
+ * @example
175
+ * ```ts
176
+ * // Invalidate merchant info cache after a mutation
177
+ * getCache("frak_getMerchantInformation").clear();
178
+ * ```
179
+ */
180
+ declare function getCache(cacheKey: string): {
181
+ /** Clear both the pending promise and the cached response */clear: () => void; /** Check if a non-expired response exists */
182
+ has: (cacheTime?: number) => boolean;
183
+ };
184
+ /**
185
+ * Clear all cached data (both pending promises and resolved responses).
186
+ * Called automatically when the client is destroyed.
187
+ */
188
+ declare function clearAllCache(): void;
189
+ //#endregion
146
190
  //#region src/utils/clientId.d.ts
147
191
  /**
148
192
  * Client ID utilities for anonymous tracking
@@ -415,47 +459,57 @@ declare function createIframe({
415
459
  */
416
460
  declare function findIframeInOpener(pathname?: string): Window | null;
417
461
  //#endregion
418
- //#region src/utils/merchantId.d.ts
419
- /**
420
- * Merchant ID utilities for auto-fetching from backend
421
- */
462
+ //#region src/utils/inAppBrowser.d.ts
422
463
  /**
423
- * Fetch merchantId from backend by domain
424
- *
425
- * @param domain - The domain to lookup (defaults to current hostname)
426
- * @param walletUrl - Optional wallet URL to derive backend URL
427
- * @returns The merchantId if found, undefined otherwise
428
- *
429
- * @example
430
- * ```ts
431
- * const merchantId = await fetchMerchantId("shop.example.com");
432
- * if (merchantId) {
433
- * // Use merchantId for tracking
434
- * }
435
- * ```
464
+ * Whether the current device runs iOS (including iPadOS 13+).
436
465
  */
437
- declare function fetchMerchantId(domain?: string, walletUrl?: string): Promise<string | undefined>;
466
+ declare const isIOS: boolean;
438
467
  /**
439
- * Clear the cached merchantId
440
- * Useful for testing or when switching domains
468
+ * Whether the current browser is a social media in-app browser
469
+ * (Instagram, Facebook).
441
470
  */
442
- declare function clearMerchantIdCache(): void;
471
+ declare const isInAppBrowser: boolean;
443
472
  /**
444
- * Get merchantId from config or auto-fetch from backend
473
+ * Redirect to external browser from in-app WebView.
474
+ *
475
+ * - **iOS**: Uses `x-safari-https://` scheme — server-side 302 redirects
476
+ * to custom URL schemes are silently swallowed by WKWebView.
477
+ * Direct `window.location.href` assignment works (confirmed iOS 17+).
445
478
  *
446
- * @param config - The SDK config that may contain merchantId
447
- * @param walletUrl - Optional wallet URL to derive backend URL
448
- * @returns The merchantId if available (from config or fetch), undefined otherwise
479
+ * - **Android**: Uses backend `/common/social` endpoint which returns a PDF
480
+ * Content-Type response, forcing the WebView to hand off to the default browser.
481
+ *
482
+ * @param targetUrl - The URL to open in the external browser
449
483
  */
450
- declare function resolveMerchantId(config: {
451
- metadata?: {
452
- merchantId?: string;
453
- };
454
- }, walletUrl?: string): Promise<string | undefined>;
484
+ declare function redirectToExternalBrowser(targetUrl: string): void;
485
+ //#endregion
486
+ //#region src/utils/sdkConfigStore.d.ts
487
+ declare const GLOBAL_KEY = "__frakSdkConfig";
488
+ declare global {
489
+ interface Window {
490
+ [GLOBAL_KEY]?: SdkResolvedConfig;
491
+ }
492
+ interface WindowEventMap {
493
+ "frak:config": CustomEvent<SdkResolvedConfig>;
494
+ }
495
+ }
496
+ declare function getConfig(): SdkResolvedConfig;
497
+ declare const sdkConfigStore: {
498
+ getConfig: typeof getConfig;
499
+ readonly isResolved: boolean;
500
+ readonly isCacheFresh: boolean;
501
+ setCacheScope(domain: string, lang?: string): void;
502
+ setConfig(config: SdkResolvedConfig): void;
503
+ reset(): void;
504
+ clearCache(): void;
505
+ resolve(domain?: string, walletUrl?: string, lang?: Language): Promise<MerchantConfigResponse | undefined>;
506
+ getMerchantId(): string | undefined;
507
+ resolveMerchantId(domain?: string, walletUrl?: string): Promise<string | undefined>;
508
+ };
455
509
  //#endregion
456
510
  //#region src/utils/sso.d.ts
457
511
  type AppSpecificSsoMetadata = SsoMetadata & {
458
- name: string;
512
+ name?: string;
459
513
  css?: string;
460
514
  };
461
515
  /**
@@ -489,7 +543,7 @@ type FullSsoParams = Omit<PrepareSsoParamsType, "metadata"> & {
489
543
  * // Returns: https://wallet.frak.id/sso?p=<compressed_base64>
490
544
  * ```
491
545
  */
492
- declare function generateSsoUrl(walletUrl: string, params: PrepareSsoParamsType, merchantId: string, name: string, clientId: string, css?: string): string;
546
+ declare function generateSsoUrl(walletUrl: string, params: PrepareSsoParamsType, merchantId: string, name: string | undefined, clientId: string, css?: string): string;
493
547
  /**
494
548
  * Type of compressed the sso data
495
549
  */
@@ -501,7 +555,7 @@ type CompressedSsoData = {
501
555
  l?: "en" | "fr";
502
556
  m: string;
503
557
  md: {
504
- n: string;
558
+ n?: string;
505
559
  css?: string;
506
560
  l?: string;
507
561
  h?: string;
@@ -534,4 +588,4 @@ declare function computeLegacyProductId({
534
588
  domain?: string;
535
589
  }): `0x${string}`;
536
590
  //#endregion
537
- export { getBackendUrl as A, HashProtectedData as B, triggerDeepLinkWithFallback as C, base64urlDecode as D, compressJsonToB64 as E, createIFrameFrakClient as F, TrackArrivalParams as I, TrackArrivalResult as L, locales as M, setupClient as N, base64urlEncode as O, DebugInfoGatherer as P, UtmParams as R, toAndroidIntentUrl as S, decompressJsonFromB64 as T, KeyProvider as V, formatAmount as _, CompressedSsoData as a, isChromiumAndroid as b, clearMerchantIdCache as c, baseIframeProps as d, createIframe as f, getCurrencyAmountKey as g, getSupportedCurrency as h, AppSpecificSsoMetadata as i, LocalesKey as j, getClientId as k, fetchMerchantId as l, getSupportedLocale as m, FrakEvent as n, FullSsoParams as o, findIframeInOpener as p, trackEvent as r, generateSsoUrl as s, computeLegacyProductId as t, resolveMerchantId as u, FrakContextManager as v, DEEP_LINK_SCHEME as w, isFrakDeepLink as x, DeepLinkFallbackOptions as y, CompressedData as z };
591
+ export { getClientId as A, TrackArrivalParams as B, toAndroidIntentUrl as C, compressJsonToB64 as D, decompressJsonFromB64 as E, LocalesKey as F, KeyProvider as G, UtmParams as H, locales as I, setupClient as L, getCache as M, withCache as N, base64urlDecode as O, getBackendUrl as P, DebugInfoGatherer as R, isFrakDeepLink as S, DEEP_LINK_SCHEME as T, CompressedData as U, TrackArrivalResult as V, HashProtectedData as W, getCurrencyAmountKey as _, CompressedSsoData as a, DeepLinkFallbackOptions as b, sdkConfigStore as c, redirectToExternalBrowser as d, baseIframeProps as f, getSupportedCurrency as g, getSupportedLocale as h, AppSpecificSsoMetadata as i, clearAllCache as j, base64urlEncode as k, isIOS as l, findIframeInOpener as m, FrakEvent as n, FullSsoParams as o, createIframe as p, trackEvent as r, generateSsoUrl as s, computeLegacyProductId as t, isInAppBrowser as u, formatAmount as v, triggerDeepLinkWithFallback as w, isChromiumAndroid as x, FrakContextManager as y, createIFrameFrakClient as z };
@@ -1,6 +1,6 @@
1
- import { J as Currency, V as SsoMetadata, Y as FrakWalletSdkConfig, _ as TokenAmountType, a as FrakContextV1, i as FrakContext, l as FrakClient, o as FrakContextV2, z as PrepareSsoParamsType } from "./openSso-CMzwvaCa.js";
2
- import { Address, Hex } from "viem";
1
+ import { G as SsoMetadata, Q as MerchantConfigResponse, U as PrepareSsoParamsType, a as FrakContextV1, at as Language, i as FrakContext, l as FrakClient, nt as Currency, o as FrakContextV2, rt as FrakWalletSdkConfig, tt as SdkResolvedConfig, v as TokenAmountType } from "./openSso-CebB8mFv.cjs";
3
2
  import { RpcMessage, RpcResponse } from "@frak-labs/frame-connector";
3
+ import { Address, Hex } from "viem";
4
4
 
5
5
  //#region src/types/compression.d.ts
6
6
  /**
@@ -50,7 +50,7 @@ type TrackArrivalResult = {
50
50
  * Create a new iframe Frak client
51
51
  * @param args
52
52
  * @param args.config - The configuration to use for the Frak Wallet SDK.
53
- * When `config.domain` is set, it is forwarded to the iframe handshake so the listener resolves the correct merchant in tunneled/proxied environments (e.g. Shopify dev with Cloudflare tunnel).
53
+ * When `config.domain` is set, it is used to resolve the correct merchant config in tunneled/proxied environments (e.g. Shopify dev with Cloudflare tunnel).
54
54
  * @param args.iframe - The iframe to use for the communication
55
55
  * @returns The created Frak Client
56
56
  *
@@ -143,6 +143,50 @@ declare const locales: {
143
143
  */
144
144
  declare function getBackendUrl(walletUrl?: string): string;
145
145
  //#endregion
146
+ //#region src/utils/cache/withCache.d.ts
147
+ type WithCacheOptions = {
148
+ /** The key to cache the data against */cacheKey: string; /** Time in ms that cached data will remain valid. Default: 30_000 (30s). Set to 0 to disable caching. */
149
+ cacheTime?: number;
150
+ };
151
+ /**
152
+ * Returns the result of a given promise, and caches the result for
153
+ * subsequent invocations against a provided cache key.
154
+ *
155
+ * Also deduplicates concurrent calls — if multiple callers request the same
156
+ * cache key while the promise is pending, they share the same promise.
157
+ *
158
+ * @example
159
+ * ```ts
160
+ * // First call fetches, subsequent calls return cached data for 30s
161
+ * const data = await withCache(
162
+ * () => client.request({ method: "frak_getMerchantInformation" }),
163
+ * { cacheKey: "merchantInfo", cacheTime: 30_000 }
164
+ * );
165
+ * ```
166
+ */
167
+ declare function withCache<TData>(fn: () => Promise<TData>, {
168
+ cacheKey,
169
+ cacheTime
170
+ }: WithCacheOptions): Promise<TData>;
171
+ /**
172
+ * Get a cache handle for a specific key, useful for manual invalidation.
173
+ *
174
+ * @example
175
+ * ```ts
176
+ * // Invalidate merchant info cache after a mutation
177
+ * getCache("frak_getMerchantInformation").clear();
178
+ * ```
179
+ */
180
+ declare function getCache(cacheKey: string): {
181
+ /** Clear both the pending promise and the cached response */clear: () => void; /** Check if a non-expired response exists */
182
+ has: (cacheTime?: number) => boolean;
183
+ };
184
+ /**
185
+ * Clear all cached data (both pending promises and resolved responses).
186
+ * Called automatically when the client is destroyed.
187
+ */
188
+ declare function clearAllCache(): void;
189
+ //#endregion
146
190
  //#region src/utils/clientId.d.ts
147
191
  /**
148
192
  * Client ID utilities for anonymous tracking
@@ -415,47 +459,57 @@ declare function createIframe({
415
459
  */
416
460
  declare function findIframeInOpener(pathname?: string): Window | null;
417
461
  //#endregion
418
- //#region src/utils/merchantId.d.ts
419
- /**
420
- * Merchant ID utilities for auto-fetching from backend
421
- */
462
+ //#region src/utils/inAppBrowser.d.ts
422
463
  /**
423
- * Fetch merchantId from backend by domain
424
- *
425
- * @param domain - The domain to lookup (defaults to current hostname)
426
- * @param walletUrl - Optional wallet URL to derive backend URL
427
- * @returns The merchantId if found, undefined otherwise
428
- *
429
- * @example
430
- * ```ts
431
- * const merchantId = await fetchMerchantId("shop.example.com");
432
- * if (merchantId) {
433
- * // Use merchantId for tracking
434
- * }
435
- * ```
464
+ * Whether the current device runs iOS (including iPadOS 13+).
436
465
  */
437
- declare function fetchMerchantId(domain?: string, walletUrl?: string): Promise<string | undefined>;
466
+ declare const isIOS: boolean;
438
467
  /**
439
- * Clear the cached merchantId
440
- * Useful for testing or when switching domains
468
+ * Whether the current browser is a social media in-app browser
469
+ * (Instagram, Facebook).
441
470
  */
442
- declare function clearMerchantIdCache(): void;
471
+ declare const isInAppBrowser: boolean;
443
472
  /**
444
- * Get merchantId from config or auto-fetch from backend
473
+ * Redirect to external browser from in-app WebView.
474
+ *
475
+ * - **iOS**: Uses `x-safari-https://` scheme — server-side 302 redirects
476
+ * to custom URL schemes are silently swallowed by WKWebView.
477
+ * Direct `window.location.href` assignment works (confirmed iOS 17+).
445
478
  *
446
- * @param config - The SDK config that may contain merchantId
447
- * @param walletUrl - Optional wallet URL to derive backend URL
448
- * @returns The merchantId if available (from config or fetch), undefined otherwise
479
+ * - **Android**: Uses backend `/common/social` endpoint which returns a PDF
480
+ * Content-Type response, forcing the WebView to hand off to the default browser.
481
+ *
482
+ * @param targetUrl - The URL to open in the external browser
449
483
  */
450
- declare function resolveMerchantId(config: {
451
- metadata?: {
452
- merchantId?: string;
453
- };
454
- }, walletUrl?: string): Promise<string | undefined>;
484
+ declare function redirectToExternalBrowser(targetUrl: string): void;
485
+ //#endregion
486
+ //#region src/utils/sdkConfigStore.d.ts
487
+ declare const GLOBAL_KEY = "__frakSdkConfig";
488
+ declare global {
489
+ interface Window {
490
+ [GLOBAL_KEY]?: SdkResolvedConfig;
491
+ }
492
+ interface WindowEventMap {
493
+ "frak:config": CustomEvent<SdkResolvedConfig>;
494
+ }
495
+ }
496
+ declare function getConfig(): SdkResolvedConfig;
497
+ declare const sdkConfigStore: {
498
+ getConfig: typeof getConfig;
499
+ readonly isResolved: boolean;
500
+ readonly isCacheFresh: boolean;
501
+ setCacheScope(domain: string, lang?: string): void;
502
+ setConfig(config: SdkResolvedConfig): void;
503
+ reset(): void;
504
+ clearCache(): void;
505
+ resolve(domain?: string, walletUrl?: string, lang?: Language): Promise<MerchantConfigResponse | undefined>;
506
+ getMerchantId(): string | undefined;
507
+ resolveMerchantId(domain?: string, walletUrl?: string): Promise<string | undefined>;
508
+ };
455
509
  //#endregion
456
510
  //#region src/utils/sso.d.ts
457
511
  type AppSpecificSsoMetadata = SsoMetadata & {
458
- name: string;
512
+ name?: string;
459
513
  css?: string;
460
514
  };
461
515
  /**
@@ -489,7 +543,7 @@ type FullSsoParams = Omit<PrepareSsoParamsType, "metadata"> & {
489
543
  * // Returns: https://wallet.frak.id/sso?p=<compressed_base64>
490
544
  * ```
491
545
  */
492
- declare function generateSsoUrl(walletUrl: string, params: PrepareSsoParamsType, merchantId: string, name: string, clientId: string, css?: string): string;
546
+ declare function generateSsoUrl(walletUrl: string, params: PrepareSsoParamsType, merchantId: string, name: string | undefined, clientId: string, css?: string): string;
493
547
  /**
494
548
  * Type of compressed the sso data
495
549
  */
@@ -501,7 +555,7 @@ type CompressedSsoData = {
501
555
  l?: "en" | "fr";
502
556
  m: string;
503
557
  md: {
504
- n: string;
558
+ n?: string;
505
559
  css?: string;
506
560
  l?: string;
507
561
  h?: string;
@@ -534,4 +588,4 @@ declare function computeLegacyProductId({
534
588
  domain?: string;
535
589
  }): `0x${string}`;
536
590
  //#endregion
537
- export { getBackendUrl as A, HashProtectedData as B, triggerDeepLinkWithFallback as C, base64urlDecode as D, compressJsonToB64 as E, createIFrameFrakClient as F, TrackArrivalParams as I, TrackArrivalResult as L, locales as M, setupClient as N, base64urlEncode as O, DebugInfoGatherer as P, UtmParams as R, toAndroidIntentUrl as S, decompressJsonFromB64 as T, KeyProvider as V, formatAmount as _, CompressedSsoData as a, isChromiumAndroid as b, clearMerchantIdCache as c, baseIframeProps as d, createIframe as f, getCurrencyAmountKey as g, getSupportedCurrency as h, AppSpecificSsoMetadata as i, LocalesKey as j, getClientId as k, fetchMerchantId as l, getSupportedLocale as m, FrakEvent as n, FullSsoParams as o, findIframeInOpener as p, trackEvent as r, generateSsoUrl as s, computeLegacyProductId as t, resolveMerchantId as u, FrakContextManager as v, DEEP_LINK_SCHEME as w, isFrakDeepLink as x, DeepLinkFallbackOptions as y, CompressedData as z };
591
+ export { getClientId as A, TrackArrivalParams as B, toAndroidIntentUrl as C, compressJsonToB64 as D, decompressJsonFromB64 as E, LocalesKey as F, KeyProvider as G, UtmParams as H, locales as I, setupClient as L, getCache as M, withCache as N, base64urlDecode as O, getBackendUrl as P, DebugInfoGatherer as R, isFrakDeepLink as S, DEEP_LINK_SCHEME as T, CompressedData as U, TrackArrivalResult as V, HashProtectedData as W, getCurrencyAmountKey as _, CompressedSsoData as a, DeepLinkFallbackOptions as b, sdkConfigStore as c, redirectToExternalBrowser as d, baseIframeProps as f, getSupportedCurrency as g, getSupportedLocale as h, AppSpecificSsoMetadata as i, clearAllCache as j, base64urlEncode as k, isIOS as l, findIframeInOpener as m, FrakEvent as n, FullSsoParams as o, createIframe as p, trackEvent as r, generateSsoUrl as s, computeLegacyProductId as t, isInAppBrowser as u, formatAmount as v, triggerDeepLinkWithFallback as w, isChromiumAndroid as x, FrakContextManager as y, createIFrameFrakClient as z };
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./trackEvent-Ew5r5zfI.cjs`),t=require(`./setupClient-CqTHGvVa.cjs`);exports.DEEP_LINK_SCHEME=t.g,exports.DebugInfoGatherer=t.r,exports.FrakContextManager=e.a,exports.base64urlDecode=e.h,exports.base64urlEncode=e.g,exports.baseIframeProps=t.i,exports.clearMerchantIdCache=e.n,exports.compressJsonToB64=e.m,exports.computeLegacyProductId=e._,exports.createIFrameFrakClient=t.n,exports.createIframe=t.a,exports.decompressJsonFromB64=e.c,exports.fetchMerchantId=e.r,exports.findIframeInOpener=t.o,exports.formatAmount=t.c,exports.generateSsoUrl=e.p,exports.getBackendUrl=e.l,exports.getClientId=e.v,exports.getCurrencyAmountKey=t.s,exports.getSupportedCurrency=t.u,exports.getSupportedLocale=t.l,exports.isChromiumAndroid=t.f,exports.isFrakDeepLink=t.p,exports.isV1Context=e.o,exports.isV2Context=e.s,exports.locales=t.d,exports.resolveMerchantId=e.i,exports.setupClient=t.t,exports.ssoPopupFeatures=e.d,exports.ssoPopupName=e.f,exports.toAndroidIntentUrl=t.m,exports.trackEvent=e.t,exports.triggerDeepLinkWithFallback=t.h;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./trackEvent-CvbJTTqA.cjs`),t=require(`./setupClient-B_XMB52l.cjs`);exports.DEEP_LINK_SCHEME=t.y,exports.DebugInfoGatherer=t.r,exports.FrakContextManager=e.r,exports.base64urlDecode=e.g,exports.base64urlEncode=e._,exports.baseIframeProps=t.s,exports.clearAllCache=e.s,exports.compressJsonToB64=e.h,exports.computeLegacyProductId=e.v,exports.createIFrameFrakClient=t.n,exports.createIframe=t.c,exports.decompressJsonFromB64=e.o,exports.findIframeInOpener=t.l,exports.formatAmount=t.d,exports.generateSsoUrl=e.m,exports.getBackendUrl=e.u,exports.getCache=e.c,exports.getClientId=e.y,exports.getCurrencyAmountKey=t.u,exports.getSupportedCurrency=t.p,exports.getSupportedLocale=t.f,exports.isChromiumAndroid=t.h,exports.isFrakDeepLink=t.g,exports.isIOS=t.i,exports.isInAppBrowser=t.a,exports.isV1Context=e.i,exports.isV2Context=e.a,exports.locales=t.m,exports.redirectToExternalBrowser=t.o,exports.sdkConfigStore=e.n,exports.setupClient=t.t,exports.ssoPopupFeatures=e.f,exports.ssoPopupName=e.p,exports.toAndroidIntentUrl=t._,exports.trackEvent=e.t,exports.triggerDeepLinkWithFallback=t.v,exports.withCache=e.l;
package/dist/index.d.cts CHANGED
@@ -1,3 +1,3 @@
1
- import { A as SendTransactionModalStepType, B as PrepareSsoReturnType, C as EmbeddedViewActionSharing, D as ModalRpcStepsInput, E as ModalRpcMetadata, F as SiweAuthenticationParams, G as InteractionTypeKey, H as FinalActionType, I as LoginModalStepType, J as Currency, K as IFrameLifecycleEvent, L as OpenSsoParamsType, M as SendTransactionTxType, N as SiweAuthenticateModalStepType, O as ModalRpcStepsResultType, P as SiweAuthenticateReturnType, Q as LocalizedI18nConfig, R as OpenSsoReturnType, S as EmbeddedViewActionReferred, T as DisplayModalParamsType, U as FinalModalStepType, V as SsoMetadata, W as ModalStepMetadata, X as I18nConfig, Y as FrakWalletSdkConfig, Z as Language, _ as TokenAmountType, a as FrakContextV1, b as DisplayEmbeddedWalletResultType, c as isV2Context, d as IFrameTransport, f as IFrameRpcSchema, g as RewardTier, h as GetMerchantInformationReturnType, i as FrakContext, j as SendTransactionReturnType, k as ModalStepTypes, l as FrakClient, m as EstimatedReward, n as ssoPopupFeatures, o as FrakContextV2, p as WalletStatusReturnType, q as ClientLifecycleEvent, r as ssoPopupName, s as isV1Context, u as FrakLifecycleEvent, v as SendInteractionParamsType, w as LoggedInEmbeddedView, x as LoggedOutEmbeddedView, y as DisplayEmbeddedWalletParamsType, z as PrepareSsoParamsType } from "./openSso-B0g7-807.cjs";
2
- import { A as getBackendUrl, B as HashProtectedData, C as triggerDeepLinkWithFallback, D as base64urlDecode, E as compressJsonToB64, F as createIFrameFrakClient, I as TrackArrivalParams, L as TrackArrivalResult, M as locales, N as setupClient, O as base64urlEncode, P as DebugInfoGatherer, R as UtmParams, S as toAndroidIntentUrl, T as decompressJsonFromB64, V as KeyProvider, _ as formatAmount, a as CompressedSsoData, b as isChromiumAndroid, c as clearMerchantIdCache, d as baseIframeProps, f as createIframe, g as getCurrencyAmountKey, h as getSupportedCurrency, i as AppSpecificSsoMetadata, j as LocalesKey, k as getClientId, l as fetchMerchantId, m as getSupportedLocale, n as FrakEvent, o as FullSsoParams, p as findIframeInOpener, r as trackEvent, s as generateSsoUrl, t as computeLegacyProductId, u as resolveMerchantId, v as FrakContextManager, w as DEEP_LINK_SCHEME, x as isFrakDeepLink, y as DeepLinkFallbackOptions, z as CompressedData } from "./computeLegacyProductId-CCAZvLa5.cjs";
3
- export { type AppSpecificSsoMetadata, type ClientLifecycleEvent, type CompressedData, type CompressedSsoData, type Currency, DEEP_LINK_SCHEME, DebugInfoGatherer, type DeepLinkFallbackOptions, type DisplayEmbeddedWalletParamsType, type DisplayEmbeddedWalletResultType, type DisplayModalParamsType, type EmbeddedViewActionReferred, type EmbeddedViewActionSharing, type EstimatedReward, type FinalActionType, type FinalModalStepType, type FrakClient, type FrakContext, FrakContextManager, type FrakContextV1, type FrakContextV2, type FrakEvent, type FrakLifecycleEvent, type FrakWalletSdkConfig, type FullSsoParams, type GetMerchantInformationReturnType, type HashProtectedData, type I18nConfig, type IFrameLifecycleEvent, type IFrameRpcSchema, type IFrameTransport, type InteractionTypeKey, type KeyProvider, type Language, type LocalesKey, type LocalizedI18nConfig, type LoggedInEmbeddedView, type LoggedOutEmbeddedView, type LoginModalStepType, type ModalRpcMetadata, type ModalRpcStepsInput, type ModalRpcStepsResultType, type ModalStepMetadata, type ModalStepTypes, type OpenSsoParamsType, type OpenSsoReturnType, type PrepareSsoParamsType, type PrepareSsoReturnType, type RewardTier, type SendInteractionParamsType, type SendTransactionModalStepType, type SendTransactionReturnType, type SendTransactionTxType, type SiweAuthenticateModalStepType, type SiweAuthenticateReturnType, type SiweAuthenticationParams, type SsoMetadata, type TokenAmountType, type TrackArrivalParams, type TrackArrivalResult, type UtmParams, type WalletStatusReturnType, base64urlDecode, base64urlEncode, baseIframeProps, clearMerchantIdCache, compressJsonToB64, computeLegacyProductId, createIFrameFrakClient, createIframe, decompressJsonFromB64, fetchMerchantId, findIframeInOpener, formatAmount, generateSsoUrl, getBackendUrl, getClientId, getCurrencyAmountKey, getSupportedCurrency, getSupportedLocale, isChromiumAndroid, isFrakDeepLink, isV1Context, isV2Context, locales, resolveMerchantId, setupClient, ssoPopupFeatures, ssoPopupName, toAndroidIntentUrl, trackEvent, triggerDeepLinkWithFallback };
1
+ import { $ as ResolvedPlacement, A as ModalRpcMetadata, B as LoginModalStepType, C as EmbeddedViewActionReferred, D as DisplaySharingPageResultType, E as DisplaySharingPageParamsType, F as SendTransactionReturnType, G as SsoMetadata, H as OpenSsoReturnType, I as SendTransactionTxType, J as ModalStepMetadata, K as FinalActionType, L as SiweAuthenticateModalStepType, M as ModalRpcStepsResultType, N as ModalStepTypes, O as SharingPageProduct, P as SendTransactionModalStepType, Q as MerchantConfigResponse, R as SiweAuthenticateReturnType, S as LoggedOutEmbeddedView, T as LoggedInEmbeddedView, U as PrepareSsoParamsType, V as OpenSsoParamsType, W as PrepareSsoReturnType, X as IFrameLifecycleEvent, Y as InteractionTypeKey, Z as ClientLifecycleEvent, _ as RewardTier, a as FrakContextV1, at as Language, b as DisplayEmbeddedWalletParamsType, c as isV2Context, d as IFrameTransport, et as ResolvedSdkConfig, f as IFrameRpcSchema, g as GetMerchantInformationReturnType, h as EstimatedReward, i as FrakContext, it as I18nConfig, j as ModalRpcStepsInput, k as DisplayModalParamsType, l as FrakClient, m as UserReferralStatusType, n as ssoPopupFeatures, nt as Currency, o as FrakContextV2, ot as LocalizedI18nConfig, p as WalletStatusReturnType, q as FinalModalStepType, r as ssoPopupName, rt as FrakWalletSdkConfig, s as isV1Context, tt as SdkResolvedConfig, u as FrakLifecycleEvent, v as TokenAmountType, w as EmbeddedViewActionSharing, x as DisplayEmbeddedWalletResultType, y as SendInteractionParamsType, z as SiweAuthenticationParams } from "./openSso-CebB8mFv.cjs";
2
+ import { A as getClientId, B as TrackArrivalParams, C as toAndroidIntentUrl, D as compressJsonToB64, E as decompressJsonFromB64, F as LocalesKey, G as KeyProvider, H as UtmParams, I as locales, L as setupClient, M as getCache, N as withCache, O as base64urlDecode, P as getBackendUrl, R as DebugInfoGatherer, S as isFrakDeepLink, T as DEEP_LINK_SCHEME, U as CompressedData, V as TrackArrivalResult, W as HashProtectedData, _ as getCurrencyAmountKey, a as CompressedSsoData, b as DeepLinkFallbackOptions, c as sdkConfigStore, d as redirectToExternalBrowser, f as baseIframeProps, g as getSupportedCurrency, h as getSupportedLocale, i as AppSpecificSsoMetadata, j as clearAllCache, k as base64urlEncode, l as isIOS, m as findIframeInOpener, n as FrakEvent, o as FullSsoParams, p as createIframe, r as trackEvent, s as generateSsoUrl, t as computeLegacyProductId, u as isInAppBrowser, v as formatAmount, w as triggerDeepLinkWithFallback, x as isChromiumAndroid, y as FrakContextManager, z as createIFrameFrakClient } from "./computeLegacyProductId-rYIvY4c3.cjs";
3
+ export { type AppSpecificSsoMetadata, type ClientLifecycleEvent, type CompressedData, type CompressedSsoData, type Currency, DEEP_LINK_SCHEME, DebugInfoGatherer, type DeepLinkFallbackOptions, type DisplayEmbeddedWalletParamsType, type DisplayEmbeddedWalletResultType, type DisplayModalParamsType, type DisplaySharingPageParamsType, type DisplaySharingPageResultType, type EmbeddedViewActionReferred, type EmbeddedViewActionSharing, type EstimatedReward, type FinalActionType, type FinalModalStepType, type FrakClient, type FrakContext, FrakContextManager, type FrakContextV1, type FrakContextV2, type FrakEvent, type FrakLifecycleEvent, type FrakWalletSdkConfig, type FullSsoParams, type GetMerchantInformationReturnType, type HashProtectedData, type I18nConfig, type IFrameLifecycleEvent, type IFrameRpcSchema, type IFrameTransport, type InteractionTypeKey, type KeyProvider, type Language, type LocalesKey, type LocalizedI18nConfig, type LoggedInEmbeddedView, type LoggedOutEmbeddedView, type LoginModalStepType, type MerchantConfigResponse, type ModalRpcMetadata, type ModalRpcStepsInput, type ModalRpcStepsResultType, type ModalStepMetadata, type ModalStepTypes, type OpenSsoParamsType, type OpenSsoReturnType, type PrepareSsoParamsType, type PrepareSsoReturnType, type ResolvedPlacement, type ResolvedSdkConfig, type RewardTier, type SdkResolvedConfig, type SendInteractionParamsType, type SendTransactionModalStepType, type SendTransactionReturnType, type SendTransactionTxType, type SharingPageProduct, type SiweAuthenticateModalStepType, type SiweAuthenticateReturnType, type SiweAuthenticationParams, type SsoMetadata, type TokenAmountType, type TrackArrivalParams, type TrackArrivalResult, type UserReferralStatusType, type UtmParams, type WalletStatusReturnType, base64urlDecode, base64urlEncode, baseIframeProps, clearAllCache, compressJsonToB64, computeLegacyProductId, createIFrameFrakClient, createIframe, decompressJsonFromB64, findIframeInOpener, formatAmount, generateSsoUrl, getBackendUrl, getCache, getClientId, getCurrencyAmountKey, getSupportedCurrency, getSupportedLocale, isChromiumAndroid, isFrakDeepLink, isIOS, isInAppBrowser, isV1Context, isV2Context, locales, redirectToExternalBrowser, sdkConfigStore, setupClient, ssoPopupFeatures, ssoPopupName, toAndroidIntentUrl, trackEvent, triggerDeepLinkWithFallback, withCache };
package/dist/index.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- import { A as SendTransactionModalStepType, B as PrepareSsoReturnType, C as EmbeddedViewActionSharing, D as ModalRpcStepsInput, E as ModalRpcMetadata, F as SiweAuthenticationParams, G as InteractionTypeKey, H as FinalActionType, I as LoginModalStepType, J as Currency, K as IFrameLifecycleEvent, L as OpenSsoParamsType, M as SendTransactionTxType, N as SiweAuthenticateModalStepType, O as ModalRpcStepsResultType, P as SiweAuthenticateReturnType, Q as LocalizedI18nConfig, R as OpenSsoReturnType, S as EmbeddedViewActionReferred, T as DisplayModalParamsType, U as FinalModalStepType, V as SsoMetadata, W as ModalStepMetadata, X as I18nConfig, Y as FrakWalletSdkConfig, Z as Language, _ as TokenAmountType, a as FrakContextV1, b as DisplayEmbeddedWalletResultType, c as isV2Context, d as IFrameTransport, f as IFrameRpcSchema, g as RewardTier, h as GetMerchantInformationReturnType, i as FrakContext, j as SendTransactionReturnType, k as ModalStepTypes, l as FrakClient, m as EstimatedReward, n as ssoPopupFeatures, o as FrakContextV2, p as WalletStatusReturnType, q as ClientLifecycleEvent, r as ssoPopupName, s as isV1Context, u as FrakLifecycleEvent, v as SendInteractionParamsType, w as LoggedInEmbeddedView, x as LoggedOutEmbeddedView, y as DisplayEmbeddedWalletParamsType, z as PrepareSsoParamsType } from "./openSso-CMzwvaCa.js";
2
- import { A as getBackendUrl, B as HashProtectedData, C as triggerDeepLinkWithFallback, D as base64urlDecode, E as compressJsonToB64, F as createIFrameFrakClient, I as TrackArrivalParams, L as TrackArrivalResult, M as locales, N as setupClient, O as base64urlEncode, P as DebugInfoGatherer, R as UtmParams, S as toAndroidIntentUrl, T as decompressJsonFromB64, V as KeyProvider, _ as formatAmount, a as CompressedSsoData, b as isChromiumAndroid, c as clearMerchantIdCache, d as baseIframeProps, f as createIframe, g as getCurrencyAmountKey, h as getSupportedCurrency, i as AppSpecificSsoMetadata, j as LocalesKey, k as getClientId, l as fetchMerchantId, m as getSupportedLocale, n as FrakEvent, o as FullSsoParams, p as findIframeInOpener, r as trackEvent, s as generateSsoUrl, t as computeLegacyProductId, u as resolveMerchantId, v as FrakContextManager, w as DEEP_LINK_SCHEME, x as isFrakDeepLink, y as DeepLinkFallbackOptions, z as CompressedData } from "./computeLegacyProductId-b5cUWdAm.js";
3
- export { type AppSpecificSsoMetadata, type ClientLifecycleEvent, type CompressedData, type CompressedSsoData, type Currency, DEEP_LINK_SCHEME, DebugInfoGatherer, type DeepLinkFallbackOptions, type DisplayEmbeddedWalletParamsType, type DisplayEmbeddedWalletResultType, type DisplayModalParamsType, type EmbeddedViewActionReferred, type EmbeddedViewActionSharing, type EstimatedReward, type FinalActionType, type FinalModalStepType, type FrakClient, type FrakContext, FrakContextManager, type FrakContextV1, type FrakContextV2, type FrakEvent, type FrakLifecycleEvent, type FrakWalletSdkConfig, type FullSsoParams, type GetMerchantInformationReturnType, type HashProtectedData, type I18nConfig, type IFrameLifecycleEvent, type IFrameRpcSchema, type IFrameTransport, type InteractionTypeKey, type KeyProvider, type Language, type LocalesKey, type LocalizedI18nConfig, type LoggedInEmbeddedView, type LoggedOutEmbeddedView, type LoginModalStepType, type ModalRpcMetadata, type ModalRpcStepsInput, type ModalRpcStepsResultType, type ModalStepMetadata, type ModalStepTypes, type OpenSsoParamsType, type OpenSsoReturnType, type PrepareSsoParamsType, type PrepareSsoReturnType, type RewardTier, type SendInteractionParamsType, type SendTransactionModalStepType, type SendTransactionReturnType, type SendTransactionTxType, type SiweAuthenticateModalStepType, type SiweAuthenticateReturnType, type SiweAuthenticationParams, type SsoMetadata, type TokenAmountType, type TrackArrivalParams, type TrackArrivalResult, type UtmParams, type WalletStatusReturnType, base64urlDecode, base64urlEncode, baseIframeProps, clearMerchantIdCache, compressJsonToB64, computeLegacyProductId, createIFrameFrakClient, createIframe, decompressJsonFromB64, fetchMerchantId, findIframeInOpener, formatAmount, generateSsoUrl, getBackendUrl, getClientId, getCurrencyAmountKey, getSupportedCurrency, getSupportedLocale, isChromiumAndroid, isFrakDeepLink, isV1Context, isV2Context, locales, resolveMerchantId, setupClient, ssoPopupFeatures, ssoPopupName, toAndroidIntentUrl, trackEvent, triggerDeepLinkWithFallback };
1
+ import { $ as ResolvedPlacement, A as ModalRpcMetadata, B as LoginModalStepType, C as EmbeddedViewActionReferred, D as DisplaySharingPageResultType, E as DisplaySharingPageParamsType, F as SendTransactionReturnType, G as SsoMetadata, H as OpenSsoReturnType, I as SendTransactionTxType, J as ModalStepMetadata, K as FinalActionType, L as SiweAuthenticateModalStepType, M as ModalRpcStepsResultType, N as ModalStepTypes, O as SharingPageProduct, P as SendTransactionModalStepType, Q as MerchantConfigResponse, R as SiweAuthenticateReturnType, S as LoggedOutEmbeddedView, T as LoggedInEmbeddedView, U as PrepareSsoParamsType, V as OpenSsoParamsType, W as PrepareSsoReturnType, X as IFrameLifecycleEvent, Y as InteractionTypeKey, Z as ClientLifecycleEvent, _ as RewardTier, a as FrakContextV1, at as Language, b as DisplayEmbeddedWalletParamsType, c as isV2Context, d as IFrameTransport, et as ResolvedSdkConfig, f as IFrameRpcSchema, g as GetMerchantInformationReturnType, h as EstimatedReward, i as FrakContext, it as I18nConfig, j as ModalRpcStepsInput, k as DisplayModalParamsType, l as FrakClient, m as UserReferralStatusType, n as ssoPopupFeatures, nt as Currency, o as FrakContextV2, ot as LocalizedI18nConfig, p as WalletStatusReturnType, q as FinalModalStepType, r as ssoPopupName, rt as FrakWalletSdkConfig, s as isV1Context, tt as SdkResolvedConfig, u as FrakLifecycleEvent, v as TokenAmountType, w as EmbeddedViewActionSharing, x as DisplayEmbeddedWalletResultType, y as SendInteractionParamsType, z as SiweAuthenticationParams } from "./openSso-CMZM06uR.js";
2
+ import { A as getClientId, B as TrackArrivalParams, C as toAndroidIntentUrl, D as compressJsonToB64, E as decompressJsonFromB64, F as LocalesKey, G as KeyProvider, H as UtmParams, I as locales, L as setupClient, M as getCache, N as withCache, O as base64urlDecode, P as getBackendUrl, R as DebugInfoGatherer, S as isFrakDeepLink, T as DEEP_LINK_SCHEME, U as CompressedData, V as TrackArrivalResult, W as HashProtectedData, _ as getCurrencyAmountKey, a as CompressedSsoData, b as DeepLinkFallbackOptions, c as sdkConfigStore, d as redirectToExternalBrowser, f as baseIframeProps, g as getSupportedCurrency, h as getSupportedLocale, i as AppSpecificSsoMetadata, j as clearAllCache, k as base64urlEncode, l as isIOS, m as findIframeInOpener, n as FrakEvent, o as FullSsoParams, p as createIframe, r as trackEvent, s as generateSsoUrl, t as computeLegacyProductId, u as isInAppBrowser, v as formatAmount, w as triggerDeepLinkWithFallback, x as isChromiumAndroid, y as FrakContextManager, z as createIFrameFrakClient } from "./computeLegacyProductId-fKvxbC4k.js";
3
+ export { type AppSpecificSsoMetadata, type ClientLifecycleEvent, type CompressedData, type CompressedSsoData, type Currency, DEEP_LINK_SCHEME, DebugInfoGatherer, type DeepLinkFallbackOptions, type DisplayEmbeddedWalletParamsType, type DisplayEmbeddedWalletResultType, type DisplayModalParamsType, type DisplaySharingPageParamsType, type DisplaySharingPageResultType, type EmbeddedViewActionReferred, type EmbeddedViewActionSharing, type EstimatedReward, type FinalActionType, type FinalModalStepType, type FrakClient, type FrakContext, FrakContextManager, type FrakContextV1, type FrakContextV2, type FrakEvent, type FrakLifecycleEvent, type FrakWalletSdkConfig, type FullSsoParams, type GetMerchantInformationReturnType, type HashProtectedData, type I18nConfig, type IFrameLifecycleEvent, type IFrameRpcSchema, type IFrameTransport, type InteractionTypeKey, type KeyProvider, type Language, type LocalesKey, type LocalizedI18nConfig, type LoggedInEmbeddedView, type LoggedOutEmbeddedView, type LoginModalStepType, type MerchantConfigResponse, type ModalRpcMetadata, type ModalRpcStepsInput, type ModalRpcStepsResultType, type ModalStepMetadata, type ModalStepTypes, type OpenSsoParamsType, type OpenSsoReturnType, type PrepareSsoParamsType, type PrepareSsoReturnType, type ResolvedPlacement, type ResolvedSdkConfig, type RewardTier, type SdkResolvedConfig, type SendInteractionParamsType, type SendTransactionModalStepType, type SendTransactionReturnType, type SendTransactionTxType, type SharingPageProduct, type SiweAuthenticateModalStepType, type SiweAuthenticateReturnType, type SiweAuthenticationParams, type SsoMetadata, type TokenAmountType, type TrackArrivalParams, type TrackArrivalResult, type UserReferralStatusType, type UtmParams, type WalletStatusReturnType, base64urlDecode, base64urlEncode, baseIframeProps, clearAllCache, compressJsonToB64, computeLegacyProductId, createIFrameFrakClient, createIframe, decompressJsonFromB64, findIframeInOpener, formatAmount, generateSsoUrl, getBackendUrl, getCache, getClientId, getCurrencyAmountKey, getSupportedCurrency, getSupportedLocale, isChromiumAndroid, isFrakDeepLink, isIOS, isInAppBrowser, isV1Context, isV2Context, locales, redirectToExternalBrowser, sdkConfigStore, setupClient, ssoPopupFeatures, ssoPopupName, toAndroidIntentUrl, trackEvent, triggerDeepLinkWithFallback, withCache };
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- import{_ as e,a as t,c as n,d as r,f as i,g as a,h as o,i as s,l as c,m as l,n as u,o as d,p as f,r as p,s as m,t as h,v as g}from"./trackEvent-CeLFVzZn.js";import{a as _,c as v,d as y,f as b,g as x,h as S,i as C,l as w,m as T,n as E,o as D,p as O,r as k,s as A,t as j,u as M}from"./setupClient-DTyvAPgh.js";export{x as DEEP_LINK_SCHEME,k as DebugInfoGatherer,t as FrakContextManager,o as base64urlDecode,a as base64urlEncode,C as baseIframeProps,u as clearMerchantIdCache,l as compressJsonToB64,e as computeLegacyProductId,E as createIFrameFrakClient,_ as createIframe,n as decompressJsonFromB64,p as fetchMerchantId,D as findIframeInOpener,v as formatAmount,f as generateSsoUrl,c as getBackendUrl,g as getClientId,A as getCurrencyAmountKey,M as getSupportedCurrency,w as getSupportedLocale,b as isChromiumAndroid,O as isFrakDeepLink,d as isV1Context,m as isV2Context,y as locales,s as resolveMerchantId,j as setupClient,r as ssoPopupFeatures,i as ssoPopupName,T as toAndroidIntentUrl,h as trackEvent,S as triggerDeepLinkWithFallback};
1
+ import{_ as e,a as t,c as n,f as r,g as i,h as a,i as o,l as s,m as c,n as l,o as u,p as d,r as f,s as p,t as m,u as h,v as g,y as _}from"./trackEvent-Ce1XlsIE.js";import{_ as v,a as y,c as b,d as x,f as S,g as C,h as w,i as T,l as E,m as D,n as O,o as k,p as A,r as j,s as M,t as N,u as P,v as F,y as I}from"./setupClient-jYx-fbxB.js";export{I as DEEP_LINK_SCHEME,j as DebugInfoGatherer,f as FrakContextManager,i as base64urlDecode,e as base64urlEncode,M as baseIframeProps,p as clearAllCache,a as compressJsonToB64,g as computeLegacyProductId,O as createIFrameFrakClient,b as createIframe,u as decompressJsonFromB64,E as findIframeInOpener,x as formatAmount,c as generateSsoUrl,h as getBackendUrl,n as getCache,_ as getClientId,P as getCurrencyAmountKey,A as getSupportedCurrency,S as getSupportedLocale,w as isChromiumAndroid,C as isFrakDeepLink,T as isIOS,y as isInAppBrowser,o as isV1Context,t as isV2Context,D as locales,k as redirectToExternalBrowser,l as sdkConfigStore,N as setupClient,r as ssoPopupFeatures,d as ssoPopupName,v as toAndroidIntentUrl,m as trackEvent,F as triggerDeepLinkWithFallback,s as withCache};