@swype-org/react-sdk 0.1.285 → 0.1.293

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -488,13 +488,14 @@ __export(api_exports, {
488
488
  fetchAuthorizationSessionByToken: () => fetchAuthorizationSessionByToken,
489
489
  fetchChains: () => fetchChains,
490
490
  fetchGuestAccount: () => fetchGuestAccount,
491
- fetchGuestTransferBalances: () => fetchGuestTransferBalances,
492
491
  fetchMerchantPublicKey: () => fetchMerchantPublicKey,
493
492
  fetchProviders: () => fetchProviders,
494
493
  fetchTransfer: () => fetchTransfer,
495
494
  fetchUserConfig: () => fetchUserConfig,
496
495
  getGuestTransfer: () => getGuestTransfer,
497
496
  getTransferByGuestToken: () => getTransferByGuestToken,
497
+ postGuestTransferFeeQuote: () => postGuestTransferFeeQuote,
498
+ putGuestTransferSender: () => putGuestTransferSender,
498
499
  registerPasskey: () => registerPasskey,
499
500
  reportActionCompletion: () => reportActionCompletion,
500
501
  reportPasskeyActivity: () => reportPasskeyActivity,
@@ -749,18 +750,37 @@ async function getTransferByGuestToken(apiBaseUrl, guestToken) {
749
750
  if (!res.ok) await throwApiError(res);
750
751
  return await res.json();
751
752
  }
752
- async function setTransferSender(apiBaseUrl, transferId, guestSessionToken, senderAddress, sourceChainId, sourceToken) {
753
+ async function postGuestTransferFeeQuote(apiBaseUrl, transferId, guestSessionToken, senderAddress, sourceChainId, sourceToken) {
754
+ const res = await fetch(`${apiBaseUrl}/v1/transfers/${transferId}/quotes`, {
755
+ method: "POST",
756
+ headers: {
757
+ "Content-Type": "application/json",
758
+ "x-guest-session-token": guestSessionToken
759
+ },
760
+ body: JSON.stringify({ senderAddress, sourceChainId, sourceToken })
761
+ });
762
+ if (!res.ok) await throwApiError(res);
763
+ return await res.json();
764
+ }
765
+ async function putGuestTransferSender(apiBaseUrl, transferId, guestSessionToken, body) {
753
766
  const res = await fetch(`${apiBaseUrl}/v1/transfers/${transferId}/sender`, {
754
767
  method: "PUT",
755
768
  headers: {
756
769
  "Content-Type": "application/json",
757
770
  "x-guest-session-token": guestSessionToken
758
771
  },
759
- body: JSON.stringify({ senderAddress, sourceChainId, sourceToken })
772
+ body: JSON.stringify(body)
760
773
  });
761
774
  if (!res.ok) await throwApiError(res);
762
775
  return await res.json();
763
776
  }
777
+ async function setTransferSender(apiBaseUrl, transferId, guestSessionToken, senderAddress, sourceChainId, sourceToken) {
778
+ return putGuestTransferSender(apiBaseUrl, transferId, guestSessionToken, {
779
+ senderAddress,
780
+ sourceChainId,
781
+ sourceToken
782
+ });
783
+ }
764
784
  async function signGuestTransfer(apiBaseUrl, transferId, guestSessionToken, originTxHash) {
765
785
  const res = await fetch(`${apiBaseUrl}/v1/transfers/${transferId}`, {
766
786
  method: "PATCH",
@@ -782,20 +802,6 @@ async function getGuestTransfer(apiBaseUrl, transferId, guestSessionToken) {
782
802
  if (!res.ok) await throwApiError(res);
783
803
  return await res.json();
784
804
  }
785
- async function fetchGuestTransferBalances(apiBaseUrl, transferId, guestSessionToken, walletAddress) {
786
- const params = new URLSearchParams({ walletAddress });
787
- const res = await fetch(
788
- `${apiBaseUrl}/v1/transfers/${transferId}/balances?${params.toString()}`,
789
- {
790
- headers: {
791
- "x-guest-session-token": guestSessionToken
792
- }
793
- }
794
- );
795
- if (!res.ok) await throwApiError(res);
796
- const data = await res.json();
797
- return data.items;
798
- }
799
805
  async function fetchGuestAccount(apiBaseUrl, guestToken) {
800
806
  const params = new URLSearchParams({ guestToken });
801
807
  const res = await fetch(`${apiBaseUrl}/v1/accounts?${params.toString()}`);
@@ -2091,23 +2097,24 @@ function resolvePhase(state) {
2091
2097
  const branchCompleted = !branchGuestSetupComplete && !branchKeepGuestPreauthPin && !branchGuestPostPayLogin && transferCompleted && !state.verificationTarget && !needsPasskeyBootstrap;
2092
2098
  const branchFailed = !branchGuestSetupComplete && !branchKeepGuestPreauthPin && !branchGuestPostPayLogin && !branchCompleted && state.transfer?.status === "FAILED";
2093
2099
  const branchProcessing = !branchGuestSetupComplete && !branchKeepGuestPreauthPin && !branchGuestPostPayLogin && !branchCompleted && !branchFailed && (state.creatingTransfer || isTransferAwaitingCompletion(state.transfer));
2094
- const branchKeepFundingSubflow = !branchGuestSetupComplete && !branchKeepGuestPreauthPin && !branchGuestPostPayLogin && !branchCompleted && !branchFailed && !branchProcessing && isFundingSourceSubflow;
2095
- const branchMobileWalletSetup = !branchGuestSetupComplete && !branchKeepGuestPreauthPin && !branchGuestPostPayLogin && !branchCompleted && !branchFailed && !branchProcessing && !branchKeepFundingSubflow && state.mobileFlow && state.deeplinkUri != null;
2096
- const branchKeepGuestPreauthDesktopOpenWallet = !branchGuestSetupComplete && !branchKeepGuestPreauthPin && !branchGuestPostPayLogin && !branchCompleted && !branchFailed && !branchProcessing && !branchKeepFundingSubflow && !branchMobileWalletSetup && currentPhase.step === "wallet-setup" && currentPhase.mobile == null && currentPhase.guestDesktopExtension === true && state.guestPreauthorizing && !state.privyAuthenticated && !state.loginRequested;
2097
- const branchKeepGuestWalletSetup = !branchGuestSetupComplete && !branchKeepGuestPreauthPin && !branchGuestPostPayLogin && !branchCompleted && !branchFailed && !branchProcessing && !branchKeepFundingSubflow && !branchMobileWalletSetup && !branchKeepGuestPreauthDesktopOpenWallet && currentPhase.step === "wallet-setup" && currentPhase.mobile == null && state.guestPreauthorizing && state.privyAuthenticated && state.activeCredentialId != null;
2098
- const branchGuestTokenPicker = !branchGuestSetupComplete && !branchKeepGuestPreauthPin && !branchGuestPostPayLogin && !branchCompleted && !branchFailed && !branchProcessing && !branchKeepFundingSubflow && !branchMobileWalletSetup && !branchKeepGuestPreauthDesktopOpenWallet && !branchKeepGuestWalletSetup && guestTokenPickerEligible;
2099
- const branchKeepWalletPickerSwitch = !branchGuestSetupComplete && !branchKeepGuestPreauthPin && !branchGuestPostPayLogin && !branchCompleted && !branchFailed && !branchProcessing && !branchKeepFundingSubflow && !branchMobileWalletSetup && !branchKeepGuestPreauthDesktopOpenWallet && !branchKeepGuestWalletSetup && !branchGuestTokenPicker && walletPickerSwitchEligible;
2100
- const branchInitializingPrivy = !branchGuestSetupComplete && !branchKeepGuestPreauthPin && !branchGuestPostPayLogin && !branchCompleted && !branchFailed && !branchProcessing && !branchKeepFundingSubflow && !branchMobileWalletSetup && !branchKeepGuestPreauthDesktopOpenWallet && !branchKeepGuestWalletSetup && !branchGuestTokenPicker && !branchKeepWalletPickerSwitch && !state.privyReady;
2101
- const branchInitializingPasskeyConfig = !branchGuestSetupComplete && !branchKeepGuestPreauthPin && !branchGuestPostPayLogin && !branchCompleted && !branchFailed && !branchProcessing && !branchKeepFundingSubflow && !branchMobileWalletSetup && !branchKeepGuestPreauthDesktopOpenWallet && !branchKeepGuestWalletSetup && !branchGuestTokenPicker && !branchKeepWalletPickerSwitch && !branchInitializingPrivy && state.privyAuthenticated && !state.activeCredentialId && !state.passkeyConfigLoaded;
2102
- const branchOtpVerify = !branchGuestSetupComplete && !branchKeepGuestPreauthPin && !branchGuestPostPayLogin && !branchCompleted && !branchFailed && !branchProcessing && !branchKeepFundingSubflow && !branchMobileWalletSetup && !branchKeepGuestPreauthDesktopOpenWallet && !branchKeepGuestWalletSetup && !branchGuestTokenPicker && !branchKeepWalletPickerSwitch && !branchInitializingPrivy && !branchInitializingPasskeyConfig && state.verificationTarget != null && !state.privyAuthenticated;
2103
- const branchLoginRequested = !branchGuestSetupComplete && !branchKeepGuestPreauthPin && !branchGuestPostPayLogin && !branchCompleted && !branchFailed && !branchProcessing && !branchKeepFundingSubflow && !branchMobileWalletSetup && !branchKeepGuestPreauthDesktopOpenWallet && !branchKeepGuestWalletSetup && !branchGuestTokenPicker && !branchKeepWalletPickerSwitch && !branchInitializingPrivy && !branchInitializingPasskeyConfig && !branchOtpVerify && state.loginRequested;
2104
- const branchPasskeyVerify = !branchGuestSetupComplete && !branchKeepGuestPreauthPin && !branchGuestPostPayLogin && !branchCompleted && !branchFailed && !branchProcessing && !branchKeepFundingSubflow && !branchMobileWalletSetup && !branchKeepGuestPreauthDesktopOpenWallet && !branchKeepGuestWalletSetup && !branchGuestTokenPicker && !branchKeepWalletPickerSwitch && !branchInitializingPrivy && !branchInitializingPasskeyConfig && !branchOtpVerify && !branchLoginRequested && shouldPromptPasskeyVerification;
2105
- const branchPasskeyCreate = !branchGuestSetupComplete && !branchKeepGuestPreauthPin && !branchGuestPostPayLogin && !branchCompleted && !branchFailed && !branchProcessing && !branchKeepFundingSubflow && !branchMobileWalletSetup && !branchKeepGuestPreauthDesktopOpenWallet && !branchKeepGuestWalletSetup && !branchGuestTokenPicker && !branchKeepWalletPickerSwitch && !branchInitializingPrivy && !branchInitializingPasskeyConfig && !branchOtpVerify && !branchLoginRequested && !branchPasskeyVerify && missingActivePasskeyCredential;
2106
- const branchGuestPreauthClaiming = !branchGuestSetupComplete && !branchKeepGuestPreauthPin && !branchGuestPostPayLogin && !branchCompleted && !branchFailed && !branchProcessing && !branchKeepFundingSubflow && !branchMobileWalletSetup && !branchKeepGuestPreauthDesktopOpenWallet && !branchKeepGuestWalletSetup && !branchGuestTokenPicker && !branchKeepWalletPickerSwitch && !branchInitializingPrivy && !branchInitializingPasskeyConfig && !branchOtpVerify && !branchLoginRequested && !branchPasskeyVerify && !branchPasskeyCreate && state.guestPreauthAccountId != null && state.guestSessionToken != null && state.privyAuthenticated && state.activeCredentialId != null && !state.guestPreauthSetupCompletePending && !state.error;
2107
- const branchDataLoading = !branchGuestSetupComplete && !branchKeepGuestPreauthPin && !branchGuestPostPayLogin && !branchCompleted && !branchFailed && !branchProcessing && !branchKeepFundingSubflow && !branchMobileWalletSetup && !branchKeepGuestPreauthDesktopOpenWallet && !branchKeepGuestWalletSetup && !branchGuestTokenPicker && !branchKeepWalletPickerSwitch && !branchInitializingPrivy && !branchInitializingPasskeyConfig && !branchOtpVerify && !branchLoginRequested && !branchPasskeyVerify && !branchPasskeyCreate && !branchGuestPreauthClaiming && state.loadingData && state.activeCredentialId != null && hasActiveWallet(state.accounts);
2108
- const branchWalletPickerLink = !branchGuestSetupComplete && !branchKeepGuestPreauthPin && !branchGuestPostPayLogin && !branchCompleted && !branchFailed && !branchProcessing && !branchKeepFundingSubflow && !branchMobileWalletSetup && !branchKeepGuestPreauthDesktopOpenWallet && !branchKeepGuestWalletSetup && !branchGuestTokenPicker && !branchKeepWalletPickerSwitch && !branchInitializingPrivy && !branchInitializingPasskeyConfig && !branchOtpVerify && !branchLoginRequested && !branchPasskeyVerify && !branchPasskeyCreate && !branchGuestPreauthClaiming && !branchDataLoading && state.activeCredentialId != null && !hasActiveWallet(state.accounts) && !state.mobileFlow;
2109
- const branchDeposit = !branchGuestSetupComplete && !branchKeepGuestPreauthPin && !branchGuestPostPayLogin && !branchCompleted && !branchFailed && !branchProcessing && !branchKeepFundingSubflow && !branchMobileWalletSetup && !branchKeepGuestPreauthDesktopOpenWallet && !branchKeepGuestWalletSetup && !branchGuestTokenPicker && !branchKeepWalletPickerSwitch && !branchInitializingPrivy && !branchInitializingPasskeyConfig && !branchOtpVerify && !branchLoginRequested && !branchPasskeyVerify && !branchPasskeyCreate && !branchGuestPreauthClaiming && !branchDataLoading && !branchWalletPickerLink && state.activeCredentialId != null && hasActiveWallet(state.accounts) && !state.loadingData;
2110
- const branchWalletPickerGuestEntry = !branchGuestSetupComplete && !branchKeepGuestPreauthPin && !branchGuestPostPayLogin && !branchCompleted && !branchFailed && !branchProcessing && !branchKeepFundingSubflow && !branchMobileWalletSetup && !branchKeepGuestPreauthDesktopOpenWallet && !branchKeepGuestWalletSetup && !branchGuestTokenPicker && !branchKeepWalletPickerSwitch && !branchInitializingPrivy && !branchInitializingPasskeyConfig && !branchOtpVerify && !branchLoginRequested && !branchPasskeyVerify && !branchPasskeyCreate && !branchGuestPreauthClaiming && !branchDataLoading && !branchWalletPickerLink && !branchDeposit && state.isGuestFlow;
2100
+ const branchStandardDesktopInlineOpenWallet = !branchGuestSetupComplete && !branchKeepGuestPreauthPin && !branchGuestPostPayLogin && !branchCompleted && !branchFailed && !branchProcessing && state.standardDesktopInlineOpenWallet && state.privyAuthenticated && state.activeCredentialId != null && state.selectedAccountId != null && !state.loginRequested && !state.guestPreauthorizing;
2101
+ const branchKeepFundingSubflow = !branchGuestSetupComplete && !branchKeepGuestPreauthPin && !branchGuestPostPayLogin && !branchCompleted && !branchFailed && !branchProcessing && !branchStandardDesktopInlineOpenWallet && isFundingSourceSubflow;
2102
+ const branchMobileWalletSetup = !branchGuestSetupComplete && !branchKeepGuestPreauthPin && !branchGuestPostPayLogin && !branchCompleted && !branchFailed && !branchProcessing && !branchKeepFundingSubflow && !branchStandardDesktopInlineOpenWallet && state.mobileFlow && state.deeplinkUri != null;
2103
+ const branchKeepGuestPreauthDesktopOpenWallet = !branchGuestSetupComplete && !branchKeepGuestPreauthPin && !branchGuestPostPayLogin && !branchCompleted && !branchFailed && !branchProcessing && !branchKeepFundingSubflow && !branchStandardDesktopInlineOpenWallet && !branchMobileWalletSetup && currentPhase.step === "wallet-setup" && currentPhase.mobile == null && currentPhase.guestDesktopExtension === true && state.guestPreauthorizing && !state.privyAuthenticated && !state.loginRequested;
2104
+ const branchKeepGuestWalletSetup = !branchGuestSetupComplete && !branchKeepGuestPreauthPin && !branchGuestPostPayLogin && !branchCompleted && !branchFailed && !branchProcessing && !branchKeepFundingSubflow && !branchMobileWalletSetup && !branchStandardDesktopInlineOpenWallet && !branchKeepGuestPreauthDesktopOpenWallet && currentPhase.step === "wallet-setup" && currentPhase.mobile == null && state.guestPreauthorizing && state.privyAuthenticated && state.activeCredentialId != null;
2105
+ const branchGuestTokenPicker = !branchGuestSetupComplete && !branchKeepGuestPreauthPin && !branchGuestPostPayLogin && !branchCompleted && !branchFailed && !branchProcessing && !branchKeepFundingSubflow && !branchMobileWalletSetup && !branchStandardDesktopInlineOpenWallet && !branchKeepGuestPreauthDesktopOpenWallet && !branchKeepGuestWalletSetup && guestTokenPickerEligible;
2106
+ const branchKeepWalletPickerSwitch = !branchGuestSetupComplete && !branchKeepGuestPreauthPin && !branchGuestPostPayLogin && !branchCompleted && !branchFailed && !branchProcessing && !branchKeepFundingSubflow && !branchMobileWalletSetup && !branchStandardDesktopInlineOpenWallet && !branchKeepGuestPreauthDesktopOpenWallet && !branchKeepGuestWalletSetup && !branchGuestTokenPicker && walletPickerSwitchEligible;
2107
+ const branchInitializingPrivy = !branchGuestSetupComplete && !branchKeepGuestPreauthPin && !branchGuestPostPayLogin && !branchCompleted && !branchFailed && !branchProcessing && !branchKeepFundingSubflow && !branchMobileWalletSetup && !branchStandardDesktopInlineOpenWallet && !branchKeepGuestPreauthDesktopOpenWallet && !branchKeepGuestWalletSetup && !branchGuestTokenPicker && !branchKeepWalletPickerSwitch && !state.privyReady;
2108
+ const branchInitializingPasskeyConfig = !branchGuestSetupComplete && !branchKeepGuestPreauthPin && !branchGuestPostPayLogin && !branchCompleted && !branchFailed && !branchProcessing && !branchKeepFundingSubflow && !branchMobileWalletSetup && !branchStandardDesktopInlineOpenWallet && !branchKeepGuestPreauthDesktopOpenWallet && !branchKeepGuestWalletSetup && !branchGuestTokenPicker && !branchKeepWalletPickerSwitch && !branchInitializingPrivy && state.privyAuthenticated && !state.activeCredentialId && !state.passkeyConfigLoaded;
2109
+ const branchOtpVerify = !branchGuestSetupComplete && !branchKeepGuestPreauthPin && !branchGuestPostPayLogin && !branchCompleted && !branchFailed && !branchProcessing && !branchKeepFundingSubflow && !branchMobileWalletSetup && !branchStandardDesktopInlineOpenWallet && !branchKeepGuestPreauthDesktopOpenWallet && !branchKeepGuestWalletSetup && !branchGuestTokenPicker && !branchKeepWalletPickerSwitch && !branchInitializingPrivy && !branchInitializingPasskeyConfig && state.verificationTarget != null && !state.privyAuthenticated;
2110
+ const branchLoginRequested = !branchGuestSetupComplete && !branchKeepGuestPreauthPin && !branchGuestPostPayLogin && !branchCompleted && !branchFailed && !branchProcessing && !branchKeepFundingSubflow && !branchMobileWalletSetup && !branchStandardDesktopInlineOpenWallet && !branchKeepGuestPreauthDesktopOpenWallet && !branchKeepGuestWalletSetup && !branchGuestTokenPicker && !branchKeepWalletPickerSwitch && !branchInitializingPrivy && !branchInitializingPasskeyConfig && !branchOtpVerify && state.loginRequested;
2111
+ const branchPasskeyVerify = !branchGuestSetupComplete && !branchKeepGuestPreauthPin && !branchGuestPostPayLogin && !branchCompleted && !branchFailed && !branchProcessing && !branchKeepFundingSubflow && !branchMobileWalletSetup && !branchStandardDesktopInlineOpenWallet && !branchKeepGuestPreauthDesktopOpenWallet && !branchKeepGuestWalletSetup && !branchGuestTokenPicker && !branchKeepWalletPickerSwitch && !branchInitializingPrivy && !branchInitializingPasskeyConfig && !branchOtpVerify && !branchLoginRequested && shouldPromptPasskeyVerification;
2112
+ const branchPasskeyCreate = !branchGuestSetupComplete && !branchKeepGuestPreauthPin && !branchGuestPostPayLogin && !branchCompleted && !branchFailed && !branchProcessing && !branchKeepFundingSubflow && !branchMobileWalletSetup && !branchStandardDesktopInlineOpenWallet && !branchKeepGuestPreauthDesktopOpenWallet && !branchKeepGuestWalletSetup && !branchGuestTokenPicker && !branchKeepWalletPickerSwitch && !branchInitializingPrivy && !branchInitializingPasskeyConfig && !branchOtpVerify && !branchLoginRequested && !branchPasskeyVerify && missingActivePasskeyCredential;
2113
+ const branchGuestPreauthClaiming = !branchGuestSetupComplete && !branchKeepGuestPreauthPin && !branchGuestPostPayLogin && !branchCompleted && !branchFailed && !branchProcessing && !branchKeepFundingSubflow && !branchMobileWalletSetup && !branchStandardDesktopInlineOpenWallet && !branchKeepGuestPreauthDesktopOpenWallet && !branchKeepGuestWalletSetup && !branchGuestTokenPicker && !branchKeepWalletPickerSwitch && !branchInitializingPrivy && !branchInitializingPasskeyConfig && !branchOtpVerify && !branchLoginRequested && !branchPasskeyVerify && !branchPasskeyCreate && state.guestPreauthAccountId != null && state.guestSessionToken != null && state.privyAuthenticated && state.activeCredentialId != null && !state.guestPreauthSetupCompletePending && !state.error;
2114
+ const branchDataLoading = !branchGuestSetupComplete && !branchKeepGuestPreauthPin && !branchGuestPostPayLogin && !branchCompleted && !branchFailed && !branchProcessing && !branchKeepFundingSubflow && !branchMobileWalletSetup && !branchStandardDesktopInlineOpenWallet && !branchKeepGuestPreauthDesktopOpenWallet && !branchKeepGuestWalletSetup && !branchGuestTokenPicker && !branchKeepWalletPickerSwitch && !branchInitializingPrivy && !branchInitializingPasskeyConfig && !branchOtpVerify && !branchLoginRequested && !branchPasskeyVerify && !branchPasskeyCreate && !branchGuestPreauthClaiming && state.loadingData && state.activeCredentialId != null && hasActiveWallet(state.accounts);
2115
+ const branchWalletPickerLink = !branchGuestSetupComplete && !branchKeepGuestPreauthPin && !branchGuestPostPayLogin && !branchCompleted && !branchFailed && !branchProcessing && !branchKeepFundingSubflow && !branchMobileWalletSetup && !branchStandardDesktopInlineOpenWallet && !branchKeepGuestPreauthDesktopOpenWallet && !branchKeepGuestWalletSetup && !branchGuestTokenPicker && !branchKeepWalletPickerSwitch && !branchInitializingPrivy && !branchInitializingPasskeyConfig && !branchOtpVerify && !branchLoginRequested && !branchPasskeyVerify && !branchPasskeyCreate && !branchGuestPreauthClaiming && !branchDataLoading && state.activeCredentialId != null && !hasActiveWallet(state.accounts) && !state.mobileFlow;
2116
+ const branchDeposit = !branchGuestSetupComplete && !branchKeepGuestPreauthPin && !branchGuestPostPayLogin && !branchCompleted && !branchFailed && !branchProcessing && !branchKeepFundingSubflow && !branchMobileWalletSetup && !branchStandardDesktopInlineOpenWallet && !branchKeepGuestPreauthDesktopOpenWallet && !branchKeepGuestWalletSetup && !branchGuestTokenPicker && !branchKeepWalletPickerSwitch && !branchInitializingPrivy && !branchInitializingPasskeyConfig && !branchOtpVerify && !branchLoginRequested && !branchPasskeyVerify && !branchPasskeyCreate && !branchGuestPreauthClaiming && !branchDataLoading && !branchWalletPickerLink && state.activeCredentialId != null && hasActiveWallet(state.accounts) && !state.loadingData;
2117
+ const branchWalletPickerGuestEntry = !branchGuestSetupComplete && !branchKeepGuestPreauthPin && !branchGuestPostPayLogin && !branchCompleted && !branchFailed && !branchProcessing && !branchKeepFundingSubflow && !branchMobileWalletSetup && !branchStandardDesktopInlineOpenWallet && !branchKeepGuestPreauthDesktopOpenWallet && !branchKeepGuestWalletSetup && !branchGuestTokenPicker && !branchKeepWalletPickerSwitch && !branchInitializingPrivy && !branchInitializingPasskeyConfig && !branchOtpVerify && !branchLoginRequested && !branchPasskeyVerify && !branchPasskeyCreate && !branchGuestPreauthClaiming && !branchDataLoading && !branchWalletPickerLink && !branchDeposit && state.isGuestFlow;
2111
2118
  const exclusiveBranchFlags = [
2112
2119
  branchGuestSetupComplete,
2113
2120
  branchKeepGuestPreauthPin,
@@ -2115,6 +2122,7 @@ function resolvePhase(state) {
2115
2122
  branchCompleted,
2116
2123
  branchFailed,
2117
2124
  branchProcessing,
2125
+ branchStandardDesktopInlineOpenWallet,
2118
2126
  branchKeepFundingSubflow,
2119
2127
  branchMobileWalletSetup,
2120
2128
  branchKeepGuestPreauthDesktopOpenWallet,
@@ -2143,6 +2151,7 @@ function resolvePhase(state) {
2143
2151
  branchCompleted,
2144
2152
  branchFailed,
2145
2153
  branchProcessing,
2154
+ branchStandardDesktopInlineOpenWallet,
2146
2155
  branchKeepFundingSubflow,
2147
2156
  branchMobileWalletSetup,
2148
2157
  branchKeepGuestPreauthDesktopOpenWallet,
@@ -2180,6 +2189,13 @@ function resolvePhase(state) {
2180
2189
  };
2181
2190
  } else if (branchProcessing) {
2182
2191
  nextPhase = { step: "processing", transfer: state.transfer };
2192
+ } else if (branchStandardDesktopInlineOpenWallet) {
2193
+ nextPhase = {
2194
+ step: "wallet-setup",
2195
+ mobile: null,
2196
+ accountId: state.selectedAccountId,
2197
+ guestDesktopExtension: true
2198
+ };
2183
2199
  } else if (branchKeepFundingSubflow) {
2184
2200
  nextPhase = currentPhase;
2185
2201
  } else if (branchMobileWalletSetup) {
@@ -2288,6 +2304,7 @@ function createInitialState(config) {
2288
2304
  activePublicKey: null,
2289
2305
  loginRequested: false,
2290
2306
  guestPreauthorizing: false,
2307
+ standardDesktopInlineOpenWallet: false,
2291
2308
  guestPreauthSetupCompletePending: false,
2292
2309
  privyReady: false,
2293
2310
  privyAuthenticated: false
@@ -2674,6 +2691,8 @@ function applyAction(state, action) {
2674
2691
  return { ...state, error: action.error };
2675
2692
  case "SET_ONE_TAP_LIMIT_SAVED_DURING_SETUP":
2676
2693
  return { ...state, oneTapLimitSavedDuringSetup: action.saved };
2694
+ case "SET_STANDARD_DESKTOP_INLINE_OPEN_WALLET":
2695
+ return { ...state, standardDesktopInlineOpenWallet: action.value };
2677
2696
  // ── Lifecycle ────────────────────────────────────────────────
2678
2697
  case "NEW_PAYMENT":
2679
2698
  return {
@@ -2695,7 +2714,8 @@ function applyAction(state, action) {
2695
2714
  loginRequested: false,
2696
2715
  oneTapLimitSavedDuringSetup: false,
2697
2716
  guestPreauthorizing: false,
2698
- guestPreauthSetupCompletePending: false
2717
+ guestPreauthSetupCompletePending: false,
2718
+ standardDesktopInlineOpenWallet: false
2699
2719
  };
2700
2720
  case "LOGOUT":
2701
2721
  return {
@@ -3499,10 +3519,15 @@ function LoginScreen({
3499
3519
  error,
3500
3520
  onBack,
3501
3521
  merchantInitials,
3502
- onSocialLogin
3522
+ onSocialLogin,
3523
+ heroTitle,
3524
+ heroSubtitle,
3525
+ inputPlaceholder
3503
3526
  }) {
3504
3527
  const { tokens } = useBlinkConfig();
3505
3528
  const disabled = authInput.trim().length === 0 || sending;
3529
+ const heading = heroTitle ?? "Your Money. Any App.\nOne Tap.";
3530
+ const placeholder = inputPlaceholder ?? "Email or phone number";
3506
3531
  return /* @__PURE__ */ jsxRuntime.jsxs(
3507
3532
  ScreenLayout,
3508
3533
  {
@@ -3537,7 +3562,8 @@ function LoginScreen({
3537
3562
  ),
3538
3563
  /* @__PURE__ */ jsxRuntime.jsxs("div", { style: contentStyle, children: [
3539
3564
  /* @__PURE__ */ jsxRuntime.jsx("img", { src: BLINK_LOGO, alt: "Blink", style: logoStyle }),
3540
- /* @__PURE__ */ jsxRuntime.jsx("h2", { style: headingStyle(tokens.text), children: "Your Money. Any App.\nOne Tap." }),
3565
+ /* @__PURE__ */ jsxRuntime.jsx("h2", { style: headingStyle(tokens.text), children: heading }),
3566
+ heroSubtitle ? /* @__PURE__ */ jsxRuntime.jsx("p", { style: subtitleStyle(tokens.textMuted), children: heroSubtitle }) : null,
3541
3567
  error && /* @__PURE__ */ jsxRuntime.jsx("div", { style: errorStyle(tokens), children: error }),
3542
3568
  /* @__PURE__ */ jsxRuntime.jsx(
3543
3569
  "input",
@@ -3546,7 +3572,7 @@ function LoginScreen({
3546
3572
  type: "text",
3547
3573
  inputMode: "text",
3548
3574
  autoComplete: "username",
3549
- placeholder: "Email or phone number",
3575
+ placeholder,
3550
3576
  value: authInput,
3551
3577
  onChange: (e) => onAuthInputChange(e.target.value),
3552
3578
  onKeyDown: (e) => {
@@ -3591,6 +3617,14 @@ var headingStyle = (color) => ({
3591
3617
  margin: "20px 0 8px",
3592
3618
  whiteSpace: "pre-line"
3593
3619
  });
3620
+ var subtitleStyle = (color) => ({
3621
+ fontSize: "0.9rem",
3622
+ fontWeight: 500,
3623
+ lineHeight: 1.45,
3624
+ color,
3625
+ margin: "0 0 16px",
3626
+ maxWidth: 320
3627
+ });
3594
3628
  var inputStyle2 = (tokens) => ({
3595
3629
  width: "100%",
3596
3630
  padding: "15px 16px",
@@ -3713,7 +3747,7 @@ function OtpVerifyScreen({
3713
3747
  /* @__PURE__ */ jsxRuntime.jsx(ScreenHeader, { onBack }),
3714
3748
  /* @__PURE__ */ jsxRuntime.jsxs("div", { style: contentStyle2, children: [
3715
3749
  /* @__PURE__ */ jsxRuntime.jsx("h2", { style: headingStyle2(tokens.text), children: "Confirm it is you" }),
3716
- /* @__PURE__ */ jsxRuntime.jsxs("p", { style: subtitleStyle(tokens.textSecondary), children: [
3750
+ /* @__PURE__ */ jsxRuntime.jsxs("p", { style: subtitleStyle2(tokens.textSecondary), children: [
3717
3751
  "We sent a 6-digit code to",
3718
3752
  "\n",
3719
3753
  /* @__PURE__ */ jsxRuntime.jsx("strong", { children: maskedIdentifier })
@@ -3749,7 +3783,7 @@ var headingStyle2 = (color) => ({
3749
3783
  color,
3750
3784
  margin: "20px 0 8px"
3751
3785
  });
3752
- var subtitleStyle = (color) => ({
3786
+ var subtitleStyle2 = (color) => ({
3753
3787
  fontSize: "0.88rem",
3754
3788
  color,
3755
3789
  margin: "0 0 28px",
@@ -3802,7 +3836,7 @@ function PasskeyScreen({
3802
3836
  /* @__PURE__ */ jsxRuntime.jsx(ScreenHeader, { onBack, onLogout }),
3803
3837
  /* @__PURE__ */ jsxRuntime.jsxs("div", { style: contentStyle3, children: [
3804
3838
  /* @__PURE__ */ jsxRuntime.jsx("h2", { style: headingStyle3(tokens.text), children: "Secure your account with a passkey" }),
3805
- /* @__PURE__ */ jsxRuntime.jsx("p", { style: subtitleStyle2(tokens.textSecondary), children: "This enables secure one-tap deposits on this device" }),
3839
+ /* @__PURE__ */ jsxRuntime.jsx("p", { style: subtitleStyle3(tokens.textSecondary), children: "This enables secure one-tap deposits on this device" }),
3806
3840
  error && /* @__PURE__ */ jsxRuntime.jsx("div", { style: errorBannerStyle2(tokens), children: error })
3807
3841
  ] })
3808
3842
  ]
@@ -3824,7 +3858,7 @@ var headingStyle3 = (color) => ({
3824
3858
  color,
3825
3859
  margin: "24px 0 8px"
3826
3860
  });
3827
- var subtitleStyle2 = (color) => ({
3861
+ var subtitleStyle3 = (color) => ({
3828
3862
  fontSize: "0.86rem",
3829
3863
  color,
3830
3864
  margin: "0 0 20px",
@@ -3842,6 +3876,72 @@ var errorBannerStyle2 = (tokens) => ({
3842
3876
  width: "100%",
3843
3877
  textAlign: "left"
3844
3878
  });
3879
+ function VerifyPasskeyScreen({
3880
+ onVerify,
3881
+ onBack,
3882
+ verifying,
3883
+ error
3884
+ }) {
3885
+ const { tokens } = useBlinkConfig();
3886
+ return /* @__PURE__ */ jsxRuntime.jsxs(
3887
+ ScreenLayout,
3888
+ {
3889
+ footer: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
3890
+ /* @__PURE__ */ jsxRuntime.jsx(PrimaryButton, { onClick: onVerify, disabled: verifying, loading: verifying, children: "Verify passkey" }),
3891
+ /* @__PURE__ */ jsxRuntime.jsx(PoweredByFooter, {})
3892
+ ] }),
3893
+ children: [
3894
+ /* @__PURE__ */ jsxRuntime.jsx(ScreenHeader, { onBack }),
3895
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { style: contentStyle4, children: [
3896
+ /* @__PURE__ */ jsxRuntime.jsx(IconCircle, { variant: "accent", size: 64, children: /* @__PURE__ */ jsxRuntime.jsxs("svg", { width: "36", height: "36", viewBox: "0 0 24 24", fill: "none", children: [
3897
+ /* @__PURE__ */ jsxRuntime.jsx("rect", { x: "4", y: "4", width: "16", height: "16", rx: "3", stroke: tokens.accent, strokeWidth: "1.5", strokeDasharray: "3 2" }),
3898
+ /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "9", cy: "10", r: "1", fill: tokens.accent }),
3899
+ /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "15", cy: "10", r: "1", fill: tokens.accent }),
3900
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M9 14c0 1.5 1.34 2.5 3 2.5s3-1 3-2.5", stroke: tokens.accent, strokeWidth: "1.2", strokeLinecap: "round" })
3901
+ ] }) }),
3902
+ /* @__PURE__ */ jsxRuntime.jsx("h2", { style: headingStyle4(tokens.text), children: "Verify your passkey" }),
3903
+ /* @__PURE__ */ jsxRuntime.jsx("p", { style: subtitleStyle4(tokens.textSecondary), children: "Your browser requires a separate window to verify your passkey. Tap the button below to continue." }),
3904
+ error && /* @__PURE__ */ jsxRuntime.jsx("div", { style: errorBannerStyle3(tokens), children: error }),
3905
+ /* @__PURE__ */ jsxRuntime.jsx(InfoBanner, { children: "Your passkey is stored securely on your device. Blink never sees your biometric data." })
3906
+ ] })
3907
+ ]
3908
+ }
3909
+ );
3910
+ }
3911
+ var contentStyle4 = {
3912
+ textAlign: "center",
3913
+ flex: 1,
3914
+ display: "flex",
3915
+ flexDirection: "column",
3916
+ alignItems: "center",
3917
+ paddingTop: 32
3918
+ };
3919
+ var headingStyle4 = (color) => ({
3920
+ fontSize: "1.45rem",
3921
+ fontWeight: 700,
3922
+ letterSpacing: "-0.02em",
3923
+ color,
3924
+ margin: "24px 0 8px"
3925
+ });
3926
+ var subtitleStyle4 = (color) => ({
3927
+ fontSize: "0.9rem",
3928
+ color,
3929
+ margin: "0 0 28px",
3930
+ lineHeight: 1.5,
3931
+ maxWidth: 280
3932
+ });
3933
+ var errorBannerStyle3 = (tokens) => ({
3934
+ background: tokens.errorBg,
3935
+ border: `1px solid ${tokens.error}66`,
3936
+ borderRadius: 16,
3937
+ padding: "11px 14px",
3938
+ color: tokens.error,
3939
+ fontSize: "0.84rem",
3940
+ marginBottom: 14,
3941
+ lineHeight: 1.5,
3942
+ width: "100%",
3943
+ textAlign: "left"
3944
+ });
3845
3945
  function Spinner({ size = 40, label }) {
3846
3946
  const { tokens } = useBlinkConfig();
3847
3947
  return /* @__PURE__ */ jsxRuntime.jsxs(
@@ -3985,8 +4085,8 @@ function WalletPickerScreen({
3985
4085
  children: [
3986
4086
  /* @__PURE__ */ jsxRuntime.jsx(ScreenHeader, { title: "Set up Blink", onBack, onLogout }),
3987
4087
  hasPending && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
3988
- /* @__PURE__ */ jsxRuntime.jsx("h2", { style: headingStyle4(tokens.text), children: "Continue where you left off" }),
3989
- /* @__PURE__ */ jsxRuntime.jsx("p", { style: subtitleStyle3(tokens.textSecondary), children: "You have a wallet that still needs setup" }),
4088
+ /* @__PURE__ */ jsxRuntime.jsx("h2", { style: headingStyle5(tokens.text), children: "Continue where you left off" }),
4089
+ /* @__PURE__ */ jsxRuntime.jsx("p", { style: subtitleStyle5(tokens.textSecondary), children: "You have a wallet that still needs setup" }),
3990
4090
  /* @__PURE__ */ jsxRuntime.jsx("div", { style: pendingListStyle, children: pendingConnections.map((acct) => {
3991
4091
  const wallet = acct.wallets[0];
3992
4092
  const address = wallet ? truncateAddress(wallet.name) : void 0;
@@ -4025,7 +4125,7 @@ function WalletPickerScreen({
4025
4125
  }) }),
4026
4126
  /* @__PURE__ */ jsxRuntime.jsx("div", { style: dividerStyle2(tokens.border), children: /* @__PURE__ */ jsxRuntime.jsx("span", { style: dividerTextStyle(tokens.textMuted), children: "Or connect a new wallet" }) })
4027
4127
  ] }),
4028
- !hasPending && /* @__PURE__ */ jsxRuntime.jsx("h2", { style: headingStyle4(tokens.text), children: "Where is your money?" }),
4128
+ !hasPending && /* @__PURE__ */ jsxRuntime.jsx("h2", { style: headingStyle5(tokens.text), children: "Where is your money?" }),
4029
4129
  /* @__PURE__ */ jsxRuntime.jsxs(
4030
4130
  "button",
4031
4131
  {
@@ -4096,14 +4196,14 @@ function WalletPickerScreen({
4096
4196
  }
4097
4197
  );
4098
4198
  }
4099
- var headingStyle4 = (color) => ({
4199
+ var headingStyle5 = (color) => ({
4100
4200
  fontSize: "1.35rem",
4101
4201
  fontWeight: 700,
4102
4202
  letterSpacing: "-0.02em",
4103
4203
  color,
4104
4204
  margin: "8px 0 4px"
4105
4205
  });
4106
- var subtitleStyle3 = (color) => ({
4206
+ var subtitleStyle5 = (color) => ({
4107
4207
  fontSize: "0.88rem",
4108
4208
  color,
4109
4209
  margin: "0 0 24px"
@@ -4339,8 +4439,8 @@ function SetupScreen({
4339
4439
  ] }),
4340
4440
  children: [
4341
4441
  /* @__PURE__ */ jsxRuntime.jsx(ScreenHeader, { onBack, onLogout }),
4342
- /* @__PURE__ */ jsxRuntime.jsx("h2", { style: headingStyle5(tokens.text), children: "Set Spending Limit" }),
4343
- error && /* @__PURE__ */ jsxRuntime.jsx("div", { style: errorBannerStyle3(tokens), children: error }),
4442
+ /* @__PURE__ */ jsxRuntime.jsx("h2", { style: headingStyle6(tokens.text), children: "Set Spending Limit" }),
4443
+ error && /* @__PURE__ */ jsxRuntime.jsx("div", { style: errorBannerStyle4(tokens), children: error }),
4344
4444
  /* @__PURE__ */ jsxRuntime.jsxs("div", { style: amountRowStyle, children: [
4345
4445
  /* @__PURE__ */ jsxRuntime.jsx("div", { style: { flex: 1 }, children: editing ? /* @__PURE__ */ jsxRuntime.jsxs("div", { style: limitValueStyle(tokens.text), children: [
4346
4446
  "$",
@@ -4415,7 +4515,7 @@ function SetupScreen({
4415
4515
  }
4416
4516
  );
4417
4517
  }
4418
- var headingStyle5 = (color) => ({
4518
+ var headingStyle6 = (color) => ({
4419
4519
  fontSize: "1.1rem",
4420
4520
  fontWeight: 700,
4421
4521
  letterSpacing: "-0.02em",
@@ -4423,7 +4523,7 @@ var headingStyle5 = (color) => ({
4423
4523
  margin: "8px 0 24px",
4424
4524
  textAlign: "center"
4425
4525
  });
4426
- var errorBannerStyle3 = (tokens) => ({
4526
+ var errorBannerStyle4 = (tokens) => ({
4427
4527
  background: tokens.errorBg,
4428
4528
  border: `1px solid ${tokens.error}66`,
4429
4529
  borderRadius: 16,
@@ -4514,10 +4614,10 @@ function SetupStatusScreen({
4514
4614
  if (complete) {
4515
4615
  return /* @__PURE__ */ jsxRuntime.jsxs(ScreenLayout, { footer: /* @__PURE__ */ jsxRuntime.jsx(PoweredByFooter, {}), children: [
4516
4616
  /* @__PURE__ */ jsxRuntime.jsx(ScreenHeader, { onBack: onContinue }),
4517
- /* @__PURE__ */ jsxRuntime.jsxs("div", { style: contentStyle4, children: [
4617
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { style: contentStyle5, children: [
4518
4618
  /* @__PURE__ */ jsxRuntime.jsx("img", { src: BLINK_LOGO, alt: "Blink", style: mascotStyle2 }),
4519
- /* @__PURE__ */ jsxRuntime.jsx("h2", { style: headingStyle6(tokens.text), children: "Done!" }),
4520
- /* @__PURE__ */ jsxRuntime.jsx("p", { style: subtitleStyle4(tokens.textSecondary), children: "Return to the app to try one-tap deposits." })
4619
+ /* @__PURE__ */ jsxRuntime.jsx("h2", { style: headingStyle7(tokens.text), children: "Done!" }),
4620
+ /* @__PURE__ */ jsxRuntime.jsx("p", { style: subtitleStyle6(tokens.textSecondary), children: "Return to the app to try one-tap deposits." })
4521
4621
  ] })
4522
4622
  ] });
4523
4623
  }
@@ -4527,16 +4627,16 @@ function SetupStatusScreen({
4527
4627
  ];
4528
4628
  return /* @__PURE__ */ jsxRuntime.jsxs(ScreenLayout, { children: [
4529
4629
  /* @__PURE__ */ jsxRuntime.jsx(ScreenHeader, { onLogout }),
4530
- /* @__PURE__ */ jsxRuntime.jsxs("div", { style: contentStyle4, children: [
4630
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { style: contentStyle5, children: [
4531
4631
  /* @__PURE__ */ jsxRuntime.jsx(Spinner, { size: 48 }),
4532
- /* @__PURE__ */ jsxRuntime.jsx("h2", { style: headingStyle6(tokens.text), children: "Setting up One-Tap..." }),
4533
- error && /* @__PURE__ */ jsxRuntime.jsx("div", { style: errorBannerStyle4(tokens), children: error }),
4632
+ /* @__PURE__ */ jsxRuntime.jsx("h2", { style: headingStyle7(tokens.text), children: "Setting up One-Tap..." }),
4633
+ error && /* @__PURE__ */ jsxRuntime.jsx("div", { style: errorBannerStyle5(tokens), children: error }),
4534
4634
  /* @__PURE__ */ jsxRuntime.jsx("div", { style: stepsWrapStyle, children: /* @__PURE__ */ jsxRuntime.jsx(StepList, { steps }) }),
4535
4635
  /* @__PURE__ */ jsxRuntime.jsx("p", { style: waitHintStyle(tokens.textMuted), children: "Usually takes a few seconds" })
4536
4636
  ] })
4537
4637
  ] });
4538
4638
  }
4539
- var contentStyle4 = {
4639
+ var contentStyle5 = {
4540
4640
  flex: 1,
4541
4641
  display: "flex",
4542
4642
  flexDirection: "column",
@@ -4549,21 +4649,21 @@ var mascotStyle2 = {
4549
4649
  width: 56,
4550
4650
  height: 56
4551
4651
  };
4552
- var headingStyle6 = (color) => ({
4652
+ var headingStyle7 = (color) => ({
4553
4653
  fontSize: "1.45rem",
4554
4654
  fontWeight: 700,
4555
4655
  letterSpacing: "-0.02em",
4556
4656
  color,
4557
4657
  margin: "20px 0 8px"
4558
4658
  });
4559
- var subtitleStyle4 = (color) => ({
4659
+ var subtitleStyle6 = (color) => ({
4560
4660
  fontSize: "0.9rem",
4561
4661
  color,
4562
4662
  margin: "0 0 28px",
4563
4663
  lineHeight: 1.5,
4564
4664
  maxWidth: 260
4565
4665
  });
4566
- var errorBannerStyle4 = (tokens) => ({
4666
+ var errorBannerStyle5 = (tokens) => ({
4567
4667
  background: tokens.errorBg,
4568
4668
  border: `1px solid ${tokens.error}66`,
4569
4669
  borderRadius: 16,
@@ -4768,7 +4868,7 @@ function DepositScreen({
4768
4868
  minDepositFloor.toFixed(2),
4769
4869
  " to deposit via One-Tap."
4770
4870
  ] }),
4771
- error && /* @__PURE__ */ jsxRuntime.jsx("div", { style: errorBannerStyle5(tokens), children: error })
4871
+ error && /* @__PURE__ */ jsxRuntime.jsx("div", { style: errorBannerStyle6(tokens), children: error })
4772
4872
  ]
4773
4873
  }
4774
4874
  );
@@ -4954,7 +5054,7 @@ var spendingLimitStyle = (color) => ({
4954
5054
  color,
4955
5055
  marginBottom: 8
4956
5056
  });
4957
- var errorBannerStyle5 = (tokens) => ({
5057
+ var errorBannerStyle6 = (tokens) => ({
4958
5058
  background: tokens.errorBg,
4959
5059
  border: `1px solid ${tokens.error}66`,
4960
5060
  borderRadius: 16,
@@ -4999,22 +5099,22 @@ function SuccessScreen({
4999
5099
  ] }),
5000
5100
  children: [
5001
5101
  /* @__PURE__ */ jsxRuntime.jsx(ScreenHeader, { onLogout }),
5002
- /* @__PURE__ */ jsxRuntime.jsxs("div", { style: contentStyle5, children: [
5102
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { style: contentStyle6, children: [
5003
5103
  succeeded ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
5004
5104
  /* @__PURE__ */ jsxRuntime.jsx(IconCircle, { variant: "success", size: 64, children: /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "32", height: "32", viewBox: "0 0 24 24", fill: "none", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z", fill: tokens.success }) }) }),
5005
- /* @__PURE__ */ jsxRuntime.jsxs("h2", { style: headingStyle7(tokens.text), children: [
5105
+ /* @__PURE__ */ jsxRuntime.jsxs("h2", { style: headingStyle8(tokens.text), children: [
5006
5106
  "$",
5007
5107
  amount.toFixed(2),
5008
5108
  " deposited"
5009
5109
  ] }),
5010
- merchantName && /* @__PURE__ */ jsxRuntime.jsxs("p", { style: subtitleStyle5(tokens.textSecondary), children: [
5110
+ merchantName && /* @__PURE__ */ jsxRuntime.jsxs("p", { style: subtitleStyle7(tokens.textSecondary), children: [
5011
5111
  "to ",
5012
5112
  merchantName
5013
5113
  ] })
5014
5114
  ] }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
5015
5115
  /* @__PURE__ */ jsxRuntime.jsx(IconCircle, { variant: "error", size: 64, children: /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "32", height: "32", viewBox: "0 0 24 24", fill: "none", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z", fill: tokens.error }) }) }),
5016
- /* @__PURE__ */ jsxRuntime.jsx("h2", { style: headingStyle7(tokens.text), children: "Transfer failed" }),
5017
- error && /* @__PURE__ */ jsxRuntime.jsx("p", { style: subtitleStyle5(tokens.error), children: error })
5116
+ /* @__PURE__ */ jsxRuntime.jsx("h2", { style: headingStyle8(tokens.text), children: "Transfer failed" }),
5117
+ error && /* @__PURE__ */ jsxRuntime.jsx("p", { style: subtitleStyle7(tokens.error), children: error })
5018
5118
  ] }),
5019
5119
  /* @__PURE__ */ jsxRuntime.jsxs("div", { style: summaryCardStyle(tokens), children: [
5020
5120
  sourceName && /* @__PURE__ */ jsxRuntime.jsxs("div", { style: summaryRowStyle, children: [
@@ -5046,21 +5146,21 @@ function SuccessScreen({
5046
5146
  }
5047
5147
  );
5048
5148
  }
5049
- var contentStyle5 = {
5149
+ var contentStyle6 = {
5050
5150
  flex: 1,
5051
5151
  display: "flex",
5052
5152
  flexDirection: "column",
5053
5153
  alignItems: "center",
5054
5154
  paddingTop: 16
5055
5155
  };
5056
- var headingStyle7 = (color) => ({
5156
+ var headingStyle8 = (color) => ({
5057
5157
  fontSize: "1.5rem",
5058
5158
  fontWeight: 700,
5059
5159
  letterSpacing: "-0.02em",
5060
5160
  color,
5061
5161
  margin: "20px 0 4px"
5062
5162
  });
5063
- var subtitleStyle5 = (color) => ({
5163
+ var subtitleStyle7 = (color) => ({
5064
5164
  fontSize: "0.9rem",
5065
5165
  color,
5066
5166
  margin: "0 0 20px"
@@ -5174,7 +5274,7 @@ function SelectSourceScreen({
5174
5274
  onLogout
5175
5275
  }
5176
5276
  ),
5177
- /* @__PURE__ */ jsxRuntime.jsx("p", { style: subtitleStyle6(tokens.textMuted), children: "Choose which chain and token to pay from." }),
5277
+ /* @__PURE__ */ jsxRuntime.jsx("p", { style: subtitleStyle8(tokens.textMuted), children: "Choose which chain and token to pay from." }),
5178
5278
  /* @__PURE__ */ jsxRuntime.jsx("label", { style: labelStyle4(tokens.textSecondary), children: "Chain" }),
5179
5279
  /* @__PURE__ */ jsxRuntime.jsx("div", { style: optionListStyle, children: choices.map((chain) => {
5180
5280
  const isSelected = chain.chainName === selectedChainName;
@@ -5235,7 +5335,7 @@ function SelectSourceScreen({
5235
5335
  }
5236
5336
  );
5237
5337
  }
5238
- var subtitleStyle6 = (color) => ({
5338
+ var subtitleStyle8 = (color) => ({
5239
5339
  fontSize: "0.85rem",
5240
5340
  color,
5241
5341
  margin: "0 0 20px",
@@ -5377,8 +5477,8 @@ function AdvancedSourceScreen({
5377
5477
  right: /* @__PURE__ */ jsxRuntime.jsx("span", { style: advancedBadgeStyle(tokens.accent), children: "Advanced" })
5378
5478
  }
5379
5479
  ),
5380
- /* @__PURE__ */ jsxRuntime.jsx("h2", { style: headingStyle8(tokens.text), children: "Set up One-Tap deposits" }),
5381
- /* @__PURE__ */ jsxRuntime.jsx("p", { style: subtitleStyle7(tokens.textSecondary), children: "Select a token source for your One-Tap deposits." }),
5480
+ /* @__PURE__ */ jsxRuntime.jsx("h2", { style: headingStyle9(tokens.text), children: "Set up One-Tap deposits" }),
5481
+ /* @__PURE__ */ jsxRuntime.jsx("p", { style: subtitleStyle9(tokens.textSecondary), children: "Select a token source for your One-Tap deposits." }),
5382
5482
  /* @__PURE__ */ jsxRuntime.jsx("label", { style: labelStyle5(tokens.textSecondary), children: "Select tokens to approve" }),
5383
5483
  /* @__PURE__ */ jsxRuntime.jsx("div", { style: chainListStyle, children: choices.map((chain) => {
5384
5484
  const isExpanded = expandedChain === chain.chainName;
@@ -5441,14 +5541,14 @@ var advancedBadgeStyle = (color) => ({
5441
5541
  padding: "3px 10px",
5442
5542
  letterSpacing: "0.02em"
5443
5543
  });
5444
- var headingStyle8 = (color) => ({
5544
+ var headingStyle9 = (color) => ({
5445
5545
  fontSize: "1.3rem",
5446
5546
  fontWeight: 700,
5447
5547
  letterSpacing: "-0.02em",
5448
5548
  color,
5449
5549
  margin: "8px 0 4px"
5450
5550
  });
5451
- var subtitleStyle7 = (color) => ({
5551
+ var subtitleStyle9 = (color) => ({
5452
5552
  fontSize: "0.86rem",
5453
5553
  color,
5454
5554
  margin: "0 0 20px",
@@ -5576,15 +5676,15 @@ function TransferStatusScreen({
5576
5676
  const steps = buildSteps(phase);
5577
5677
  return /* @__PURE__ */ jsxRuntime.jsxs(ScreenLayout, { footer: /* @__PURE__ */ jsxRuntime.jsx(PoweredByFooter, {}), children: [
5578
5678
  /* @__PURE__ */ jsxRuntime.jsx(ScreenHeader, { onLogout }),
5579
- /* @__PURE__ */ jsxRuntime.jsxs("div", { style: contentStyle6, children: [
5679
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { style: contentStyle7, children: [
5580
5680
  /* @__PURE__ */ jsxRuntime.jsx(Spinner, { size: 64 }),
5581
- /* @__PURE__ */ jsxRuntime.jsx("h2", { style: headingStyle9(tokens.text), children: "Depositing your money..." }),
5582
- error && /* @__PURE__ */ jsxRuntime.jsx("div", { style: errorBannerStyle6(tokens), children: error }),
5681
+ /* @__PURE__ */ jsxRuntime.jsx("h2", { style: headingStyle10(tokens.text), children: "Depositing your money..." }),
5682
+ error && /* @__PURE__ */ jsxRuntime.jsx("div", { style: errorBannerStyle7(tokens), children: error }),
5583
5683
  /* @__PURE__ */ jsxRuntime.jsx("div", { style: stepsWrapStyle2, children: /* @__PURE__ */ jsxRuntime.jsx(StepList, { steps }) })
5584
5684
  ] })
5585
5685
  ] });
5586
5686
  }
5587
- var contentStyle6 = {
5687
+ var contentStyle7 = {
5588
5688
  flex: 1,
5589
5689
  display: "flex",
5590
5690
  flexDirection: "column",
@@ -5593,14 +5693,14 @@ var contentStyle6 = {
5593
5693
  textAlign: "center",
5594
5694
  padding: "0 24px"
5595
5695
  };
5596
- var headingStyle9 = (color) => ({
5696
+ var headingStyle10 = (color) => ({
5597
5697
  fontSize: "1.45rem",
5598
5698
  fontWeight: 700,
5599
5699
  letterSpacing: "-0.02em",
5600
5700
  color,
5601
5701
  margin: "20px 0 16px"
5602
5702
  });
5603
- var errorBannerStyle6 = (tokens) => ({
5703
+ var errorBannerStyle7 = (tokens) => ({
5604
5704
  background: tokens.errorBg,
5605
5705
  border: `1px solid ${tokens.error}66`,
5606
5706
  borderRadius: 16,
@@ -5654,14 +5754,14 @@ function OpenWalletScreen({
5654
5754
  ] }),
5655
5755
  children: [
5656
5756
  /* @__PURE__ */ jsxRuntime.jsx(ScreenHeader, { onLogout }),
5657
- /* @__PURE__ */ jsxRuntime.jsxs("div", { style: contentStyle7, children: [
5757
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { style: contentStyle8, children: [
5658
5758
  /* @__PURE__ */ jsxRuntime.jsx("div", { style: logoCircleStyle(tokens.bgInput), children: logoSrc ? /* @__PURE__ */ jsxRuntime.jsx("img", { src: logoSrc, alt: displayName, style: logoStyle2 }) : /* @__PURE__ */ jsxRuntime.jsx(Spinner, { size: 32 }) }),
5659
- /* @__PURE__ */ jsxRuntime.jsxs("h2", { style: headingStyle10(tokens.text), children: [
5759
+ /* @__PURE__ */ jsxRuntime.jsxs("h2", { style: headingStyle11(tokens.text), children: [
5660
5760
  "Setting up ",
5661
5761
  displayName,
5662
5762
  "..."
5663
5763
  ] }),
5664
- /* @__PURE__ */ jsxRuntime.jsx("p", { style: subtitleStyle8(tokens.textSecondary), children: "Approve the connection in your wallet extension." }),
5764
+ /* @__PURE__ */ jsxRuntime.jsx("p", { style: subtitleStyle10(tokens.textSecondary), children: "Approve the connection in your wallet extension." }),
5665
5765
  /* @__PURE__ */ jsxRuntime.jsxs("div", { style: waitingBadgeStyle(tokens), children: [
5666
5766
  /* @__PURE__ */ jsxRuntime.jsx(Spinner, { size: 14 }),
5667
5767
  /* @__PURE__ */ jsxRuntime.jsx("span", { children: "Waiting for authorization..." })
@@ -5687,10 +5787,10 @@ function OpenWalletScreen({
5687
5787
  ] }),
5688
5788
  children: [
5689
5789
  /* @__PURE__ */ jsxRuntime.jsx(ScreenHeader, { onBack, onLogout }),
5690
- /* @__PURE__ */ jsxRuntime.jsxs("div", { style: contentStyle7, children: [
5790
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { style: contentStyle8, children: [
5691
5791
  /* @__PURE__ */ jsxRuntime.jsx("div", { style: logoCircleStyle(tokens.bgInput), children: logoSrc ? /* @__PURE__ */ jsxRuntime.jsx("img", { src: logoSrc, alt: displayName, style: logoStyle2 }) : /* @__PURE__ */ jsxRuntime.jsx(Spinner, { size: 32 }) }),
5692
- /* @__PURE__ */ jsxRuntime.jsx("h2", { style: headingStyle10(tokens.text), children: loading ? "Connecting..." : `Open ${displayName}` }),
5693
- /* @__PURE__ */ jsxRuntime.jsx("p", { style: subtitleStyle8(tokens.textSecondary), children: loading ? "Creating transfer and preparing your wallet link..." : `Continue in ${displayName} to authorize this connection.` }),
5792
+ /* @__PURE__ */ jsxRuntime.jsx("h2", { style: headingStyle11(tokens.text), children: loading ? "Connecting..." : `Open ${displayName}` }),
5793
+ /* @__PURE__ */ jsxRuntime.jsx("p", { style: subtitleStyle10(tokens.textSecondary), children: loading ? "Creating transfer and preparing your wallet link..." : `Continue in ${displayName} to authorize this connection.` }),
5694
5794
  !loading && /* @__PURE__ */ jsxRuntime.jsxs("div", { style: waitingBadgeStyle(tokens), children: [
5695
5795
  /* @__PURE__ */ jsxRuntime.jsx(Spinner, { size: 14 }),
5696
5796
  /* @__PURE__ */ jsxRuntime.jsx("span", { children: "Waiting for authorization..." })
@@ -5700,7 +5800,7 @@ function OpenWalletScreen({
5700
5800
  }
5701
5801
  );
5702
5802
  }
5703
- var contentStyle7 = {
5803
+ var contentStyle8 = {
5704
5804
  flex: 1,
5705
5805
  display: "flex",
5706
5806
  flexDirection: "column",
@@ -5730,14 +5830,14 @@ var logoStyle2 = {
5730
5830
  borderRadius: 12,
5731
5831
  objectFit: "contain"
5732
5832
  };
5733
- var headingStyle10 = (color) => ({
5833
+ var headingStyle11 = (color) => ({
5734
5834
  fontSize: "1.45rem",
5735
5835
  fontWeight: 700,
5736
5836
  letterSpacing: "-0.02em",
5737
5837
  color,
5738
5838
  margin: "20px 0 8px"
5739
5839
  });
5740
- var subtitleStyle8 = (color) => ({
5840
+ var subtitleStyle10 = (color) => ({
5741
5841
  fontSize: "0.9rem",
5742
5842
  color,
5743
5843
  margin: "0 0 24px",
@@ -5786,10 +5886,10 @@ function ConfirmSignScreen({
5786
5886
  ] }),
5787
5887
  children: [
5788
5888
  /* @__PURE__ */ jsxRuntime.jsx(ScreenHeader, { onLogout }),
5789
- /* @__PURE__ */ jsxRuntime.jsxs("div", { style: contentStyle8, children: [
5889
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { style: contentStyle9, children: [
5790
5890
  logoSrc ? /* @__PURE__ */ jsxRuntime.jsx("img", { src: logoSrc, alt: displayName, style: logoStyle3 }) : /* @__PURE__ */ jsxRuntime.jsx(Spinner, { size: 48 }),
5791
- /* @__PURE__ */ jsxRuntime.jsx("h2", { style: headingStyle11(tokens.text), children: "Wallet authorized" }),
5792
- /* @__PURE__ */ jsxRuntime.jsxs("p", { style: subtitleStyle9(tokens.textSecondary), children: [
5891
+ /* @__PURE__ */ jsxRuntime.jsx("h2", { style: headingStyle12(tokens.text), children: "Wallet authorized" }),
5892
+ /* @__PURE__ */ jsxRuntime.jsxs("p", { style: subtitleStyle11(tokens.textSecondary), children: [
5793
5893
  displayName,
5794
5894
  " approved the connection. Tap below to confirm your payment."
5795
5895
  ] }),
@@ -5802,7 +5902,7 @@ function ConfirmSignScreen({
5802
5902
  }
5803
5903
  );
5804
5904
  }
5805
- var contentStyle8 = {
5905
+ var contentStyle9 = {
5806
5906
  flex: 1,
5807
5907
  display: "flex",
5808
5908
  flexDirection: "column",
@@ -5817,14 +5917,14 @@ var logoStyle3 = {
5817
5917
  borderRadius: 14,
5818
5918
  objectFit: "contain"
5819
5919
  };
5820
- var headingStyle11 = (color) => ({
5920
+ var headingStyle12 = (color) => ({
5821
5921
  fontSize: "1.45rem",
5822
5922
  fontWeight: 700,
5823
5923
  letterSpacing: "-0.02em",
5824
5924
  color,
5825
5925
  margin: "20px 0 8px"
5826
5926
  });
5827
- var subtitleStyle9 = (color) => ({
5927
+ var subtitleStyle11 = (color) => ({
5828
5928
  fontSize: "0.9rem",
5829
5929
  color,
5830
5930
  margin: "0 0 24px",
@@ -6094,60 +6194,232 @@ var selectCircleSelectedStyle = (color) => ({
6094
6194
  justifyContent: "center",
6095
6195
  flexShrink: 0
6096
6196
  });
6197
+ function entryKey(entry) {
6198
+ return `${entry.sourceChainId}-${entry.tokenAddress.toLowerCase()}`;
6199
+ }
6200
+ function formatPreciseMoneyForDisplay(fee) {
6201
+ const raw = fee.value.trim();
6202
+ if (fee.currency === "USD") {
6203
+ if (!/^\d+(\.\d*)?$/.test(raw)) {
6204
+ return `$${raw}`;
6205
+ }
6206
+ const [whole, frac = ""] = raw.split(".");
6207
+ const dec = `${frac}00`.slice(0, 2);
6208
+ const intFmt = whole.replace(/\B(?=(\d{3})+(?!\d))/g, ",");
6209
+ return `$${intFmt}.${dec}`;
6210
+ }
6211
+ return `${raw} ${fee.currency}`;
6212
+ }
6097
6213
  function GuestTokenPickerScreen({
6098
6214
  entries,
6099
6215
  loading,
6100
6216
  setting,
6101
6217
  depositAmount,
6102
6218
  error,
6219
+ pendingEntry,
6220
+ quoteFee,
6221
+ quoteLoading,
6103
6222
  onSelect,
6104
- onBack
6223
+ onConfirm,
6224
+ onBack,
6225
+ defaultTokenListExpanded = false
6105
6226
  }) {
6106
6227
  const { tokens: t } = useBlinkConfig();
6228
+ const pendingKey = pendingEntry ? entryKey(pendingEntry) : null;
6229
+ const [tokenListOpen, setTokenListOpen] = react.useState(defaultTokenListExpanded);
6230
+ const pickerRef = react.useRef(null);
6231
+ react.useEffect(() => {
6232
+ if (!tokenListOpen) return;
6233
+ const handleMouseDown = (e) => {
6234
+ if (pickerRef.current && !pickerRef.current.contains(e.target)) {
6235
+ setTokenListOpen(false);
6236
+ }
6237
+ };
6238
+ document.addEventListener("mousedown", handleMouseDown);
6239
+ return () => document.removeEventListener("mousedown", handleMouseDown);
6240
+ }, [tokenListOpen]);
6107
6241
  if (loading) {
6108
6242
  return /* @__PURE__ */ jsxRuntime.jsxs(ScreenLayout, { children: [
6109
- /* @__PURE__ */ jsxRuntime.jsx(ScreenHeader, { title: "Select Token", onBack }),
6243
+ /* @__PURE__ */ jsxRuntime.jsx(ScreenHeader, { onBack }),
6110
6244
  /* @__PURE__ */ jsxRuntime.jsx("div", { style: loadingWrapStyle, children: /* @__PURE__ */ jsxRuntime.jsx(Spinner, { label: "Loading balances..." }) })
6111
6245
  ] });
6112
6246
  }
6113
- return /* @__PURE__ */ jsxRuntime.jsxs(ScreenLayout, { footer: /* @__PURE__ */ jsxRuntime.jsx(PoweredByFooter, {}), children: [
6114
- /* @__PURE__ */ jsxRuntime.jsx(ScreenHeader, { title: "Select Token", onBack }),
6115
- depositAmount != null && /* @__PURE__ */ jsxRuntime.jsxs("div", { style: depositHeaderStyle, children: [
6116
- /* @__PURE__ */ jsxRuntime.jsx("div", { style: depositLabelStyle3(t.textMuted), children: "Depositing" }),
6117
- /* @__PURE__ */ jsxRuntime.jsxs("div", { style: depositAmountStyle2(t.text), children: [
6118
- "$",
6119
- depositAmount.toLocaleString("en-US", { minimumFractionDigits: 2, maximumFractionDigits: 2 })
6120
- ] })
6121
- ] }),
6122
- error && /* @__PURE__ */ jsxRuntime.jsx("p", { style: errorStyle3(t.error), children: error }),
6123
- /* @__PURE__ */ jsxRuntime.jsx("div", { style: sectionLabelStyle2(t.textMuted), children: "Choose token to pay with" }),
6124
- /* @__PURE__ */ jsxRuntime.jsx("div", { style: tokenListStyle3, children: entries.map((entry) => /* @__PURE__ */ jsxRuntime.jsxs(
6125
- "button",
6126
- {
6127
- type: "button",
6128
- onClick: () => onSelect(entry),
6129
- disabled: setting,
6130
- style: tokenRowStyle3(t, setting),
6131
- children: [
6132
- /* @__PURE__ */ jsxRuntime.jsx("div", { style: tokenIconCircleStyle3(t, !!TOKEN_LOGOS[entry.tokenSymbol]), children: TOKEN_LOGOS[entry.tokenSymbol] ? /* @__PURE__ */ jsxRuntime.jsx("img", { src: TOKEN_LOGOS[entry.tokenSymbol], alt: entry.tokenSymbol, style: tokenLogoImgStyle3 }) : /* @__PURE__ */ jsxRuntime.jsx("span", { style: tokenIconTextStyle3(t.textMuted), children: "$" }) }),
6133
- /* @__PURE__ */ jsxRuntime.jsxs("div", { style: tokenInfoStyle3, children: [
6134
- /* @__PURE__ */ jsxRuntime.jsxs("div", { style: tokenNameRowStyle2, children: [
6135
- /* @__PURE__ */ jsxRuntime.jsx("span", { style: tokenSymbolTextStyle2(t.text), children: entry.tokenSymbol }),
6136
- /* @__PURE__ */ jsxRuntime.jsx("span", { style: tokenChainDotStyle2(t.textMuted), children: "\xB7" }),
6137
- /* @__PURE__ */ jsxRuntime.jsx("span", { style: tokenChainTextStyle2(t.textMuted), children: entry.chainName })
6138
- ] }),
6139
- /* @__PURE__ */ jsxRuntime.jsxs("span", { style: tokenBalanceStyle2(t.textMuted), children: [
6140
- "$",
6141
- entry.balance.toLocaleString("en-US", { minimumFractionDigits: 2, maximumFractionDigits: 2 })
6247
+ const rowBusy = setting || quoteLoading;
6248
+ const displayEntry = pendingEntry ?? entries[0] ?? null;
6249
+ const canConfirm = Boolean(quoteFee && pendingEntry && !quoteLoading);
6250
+ const feeLine = (() => {
6251
+ if (quoteLoading && pendingEntry) {
6252
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { style: feeRowStyle(t.textMuted), "aria-live": "polite", children: "Estimating fee\u2026" });
6253
+ }
6254
+ if (quoteFee) {
6255
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { style: feeRowStyle(t.textMuted), "aria-live": "polite", children: [
6256
+ "Estimated fee ",
6257
+ formatPreciseMoneyForDisplay(quoteFee)
6258
+ ] });
6259
+ }
6260
+ return null;
6261
+ })();
6262
+ return /* @__PURE__ */ jsxRuntime.jsxs(
6263
+ ScreenLayout,
6264
+ {
6265
+ footer: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
6266
+ canConfirm && /* @__PURE__ */ jsxRuntime.jsx(PrimaryButton, { onClick: () => void onConfirm(), loading: setting, disabled: setting, children: "Continue" }),
6267
+ /* @__PURE__ */ jsxRuntime.jsx(PoweredByFooter, {})
6268
+ ] }),
6269
+ children: [
6270
+ /* @__PURE__ */ jsxRuntime.jsx(ScreenHeader, { onBack }),
6271
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { ref: pickerRef, children: [
6272
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { style: depositCardSurfaceStyle(t, tokenListOpen), children: [
6273
+ /* @__PURE__ */ jsxRuntime.jsx("div", { style: depositLabelStyle3(t.textMuted), children: "Deposit" }),
6274
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { style: amountBandStyle, children: [
6275
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { style: amountLeftColStyle, children: [
6276
+ depositAmount != null && /* @__PURE__ */ jsxRuntime.jsxs("div", { style: depositAmountStyle2(t.text), children: [
6277
+ "$",
6278
+ depositAmount.toLocaleString("en-US", {
6279
+ minimumFractionDigits: 0,
6280
+ maximumFractionDigits: 2
6281
+ })
6282
+ ] }),
6283
+ feeLine
6284
+ ] }),
6285
+ /* @__PURE__ */ jsxRuntime.jsxs(
6286
+ "button",
6287
+ {
6288
+ type: "button",
6289
+ onClick: () => entries.length > 0 && setTokenListOpen((o) => !o),
6290
+ disabled: entries.length === 0 || rowBusy,
6291
+ style: tokenTriggerStyle(t, entries.length > 0 && !rowBusy),
6292
+ "aria-expanded": tokenListOpen,
6293
+ "aria-haspopup": "listbox",
6294
+ children: [
6295
+ /* @__PURE__ */ jsxRuntime.jsx("div", { style: tokenTriggerIconsStyle, children: pendingEntry && TOKEN_LOGOS[pendingEntry.tokenSymbol] ? /* @__PURE__ */ jsxRuntime.jsx(
6296
+ "img",
6297
+ {
6298
+ src: TOKEN_LOGOS[pendingEntry.tokenSymbol],
6299
+ alt: "",
6300
+ width: 28,
6301
+ height: 28,
6302
+ style: triggerLogoStyle(0)
6303
+ }
6304
+ ) : entries[0] && entries[1] && TOKEN_LOGOS[entries[0].tokenSymbol] && TOKEN_LOGOS[entries[1].tokenSymbol] ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
6305
+ /* @__PURE__ */ jsxRuntime.jsx(
6306
+ "img",
6307
+ {
6308
+ src: TOKEN_LOGOS[entries[0].tokenSymbol],
6309
+ alt: "",
6310
+ width: 28,
6311
+ height: 28,
6312
+ style: triggerLogoStyle(0)
6313
+ }
6314
+ ),
6315
+ /* @__PURE__ */ jsxRuntime.jsx(
6316
+ "img",
6317
+ {
6318
+ src: TOKEN_LOGOS[entries[1].tokenSymbol],
6319
+ alt: "",
6320
+ width: 28,
6321
+ height: 28,
6322
+ style: triggerLogoStyle(14)
6323
+ }
6324
+ )
6325
+ ] }) : displayEntry && TOKEN_LOGOS[displayEntry.tokenSymbol] ? /* @__PURE__ */ jsxRuntime.jsx(
6326
+ "img",
6327
+ {
6328
+ src: TOKEN_LOGOS[displayEntry.tokenSymbol],
6329
+ alt: "",
6330
+ width: 28,
6331
+ height: 28,
6332
+ style: triggerLogoStyle(0)
6333
+ }
6334
+ ) : null }),
6335
+ /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", style: { opacity: 0.5 }, children: tokenListOpen ? /* @__PURE__ */ jsxRuntime.jsx(
6336
+ "path",
6337
+ {
6338
+ d: "M18 15l-6-6-6 6",
6339
+ stroke: t.textMuted,
6340
+ strokeWidth: "2.5",
6341
+ strokeLinecap: "round",
6342
+ strokeLinejoin: "round"
6343
+ }
6344
+ ) : /* @__PURE__ */ jsxRuntime.jsx(
6345
+ "path",
6346
+ {
6347
+ d: "M6 9l6 6 6-6",
6348
+ stroke: t.textMuted,
6349
+ strokeWidth: "2.5",
6350
+ strokeLinecap: "round",
6351
+ strokeLinejoin: "round"
6352
+ }
6353
+ ) })
6354
+ ]
6355
+ }
6356
+ )
6142
6357
  ] })
6143
6358
  ] }),
6144
- /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", style: chevronStyle, children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z", fill: t.textMuted }) })
6145
- ]
6146
- },
6147
- `${entry.chainId}-${entry.tokenAddress}`
6148
- )) }),
6149
- entries.length === 0 && /* @__PURE__ */ jsxRuntime.jsx("p", { style: emptyStyle(t.textMuted), children: "No supported tokens found in your wallet. Please ensure you have USDC or USDT." })
6150
- ] });
6359
+ tokenListOpen && entries.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { style: tokenDropdownOuterStyle(t), children: [
6360
+ /* @__PURE__ */ jsxRuntime.jsx("div", { style: accountDropdownLabelStyle2(t.textMuted), children: "Choose token" }),
6361
+ /* @__PURE__ */ jsxRuntime.jsx("div", { style: tokenDropdownInnerStyle(t), children: entries.map((entry, index) => {
6362
+ const selected = pendingKey === entryKey(entry);
6363
+ const isLast = index === entries.length - 1;
6364
+ return /* @__PURE__ */ jsxRuntime.jsxs(
6365
+ "button",
6366
+ {
6367
+ type: "button",
6368
+ onClick: () => {
6369
+ void onSelect(entry);
6370
+ },
6371
+ disabled: rowBusy,
6372
+ style: pickerRowStyle(t, selected, isLast),
6373
+ children: [
6374
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { style: pickerRowLeftStyle, children: [
6375
+ /* @__PURE__ */ jsxRuntime.jsx("div", { style: tokenIconCircleStyle3(t, !!TOKEN_LOGOS[entry.tokenSymbol]), children: TOKEN_LOGOS[entry.tokenSymbol] ? /* @__PURE__ */ jsxRuntime.jsx(
6376
+ "img",
6377
+ {
6378
+ src: TOKEN_LOGOS[entry.tokenSymbol],
6379
+ alt: entry.tokenSymbol,
6380
+ style: tokenLogoImgStyle3
6381
+ }
6382
+ ) : /* @__PURE__ */ jsxRuntime.jsx("span", { style: tokenIconTextStyle3(t.textMuted), children: "$" }) }),
6383
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { style: pickerRowInfoStyle, children: [
6384
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { style: tokenNameRowStyle2, children: [
6385
+ /* @__PURE__ */ jsxRuntime.jsx("span", { style: tokenSymbolTextStyle2(t.text), children: entry.tokenSymbol }),
6386
+ /* @__PURE__ */ jsxRuntime.jsx("span", { style: tokenChainDotStyle2(t.textMuted), children: "\xB7" }),
6387
+ /* @__PURE__ */ jsxRuntime.jsx("span", { style: tokenChainTextStyle2(t.textMuted), children: entry.chainName })
6388
+ ] }),
6389
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { style: tokenBalanceStyle2(t.textMuted), children: [
6390
+ "$",
6391
+ entry.balance.toLocaleString("en-US", {
6392
+ minimumFractionDigits: 2,
6393
+ maximumFractionDigits: 2
6394
+ })
6395
+ ] })
6396
+ ] })
6397
+ ] }),
6398
+ selected ? /* @__PURE__ */ jsxRuntime.jsxs("svg", { width: "22", height: "22", viewBox: "0 0 22 22", fill: "none", children: [
6399
+ /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "11", cy: "11", r: "11", fill: t.success }),
6400
+ /* @__PURE__ */ jsxRuntime.jsx(
6401
+ "path",
6402
+ {
6403
+ d: "M7 11l3 3 5-5",
6404
+ stroke: "#fff",
6405
+ strokeWidth: "2",
6406
+ strokeLinecap: "round",
6407
+ strokeLinejoin: "round"
6408
+ }
6409
+ )
6410
+ ] }) : /* @__PURE__ */ jsxRuntime.jsx("div", { style: radioEmptyStyle2(t.border) })
6411
+ ]
6412
+ },
6413
+ entryKey(entry)
6414
+ );
6415
+ }) })
6416
+ ] })
6417
+ ] }),
6418
+ error && /* @__PURE__ */ jsxRuntime.jsx("p", { style: errorStyle3(t.error), children: error }),
6419
+ entries.length === 0 && /* @__PURE__ */ jsxRuntime.jsx("p", { style: emptyStyle(t.textMuted), children: "No supported tokens found in your wallet. Please ensure you have USDC or USDT." })
6420
+ ]
6421
+ }
6422
+ );
6151
6423
  }
6152
6424
  var loadingWrapStyle = {
6153
6425
  textAlign: "center",
@@ -6157,52 +6429,129 @@ var loadingWrapStyle = {
6157
6429
  alignItems: "center",
6158
6430
  justifyContent: "center"
6159
6431
  };
6160
- var depositHeaderStyle = {
6161
- marginBottom: 20
6162
- };
6432
+ var depositCardSurfaceStyle = (tokens, listOpen) => ({
6433
+ background: tokens.bgCard,
6434
+ border: `1px solid ${tokens.border}`,
6435
+ borderRadius: tokens.radiusLg,
6436
+ padding: "16px 20px",
6437
+ marginBottom: listOpen ? 4 : 16
6438
+ });
6163
6439
  var depositLabelStyle3 = (color) => ({
6164
6440
  fontSize: "0.75rem",
6165
6441
  fontWeight: 500,
6166
6442
  color,
6167
6443
  marginBottom: 4
6168
6444
  });
6445
+ var amountBandStyle = {
6446
+ display: "flex",
6447
+ alignItems: "flex-start",
6448
+ justifyContent: "space-between",
6449
+ gap: 12
6450
+ };
6451
+ var amountLeftColStyle = {
6452
+ flex: 1,
6453
+ minWidth: 0
6454
+ };
6169
6455
  var depositAmountStyle2 = (color) => ({
6170
6456
  fontSize: "2.4rem",
6171
6457
  fontWeight: 700,
6172
6458
  letterSpacing: "-0.02em",
6173
- color
6174
- });
6175
- var errorStyle3 = (color) => ({
6176
- fontSize: "0.84rem",
6177
6459
  color,
6178
- margin: "0 0 12px",
6179
- lineHeight: 1.5
6460
+ lineHeight: 1.05
6180
6461
  });
6181
- var sectionLabelStyle2 = (color) => ({
6462
+ var feeRowStyle = (color) => ({
6182
6463
  fontSize: "0.84rem",
6183
6464
  fontWeight: 500,
6184
6465
  color,
6185
- marginBottom: 12
6466
+ marginTop: 6
6186
6467
  });
6187
- var tokenListStyle3 = {
6468
+ var tokenTriggerStyle = (tokens, interactive) => ({
6188
6469
  display: "flex",
6189
- flexDirection: "column",
6190
- gap: 10
6470
+ alignItems: "center",
6471
+ gap: 6,
6472
+ flexShrink: 0,
6473
+ marginTop: 4,
6474
+ padding: "6px 10px",
6475
+ background: tokens.bgInput,
6476
+ border: `1px solid ${tokens.border}`,
6477
+ borderRadius: 999,
6478
+ cursor: interactive ? "pointer" : "default",
6479
+ fontFamily: "inherit"
6480
+ });
6481
+ var tokenTriggerIconsStyle = {
6482
+ position: "relative",
6483
+ width: 40,
6484
+ height: 28
6191
6485
  };
6192
- var tokenRowStyle3 = (tokens, disabled) => ({
6486
+ var triggerLogoStyle = (left) => ({
6487
+ position: "absolute",
6488
+ left,
6489
+ top: 0,
6490
+ borderRadius: "50%",
6491
+ objectFit: "cover",
6492
+ border: "2px solid rgba(255,255,255,0.9)",
6493
+ boxSizing: "content-box"
6494
+ });
6495
+ var tokenDropdownOuterStyle = (tokens) => ({
6496
+ marginTop: 4,
6497
+ marginBottom: 16,
6498
+ background: tokens.bgCard,
6499
+ border: `1px solid ${tokens.border}`,
6500
+ borderRadius: tokens.radiusLg,
6501
+ boxShadow: tokens.shadowLg,
6502
+ padding: "12px 14px 14px"
6503
+ });
6504
+ var accountDropdownLabelStyle2 = (color) => ({
6505
+ fontSize: "0.78rem",
6506
+ fontWeight: 500,
6507
+ color,
6508
+ marginBottom: 8
6509
+ });
6510
+ var tokenDropdownInnerStyle = (tokens) => ({
6511
+ background: tokens.bgInput,
6512
+ border: `1px solid ${tokens.border}`,
6513
+ borderRadius: tokens.radiusLg,
6514
+ overflow: "hidden"
6515
+ });
6516
+ var pickerRowStyle = (tokens, isSelected, isLast) => ({
6193
6517
  display: "flex",
6194
6518
  alignItems: "center",
6195
- gap: 14,
6519
+ justifyContent: "space-between",
6520
+ width: "100%",
6196
6521
  padding: "14px 16px",
6197
- background: tokens.bgInput,
6198
- border: `1px solid ${tokens.border}`,
6199
- borderRadius: 16,
6200
- cursor: disabled ? "default" : "pointer",
6522
+ background: isSelected ? `${tokens.accent}18` : "transparent",
6523
+ border: "none",
6524
+ borderBottom: isLast ? "none" : `1px solid ${tokens.border}`,
6525
+ cursor: "pointer",
6201
6526
  fontFamily: "inherit",
6202
6527
  textAlign: "left",
6203
- width: "100%",
6204
- opacity: disabled ? 0.6 : 1,
6205
- transition: "opacity 0.15s ease"
6528
+ outline: "none"
6529
+ });
6530
+ var pickerRowLeftStyle = {
6531
+ display: "flex",
6532
+ alignItems: "center",
6533
+ gap: 12,
6534
+ minWidth: 0,
6535
+ flex: 1
6536
+ };
6537
+ var pickerRowInfoStyle = {
6538
+ display: "flex",
6539
+ flexDirection: "column",
6540
+ gap: 2,
6541
+ minWidth: 0
6542
+ };
6543
+ var radioEmptyStyle2 = (borderColor) => ({
6544
+ width: 22,
6545
+ height: 22,
6546
+ borderRadius: "50%",
6547
+ border: `2px solid ${borderColor}`,
6548
+ flexShrink: 0
6549
+ });
6550
+ var errorStyle3 = (color) => ({
6551
+ fontSize: "0.84rem",
6552
+ color,
6553
+ margin: "0 0 12px",
6554
+ lineHeight: 1.5
6206
6555
  });
6207
6556
  var tokenIconCircleStyle3 = (tokens, hasLogo) => ({
6208
6557
  width: 36,
@@ -6226,13 +6575,6 @@ var tokenIconTextStyle3 = (color) => ({
6226
6575
  fontWeight: 700,
6227
6576
  color
6228
6577
  });
6229
- var tokenInfoStyle3 = {
6230
- display: "flex",
6231
- flexDirection: "column",
6232
- gap: 2,
6233
- flex: 1,
6234
- minWidth: 0
6235
- };
6236
6578
  var tokenNameRowStyle2 = {
6237
6579
  display: "flex",
6238
6580
  alignItems: "center",
@@ -6256,10 +6598,6 @@ var tokenBalanceStyle2 = (color) => ({
6256
6598
  fontSize: "0.78rem",
6257
6599
  color
6258
6600
  });
6259
- var chevronStyle = {
6260
- flexShrink: 0,
6261
- opacity: 0.4
6262
- };
6263
6601
  var emptyStyle = (color) => ({
6264
6602
  fontSize: "0.88rem",
6265
6603
  color,
@@ -6281,7 +6619,7 @@ function GuestPreauthSetupCompleteScreen({
6281
6619
  ] }),
6282
6620
  children: [
6283
6621
  /* @__PURE__ */ jsxRuntime.jsx(ScreenHeader, { onLogout }),
6284
- /* @__PURE__ */ jsxRuntime.jsxs("div", { style: contentStyle9, children: [
6622
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { style: contentStyle10, children: [
6285
6623
  /* @__PURE__ */ jsxRuntime.jsx(IconCircle, { variant: "success", size: 64, children: /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "32", height: "32", viewBox: "0 0 24 24", fill: "none", children: /* @__PURE__ */ jsxRuntime.jsx(
6286
6624
  "path",
6287
6625
  {
@@ -6289,14 +6627,14 @@ function GuestPreauthSetupCompleteScreen({
6289
6627
  fill: tokens.success
6290
6628
  }
6291
6629
  ) }) }),
6292
- /* @__PURE__ */ jsxRuntime.jsx("h2", { style: headingStyle12(tokens.text), children: "Setup complete" }),
6293
- /* @__PURE__ */ jsxRuntime.jsx("p", { style: subtitleStyle10(tokens.textSecondary), children: "Your account is linked and ready. You can close this window or make another deposit." })
6630
+ /* @__PURE__ */ jsxRuntime.jsx("h2", { style: headingStyle13(tokens.text), children: "Setup complete" }),
6631
+ /* @__PURE__ */ jsxRuntime.jsx("p", { style: subtitleStyle12(tokens.textSecondary), children: "Your account is linked and ready. You can close this window or make another deposit." })
6294
6632
  ] })
6295
6633
  ]
6296
6634
  }
6297
6635
  );
6298
6636
  }
6299
- var contentStyle9 = {
6637
+ var contentStyle10 = {
6300
6638
  display: "flex",
6301
6639
  flexDirection: "column",
6302
6640
  alignItems: "center",
@@ -6304,7 +6642,7 @@ var contentStyle9 = {
6304
6642
  gap: 12,
6305
6643
  paddingTop: 8
6306
6644
  };
6307
- function headingStyle12(color) {
6645
+ function headingStyle13(color) {
6308
6646
  return {
6309
6647
  margin: 0,
6310
6648
  fontSize: 22,
@@ -6312,7 +6650,7 @@ function headingStyle12(color) {
6312
6650
  color
6313
6651
  };
6314
6652
  }
6315
- function subtitleStyle10(color) {
6653
+ function subtitleStyle12(color) {
6316
6654
  return {
6317
6655
  margin: 0,
6318
6656
  fontSize: 15,
@@ -6325,14 +6663,14 @@ function GuestPreauthLinkingScreen({ onLogout }) {
6325
6663
  const { tokens } = useBlinkConfig();
6326
6664
  return /* @__PURE__ */ jsxRuntime.jsxs(ScreenLayout, { children: [
6327
6665
  /* @__PURE__ */ jsxRuntime.jsx(ScreenHeader, { onLogout }),
6328
- /* @__PURE__ */ jsxRuntime.jsxs("div", { style: contentStyle10, children: [
6666
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { style: contentStyle11, children: [
6329
6667
  /* @__PURE__ */ jsxRuntime.jsx(Spinner, { size: 48 }),
6330
- /* @__PURE__ */ jsxRuntime.jsx("h2", { style: headingStyle13(tokens.text), children: "Setting up your account..." }),
6331
- /* @__PURE__ */ jsxRuntime.jsx("p", { style: subtitleStyle11(tokens.textSecondary), children: "Linking your wallet to your Blink account. This usually takes a few seconds." })
6668
+ /* @__PURE__ */ jsxRuntime.jsx("h2", { style: headingStyle14(tokens.text), children: "Setting up your account..." }),
6669
+ /* @__PURE__ */ jsxRuntime.jsx("p", { style: subtitleStyle13(tokens.textSecondary), children: "Linking your wallet to your Blink account. This usually takes a few seconds." })
6332
6670
  ] })
6333
6671
  ] });
6334
6672
  }
6335
- var contentStyle10 = {
6673
+ var contentStyle11 = {
6336
6674
  flex: 1,
6337
6675
  display: "flex",
6338
6676
  flexDirection: "column",
@@ -6341,7 +6679,7 @@ var contentStyle10 = {
6341
6679
  textAlign: "center",
6342
6680
  padding: "0 24px 32px"
6343
6681
  };
6344
- function headingStyle13(color) {
6682
+ function headingStyle14(color) {
6345
6683
  return {
6346
6684
  margin: "20px 0 8px",
6347
6685
  fontSize: "1.45rem",
@@ -6350,7 +6688,7 @@ function headingStyle13(color) {
6350
6688
  color
6351
6689
  };
6352
6690
  }
6353
- function subtitleStyle11(color) {
6691
+ function subtitleStyle13(color) {
6354
6692
  return {
6355
6693
  margin: 0,
6356
6694
  fontSize: "0.9rem",
@@ -6359,6 +6697,8 @@ function subtitleStyle11(color) {
6359
6697
  maxWidth: 280
6360
6698
  };
6361
6699
  }
6700
+
6701
+ // src/stepHeaderFlowPhase.ts
6362
6702
  var LINK_SCREENS = /* @__PURE__ */ new Set([
6363
6703
  "create-passkey",
6364
6704
  "verify-passkey",
@@ -6373,7 +6713,6 @@ var DEPOSIT_SCREENS = /* @__PURE__ */ new Set([
6373
6713
  "processing",
6374
6714
  "success"
6375
6715
  ]);
6376
- var DEFAULT_MIN_DEPOSIT_USD = 0.25;
6377
6716
  function getFlowPhase(screen, phase) {
6378
6717
  if (LINK_SCREENS.has(screen)) return "link";
6379
6718
  if (DEPOSIT_SCREENS.has(screen)) return "deposit";
@@ -6382,9 +6721,19 @@ function getFlowPhase(screen, phase) {
6382
6721
  }
6383
6722
  return null;
6384
6723
  }
6724
+ function resolveHeaderFlowPhase(screen, phase, authenticated) {
6725
+ const raw = getFlowPhase(screen, phase);
6726
+ if (raw === "link" && !authenticated) return null;
6727
+ return raw;
6728
+ }
6729
+ var DEFAULT_MIN_DEPOSIT_USD = 0.25;
6385
6730
  function StepRenderer(props) {
6386
6731
  const screen = screenForPhase(props.flow.state.phase);
6387
- const flowPhase = getFlowPhase(screen, props.flow.state.phase);
6732
+ const flowPhase = resolveHeaderFlowPhase(
6733
+ screen,
6734
+ props.flow.state.phase,
6735
+ props.flow.authenticated
6736
+ );
6388
6737
  return /* @__PURE__ */ jsxRuntime.jsx(FlowPhaseProvider, { phase: flowPhase, children: /* @__PURE__ */ jsxRuntime.jsx(StepRendererContent, { ...props, screen }) });
6389
6738
  }
6390
6739
  function StepRendererContent({
@@ -6410,6 +6759,7 @@ function StepRendererContent({
6410
6759
  pollingError,
6411
6760
  guestAccountPollingError,
6412
6761
  authExecutorError,
6762
+ authExecutorExecuting,
6413
6763
  transferSigningSigning,
6414
6764
  transferSigningError,
6415
6765
  pendingSelectSource
@@ -6430,6 +6780,9 @@ function StepRendererContent({
6430
6780
  guestTokenEntries,
6431
6781
  guestLoadingBalances,
6432
6782
  guestSettingSender,
6783
+ guestPendingEntry,
6784
+ guestQuoteFee,
6785
+ guestQuoteLoading,
6433
6786
  authInput,
6434
6787
  otpCode,
6435
6788
  selectSourceChainName,
@@ -6524,7 +6877,7 @@ function StepRendererContent({
6524
6877
  {
6525
6878
  walletName: providerName,
6526
6879
  deeplinkUri: state.deeplinkUri ?? "",
6527
- loading: !isDesktop ? state.creatingTransfer || !state.deeplinkUri : state.creatingTransfer,
6880
+ loading: !isDesktop ? state.creatingTransfer || !state.deeplinkUri : state.creatingTransfer || authExecutorExecuting,
6528
6881
  useDeeplink: !isDesktop,
6529
6882
  error: state.error || guestAccountPollingError || (!isDesktop ? pollingError : authExecutorError),
6530
6883
  onRetryStatus: !isDesktop ? handlers.onRetryMobileStatus : void 0,
@@ -6667,7 +7020,11 @@ function StepRendererContent({
6667
7020
  setting: guestSettingSender,
6668
7021
  depositAmount: depositAmount ?? void 0,
6669
7022
  error: state.error,
7023
+ pendingEntry: forms.guestPendingEntry,
7024
+ quoteFee: forms.guestQuoteFee,
7025
+ quoteLoading: forms.guestQuoteLoading,
6670
7026
  onSelect: handlers.onSelectGuestToken,
7027
+ onConfirm: handlers.onConfirmGuestToken,
6671
7028
  onBack: handlers.onGuestBackFromTokenPicker
6672
7029
  }
6673
7030
  );
@@ -6772,7 +7129,7 @@ var PaymentErrorBoundary = class extends react.Component {
6772
7129
  /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M12 8v5", stroke: "#ef4444", strokeWidth: "1.5", strokeLinecap: "round" }),
6773
7130
  /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "12", cy: "16", r: "0.75", fill: "#ef4444" })
6774
7131
  ] }) }),
6775
- /* @__PURE__ */ jsxRuntime.jsx("h2", { style: headingStyle14, children: "Something went wrong" }),
7132
+ /* @__PURE__ */ jsxRuntime.jsx("h2", { style: headingStyle15, children: "Something went wrong" }),
6776
7133
  /* @__PURE__ */ jsxRuntime.jsx("p", { style: messageStyle, children: "An unexpected error occurred. Please try again." }),
6777
7134
  /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", onClick: this.handleReset, style: buttonStyle3, children: "Try again" })
6778
7135
  ] });
@@ -6792,7 +7149,7 @@ var containerStyle9 = {
6792
7149
  var iconStyle3 = {
6793
7150
  marginBottom: 20
6794
7151
  };
6795
- var headingStyle14 = {
7152
+ var headingStyle15 = {
6796
7153
  fontSize: "1.25rem",
6797
7154
  fontWeight: 700,
6798
7155
  color: "#1a1a1a",
@@ -7971,8 +8328,8 @@ function useProviderHandlers(deps) {
7971
8328
  }
7972
8329
 
7973
8330
  // src/guestTokens.ts
7974
- function mapBalancesToGuestTokenEntries(options) {
7975
- return options.map((opt) => ({
8331
+ function mapGuestPickerEntries(options) {
8332
+ const mapped = options.map((opt) => ({
7976
8333
  chainId: opt.chainId,
7977
8334
  sourceChainId: opt.sourceChainId,
7978
8335
  chainName: opt.chainName,
@@ -7981,7 +8338,26 @@ function mapBalancesToGuestTokenEntries(options) {
7981
8338
  decimals: opt.decimals,
7982
8339
  rawBalance: opt.rawBalance,
7983
8340
  balance: Number(opt.rawBalance) / 10 ** opt.decimals
7984
- })).filter((entry) => entry.balance > 0).sort((a, b) => b.balance - a.balance);
8341
+ }));
8342
+ const positive = mapped.filter((e) => e.balance > 0).sort((a, b) => b.balance - a.balance);
8343
+ if (positive.length > 0) return positive;
8344
+ return mapped.sort((a, b) => b.balance - a.balance);
8345
+ }
8346
+ function guestEntryMatchingRecommended(balances, recommended) {
8347
+ const raw = balances.find(
8348
+ (b) => b.sourceChainId === recommended.sourceChainId && b.tokenAddress.toLowerCase() === recommended.tokenAddress.toLowerCase()
8349
+ );
8350
+ if (!raw) return null;
8351
+ return {
8352
+ chainId: raw.chainId,
8353
+ sourceChainId: raw.sourceChainId,
8354
+ chainName: raw.chainName,
8355
+ tokenSymbol: raw.tokenSymbol,
8356
+ tokenAddress: raw.tokenAddress,
8357
+ decimals: raw.decimals,
8358
+ rawBalance: raw.rawBalance,
8359
+ balance: Number(raw.rawBalance) / 10 ** raw.decimals
8360
+ };
7985
8361
  }
7986
8362
 
7987
8363
  // src/hooks/useGuestTransferHandlers.ts
@@ -8008,6 +8384,9 @@ function useGuestTransferHandlers(deps) {
8008
8384
  const [guestTokenEntries, setGuestTokenEntries] = react.useState([]);
8009
8385
  const [loadingBalances, setLoadingBalances] = react.useState(false);
8010
8386
  const [settingSender, setSettingSender] = react.useState(false);
8387
+ const [pendingGuestEntry, setPendingGuestEntry] = react.useState(null);
8388
+ const [guestFee, setGuestFee] = react.useState(null);
8389
+ const [guestQuoteLoading, setGuestQuoteLoading] = react.useState(false);
8011
8390
  const executingBridgeRef = react.useRef(false);
8012
8391
  const fetchedRef = react.useRef(false);
8013
8392
  const selectedGuestTokenRef = react.useRef(null);
@@ -8017,21 +8396,65 @@ function useGuestTransferHandlers(deps) {
8017
8396
  if (!account.address) return;
8018
8397
  fetchedRef.current = true;
8019
8398
  setLoadingBalances(true);
8020
- fetchGuestTransferBalances(apiBaseUrl, guestTransferId, guestSessionToken, account.address).then((options) => mapBalancesToGuestTokenEntries(options)).then((entries) => {
8399
+ putGuestTransferSender(apiBaseUrl, guestTransferId, guestSessionToken, {
8400
+ senderAddress: account.address
8401
+ }).then(async (res) => {
8402
+ const balances = res.source?.balances;
8403
+ if (!balances?.length) {
8404
+ dispatch({ type: "SET_ERROR", error: "No supported tokens found for this transfer." });
8405
+ return;
8406
+ }
8407
+ const entries = mapGuestPickerEntries(balances);
8021
8408
  setGuestTokenEntries(entries);
8022
8409
  if (entries.length === 0) {
8023
8410
  dispatch({ type: "SET_ERROR", error: "No supported tokens found in your wallet." });
8411
+ return;
8412
+ }
8413
+ const recommended = res.source?.recommended;
8414
+ const autoEntry = recommended ? guestEntryMatchingRecommended(balances, recommended) : null;
8415
+ const pick = autoEntry && entries.some(
8416
+ (e) => e.sourceChainId === autoEntry.sourceChainId && e.tokenAddress.toLowerCase() === autoEntry.tokenAddress.toLowerCase()
8417
+ ) ? autoEntry : entries[0];
8418
+ setPendingGuestEntry(pick);
8419
+ setGuestFee(null);
8420
+ if (res.fee?.quote != null) {
8421
+ setGuestFee(res.fee);
8422
+ return;
8423
+ }
8424
+ setGuestQuoteLoading(true);
8425
+ try {
8426
+ const quote = await postGuestTransferFeeQuote(
8427
+ apiBaseUrl,
8428
+ guestTransferId,
8429
+ guestSessionToken,
8430
+ account.address,
8431
+ pick.sourceChainId,
8432
+ pick.tokenAddress
8433
+ );
8434
+ setGuestFee(quote);
8435
+ } catch (err) {
8436
+ captureException(err);
8437
+ setPendingGuestEntry(null);
8438
+ setGuestFee(null);
8439
+ const msg = err instanceof Error ? err.message : "Failed to load fee estimate";
8440
+ dispatch({ type: "SET_ERROR", error: msg });
8441
+ onError?.(msg);
8442
+ } finally {
8443
+ setGuestQuoteLoading(false);
8024
8444
  }
8025
8445
  }).catch((err) => {
8026
8446
  captureException(err);
8027
- dispatch({ type: "SET_ERROR", error: "Failed to fetch token balances." });
8447
+ dispatch({ type: "SET_ERROR", error: "Failed to load payment sources." });
8028
8448
  }).finally(() => setLoadingBalances(false));
8029
- }, [isGuestFlow, guestTransferId, guestSessionToken, apiBaseUrl, wagmiConfig2, dispatch]);
8449
+ }, [isGuestFlow, guestTransferId, guestSessionToken, apiBaseUrl, wagmiConfig2, dispatch, onError]);
8030
8450
  react.useEffect(() => {
8031
8451
  if (!isGuestFlow) {
8032
8452
  fetchedRef.current = false;
8033
8453
  selectedGuestTokenRef.current = null;
8034
8454
  setGuestTokenEntries([]);
8455
+ setPendingGuestEntry(null);
8456
+ setGuestFee(null);
8457
+ setGuestQuoteLoading(false);
8035
8458
  }
8036
8459
  }, [isGuestFlow]);
8037
8460
  const handleSelectGuestToken = react.useCallback(async (entry) => {
@@ -8041,7 +8464,44 @@ function useGuestTransferHandlers(deps) {
8041
8464
  dispatch({ type: "SET_ERROR", error: "Wallet not connected." });
8042
8465
  return;
8043
8466
  }
8467
+ setGuestQuoteLoading(true);
8468
+ dispatch({ type: "SET_ERROR", error: null });
8469
+ setPendingGuestEntry(entry);
8470
+ setGuestFee(null);
8471
+ try {
8472
+ console.info(
8473
+ `[blink-sdk] type=guest Fee quote preview: address=${account.address}, chain=${entry.sourceChainId}, token=${entry.tokenSymbol}`
8474
+ );
8475
+ const quote = await postGuestTransferFeeQuote(
8476
+ apiBaseUrl,
8477
+ guestTransferId,
8478
+ guestSessionToken,
8479
+ account.address,
8480
+ entry.sourceChainId,
8481
+ entry.tokenAddress
8482
+ );
8483
+ setGuestFee(quote);
8484
+ } catch (err) {
8485
+ captureException(err);
8486
+ setPendingGuestEntry(null);
8487
+ setGuestFee(null);
8488
+ const msg = err instanceof Error ? err.message : "Failed to load fee estimate";
8489
+ dispatch({ type: "SET_ERROR", error: msg });
8490
+ onError?.(msg);
8491
+ } finally {
8492
+ setGuestQuoteLoading(false);
8493
+ }
8494
+ }, [guestTransferId, guestSessionToken, wagmiConfig2, apiBaseUrl, dispatch, onError]);
8495
+ const handleConfirmGuestToken = react.useCallback(async () => {
8496
+ if (!guestTransferId || !guestSessionToken || !pendingGuestEntry) return;
8497
+ const account = getAccount(wagmiConfig2);
8498
+ if (!account.address) {
8499
+ dispatch({ type: "SET_ERROR", error: "Wallet not connected." });
8500
+ return;
8501
+ }
8502
+ const entry = pendingGuestEntry;
8044
8503
  setSettingSender(true);
8504
+ dispatch({ type: "SET_ERROR", error: null });
8045
8505
  try {
8046
8506
  console.info(
8047
8507
  `[blink-sdk] type=guest Setting sender: address=${account.address}, chain=${entry.sourceChainId}, token=${entry.tokenSymbol}`
@@ -8063,7 +8523,15 @@ function useGuestTransferHandlers(deps) {
8063
8523
  } finally {
8064
8524
  setSettingSender(false);
8065
8525
  }
8066
- }, [guestTransferId, guestSessionToken, wagmiConfig2, apiBaseUrl, dispatch, onError]);
8526
+ }, [
8527
+ guestTransferId,
8528
+ guestSessionToken,
8529
+ pendingGuestEntry,
8530
+ wagmiConfig2,
8531
+ apiBaseUrl,
8532
+ dispatch,
8533
+ onError
8534
+ ]);
8067
8535
  react.useEffect(() => {
8068
8536
  if (!isGuestFlow || !guestTransferId || !guestSessionToken || !selectedGuestTokenRef.current) return;
8069
8537
  if (executingBridgeRef.current) return;
@@ -8171,13 +8639,19 @@ function useGuestTransferHandlers(deps) {
8171
8639
  execute();
8172
8640
  }, [isGuestFlow, guestTransferId, guestSessionToken, settingSender, apiBaseUrl, wagmiConfig2, switchChainAsync, dispatch, onComplete, onError]);
8173
8641
  const handleGuestBackFromTokenPicker = react.useCallback(() => {
8642
+ setPendingGuestEntry(null);
8643
+ setGuestFee(null);
8174
8644
  dispatch({ type: "GUEST_BACK_FROM_TOKEN_PICKER" });
8175
8645
  }, [dispatch]);
8176
8646
  return {
8177
8647
  guestTokenEntries,
8178
8648
  loadingBalances,
8179
8649
  settingSender,
8650
+ pendingGuestEntry,
8651
+ guestFee,
8652
+ guestQuoteLoading,
8180
8653
  handleSelectGuestToken,
8654
+ handleConfirmGuestToken,
8181
8655
  handleGuestBackFromTokenPicker
8182
8656
  };
8183
8657
  }
@@ -8235,7 +8709,7 @@ function useOneTapSetupHandlers(deps) {
8235
8709
  } else if (authExecutor.pendingOneTapSetup) {
8236
8710
  authExecutor.resolveOneTapSetup();
8237
8711
  }
8238
- if (!guestPostPayPreauth || !willResolveSession) {
8712
+ if (!willResolveSession) {
8239
8713
  dispatch({ type: "SET_USER_INTENT", intent: { step: "deposit" } });
8240
8714
  }
8241
8715
  } catch (err) {
@@ -9360,6 +9834,32 @@ function useGuestPreauthWalletSetupEffect(deps) {
9360
9834
  dispatch
9361
9835
  ]);
9362
9836
  }
9837
+ function useStandardDesktopInlineOpenWalletEffect(deps) {
9838
+ const { isDesktop, state, dispatch, authExecutor } = deps;
9839
+ react.useEffect(() => {
9840
+ if (!isDesktop || state.guestPreauthorizing) return;
9841
+ if (!state.privyAuthenticated || !state.activeCredentialId || !state.selectedAccountId) return;
9842
+ const shouldPin = authExecutor.executing && !authExecutor.pendingSelectSource && !authExecutor.pendingOneTapSetup;
9843
+ if (shouldPin && !state.standardDesktopInlineOpenWallet) {
9844
+ dispatch({ type: "SET_STANDARD_DESKTOP_INLINE_OPEN_WALLET", value: true });
9845
+ return;
9846
+ }
9847
+ if (!shouldPin && state.standardDesktopInlineOpenWallet) {
9848
+ dispatch({ type: "SET_STANDARD_DESKTOP_INLINE_OPEN_WALLET", value: false });
9849
+ }
9850
+ }, [
9851
+ isDesktop,
9852
+ state.guestPreauthorizing,
9853
+ state.privyAuthenticated,
9854
+ state.activeCredentialId,
9855
+ state.selectedAccountId,
9856
+ state.standardDesktopInlineOpenWallet,
9857
+ authExecutor.executing,
9858
+ authExecutor.pendingSelectSource,
9859
+ authExecutor.pendingOneTapSetup,
9860
+ dispatch
9861
+ ]);
9862
+ }
9363
9863
  function useGuestAccountAutoPollingEffect(deps) {
9364
9864
  const {
9365
9865
  mobileFlow,
@@ -9859,6 +10359,12 @@ function BlinkPaymentInner({
9859
10359
  authExecutor,
9860
10360
  isDesktop
9861
10361
  });
10362
+ useStandardDesktopInlineOpenWalletEffect({
10363
+ isDesktop,
10364
+ state,
10365
+ dispatch,
10366
+ authExecutor
10367
+ });
9862
10368
  const handlers = react.useMemo(() => ({
9863
10369
  onSendLoginCode: auth.handleSendLoginCode,
9864
10370
  onVerifyLoginCode: auth.handleVerifyLoginCode,
@@ -9895,6 +10401,7 @@ function BlinkPaymentInner({
9895
10401
  onSelectAuthorizedToken: provider.handleSelectAuthorizedToken,
9896
10402
  onAuthorizeToken: provider.handleAuthorizeToken,
9897
10403
  onSelectGuestToken: guestTransfer.handleSelectGuestToken,
10404
+ onConfirmGuestToken: guestTransfer.handleConfirmGuestToken,
9898
10405
  onGuestBackFromTokenPicker: guestTransfer.handleGuestBackFromTokenPicker,
9899
10406
  onLogin: () => dispatch({ type: "REQUEST_LOGIN" }),
9900
10407
  onPreauthorize: provider.handlePreauthorize,
@@ -9934,6 +10441,7 @@ function BlinkPaymentInner({
9934
10441
  pollingError: polling.error,
9935
10442
  guestAccountPollingError: guestAccountPolling.error,
9936
10443
  authExecutorError: authExecutor.error,
10444
+ authExecutorExecuting: authExecutor.executing,
9937
10445
  transferSigningSigning: transferSigning.signing,
9938
10446
  transferSigningError: transferSigning.error,
9939
10447
  pendingSelectSource: authExecutor.pendingSelectSource,
@@ -9959,7 +10467,10 @@ function BlinkPaymentInner({
9959
10467
  savingOneTapLimit: oneTapSetup.savingOneTapLimit,
9960
10468
  guestTokenEntries: guestTransfer.guestTokenEntries,
9961
10469
  guestLoadingBalances: guestTransfer.loadingBalances,
9962
- guestSettingSender: guestTransfer.settingSender
10470
+ guestSettingSender: guestTransfer.settingSender,
10471
+ guestPendingEntry: guestTransfer.pendingGuestEntry,
10472
+ guestQuoteFee: guestTransfer.guestFee?.quote ?? null,
10473
+ guestQuoteLoading: guestTransfer.guestQuoteLoading
9963
10474
  },
9964
10475
  handlers
9965
10476
  }
@@ -9972,9 +10483,17 @@ exports.BLINK_MASCOT = BLINK_MASCOT;
9972
10483
  exports.BlinkLoadingScreen = BlinkLoadingScreen;
9973
10484
  exports.BlinkPayment = BlinkPayment;
9974
10485
  exports.BlinkProvider = BlinkProvider;
10486
+ exports.ConfirmSignScreen = ConfirmSignScreen;
10487
+ exports.DepositScreen = DepositScreen;
9975
10488
  exports.FlowPhaseProvider = FlowPhaseProvider;
10489
+ exports.GuestPreauthLinkingScreen = GuestPreauthLinkingScreen;
10490
+ exports.GuestPreauthSetupCompleteScreen = GuestPreauthSetupCompleteScreen;
10491
+ exports.GuestTokenPickerScreen = GuestTokenPickerScreen;
9976
10492
  exports.IconCircle = IconCircle;
9977
10493
  exports.InfoBanner = InfoBanner;
10494
+ exports.LoginScreen = LoginScreen;
10495
+ exports.OpenWalletScreen = OpenWalletScreen;
10496
+ exports.OtpVerifyScreen = OtpVerifyScreen;
9978
10497
  exports.OutlineButton = OutlineButton;
9979
10498
  exports.PasskeyIframeBlockedError = PasskeyIframeBlockedError;
9980
10499
  exports.PasskeyScreen = PasskeyScreen;
@@ -9985,9 +10504,14 @@ exports.ScreenLayout = ScreenLayout;
9985
10504
  exports.SelectSourceScreen = SelectSourceScreen;
9986
10505
  exports.SettingsMenu = SettingsMenu;
9987
10506
  exports.SetupScreen = SetupScreen;
10507
+ exports.SetupStatusScreen = SetupStatusScreen;
9988
10508
  exports.Spinner = Spinner;
9989
10509
  exports.StepList = StepList;
10510
+ exports.SuccessScreen = SuccessScreen;
9990
10511
  exports.TokenPickerScreen = TokenPickerScreen;
10512
+ exports.TransferStatusScreen = TransferStatusScreen;
10513
+ exports.VerifyPasskeyScreen = VerifyPasskeyScreen;
10514
+ exports.WalletPickerScreen = WalletPickerScreen;
9991
10515
  exports.blinkApi = api_exports;
9992
10516
  exports.buildPasskeyPopupOptions = buildPasskeyPopupOptions;
9993
10517
  exports.createPasskeyCredential = createPasskeyCredential;
@@ -9997,7 +10521,9 @@ exports.deviceHasPasskey = deviceHasPasskey;
9997
10521
  exports.findDevicePasskey = findDevicePasskey;
9998
10522
  exports.findDevicePasskeyViaPopup = findDevicePasskeyViaPopup;
9999
10523
  exports.getTheme = getTheme;
10524
+ exports.guestEntryMatchingRecommended = guestEntryMatchingRecommended;
10000
10525
  exports.lightTheme = lightTheme;
10526
+ exports.mapGuestPickerEntries = mapGuestPickerEntries;
10001
10527
  exports.resolvePasskeyRpId = resolvePasskeyRpId;
10002
10528
  exports.screenForPhase = screenForPhase;
10003
10529
  exports.useAuthorizationExecutor = useAuthorizationExecutor;