@frak-labs/core-sdk 0.1.1-beta.d13d0e5d → 0.1.1-beta.d96bc28d

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/cdn/bundle.js CHANGED
@@ -11,4 +11,4 @@ var FrakSDK=(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:`Modu
11
11
  Last Response: ${t.lastResponse}
12
12
  Client Status: ${t.clientStatus}
13
13
  Error: ${t.error}
14
- `.trim()}};function Et(e){e?localStorage.setItem(U,e):localStorage.removeItem(U)}function Dt(e,t,n){let r=new URL(window.location.href),i=r.searchParams.get(`fmt`)??void 0;e.contentWindow?.postMessage({clientLifecycle:`handshake-response`,data:{token:t,currentUrl:window.location.href,clientId:F(),pendingMergeToken:i}},n),i&&(r.searchParams.delete(`fmt`),window.history.replaceState({},``,r.toString()))}function Ot(e,t){try{let n=new URL(e);return n.searchParams.has(`u`)?(n.searchParams.delete(`u`),n.searchParams.append(`u`,window.location.href),t&&n.searchParams.append(`fmt`,t),n.toString()):e}catch{return e}}function kt(e,t,n,r){let i=Ot(t,r);W(t)?We(i,{onFallback:()=>{e.contentWindow?.postMessage({clientLifecycle:`deep-link-failed`,data:{originalUrl:i}},n)}}):window.location.href=i}function At({iframe:e,targetOrigin:t}){let n=new R;return{handleEvent:async r=>{if(!(`iframeLifecycle`in r))return;let{iframeLifecycle:i,data:a}=r;switch(i){case`connected`:n.resolve(!0);break;case`do-backup`:Et(a.backup);break;case`remove-backup`:localStorage.removeItem(U);break;case`show`:case`hide`:tt({iframe:e,isVisible:i===`show`});break;case`handshake`:Dt(e,a.token,t);break;case`redirect`:kt(e,a.baseRedirectUrl,t,a.mergeToken);break}},isConnected:n.promise}}function jt({config:e,iframe:t}){let n=e?.walletUrl??`https://wallet.frak.id`,r=At({iframe:t,targetOrigin:n}),i=new Tt(e,t);if(!t.contentWindow)throw new L(I.configError,`The iframe does not have a content window`);let a=Oe({emittingTransport:t.contentWindow,listeningTransport:window,targetOrigin:n,middleware:[{async onRequest(e,t){if(!await r.isConnected)throw new L(I.clientNotConnected,`The iframe provider isn't connected yet`);return t}},{onRequest(e,t){return i.setLastRequest(e),t},onResponse(e,t){return i.setLastResponse(e,t),t}}],lifecycleHandlers:{iframeLifecycle:async(e,t)=>{await r.handleEvent(e)}}}),o=Mt(a,r),s=async()=>{o(),a.cleanup(),t.remove()},c;console.log(`[Frak SDK] Initializing OpenPanel`),c=new Ct({apiUrl:`https://op-api.gcp.frak.id`,clientId:`6eacc8d7-49ac-4936-95e9-81ef29449570`,trackScreenViews:!0,trackOutgoingLinks:!0,trackAttributes:!1,filter:({type:e,payload:t})=>(e!==`track`||!t?.properties||`sdkVersion`in t.properties||(t.properties={...t.properties,sdkVersion:`0.1.1`}),!0)}),c.setGlobalProperties({sdkVersion:`0.1.1`}),c.init();let l=Nt({config:e,rpcClient:a,lifecycleManager:r}).then(()=>i.updateSetupStatus(!0));return{config:e,debugInfo:i,waitForConnection:r.isConnected,waitForSetup:l,request:a.request,listenerRequest:a.listen,destroy:s,openPanel:c}}function Mt(e,t){let n,r,i=()=>e.sendLifecycle({clientLifecycle:`heartbeat`});async function a(){i(),n=setInterval(i,1e3),r=setTimeout(()=>{o(),console.log(`Heartbeat timeout: connection failed`)},3e4),await t.isConnected,o()}function o(){n&&clearInterval(n),r&&clearTimeout(r)}return a(),o}async function Nt({config:e,rpcClient:t,lifecycleManager:n}){await n.isConnected,wt(t,n.isConnected);async function r(){let n=e.customizations?.css;if(!n)return;let r={clientLifecycle:`modal-css`,data:{cssLink:n}};t.sendLifecycle(r)}async function i(){let n=e.customizations?.i18n;if(!n)return;let r={clientLifecycle:`modal-i18n`,data:{i18n:n}};t.sendLifecycle(r)}async function a(){if(typeof window>`u`)return;let e=window.localStorage.getItem(U);if(!e)return;let n={clientLifecycle:`restore-backup`,data:{backup:e}};t.sendLifecycle(n)}await Promise.allSettled([r(),i(),a()])}async function Pt({config:e}){let t=Ft(e),n=await et({config:t});if(!n){console.error(`Failed to create iframe`);return}let r=jt({config:t,iframe:n});if(await r.waitForSetup,!await r.waitForConnection){console.error(`Failed to connect to client`);return}return r}function Ft(e){let t=J(e.metadata?.currency);return{...e,metadata:{...e.metadata,currency:t}}}return e.DEEP_LINK_SCHEME=Ve,e.DebugInfoGatherer=Tt,e.FrakContextManager=K,e.base64urlDecode=B,e.base64urlEncode=z,e.baseIframeProps=Y,e.clearMerchantIdCache=at,e.compressJsonToB64=V,e.computeLegacyProductId=M,e.createIFrameFrakClient=jt,e.createIframe=et,e.decompressJsonFromB64=Be,e.displayEmbeddedWallet=n,e.displayModal=r,e.fetchMerchantId=rt,e.findIframeInOpener=nt,e.formatAmount=Qe,e.generateSsoUrl=je,e.getBackendUrl=H,e.getClientId=F,e.getCurrencyAmountKey=$e,e.getMerchantInformation=i,e.getSupportedCurrency=J,e.getSupportedLocale=Ze,e.isChromiumAndroid=He,e.isFrakDeepLink=W,e.locales=q,e.modalBuilder=gt,e.openSso=Fe,e.prepareSso=Ie,e.processReferral=ct,e.referralInteraction=ft,e.resolveMerchantId=ot,e.sendInteraction=st,e.sendTransaction=_t,e.setupClient=Pt,e.siweAuthenticate=yt,e.ssoPopupFeatures=Ne,e.ssoPopupName=Pe,e.toAndroidIntentUrl=Ue,e.trackEvent=Q,e.trackPurchaseStatus=pt,e.triggerDeepLinkWithFallback=We,e.watchWalletStatus=mt,e})({});
14
+ `.trim()}};function Et(e){e?localStorage.setItem(U,e):localStorage.removeItem(U)}function Dt(e,t,n,r){let i=new URL(window.location.href),a=i.searchParams.get(`fmt`)??void 0;e.contentWindow?.postMessage({clientLifecycle:`handshake-response`,data:{token:t,currentUrl:window.location.href,clientId:F(),pendingMergeToken:a,configDomain:r}},n),a&&(i.searchParams.delete(`fmt`),window.history.replaceState({},``,i.toString()))}function Ot(e,t){try{let n=new URL(e);return n.searchParams.has(`u`)?(n.searchParams.delete(`u`),n.searchParams.append(`u`,window.location.href),t&&n.searchParams.append(`fmt`,t),n.toString()):e}catch{return e}}function kt(e,t,n,r){let i=Ot(t,r);W(t)?We(i,{onFallback:()=>{e.contentWindow?.postMessage({clientLifecycle:`deep-link-failed`,data:{originalUrl:i}},n)}}):window.location.href=i}function At({iframe:e,targetOrigin:t,configDomain:n}){let r=new R;return{handleEvent:async i=>{if(!(`iframeLifecycle`in i))return;let{iframeLifecycle:a,data:o}=i;switch(a){case`connected`:r.resolve(!0);break;case`do-backup`:Et(o.backup);break;case`remove-backup`:localStorage.removeItem(U);break;case`show`:case`hide`:tt({iframe:e,isVisible:a===`show`});break;case`handshake`:Dt(e,o.token,t,n);break;case`redirect`:kt(e,o.baseRedirectUrl,t,o.mergeToken);break}},isConnected:r.promise}}function jt({config:e,iframe:t}){let n=e?.walletUrl??`https://wallet.frak.id`,r=At({iframe:t,targetOrigin:n,configDomain:e.domain}),i=new Tt(e,t);if(!t.contentWindow)throw new L(I.configError,`The iframe does not have a content window`);let a=Oe({emittingTransport:t.contentWindow,listeningTransport:window,targetOrigin:n,middleware:[{async onRequest(e,t){if(!await r.isConnected)throw new L(I.clientNotConnected,`The iframe provider isn't connected yet`);return t}},{onRequest(e,t){return i.setLastRequest(e),t},onResponse(e,t){return i.setLastResponse(e,t),t}}],lifecycleHandlers:{iframeLifecycle:async(e,t)=>{await r.handleEvent(e)}}}),o=Mt(a,r),s=async()=>{o(),a.cleanup(),t.remove()},c;console.log(`[Frak SDK] Initializing OpenPanel`),c=new Ct({apiUrl:`https://op-api.gcp.frak.id`,clientId:`6eacc8d7-49ac-4936-95e9-81ef29449570`,trackScreenViews:!0,trackOutgoingLinks:!0,trackAttributes:!1,filter:({type:e,payload:t})=>(e!==`track`||!t?.properties||`sdkVersion`in t.properties||(t.properties={...t.properties,sdkVersion:`0.1.1`}),!0)}),c.setGlobalProperties({sdkVersion:`0.1.1`}),c.init();let l=Nt({config:e,rpcClient:a,lifecycleManager:r}).then(()=>i.updateSetupStatus(!0));return{config:e,debugInfo:i,waitForConnection:r.isConnected,waitForSetup:l,request:a.request,listenerRequest:a.listen,destroy:s,openPanel:c}}function Mt(e,t){let n,r,i=()=>e.sendLifecycle({clientLifecycle:`heartbeat`});async function a(){i(),n=setInterval(i,1e3),r=setTimeout(()=>{o(),console.log(`Heartbeat timeout: connection failed`)},3e4),await t.isConnected,o()}function o(){n&&clearInterval(n),r&&clearTimeout(r)}return a(),o}async function Nt({config:e,rpcClient:t,lifecycleManager:n}){await n.isConnected,wt(t,n.isConnected);async function r(){let n=e.customizations?.css;if(!n)return;let r={clientLifecycle:`modal-css`,data:{cssLink:n}};t.sendLifecycle(r)}async function i(){let n=e.customizations?.i18n;if(!n)return;let r={clientLifecycle:`modal-i18n`,data:{i18n:n}};t.sendLifecycle(r)}async function a(){if(typeof window>`u`)return;let e=window.localStorage.getItem(U);if(!e)return;let n={clientLifecycle:`restore-backup`,data:{backup:e}};t.sendLifecycle(n)}await Promise.allSettled([r(),i(),a()])}async function Pt({config:e}){let t=Ft(e),n=await et({config:t});if(!n){console.error(`Failed to create iframe`);return}let r=jt({config:t,iframe:n});if(await r.waitForSetup,!await r.waitForConnection){console.error(`Failed to connect to client`);return}return r}function Ft(e){let t=J(e.metadata?.currency);return{...e,metadata:{...e.metadata,currency:t}}}return e.DEEP_LINK_SCHEME=Ve,e.DebugInfoGatherer=Tt,e.FrakContextManager=K,e.base64urlDecode=B,e.base64urlEncode=z,e.baseIframeProps=Y,e.clearMerchantIdCache=at,e.compressJsonToB64=V,e.computeLegacyProductId=M,e.createIFrameFrakClient=jt,e.createIframe=et,e.decompressJsonFromB64=Be,e.displayEmbeddedWallet=n,e.displayModal=r,e.fetchMerchantId=rt,e.findIframeInOpener=nt,e.formatAmount=Qe,e.generateSsoUrl=je,e.getBackendUrl=H,e.getClientId=F,e.getCurrencyAmountKey=$e,e.getMerchantInformation=i,e.getSupportedCurrency=J,e.getSupportedLocale=Ze,e.isChromiumAndroid=He,e.isFrakDeepLink=W,e.locales=q,e.modalBuilder=gt,e.openSso=Fe,e.prepareSso=Ie,e.processReferral=ct,e.referralInteraction=ft,e.resolveMerchantId=ot,e.sendInteraction=st,e.sendTransaction=_t,e.setupClient=Pt,e.siweAuthenticate=yt,e.ssoPopupFeatures=Ne,e.ssoPopupName=Pe,e.toAndroidIntentUrl=Ue,e.trackEvent=Q,e.trackPurchaseStatus=pt,e.triggerDeepLinkWithFallback=We,e.watchWalletStatus=mt,e})({});
@@ -1,3 +1,3 @@
1
- import { t as openSso } from "./openSso-oAGMkQ4T.cjs";
2
- import { _ as displayEmbeddedWallet, a as ModalBuilder, c as watchWalletStatus, d as referralInteraction, f as ProcessReferralOptions, g as displayModal, 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 } from "./siweAuthenticate-D5lp5sdP.cjs";
1
+ import { t as openSso } from "./openSso-CC1-loUk.cjs";
2
+ import { _ as displayEmbeddedWallet, a as ModalBuilder, c as watchWalletStatus, d as referralInteraction, f as ProcessReferralOptions, g as displayModal, 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 } from "./siweAuthenticate-CR4Dpji6.cjs";
3
3
  export { type ModalBuilder, type ModalStepBuilder, type ProcessReferralOptions, type SendTransactionParams, type SiweAuthenticateModalParams, displayEmbeddedWallet, displayModal, 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-ocIfOlv6.js";
2
- import { _ as displayEmbeddedWallet, a as ModalBuilder, c as watchWalletStatus, d as referralInteraction, f as ProcessReferralOptions, g as displayModal, 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 } from "./siweAuthenticate-DP0y5LIx.js";
1
+ import { t as openSso } from "./openSso-tkqaDQLV.js";
2
+ import { _ as displayEmbeddedWallet, a as ModalBuilder, c as watchWalletStatus, d as referralInteraction, f as ProcessReferralOptions, g as displayModal, 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 } from "./siweAuthenticate-udoruuy9.js";
3
3
  export { type ModalBuilder, type ModalStepBuilder, type ProcessReferralOptions, type SendTransactionParams, type SiweAuthenticateModalParams, displayEmbeddedWallet, displayModal, getMerchantInformation, modalBuilder, openSso, prepareSso, processReferral, referralInteraction, sendInteraction, sendTransaction, siweAuthenticate, trackPurchaseStatus, watchWalletStatus };
package/dist/bundle.cjs CHANGED
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./trackEvent-CGIryq5h.cjs`),t=require(`./setupClient-CudGNb4Q.cjs`),n=require(`./siweAuthenticate-B_Z2OZmj.cjs`);exports.DEEP_LINK_SCHEME=t.b,exports.DebugInfoGatherer=t.y,exports.FrakContextManager=e.n,exports.base64urlDecode=e.l,exports.base64urlEncode=e.u,exports.baseIframeProps=t.f,exports.clearMerchantIdCache=t.n,exports.compressJsonToB64=e.c,exports.computeLegacyProductId=e.f,exports.createIFrameFrakClient=t.d,exports.createIframe=t.p,exports.decompressJsonFromB64=t.u,exports.displayEmbeddedWallet=n.f,exports.displayModal=n.d,exports.fetchMerchantId=t.r,exports.findIframeInOpener=t.m,exports.formatAmount=t.o,exports.generateSsoUrl=e.s,exports.getBackendUrl=e.r,exports.getClientId=e.d,exports.getCurrencyAmountKey=t.a,exports.getMerchantInformation=n.u,exports.getSupportedCurrency=t.c,exports.getSupportedLocale=t.s,exports.isChromiumAndroid=t.h,exports.isFrakDeepLink=t.g,exports.locales=t.l,exports.modalBuilder=n.r,exports.openSso=e.i,exports.prepareSso=n.l,exports.processReferral=n.s,exports.referralInteraction=n.o,exports.resolveMerchantId=t.i,exports.sendInteraction=n.c,exports.sendTransaction=n.n,exports.setupClient=t.t,exports.siweAuthenticate=n.t,exports.ssoPopupFeatures=e.a,exports.ssoPopupName=e.o,exports.toAndroidIntentUrl=t._,exports.trackEvent=e.t,exports.trackPurchaseStatus=n.a,exports.triggerDeepLinkWithFallback=t.v,exports.watchWalletStatus=n.i;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./trackEvent-CGIryq5h.cjs`),t=require(`./setupClient-BjIbK6XJ.cjs`),n=require(`./siweAuthenticate-B_Z2OZmj.cjs`);exports.DEEP_LINK_SCHEME=t.b,exports.DebugInfoGatherer=t.y,exports.FrakContextManager=e.n,exports.base64urlDecode=e.l,exports.base64urlEncode=e.u,exports.baseIframeProps=t.f,exports.clearMerchantIdCache=t.n,exports.compressJsonToB64=e.c,exports.computeLegacyProductId=e.f,exports.createIFrameFrakClient=t.d,exports.createIframe=t.p,exports.decompressJsonFromB64=t.u,exports.displayEmbeddedWallet=n.f,exports.displayModal=n.d,exports.fetchMerchantId=t.r,exports.findIframeInOpener=t.m,exports.formatAmount=t.o,exports.generateSsoUrl=e.s,exports.getBackendUrl=e.r,exports.getClientId=e.d,exports.getCurrencyAmountKey=t.a,exports.getMerchantInformation=n.u,exports.getSupportedCurrency=t.c,exports.getSupportedLocale=t.s,exports.isChromiumAndroid=t.h,exports.isFrakDeepLink=t.g,exports.locales=t.l,exports.modalBuilder=n.r,exports.openSso=e.i,exports.prepareSso=n.l,exports.processReferral=n.s,exports.referralInteraction=n.o,exports.resolveMerchantId=t.i,exports.sendInteraction=n.c,exports.sendTransaction=n.n,exports.setupClient=t.t,exports.siweAuthenticate=n.t,exports.ssoPopupFeatures=e.a,exports.ssoPopupName=e.o,exports.toAndroidIntentUrl=t._,exports.trackEvent=e.t,exports.trackPurchaseStatus=n.a,exports.triggerDeepLinkWithFallback=t.v,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-oAGMkQ4T.cjs";
2
- import { A as getBackendUrl, B as CompressedData, C as triggerDeepLinkWithFallback, D as base64urlDecode, E as compressJsonToB64, F as createIFrameFrakClient, H as KeyProvider, I as TrackArrivalInternalParams, L as TrackArrivalParams, M as locales, N as setupClient, O as base64urlEncode, P as DebugInfoGatherer, R as TrackArrivalResult, S as toAndroidIntentUrl, T as decompressJsonFromB64, V as HashProtectedData, _ 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 UtmParams } from "./computeLegacyProductId-Ce84telU.cjs";
3
- import { _ as displayEmbeddedWallet, a as ModalBuilder, c as watchWalletStatus, d as referralInteraction, f as ProcessReferralOptions, g as displayModal, 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 } from "./siweAuthenticate-D5lp5sdP.cjs";
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-CC1-loUk.cjs";
2
+ import { A as getBackendUrl, B as CompressedData, C as triggerDeepLinkWithFallback, D as base64urlDecode, E as compressJsonToB64, F as createIFrameFrakClient, H as KeyProvider, I as TrackArrivalInternalParams, L as TrackArrivalParams, M as locales, N as setupClient, O as base64urlEncode, P as DebugInfoGatherer, R as TrackArrivalResult, S as toAndroidIntentUrl, T as decompressJsonFromB64, V as HashProtectedData, _ 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 UtmParams } from "./computeLegacyProductId-CscYhyUi.cjs";
3
+ import { _ as displayEmbeddedWallet, a as ModalBuilder, c as watchWalletStatus, d as referralInteraction, f as ProcessReferralOptions, g as displayModal, 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 } from "./siweAuthenticate-CR4Dpji6.cjs";
4
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, TrackArrivalInternalParams, TrackArrivalParams, TrackArrivalResult, UtmParams, WalletStatusReturnType, base64urlDecode, base64urlEncode, baseIframeProps, clearMerchantIdCache, compressJsonToB64, computeLegacyProductId, createIFrameFrakClient, createIframe, decompressJsonFromB64, displayEmbeddedWallet, displayModal, 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 };
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-ocIfOlv6.js";
2
- import { A as getBackendUrl, B as CompressedData, C as triggerDeepLinkWithFallback, D as base64urlDecode, E as compressJsonToB64, F as createIFrameFrakClient, H as KeyProvider, I as TrackArrivalInternalParams, L as TrackArrivalParams, M as locales, N as setupClient, O as base64urlEncode, P as DebugInfoGatherer, R as TrackArrivalResult, S as toAndroidIntentUrl, T as decompressJsonFromB64, V as HashProtectedData, _ 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 UtmParams } from "./computeLegacyProductId-BB2XwoJJ.js";
3
- import { _ as displayEmbeddedWallet, a as ModalBuilder, c as watchWalletStatus, d as referralInteraction, f as ProcessReferralOptions, g as displayModal, 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 } from "./siweAuthenticate-DP0y5LIx.js";
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-tkqaDQLV.js";
2
+ import { A as getBackendUrl, B as CompressedData, C as triggerDeepLinkWithFallback, D as base64urlDecode, E as compressJsonToB64, F as createIFrameFrakClient, H as KeyProvider, I as TrackArrivalInternalParams, L as TrackArrivalParams, M as locales, N as setupClient, O as base64urlEncode, P as DebugInfoGatherer, R as TrackArrivalResult, S as toAndroidIntentUrl, T as decompressJsonFromB64, V as HashProtectedData, _ 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 UtmParams } from "./computeLegacyProductId-WbD1gXV9.js";
3
+ import { _ as displayEmbeddedWallet, a as ModalBuilder, c as watchWalletStatus, d as referralInteraction, f as ProcessReferralOptions, g as displayModal, 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 } from "./siweAuthenticate-udoruuy9.js";
4
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, TrackArrivalInternalParams, TrackArrivalParams, TrackArrivalResult, UtmParams, WalletStatusReturnType, base64urlDecode, base64urlEncode, baseIframeProps, clearMerchantIdCache, compressJsonToB64, computeLegacyProductId, createIFrameFrakClient, createIframe, decompressJsonFromB64, displayEmbeddedWallet, displayModal, 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 };
package/dist/bundle.js CHANGED
@@ -1 +1 @@
1
- import{a as e,c as t,d as n,f as r,i,l as a,n as o,o as s,r as c,s as l,t as u,u as d}from"./trackEvent-YfUh4jrx.js";import{_ as f,a as p,b as m,c as h,d as g,f as _,g as v,h as y,i as b,l as x,m as S,n as C,o as w,p as T,r as E,s as D,t as O,u as k,v as A,y as j}from"./setupClient-DS3T5LNS.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,r as B,s as V,t as H,u as U}from"./siweAuthenticate-CQ4OfPuA.js";export{m as DEEP_LINK_SCHEME,j as DebugInfoGatherer,o as FrakContextManager,a as base64urlDecode,d as base64urlEncode,_ as baseIframeProps,C as clearMerchantIdCache,t as compressJsonToB64,r as computeLegacyProductId,g as createIFrameFrakClient,T as createIframe,k as decompressJsonFromB64,F as displayEmbeddedWallet,P as displayModal,E as fetchMerchantId,S as findIframeInOpener,w as formatAmount,l as generateSsoUrl,c as getBackendUrl,n as getClientId,p as getCurrencyAmountKey,U as getMerchantInformation,h as getSupportedCurrency,D as getSupportedLocale,y as isChromiumAndroid,v as isFrakDeepLink,x as locales,B as modalBuilder,i as openSso,L as prepareSso,V as processReferral,z as referralInteraction,b as resolveMerchantId,N as sendInteraction,R as sendTransaction,O as setupClient,H as siweAuthenticate,e as ssoPopupFeatures,s as ssoPopupName,f as toAndroidIntentUrl,u as trackEvent,M as trackPurchaseStatus,A as triggerDeepLinkWithFallback,I as watchWalletStatus};
1
+ import{a as e,c as t,d as n,f as r,i,l as a,n as o,o as s,r as c,s as l,t as u,u as d}from"./trackEvent-YfUh4jrx.js";import{_ as f,a as p,b as m,c as h,d as g,f as _,g as v,h as y,i as b,l as x,m as S,n as C,o as w,p as T,r as E,s as D,t as O,u as k,v as A,y as j}from"./setupClient-D_HId3e2.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,r as B,s as V,t as H,u as U}from"./siweAuthenticate-CQ4OfPuA.js";export{m as DEEP_LINK_SCHEME,j as DebugInfoGatherer,o as FrakContextManager,a as base64urlDecode,d as base64urlEncode,_ as baseIframeProps,C as clearMerchantIdCache,t as compressJsonToB64,r as computeLegacyProductId,g as createIFrameFrakClient,T as createIframe,k as decompressJsonFromB64,F as displayEmbeddedWallet,P as displayModal,E as fetchMerchantId,S as findIframeInOpener,w as formatAmount,l as generateSsoUrl,c as getBackendUrl,n as getClientId,p as getCurrencyAmountKey,U as getMerchantInformation,h as getSupportedCurrency,D as getSupportedLocale,y as isChromiumAndroid,v as isFrakDeepLink,x as locales,B as modalBuilder,i as openSso,L as prepareSso,V as processReferral,z as referralInteraction,b as resolveMerchantId,N as sendInteraction,R as sendTransaction,O as setupClient,H as siweAuthenticate,e as ssoPopupFeatures,s as ssoPopupName,f as toAndroidIntentUrl,u as trackEvent,M as trackPurchaseStatus,A 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-oAGMkQ4T.cjs";
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-CC1-loUk.cjs";
2
2
  import { RpcMessage, RpcResponse } from "@frak-labs/frame-connector";
3
3
  import { Address, Hex } from "viem";
4
4
 
@@ -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-ocIfOlv6.js";
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-tkqaDQLV.js";
2
2
  import { Address, Hex } from "viem";
3
3
  import { RpcMessage, RpcResponse } from "@frak-labs/frame-connector";
4
4
 
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./trackEvent-CGIryq5h.cjs`),t=require(`./setupClient-CudGNb4Q.cjs`);exports.DEEP_LINK_SCHEME=t.b,exports.DebugInfoGatherer=t.y,exports.FrakContextManager=e.n,exports.base64urlDecode=e.l,exports.base64urlEncode=e.u,exports.baseIframeProps=t.f,exports.clearMerchantIdCache=t.n,exports.compressJsonToB64=e.c,exports.computeLegacyProductId=e.f,exports.createIFrameFrakClient=t.d,exports.createIframe=t.p,exports.decompressJsonFromB64=t.u,exports.fetchMerchantId=t.r,exports.findIframeInOpener=t.m,exports.formatAmount=t.o,exports.generateSsoUrl=e.s,exports.getBackendUrl=e.r,exports.getClientId=e.d,exports.getCurrencyAmountKey=t.a,exports.getSupportedCurrency=t.c,exports.getSupportedLocale=t.s,exports.isChromiumAndroid=t.h,exports.isFrakDeepLink=t.g,exports.locales=t.l,exports.resolveMerchantId=t.i,exports.setupClient=t.t,exports.ssoPopupFeatures=e.a,exports.ssoPopupName=e.o,exports.toAndroidIntentUrl=t._,exports.trackEvent=e.t,exports.triggerDeepLinkWithFallback=t.v;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./trackEvent-CGIryq5h.cjs`),t=require(`./setupClient-BjIbK6XJ.cjs`);exports.DEEP_LINK_SCHEME=t.b,exports.DebugInfoGatherer=t.y,exports.FrakContextManager=e.n,exports.base64urlDecode=e.l,exports.base64urlEncode=e.u,exports.baseIframeProps=t.f,exports.clearMerchantIdCache=t.n,exports.compressJsonToB64=e.c,exports.computeLegacyProductId=e.f,exports.createIFrameFrakClient=t.d,exports.createIframe=t.p,exports.decompressJsonFromB64=t.u,exports.fetchMerchantId=t.r,exports.findIframeInOpener=t.m,exports.formatAmount=t.o,exports.generateSsoUrl=e.s,exports.getBackendUrl=e.r,exports.getClientId=e.d,exports.getCurrencyAmountKey=t.a,exports.getSupportedCurrency=t.c,exports.getSupportedLocale=t.s,exports.isChromiumAndroid=t.h,exports.isFrakDeepLink=t.g,exports.locales=t.l,exports.resolveMerchantId=t.i,exports.setupClient=t.t,exports.ssoPopupFeatures=e.a,exports.ssoPopupName=e.o,exports.toAndroidIntentUrl=t._,exports.trackEvent=e.t,exports.triggerDeepLinkWithFallback=t.v;
package/dist/index.d.cts CHANGED
@@ -1,3 +1,3 @@
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, u as EstimatedReward, v as EmbeddedViewActionReferred, w as ModalRpcStepsResultType, x as DisplayModalParamsType, y as EmbeddedViewActionSharing, z as FinalModalStepType } from "./openSso-oAGMkQ4T.cjs";
2
- import { A as getBackendUrl, B as CompressedData, C as triggerDeepLinkWithFallback, D as base64urlDecode, E as compressJsonToB64, F as createIFrameFrakClient, H as KeyProvider, I as TrackArrivalInternalParams, L as TrackArrivalParams, M as locales, N as setupClient, O as base64urlEncode, P as DebugInfoGatherer, R as TrackArrivalResult, S as toAndroidIntentUrl, T as decompressJsonFromB64, V as HashProtectedData, _ 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 UtmParams } from "./computeLegacyProductId-Ce84telU.cjs";
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, u as EstimatedReward, v as EmbeddedViewActionReferred, w as ModalRpcStepsResultType, x as DisplayModalParamsType, y as EmbeddedViewActionSharing, z as FinalModalStepType } from "./openSso-CC1-loUk.cjs";
2
+ import { A as getBackendUrl, B as CompressedData, C as triggerDeepLinkWithFallback, D as base64urlDecode, E as compressJsonToB64, F as createIFrameFrakClient, H as KeyProvider, I as TrackArrivalInternalParams, L as TrackArrivalParams, M as locales, N as setupClient, O as base64urlEncode, P as DebugInfoGatherer, R as TrackArrivalResult, S as toAndroidIntentUrl, T as decompressJsonFromB64, V as HashProtectedData, _ 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 UtmParams } from "./computeLegacyProductId-CscYhyUi.cjs";
3
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 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 TrackArrivalInternalParams, 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, locales, resolveMerchantId, setupClient, ssoPopupFeatures, ssoPopupName, toAndroidIntentUrl, trackEvent, triggerDeepLinkWithFallback };
package/dist/index.d.ts CHANGED
@@ -1,3 +1,3 @@
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, u as EstimatedReward, v as EmbeddedViewActionReferred, w as ModalRpcStepsResultType, x as DisplayModalParamsType, y as EmbeddedViewActionSharing, z as FinalModalStepType } from "./openSso-ocIfOlv6.js";
2
- import { A as getBackendUrl, B as CompressedData, C as triggerDeepLinkWithFallback, D as base64urlDecode, E as compressJsonToB64, F as createIFrameFrakClient, H as KeyProvider, I as TrackArrivalInternalParams, L as TrackArrivalParams, M as locales, N as setupClient, O as base64urlEncode, P as DebugInfoGatherer, R as TrackArrivalResult, S as toAndroidIntentUrl, T as decompressJsonFromB64, V as HashProtectedData, _ 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 UtmParams } from "./computeLegacyProductId-BB2XwoJJ.js";
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, u as EstimatedReward, v as EmbeddedViewActionReferred, w as ModalRpcStepsResultType, x as DisplayModalParamsType, y as EmbeddedViewActionSharing, z as FinalModalStepType } from "./openSso-tkqaDQLV.js";
2
+ import { A as getBackendUrl, B as CompressedData, C as triggerDeepLinkWithFallback, D as base64urlDecode, E as compressJsonToB64, F as createIFrameFrakClient, H as KeyProvider, I as TrackArrivalInternalParams, L as TrackArrivalParams, M as locales, N as setupClient, O as base64urlEncode, P as DebugInfoGatherer, R as TrackArrivalResult, S as toAndroidIntentUrl, T as decompressJsonFromB64, V as HashProtectedData, _ 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 UtmParams } from "./computeLegacyProductId-WbD1gXV9.js";
3
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 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 TrackArrivalInternalParams, 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, locales, resolveMerchantId, setupClient, ssoPopupFeatures, ssoPopupName, toAndroidIntentUrl, trackEvent, triggerDeepLinkWithFallback };
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- import{a as e,c as t,d as n,f as r,l as i,n as a,o,r as s,s as c,t as l,u}from"./trackEvent-YfUh4jrx.js";import{_ as d,a as f,b as p,c as m,d as h,f as g,g as _,h as v,i as y,l as b,m as x,n as S,o as C,p as w,r as T,s as E,t as D,u as O,v as k,y as A}from"./setupClient-DS3T5LNS.js";export{p as DEEP_LINK_SCHEME,A as DebugInfoGatherer,a as FrakContextManager,i as base64urlDecode,u as base64urlEncode,g as baseIframeProps,S as clearMerchantIdCache,t as compressJsonToB64,r as computeLegacyProductId,h as createIFrameFrakClient,w as createIframe,O as decompressJsonFromB64,T as fetchMerchantId,x as findIframeInOpener,C as formatAmount,c as generateSsoUrl,s as getBackendUrl,n as getClientId,f as getCurrencyAmountKey,m as getSupportedCurrency,E as getSupportedLocale,v as isChromiumAndroid,_ as isFrakDeepLink,b as locales,y as resolveMerchantId,D as setupClient,e as ssoPopupFeatures,o as ssoPopupName,d as toAndroidIntentUrl,l as trackEvent,k as triggerDeepLinkWithFallback};
1
+ import{a as e,c as t,d as n,f as r,l as i,n as a,o,r as s,s as c,t as l,u}from"./trackEvent-YfUh4jrx.js";import{_ as d,a as f,b as p,c as m,d as h,f as g,g as _,h as v,i as y,l as b,m as x,n as S,o as C,p as w,r as T,s as E,t as D,u as O,v as k,y as A}from"./setupClient-D_HId3e2.js";export{p as DEEP_LINK_SCHEME,A as DebugInfoGatherer,a as FrakContextManager,i as base64urlDecode,u as base64urlEncode,g as baseIframeProps,S as clearMerchantIdCache,t as compressJsonToB64,r as computeLegacyProductId,h as createIFrameFrakClient,w as createIframe,O as decompressJsonFromB64,T as fetchMerchantId,x as findIframeInOpener,C as formatAmount,c as generateSsoUrl,s as getBackendUrl,n as getClientId,f as getCurrencyAmountKey,m as getSupportedCurrency,E as getSupportedLocale,v as isChromiumAndroid,_ as isFrakDeepLink,b as locales,y as resolveMerchantId,D as setupClient,e as ssoPopupFeatures,o as ssoPopupName,d as toAndroidIntentUrl,l as trackEvent,k as triggerDeepLinkWithFallback};
@@ -162,6 +162,12 @@ type HandshakeResponse = {
162
162
  * URL is cleaned after handshake response is sent
163
163
  */
164
164
  pendingMergeToken?: string;
165
+ /**
166
+ * Explicit domain from SDK config (FrakWalletSdkConfig.domain)
167
+ * When present, listener should prefer this over URL-derived domain
168
+ * for merchant resolution (handles proxied/tunneled environments)
169
+ */
170
+ configDomain?: string;
165
171
  };
166
172
  };
167
173
  type SsoRedirectCompleteEvent = {
@@ -162,6 +162,12 @@ type HandshakeResponse = {
162
162
  * URL is cleaned after handshake response is sent
163
163
  */
164
164
  pendingMergeToken?: string;
165
+ /**
166
+ * Explicit domain from SDK config (FrakWalletSdkConfig.domain)
167
+ * When present, listener should prefer this over URL-derived domain
168
+ * for merchant resolution (handles proxied/tunneled environments)
169
+ */
170
+ configDomain?: string;
165
171
  };
166
172
  };
167
173
  type SsoRedirectCompleteEvent = {
@@ -0,0 +1,13 @@
1
+ const e=require(`./trackEvent-CGIryq5h.cjs`);let t=require(`@frak-labs/frame-connector`),n=require(`@openpanel/web`);const r=`nexus-wallet-backup`,i=`frakwallet://`;function a(e,t){if(typeof window>`u`)return;let n=new URL(window.location.href),r=n.searchParams.get(`sso`);r&&(t.then(()=>{e.sendLifecycle({clientLifecycle:`sso-redirect-complete`,data:{compressed:r}}),console.log(`[SSO URL Listener] Forwarded compressed SSO data to iframe`)}).catch(e=>{console.error(`[SSO URL Listener] Failed to forward SSO data:`,e)}),n.searchParams.delete(`sso`),window.history.replaceState({},``,n.toString()),console.log(`[SSO URL Listener] SSO parameter detected and URL cleaned`))}var o=class e{config;iframe;isSetupDone=!1;lastResponse=null;lastRequest=null;constructor(e,t){this.config=e,this.iframe=t,this.lastRequest=null,this.lastResponse=null}setLastResponse(e,t){this.lastResponse={message:e,response:t,timestamp:Date.now()}}setLastRequest(e){this.lastRequest={event:e,timestamp:Date.now()}}updateSetupStatus(e){this.isSetupDone=e}base64Encode(e){try{return btoa(JSON.stringify(e))}catch(e){return console.warn(`Failed to encode debug data`,e),btoa(`Failed to encode data`)}}getIframeStatus(){return this.iframe?{loading:this.iframe.hasAttribute(`loading`),url:this.iframe.src,readyState:this.iframe.contentDocument?.readyState?this.iframe.contentDocument.readyState===`complete`?1:0:-1,contentWindow:!!this.iframe.contentWindow,isConnected:this.iframe.isConnected}:null}getNavigatorInfo(){return navigator?{userAgent:navigator.userAgent,language:navigator.language,onLine:navigator.onLine,screenWidth:window.screen.width,screenHeight:window.screen.height,pixelRatio:window.devicePixelRatio}:null}gatherDebugInfo(e){let n=this.getIframeStatus(),r=this.getNavigatorInfo(),i=`Unknown`;return e instanceof t.FrakRpcError?i=`FrakRpcError: ${e.code} '${e.message}'`:e instanceof Error?i=e.message:typeof e==`string`&&(i=e),{timestamp:new Date().toISOString(),encodedUrl:btoa(window.location.href),encodedConfig:this.config?this.base64Encode(this.config):`no-config`,navigatorInfo:r?this.base64Encode(r):`no-navigator`,iframeStatus:n?this.base64Encode(n):`not-iframe`,lastRequest:this.lastRequest?this.base64Encode(this.lastRequest):`No Frak request logged`,lastResponse:this.lastResponse?this.base64Encode(this.lastResponse):`No Frak response logged`,clientStatus:this.isSetupDone?`setup`:`not-setup`,error:i}}static empty(){return new e}formatDebugInfo(e){let t=this.gatherDebugInfo(e);return`
2
+ Debug Information:
3
+ -----------------
4
+ Timestamp: ${t.timestamp}
5
+ URL: ${t.encodedUrl}
6
+ Config: ${t.encodedConfig}
7
+ Navigator Info: ${t.navigatorInfo}
8
+ IFrame Status: ${t.iframeStatus}
9
+ Last Request: ${t.lastRequest}
10
+ Last Response: ${t.lastResponse}
11
+ Client Status: ${t.clientStatus}
12
+ Error: ${t.error}
13
+ `.trim()}};function s(){let e=navigator.userAgent;return/Android/i.test(e)&&/Chrome\/\d+/i.test(e)}function c(e){return`intent://${e.slice(13)}#Intent;scheme=frakwallet;package=id.frak.wallet;end`}function l(e,t){let n=t?.timeout??2500,r=!1,i=()=>{document.hidden&&(r=!0)};document.addEventListener(`visibilitychange`,i);let a=s()&&u(e)?c(e):e;window.location.href=a,setTimeout(()=>{document.removeEventListener(`visibilitychange`,i),r||t?.onFallback?.()},n)}function u(e){return e.startsWith(i)}const d={id:`frak-wallet`,name:`frak-wallet`,title:`Frak Wallet`,allow:`publickey-credentials-get *; clipboard-write; web-share *`,style:{width:`0`,height:`0`,border:`0`,position:`absolute`,zIndex:2000001,top:`-1000px`,left:`-1000px`,colorScheme:`auto`}};function f({walletBaseUrl:e,config:t}){let n=document.querySelector(`#frak-wallet`);n&&n.remove();let r=document.createElement(`iframe`);return r.id=d.id,r.name=d.name,r.allow=d.allow,r.style.zIndex=d.style.zIndex.toString(),p({iframe:r,isVisible:!1}),r.src=`${t?.walletUrl??e??`https://wallet.frak.id`}/listener`,new Promise(e=>{r.addEventListener(`load`,()=>e(r)),document.body.appendChild(r)})}function p({iframe:e,isVisible:t}){if(!t){e.style.width=`0`,e.style.height=`0`,e.style.border=`0`,e.style.position=`fixed`,e.style.top=`-1000px`,e.style.left=`-1000px`;return}e.style.position=`fixed`,e.style.top=`0`,e.style.left=`0`,e.style.width=`100%`,e.style.height=`100%`,e.style.pointerEvents=`auto`}function m(e=`/listener`){if(!window.opener)return null;let t=t=>{try{return t.location.origin===window.location.origin&&t.location.pathname===e}catch{return!1}};if(t(window.opener))return window.opener;try{let e=window.opener.frames;for(let n=0;n<e.length;n++)if(t(e[n]))return e[n];return null}catch(t){return console.error(`[findIframeInOpener] Error finding iframe with pathname ${e}:`,t),null}}function h(e){e?localStorage.setItem(r,e):localStorage.removeItem(r)}function g(t,n,r,i){let a=new URL(window.location.href),o=a.searchParams.get(`fmt`)??void 0;t.contentWindow?.postMessage({clientLifecycle:`handshake-response`,data:{token:n,currentUrl:window.location.href,clientId:e.d(),pendingMergeToken:o,configDomain:i}},r),o&&(a.searchParams.delete(`fmt`),window.history.replaceState({},``,a.toString()))}function _(e,t){try{let n=new URL(e);return n.searchParams.has(`u`)?(n.searchParams.delete(`u`),n.searchParams.append(`u`,window.location.href),t&&n.searchParams.append(`fmt`,t),n.toString()):e}catch{return e}}function v(e,t,n,r){let i=_(t,r);u(t)?l(i,{onFallback:()=>{e.contentWindow?.postMessage({clientLifecycle:`deep-link-failed`,data:{originalUrl:i}},n)}}):window.location.href=i}function y({iframe:e,targetOrigin:n,configDomain:i}){let a=new t.Deferred;return{handleEvent:async t=>{if(!(`iframeLifecycle`in t))return;let{iframeLifecycle:o,data:s}=t;switch(o){case`connected`:a.resolve(!0);break;case`do-backup`:h(s.backup);break;case`remove-backup`:localStorage.removeItem(r);break;case`show`:case`hide`:p({iframe:e,isVisible:o===`show`});break;case`handshake`:g(e,s.token,n,i);break;case`redirect`:v(e,s.baseRedirectUrl,n,s.mergeToken);break}},isConnected:a.promise}}function b({config:e,iframe:r}){let i=e?.walletUrl??`https://wallet.frak.id`,a=y({iframe:r,targetOrigin:i,configDomain:e.domain}),s=new o(e,r);if(!r.contentWindow)throw new t.FrakRpcError(t.RpcErrorCodes.configError,`The iframe does not have a content window`);let c=(0,t.createRpcClient)({emittingTransport:r.contentWindow,listeningTransport:window,targetOrigin:i,middleware:[{async onRequest(e,n){if(!await a.isConnected)throw new t.FrakRpcError(t.RpcErrorCodes.clientNotConnected,`The iframe provider isn't connected yet`);return n}},{onRequest(e,t){return s.setLastRequest(e),t},onResponse(e,t){return s.setLastResponse(e,t),t}}],lifecycleHandlers:{iframeLifecycle:async(e,t)=>{await a.handleEvent(e)}}}),l=x(c,a),u=async()=>{l(),c.cleanup(),r.remove()},d;console.log(`[Frak SDK] Initializing OpenPanel`),d=new n.OpenPanel({apiUrl:`https://op-api.gcp.frak.id`,clientId:`6eacc8d7-49ac-4936-95e9-81ef29449570`,trackScreenViews:!0,trackOutgoingLinks:!0,trackAttributes:!1,filter:({type:e,payload:t})=>(e!==`track`||!t?.properties||`sdkVersion`in t.properties||(t.properties={...t.properties,sdkVersion:`0.1.1`}),!0)}),d.setGlobalProperties({sdkVersion:`0.1.1`}),d.init();let f=S({config:e,rpcClient:c,lifecycleManager:a}).then(()=>s.updateSetupStatus(!0));return{config:e,debugInfo:s,waitForConnection:a.isConnected,waitForSetup:f,request:c.request,listenerRequest:c.listen,destroy:u,openPanel:d}}function x(e,t){let n,r,i=()=>e.sendLifecycle({clientLifecycle:`heartbeat`});async function a(){i(),n=setInterval(i,1e3),r=setTimeout(()=>{o(),console.log(`Heartbeat timeout: connection failed`)},3e4),await t.isConnected,o()}function o(){n&&clearInterval(n),r&&clearTimeout(r)}return a(),o}async function S({config:e,rpcClient:t,lifecycleManager:n}){await n.isConnected,a(t,n.isConnected);async function i(){let n=e.customizations?.css;if(!n)return;let r={clientLifecycle:`modal-css`,data:{cssLink:n}};t.sendLifecycle(r)}async function o(){let n=e.customizations?.i18n;if(!n)return;let r={clientLifecycle:`modal-i18n`,data:{i18n:n}};t.sendLifecycle(r)}async function s(){if(typeof window>`u`)return;let e=window.localStorage.getItem(r);if(!e)return;let n={clientLifecycle:`restore-backup`,data:{backup:e}};t.sendLifecycle(n)}await Promise.allSettled([i(),o(),s()])}function C(n){return(0,t.jsonDecode)(e.l(n))}const w={eur:`fr-FR`,usd:`en-US`,gbp:`en-GB`};function T(e){return e&&e in w?e:`eur`}function E(e){return e?w[e]??w.eur:w.eur}function D(e,t){let n=E(t),r=T(t);return e.toLocaleString(n,{style:`currency`,currency:r,minimumFractionDigits:0,maximumFractionDigits:2})}function O(e){return e?`${e}Amount`:`eurAmount`}let k,A;async function j(e,t){if(k)return k;if(A)return A;A=M(e,t);let n=await A;return A=void 0,n}async function M(t,n){let r=t??(typeof window<`u`?window.location.hostname:``);if(r)try{let t=e.r(n),i=await fetch(`${t}/user/merchant/resolve?domain=${encodeURIComponent(r)}`);if(!i.ok){console.warn(`[Frak SDK] Merchant lookup failed for domain ${r}: ${i.status}`);return}return k=(await i.json()).merchantId,k}catch(e){console.warn(`[Frak SDK] Failed to fetch merchantId:`,e);return}}function N(){k=void 0,A=void 0}async function P(e,t){return e.metadata?.merchantId?e.metadata.merchantId:j(void 0,t)}async function F({config:e}){let t=I(e),n=await f({config:t});if(!n){console.error(`Failed to create iframe`);return}let r=b({config:t,iframe:n});if(await r.waitForSetup,!await r.waitForConnection){console.error(`Failed to connect to client`);return}return r}function I(e){let t=T(e.metadata?.currency);return{...e,metadata:{...e.metadata,currency:t}}}Object.defineProperty(exports,`_`,{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return O}}),Object.defineProperty(exports,`b`,{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,`c`,{enumerable:!0,get:function(){return T}}),Object.defineProperty(exports,`d`,{enumerable:!0,get:function(){return b}}),Object.defineProperty(exports,`f`,{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,`g`,{enumerable:!0,get:function(){return u}}),Object.defineProperty(exports,`h`,{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return P}}),Object.defineProperty(exports,`l`,{enumerable:!0,get:function(){return w}}),Object.defineProperty(exports,`m`,{enumerable:!0,get:function(){return m}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return N}}),Object.defineProperty(exports,`o`,{enumerable:!0,get:function(){return D}}),Object.defineProperty(exports,`p`,{enumerable:!0,get:function(){return f}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return j}}),Object.defineProperty(exports,`s`,{enumerable:!0,get:function(){return E}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return F}}),Object.defineProperty(exports,`u`,{enumerable:!0,get:function(){return C}}),Object.defineProperty(exports,`v`,{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,`y`,{enumerable:!0,get:function(){return o}});
@@ -10,4 +10,4 @@ import{d as e,l as t,r as n}from"./trackEvent-YfUh4jrx.js";import{Deferred as r,
10
10
  Last Response: ${t.lastResponse}
11
11
  Client Status: ${t.clientStatus}
12
12
  Error: ${t.error}
13
- `.trim()}};function p(){let e=navigator.userAgent;return/Android/i.test(e)&&/Chrome\/\d+/i.test(e)}function m(e){return`intent://${e.slice(13)}#Intent;scheme=frakwallet;package=id.frak.wallet;end`}function h(e,t){let n=t?.timeout??2500,r=!1,i=()=>{document.hidden&&(r=!0)};document.addEventListener(`visibilitychange`,i);let a=p()&&g(e)?m(e):e;window.location.href=a,setTimeout(()=>{document.removeEventListener(`visibilitychange`,i),r||t?.onFallback?.()},n)}function g(e){return e.startsWith(u)}const _={id:`frak-wallet`,name:`frak-wallet`,title:`Frak Wallet`,allow:`publickey-credentials-get *; clipboard-write; web-share *`,style:{width:`0`,height:`0`,border:`0`,position:`absolute`,zIndex:2000001,top:`-1000px`,left:`-1000px`,colorScheme:`auto`}};function v({walletBaseUrl:e,config:t}){let n=document.querySelector(`#frak-wallet`);n&&n.remove();let r=document.createElement(`iframe`);return r.id=_.id,r.name=_.name,r.allow=_.allow,r.style.zIndex=_.style.zIndex.toString(),y({iframe:r,isVisible:!1}),r.src=`${t?.walletUrl??e??`https://wallet.frak.id`}/listener`,new Promise(e=>{r.addEventListener(`load`,()=>e(r)),document.body.appendChild(r)})}function y({iframe:e,isVisible:t}){if(!t){e.style.width=`0`,e.style.height=`0`,e.style.border=`0`,e.style.position=`fixed`,e.style.top=`-1000px`,e.style.left=`-1000px`;return}e.style.position=`fixed`,e.style.top=`0`,e.style.left=`0`,e.style.width=`100%`,e.style.height=`100%`,e.style.pointerEvents=`auto`}function b(e=`/listener`){if(!window.opener)return null;let t=t=>{try{return t.location.origin===window.location.origin&&t.location.pathname===e}catch{return!1}};if(t(window.opener))return window.opener;try{let e=window.opener.frames;for(let n=0;n<e.length;n++)if(t(e[n]))return e[n];return null}catch(t){return console.error(`[findIframeInOpener] Error finding iframe with pathname ${e}:`,t),null}}function x(e){e?localStorage.setItem(l,e):localStorage.removeItem(l)}function S(t,n,r){let i=new URL(window.location.href),a=i.searchParams.get(`fmt`)??void 0;t.contentWindow?.postMessage({clientLifecycle:`handshake-response`,data:{token:n,currentUrl:window.location.href,clientId:e(),pendingMergeToken:a}},r),a&&(i.searchParams.delete(`fmt`),window.history.replaceState({},``,i.toString()))}function C(e,t){try{let n=new URL(e);return n.searchParams.has(`u`)?(n.searchParams.delete(`u`),n.searchParams.append(`u`,window.location.href),t&&n.searchParams.append(`fmt`,t),n.toString()):e}catch{return e}}function w(e,t,n,r){let i=C(t,r);g(t)?h(i,{onFallback:()=>{e.contentWindow?.postMessage({clientLifecycle:`deep-link-failed`,data:{originalUrl:i}},n)}}):window.location.href=i}function T({iframe:e,targetOrigin:t}){let n=new r;return{handleEvent:async r=>{if(!(`iframeLifecycle`in r))return;let{iframeLifecycle:i,data:a}=r;switch(i){case`connected`:n.resolve(!0);break;case`do-backup`:x(a.backup);break;case`remove-backup`:localStorage.removeItem(l);break;case`show`:case`hide`:y({iframe:e,isVisible:i===`show`});break;case`handshake`:S(e,a.token,t);break;case`redirect`:w(e,a.baseRedirectUrl,t,a.mergeToken);break}},isConnected:n.promise}}function E({config:e,iframe:t}){let n=e?.walletUrl??`https://wallet.frak.id`,r=T({iframe:t,targetOrigin:n}),s=new f(e,t);if(!t.contentWindow)throw new i(a.configError,`The iframe does not have a content window`);let l=o({emittingTransport:t.contentWindow,listeningTransport:window,targetOrigin:n,middleware:[{async onRequest(e,t){if(!await r.isConnected)throw new i(a.clientNotConnected,`The iframe provider isn't connected yet`);return t}},{onRequest(e,t){return s.setLastRequest(e),t},onResponse(e,t){return s.setLastResponse(e,t),t}}],lifecycleHandlers:{iframeLifecycle:async(e,t)=>{await r.handleEvent(e)}}}),u=D(l,r),d=async()=>{u(),l.cleanup(),t.remove()},p;console.log(`[Frak SDK] Initializing OpenPanel`),p=new c({apiUrl:`https://op-api.gcp.frak.id`,clientId:`6eacc8d7-49ac-4936-95e9-81ef29449570`,trackScreenViews:!0,trackOutgoingLinks:!0,trackAttributes:!1,filter:({type:e,payload:t})=>(e!==`track`||!t?.properties||`sdkVersion`in t.properties||(t.properties={...t.properties,sdkVersion:`0.1.1`}),!0)}),p.setGlobalProperties({sdkVersion:`0.1.1`}),p.init();let m=O({config:e,rpcClient:l,lifecycleManager:r}).then(()=>s.updateSetupStatus(!0));return{config:e,debugInfo:s,waitForConnection:r.isConnected,waitForSetup:m,request:l.request,listenerRequest:l.listen,destroy:d,openPanel:p}}function D(e,t){let n,r,i=()=>e.sendLifecycle({clientLifecycle:`heartbeat`});async function a(){i(),n=setInterval(i,1e3),r=setTimeout(()=>{o(),console.log(`Heartbeat timeout: connection failed`)},3e4),await t.isConnected,o()}function o(){n&&clearInterval(n),r&&clearTimeout(r)}return a(),o}async function O({config:e,rpcClient:t,lifecycleManager:n}){await n.isConnected,d(t,n.isConnected);async function r(){let n=e.customizations?.css;if(!n)return;let r={clientLifecycle:`modal-css`,data:{cssLink:n}};t.sendLifecycle(r)}async function i(){let n=e.customizations?.i18n;if(!n)return;let r={clientLifecycle:`modal-i18n`,data:{i18n:n}};t.sendLifecycle(r)}async function a(){if(typeof window>`u`)return;let e=window.localStorage.getItem(l);if(!e)return;let n={clientLifecycle:`restore-backup`,data:{backup:e}};t.sendLifecycle(n)}await Promise.allSettled([r(),i(),a()])}function k(e){return s(t(e))}const A={eur:`fr-FR`,usd:`en-US`,gbp:`en-GB`};function j(e){return e&&e in A?e:`eur`}function M(e){return e?A[e]??A.eur:A.eur}function N(e,t){let n=M(t),r=j(t);return e.toLocaleString(n,{style:`currency`,currency:r,minimumFractionDigits:0,maximumFractionDigits:2})}function P(e){return e?`${e}Amount`:`eurAmount`}let F,I;async function L(e,t){if(F)return F;if(I)return I;I=R(e,t);let n=await I;return I=void 0,n}async function R(e,t){let r=e??(typeof window<`u`?window.location.hostname:``);if(r)try{let e=n(t),i=await fetch(`${e}/user/merchant/resolve?domain=${encodeURIComponent(r)}`);if(!i.ok){console.warn(`[Frak SDK] Merchant lookup failed for domain ${r}: ${i.status}`);return}return F=(await i.json()).merchantId,F}catch(e){console.warn(`[Frak SDK] Failed to fetch merchantId:`,e);return}}function z(){F=void 0,I=void 0}async function B(e,t){return e.metadata?.merchantId?e.metadata.merchantId:L(void 0,t)}async function V({config:e}){let t=H(e),n=await v({config:t});if(!n){console.error(`Failed to create iframe`);return}let r=E({config:t,iframe:n});if(await r.waitForSetup,!await r.waitForConnection){console.error(`Failed to connect to client`);return}return r}function H(e){let t=j(e.metadata?.currency);return{...e,metadata:{...e.metadata,currency:t}}}export{m as _,P as a,u as b,j as c,E as d,_ as f,g,p as h,B as i,A as l,b as m,z as n,N as o,v as p,L as r,M as s,V as t,k as u,h as v,f as y};
13
+ `.trim()}};function p(){let e=navigator.userAgent;return/Android/i.test(e)&&/Chrome\/\d+/i.test(e)}function m(e){return`intent://${e.slice(13)}#Intent;scheme=frakwallet;package=id.frak.wallet;end`}function h(e,t){let n=t?.timeout??2500,r=!1,i=()=>{document.hidden&&(r=!0)};document.addEventListener(`visibilitychange`,i);let a=p()&&g(e)?m(e):e;window.location.href=a,setTimeout(()=>{document.removeEventListener(`visibilitychange`,i),r||t?.onFallback?.()},n)}function g(e){return e.startsWith(u)}const _={id:`frak-wallet`,name:`frak-wallet`,title:`Frak Wallet`,allow:`publickey-credentials-get *; clipboard-write; web-share *`,style:{width:`0`,height:`0`,border:`0`,position:`absolute`,zIndex:2000001,top:`-1000px`,left:`-1000px`,colorScheme:`auto`}};function v({walletBaseUrl:e,config:t}){let n=document.querySelector(`#frak-wallet`);n&&n.remove();let r=document.createElement(`iframe`);return r.id=_.id,r.name=_.name,r.allow=_.allow,r.style.zIndex=_.style.zIndex.toString(),y({iframe:r,isVisible:!1}),r.src=`${t?.walletUrl??e??`https://wallet.frak.id`}/listener`,new Promise(e=>{r.addEventListener(`load`,()=>e(r)),document.body.appendChild(r)})}function y({iframe:e,isVisible:t}){if(!t){e.style.width=`0`,e.style.height=`0`,e.style.border=`0`,e.style.position=`fixed`,e.style.top=`-1000px`,e.style.left=`-1000px`;return}e.style.position=`fixed`,e.style.top=`0`,e.style.left=`0`,e.style.width=`100%`,e.style.height=`100%`,e.style.pointerEvents=`auto`}function b(e=`/listener`){if(!window.opener)return null;let t=t=>{try{return t.location.origin===window.location.origin&&t.location.pathname===e}catch{return!1}};if(t(window.opener))return window.opener;try{let e=window.opener.frames;for(let n=0;n<e.length;n++)if(t(e[n]))return e[n];return null}catch(t){return console.error(`[findIframeInOpener] Error finding iframe with pathname ${e}:`,t),null}}function x(e){e?localStorage.setItem(l,e):localStorage.removeItem(l)}function S(t,n,r,i){let a=new URL(window.location.href),o=a.searchParams.get(`fmt`)??void 0;t.contentWindow?.postMessage({clientLifecycle:`handshake-response`,data:{token:n,currentUrl:window.location.href,clientId:e(),pendingMergeToken:o,configDomain:i}},r),o&&(a.searchParams.delete(`fmt`),window.history.replaceState({},``,a.toString()))}function C(e,t){try{let n=new URL(e);return n.searchParams.has(`u`)?(n.searchParams.delete(`u`),n.searchParams.append(`u`,window.location.href),t&&n.searchParams.append(`fmt`,t),n.toString()):e}catch{return e}}function w(e,t,n,r){let i=C(t,r);g(t)?h(i,{onFallback:()=>{e.contentWindow?.postMessage({clientLifecycle:`deep-link-failed`,data:{originalUrl:i}},n)}}):window.location.href=i}function T({iframe:e,targetOrigin:t,configDomain:n}){let i=new r;return{handleEvent:async r=>{if(!(`iframeLifecycle`in r))return;let{iframeLifecycle:a,data:o}=r;switch(a){case`connected`:i.resolve(!0);break;case`do-backup`:x(o.backup);break;case`remove-backup`:localStorage.removeItem(l);break;case`show`:case`hide`:y({iframe:e,isVisible:a===`show`});break;case`handshake`:S(e,o.token,t,n);break;case`redirect`:w(e,o.baseRedirectUrl,t,o.mergeToken);break}},isConnected:i.promise}}function E({config:e,iframe:t}){let n=e?.walletUrl??`https://wallet.frak.id`,r=T({iframe:t,targetOrigin:n,configDomain:e.domain}),s=new f(e,t);if(!t.contentWindow)throw new i(a.configError,`The iframe does not have a content window`);let l=o({emittingTransport:t.contentWindow,listeningTransport:window,targetOrigin:n,middleware:[{async onRequest(e,t){if(!await r.isConnected)throw new i(a.clientNotConnected,`The iframe provider isn't connected yet`);return t}},{onRequest(e,t){return s.setLastRequest(e),t},onResponse(e,t){return s.setLastResponse(e,t),t}}],lifecycleHandlers:{iframeLifecycle:async(e,t)=>{await r.handleEvent(e)}}}),u=D(l,r),d=async()=>{u(),l.cleanup(),t.remove()},p;console.log(`[Frak SDK] Initializing OpenPanel`),p=new c({apiUrl:`https://op-api.gcp.frak.id`,clientId:`6eacc8d7-49ac-4936-95e9-81ef29449570`,trackScreenViews:!0,trackOutgoingLinks:!0,trackAttributes:!1,filter:({type:e,payload:t})=>(e!==`track`||!t?.properties||`sdkVersion`in t.properties||(t.properties={...t.properties,sdkVersion:`0.1.1`}),!0)}),p.setGlobalProperties({sdkVersion:`0.1.1`}),p.init();let m=O({config:e,rpcClient:l,lifecycleManager:r}).then(()=>s.updateSetupStatus(!0));return{config:e,debugInfo:s,waitForConnection:r.isConnected,waitForSetup:m,request:l.request,listenerRequest:l.listen,destroy:d,openPanel:p}}function D(e,t){let n,r,i=()=>e.sendLifecycle({clientLifecycle:`heartbeat`});async function a(){i(),n=setInterval(i,1e3),r=setTimeout(()=>{o(),console.log(`Heartbeat timeout: connection failed`)},3e4),await t.isConnected,o()}function o(){n&&clearInterval(n),r&&clearTimeout(r)}return a(),o}async function O({config:e,rpcClient:t,lifecycleManager:n}){await n.isConnected,d(t,n.isConnected);async function r(){let n=e.customizations?.css;if(!n)return;let r={clientLifecycle:`modal-css`,data:{cssLink:n}};t.sendLifecycle(r)}async function i(){let n=e.customizations?.i18n;if(!n)return;let r={clientLifecycle:`modal-i18n`,data:{i18n:n}};t.sendLifecycle(r)}async function a(){if(typeof window>`u`)return;let e=window.localStorage.getItem(l);if(!e)return;let n={clientLifecycle:`restore-backup`,data:{backup:e}};t.sendLifecycle(n)}await Promise.allSettled([r(),i(),a()])}function k(e){return s(t(e))}const A={eur:`fr-FR`,usd:`en-US`,gbp:`en-GB`};function j(e){return e&&e in A?e:`eur`}function M(e){return e?A[e]??A.eur:A.eur}function N(e,t){let n=M(t),r=j(t);return e.toLocaleString(n,{style:`currency`,currency:r,minimumFractionDigits:0,maximumFractionDigits:2})}function P(e){return e?`${e}Amount`:`eurAmount`}let F,I;async function L(e,t){if(F)return F;if(I)return I;I=R(e,t);let n=await I;return I=void 0,n}async function R(e,t){let r=e??(typeof window<`u`?window.location.hostname:``);if(r)try{let e=n(t),i=await fetch(`${e}/user/merchant/resolve?domain=${encodeURIComponent(r)}`);if(!i.ok){console.warn(`[Frak SDK] Merchant lookup failed for domain ${r}: ${i.status}`);return}return F=(await i.json()).merchantId,F}catch(e){console.warn(`[Frak SDK] Failed to fetch merchantId:`,e);return}}function z(){F=void 0,I=void 0}async function B(e,t){return e.metadata?.merchantId?e.metadata.merchantId:L(void 0,t)}async function V({config:e}){let t=H(e),n=await v({config:t});if(!n){console.error(`Failed to create iframe`);return}let r=E({config:t,iframe:n});if(await r.waitForSetup,!await r.waitForConnection){console.error(`Failed to connect to client`);return}return r}function H(e){let t=j(e.metadata?.currency);return{...e,metadata:{...e.metadata,currency:t}}}export{m as _,P as a,u as b,j as c,E as d,_ as f,g,p as h,B as i,A as l,b as m,z as n,N as o,v as p,L as r,M as s,V as t,k as u,h as v,f as y};
@@ -1,4 +1,4 @@
1
- import { A as SiweAuthenticateReturnType, D as SendTransactionReturnType, E as SendTransactionModalStepType, F as PrepareSsoParamsType, I as PrepareSsoReturnType, M as LoginModalStepType, R as FinalActionType, S as ModalRpcMetadata, T as ModalStepTypes, a as FrakClient, d as GetMerchantInformationReturnType, g as DisplayEmbeddedWalletResultType, h as DisplayEmbeddedWalletParamsType, i as FrakContext, j as SiweAuthenticationParams, l as WalletStatusReturnType, m as SendInteractionParamsType, w as ModalRpcStepsResultType, x as DisplayModalParamsType, z as FinalModalStepType } from "./openSso-oAGMkQ4T.cjs";
1
+ import { A as SiweAuthenticateReturnType, D as SendTransactionReturnType, E as SendTransactionModalStepType, F as PrepareSsoParamsType, I as PrepareSsoReturnType, M as LoginModalStepType, R as FinalActionType, S as ModalRpcMetadata, T as ModalStepTypes, a as FrakClient, d as GetMerchantInformationReturnType, g as DisplayEmbeddedWalletResultType, h as DisplayEmbeddedWalletParamsType, i as FrakContext, j as SiweAuthenticationParams, l as WalletStatusReturnType, m as SendInteractionParamsType, w as ModalRpcStepsResultType, x as DisplayModalParamsType, z as FinalModalStepType } from "./openSso-CC1-loUk.cjs";
2
2
 
3
3
  //#region src/actions/displayEmbeddedWallet.d.ts
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { A as SiweAuthenticateReturnType, D as SendTransactionReturnType, E as SendTransactionModalStepType, F as PrepareSsoParamsType, I as PrepareSsoReturnType, M as LoginModalStepType, R as FinalActionType, S as ModalRpcMetadata, T as ModalStepTypes, a as FrakClient, d as GetMerchantInformationReturnType, g as DisplayEmbeddedWalletResultType, h as DisplayEmbeddedWalletParamsType, i as FrakContext, j as SiweAuthenticationParams, l as WalletStatusReturnType, m as SendInteractionParamsType, w as ModalRpcStepsResultType, x as DisplayModalParamsType, z as FinalModalStepType } from "./openSso-ocIfOlv6.js";
1
+ import { A as SiweAuthenticateReturnType, D as SendTransactionReturnType, E as SendTransactionModalStepType, F as PrepareSsoParamsType, I as PrepareSsoReturnType, M as LoginModalStepType, R as FinalActionType, S as ModalRpcMetadata, T as ModalStepTypes, a as FrakClient, d as GetMerchantInformationReturnType, g as DisplayEmbeddedWalletResultType, h as DisplayEmbeddedWalletParamsType, i as FrakContext, j as SiweAuthenticationParams, l as WalletStatusReturnType, m as SendInteractionParamsType, w as ModalRpcStepsResultType, x as DisplayModalParamsType, z as FinalModalStepType } from "./openSso-tkqaDQLV.js";
2
2
 
3
3
  //#region src/actions/displayEmbeddedWallet.d.ts
4
4
  /**
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "url": "https://twitter.com/QNivelais"
12
12
  }
13
13
  ],
14
- "version": "0.1.1-beta.d13d0e5d",
14
+ "version": "0.1.1-beta.d96bc28d",
15
15
  "description": "Core SDK of the Frak wallet, low level library to interact directly with the frak ecosystem.",
16
16
  "repository": {
17
17
  "url": "https://github.com/frak-id/wallet",
@@ -91,7 +91,7 @@
91
91
  "viem": "^2.x"
92
92
  },
93
93
  "dependencies": {
94
- "@frak-labs/frame-connector": "0.1.0-beta.d13d0e5d",
94
+ "@frak-labs/frame-connector": "0.1.0-beta.d96bc28d",
95
95
  "@openpanel/web": "^1.0.7"
96
96
  },
97
97
  "devDependencies": {
@@ -49,6 +49,7 @@ export function createIFrameFrakClient({
49
49
  const lifecycleManager = createIFrameLifecycleManager({
50
50
  iframe,
51
51
  targetOrigin: frakWalletUrl,
52
+ configDomain: config.domain,
52
53
  });
53
54
 
54
55
  // Create our debug info gatherer
@@ -31,7 +31,8 @@ function handleBackup(backup: string | undefined): void {
31
31
  function handleHandshake(
32
32
  iframe: HTMLIFrameElement,
33
33
  token: string,
34
- targetOrigin: string
34
+ targetOrigin: string,
35
+ configDomain?: string
35
36
  ): void {
36
37
  const url = new URL(window.location.href);
37
38
  const pendingMergeToken = url.searchParams.get("fmt") ?? undefined;
@@ -44,6 +45,7 @@ function handleHandshake(
44
45
  currentUrl: window.location.href,
45
46
  clientId: getClientId(),
46
47
  pendingMergeToken,
48
+ configDomain,
47
49
  },
48
50
  },
49
51
  targetOrigin
@@ -116,9 +118,11 @@ function handleRedirect(
116
118
  export function createIFrameLifecycleManager({
117
119
  iframe,
118
120
  targetOrigin,
121
+ configDomain,
119
122
  }: {
120
123
  iframe: HTMLIFrameElement;
121
124
  targetOrigin: string;
125
+ configDomain?: string;
122
126
  }): IframeLifecycleManager {
123
127
  // Create the isConnected listener
124
128
  const isConnectedDeferred = new Deferred<boolean>();
@@ -149,7 +153,7 @@ export function createIFrameLifecycleManager({
149
153
  break;
150
154
  // Handshake handling
151
155
  case "handshake":
152
- handleHandshake(iframe, data.token, targetOrigin);
156
+ handleHandshake(iframe, data.token, targetOrigin, configDomain);
153
157
  break;
154
158
  // Redirect handling
155
159
  case "redirect":
@@ -49,6 +49,12 @@ type HandshakeResponse = {
49
49
  * URL is cleaned after handshake response is sent
50
50
  */
51
51
  pendingMergeToken?: string;
52
+ /**
53
+ * Explicit domain from SDK config (FrakWalletSdkConfig.domain)
54
+ * When present, listener should prefer this over URL-derived domain
55
+ * for merchant resolution (handles proxied/tunneled environments)
56
+ */
57
+ configDomain?: string;
52
58
  };
53
59
  };
54
60
 
@@ -1,13 +0,0 @@
1
- const e=require(`./trackEvent-CGIryq5h.cjs`);let t=require(`@frak-labs/frame-connector`),n=require(`@openpanel/web`);const r=`nexus-wallet-backup`,i=`frakwallet://`;function a(e,t){if(typeof window>`u`)return;let n=new URL(window.location.href),r=n.searchParams.get(`sso`);r&&(t.then(()=>{e.sendLifecycle({clientLifecycle:`sso-redirect-complete`,data:{compressed:r}}),console.log(`[SSO URL Listener] Forwarded compressed SSO data to iframe`)}).catch(e=>{console.error(`[SSO URL Listener] Failed to forward SSO data:`,e)}),n.searchParams.delete(`sso`),window.history.replaceState({},``,n.toString()),console.log(`[SSO URL Listener] SSO parameter detected and URL cleaned`))}var o=class e{config;iframe;isSetupDone=!1;lastResponse=null;lastRequest=null;constructor(e,t){this.config=e,this.iframe=t,this.lastRequest=null,this.lastResponse=null}setLastResponse(e,t){this.lastResponse={message:e,response:t,timestamp:Date.now()}}setLastRequest(e){this.lastRequest={event:e,timestamp:Date.now()}}updateSetupStatus(e){this.isSetupDone=e}base64Encode(e){try{return btoa(JSON.stringify(e))}catch(e){return console.warn(`Failed to encode debug data`,e),btoa(`Failed to encode data`)}}getIframeStatus(){return this.iframe?{loading:this.iframe.hasAttribute(`loading`),url:this.iframe.src,readyState:this.iframe.contentDocument?.readyState?this.iframe.contentDocument.readyState===`complete`?1:0:-1,contentWindow:!!this.iframe.contentWindow,isConnected:this.iframe.isConnected}:null}getNavigatorInfo(){return navigator?{userAgent:navigator.userAgent,language:navigator.language,onLine:navigator.onLine,screenWidth:window.screen.width,screenHeight:window.screen.height,pixelRatio:window.devicePixelRatio}:null}gatherDebugInfo(e){let n=this.getIframeStatus(),r=this.getNavigatorInfo(),i=`Unknown`;return e instanceof t.FrakRpcError?i=`FrakRpcError: ${e.code} '${e.message}'`:e instanceof Error?i=e.message:typeof e==`string`&&(i=e),{timestamp:new Date().toISOString(),encodedUrl:btoa(window.location.href),encodedConfig:this.config?this.base64Encode(this.config):`no-config`,navigatorInfo:r?this.base64Encode(r):`no-navigator`,iframeStatus:n?this.base64Encode(n):`not-iframe`,lastRequest:this.lastRequest?this.base64Encode(this.lastRequest):`No Frak request logged`,lastResponse:this.lastResponse?this.base64Encode(this.lastResponse):`No Frak response logged`,clientStatus:this.isSetupDone?`setup`:`not-setup`,error:i}}static empty(){return new e}formatDebugInfo(e){let t=this.gatherDebugInfo(e);return`
2
- Debug Information:
3
- -----------------
4
- Timestamp: ${t.timestamp}
5
- URL: ${t.encodedUrl}
6
- Config: ${t.encodedConfig}
7
- Navigator Info: ${t.navigatorInfo}
8
- IFrame Status: ${t.iframeStatus}
9
- Last Request: ${t.lastRequest}
10
- Last Response: ${t.lastResponse}
11
- Client Status: ${t.clientStatus}
12
- Error: ${t.error}
13
- `.trim()}};function s(){let e=navigator.userAgent;return/Android/i.test(e)&&/Chrome\/\d+/i.test(e)}function c(e){return`intent://${e.slice(13)}#Intent;scheme=frakwallet;package=id.frak.wallet;end`}function l(e,t){let n=t?.timeout??2500,r=!1,i=()=>{document.hidden&&(r=!0)};document.addEventListener(`visibilitychange`,i);let a=s()&&u(e)?c(e):e;window.location.href=a,setTimeout(()=>{document.removeEventListener(`visibilitychange`,i),r||t?.onFallback?.()},n)}function u(e){return e.startsWith(i)}const d={id:`frak-wallet`,name:`frak-wallet`,title:`Frak Wallet`,allow:`publickey-credentials-get *; clipboard-write; web-share *`,style:{width:`0`,height:`0`,border:`0`,position:`absolute`,zIndex:2000001,top:`-1000px`,left:`-1000px`,colorScheme:`auto`}};function f({walletBaseUrl:e,config:t}){let n=document.querySelector(`#frak-wallet`);n&&n.remove();let r=document.createElement(`iframe`);return r.id=d.id,r.name=d.name,r.allow=d.allow,r.style.zIndex=d.style.zIndex.toString(),p({iframe:r,isVisible:!1}),r.src=`${t?.walletUrl??e??`https://wallet.frak.id`}/listener`,new Promise(e=>{r.addEventListener(`load`,()=>e(r)),document.body.appendChild(r)})}function p({iframe:e,isVisible:t}){if(!t){e.style.width=`0`,e.style.height=`0`,e.style.border=`0`,e.style.position=`fixed`,e.style.top=`-1000px`,e.style.left=`-1000px`;return}e.style.position=`fixed`,e.style.top=`0`,e.style.left=`0`,e.style.width=`100%`,e.style.height=`100%`,e.style.pointerEvents=`auto`}function m(e=`/listener`){if(!window.opener)return null;let t=t=>{try{return t.location.origin===window.location.origin&&t.location.pathname===e}catch{return!1}};if(t(window.opener))return window.opener;try{let e=window.opener.frames;for(let n=0;n<e.length;n++)if(t(e[n]))return e[n];return null}catch(t){return console.error(`[findIframeInOpener] Error finding iframe with pathname ${e}:`,t),null}}function h(e){e?localStorage.setItem(r,e):localStorage.removeItem(r)}function g(t,n,r){let i=new URL(window.location.href),a=i.searchParams.get(`fmt`)??void 0;t.contentWindow?.postMessage({clientLifecycle:`handshake-response`,data:{token:n,currentUrl:window.location.href,clientId:e.d(),pendingMergeToken:a}},r),a&&(i.searchParams.delete(`fmt`),window.history.replaceState({},``,i.toString()))}function _(e,t){try{let n=new URL(e);return n.searchParams.has(`u`)?(n.searchParams.delete(`u`),n.searchParams.append(`u`,window.location.href),t&&n.searchParams.append(`fmt`,t),n.toString()):e}catch{return e}}function v(e,t,n,r){let i=_(t,r);u(t)?l(i,{onFallback:()=>{e.contentWindow?.postMessage({clientLifecycle:`deep-link-failed`,data:{originalUrl:i}},n)}}):window.location.href=i}function y({iframe:e,targetOrigin:n}){let i=new t.Deferred;return{handleEvent:async t=>{if(!(`iframeLifecycle`in t))return;let{iframeLifecycle:a,data:o}=t;switch(a){case`connected`:i.resolve(!0);break;case`do-backup`:h(o.backup);break;case`remove-backup`:localStorage.removeItem(r);break;case`show`:case`hide`:p({iframe:e,isVisible:a===`show`});break;case`handshake`:g(e,o.token,n);break;case`redirect`:v(e,o.baseRedirectUrl,n,o.mergeToken);break}},isConnected:i.promise}}function b({config:e,iframe:r}){let i=e?.walletUrl??`https://wallet.frak.id`,a=y({iframe:r,targetOrigin:i}),s=new o(e,r);if(!r.contentWindow)throw new t.FrakRpcError(t.RpcErrorCodes.configError,`The iframe does not have a content window`);let c=(0,t.createRpcClient)({emittingTransport:r.contentWindow,listeningTransport:window,targetOrigin:i,middleware:[{async onRequest(e,n){if(!await a.isConnected)throw new t.FrakRpcError(t.RpcErrorCodes.clientNotConnected,`The iframe provider isn't connected yet`);return n}},{onRequest(e,t){return s.setLastRequest(e),t},onResponse(e,t){return s.setLastResponse(e,t),t}}],lifecycleHandlers:{iframeLifecycle:async(e,t)=>{await a.handleEvent(e)}}}),l=x(c,a),u=async()=>{l(),c.cleanup(),r.remove()},d;console.log(`[Frak SDK] Initializing OpenPanel`),d=new n.OpenPanel({apiUrl:`https://op-api.gcp.frak.id`,clientId:`6eacc8d7-49ac-4936-95e9-81ef29449570`,trackScreenViews:!0,trackOutgoingLinks:!0,trackAttributes:!1,filter:({type:e,payload:t})=>(e!==`track`||!t?.properties||`sdkVersion`in t.properties||(t.properties={...t.properties,sdkVersion:`0.1.1`}),!0)}),d.setGlobalProperties({sdkVersion:`0.1.1`}),d.init();let f=S({config:e,rpcClient:c,lifecycleManager:a}).then(()=>s.updateSetupStatus(!0));return{config:e,debugInfo:s,waitForConnection:a.isConnected,waitForSetup:f,request:c.request,listenerRequest:c.listen,destroy:u,openPanel:d}}function x(e,t){let n,r,i=()=>e.sendLifecycle({clientLifecycle:`heartbeat`});async function a(){i(),n=setInterval(i,1e3),r=setTimeout(()=>{o(),console.log(`Heartbeat timeout: connection failed`)},3e4),await t.isConnected,o()}function o(){n&&clearInterval(n),r&&clearTimeout(r)}return a(),o}async function S({config:e,rpcClient:t,lifecycleManager:n}){await n.isConnected,a(t,n.isConnected);async function i(){let n=e.customizations?.css;if(!n)return;let r={clientLifecycle:`modal-css`,data:{cssLink:n}};t.sendLifecycle(r)}async function o(){let n=e.customizations?.i18n;if(!n)return;let r={clientLifecycle:`modal-i18n`,data:{i18n:n}};t.sendLifecycle(r)}async function s(){if(typeof window>`u`)return;let e=window.localStorage.getItem(r);if(!e)return;let n={clientLifecycle:`restore-backup`,data:{backup:e}};t.sendLifecycle(n)}await Promise.allSettled([i(),o(),s()])}function C(n){return(0,t.jsonDecode)(e.l(n))}const w={eur:`fr-FR`,usd:`en-US`,gbp:`en-GB`};function T(e){return e&&e in w?e:`eur`}function E(e){return e?w[e]??w.eur:w.eur}function D(e,t){let n=E(t),r=T(t);return e.toLocaleString(n,{style:`currency`,currency:r,minimumFractionDigits:0,maximumFractionDigits:2})}function O(e){return e?`${e}Amount`:`eurAmount`}let k,A;async function j(e,t){if(k)return k;if(A)return A;A=M(e,t);let n=await A;return A=void 0,n}async function M(t,n){let r=t??(typeof window<`u`?window.location.hostname:``);if(r)try{let t=e.r(n),i=await fetch(`${t}/user/merchant/resolve?domain=${encodeURIComponent(r)}`);if(!i.ok){console.warn(`[Frak SDK] Merchant lookup failed for domain ${r}: ${i.status}`);return}return k=(await i.json()).merchantId,k}catch(e){console.warn(`[Frak SDK] Failed to fetch merchantId:`,e);return}}function N(){k=void 0,A=void 0}async function P(e,t){return e.metadata?.merchantId?e.metadata.merchantId:j(void 0,t)}async function F({config:e}){let t=I(e),n=await f({config:t});if(!n){console.error(`Failed to create iframe`);return}let r=b({config:t,iframe:n});if(await r.waitForSetup,!await r.waitForConnection){console.error(`Failed to connect to client`);return}return r}function I(e){let t=T(e.metadata?.currency);return{...e,metadata:{...e.metadata,currency:t}}}Object.defineProperty(exports,`_`,{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return O}}),Object.defineProperty(exports,`b`,{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,`c`,{enumerable:!0,get:function(){return T}}),Object.defineProperty(exports,`d`,{enumerable:!0,get:function(){return b}}),Object.defineProperty(exports,`f`,{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,`g`,{enumerable:!0,get:function(){return u}}),Object.defineProperty(exports,`h`,{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return P}}),Object.defineProperty(exports,`l`,{enumerable:!0,get:function(){return w}}),Object.defineProperty(exports,`m`,{enumerable:!0,get:function(){return m}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return N}}),Object.defineProperty(exports,`o`,{enumerable:!0,get:function(){return D}}),Object.defineProperty(exports,`p`,{enumerable:!0,get:function(){return f}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return j}}),Object.defineProperty(exports,`s`,{enumerable:!0,get:function(){return E}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return F}}),Object.defineProperty(exports,`u`,{enumerable:!0,get:function(){return C}}),Object.defineProperty(exports,`v`,{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,`y`,{enumerable:!0,get:function(){return o}});