@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.js CHANGED
@@ -485,13 +485,14 @@ __export(api_exports, {
485
485
  fetchAuthorizationSessionByToken: () => fetchAuthorizationSessionByToken,
486
486
  fetchChains: () => fetchChains,
487
487
  fetchGuestAccount: () => fetchGuestAccount,
488
- fetchGuestTransferBalances: () => fetchGuestTransferBalances,
489
488
  fetchMerchantPublicKey: () => fetchMerchantPublicKey,
490
489
  fetchProviders: () => fetchProviders,
491
490
  fetchTransfer: () => fetchTransfer,
492
491
  fetchUserConfig: () => fetchUserConfig,
493
492
  getGuestTransfer: () => getGuestTransfer,
494
493
  getTransferByGuestToken: () => getTransferByGuestToken,
494
+ postGuestTransferFeeQuote: () => postGuestTransferFeeQuote,
495
+ putGuestTransferSender: () => putGuestTransferSender,
495
496
  registerPasskey: () => registerPasskey,
496
497
  reportActionCompletion: () => reportActionCompletion,
497
498
  reportPasskeyActivity: () => reportPasskeyActivity,
@@ -746,18 +747,37 @@ async function getTransferByGuestToken(apiBaseUrl, guestToken) {
746
747
  if (!res.ok) await throwApiError(res);
747
748
  return await res.json();
748
749
  }
749
- async function setTransferSender(apiBaseUrl, transferId, guestSessionToken, senderAddress, sourceChainId, sourceToken) {
750
+ async function postGuestTransferFeeQuote(apiBaseUrl, transferId, guestSessionToken, senderAddress, sourceChainId, sourceToken) {
751
+ const res = await fetch(`${apiBaseUrl}/v1/transfers/${transferId}/quotes`, {
752
+ method: "POST",
753
+ headers: {
754
+ "Content-Type": "application/json",
755
+ "x-guest-session-token": guestSessionToken
756
+ },
757
+ body: JSON.stringify({ senderAddress, sourceChainId, sourceToken })
758
+ });
759
+ if (!res.ok) await throwApiError(res);
760
+ return await res.json();
761
+ }
762
+ async function putGuestTransferSender(apiBaseUrl, transferId, guestSessionToken, body) {
750
763
  const res = await fetch(`${apiBaseUrl}/v1/transfers/${transferId}/sender`, {
751
764
  method: "PUT",
752
765
  headers: {
753
766
  "Content-Type": "application/json",
754
767
  "x-guest-session-token": guestSessionToken
755
768
  },
756
- body: JSON.stringify({ senderAddress, sourceChainId, sourceToken })
769
+ body: JSON.stringify(body)
757
770
  });
758
771
  if (!res.ok) await throwApiError(res);
759
772
  return await res.json();
760
773
  }
774
+ async function setTransferSender(apiBaseUrl, transferId, guestSessionToken, senderAddress, sourceChainId, sourceToken) {
775
+ return putGuestTransferSender(apiBaseUrl, transferId, guestSessionToken, {
776
+ senderAddress,
777
+ sourceChainId,
778
+ sourceToken
779
+ });
780
+ }
761
781
  async function signGuestTransfer(apiBaseUrl, transferId, guestSessionToken, originTxHash) {
762
782
  const res = await fetch(`${apiBaseUrl}/v1/transfers/${transferId}`, {
763
783
  method: "PATCH",
@@ -779,20 +799,6 @@ async function getGuestTransfer(apiBaseUrl, transferId, guestSessionToken) {
779
799
  if (!res.ok) await throwApiError(res);
780
800
  return await res.json();
781
801
  }
782
- async function fetchGuestTransferBalances(apiBaseUrl, transferId, guestSessionToken, walletAddress) {
783
- const params = new URLSearchParams({ walletAddress });
784
- const res = await fetch(
785
- `${apiBaseUrl}/v1/transfers/${transferId}/balances?${params.toString()}`,
786
- {
787
- headers: {
788
- "x-guest-session-token": guestSessionToken
789
- }
790
- }
791
- );
792
- if (!res.ok) await throwApiError(res);
793
- const data = await res.json();
794
- return data.items;
795
- }
796
802
  async function fetchGuestAccount(apiBaseUrl, guestToken) {
797
803
  const params = new URLSearchParams({ guestToken });
798
804
  const res = await fetch(`${apiBaseUrl}/v1/accounts?${params.toString()}`);
@@ -2088,23 +2094,24 @@ function resolvePhase(state) {
2088
2094
  const branchCompleted = !branchGuestSetupComplete && !branchKeepGuestPreauthPin && !branchGuestPostPayLogin && transferCompleted && !state.verificationTarget && !needsPasskeyBootstrap;
2089
2095
  const branchFailed = !branchGuestSetupComplete && !branchKeepGuestPreauthPin && !branchGuestPostPayLogin && !branchCompleted && state.transfer?.status === "FAILED";
2090
2096
  const branchProcessing = !branchGuestSetupComplete && !branchKeepGuestPreauthPin && !branchGuestPostPayLogin && !branchCompleted && !branchFailed && (state.creatingTransfer || isTransferAwaitingCompletion(state.transfer));
2091
- const branchKeepFundingSubflow = !branchGuestSetupComplete && !branchKeepGuestPreauthPin && !branchGuestPostPayLogin && !branchCompleted && !branchFailed && !branchProcessing && isFundingSourceSubflow;
2092
- const branchMobileWalletSetup = !branchGuestSetupComplete && !branchKeepGuestPreauthPin && !branchGuestPostPayLogin && !branchCompleted && !branchFailed && !branchProcessing && !branchKeepFundingSubflow && state.mobileFlow && state.deeplinkUri != null;
2093
- 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;
2094
- 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;
2095
- const branchGuestTokenPicker = !branchGuestSetupComplete && !branchKeepGuestPreauthPin && !branchGuestPostPayLogin && !branchCompleted && !branchFailed && !branchProcessing && !branchKeepFundingSubflow && !branchMobileWalletSetup && !branchKeepGuestPreauthDesktopOpenWallet && !branchKeepGuestWalletSetup && guestTokenPickerEligible;
2096
- const branchKeepWalletPickerSwitch = !branchGuestSetupComplete && !branchKeepGuestPreauthPin && !branchGuestPostPayLogin && !branchCompleted && !branchFailed && !branchProcessing && !branchKeepFundingSubflow && !branchMobileWalletSetup && !branchKeepGuestPreauthDesktopOpenWallet && !branchKeepGuestWalletSetup && !branchGuestTokenPicker && walletPickerSwitchEligible;
2097
- const branchInitializingPrivy = !branchGuestSetupComplete && !branchKeepGuestPreauthPin && !branchGuestPostPayLogin && !branchCompleted && !branchFailed && !branchProcessing && !branchKeepFundingSubflow && !branchMobileWalletSetup && !branchKeepGuestPreauthDesktopOpenWallet && !branchKeepGuestWalletSetup && !branchGuestTokenPicker && !branchKeepWalletPickerSwitch && !state.privyReady;
2098
- const branchInitializingPasskeyConfig = !branchGuestSetupComplete && !branchKeepGuestPreauthPin && !branchGuestPostPayLogin && !branchCompleted && !branchFailed && !branchProcessing && !branchKeepFundingSubflow && !branchMobileWalletSetup && !branchKeepGuestPreauthDesktopOpenWallet && !branchKeepGuestWalletSetup && !branchGuestTokenPicker && !branchKeepWalletPickerSwitch && !branchInitializingPrivy && state.privyAuthenticated && !state.activeCredentialId && !state.passkeyConfigLoaded;
2099
- const branchOtpVerify = !branchGuestSetupComplete && !branchKeepGuestPreauthPin && !branchGuestPostPayLogin && !branchCompleted && !branchFailed && !branchProcessing && !branchKeepFundingSubflow && !branchMobileWalletSetup && !branchKeepGuestPreauthDesktopOpenWallet && !branchKeepGuestWalletSetup && !branchGuestTokenPicker && !branchKeepWalletPickerSwitch && !branchInitializingPrivy && !branchInitializingPasskeyConfig && state.verificationTarget != null && !state.privyAuthenticated;
2100
- const branchLoginRequested = !branchGuestSetupComplete && !branchKeepGuestPreauthPin && !branchGuestPostPayLogin && !branchCompleted && !branchFailed && !branchProcessing && !branchKeepFundingSubflow && !branchMobileWalletSetup && !branchKeepGuestPreauthDesktopOpenWallet && !branchKeepGuestWalletSetup && !branchGuestTokenPicker && !branchKeepWalletPickerSwitch && !branchInitializingPrivy && !branchInitializingPasskeyConfig && !branchOtpVerify && state.loginRequested;
2101
- const branchPasskeyVerify = !branchGuestSetupComplete && !branchKeepGuestPreauthPin && !branchGuestPostPayLogin && !branchCompleted && !branchFailed && !branchProcessing && !branchKeepFundingSubflow && !branchMobileWalletSetup && !branchKeepGuestPreauthDesktopOpenWallet && !branchKeepGuestWalletSetup && !branchGuestTokenPicker && !branchKeepWalletPickerSwitch && !branchInitializingPrivy && !branchInitializingPasskeyConfig && !branchOtpVerify && !branchLoginRequested && shouldPromptPasskeyVerification;
2102
- const branchPasskeyCreate = !branchGuestSetupComplete && !branchKeepGuestPreauthPin && !branchGuestPostPayLogin && !branchCompleted && !branchFailed && !branchProcessing && !branchKeepFundingSubflow && !branchMobileWalletSetup && !branchKeepGuestPreauthDesktopOpenWallet && !branchKeepGuestWalletSetup && !branchGuestTokenPicker && !branchKeepWalletPickerSwitch && !branchInitializingPrivy && !branchInitializingPasskeyConfig && !branchOtpVerify && !branchLoginRequested && !branchPasskeyVerify && missingActivePasskeyCredential;
2103
- 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;
2104
- 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);
2105
- 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;
2106
- 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;
2107
- 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;
2097
+ const branchStandardDesktopInlineOpenWallet = !branchGuestSetupComplete && !branchKeepGuestPreauthPin && !branchGuestPostPayLogin && !branchCompleted && !branchFailed && !branchProcessing && state.standardDesktopInlineOpenWallet && state.privyAuthenticated && state.activeCredentialId != null && state.selectedAccountId != null && !state.loginRequested && !state.guestPreauthorizing;
2098
+ const branchKeepFundingSubflow = !branchGuestSetupComplete && !branchKeepGuestPreauthPin && !branchGuestPostPayLogin && !branchCompleted && !branchFailed && !branchProcessing && !branchStandardDesktopInlineOpenWallet && isFundingSourceSubflow;
2099
+ const branchMobileWalletSetup = !branchGuestSetupComplete && !branchKeepGuestPreauthPin && !branchGuestPostPayLogin && !branchCompleted && !branchFailed && !branchProcessing && !branchKeepFundingSubflow && !branchStandardDesktopInlineOpenWallet && state.mobileFlow && state.deeplinkUri != null;
2100
+ 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;
2101
+ 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;
2102
+ const branchGuestTokenPicker = !branchGuestSetupComplete && !branchKeepGuestPreauthPin && !branchGuestPostPayLogin && !branchCompleted && !branchFailed && !branchProcessing && !branchKeepFundingSubflow && !branchMobileWalletSetup && !branchStandardDesktopInlineOpenWallet && !branchKeepGuestPreauthDesktopOpenWallet && !branchKeepGuestWalletSetup && guestTokenPickerEligible;
2103
+ const branchKeepWalletPickerSwitch = !branchGuestSetupComplete && !branchKeepGuestPreauthPin && !branchGuestPostPayLogin && !branchCompleted && !branchFailed && !branchProcessing && !branchKeepFundingSubflow && !branchMobileWalletSetup && !branchStandardDesktopInlineOpenWallet && !branchKeepGuestPreauthDesktopOpenWallet && !branchKeepGuestWalletSetup && !branchGuestTokenPicker && walletPickerSwitchEligible;
2104
+ const branchInitializingPrivy = !branchGuestSetupComplete && !branchKeepGuestPreauthPin && !branchGuestPostPayLogin && !branchCompleted && !branchFailed && !branchProcessing && !branchKeepFundingSubflow && !branchMobileWalletSetup && !branchStandardDesktopInlineOpenWallet && !branchKeepGuestPreauthDesktopOpenWallet && !branchKeepGuestWalletSetup && !branchGuestTokenPicker && !branchKeepWalletPickerSwitch && !state.privyReady;
2105
+ const branchInitializingPasskeyConfig = !branchGuestSetupComplete && !branchKeepGuestPreauthPin && !branchGuestPostPayLogin && !branchCompleted && !branchFailed && !branchProcessing && !branchKeepFundingSubflow && !branchMobileWalletSetup && !branchStandardDesktopInlineOpenWallet && !branchKeepGuestPreauthDesktopOpenWallet && !branchKeepGuestWalletSetup && !branchGuestTokenPicker && !branchKeepWalletPickerSwitch && !branchInitializingPrivy && state.privyAuthenticated && !state.activeCredentialId && !state.passkeyConfigLoaded;
2106
+ const branchOtpVerify = !branchGuestSetupComplete && !branchKeepGuestPreauthPin && !branchGuestPostPayLogin && !branchCompleted && !branchFailed && !branchProcessing && !branchKeepFundingSubflow && !branchMobileWalletSetup && !branchStandardDesktopInlineOpenWallet && !branchKeepGuestPreauthDesktopOpenWallet && !branchKeepGuestWalletSetup && !branchGuestTokenPicker && !branchKeepWalletPickerSwitch && !branchInitializingPrivy && !branchInitializingPasskeyConfig && state.verificationTarget != null && !state.privyAuthenticated;
2107
+ const branchLoginRequested = !branchGuestSetupComplete && !branchKeepGuestPreauthPin && !branchGuestPostPayLogin && !branchCompleted && !branchFailed && !branchProcessing && !branchKeepFundingSubflow && !branchMobileWalletSetup && !branchStandardDesktopInlineOpenWallet && !branchKeepGuestPreauthDesktopOpenWallet && !branchKeepGuestWalletSetup && !branchGuestTokenPicker && !branchKeepWalletPickerSwitch && !branchInitializingPrivy && !branchInitializingPasskeyConfig && !branchOtpVerify && state.loginRequested;
2108
+ const branchPasskeyVerify = !branchGuestSetupComplete && !branchKeepGuestPreauthPin && !branchGuestPostPayLogin && !branchCompleted && !branchFailed && !branchProcessing && !branchKeepFundingSubflow && !branchMobileWalletSetup && !branchStandardDesktopInlineOpenWallet && !branchKeepGuestPreauthDesktopOpenWallet && !branchKeepGuestWalletSetup && !branchGuestTokenPicker && !branchKeepWalletPickerSwitch && !branchInitializingPrivy && !branchInitializingPasskeyConfig && !branchOtpVerify && !branchLoginRequested && shouldPromptPasskeyVerification;
2109
+ const branchPasskeyCreate = !branchGuestSetupComplete && !branchKeepGuestPreauthPin && !branchGuestPostPayLogin && !branchCompleted && !branchFailed && !branchProcessing && !branchKeepFundingSubflow && !branchMobileWalletSetup && !branchStandardDesktopInlineOpenWallet && !branchKeepGuestPreauthDesktopOpenWallet && !branchKeepGuestWalletSetup && !branchGuestTokenPicker && !branchKeepWalletPickerSwitch && !branchInitializingPrivy && !branchInitializingPasskeyConfig && !branchOtpVerify && !branchLoginRequested && !branchPasskeyVerify && missingActivePasskeyCredential;
2110
+ 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;
2111
+ 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);
2112
+ 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;
2113
+ 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;
2114
+ 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;
2108
2115
  const exclusiveBranchFlags = [
2109
2116
  branchGuestSetupComplete,
2110
2117
  branchKeepGuestPreauthPin,
@@ -2112,6 +2119,7 @@ function resolvePhase(state) {
2112
2119
  branchCompleted,
2113
2120
  branchFailed,
2114
2121
  branchProcessing,
2122
+ branchStandardDesktopInlineOpenWallet,
2115
2123
  branchKeepFundingSubflow,
2116
2124
  branchMobileWalletSetup,
2117
2125
  branchKeepGuestPreauthDesktopOpenWallet,
@@ -2140,6 +2148,7 @@ function resolvePhase(state) {
2140
2148
  branchCompleted,
2141
2149
  branchFailed,
2142
2150
  branchProcessing,
2151
+ branchStandardDesktopInlineOpenWallet,
2143
2152
  branchKeepFundingSubflow,
2144
2153
  branchMobileWalletSetup,
2145
2154
  branchKeepGuestPreauthDesktopOpenWallet,
@@ -2177,6 +2186,13 @@ function resolvePhase(state) {
2177
2186
  };
2178
2187
  } else if (branchProcessing) {
2179
2188
  nextPhase = { step: "processing", transfer: state.transfer };
2189
+ } else if (branchStandardDesktopInlineOpenWallet) {
2190
+ nextPhase = {
2191
+ step: "wallet-setup",
2192
+ mobile: null,
2193
+ accountId: state.selectedAccountId,
2194
+ guestDesktopExtension: true
2195
+ };
2180
2196
  } else if (branchKeepFundingSubflow) {
2181
2197
  nextPhase = currentPhase;
2182
2198
  } else if (branchMobileWalletSetup) {
@@ -2285,6 +2301,7 @@ function createInitialState(config) {
2285
2301
  activePublicKey: null,
2286
2302
  loginRequested: false,
2287
2303
  guestPreauthorizing: false,
2304
+ standardDesktopInlineOpenWallet: false,
2288
2305
  guestPreauthSetupCompletePending: false,
2289
2306
  privyReady: false,
2290
2307
  privyAuthenticated: false
@@ -2671,6 +2688,8 @@ function applyAction(state, action) {
2671
2688
  return { ...state, error: action.error };
2672
2689
  case "SET_ONE_TAP_LIMIT_SAVED_DURING_SETUP":
2673
2690
  return { ...state, oneTapLimitSavedDuringSetup: action.saved };
2691
+ case "SET_STANDARD_DESKTOP_INLINE_OPEN_WALLET":
2692
+ return { ...state, standardDesktopInlineOpenWallet: action.value };
2674
2693
  // ── Lifecycle ────────────────────────────────────────────────
2675
2694
  case "NEW_PAYMENT":
2676
2695
  return {
@@ -2692,7 +2711,8 @@ function applyAction(state, action) {
2692
2711
  loginRequested: false,
2693
2712
  oneTapLimitSavedDuringSetup: false,
2694
2713
  guestPreauthorizing: false,
2695
- guestPreauthSetupCompletePending: false
2714
+ guestPreauthSetupCompletePending: false,
2715
+ standardDesktopInlineOpenWallet: false
2696
2716
  };
2697
2717
  case "LOGOUT":
2698
2718
  return {
@@ -3496,10 +3516,15 @@ function LoginScreen({
3496
3516
  error,
3497
3517
  onBack,
3498
3518
  merchantInitials,
3499
- onSocialLogin
3519
+ onSocialLogin,
3520
+ heroTitle,
3521
+ heroSubtitle,
3522
+ inputPlaceholder
3500
3523
  }) {
3501
3524
  const { tokens } = useBlinkConfig();
3502
3525
  const disabled = authInput.trim().length === 0 || sending;
3526
+ const heading = heroTitle ?? "Your Money. Any App.\nOne Tap.";
3527
+ const placeholder = inputPlaceholder ?? "Email or phone number";
3503
3528
  return /* @__PURE__ */ jsxs(
3504
3529
  ScreenLayout,
3505
3530
  {
@@ -3534,7 +3559,8 @@ function LoginScreen({
3534
3559
  ),
3535
3560
  /* @__PURE__ */ jsxs("div", { style: contentStyle, children: [
3536
3561
  /* @__PURE__ */ jsx("img", { src: BLINK_LOGO, alt: "Blink", style: logoStyle }),
3537
- /* @__PURE__ */ jsx("h2", { style: headingStyle(tokens.text), children: "Your Money. Any App.\nOne Tap." }),
3562
+ /* @__PURE__ */ jsx("h2", { style: headingStyle(tokens.text), children: heading }),
3563
+ heroSubtitle ? /* @__PURE__ */ jsx("p", { style: subtitleStyle(tokens.textMuted), children: heroSubtitle }) : null,
3538
3564
  error && /* @__PURE__ */ jsx("div", { style: errorStyle(tokens), children: error }),
3539
3565
  /* @__PURE__ */ jsx(
3540
3566
  "input",
@@ -3543,7 +3569,7 @@ function LoginScreen({
3543
3569
  type: "text",
3544
3570
  inputMode: "text",
3545
3571
  autoComplete: "username",
3546
- placeholder: "Email or phone number",
3572
+ placeholder,
3547
3573
  value: authInput,
3548
3574
  onChange: (e) => onAuthInputChange(e.target.value),
3549
3575
  onKeyDown: (e) => {
@@ -3588,6 +3614,14 @@ var headingStyle = (color) => ({
3588
3614
  margin: "20px 0 8px",
3589
3615
  whiteSpace: "pre-line"
3590
3616
  });
3617
+ var subtitleStyle = (color) => ({
3618
+ fontSize: "0.9rem",
3619
+ fontWeight: 500,
3620
+ lineHeight: 1.45,
3621
+ color,
3622
+ margin: "0 0 16px",
3623
+ maxWidth: 320
3624
+ });
3591
3625
  var inputStyle2 = (tokens) => ({
3592
3626
  width: "100%",
3593
3627
  padding: "15px 16px",
@@ -3710,7 +3744,7 @@ function OtpVerifyScreen({
3710
3744
  /* @__PURE__ */ jsx(ScreenHeader, { onBack }),
3711
3745
  /* @__PURE__ */ jsxs("div", { style: contentStyle2, children: [
3712
3746
  /* @__PURE__ */ jsx("h2", { style: headingStyle2(tokens.text), children: "Confirm it is you" }),
3713
- /* @__PURE__ */ jsxs("p", { style: subtitleStyle(tokens.textSecondary), children: [
3747
+ /* @__PURE__ */ jsxs("p", { style: subtitleStyle2(tokens.textSecondary), children: [
3714
3748
  "We sent a 6-digit code to",
3715
3749
  "\n",
3716
3750
  /* @__PURE__ */ jsx("strong", { children: maskedIdentifier })
@@ -3746,7 +3780,7 @@ var headingStyle2 = (color) => ({
3746
3780
  color,
3747
3781
  margin: "20px 0 8px"
3748
3782
  });
3749
- var subtitleStyle = (color) => ({
3783
+ var subtitleStyle2 = (color) => ({
3750
3784
  fontSize: "0.88rem",
3751
3785
  color,
3752
3786
  margin: "0 0 28px",
@@ -3799,7 +3833,7 @@ function PasskeyScreen({
3799
3833
  /* @__PURE__ */ jsx(ScreenHeader, { onBack, onLogout }),
3800
3834
  /* @__PURE__ */ jsxs("div", { style: contentStyle3, children: [
3801
3835
  /* @__PURE__ */ jsx("h2", { style: headingStyle3(tokens.text), children: "Secure your account with a passkey" }),
3802
- /* @__PURE__ */ jsx("p", { style: subtitleStyle2(tokens.textSecondary), children: "This enables secure one-tap deposits on this device" }),
3836
+ /* @__PURE__ */ jsx("p", { style: subtitleStyle3(tokens.textSecondary), children: "This enables secure one-tap deposits on this device" }),
3803
3837
  error && /* @__PURE__ */ jsx("div", { style: errorBannerStyle2(tokens), children: error })
3804
3838
  ] })
3805
3839
  ]
@@ -3821,7 +3855,7 @@ var headingStyle3 = (color) => ({
3821
3855
  color,
3822
3856
  margin: "24px 0 8px"
3823
3857
  });
3824
- var subtitleStyle2 = (color) => ({
3858
+ var subtitleStyle3 = (color) => ({
3825
3859
  fontSize: "0.86rem",
3826
3860
  color,
3827
3861
  margin: "0 0 20px",
@@ -3839,6 +3873,72 @@ var errorBannerStyle2 = (tokens) => ({
3839
3873
  width: "100%",
3840
3874
  textAlign: "left"
3841
3875
  });
3876
+ function VerifyPasskeyScreen({
3877
+ onVerify,
3878
+ onBack,
3879
+ verifying,
3880
+ error
3881
+ }) {
3882
+ const { tokens } = useBlinkConfig();
3883
+ return /* @__PURE__ */ jsxs(
3884
+ ScreenLayout,
3885
+ {
3886
+ footer: /* @__PURE__ */ jsxs(Fragment, { children: [
3887
+ /* @__PURE__ */ jsx(PrimaryButton, { onClick: onVerify, disabled: verifying, loading: verifying, children: "Verify passkey" }),
3888
+ /* @__PURE__ */ jsx(PoweredByFooter, {})
3889
+ ] }),
3890
+ children: [
3891
+ /* @__PURE__ */ jsx(ScreenHeader, { onBack }),
3892
+ /* @__PURE__ */ jsxs("div", { style: contentStyle4, children: [
3893
+ /* @__PURE__ */ jsx(IconCircle, { variant: "accent", size: 64, children: /* @__PURE__ */ jsxs("svg", { width: "36", height: "36", viewBox: "0 0 24 24", fill: "none", children: [
3894
+ /* @__PURE__ */ jsx("rect", { x: "4", y: "4", width: "16", height: "16", rx: "3", stroke: tokens.accent, strokeWidth: "1.5", strokeDasharray: "3 2" }),
3895
+ /* @__PURE__ */ jsx("circle", { cx: "9", cy: "10", r: "1", fill: tokens.accent }),
3896
+ /* @__PURE__ */ jsx("circle", { cx: "15", cy: "10", r: "1", fill: tokens.accent }),
3897
+ /* @__PURE__ */ 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" })
3898
+ ] }) }),
3899
+ /* @__PURE__ */ jsx("h2", { style: headingStyle4(tokens.text), children: "Verify your passkey" }),
3900
+ /* @__PURE__ */ jsx("p", { style: subtitleStyle4(tokens.textSecondary), children: "Your browser requires a separate window to verify your passkey. Tap the button below to continue." }),
3901
+ error && /* @__PURE__ */ jsx("div", { style: errorBannerStyle3(tokens), children: error }),
3902
+ /* @__PURE__ */ jsx(InfoBanner, { children: "Your passkey is stored securely on your device. Blink never sees your biometric data." })
3903
+ ] })
3904
+ ]
3905
+ }
3906
+ );
3907
+ }
3908
+ var contentStyle4 = {
3909
+ textAlign: "center",
3910
+ flex: 1,
3911
+ display: "flex",
3912
+ flexDirection: "column",
3913
+ alignItems: "center",
3914
+ paddingTop: 32
3915
+ };
3916
+ var headingStyle4 = (color) => ({
3917
+ fontSize: "1.45rem",
3918
+ fontWeight: 700,
3919
+ letterSpacing: "-0.02em",
3920
+ color,
3921
+ margin: "24px 0 8px"
3922
+ });
3923
+ var subtitleStyle4 = (color) => ({
3924
+ fontSize: "0.9rem",
3925
+ color,
3926
+ margin: "0 0 28px",
3927
+ lineHeight: 1.5,
3928
+ maxWidth: 280
3929
+ });
3930
+ var errorBannerStyle3 = (tokens) => ({
3931
+ background: tokens.errorBg,
3932
+ border: `1px solid ${tokens.error}66`,
3933
+ borderRadius: 16,
3934
+ padding: "11px 14px",
3935
+ color: tokens.error,
3936
+ fontSize: "0.84rem",
3937
+ marginBottom: 14,
3938
+ lineHeight: 1.5,
3939
+ width: "100%",
3940
+ textAlign: "left"
3941
+ });
3842
3942
  function Spinner({ size = 40, label }) {
3843
3943
  const { tokens } = useBlinkConfig();
3844
3944
  return /* @__PURE__ */ jsxs(
@@ -3982,8 +4082,8 @@ function WalletPickerScreen({
3982
4082
  children: [
3983
4083
  /* @__PURE__ */ jsx(ScreenHeader, { title: "Set up Blink", onBack, onLogout }),
3984
4084
  hasPending && /* @__PURE__ */ jsxs(Fragment, { children: [
3985
- /* @__PURE__ */ jsx("h2", { style: headingStyle4(tokens.text), children: "Continue where you left off" }),
3986
- /* @__PURE__ */ jsx("p", { style: subtitleStyle3(tokens.textSecondary), children: "You have a wallet that still needs setup" }),
4085
+ /* @__PURE__ */ jsx("h2", { style: headingStyle5(tokens.text), children: "Continue where you left off" }),
4086
+ /* @__PURE__ */ jsx("p", { style: subtitleStyle5(tokens.textSecondary), children: "You have a wallet that still needs setup" }),
3987
4087
  /* @__PURE__ */ jsx("div", { style: pendingListStyle, children: pendingConnections.map((acct) => {
3988
4088
  const wallet = acct.wallets[0];
3989
4089
  const address = wallet ? truncateAddress(wallet.name) : void 0;
@@ -4022,7 +4122,7 @@ function WalletPickerScreen({
4022
4122
  }) }),
4023
4123
  /* @__PURE__ */ jsx("div", { style: dividerStyle2(tokens.border), children: /* @__PURE__ */ jsx("span", { style: dividerTextStyle(tokens.textMuted), children: "Or connect a new wallet" }) })
4024
4124
  ] }),
4025
- !hasPending && /* @__PURE__ */ jsx("h2", { style: headingStyle4(tokens.text), children: "Where is your money?" }),
4125
+ !hasPending && /* @__PURE__ */ jsx("h2", { style: headingStyle5(tokens.text), children: "Where is your money?" }),
4026
4126
  /* @__PURE__ */ jsxs(
4027
4127
  "button",
4028
4128
  {
@@ -4093,14 +4193,14 @@ function WalletPickerScreen({
4093
4193
  }
4094
4194
  );
4095
4195
  }
4096
- var headingStyle4 = (color) => ({
4196
+ var headingStyle5 = (color) => ({
4097
4197
  fontSize: "1.35rem",
4098
4198
  fontWeight: 700,
4099
4199
  letterSpacing: "-0.02em",
4100
4200
  color,
4101
4201
  margin: "8px 0 4px"
4102
4202
  });
4103
- var subtitleStyle3 = (color) => ({
4203
+ var subtitleStyle5 = (color) => ({
4104
4204
  fontSize: "0.88rem",
4105
4205
  color,
4106
4206
  margin: "0 0 24px"
@@ -4336,8 +4436,8 @@ function SetupScreen({
4336
4436
  ] }),
4337
4437
  children: [
4338
4438
  /* @__PURE__ */ jsx(ScreenHeader, { onBack, onLogout }),
4339
- /* @__PURE__ */ jsx("h2", { style: headingStyle5(tokens.text), children: "Set Spending Limit" }),
4340
- error && /* @__PURE__ */ jsx("div", { style: errorBannerStyle3(tokens), children: error }),
4439
+ /* @__PURE__ */ jsx("h2", { style: headingStyle6(tokens.text), children: "Set Spending Limit" }),
4440
+ error && /* @__PURE__ */ jsx("div", { style: errorBannerStyle4(tokens), children: error }),
4341
4441
  /* @__PURE__ */ jsxs("div", { style: amountRowStyle, children: [
4342
4442
  /* @__PURE__ */ jsx("div", { style: { flex: 1 }, children: editing ? /* @__PURE__ */ jsxs("div", { style: limitValueStyle(tokens.text), children: [
4343
4443
  "$",
@@ -4412,7 +4512,7 @@ function SetupScreen({
4412
4512
  }
4413
4513
  );
4414
4514
  }
4415
- var headingStyle5 = (color) => ({
4515
+ var headingStyle6 = (color) => ({
4416
4516
  fontSize: "1.1rem",
4417
4517
  fontWeight: 700,
4418
4518
  letterSpacing: "-0.02em",
@@ -4420,7 +4520,7 @@ var headingStyle5 = (color) => ({
4420
4520
  margin: "8px 0 24px",
4421
4521
  textAlign: "center"
4422
4522
  });
4423
- var errorBannerStyle3 = (tokens) => ({
4523
+ var errorBannerStyle4 = (tokens) => ({
4424
4524
  background: tokens.errorBg,
4425
4525
  border: `1px solid ${tokens.error}66`,
4426
4526
  borderRadius: 16,
@@ -4511,10 +4611,10 @@ function SetupStatusScreen({
4511
4611
  if (complete) {
4512
4612
  return /* @__PURE__ */ jsxs(ScreenLayout, { footer: /* @__PURE__ */ jsx(PoweredByFooter, {}), children: [
4513
4613
  /* @__PURE__ */ jsx(ScreenHeader, { onBack: onContinue }),
4514
- /* @__PURE__ */ jsxs("div", { style: contentStyle4, children: [
4614
+ /* @__PURE__ */ jsxs("div", { style: contentStyle5, children: [
4515
4615
  /* @__PURE__ */ jsx("img", { src: BLINK_LOGO, alt: "Blink", style: mascotStyle2 }),
4516
- /* @__PURE__ */ jsx("h2", { style: headingStyle6(tokens.text), children: "Done!" }),
4517
- /* @__PURE__ */ jsx("p", { style: subtitleStyle4(tokens.textSecondary), children: "Return to the app to try one-tap deposits." })
4616
+ /* @__PURE__ */ jsx("h2", { style: headingStyle7(tokens.text), children: "Done!" }),
4617
+ /* @__PURE__ */ jsx("p", { style: subtitleStyle6(tokens.textSecondary), children: "Return to the app to try one-tap deposits." })
4518
4618
  ] })
4519
4619
  ] });
4520
4620
  }
@@ -4524,16 +4624,16 @@ function SetupStatusScreen({
4524
4624
  ];
4525
4625
  return /* @__PURE__ */ jsxs(ScreenLayout, { children: [
4526
4626
  /* @__PURE__ */ jsx(ScreenHeader, { onLogout }),
4527
- /* @__PURE__ */ jsxs("div", { style: contentStyle4, children: [
4627
+ /* @__PURE__ */ jsxs("div", { style: contentStyle5, children: [
4528
4628
  /* @__PURE__ */ jsx(Spinner, { size: 48 }),
4529
- /* @__PURE__ */ jsx("h2", { style: headingStyle6(tokens.text), children: "Setting up One-Tap..." }),
4530
- error && /* @__PURE__ */ jsx("div", { style: errorBannerStyle4(tokens), children: error }),
4629
+ /* @__PURE__ */ jsx("h2", { style: headingStyle7(tokens.text), children: "Setting up One-Tap..." }),
4630
+ error && /* @__PURE__ */ jsx("div", { style: errorBannerStyle5(tokens), children: error }),
4531
4631
  /* @__PURE__ */ jsx("div", { style: stepsWrapStyle, children: /* @__PURE__ */ jsx(StepList, { steps }) }),
4532
4632
  /* @__PURE__ */ jsx("p", { style: waitHintStyle(tokens.textMuted), children: "Usually takes a few seconds" })
4533
4633
  ] })
4534
4634
  ] });
4535
4635
  }
4536
- var contentStyle4 = {
4636
+ var contentStyle5 = {
4537
4637
  flex: 1,
4538
4638
  display: "flex",
4539
4639
  flexDirection: "column",
@@ -4546,21 +4646,21 @@ var mascotStyle2 = {
4546
4646
  width: 56,
4547
4647
  height: 56
4548
4648
  };
4549
- var headingStyle6 = (color) => ({
4649
+ var headingStyle7 = (color) => ({
4550
4650
  fontSize: "1.45rem",
4551
4651
  fontWeight: 700,
4552
4652
  letterSpacing: "-0.02em",
4553
4653
  color,
4554
4654
  margin: "20px 0 8px"
4555
4655
  });
4556
- var subtitleStyle4 = (color) => ({
4656
+ var subtitleStyle6 = (color) => ({
4557
4657
  fontSize: "0.9rem",
4558
4658
  color,
4559
4659
  margin: "0 0 28px",
4560
4660
  lineHeight: 1.5,
4561
4661
  maxWidth: 260
4562
4662
  });
4563
- var errorBannerStyle4 = (tokens) => ({
4663
+ var errorBannerStyle5 = (tokens) => ({
4564
4664
  background: tokens.errorBg,
4565
4665
  border: `1px solid ${tokens.error}66`,
4566
4666
  borderRadius: 16,
@@ -4765,7 +4865,7 @@ function DepositScreen({
4765
4865
  minDepositFloor.toFixed(2),
4766
4866
  " to deposit via One-Tap."
4767
4867
  ] }),
4768
- error && /* @__PURE__ */ jsx("div", { style: errorBannerStyle5(tokens), children: error })
4868
+ error && /* @__PURE__ */ jsx("div", { style: errorBannerStyle6(tokens), children: error })
4769
4869
  ]
4770
4870
  }
4771
4871
  );
@@ -4951,7 +5051,7 @@ var spendingLimitStyle = (color) => ({
4951
5051
  color,
4952
5052
  marginBottom: 8
4953
5053
  });
4954
- var errorBannerStyle5 = (tokens) => ({
5054
+ var errorBannerStyle6 = (tokens) => ({
4955
5055
  background: tokens.errorBg,
4956
5056
  border: `1px solid ${tokens.error}66`,
4957
5057
  borderRadius: 16,
@@ -4996,22 +5096,22 @@ function SuccessScreen({
4996
5096
  ] }),
4997
5097
  children: [
4998
5098
  /* @__PURE__ */ jsx(ScreenHeader, { onLogout }),
4999
- /* @__PURE__ */ jsxs("div", { style: contentStyle5, children: [
5099
+ /* @__PURE__ */ jsxs("div", { style: contentStyle6, children: [
5000
5100
  succeeded ? /* @__PURE__ */ jsxs(Fragment, { children: [
5001
5101
  /* @__PURE__ */ jsx(IconCircle, { variant: "success", size: 64, children: /* @__PURE__ */ jsx("svg", { width: "32", height: "32", viewBox: "0 0 24 24", fill: "none", children: /* @__PURE__ */ jsx("path", { d: "M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z", fill: tokens.success }) }) }),
5002
- /* @__PURE__ */ jsxs("h2", { style: headingStyle7(tokens.text), children: [
5102
+ /* @__PURE__ */ jsxs("h2", { style: headingStyle8(tokens.text), children: [
5003
5103
  "$",
5004
5104
  amount.toFixed(2),
5005
5105
  " deposited"
5006
5106
  ] }),
5007
- merchantName && /* @__PURE__ */ jsxs("p", { style: subtitleStyle5(tokens.textSecondary), children: [
5107
+ merchantName && /* @__PURE__ */ jsxs("p", { style: subtitleStyle7(tokens.textSecondary), children: [
5008
5108
  "to ",
5009
5109
  merchantName
5010
5110
  ] })
5011
5111
  ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
5012
5112
  /* @__PURE__ */ jsx(IconCircle, { variant: "error", size: 64, children: /* @__PURE__ */ jsx("svg", { width: "32", height: "32", viewBox: "0 0 24 24", fill: "none", children: /* @__PURE__ */ 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 }) }) }),
5013
- /* @__PURE__ */ jsx("h2", { style: headingStyle7(tokens.text), children: "Transfer failed" }),
5014
- error && /* @__PURE__ */ jsx("p", { style: subtitleStyle5(tokens.error), children: error })
5113
+ /* @__PURE__ */ jsx("h2", { style: headingStyle8(tokens.text), children: "Transfer failed" }),
5114
+ error && /* @__PURE__ */ jsx("p", { style: subtitleStyle7(tokens.error), children: error })
5015
5115
  ] }),
5016
5116
  /* @__PURE__ */ jsxs("div", { style: summaryCardStyle(tokens), children: [
5017
5117
  sourceName && /* @__PURE__ */ jsxs("div", { style: summaryRowStyle, children: [
@@ -5043,21 +5143,21 @@ function SuccessScreen({
5043
5143
  }
5044
5144
  );
5045
5145
  }
5046
- var contentStyle5 = {
5146
+ var contentStyle6 = {
5047
5147
  flex: 1,
5048
5148
  display: "flex",
5049
5149
  flexDirection: "column",
5050
5150
  alignItems: "center",
5051
5151
  paddingTop: 16
5052
5152
  };
5053
- var headingStyle7 = (color) => ({
5153
+ var headingStyle8 = (color) => ({
5054
5154
  fontSize: "1.5rem",
5055
5155
  fontWeight: 700,
5056
5156
  letterSpacing: "-0.02em",
5057
5157
  color,
5058
5158
  margin: "20px 0 4px"
5059
5159
  });
5060
- var subtitleStyle5 = (color) => ({
5160
+ var subtitleStyle7 = (color) => ({
5061
5161
  fontSize: "0.9rem",
5062
5162
  color,
5063
5163
  margin: "0 0 20px"
@@ -5171,7 +5271,7 @@ function SelectSourceScreen({
5171
5271
  onLogout
5172
5272
  }
5173
5273
  ),
5174
- /* @__PURE__ */ jsx("p", { style: subtitleStyle6(tokens.textMuted), children: "Choose which chain and token to pay from." }),
5274
+ /* @__PURE__ */ jsx("p", { style: subtitleStyle8(tokens.textMuted), children: "Choose which chain and token to pay from." }),
5175
5275
  /* @__PURE__ */ jsx("label", { style: labelStyle4(tokens.textSecondary), children: "Chain" }),
5176
5276
  /* @__PURE__ */ jsx("div", { style: optionListStyle, children: choices.map((chain) => {
5177
5277
  const isSelected = chain.chainName === selectedChainName;
@@ -5232,7 +5332,7 @@ function SelectSourceScreen({
5232
5332
  }
5233
5333
  );
5234
5334
  }
5235
- var subtitleStyle6 = (color) => ({
5335
+ var subtitleStyle8 = (color) => ({
5236
5336
  fontSize: "0.85rem",
5237
5337
  color,
5238
5338
  margin: "0 0 20px",
@@ -5374,8 +5474,8 @@ function AdvancedSourceScreen({
5374
5474
  right: /* @__PURE__ */ jsx("span", { style: advancedBadgeStyle(tokens.accent), children: "Advanced" })
5375
5475
  }
5376
5476
  ),
5377
- /* @__PURE__ */ jsx("h2", { style: headingStyle8(tokens.text), children: "Set up One-Tap deposits" }),
5378
- /* @__PURE__ */ jsx("p", { style: subtitleStyle7(tokens.textSecondary), children: "Select a token source for your One-Tap deposits." }),
5477
+ /* @__PURE__ */ jsx("h2", { style: headingStyle9(tokens.text), children: "Set up One-Tap deposits" }),
5478
+ /* @__PURE__ */ jsx("p", { style: subtitleStyle9(tokens.textSecondary), children: "Select a token source for your One-Tap deposits." }),
5379
5479
  /* @__PURE__ */ jsx("label", { style: labelStyle5(tokens.textSecondary), children: "Select tokens to approve" }),
5380
5480
  /* @__PURE__ */ jsx("div", { style: chainListStyle, children: choices.map((chain) => {
5381
5481
  const isExpanded = expandedChain === chain.chainName;
@@ -5438,14 +5538,14 @@ var advancedBadgeStyle = (color) => ({
5438
5538
  padding: "3px 10px",
5439
5539
  letterSpacing: "0.02em"
5440
5540
  });
5441
- var headingStyle8 = (color) => ({
5541
+ var headingStyle9 = (color) => ({
5442
5542
  fontSize: "1.3rem",
5443
5543
  fontWeight: 700,
5444
5544
  letterSpacing: "-0.02em",
5445
5545
  color,
5446
5546
  margin: "8px 0 4px"
5447
5547
  });
5448
- var subtitleStyle7 = (color) => ({
5548
+ var subtitleStyle9 = (color) => ({
5449
5549
  fontSize: "0.86rem",
5450
5550
  color,
5451
5551
  margin: "0 0 20px",
@@ -5573,15 +5673,15 @@ function TransferStatusScreen({
5573
5673
  const steps = buildSteps(phase);
5574
5674
  return /* @__PURE__ */ jsxs(ScreenLayout, { footer: /* @__PURE__ */ jsx(PoweredByFooter, {}), children: [
5575
5675
  /* @__PURE__ */ jsx(ScreenHeader, { onLogout }),
5576
- /* @__PURE__ */ jsxs("div", { style: contentStyle6, children: [
5676
+ /* @__PURE__ */ jsxs("div", { style: contentStyle7, children: [
5577
5677
  /* @__PURE__ */ jsx(Spinner, { size: 64 }),
5578
- /* @__PURE__ */ jsx("h2", { style: headingStyle9(tokens.text), children: "Depositing your money..." }),
5579
- error && /* @__PURE__ */ jsx("div", { style: errorBannerStyle6(tokens), children: error }),
5678
+ /* @__PURE__ */ jsx("h2", { style: headingStyle10(tokens.text), children: "Depositing your money..." }),
5679
+ error && /* @__PURE__ */ jsx("div", { style: errorBannerStyle7(tokens), children: error }),
5580
5680
  /* @__PURE__ */ jsx("div", { style: stepsWrapStyle2, children: /* @__PURE__ */ jsx(StepList, { steps }) })
5581
5681
  ] })
5582
5682
  ] });
5583
5683
  }
5584
- var contentStyle6 = {
5684
+ var contentStyle7 = {
5585
5685
  flex: 1,
5586
5686
  display: "flex",
5587
5687
  flexDirection: "column",
@@ -5590,14 +5690,14 @@ var contentStyle6 = {
5590
5690
  textAlign: "center",
5591
5691
  padding: "0 24px"
5592
5692
  };
5593
- var headingStyle9 = (color) => ({
5693
+ var headingStyle10 = (color) => ({
5594
5694
  fontSize: "1.45rem",
5595
5695
  fontWeight: 700,
5596
5696
  letterSpacing: "-0.02em",
5597
5697
  color,
5598
5698
  margin: "20px 0 16px"
5599
5699
  });
5600
- var errorBannerStyle6 = (tokens) => ({
5700
+ var errorBannerStyle7 = (tokens) => ({
5601
5701
  background: tokens.errorBg,
5602
5702
  border: `1px solid ${tokens.error}66`,
5603
5703
  borderRadius: 16,
@@ -5651,14 +5751,14 @@ function OpenWalletScreen({
5651
5751
  ] }),
5652
5752
  children: [
5653
5753
  /* @__PURE__ */ jsx(ScreenHeader, { onLogout }),
5654
- /* @__PURE__ */ jsxs("div", { style: contentStyle7, children: [
5754
+ /* @__PURE__ */ jsxs("div", { style: contentStyle8, children: [
5655
5755
  /* @__PURE__ */ jsx("div", { style: logoCircleStyle(tokens.bgInput), children: logoSrc ? /* @__PURE__ */ jsx("img", { src: logoSrc, alt: displayName, style: logoStyle2 }) : /* @__PURE__ */ jsx(Spinner, { size: 32 }) }),
5656
- /* @__PURE__ */ jsxs("h2", { style: headingStyle10(tokens.text), children: [
5756
+ /* @__PURE__ */ jsxs("h2", { style: headingStyle11(tokens.text), children: [
5657
5757
  "Setting up ",
5658
5758
  displayName,
5659
5759
  "..."
5660
5760
  ] }),
5661
- /* @__PURE__ */ jsx("p", { style: subtitleStyle8(tokens.textSecondary), children: "Approve the connection in your wallet extension." }),
5761
+ /* @__PURE__ */ jsx("p", { style: subtitleStyle10(tokens.textSecondary), children: "Approve the connection in your wallet extension." }),
5662
5762
  /* @__PURE__ */ jsxs("div", { style: waitingBadgeStyle(tokens), children: [
5663
5763
  /* @__PURE__ */ jsx(Spinner, { size: 14 }),
5664
5764
  /* @__PURE__ */ jsx("span", { children: "Waiting for authorization..." })
@@ -5684,10 +5784,10 @@ function OpenWalletScreen({
5684
5784
  ] }),
5685
5785
  children: [
5686
5786
  /* @__PURE__ */ jsx(ScreenHeader, { onBack, onLogout }),
5687
- /* @__PURE__ */ jsxs("div", { style: contentStyle7, children: [
5787
+ /* @__PURE__ */ jsxs("div", { style: contentStyle8, children: [
5688
5788
  /* @__PURE__ */ jsx("div", { style: logoCircleStyle(tokens.bgInput), children: logoSrc ? /* @__PURE__ */ jsx("img", { src: logoSrc, alt: displayName, style: logoStyle2 }) : /* @__PURE__ */ jsx(Spinner, { size: 32 }) }),
5689
- /* @__PURE__ */ jsx("h2", { style: headingStyle10(tokens.text), children: loading ? "Connecting..." : `Open ${displayName}` }),
5690
- /* @__PURE__ */ jsx("p", { style: subtitleStyle8(tokens.textSecondary), children: loading ? "Creating transfer and preparing your wallet link..." : `Continue in ${displayName} to authorize this connection.` }),
5789
+ /* @__PURE__ */ jsx("h2", { style: headingStyle11(tokens.text), children: loading ? "Connecting..." : `Open ${displayName}` }),
5790
+ /* @__PURE__ */ jsx("p", { style: subtitleStyle10(tokens.textSecondary), children: loading ? "Creating transfer and preparing your wallet link..." : `Continue in ${displayName} to authorize this connection.` }),
5691
5791
  !loading && /* @__PURE__ */ jsxs("div", { style: waitingBadgeStyle(tokens), children: [
5692
5792
  /* @__PURE__ */ jsx(Spinner, { size: 14 }),
5693
5793
  /* @__PURE__ */ jsx("span", { children: "Waiting for authorization..." })
@@ -5697,7 +5797,7 @@ function OpenWalletScreen({
5697
5797
  }
5698
5798
  );
5699
5799
  }
5700
- var contentStyle7 = {
5800
+ var contentStyle8 = {
5701
5801
  flex: 1,
5702
5802
  display: "flex",
5703
5803
  flexDirection: "column",
@@ -5727,14 +5827,14 @@ var logoStyle2 = {
5727
5827
  borderRadius: 12,
5728
5828
  objectFit: "contain"
5729
5829
  };
5730
- var headingStyle10 = (color) => ({
5830
+ var headingStyle11 = (color) => ({
5731
5831
  fontSize: "1.45rem",
5732
5832
  fontWeight: 700,
5733
5833
  letterSpacing: "-0.02em",
5734
5834
  color,
5735
5835
  margin: "20px 0 8px"
5736
5836
  });
5737
- var subtitleStyle8 = (color) => ({
5837
+ var subtitleStyle10 = (color) => ({
5738
5838
  fontSize: "0.9rem",
5739
5839
  color,
5740
5840
  margin: "0 0 24px",
@@ -5783,10 +5883,10 @@ function ConfirmSignScreen({
5783
5883
  ] }),
5784
5884
  children: [
5785
5885
  /* @__PURE__ */ jsx(ScreenHeader, { onLogout }),
5786
- /* @__PURE__ */ jsxs("div", { style: contentStyle8, children: [
5886
+ /* @__PURE__ */ jsxs("div", { style: contentStyle9, children: [
5787
5887
  logoSrc ? /* @__PURE__ */ jsx("img", { src: logoSrc, alt: displayName, style: logoStyle3 }) : /* @__PURE__ */ jsx(Spinner, { size: 48 }),
5788
- /* @__PURE__ */ jsx("h2", { style: headingStyle11(tokens.text), children: "Wallet authorized" }),
5789
- /* @__PURE__ */ jsxs("p", { style: subtitleStyle9(tokens.textSecondary), children: [
5888
+ /* @__PURE__ */ jsx("h2", { style: headingStyle12(tokens.text), children: "Wallet authorized" }),
5889
+ /* @__PURE__ */ jsxs("p", { style: subtitleStyle11(tokens.textSecondary), children: [
5790
5890
  displayName,
5791
5891
  " approved the connection. Tap below to confirm your payment."
5792
5892
  ] }),
@@ -5799,7 +5899,7 @@ function ConfirmSignScreen({
5799
5899
  }
5800
5900
  );
5801
5901
  }
5802
- var contentStyle8 = {
5902
+ var contentStyle9 = {
5803
5903
  flex: 1,
5804
5904
  display: "flex",
5805
5905
  flexDirection: "column",
@@ -5814,14 +5914,14 @@ var logoStyle3 = {
5814
5914
  borderRadius: 14,
5815
5915
  objectFit: "contain"
5816
5916
  };
5817
- var headingStyle11 = (color) => ({
5917
+ var headingStyle12 = (color) => ({
5818
5918
  fontSize: "1.45rem",
5819
5919
  fontWeight: 700,
5820
5920
  letterSpacing: "-0.02em",
5821
5921
  color,
5822
5922
  margin: "20px 0 8px"
5823
5923
  });
5824
- var subtitleStyle9 = (color) => ({
5924
+ var subtitleStyle11 = (color) => ({
5825
5925
  fontSize: "0.9rem",
5826
5926
  color,
5827
5927
  margin: "0 0 24px",
@@ -6091,60 +6191,232 @@ var selectCircleSelectedStyle = (color) => ({
6091
6191
  justifyContent: "center",
6092
6192
  flexShrink: 0
6093
6193
  });
6194
+ function entryKey(entry) {
6195
+ return `${entry.sourceChainId}-${entry.tokenAddress.toLowerCase()}`;
6196
+ }
6197
+ function formatPreciseMoneyForDisplay(fee) {
6198
+ const raw = fee.value.trim();
6199
+ if (fee.currency === "USD") {
6200
+ if (!/^\d+(\.\d*)?$/.test(raw)) {
6201
+ return `$${raw}`;
6202
+ }
6203
+ const [whole, frac = ""] = raw.split(".");
6204
+ const dec = `${frac}00`.slice(0, 2);
6205
+ const intFmt = whole.replace(/\B(?=(\d{3})+(?!\d))/g, ",");
6206
+ return `$${intFmt}.${dec}`;
6207
+ }
6208
+ return `${raw} ${fee.currency}`;
6209
+ }
6094
6210
  function GuestTokenPickerScreen({
6095
6211
  entries,
6096
6212
  loading,
6097
6213
  setting,
6098
6214
  depositAmount,
6099
6215
  error,
6216
+ pendingEntry,
6217
+ quoteFee,
6218
+ quoteLoading,
6100
6219
  onSelect,
6101
- onBack
6220
+ onConfirm,
6221
+ onBack,
6222
+ defaultTokenListExpanded = false
6102
6223
  }) {
6103
6224
  const { tokens: t } = useBlinkConfig();
6225
+ const pendingKey = pendingEntry ? entryKey(pendingEntry) : null;
6226
+ const [tokenListOpen, setTokenListOpen] = useState(defaultTokenListExpanded);
6227
+ const pickerRef = useRef(null);
6228
+ useEffect(() => {
6229
+ if (!tokenListOpen) return;
6230
+ const handleMouseDown = (e) => {
6231
+ if (pickerRef.current && !pickerRef.current.contains(e.target)) {
6232
+ setTokenListOpen(false);
6233
+ }
6234
+ };
6235
+ document.addEventListener("mousedown", handleMouseDown);
6236
+ return () => document.removeEventListener("mousedown", handleMouseDown);
6237
+ }, [tokenListOpen]);
6104
6238
  if (loading) {
6105
6239
  return /* @__PURE__ */ jsxs(ScreenLayout, { children: [
6106
- /* @__PURE__ */ jsx(ScreenHeader, { title: "Select Token", onBack }),
6240
+ /* @__PURE__ */ jsx(ScreenHeader, { onBack }),
6107
6241
  /* @__PURE__ */ jsx("div", { style: loadingWrapStyle, children: /* @__PURE__ */ jsx(Spinner, { label: "Loading balances..." }) })
6108
6242
  ] });
6109
6243
  }
6110
- return /* @__PURE__ */ jsxs(ScreenLayout, { footer: /* @__PURE__ */ jsx(PoweredByFooter, {}), children: [
6111
- /* @__PURE__ */ jsx(ScreenHeader, { title: "Select Token", onBack }),
6112
- depositAmount != null && /* @__PURE__ */ jsxs("div", { style: depositHeaderStyle, children: [
6113
- /* @__PURE__ */ jsx("div", { style: depositLabelStyle3(t.textMuted), children: "Depositing" }),
6114
- /* @__PURE__ */ jsxs("div", { style: depositAmountStyle2(t.text), children: [
6115
- "$",
6116
- depositAmount.toLocaleString("en-US", { minimumFractionDigits: 2, maximumFractionDigits: 2 })
6117
- ] })
6118
- ] }),
6119
- error && /* @__PURE__ */ jsx("p", { style: errorStyle3(t.error), children: error }),
6120
- /* @__PURE__ */ jsx("div", { style: sectionLabelStyle2(t.textMuted), children: "Choose token to pay with" }),
6121
- /* @__PURE__ */ jsx("div", { style: tokenListStyle3, children: entries.map((entry) => /* @__PURE__ */ jsxs(
6122
- "button",
6123
- {
6124
- type: "button",
6125
- onClick: () => onSelect(entry),
6126
- disabled: setting,
6127
- style: tokenRowStyle3(t, setting),
6128
- children: [
6129
- /* @__PURE__ */ jsx("div", { style: tokenIconCircleStyle3(t, !!TOKEN_LOGOS[entry.tokenSymbol]), children: TOKEN_LOGOS[entry.tokenSymbol] ? /* @__PURE__ */ jsx("img", { src: TOKEN_LOGOS[entry.tokenSymbol], alt: entry.tokenSymbol, style: tokenLogoImgStyle3 }) : /* @__PURE__ */ jsx("span", { style: tokenIconTextStyle3(t.textMuted), children: "$" }) }),
6130
- /* @__PURE__ */ jsxs("div", { style: tokenInfoStyle3, children: [
6131
- /* @__PURE__ */ jsxs("div", { style: tokenNameRowStyle2, children: [
6132
- /* @__PURE__ */ jsx("span", { style: tokenSymbolTextStyle2(t.text), children: entry.tokenSymbol }),
6133
- /* @__PURE__ */ jsx("span", { style: tokenChainDotStyle2(t.textMuted), children: "\xB7" }),
6134
- /* @__PURE__ */ jsx("span", { style: tokenChainTextStyle2(t.textMuted), children: entry.chainName })
6135
- ] }),
6136
- /* @__PURE__ */ jsxs("span", { style: tokenBalanceStyle2(t.textMuted), children: [
6137
- "$",
6138
- entry.balance.toLocaleString("en-US", { minimumFractionDigits: 2, maximumFractionDigits: 2 })
6244
+ const rowBusy = setting || quoteLoading;
6245
+ const displayEntry = pendingEntry ?? entries[0] ?? null;
6246
+ const canConfirm = Boolean(quoteFee && pendingEntry && !quoteLoading);
6247
+ const feeLine = (() => {
6248
+ if (quoteLoading && pendingEntry) {
6249
+ return /* @__PURE__ */ jsx("div", { style: feeRowStyle(t.textMuted), "aria-live": "polite", children: "Estimating fee\u2026" });
6250
+ }
6251
+ if (quoteFee) {
6252
+ return /* @__PURE__ */ jsxs("div", { style: feeRowStyle(t.textMuted), "aria-live": "polite", children: [
6253
+ "Estimated fee ",
6254
+ formatPreciseMoneyForDisplay(quoteFee)
6255
+ ] });
6256
+ }
6257
+ return null;
6258
+ })();
6259
+ return /* @__PURE__ */ jsxs(
6260
+ ScreenLayout,
6261
+ {
6262
+ footer: /* @__PURE__ */ jsxs(Fragment, { children: [
6263
+ canConfirm && /* @__PURE__ */ jsx(PrimaryButton, { onClick: () => void onConfirm(), loading: setting, disabled: setting, children: "Continue" }),
6264
+ /* @__PURE__ */ jsx(PoweredByFooter, {})
6265
+ ] }),
6266
+ children: [
6267
+ /* @__PURE__ */ jsx(ScreenHeader, { onBack }),
6268
+ /* @__PURE__ */ jsxs("div", { ref: pickerRef, children: [
6269
+ /* @__PURE__ */ jsxs("div", { style: depositCardSurfaceStyle(t, tokenListOpen), children: [
6270
+ /* @__PURE__ */ jsx("div", { style: depositLabelStyle3(t.textMuted), children: "Deposit" }),
6271
+ /* @__PURE__ */ jsxs("div", { style: amountBandStyle, children: [
6272
+ /* @__PURE__ */ jsxs("div", { style: amountLeftColStyle, children: [
6273
+ depositAmount != null && /* @__PURE__ */ jsxs("div", { style: depositAmountStyle2(t.text), children: [
6274
+ "$",
6275
+ depositAmount.toLocaleString("en-US", {
6276
+ minimumFractionDigits: 0,
6277
+ maximumFractionDigits: 2
6278
+ })
6279
+ ] }),
6280
+ feeLine
6281
+ ] }),
6282
+ /* @__PURE__ */ jsxs(
6283
+ "button",
6284
+ {
6285
+ type: "button",
6286
+ onClick: () => entries.length > 0 && setTokenListOpen((o) => !o),
6287
+ disabled: entries.length === 0 || rowBusy,
6288
+ style: tokenTriggerStyle(t, entries.length > 0 && !rowBusy),
6289
+ "aria-expanded": tokenListOpen,
6290
+ "aria-haspopup": "listbox",
6291
+ children: [
6292
+ /* @__PURE__ */ jsx("div", { style: tokenTriggerIconsStyle, children: pendingEntry && TOKEN_LOGOS[pendingEntry.tokenSymbol] ? /* @__PURE__ */ jsx(
6293
+ "img",
6294
+ {
6295
+ src: TOKEN_LOGOS[pendingEntry.tokenSymbol],
6296
+ alt: "",
6297
+ width: 28,
6298
+ height: 28,
6299
+ style: triggerLogoStyle(0)
6300
+ }
6301
+ ) : entries[0] && entries[1] && TOKEN_LOGOS[entries[0].tokenSymbol] && TOKEN_LOGOS[entries[1].tokenSymbol] ? /* @__PURE__ */ jsxs(Fragment, { children: [
6302
+ /* @__PURE__ */ jsx(
6303
+ "img",
6304
+ {
6305
+ src: TOKEN_LOGOS[entries[0].tokenSymbol],
6306
+ alt: "",
6307
+ width: 28,
6308
+ height: 28,
6309
+ style: triggerLogoStyle(0)
6310
+ }
6311
+ ),
6312
+ /* @__PURE__ */ jsx(
6313
+ "img",
6314
+ {
6315
+ src: TOKEN_LOGOS[entries[1].tokenSymbol],
6316
+ alt: "",
6317
+ width: 28,
6318
+ height: 28,
6319
+ style: triggerLogoStyle(14)
6320
+ }
6321
+ )
6322
+ ] }) : displayEntry && TOKEN_LOGOS[displayEntry.tokenSymbol] ? /* @__PURE__ */ jsx(
6323
+ "img",
6324
+ {
6325
+ src: TOKEN_LOGOS[displayEntry.tokenSymbol],
6326
+ alt: "",
6327
+ width: 28,
6328
+ height: 28,
6329
+ style: triggerLogoStyle(0)
6330
+ }
6331
+ ) : null }),
6332
+ /* @__PURE__ */ jsx("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", style: { opacity: 0.5 }, children: tokenListOpen ? /* @__PURE__ */ jsx(
6333
+ "path",
6334
+ {
6335
+ d: "M18 15l-6-6-6 6",
6336
+ stroke: t.textMuted,
6337
+ strokeWidth: "2.5",
6338
+ strokeLinecap: "round",
6339
+ strokeLinejoin: "round"
6340
+ }
6341
+ ) : /* @__PURE__ */ jsx(
6342
+ "path",
6343
+ {
6344
+ d: "M6 9l6 6 6-6",
6345
+ stroke: t.textMuted,
6346
+ strokeWidth: "2.5",
6347
+ strokeLinecap: "round",
6348
+ strokeLinejoin: "round"
6349
+ }
6350
+ ) })
6351
+ ]
6352
+ }
6353
+ )
6139
6354
  ] })
6140
6355
  ] }),
6141
- /* @__PURE__ */ jsx("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", style: chevronStyle, children: /* @__PURE__ */ 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 }) })
6142
- ]
6143
- },
6144
- `${entry.chainId}-${entry.tokenAddress}`
6145
- )) }),
6146
- entries.length === 0 && /* @__PURE__ */ jsx("p", { style: emptyStyle(t.textMuted), children: "No supported tokens found in your wallet. Please ensure you have USDC or USDT." })
6147
- ] });
6356
+ tokenListOpen && entries.length > 0 && /* @__PURE__ */ jsxs("div", { style: tokenDropdownOuterStyle(t), children: [
6357
+ /* @__PURE__ */ jsx("div", { style: accountDropdownLabelStyle2(t.textMuted), children: "Choose token" }),
6358
+ /* @__PURE__ */ jsx("div", { style: tokenDropdownInnerStyle(t), children: entries.map((entry, index) => {
6359
+ const selected = pendingKey === entryKey(entry);
6360
+ const isLast = index === entries.length - 1;
6361
+ return /* @__PURE__ */ jsxs(
6362
+ "button",
6363
+ {
6364
+ type: "button",
6365
+ onClick: () => {
6366
+ void onSelect(entry);
6367
+ },
6368
+ disabled: rowBusy,
6369
+ style: pickerRowStyle(t, selected, isLast),
6370
+ children: [
6371
+ /* @__PURE__ */ jsxs("div", { style: pickerRowLeftStyle, children: [
6372
+ /* @__PURE__ */ jsx("div", { style: tokenIconCircleStyle3(t, !!TOKEN_LOGOS[entry.tokenSymbol]), children: TOKEN_LOGOS[entry.tokenSymbol] ? /* @__PURE__ */ jsx(
6373
+ "img",
6374
+ {
6375
+ src: TOKEN_LOGOS[entry.tokenSymbol],
6376
+ alt: entry.tokenSymbol,
6377
+ style: tokenLogoImgStyle3
6378
+ }
6379
+ ) : /* @__PURE__ */ jsx("span", { style: tokenIconTextStyle3(t.textMuted), children: "$" }) }),
6380
+ /* @__PURE__ */ jsxs("div", { style: pickerRowInfoStyle, children: [
6381
+ /* @__PURE__ */ jsxs("div", { style: tokenNameRowStyle2, children: [
6382
+ /* @__PURE__ */ jsx("span", { style: tokenSymbolTextStyle2(t.text), children: entry.tokenSymbol }),
6383
+ /* @__PURE__ */ jsx("span", { style: tokenChainDotStyle2(t.textMuted), children: "\xB7" }),
6384
+ /* @__PURE__ */ jsx("span", { style: tokenChainTextStyle2(t.textMuted), children: entry.chainName })
6385
+ ] }),
6386
+ /* @__PURE__ */ jsxs("span", { style: tokenBalanceStyle2(t.textMuted), children: [
6387
+ "$",
6388
+ entry.balance.toLocaleString("en-US", {
6389
+ minimumFractionDigits: 2,
6390
+ maximumFractionDigits: 2
6391
+ })
6392
+ ] })
6393
+ ] })
6394
+ ] }),
6395
+ selected ? /* @__PURE__ */ jsxs("svg", { width: "22", height: "22", viewBox: "0 0 22 22", fill: "none", children: [
6396
+ /* @__PURE__ */ jsx("circle", { cx: "11", cy: "11", r: "11", fill: t.success }),
6397
+ /* @__PURE__ */ jsx(
6398
+ "path",
6399
+ {
6400
+ d: "M7 11l3 3 5-5",
6401
+ stroke: "#fff",
6402
+ strokeWidth: "2",
6403
+ strokeLinecap: "round",
6404
+ strokeLinejoin: "round"
6405
+ }
6406
+ )
6407
+ ] }) : /* @__PURE__ */ jsx("div", { style: radioEmptyStyle2(t.border) })
6408
+ ]
6409
+ },
6410
+ entryKey(entry)
6411
+ );
6412
+ }) })
6413
+ ] })
6414
+ ] }),
6415
+ error && /* @__PURE__ */ jsx("p", { style: errorStyle3(t.error), children: error }),
6416
+ entries.length === 0 && /* @__PURE__ */ jsx("p", { style: emptyStyle(t.textMuted), children: "No supported tokens found in your wallet. Please ensure you have USDC or USDT." })
6417
+ ]
6418
+ }
6419
+ );
6148
6420
  }
6149
6421
  var loadingWrapStyle = {
6150
6422
  textAlign: "center",
@@ -6154,52 +6426,129 @@ var loadingWrapStyle = {
6154
6426
  alignItems: "center",
6155
6427
  justifyContent: "center"
6156
6428
  };
6157
- var depositHeaderStyle = {
6158
- marginBottom: 20
6159
- };
6429
+ var depositCardSurfaceStyle = (tokens, listOpen) => ({
6430
+ background: tokens.bgCard,
6431
+ border: `1px solid ${tokens.border}`,
6432
+ borderRadius: tokens.radiusLg,
6433
+ padding: "16px 20px",
6434
+ marginBottom: listOpen ? 4 : 16
6435
+ });
6160
6436
  var depositLabelStyle3 = (color) => ({
6161
6437
  fontSize: "0.75rem",
6162
6438
  fontWeight: 500,
6163
6439
  color,
6164
6440
  marginBottom: 4
6165
6441
  });
6442
+ var amountBandStyle = {
6443
+ display: "flex",
6444
+ alignItems: "flex-start",
6445
+ justifyContent: "space-between",
6446
+ gap: 12
6447
+ };
6448
+ var amountLeftColStyle = {
6449
+ flex: 1,
6450
+ minWidth: 0
6451
+ };
6166
6452
  var depositAmountStyle2 = (color) => ({
6167
6453
  fontSize: "2.4rem",
6168
6454
  fontWeight: 700,
6169
6455
  letterSpacing: "-0.02em",
6170
- color
6171
- });
6172
- var errorStyle3 = (color) => ({
6173
- fontSize: "0.84rem",
6174
6456
  color,
6175
- margin: "0 0 12px",
6176
- lineHeight: 1.5
6457
+ lineHeight: 1.05
6177
6458
  });
6178
- var sectionLabelStyle2 = (color) => ({
6459
+ var feeRowStyle = (color) => ({
6179
6460
  fontSize: "0.84rem",
6180
6461
  fontWeight: 500,
6181
6462
  color,
6182
- marginBottom: 12
6463
+ marginTop: 6
6183
6464
  });
6184
- var tokenListStyle3 = {
6465
+ var tokenTriggerStyle = (tokens, interactive) => ({
6185
6466
  display: "flex",
6186
- flexDirection: "column",
6187
- gap: 10
6467
+ alignItems: "center",
6468
+ gap: 6,
6469
+ flexShrink: 0,
6470
+ marginTop: 4,
6471
+ padding: "6px 10px",
6472
+ background: tokens.bgInput,
6473
+ border: `1px solid ${tokens.border}`,
6474
+ borderRadius: 999,
6475
+ cursor: interactive ? "pointer" : "default",
6476
+ fontFamily: "inherit"
6477
+ });
6478
+ var tokenTriggerIconsStyle = {
6479
+ position: "relative",
6480
+ width: 40,
6481
+ height: 28
6188
6482
  };
6189
- var tokenRowStyle3 = (tokens, disabled) => ({
6483
+ var triggerLogoStyle = (left) => ({
6484
+ position: "absolute",
6485
+ left,
6486
+ top: 0,
6487
+ borderRadius: "50%",
6488
+ objectFit: "cover",
6489
+ border: "2px solid rgba(255,255,255,0.9)",
6490
+ boxSizing: "content-box"
6491
+ });
6492
+ var tokenDropdownOuterStyle = (tokens) => ({
6493
+ marginTop: 4,
6494
+ marginBottom: 16,
6495
+ background: tokens.bgCard,
6496
+ border: `1px solid ${tokens.border}`,
6497
+ borderRadius: tokens.radiusLg,
6498
+ boxShadow: tokens.shadowLg,
6499
+ padding: "12px 14px 14px"
6500
+ });
6501
+ var accountDropdownLabelStyle2 = (color) => ({
6502
+ fontSize: "0.78rem",
6503
+ fontWeight: 500,
6504
+ color,
6505
+ marginBottom: 8
6506
+ });
6507
+ var tokenDropdownInnerStyle = (tokens) => ({
6508
+ background: tokens.bgInput,
6509
+ border: `1px solid ${tokens.border}`,
6510
+ borderRadius: tokens.radiusLg,
6511
+ overflow: "hidden"
6512
+ });
6513
+ var pickerRowStyle = (tokens, isSelected, isLast) => ({
6190
6514
  display: "flex",
6191
6515
  alignItems: "center",
6192
- gap: 14,
6516
+ justifyContent: "space-between",
6517
+ width: "100%",
6193
6518
  padding: "14px 16px",
6194
- background: tokens.bgInput,
6195
- border: `1px solid ${tokens.border}`,
6196
- borderRadius: 16,
6197
- cursor: disabled ? "default" : "pointer",
6519
+ background: isSelected ? `${tokens.accent}18` : "transparent",
6520
+ border: "none",
6521
+ borderBottom: isLast ? "none" : `1px solid ${tokens.border}`,
6522
+ cursor: "pointer",
6198
6523
  fontFamily: "inherit",
6199
6524
  textAlign: "left",
6200
- width: "100%",
6201
- opacity: disabled ? 0.6 : 1,
6202
- transition: "opacity 0.15s ease"
6525
+ outline: "none"
6526
+ });
6527
+ var pickerRowLeftStyle = {
6528
+ display: "flex",
6529
+ alignItems: "center",
6530
+ gap: 12,
6531
+ minWidth: 0,
6532
+ flex: 1
6533
+ };
6534
+ var pickerRowInfoStyle = {
6535
+ display: "flex",
6536
+ flexDirection: "column",
6537
+ gap: 2,
6538
+ minWidth: 0
6539
+ };
6540
+ var radioEmptyStyle2 = (borderColor) => ({
6541
+ width: 22,
6542
+ height: 22,
6543
+ borderRadius: "50%",
6544
+ border: `2px solid ${borderColor}`,
6545
+ flexShrink: 0
6546
+ });
6547
+ var errorStyle3 = (color) => ({
6548
+ fontSize: "0.84rem",
6549
+ color,
6550
+ margin: "0 0 12px",
6551
+ lineHeight: 1.5
6203
6552
  });
6204
6553
  var tokenIconCircleStyle3 = (tokens, hasLogo) => ({
6205
6554
  width: 36,
@@ -6223,13 +6572,6 @@ var tokenIconTextStyle3 = (color) => ({
6223
6572
  fontWeight: 700,
6224
6573
  color
6225
6574
  });
6226
- var tokenInfoStyle3 = {
6227
- display: "flex",
6228
- flexDirection: "column",
6229
- gap: 2,
6230
- flex: 1,
6231
- minWidth: 0
6232
- };
6233
6575
  var tokenNameRowStyle2 = {
6234
6576
  display: "flex",
6235
6577
  alignItems: "center",
@@ -6253,10 +6595,6 @@ var tokenBalanceStyle2 = (color) => ({
6253
6595
  fontSize: "0.78rem",
6254
6596
  color
6255
6597
  });
6256
- var chevronStyle = {
6257
- flexShrink: 0,
6258
- opacity: 0.4
6259
- };
6260
6598
  var emptyStyle = (color) => ({
6261
6599
  fontSize: "0.88rem",
6262
6600
  color,
@@ -6278,7 +6616,7 @@ function GuestPreauthSetupCompleteScreen({
6278
6616
  ] }),
6279
6617
  children: [
6280
6618
  /* @__PURE__ */ jsx(ScreenHeader, { onLogout }),
6281
- /* @__PURE__ */ jsxs("div", { style: contentStyle9, children: [
6619
+ /* @__PURE__ */ jsxs("div", { style: contentStyle10, children: [
6282
6620
  /* @__PURE__ */ jsx(IconCircle, { variant: "success", size: 64, children: /* @__PURE__ */ jsx("svg", { width: "32", height: "32", viewBox: "0 0 24 24", fill: "none", children: /* @__PURE__ */ jsx(
6283
6621
  "path",
6284
6622
  {
@@ -6286,14 +6624,14 @@ function GuestPreauthSetupCompleteScreen({
6286
6624
  fill: tokens.success
6287
6625
  }
6288
6626
  ) }) }),
6289
- /* @__PURE__ */ jsx("h2", { style: headingStyle12(tokens.text), children: "Setup complete" }),
6290
- /* @__PURE__ */ jsx("p", { style: subtitleStyle10(tokens.textSecondary), children: "Your account is linked and ready. You can close this window or make another deposit." })
6627
+ /* @__PURE__ */ jsx("h2", { style: headingStyle13(tokens.text), children: "Setup complete" }),
6628
+ /* @__PURE__ */ jsx("p", { style: subtitleStyle12(tokens.textSecondary), children: "Your account is linked and ready. You can close this window or make another deposit." })
6291
6629
  ] })
6292
6630
  ]
6293
6631
  }
6294
6632
  );
6295
6633
  }
6296
- var contentStyle9 = {
6634
+ var contentStyle10 = {
6297
6635
  display: "flex",
6298
6636
  flexDirection: "column",
6299
6637
  alignItems: "center",
@@ -6301,7 +6639,7 @@ var contentStyle9 = {
6301
6639
  gap: 12,
6302
6640
  paddingTop: 8
6303
6641
  };
6304
- function headingStyle12(color) {
6642
+ function headingStyle13(color) {
6305
6643
  return {
6306
6644
  margin: 0,
6307
6645
  fontSize: 22,
@@ -6309,7 +6647,7 @@ function headingStyle12(color) {
6309
6647
  color
6310
6648
  };
6311
6649
  }
6312
- function subtitleStyle10(color) {
6650
+ function subtitleStyle12(color) {
6313
6651
  return {
6314
6652
  margin: 0,
6315
6653
  fontSize: 15,
@@ -6322,14 +6660,14 @@ function GuestPreauthLinkingScreen({ onLogout }) {
6322
6660
  const { tokens } = useBlinkConfig();
6323
6661
  return /* @__PURE__ */ jsxs(ScreenLayout, { children: [
6324
6662
  /* @__PURE__ */ jsx(ScreenHeader, { onLogout }),
6325
- /* @__PURE__ */ jsxs("div", { style: contentStyle10, children: [
6663
+ /* @__PURE__ */ jsxs("div", { style: contentStyle11, children: [
6326
6664
  /* @__PURE__ */ jsx(Spinner, { size: 48 }),
6327
- /* @__PURE__ */ jsx("h2", { style: headingStyle13(tokens.text), children: "Setting up your account..." }),
6328
- /* @__PURE__ */ jsx("p", { style: subtitleStyle11(tokens.textSecondary), children: "Linking your wallet to your Blink account. This usually takes a few seconds." })
6665
+ /* @__PURE__ */ jsx("h2", { style: headingStyle14(tokens.text), children: "Setting up your account..." }),
6666
+ /* @__PURE__ */ jsx("p", { style: subtitleStyle13(tokens.textSecondary), children: "Linking your wallet to your Blink account. This usually takes a few seconds." })
6329
6667
  ] })
6330
6668
  ] });
6331
6669
  }
6332
- var contentStyle10 = {
6670
+ var contentStyle11 = {
6333
6671
  flex: 1,
6334
6672
  display: "flex",
6335
6673
  flexDirection: "column",
@@ -6338,7 +6676,7 @@ var contentStyle10 = {
6338
6676
  textAlign: "center",
6339
6677
  padding: "0 24px 32px"
6340
6678
  };
6341
- function headingStyle13(color) {
6679
+ function headingStyle14(color) {
6342
6680
  return {
6343
6681
  margin: "20px 0 8px",
6344
6682
  fontSize: "1.45rem",
@@ -6347,7 +6685,7 @@ function headingStyle13(color) {
6347
6685
  color
6348
6686
  };
6349
6687
  }
6350
- function subtitleStyle11(color) {
6688
+ function subtitleStyle13(color) {
6351
6689
  return {
6352
6690
  margin: 0,
6353
6691
  fontSize: "0.9rem",
@@ -6356,6 +6694,8 @@ function subtitleStyle11(color) {
6356
6694
  maxWidth: 280
6357
6695
  };
6358
6696
  }
6697
+
6698
+ // src/stepHeaderFlowPhase.ts
6359
6699
  var LINK_SCREENS = /* @__PURE__ */ new Set([
6360
6700
  "create-passkey",
6361
6701
  "verify-passkey",
@@ -6370,7 +6710,6 @@ var DEPOSIT_SCREENS = /* @__PURE__ */ new Set([
6370
6710
  "processing",
6371
6711
  "success"
6372
6712
  ]);
6373
- var DEFAULT_MIN_DEPOSIT_USD = 0.25;
6374
6713
  function getFlowPhase(screen, phase) {
6375
6714
  if (LINK_SCREENS.has(screen)) return "link";
6376
6715
  if (DEPOSIT_SCREENS.has(screen)) return "deposit";
@@ -6379,9 +6718,19 @@ function getFlowPhase(screen, phase) {
6379
6718
  }
6380
6719
  return null;
6381
6720
  }
6721
+ function resolveHeaderFlowPhase(screen, phase, authenticated) {
6722
+ const raw = getFlowPhase(screen, phase);
6723
+ if (raw === "link" && !authenticated) return null;
6724
+ return raw;
6725
+ }
6726
+ var DEFAULT_MIN_DEPOSIT_USD = 0.25;
6382
6727
  function StepRenderer(props) {
6383
6728
  const screen = screenForPhase(props.flow.state.phase);
6384
- const flowPhase = getFlowPhase(screen, props.flow.state.phase);
6729
+ const flowPhase = resolveHeaderFlowPhase(
6730
+ screen,
6731
+ props.flow.state.phase,
6732
+ props.flow.authenticated
6733
+ );
6385
6734
  return /* @__PURE__ */ jsx(FlowPhaseProvider, { phase: flowPhase, children: /* @__PURE__ */ jsx(StepRendererContent, { ...props, screen }) });
6386
6735
  }
6387
6736
  function StepRendererContent({
@@ -6407,6 +6756,7 @@ function StepRendererContent({
6407
6756
  pollingError,
6408
6757
  guestAccountPollingError,
6409
6758
  authExecutorError,
6759
+ authExecutorExecuting,
6410
6760
  transferSigningSigning,
6411
6761
  transferSigningError,
6412
6762
  pendingSelectSource
@@ -6427,6 +6777,9 @@ function StepRendererContent({
6427
6777
  guestTokenEntries,
6428
6778
  guestLoadingBalances,
6429
6779
  guestSettingSender,
6780
+ guestPendingEntry,
6781
+ guestQuoteFee,
6782
+ guestQuoteLoading,
6430
6783
  authInput,
6431
6784
  otpCode,
6432
6785
  selectSourceChainName,
@@ -6521,7 +6874,7 @@ function StepRendererContent({
6521
6874
  {
6522
6875
  walletName: providerName,
6523
6876
  deeplinkUri: state.deeplinkUri ?? "",
6524
- loading: !isDesktop ? state.creatingTransfer || !state.deeplinkUri : state.creatingTransfer,
6877
+ loading: !isDesktop ? state.creatingTransfer || !state.deeplinkUri : state.creatingTransfer || authExecutorExecuting,
6525
6878
  useDeeplink: !isDesktop,
6526
6879
  error: state.error || guestAccountPollingError || (!isDesktop ? pollingError : authExecutorError),
6527
6880
  onRetryStatus: !isDesktop ? handlers.onRetryMobileStatus : void 0,
@@ -6664,7 +7017,11 @@ function StepRendererContent({
6664
7017
  setting: guestSettingSender,
6665
7018
  depositAmount: depositAmount ?? void 0,
6666
7019
  error: state.error,
7020
+ pendingEntry: forms.guestPendingEntry,
7021
+ quoteFee: forms.guestQuoteFee,
7022
+ quoteLoading: forms.guestQuoteLoading,
6667
7023
  onSelect: handlers.onSelectGuestToken,
7024
+ onConfirm: handlers.onConfirmGuestToken,
6668
7025
  onBack: handlers.onGuestBackFromTokenPicker
6669
7026
  }
6670
7027
  );
@@ -6769,7 +7126,7 @@ var PaymentErrorBoundary = class extends Component {
6769
7126
  /* @__PURE__ */ jsx("path", { d: "M12 8v5", stroke: "#ef4444", strokeWidth: "1.5", strokeLinecap: "round" }),
6770
7127
  /* @__PURE__ */ jsx("circle", { cx: "12", cy: "16", r: "0.75", fill: "#ef4444" })
6771
7128
  ] }) }),
6772
- /* @__PURE__ */ jsx("h2", { style: headingStyle14, children: "Something went wrong" }),
7129
+ /* @__PURE__ */ jsx("h2", { style: headingStyle15, children: "Something went wrong" }),
6773
7130
  /* @__PURE__ */ jsx("p", { style: messageStyle, children: "An unexpected error occurred. Please try again." }),
6774
7131
  /* @__PURE__ */ jsx("button", { type: "button", onClick: this.handleReset, style: buttonStyle3, children: "Try again" })
6775
7132
  ] });
@@ -6789,7 +7146,7 @@ var containerStyle9 = {
6789
7146
  var iconStyle3 = {
6790
7147
  marginBottom: 20
6791
7148
  };
6792
- var headingStyle14 = {
7149
+ var headingStyle15 = {
6793
7150
  fontSize: "1.25rem",
6794
7151
  fontWeight: 700,
6795
7152
  color: "#1a1a1a",
@@ -7968,8 +8325,8 @@ function useProviderHandlers(deps) {
7968
8325
  }
7969
8326
 
7970
8327
  // src/guestTokens.ts
7971
- function mapBalancesToGuestTokenEntries(options) {
7972
- return options.map((opt) => ({
8328
+ function mapGuestPickerEntries(options) {
8329
+ const mapped = options.map((opt) => ({
7973
8330
  chainId: opt.chainId,
7974
8331
  sourceChainId: opt.sourceChainId,
7975
8332
  chainName: opt.chainName,
@@ -7978,7 +8335,26 @@ function mapBalancesToGuestTokenEntries(options) {
7978
8335
  decimals: opt.decimals,
7979
8336
  rawBalance: opt.rawBalance,
7980
8337
  balance: Number(opt.rawBalance) / 10 ** opt.decimals
7981
- })).filter((entry) => entry.balance > 0).sort((a, b) => b.balance - a.balance);
8338
+ }));
8339
+ const positive = mapped.filter((e) => e.balance > 0).sort((a, b) => b.balance - a.balance);
8340
+ if (positive.length > 0) return positive;
8341
+ return mapped.sort((a, b) => b.balance - a.balance);
8342
+ }
8343
+ function guestEntryMatchingRecommended(balances, recommended) {
8344
+ const raw = balances.find(
8345
+ (b) => b.sourceChainId === recommended.sourceChainId && b.tokenAddress.toLowerCase() === recommended.tokenAddress.toLowerCase()
8346
+ );
8347
+ if (!raw) return null;
8348
+ return {
8349
+ chainId: raw.chainId,
8350
+ sourceChainId: raw.sourceChainId,
8351
+ chainName: raw.chainName,
8352
+ tokenSymbol: raw.tokenSymbol,
8353
+ tokenAddress: raw.tokenAddress,
8354
+ decimals: raw.decimals,
8355
+ rawBalance: raw.rawBalance,
8356
+ balance: Number(raw.rawBalance) / 10 ** raw.decimals
8357
+ };
7982
8358
  }
7983
8359
 
7984
8360
  // src/hooks/useGuestTransferHandlers.ts
@@ -8005,6 +8381,9 @@ function useGuestTransferHandlers(deps) {
8005
8381
  const [guestTokenEntries, setGuestTokenEntries] = useState([]);
8006
8382
  const [loadingBalances, setLoadingBalances] = useState(false);
8007
8383
  const [settingSender, setSettingSender] = useState(false);
8384
+ const [pendingGuestEntry, setPendingGuestEntry] = useState(null);
8385
+ const [guestFee, setGuestFee] = useState(null);
8386
+ const [guestQuoteLoading, setGuestQuoteLoading] = useState(false);
8008
8387
  const executingBridgeRef = useRef(false);
8009
8388
  const fetchedRef = useRef(false);
8010
8389
  const selectedGuestTokenRef = useRef(null);
@@ -8014,21 +8393,65 @@ function useGuestTransferHandlers(deps) {
8014
8393
  if (!account.address) return;
8015
8394
  fetchedRef.current = true;
8016
8395
  setLoadingBalances(true);
8017
- fetchGuestTransferBalances(apiBaseUrl, guestTransferId, guestSessionToken, account.address).then((options) => mapBalancesToGuestTokenEntries(options)).then((entries) => {
8396
+ putGuestTransferSender(apiBaseUrl, guestTransferId, guestSessionToken, {
8397
+ senderAddress: account.address
8398
+ }).then(async (res) => {
8399
+ const balances = res.source?.balances;
8400
+ if (!balances?.length) {
8401
+ dispatch({ type: "SET_ERROR", error: "No supported tokens found for this transfer." });
8402
+ return;
8403
+ }
8404
+ const entries = mapGuestPickerEntries(balances);
8018
8405
  setGuestTokenEntries(entries);
8019
8406
  if (entries.length === 0) {
8020
8407
  dispatch({ type: "SET_ERROR", error: "No supported tokens found in your wallet." });
8408
+ return;
8409
+ }
8410
+ const recommended = res.source?.recommended;
8411
+ const autoEntry = recommended ? guestEntryMatchingRecommended(balances, recommended) : null;
8412
+ const pick = autoEntry && entries.some(
8413
+ (e) => e.sourceChainId === autoEntry.sourceChainId && e.tokenAddress.toLowerCase() === autoEntry.tokenAddress.toLowerCase()
8414
+ ) ? autoEntry : entries[0];
8415
+ setPendingGuestEntry(pick);
8416
+ setGuestFee(null);
8417
+ if (res.fee?.quote != null) {
8418
+ setGuestFee(res.fee);
8419
+ return;
8420
+ }
8421
+ setGuestQuoteLoading(true);
8422
+ try {
8423
+ const quote = await postGuestTransferFeeQuote(
8424
+ apiBaseUrl,
8425
+ guestTransferId,
8426
+ guestSessionToken,
8427
+ account.address,
8428
+ pick.sourceChainId,
8429
+ pick.tokenAddress
8430
+ );
8431
+ setGuestFee(quote);
8432
+ } catch (err) {
8433
+ captureException(err);
8434
+ setPendingGuestEntry(null);
8435
+ setGuestFee(null);
8436
+ const msg = err instanceof Error ? err.message : "Failed to load fee estimate";
8437
+ dispatch({ type: "SET_ERROR", error: msg });
8438
+ onError?.(msg);
8439
+ } finally {
8440
+ setGuestQuoteLoading(false);
8021
8441
  }
8022
8442
  }).catch((err) => {
8023
8443
  captureException(err);
8024
- dispatch({ type: "SET_ERROR", error: "Failed to fetch token balances." });
8444
+ dispatch({ type: "SET_ERROR", error: "Failed to load payment sources." });
8025
8445
  }).finally(() => setLoadingBalances(false));
8026
- }, [isGuestFlow, guestTransferId, guestSessionToken, apiBaseUrl, wagmiConfig2, dispatch]);
8446
+ }, [isGuestFlow, guestTransferId, guestSessionToken, apiBaseUrl, wagmiConfig2, dispatch, onError]);
8027
8447
  useEffect(() => {
8028
8448
  if (!isGuestFlow) {
8029
8449
  fetchedRef.current = false;
8030
8450
  selectedGuestTokenRef.current = null;
8031
8451
  setGuestTokenEntries([]);
8452
+ setPendingGuestEntry(null);
8453
+ setGuestFee(null);
8454
+ setGuestQuoteLoading(false);
8032
8455
  }
8033
8456
  }, [isGuestFlow]);
8034
8457
  const handleSelectGuestToken = useCallback(async (entry) => {
@@ -8038,7 +8461,44 @@ function useGuestTransferHandlers(deps) {
8038
8461
  dispatch({ type: "SET_ERROR", error: "Wallet not connected." });
8039
8462
  return;
8040
8463
  }
8464
+ setGuestQuoteLoading(true);
8465
+ dispatch({ type: "SET_ERROR", error: null });
8466
+ setPendingGuestEntry(entry);
8467
+ setGuestFee(null);
8468
+ try {
8469
+ console.info(
8470
+ `[blink-sdk] type=guest Fee quote preview: address=${account.address}, chain=${entry.sourceChainId}, token=${entry.tokenSymbol}`
8471
+ );
8472
+ const quote = await postGuestTransferFeeQuote(
8473
+ apiBaseUrl,
8474
+ guestTransferId,
8475
+ guestSessionToken,
8476
+ account.address,
8477
+ entry.sourceChainId,
8478
+ entry.tokenAddress
8479
+ );
8480
+ setGuestFee(quote);
8481
+ } catch (err) {
8482
+ captureException(err);
8483
+ setPendingGuestEntry(null);
8484
+ setGuestFee(null);
8485
+ const msg = err instanceof Error ? err.message : "Failed to load fee estimate";
8486
+ dispatch({ type: "SET_ERROR", error: msg });
8487
+ onError?.(msg);
8488
+ } finally {
8489
+ setGuestQuoteLoading(false);
8490
+ }
8491
+ }, [guestTransferId, guestSessionToken, wagmiConfig2, apiBaseUrl, dispatch, onError]);
8492
+ const handleConfirmGuestToken = useCallback(async () => {
8493
+ if (!guestTransferId || !guestSessionToken || !pendingGuestEntry) return;
8494
+ const account = getAccount(wagmiConfig2);
8495
+ if (!account.address) {
8496
+ dispatch({ type: "SET_ERROR", error: "Wallet not connected." });
8497
+ return;
8498
+ }
8499
+ const entry = pendingGuestEntry;
8041
8500
  setSettingSender(true);
8501
+ dispatch({ type: "SET_ERROR", error: null });
8042
8502
  try {
8043
8503
  console.info(
8044
8504
  `[blink-sdk] type=guest Setting sender: address=${account.address}, chain=${entry.sourceChainId}, token=${entry.tokenSymbol}`
@@ -8060,7 +8520,15 @@ function useGuestTransferHandlers(deps) {
8060
8520
  } finally {
8061
8521
  setSettingSender(false);
8062
8522
  }
8063
- }, [guestTransferId, guestSessionToken, wagmiConfig2, apiBaseUrl, dispatch, onError]);
8523
+ }, [
8524
+ guestTransferId,
8525
+ guestSessionToken,
8526
+ pendingGuestEntry,
8527
+ wagmiConfig2,
8528
+ apiBaseUrl,
8529
+ dispatch,
8530
+ onError
8531
+ ]);
8064
8532
  useEffect(() => {
8065
8533
  if (!isGuestFlow || !guestTransferId || !guestSessionToken || !selectedGuestTokenRef.current) return;
8066
8534
  if (executingBridgeRef.current) return;
@@ -8168,13 +8636,19 @@ function useGuestTransferHandlers(deps) {
8168
8636
  execute();
8169
8637
  }, [isGuestFlow, guestTransferId, guestSessionToken, settingSender, apiBaseUrl, wagmiConfig2, switchChainAsync, dispatch, onComplete, onError]);
8170
8638
  const handleGuestBackFromTokenPicker = useCallback(() => {
8639
+ setPendingGuestEntry(null);
8640
+ setGuestFee(null);
8171
8641
  dispatch({ type: "GUEST_BACK_FROM_TOKEN_PICKER" });
8172
8642
  }, [dispatch]);
8173
8643
  return {
8174
8644
  guestTokenEntries,
8175
8645
  loadingBalances,
8176
8646
  settingSender,
8647
+ pendingGuestEntry,
8648
+ guestFee,
8649
+ guestQuoteLoading,
8177
8650
  handleSelectGuestToken,
8651
+ handleConfirmGuestToken,
8178
8652
  handleGuestBackFromTokenPicker
8179
8653
  };
8180
8654
  }
@@ -8232,7 +8706,7 @@ function useOneTapSetupHandlers(deps) {
8232
8706
  } else if (authExecutor.pendingOneTapSetup) {
8233
8707
  authExecutor.resolveOneTapSetup();
8234
8708
  }
8235
- if (!guestPostPayPreauth || !willResolveSession) {
8709
+ if (!willResolveSession) {
8236
8710
  dispatch({ type: "SET_USER_INTENT", intent: { step: "deposit" } });
8237
8711
  }
8238
8712
  } catch (err) {
@@ -9357,6 +9831,32 @@ function useGuestPreauthWalletSetupEffect(deps) {
9357
9831
  dispatch
9358
9832
  ]);
9359
9833
  }
9834
+ function useStandardDesktopInlineOpenWalletEffect(deps) {
9835
+ const { isDesktop, state, dispatch, authExecutor } = deps;
9836
+ useEffect(() => {
9837
+ if (!isDesktop || state.guestPreauthorizing) return;
9838
+ if (!state.privyAuthenticated || !state.activeCredentialId || !state.selectedAccountId) return;
9839
+ const shouldPin = authExecutor.executing && !authExecutor.pendingSelectSource && !authExecutor.pendingOneTapSetup;
9840
+ if (shouldPin && !state.standardDesktopInlineOpenWallet) {
9841
+ dispatch({ type: "SET_STANDARD_DESKTOP_INLINE_OPEN_WALLET", value: true });
9842
+ return;
9843
+ }
9844
+ if (!shouldPin && state.standardDesktopInlineOpenWallet) {
9845
+ dispatch({ type: "SET_STANDARD_DESKTOP_INLINE_OPEN_WALLET", value: false });
9846
+ }
9847
+ }, [
9848
+ isDesktop,
9849
+ state.guestPreauthorizing,
9850
+ state.privyAuthenticated,
9851
+ state.activeCredentialId,
9852
+ state.selectedAccountId,
9853
+ state.standardDesktopInlineOpenWallet,
9854
+ authExecutor.executing,
9855
+ authExecutor.pendingSelectSource,
9856
+ authExecutor.pendingOneTapSetup,
9857
+ dispatch
9858
+ ]);
9859
+ }
9360
9860
  function useGuestAccountAutoPollingEffect(deps) {
9361
9861
  const {
9362
9862
  mobileFlow,
@@ -9856,6 +10356,12 @@ function BlinkPaymentInner({
9856
10356
  authExecutor,
9857
10357
  isDesktop
9858
10358
  });
10359
+ useStandardDesktopInlineOpenWalletEffect({
10360
+ isDesktop,
10361
+ state,
10362
+ dispatch,
10363
+ authExecutor
10364
+ });
9859
10365
  const handlers = useMemo(() => ({
9860
10366
  onSendLoginCode: auth.handleSendLoginCode,
9861
10367
  onVerifyLoginCode: auth.handleVerifyLoginCode,
@@ -9892,6 +10398,7 @@ function BlinkPaymentInner({
9892
10398
  onSelectAuthorizedToken: provider.handleSelectAuthorizedToken,
9893
10399
  onAuthorizeToken: provider.handleAuthorizeToken,
9894
10400
  onSelectGuestToken: guestTransfer.handleSelectGuestToken,
10401
+ onConfirmGuestToken: guestTransfer.handleConfirmGuestToken,
9895
10402
  onGuestBackFromTokenPicker: guestTransfer.handleGuestBackFromTokenPicker,
9896
10403
  onLogin: () => dispatch({ type: "REQUEST_LOGIN" }),
9897
10404
  onPreauthorize: provider.handlePreauthorize,
@@ -9931,6 +10438,7 @@ function BlinkPaymentInner({
9931
10438
  pollingError: polling.error,
9932
10439
  guestAccountPollingError: guestAccountPolling.error,
9933
10440
  authExecutorError: authExecutor.error,
10441
+ authExecutorExecuting: authExecutor.executing,
9934
10442
  transferSigningSigning: transferSigning.signing,
9935
10443
  transferSigningError: transferSigning.error,
9936
10444
  pendingSelectSource: authExecutor.pendingSelectSource,
@@ -9956,13 +10464,16 @@ function BlinkPaymentInner({
9956
10464
  savingOneTapLimit: oneTapSetup.savingOneTapLimit,
9957
10465
  guestTokenEntries: guestTransfer.guestTokenEntries,
9958
10466
  guestLoadingBalances: guestTransfer.loadingBalances,
9959
- guestSettingSender: guestTransfer.settingSender
10467
+ guestSettingSender: guestTransfer.settingSender,
10468
+ guestPendingEntry: guestTransfer.pendingGuestEntry,
10469
+ guestQuoteFee: guestTransfer.guestFee?.quote ?? null,
10470
+ guestQuoteLoading: guestTransfer.guestQuoteLoading
9960
10471
  },
9961
10472
  handlers
9962
10473
  }
9963
10474
  );
9964
10475
  }
9965
10476
 
9966
- export { AdvancedSourceScreen, BLINK_LOGO, BLINK_MASCOT, BlinkLoadingScreen, BlinkPayment, BlinkProvider, FlowPhaseProvider, IconCircle, InfoBanner, OutlineButton, PasskeyIframeBlockedError, PasskeyScreen, PoweredByFooter, PrimaryButton, ScreenHeader, ScreenLayout, SelectSourceScreen, SettingsMenu, SetupScreen, Spinner, StepList, TokenPickerScreen, api_exports as blinkApi, buildPasskeyPopupOptions, createPasskeyCredential, createPasskeyViaPopup, darkTheme, deviceHasPasskey, findDevicePasskey, findDevicePasskeyViaPopup, getTheme, lightTheme, resolvePasskeyRpId, screenForPhase, useAuthorizationExecutor, useBlinkConfig, useBlinkDepositAmount, useTransferPolling, useTransferSigning };
10477
+ export { AdvancedSourceScreen, BLINK_LOGO, BLINK_MASCOT, BlinkLoadingScreen, BlinkPayment, BlinkProvider, ConfirmSignScreen, DepositScreen, FlowPhaseProvider, GuestPreauthLinkingScreen, GuestPreauthSetupCompleteScreen, GuestTokenPickerScreen, IconCircle, InfoBanner, LoginScreen, OpenWalletScreen, OtpVerifyScreen, OutlineButton, PasskeyIframeBlockedError, PasskeyScreen, PoweredByFooter, PrimaryButton, ScreenHeader, ScreenLayout, SelectSourceScreen, SettingsMenu, SetupScreen, SetupStatusScreen, Spinner, StepList, SuccessScreen, TokenPickerScreen, TransferStatusScreen, VerifyPasskeyScreen, WalletPickerScreen, api_exports as blinkApi, buildPasskeyPopupOptions, createPasskeyCredential, createPasskeyViaPopup, darkTheme, deviceHasPasskey, findDevicePasskey, findDevicePasskeyViaPopup, getTheme, guestEntryMatchingRecommended, lightTheme, mapGuestPickerEntries, resolvePasskeyRpId, screenForPhase, useAuthorizationExecutor, useBlinkConfig, useBlinkDepositAmount, useTransferPolling, useTransferSigning };
9967
10478
  //# sourceMappingURL=index.js.map
9968
10479
  //# sourceMappingURL=index.js.map