@swype-org/react-sdk 0.1.222 → 0.1.224

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
@@ -568,6 +568,7 @@ async function createTransfer(apiBaseUrl, token, params) {
568
568
  throw new Error("merchantAuthorization is required for transfer creation.");
569
569
  }
570
570
  const body = {
571
+ type: "standard",
571
572
  id: params.id ?? crypto.randomUUID(),
572
573
  credentialId: params.credentialId,
573
574
  merchantAuthorization: params.merchantAuthorization,
@@ -2203,7 +2204,9 @@ function paymentReducer(state, action) {
2203
2204
  transfer: action.transfer,
2204
2205
  step: "success",
2205
2206
  mobileFlow: false,
2206
- deeplinkUri: null
2207
+ deeplinkUri: null,
2208
+ isGuestFlow: true,
2209
+ guestSessionToken: action.guestSessionToken ?? state.guestSessionToken
2207
2210
  };
2208
2211
  case "GUEST_PREAUTH_DETECTED":
2209
2212
  return {
@@ -5906,6 +5909,9 @@ function StepRendererContent({
5906
5909
  );
5907
5910
  }
5908
5911
  if (step === "wallet-picker") {
5912
+ if (state.isGuestFlow && state.selectedProviderId && state.activeCredentialId) {
5913
+ return /* @__PURE__ */ jsx(BlinkLoadingScreen, {});
5914
+ }
5909
5915
  const isEntryPoint = !state.isGuestFlow && !authenticated;
5910
5916
  return /* @__PURE__ */ jsx(
5911
5917
  WalletPickerScreen,
@@ -6830,7 +6836,7 @@ function useMobileFlowHandlers(dispatch, polling, reloadAccounts, pollingTransfe
6830
6836
  cancelled = true;
6831
6837
  guestPollingActiveRef.current = false;
6832
6838
  clearMobileFlowState();
6833
- dispatch({ type: "GUEST_TRANSFER_COMPLETED", transfer });
6839
+ dispatch({ type: "GUEST_TRANSFER_COMPLETED", transfer, guestSessionToken });
6834
6840
  onCompleteRef.current?.(transfer);
6835
6841
  } else if (transfer.status === "FAILED") {
6836
6842
  cancelled = true;
@@ -8560,6 +8566,21 @@ function BlinkPaymentInner({
8560
8566
  oneTapLimitSavedDuringSetupRef: oneTapSetup.oneTapLimitSavedDuringSetupRef,
8561
8567
  handleAuthorizedMobileReturn: mobileFlow.handleAuthorizedMobileReturn
8562
8568
  });
8569
+ const autoSelectingRef = useRef(false);
8570
+ useEffect(() => {
8571
+ if (state.step !== "wallet-picker" || !state.isGuestFlow || !state.selectedProviderId || !state.activeCredentialId || !authenticated || autoSelectingRef.current) return;
8572
+ autoSelectingRef.current = true;
8573
+ provider.handleSelectProvider(state.selectedProviderId).finally(() => {
8574
+ autoSelectingRef.current = false;
8575
+ });
8576
+ }, [
8577
+ state.step,
8578
+ state.isGuestFlow,
8579
+ state.selectedProviderId,
8580
+ state.activeCredentialId,
8581
+ authenticated,
8582
+ provider
8583
+ ]);
8563
8584
  const handlers = useMemo(() => ({
8564
8585
  onSendLoginCode: auth.handleSendLoginCode,
8565
8586
  onVerifyLoginCode: auth.handleVerifyLoginCode,