@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.
- package/README.md +1 -2
- package/cdn/bundle.js +55 -3
- package/dist/actions.cjs +1 -1
- package/dist/actions.d.cts +2 -2
- package/dist/actions.d.ts +2 -2
- package/dist/actions.js +1 -1
- package/dist/bundle.cjs +1 -1
- package/dist/bundle.d.cts +4 -4
- package/dist/bundle.d.ts +4 -4
- package/dist/bundle.js +1 -1
- package/dist/{computeLegacyProductId-Raks6FXg.d.cts → computeLegacyProductId-BP-ciVsp.d.cts} +73 -88
- package/dist/{computeLegacyProductId-BkyJ4rEY.d.ts → computeLegacyProductId-DiJd7RNo.d.ts} +73 -88
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +1 -1
- package/dist/{openSso-BCJGchIb.d.cts → openSso-B8v3Vtnh.d.ts} +157 -52
- package/dist/{openSso-DG-_9CED.d.ts → openSso-n_B4LSuW.d.cts} +157 -52
- package/dist/setupClient-Dr_UYfTD.cjs +13 -0
- package/dist/setupClient-TuhDjVJx.js +13 -0
- package/dist/siweAuthenticate-0UPcUqI1.js +1 -0
- package/dist/{siweAuthenticate-Btem4QHs.d.ts → siweAuthenticate-CDCsp8EJ.d.ts} +35 -36
- package/dist/siweAuthenticate-CfQibjZR.cjs +1 -0
- package/dist/{siweAuthenticate-BH7Dn7nZ.d.cts → siweAuthenticate-yITE-iKh.d.cts} +35 -36
- package/dist/trackEvent-5j5kkOCj.js +1 -0
- package/dist/trackEvent-B2uom25e.cjs +1 -0
- package/package.json +8 -8
- package/src/actions/displayEmbeddedWallet.ts +6 -2
- package/src/actions/displayModal.ts +6 -2
- package/src/actions/ensureIdentity.ts +2 -2
- package/src/actions/referral/processReferral.test.ts +109 -125
- package/src/actions/referral/processReferral.ts +134 -180
- package/src/actions/referral/referralInteraction.test.ts +3 -5
- package/src/actions/referral/referralInteraction.ts +2 -7
- package/src/actions/trackPurchaseStatus.test.ts +32 -20
- package/src/actions/trackPurchaseStatus.ts +3 -5
- package/src/actions/wrapper/modalBuilder.test.ts +4 -2
- package/src/actions/wrapper/modalBuilder.ts +6 -8
- package/src/clients/createIFrameFrakClient.ts +146 -25
- package/src/clients/transports/iframeLifecycleManager.test.ts +0 -80
- package/src/clients/transports/iframeLifecycleManager.ts +0 -44
- package/src/index.ts +8 -3
- package/src/types/config.ts +10 -3
- package/src/types/context.ts +48 -6
- package/src/types/index.ts +8 -2
- package/src/types/lifecycle/client.ts +22 -27
- package/src/types/lifecycle/iframe.ts +0 -8
- package/src/types/resolvedConfig.ts +104 -0
- package/src/types/rpc/interaction.ts +9 -0
- package/src/types/rpc.ts +7 -5
- package/src/types/tracking.ts +5 -34
- package/src/utils/FrakContext.test.ts +270 -186
- package/src/utils/FrakContext.ts +78 -56
- package/src/utils/backendUrl.test.ts +2 -2
- package/src/utils/backendUrl.ts +1 -1
- package/src/utils/index.ts +1 -5
- package/src/utils/sdkConfigStore.test.ts +405 -0
- package/src/utils/sdkConfigStore.ts +277 -0
- package/src/utils/sso.ts +3 -7
- package/dist/setupClient-CQrMDGyZ.js +0 -13
- package/dist/setupClient-Ccv3XxwL.cjs +0 -13
- package/dist/siweAuthenticate-BJHbtty4.js +0 -1
- package/dist/siweAuthenticate-Cwj3HP0m.cjs +0 -1
- package/dist/trackEvent-M2RLTQ2p.js +0 -1
- package/dist/trackEvent-T_R9ER2S.cjs +0 -1
- package/src/utils/merchantId.test.ts +0 -653
- 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-
|
|
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;
|
package/dist/actions.d.cts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { t as openSso } from "./openSso-
|
|
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-
|
|
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-
|
|
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-
|
|
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{
|
|
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-
|
|
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
|
|
2
|
-
import { A as
|
|
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-
|
|
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,
|
|
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
|
|
2
|
-
import { A as
|
|
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-
|
|
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,
|
|
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,
|
|
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};
|
package/dist/{computeLegacyProductId-Raks6FXg.d.cts → computeLegacyProductId-BP-ciVsp.d.cts}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
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
|
-
|
|
44
|
-
|
|
45
|
-
|
|
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
|
|
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
|
|
265
|
-
*
|
|
266
|
-
*
|
|
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?:
|
|
254
|
+
declare function compress(context?: FrakContextV1 | FrakContextV2): string | undefined;
|
|
269
255
|
/**
|
|
270
|
-
* Decompress
|
|
271
|
-
*
|
|
272
|
-
*
|
|
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
|
|
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
|
|
279
|
-
* @returns The parsed
|
|
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
|
-
*
|
|
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
|
|
290
|
-
* @param args.context - The context to
|
|
291
|
-
* @returns The
|
|
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:
|
|
289
|
+
context: FrakContextV1 | FrakContextV2;
|
|
299
290
|
}): string | null;
|
|
300
291
|
/**
|
|
301
|
-
* Remove
|
|
302
|
-
*
|
|
303
|
-
* @
|
|
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
|
|
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 -
|
|
310
|
-
* @param args.context -
|
|
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:
|
|
313
|
+
context: FrakContextV1 | FrakContextV2 | null;
|
|
318
314
|
}): void;
|
|
319
315
|
/**
|
|
320
|
-
*
|
|
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/
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
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
|
|
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
|
|
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 {
|
|
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 };
|