@frak-labs/core-sdk 0.2.0 → 0.2.1-beta.06c52c98

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 (67) 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 +2 -2
  5. package/dist/actions.d.ts +2 -2
  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-Raks6FXg.d.cts → computeLegacyProductId-BP-ciVsp.d.cts} +73 -88
  12. package/dist/{computeLegacyProductId-BkyJ4rEY.d.ts → computeLegacyProductId-DiJd7RNo.d.ts} +73 -88
  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-BCJGchIb.d.cts → openSso-B8v3Vtnh.d.ts} +157 -52
  18. package/dist/{openSso-DG-_9CED.d.ts → openSso-n_B4LSuW.d.cts} +157 -52
  19. package/dist/setupClient-Dr_UYfTD.cjs +13 -0
  20. package/dist/setupClient-TuhDjVJx.js +13 -0
  21. package/dist/siweAuthenticate-0UPcUqI1.js +1 -0
  22. package/dist/{siweAuthenticate-Btem4QHs.d.ts → siweAuthenticate-CDCsp8EJ.d.ts} +35 -36
  23. package/dist/siweAuthenticate-CfQibjZR.cjs +1 -0
  24. package/dist/{siweAuthenticate-BH7Dn7nZ.d.cts → siweAuthenticate-yITE-iKh.d.cts} +35 -36
  25. package/dist/trackEvent-5j5kkOCj.js +1 -0
  26. package/dist/trackEvent-B2uom25e.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/ensureIdentity.ts +2 -2
  31. package/src/actions/referral/processReferral.test.ts +109 -125
  32. package/src/actions/referral/processReferral.ts +134 -180
  33. package/src/actions/referral/referralInteraction.test.ts +3 -5
  34. package/src/actions/referral/referralInteraction.ts +2 -7
  35. package/src/actions/trackPurchaseStatus.test.ts +32 -20
  36. package/src/actions/trackPurchaseStatus.ts +3 -5
  37. package/src/actions/wrapper/modalBuilder.test.ts +4 -2
  38. package/src/actions/wrapper/modalBuilder.ts +6 -8
  39. package/src/clients/createIFrameFrakClient.ts +146 -25
  40. package/src/clients/transports/iframeLifecycleManager.test.ts +0 -80
  41. package/src/clients/transports/iframeLifecycleManager.ts +0 -44
  42. package/src/index.ts +8 -3
  43. package/src/types/config.ts +10 -3
  44. package/src/types/context.ts +48 -6
  45. package/src/types/index.ts +8 -2
  46. package/src/types/lifecycle/client.ts +22 -27
  47. package/src/types/lifecycle/iframe.ts +0 -8
  48. package/src/types/resolvedConfig.ts +104 -0
  49. package/src/types/rpc/interaction.ts +9 -0
  50. package/src/types/rpc.ts +7 -5
  51. package/src/types/tracking.ts +5 -34
  52. package/src/utils/FrakContext.test.ts +270 -186
  53. package/src/utils/FrakContext.ts +78 -56
  54. package/src/utils/backendUrl.test.ts +2 -2
  55. package/src/utils/backendUrl.ts +1 -1
  56. package/src/utils/index.ts +1 -5
  57. package/src/utils/sdkConfigStore.test.ts +405 -0
  58. package/src/utils/sdkConfigStore.ts +277 -0
  59. package/src/utils/sso.ts +3 -7
  60. package/dist/setupClient-CQrMDGyZ.js +0 -13
  61. package/dist/setupClient-Ccv3XxwL.cjs +0 -13
  62. package/dist/siweAuthenticate-BJHbtty4.js +0 -1
  63. package/dist/siweAuthenticate-Cwj3HP0m.cjs +0 -1
  64. package/dist/trackEvent-M2RLTQ2p.js +0 -1
  65. package/dist/trackEvent-T_R9ER2S.cjs +0 -1
  66. package/src/utils/merchantId.test.ts +0 -653
  67. 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-T_R9ER2S.cjs`),t=require(`./siweAuthenticate-Cwj3HP0m.cjs`);exports.displayEmbeddedWallet=t.p,exports.displayModal=t.f,exports.ensureIdentity=t.d,exports.getMerchantInformation=t.u,exports.modalBuilder=t.r,exports.openSso=e.s,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-B2uom25e.cjs`),t=require(`./siweAuthenticate-CfQibjZR.cjs`);exports.displayEmbeddedWallet=t.p,exports.displayModal=t.f,exports.ensureIdentity=t.d,exports.getMerchantInformation=t.u,exports.modalBuilder=t.r,exports.openSso=e.c,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,3 +1,3 @@
1
- import { t as openSso } from "./openSso-BCJGchIb.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-BH7Dn7nZ.cjs";
1
+ import { t as openSso } from "./openSso-n_B4LSuW.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-yITE-iKh.cjs";
3
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 };
package/dist/actions.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- import { t as openSso } from "./openSso-DG-_9CED.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-Btem4QHs.js";
1
+ import { t as openSso } from "./openSso-B8v3Vtnh.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-CDCsp8EJ.js";
3
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 };
package/dist/actions.js CHANGED
@@ -1 +1 @@
1
- import{s as e}from"./trackEvent-M2RLTQ2p.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-BJHbtty4.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{c as e}from"./trackEvent-5j5kkOCj.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-0UPcUqI1.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};
package/dist/bundle.cjs CHANGED
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./trackEvent-T_R9ER2S.cjs`),t=require(`./setupClient-Ccv3XxwL.cjs`),n=require(`./siweAuthenticate-Cwj3HP0m.cjs`);exports.DEEP_LINK_SCHEME=t.g,exports.DebugInfoGatherer=t.r,exports.FrakContextManager=e.a,exports.base64urlDecode=e.f,exports.base64urlEncode=e.p,exports.baseIframeProps=t.i,exports.clearMerchantIdCache=e.n,exports.compressJsonToB64=e.d,exports.computeLegacyProductId=e.m,exports.createIFrameFrakClient=t.n,exports.createIframe=t.a,exports.decompressJsonFromB64=t._,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.u,exports.getBackendUrl=e.o,exports.getClientId=e.h,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.locales=t.d,exports.modalBuilder=n.r,exports.openSso=e.s,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.c,exports.ssoPopupName=e.l,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-B2uom25e.cjs`),t=require(`./setupClient-Dr_UYfTD.cjs`),n=require(`./siweAuthenticate-CfQibjZR.cjs`);exports.DEEP_LINK_SCHEME=t.g,exports.DebugInfoGatherer=t.r,exports.FrakContextManager=e.r,exports.base64urlDecode=e.p,exports.base64urlEncode=e.m,exports.baseIframeProps=t.i,exports.compressJsonToB64=e.f,exports.computeLegacyProductId=e.h,exports.createIFrameFrakClient=t.n,exports.createIframe=t.a,exports.decompressJsonFromB64=e.o,exports.displayEmbeddedWallet=n.p,exports.displayModal=n.f,exports.ensureIdentity=n.d,exports.findIframeInOpener=t.o,exports.formatAmount=t.c,exports.generateSsoUrl=e.d,exports.getBackendUrl=e.s,exports.getClientId=e.g,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.i,exports.isV2Context=e.a,exports.locales=t.d,exports.modalBuilder=n.r,exports.openSso=e.c,exports.prepareSso=n.l,exports.processReferral=n.s,exports.referralInteraction=n.o,exports.sdkConfigStore=e.n,exports.sendInteraction=n.c,exports.sendTransaction=n.n,exports.setupClient=t.t,exports.siweAuthenticate=n.t,exports.ssoPopupFeatures=e.l,exports.ssoPopupName=e.u,exports.toAndroidIntentUrl=t.m,exports.trackEvent=e.t,exports.trackPurchaseStatus=n.a,exports.triggerDeepLinkWithFallback=t.h,exports.watchWalletStatus=n.i;
package/dist/bundle.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { A as SiweAuthenticateReturnType, B as ModalStepMetadata, C as ModalRpcStepsInput, D as SendTransactionReturnType, E as SendTransactionModalStepType, F as PrepareSsoParamsType, G as FrakWalletSdkConfig, H as IFrameLifecycleEvent, I as PrepareSsoReturnType, J as LocalizedI18nConfig, K as I18nConfig, L as SsoMetadata, M as LoginModalStepType, N as OpenSsoParamsType, O as SendTransactionTxType, P as OpenSsoReturnType, R as FinalActionType, S as ModalRpcMetadata, T as ModalStepTypes, U as ClientLifecycleEvent, V as InteractionTypeKey, W as Currency, _ as LoggedOutEmbeddedView, a as FrakClient, b as LoggedInEmbeddedView, c as IFrameRpcSchema, d as GetMerchantInformationReturnType, f as RewardTier, g as DisplayEmbeddedWalletResultType, h as DisplayEmbeddedWalletParamsType, i as FrakContext, j as SiweAuthenticationParams, k as SiweAuthenticateModalStepType, l as WalletStatusReturnType, m as SendInteractionParamsType, n as ssoPopupFeatures, o as FrakLifecycleEvent, p as TokenAmountType, q as Language, r as ssoPopupName, s as IFrameTransport, t as openSso, u as EstimatedReward, v as EmbeddedViewActionReferred, w as ModalRpcStepsResultType, x as DisplayModalParamsType, y as EmbeddedViewActionSharing, z as FinalModalStepType } from "./openSso-BCJGchIb.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-Raks6FXg.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-BH7Dn7nZ.cjs";
4
- export { AppSpecificSsoMetadata, ClientLifecycleEvent, CompressedData, CompressedSsoData, Currency, DEEP_LINK_SCHEME, DebugInfoGatherer, DeepLinkFallbackOptions, DisplayEmbeddedWalletParamsType, DisplayEmbeddedWalletResultType, DisplayModalParamsType, EmbeddedViewActionReferred, EmbeddedViewActionSharing, EstimatedReward, FinalActionType, FinalModalStepType, FrakClient, FrakContext, FrakContextManager, 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, locales, modalBuilder, openSso, prepareSso, processReferral, referralInteraction, resolveMerchantId, sendInteraction, sendTransaction, setupClient, siweAuthenticate, ssoPopupFeatures, ssoPopupName, toAndroidIntentUrl, trackEvent, trackPurchaseStatus, triggerDeepLinkWithFallback, watchWalletStatus };
1
+ import { $ as FrakWalletSdkConfig, 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 MerchantConfigResponse, K as IFrameLifecycleEvent, L as OpenSsoParamsType, M as SendTransactionTxType, N as SiweAuthenticateModalStepType, O as ModalRpcStepsResultType, P as SiweAuthenticateReturnType, Q as Currency, R as OpenSsoReturnType, S as EmbeddedViewActionReferred, T as DisplayModalParamsType, U as FinalModalStepType, V as SsoMetadata, W as ModalStepMetadata, X as ResolvedSdkConfig, Y as ResolvedPlacement, Z as SdkResolvedConfig, _ as TokenAmountType, a as FrakContextV1, b as DisplayEmbeddedWalletResultType, c as isV2Context, d as IFrameTransport, et as I18nConfig, 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, nt as LocalizedI18nConfig, o as FrakContextV2, p as WalletStatusReturnType, q as ClientLifecycleEvent, r as ssoPopupName, s as isV1Context, t as openSso, tt as Language, u as FrakLifecycleEvent, v as SendInteractionParamsType, w as LoggedInEmbeddedView, x as LoggedOutEmbeddedView, y as DisplayEmbeddedWalletParamsType, z as PrepareSsoParamsType } from "./openSso-n_B4LSuW.cjs";
2
+ import { A as locales, C as decompressJsonFromB64, D as getClientId, E as base64urlEncode, F as TrackArrivalResult, I as UtmParams, L as CompressedData, M as DebugInfoGatherer, N as createIFrameFrakClient, O as getBackendUrl, P as TrackArrivalParams, R as HashProtectedData, S as DEEP_LINK_SCHEME, T as base64urlDecode, _ as DeepLinkFallbackOptions, a as CompressedSsoData, b as toAndroidIntentUrl, c as sdkConfigStore, d as findIframeInOpener, f as getSupportedLocale, g as FrakContextManager, h as formatAmount, i as AppSpecificSsoMetadata, j as setupClient, k as LocalesKey, l as baseIframeProps, m as getCurrencyAmountKey, n as FrakEvent, o as FullSsoParams, p as getSupportedCurrency, r as trackEvent, s as generateSsoUrl, t as computeLegacyProductId, u as createIframe, v as isChromiumAndroid, w as compressJsonToB64, x as triggerDeepLinkWithFallback, y as isFrakDeepLink, z as KeyProvider } from "./computeLegacyProductId-BP-ciVsp.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-yITE-iKh.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, MerchantConfigResponse, ModalBuilder, ModalRpcMetadata, ModalRpcStepsInput, ModalRpcStepsResultType, ModalStepBuilder, ModalStepMetadata, ModalStepTypes, OpenSsoParamsType, OpenSsoReturnType, PrepareSsoParamsType, PrepareSsoReturnType, ProcessReferralOptions, ResolvedPlacement, ResolvedSdkConfig, RewardTier, SdkResolvedConfig, SendInteractionParamsType, SendTransactionModalStepType, SendTransactionParams, SendTransactionReturnType, SendTransactionTxType, SiweAuthenticateModalParams, SiweAuthenticateModalStepType, SiweAuthenticateReturnType, SiweAuthenticationParams, SsoMetadata, TokenAmountType, TrackArrivalParams, TrackArrivalResult, UtmParams, WalletStatusReturnType, base64urlDecode, base64urlEncode, baseIframeProps, compressJsonToB64, computeLegacyProductId, createIFrameFrakClient, createIframe, decompressJsonFromB64, displayEmbeddedWallet, displayModal, ensureIdentity, findIframeInOpener, formatAmount, generateSsoUrl, getBackendUrl, getClientId, getCurrencyAmountKey, getMerchantInformation, getSupportedCurrency, getSupportedLocale, isChromiumAndroid, isFrakDeepLink, isV1Context, isV2Context, locales, modalBuilder, openSso, prepareSso, processReferral, referralInteraction, sdkConfigStore, sendInteraction, sendTransaction, setupClient, siweAuthenticate, ssoPopupFeatures, ssoPopupName, toAndroidIntentUrl, trackEvent, trackPurchaseStatus, triggerDeepLinkWithFallback, watchWalletStatus };
package/dist/bundle.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { A as SiweAuthenticateReturnType, B as ModalStepMetadata, C as ModalRpcStepsInput, D as SendTransactionReturnType, E as SendTransactionModalStepType, F as PrepareSsoParamsType, G as FrakWalletSdkConfig, H as IFrameLifecycleEvent, I as PrepareSsoReturnType, J as LocalizedI18nConfig, K as I18nConfig, L as SsoMetadata, M as LoginModalStepType, N as OpenSsoParamsType, O as SendTransactionTxType, P as OpenSsoReturnType, R as FinalActionType, S as ModalRpcMetadata, T as ModalStepTypes, U as ClientLifecycleEvent, V as InteractionTypeKey, W as Currency, _ as LoggedOutEmbeddedView, a as FrakClient, b as LoggedInEmbeddedView, c as IFrameRpcSchema, d as GetMerchantInformationReturnType, f as RewardTier, g as DisplayEmbeddedWalletResultType, h as DisplayEmbeddedWalletParamsType, i as FrakContext, j as SiweAuthenticationParams, k as SiweAuthenticateModalStepType, l as WalletStatusReturnType, m as SendInteractionParamsType, n as ssoPopupFeatures, o as FrakLifecycleEvent, p as TokenAmountType, q as Language, r as ssoPopupName, s as IFrameTransport, t as openSso, u as EstimatedReward, v as EmbeddedViewActionReferred, w as ModalRpcStepsResultType, x as DisplayModalParamsType, y as EmbeddedViewActionSharing, z as FinalModalStepType } from "./openSso-DG-_9CED.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-BkyJ4rEY.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-Btem4QHs.js";
4
- export { AppSpecificSsoMetadata, ClientLifecycleEvent, CompressedData, CompressedSsoData, Currency, DEEP_LINK_SCHEME, DebugInfoGatherer, DeepLinkFallbackOptions, DisplayEmbeddedWalletParamsType, DisplayEmbeddedWalletResultType, DisplayModalParamsType, EmbeddedViewActionReferred, EmbeddedViewActionSharing, EstimatedReward, FinalActionType, FinalModalStepType, FrakClient, FrakContext, FrakContextManager, 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, locales, modalBuilder, openSso, prepareSso, processReferral, referralInteraction, resolveMerchantId, sendInteraction, sendTransaction, setupClient, siweAuthenticate, ssoPopupFeatures, ssoPopupName, toAndroidIntentUrl, trackEvent, trackPurchaseStatus, triggerDeepLinkWithFallback, watchWalletStatus };
1
+ import { $ as FrakWalletSdkConfig, 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 MerchantConfigResponse, K as IFrameLifecycleEvent, L as OpenSsoParamsType, M as SendTransactionTxType, N as SiweAuthenticateModalStepType, O as ModalRpcStepsResultType, P as SiweAuthenticateReturnType, Q as Currency, R as OpenSsoReturnType, S as EmbeddedViewActionReferred, T as DisplayModalParamsType, U as FinalModalStepType, V as SsoMetadata, W as ModalStepMetadata, X as ResolvedSdkConfig, Y as ResolvedPlacement, Z as SdkResolvedConfig, _ as TokenAmountType, a as FrakContextV1, b as DisplayEmbeddedWalletResultType, c as isV2Context, d as IFrameTransport, et as I18nConfig, 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, nt as LocalizedI18nConfig, o as FrakContextV2, p as WalletStatusReturnType, q as ClientLifecycleEvent, r as ssoPopupName, s as isV1Context, t as openSso, tt as Language, u as FrakLifecycleEvent, v as SendInteractionParamsType, w as LoggedInEmbeddedView, x as LoggedOutEmbeddedView, y as DisplayEmbeddedWalletParamsType, z as PrepareSsoParamsType } from "./openSso-B8v3Vtnh.js";
2
+ import { A as locales, C as decompressJsonFromB64, D as getClientId, E as base64urlEncode, F as TrackArrivalResult, I as UtmParams, L as CompressedData, M as DebugInfoGatherer, N as createIFrameFrakClient, O as getBackendUrl, P as TrackArrivalParams, R as HashProtectedData, S as DEEP_LINK_SCHEME, T as base64urlDecode, _ as DeepLinkFallbackOptions, a as CompressedSsoData, b as toAndroidIntentUrl, c as sdkConfigStore, d as findIframeInOpener, f as getSupportedLocale, g as FrakContextManager, h as formatAmount, i as AppSpecificSsoMetadata, j as setupClient, k as LocalesKey, l as baseIframeProps, m as getCurrencyAmountKey, n as FrakEvent, o as FullSsoParams, p as getSupportedCurrency, r as trackEvent, s as generateSsoUrl, t as computeLegacyProductId, u as createIframe, v as isChromiumAndroid, w as compressJsonToB64, x as triggerDeepLinkWithFallback, y as isFrakDeepLink, z as KeyProvider } from "./computeLegacyProductId-DiJd7RNo.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-CDCsp8EJ.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, MerchantConfigResponse, ModalBuilder, ModalRpcMetadata, ModalRpcStepsInput, ModalRpcStepsResultType, ModalStepBuilder, ModalStepMetadata, ModalStepTypes, OpenSsoParamsType, OpenSsoReturnType, PrepareSsoParamsType, PrepareSsoReturnType, ProcessReferralOptions, ResolvedPlacement, ResolvedSdkConfig, RewardTier, SdkResolvedConfig, SendInteractionParamsType, SendTransactionModalStepType, SendTransactionParams, SendTransactionReturnType, SendTransactionTxType, SiweAuthenticateModalParams, SiweAuthenticateModalStepType, SiweAuthenticateReturnType, SiweAuthenticationParams, SsoMetadata, TokenAmountType, TrackArrivalParams, TrackArrivalResult, UtmParams, WalletStatusReturnType, base64urlDecode, base64urlEncode, baseIframeProps, compressJsonToB64, computeLegacyProductId, createIFrameFrakClient, createIframe, decompressJsonFromB64, displayEmbeddedWallet, displayModal, ensureIdentity, findIframeInOpener, formatAmount, generateSsoUrl, getBackendUrl, getClientId, getCurrencyAmountKey, getMerchantInformation, getSupportedCurrency, getSupportedLocale, isChromiumAndroid, isFrakDeepLink, isV1Context, isV2Context, locales, modalBuilder, openSso, prepareSso, processReferral, referralInteraction, sdkConfigStore, sendInteraction, sendTransaction, setupClient, siweAuthenticate, ssoPopupFeatures, ssoPopupName, toAndroidIntentUrl, trackEvent, trackPurchaseStatus, triggerDeepLinkWithFallback, watchWalletStatus };
package/dist/bundle.js CHANGED
@@ -1 +1 @@
1
- import{a as e,c as t,d as n,f as r,h as i,i as a,l as o,m as s,n as c,o as l,p as u,r as d,s as f,t as p,u as m}from"./trackEvent-M2RLTQ2p.js";import{_ as h,a as g,c as _,d as v,f as y,g as b,h as x,i as S,l as C,m as w,n as T,o as E,p as D,r as O,s as k,t as A,u as j}from"./setupClient-CQrMDGyZ.js";import{a as M,c as N,d as P,f as F,i as I,l as L,n as R,o as z,p as B,r as V,s as H,t as U,u as W}from"./siweAuthenticate-BJHbtty4.js";export{b as DEEP_LINK_SCHEME,O as DebugInfoGatherer,e as FrakContextManager,r as base64urlDecode,u as base64urlEncode,S as baseIframeProps,c as clearMerchantIdCache,n as compressJsonToB64,s as computeLegacyProductId,T as createIFrameFrakClient,g as createIframe,h as decompressJsonFromB64,B as displayEmbeddedWallet,F as displayModal,P as ensureIdentity,d as fetchMerchantId,E as findIframeInOpener,_ as formatAmount,m as generateSsoUrl,l as getBackendUrl,i as getClientId,k as getCurrencyAmountKey,W as getMerchantInformation,j as getSupportedCurrency,C as getSupportedLocale,y as isChromiumAndroid,D as isFrakDeepLink,v as locales,V as modalBuilder,f as openSso,L as prepareSso,H as processReferral,z as referralInteraction,a as resolveMerchantId,N as sendInteraction,R as sendTransaction,A as setupClient,U as siweAuthenticate,t as ssoPopupFeatures,o as ssoPopupName,w as toAndroidIntentUrl,p as trackEvent,M as trackPurchaseStatus,x as triggerDeepLinkWithFallback,I as watchWalletStatus};
1
+ import{a as e,c as t,d 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}from"./trackEvent-5j5kkOCj.js";import{a as g,c as _,d as v,f as y,g as b,h as x,i as S,l as C,m as w,n as T,o as E,p as D,r as O,s as k,t as A,u as j}from"./setupClient-TuhDjVJx.js";import{a as M,c as N,d as P,f as F,i as I,l as L,n as R,o as z,p as B,r as V,s as H,t as U,u as W}from"./siweAuthenticate-0UPcUqI1.js";export{b as DEEP_LINK_SCHEME,O as DebugInfoGatherer,f as FrakContextManager,d as base64urlDecode,c as base64urlEncode,S as baseIframeProps,r as compressJsonToB64,a as computeLegacyProductId,T as createIFrameFrakClient,g as createIframe,u as decompressJsonFromB64,B as displayEmbeddedWallet,F as displayModal,P as ensureIdentity,E as findIframeInOpener,_ as formatAmount,n as generateSsoUrl,p as getBackendUrl,i as getClientId,k as getCurrencyAmountKey,W as getMerchantInformation,j as getSupportedCurrency,C as getSupportedLocale,y as isChromiumAndroid,D as isFrakDeepLink,o as isV1Context,e as isV2Context,v as locales,V as modalBuilder,t as openSso,L as prepareSso,H as processReferral,z as referralInteraction,l as sdkConfigStore,N as sendInteraction,R as sendTransaction,A as setupClient,U as siweAuthenticate,s as ssoPopupFeatures,h as ssoPopupName,w as toAndroidIntentUrl,m as trackEvent,M as trackPurchaseStatus,x as triggerDeepLinkWithFallback,I as watchWalletStatus};
@@ -1,4 +1,4 @@
1
- import { F as PrepareSsoParamsType, G as FrakWalletSdkConfig, L as SsoMetadata, W as Currency, a as FrakClient, i as FrakContext, p as TokenAmountType } from "./openSso-BCJGchIb.cjs";
1
+ import { $ as FrakWalletSdkConfig, J as MerchantConfigResponse, Q as Currency, V as SsoMetadata, Z as SdkResolvedConfig, _ as TokenAmountType, a as FrakContextV1, i as FrakContext, l as FrakClient, o as FrakContextV2, tt as Language, z as PrepareSsoParamsType } from "./openSso-n_B4LSuW.cjs";
2
2
  import { RpcMessage, RpcResponse } from "@frak-labs/frame-connector";
3
3
  import { Address, Hex } from "viem";
4
4
 
@@ -23,10 +23,6 @@ type HashProtectedData<DataType> = Readonly<DataType & {
23
23
  type KeyProvider<DataType> = (value: DataType) => string[];
24
24
  //#endregion
25
25
  //#region src/types/tracking.d.ts
26
- /**
27
- * UTM parameters for marketing attribution
28
- * @category Tracking
29
- */
30
26
  type UtmParams = {
31
27
  source?: string;
32
28
  medium?: string;
@@ -34,28 +30,14 @@ type UtmParams = {
34
30
  term?: string;
35
31
  content?: string;
36
32
  };
37
- /**
38
- * Parameters for tracking an arrival event
39
- * @category Tracking
40
- */
41
33
  type TrackArrivalParams = {
42
- /**
43
- * The referrer wallet address (from fCtx URL param)
44
- */
45
- referrerWallet?: Address;
46
- /**
47
- * The landing page URL (defaults to current page)
48
- */
34
+ /** @deprecated V1 legacy — use referrerClientId for v2 contexts */referrerWallet?: Address;
35
+ referrerClientId?: string;
36
+ referrerMerchantId?: string; /** Epoch seconds timestamp from the referral link creation */
37
+ referralTimestamp?: number;
49
38
  landingUrl?: string;
50
- /**
51
- * UTM parameters for marketing attribution
52
- */
53
39
  utmParams?: UtmParams;
54
40
  };
55
- /**
56
- * Result from tracking an arrival event
57
- * @category Tracking
58
- */
59
41
  type TrackArrivalResult = {
60
42
  success: boolean;
61
43
  identityGroupId?: string;
@@ -68,7 +50,7 @@ type TrackArrivalResult = {
68
50
  * Create a new iframe Frak client
69
51
  * @param args
70
52
  * @param args.config - The configuration to use for the Frak Wallet SDK.
71
- * 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).
72
54
  * @param args.iframe - The iframe to use for the communication
73
55
  * @returns The created Frak Client
74
56
  *
@@ -261,22 +243,30 @@ declare function isFrakDeepLink(url: string): boolean;
261
243
  //#endregion
262
244
  //#region src/utils/FrakContext.d.ts
263
245
  /**
264
- * Compress the current Frak context
265
- * @param context - The context to be compressed
266
- * @returns A compressed string containing the Frak context
246
+ * Compress a Frak context into a URL-safe string.
247
+ *
248
+ * - V2 contexts are serialized as compressed JSON (base64url).
249
+ * - V1 contexts encode the wallet address as raw bytes (base64url).
250
+ *
251
+ * @param context - The context to compress (V1 or V2)
252
+ * @returns A compressed base64url string, or undefined on failure
267
253
  */
268
- declare function compress(context?: Partial<FrakContext>): string | undefined;
254
+ declare function compress(context?: FrakContextV1 | FrakContextV2): string | undefined;
269
255
  /**
270
- * Decompress the given Frak context
271
- * @param context - The raw context to be decompressed into a `FrakContext`
272
- * @returns The decompressed Frak context, or undefined if it fails
256
+ * Decompress a base64url string back into a Frak context.
257
+ *
258
+ * Attempts V2 JSON decompression first, then falls back to V1 raw bytes.
259
+ *
260
+ * @param context - The compressed context string
261
+ * @returns The decompressed FrakContext, or undefined on failure
273
262
  */
274
263
  declare function decompress(context?: string): FrakContext | undefined;
275
264
  /**
276
- * Parse the current URL into a Frak Context
265
+ * Parse a URL to extract the Frak referral context from the `fCtx` query parameter.
266
+ *
277
267
  * @param args
278
- * @param args.url - The url to parse
279
- * @returns The parsed Frak context
268
+ * @param args.url - The URL to parse
269
+ * @returns The parsed FrakContext, or null if absent
280
270
  */
281
271
  declare function parse({
282
272
  url
@@ -284,40 +274,49 @@ declare function parse({
284
274
  url: string;
285
275
  }): FrakContext | null | undefined;
286
276
  /**
287
- * Populate the current url with the given Frak context
277
+ * Add or replace the `fCtx` query parameter in a URL with the given context.
278
+ *
288
279
  * @param args
289
- * @param args.url - The url to update
290
- * @param args.context - The context to update
291
- * @returns The new url with the Frak context
280
+ * @param args.url - The URL to update
281
+ * @param args.context - The context to embed (V1 or V2)
282
+ * @returns The updated URL string, or null on failure
292
283
  */
293
284
  declare function update({
294
285
  url,
295
286
  context
296
287
  }: {
297
288
  url?: string;
298
- context: Partial<FrakContext>;
289
+ context: FrakContextV1 | FrakContextV2;
299
290
  }): string | null;
300
291
  /**
301
- * Remove Frak context from current url
302
- * @param url - The url to update
303
- * @returns The new url without the Frak context
292
+ * Remove the `fCtx` query parameter from a URL.
293
+ *
294
+ * @param url - The URL to strip the context from
295
+ * @returns The cleaned URL string
304
296
  */
305
297
  declare function remove(url: string): string;
306
298
  /**
307
- * Replace the current url with the given Frak context
299
+ * Replace the current browser URL with an updated Frak context.
300
+ *
301
+ * - If `context` is non-null, embeds it via {@link update}.
302
+ * - If `context` is null, strips the context via {@link remove}.
303
+ *
308
304
  * @param args
309
- * @param args.url - The url to update
310
- * @param args.context - The context to update
305
+ * @param args.url - Base URL (defaults to `window.location.href`)
306
+ * @param args.context - Context to set, or null to remove
311
307
  */
312
308
  declare function replaceUrl({
313
309
  url: baseUrl,
314
310
  context
315
311
  }: {
316
312
  url?: string;
317
- context: Partial<FrakContext> | null;
313
+ context: FrakContextV1 | FrakContextV2 | null;
318
314
  }): void;
319
315
  /**
320
- * Export our frak context
316
+ * Manager for Frak referral context in URLs.
317
+ *
318
+ * Handles compression, decompression, URL parsing, and browser history updates
319
+ * for both V1 (wallet address) and V2 (anonymous clientId) referral contexts.
321
320
  */
322
321
  declare const FrakContextManager: {
323
322
  compress: typeof compress;
@@ -416,47 +415,33 @@ declare function createIframe({
416
415
  */
417
416
  declare function findIframeInOpener(pathname?: string): Window | null;
418
417
  //#endregion
419
- //#region src/utils/merchantId.d.ts
420
- /**
421
- * Merchant ID utilities for auto-fetching from backend
422
- */
423
- /**
424
- * Fetch merchantId from backend by domain
425
- *
426
- * @param domain - The domain to lookup (defaults to current hostname)
427
- * @param walletUrl - Optional wallet URL to derive backend URL
428
- * @returns The merchantId if found, undefined otherwise
429
- *
430
- * @example
431
- * ```ts
432
- * const merchantId = await fetchMerchantId("shop.example.com");
433
- * if (merchantId) {
434
- * // Use merchantId for tracking
435
- * }
436
- * ```
437
- */
438
- declare function fetchMerchantId(domain?: string, walletUrl?: string): Promise<string | undefined>;
439
- /**
440
- * Clear the cached merchantId
441
- * Useful for testing or when switching domains
442
- */
443
- declare function clearMerchantIdCache(): void;
444
- /**
445
- * Get merchantId from config or auto-fetch from backend
446
- *
447
- * @param config - The SDK config that may contain merchantId
448
- * @param walletUrl - Optional wallet URL to derive backend URL
449
- * @returns The merchantId if available (from config or fetch), undefined otherwise
450
- */
451
- declare function resolveMerchantId(config: {
452
- metadata?: {
453
- merchantId?: string;
454
- };
455
- }, walletUrl?: string): Promise<string | undefined>;
418
+ //#region src/utils/sdkConfigStore.d.ts
419
+ declare const GLOBAL_KEY = "__frakSdkConfig";
420
+ declare global {
421
+ interface Window {
422
+ [GLOBAL_KEY]?: SdkResolvedConfig;
423
+ }
424
+ interface WindowEventMap {
425
+ "frak:config": CustomEvent<SdkResolvedConfig>;
426
+ }
427
+ }
428
+ declare function getConfig(): SdkResolvedConfig;
429
+ declare const sdkConfigStore: {
430
+ getConfig: typeof getConfig;
431
+ readonly isResolved: boolean;
432
+ readonly isCacheFresh: boolean;
433
+ setCacheScope(domain: string, lang?: string): void;
434
+ setConfig(config: SdkResolvedConfig): void;
435
+ reset(): void;
436
+ clearCache(): void;
437
+ resolve(domain?: string, walletUrl?: string, lang?: Language): Promise<MerchantConfigResponse | undefined>;
438
+ getMerchantId(): string | undefined;
439
+ resolveMerchantId(domain?: string, walletUrl?: string): Promise<string | undefined>;
440
+ };
456
441
  //#endregion
457
442
  //#region src/utils/sso.d.ts
458
443
  type AppSpecificSsoMetadata = SsoMetadata & {
459
- name: string;
444
+ name?: string;
460
445
  css?: string;
461
446
  };
462
447
  /**
@@ -490,7 +475,7 @@ type FullSsoParams = Omit<PrepareSsoParamsType, "metadata"> & {
490
475
  * // Returns: https://wallet.frak.id/sso?p=<compressed_base64>
491
476
  * ```
492
477
  */
493
- declare function generateSsoUrl(walletUrl: string, params: PrepareSsoParamsType, merchantId: string, name: string, clientId: string, css?: string): string;
478
+ declare function generateSsoUrl(walletUrl: string, params: PrepareSsoParamsType, merchantId: string, name: string | undefined, clientId: string, css?: string): string;
494
479
  /**
495
480
  * Type of compressed the sso data
496
481
  */
@@ -502,7 +487,7 @@ type CompressedSsoData = {
502
487
  l?: "en" | "fr";
503
488
  m: string;
504
489
  md: {
505
- n: string;
490
+ n?: string;
506
491
  css?: string;
507
492
  l?: string;
508
493
  h?: string;
@@ -535,4 +520,4 @@ declare function computeLegacyProductId({
535
520
  domain?: string;
536
521
  }): `0x${string}`;
537
522
  //#endregion
538
- 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 };
523
+ export { locales as A, decompressJsonFromB64 as C, getClientId as D, base64urlEncode as E, TrackArrivalResult as F, UtmParams as I, CompressedData as L, DebugInfoGatherer as M, createIFrameFrakClient as N, getBackendUrl as O, TrackArrivalParams as P, HashProtectedData as R, DEEP_LINK_SCHEME as S, base64urlDecode as T, DeepLinkFallbackOptions as _, CompressedSsoData as a, toAndroidIntentUrl as b, sdkConfigStore as c, findIframeInOpener as d, getSupportedLocale as f, FrakContextManager as g, formatAmount as h, AppSpecificSsoMetadata as i, setupClient as j, LocalesKey as k, baseIframeProps as l, getCurrencyAmountKey as m, FrakEvent as n, FullSsoParams as o, getSupportedCurrency as p, trackEvent as r, generateSsoUrl as s, computeLegacyProductId as t, createIframe as u, isChromiumAndroid as v, compressJsonToB64 as w, triggerDeepLinkWithFallback as x, isFrakDeepLink as y, KeyProvider as z };