@openfort/react 0.0.22 → 0.0.24

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.
@@ -0,0 +1,36 @@
1
+ import { type AuthorizationRequest, type SignedAuthorization } from 'viem';
2
+ export type SignAuthorizationParameters = AuthorizationRequest;
3
+ export type SignAuthorizationReturnType = SignedAuthorization;
4
+ export type SignAuthorizationOptions = {
5
+ hashMessage: boolean;
6
+ arrayifyMessage: boolean;
7
+ };
8
+ /**
9
+ * Hook for signing EIP-7702 wallet authorizations
10
+ *
11
+ * This hook leverages the embedded Openfort client to sign authorization payloads prepared via viem.
12
+ * It mirrors viem's `signAuthorization` behaviour while always returning the structured authorization object,
13
+ * keeping private key management inside the Openfort SDK.
14
+ *
15
+ * @returns Helper with a `signAuthorization` function that signs authorizations with the active Openfort wallet
16
+ *
17
+ * @example
18
+ * ```ts
19
+ * import { prepareAuthorization } from 'viem/actions';
20
+ * import { use7702Authorization } from '@openfort/openfort-react';
21
+ *
22
+ * const { signAuthorization } = use7702Authorization();
23
+ *
24
+ * const authorization = await prepareAuthorization(pimlicoClient, {
25
+ * account: eoaAccount.address,
26
+ * contractAddress: implementationAddress,
27
+ * });
28
+ *
29
+ * const signedAuthorization = await signAuthorization({
30
+ * ...authorization,
31
+ * });
32
+ * ```
33
+ */
34
+ export declare function use7702Authorization(): {
35
+ signAuthorization: (parameters: SignAuthorizationParameters, options?: SignAuthorizationOptions) => Promise<SignAuthorizationReturnType>;
36
+ };
@@ -2,6 +2,7 @@ import { AccountTypeEnum, RecoveryMethod, RecoveryParams } from "@openfort/openf
2
2
  import { Hex } from "viem";
3
3
  import { Connector } from "wagmi";
4
4
  import { OpenfortError, OpenfortHookOptions } from "../../types";
5
+ import { BaseFlowState } from "./auth/status";
5
6
  export type UserWallet = {
6
7
  address: Hex;
7
8
  connectorType?: string;
@@ -44,6 +45,18 @@ type SetRecoveryOptions = {
44
45
  newRecovery: RecoveryParams;
45
46
  } & OpenfortHookOptions<CreateWalletResult>;
46
47
  type WalletOptions = OpenfortHookOptions<SetActiveWalletResult | CreateWalletResult>;
48
+ export type WalletFlowStatus = BaseFlowState | {
49
+ status: "creating" | "connecting";
50
+ address?: Hex;
51
+ error?: never;
52
+ };
53
+ export declare const mapWalletStatus: (status: WalletFlowStatus) => {
54
+ error: OpenfortError | null | undefined;
55
+ isError: boolean;
56
+ isSuccess: boolean;
57
+ isCreating: boolean;
58
+ isConnecting: boolean;
59
+ };
47
60
  /**
48
61
  * Hook for managing and interacting with user wallets
49
62
  *
@@ -63,12 +76,6 @@ type WalletOptions = OpenfortHookOptions<SetActiveWalletResult | CreateWalletRes
63
76
  * onSetActiveWalletSuccess: (result) => console.log('Wallet activated:', result.wallet),
64
77
  * });
65
78
  *
66
- * // Check available wallets
67
- * if (wallets.hasWallet) {
68
- * console.log('Available wallets:', wallets.wallets);
69
- * console.log('Active wallet:', wallets.activeWallet);
70
- * }
71
- *
72
79
  * // Create a new embedded wallet with automatic recovery
73
80
  * await wallets.createWallet({
74
81
  * recovery: { recoveryMethod: RecoveryMethod.AUTOMATIC },
@@ -107,7 +114,6 @@ export declare function useWallets(hookOptions?: WalletOptions): {
107
114
  isSuccess: boolean;
108
115
  isCreating: boolean;
109
116
  isConnecting: boolean;
110
- hasWallet: boolean;
111
117
  isLoadingWallets: boolean;
112
118
  wallets: UserWallet[];
113
119
  availableWallets: import("../../wallets/useWallets").WalletProps[];
package/build/index.d.ts CHANGED
@@ -10,14 +10,13 @@ export { default as Avatar } from './components/Common/Avatar';
10
10
  export { default as ChainIcon } from './components/Common/Chain';
11
11
  export { useChains } from './hooks/useChains';
12
12
  export { useChainIsSupported } from './hooks/useChainIsSupported';
13
- export { useStatus, OpenfortStatus } from './hooks/openfort/useStatus';
14
13
  export { useUser } from './hooks/openfort/useUser';
15
14
  export { useUI } from "./hooks/openfort/useUI";
16
15
  export { useWallets, UserWallet } from "./hooks/openfort/useWallets";
17
- export { useWallet } from "./hooks/openfort/useWallet";
18
- export { RecoveryMethod, AuthPlayerResponse, RecoveryParams, AccountTypeEnum } from "@openfort/openfort-js";
16
+ export { RecoveryMethod, AuthPlayerResponse, RecoveryParams, AccountTypeEnum, openfortEvents, OpenfortEventMap, OpenfortEvents, AuthResponse, EmbeddedAccount, SignedMessagePayload, AuthInitPayload } from "@openfort/openfort-js";
19
17
  export { useOpenfortCore as useOpenfort } from './openfort/useOpenfort';
20
18
  export { useConnectWithSiwe } from './hooks/openfort/useConnectWithSiwe';
19
+ export { use7702Authorization, type SignAuthorizationParameters, type SignAuthorizationReturnType, } from './hooks/openfort/use7702Authorization';
21
20
  export { embeddedWalletId } from './constants/openfort';
22
21
  export { useEmailAuth } from './hooks/openfort/auth/useEmailAuth';
23
22
  export { useAuthCallback } from './hooks/openfort/auth/useAuthCallback';
package/build/index.es.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { Openfort as Openfort$1, EmbeddedState, AccountTypeEnum, RecoveryMethod, MissingRecoveryPasswordError, ChainTypeEnum, OAuthProvider } from '@openfort/openfort-js';
2
- export { AccountTypeEnum, OAuthProvider, RecoveryMethod, ThirdPartyOAuthProvider } from '@openfort/openfort-js';
2
+ export { AccountTypeEnum, OAuthProvider, OpenfortEvents, RecoveryMethod, ThirdPartyOAuthProvider, openfortEvents } from '@openfort/openfort-js';
3
3
  import { http, useConfig, useConnectors as useConnectors$1, useConnect as useConnect$1, useAccount, useDisconnect, useChainId, useSwitchChain, createConfig, useEnsAddress, useEnsName, useEnsAvatar, useBalance, WagmiContext, useBlockNumber } from 'wagmi';
4
4
  import { mainnet, polygon, optimism, arbitrum, sepolia } from 'wagmi/chains';
5
5
  import { safe, injected, coinbaseWallet, walletConnect } from '@wagmi/connectors';
@@ -21,8 +21,10 @@ import { AxiosError } from 'axios';
21
21
  import { createSiweMessage } from 'viem/siwe';
22
22
  import { signMessage } from '@wagmi/core';
23
23
  import calculateEntropy from 'fast-password-entropy';
24
+ import { parseSignature } from 'viem';
25
+ import { hashAuthorization } from 'viem/utils';
24
26
 
25
- const OPENFORT_VERSION = '0.0.22';
27
+ const OPENFORT_VERSION = '0.0.24';
26
28
 
27
29
  var OpenfortErrorType;
28
30
  (function (OpenfortErrorType) {
@@ -918,6 +920,12 @@ const useOpenfortCore = () => {
918
920
  throw Error('useOpenfortContext Hook must be inside CoreOpenfortProvider.');
919
921
  return context;
920
922
  };
923
+ const useWalletStatus = () => {
924
+ const context = React.useContext(Context$1);
925
+ if (!context)
926
+ throw Error('useWalletStatus Hook must be inside CoreOpenfortProvider.');
927
+ return [context.walletStatus, context.setWalletStatus];
928
+ };
921
929
 
922
930
  function useIsMounted() {
923
931
  const [mounted, setMounted] = useState(false);
@@ -974,6 +982,15 @@ function createOpenfortClient(config) {
974
982
  return new Openfort$1(config);
975
983
  }
976
984
 
985
+ const PREFIX = '[Openfort-React]';
986
+ const logger = {
987
+ log: (...args) => console.log(PREFIX, ...args),
988
+ error: (...args) => console.error(PREFIX, ...args),
989
+ warn: (...args) => console.warn(PREFIX, ...args),
990
+ info: (...args) => console.info(PREFIX, ...args),
991
+ debug: (...args) => console.debug(PREFIX, ...args),
992
+ };
993
+
977
994
  const ConnectCallback = ({ onConnect, onDisconnect }) => {
978
995
  useConnectCallback({
979
996
  onConnect,
@@ -982,16 +999,16 @@ const ConnectCallback = ({ onConnect, onDisconnect }) => {
982
999
  return null;
983
1000
  };
984
1001
  const CoreOpenfortProvider = ({ children, debugMode, onConnect, onDisconnect, ...openfortProps }) => {
985
- const log = debugMode ? console.log : () => { };
986
1002
  const { connectors, connect, reset } = useConnect();
987
1003
  const { address } = useAccount();
988
1004
  const [user, setUser] = useState(null);
1005
+ const [walletStatus, setWalletStatus] = useState({ status: "idle" });
989
1006
  const { disconnectAsync } = useDisconnect();
990
1007
  const { walletConfig } = useOpenfort();
991
1008
  // ---- Openfort instance ----
992
1009
  const openfort = useMemo(() => {
993
1010
  var _a;
994
- log('Creating Openfort instance.', openfortProps);
1011
+ logger.log('Creating Openfort instance.', openfortProps);
995
1012
  if (!openfortProps.baseConfiguration.publishableKey)
996
1013
  throw Error('CoreOpenfortProvider requires a publishableKey to be set in the baseConfiguration.');
997
1014
  if (openfortProps.shieldConfiguration && !((_a = openfortProps.shieldConfiguration) === null || _a === void 0 ? void 0 : _a.passkeyRpId) && typeof window !== 'undefined') {
@@ -1007,28 +1024,33 @@ const CoreOpenfortProvider = ({ children, debugMode, onConnect, onDisconnect, ..
1007
1024
  // ---- Embedded state ----
1008
1025
  const [embeddedState, setEmbeddedState] = useState(EmbeddedState.NONE);
1009
1026
  const pollingRef = useRef(null);
1027
+ const previousEmbeddedState = useRef(EmbeddedState.NONE);
1010
1028
  const pollEmbeddedState = useCallback(async () => {
1011
1029
  if (!openfort)
1012
1030
  return;
1013
1031
  try {
1014
1032
  const state = await openfort.embeddedWallet.getEmbeddedState();
1015
- log("Polling embedded state", state);
1016
1033
  setEmbeddedState(state);
1017
1034
  }
1018
1035
  catch (error) {
1019
- console.error('Error checking embedded state with Openfort:', error);
1036
+ logger.error('Error checking embedded state with Openfort:', error);
1020
1037
  if (pollingRef.current)
1021
1038
  clearInterval(pollingRef.current);
1022
1039
  }
1023
1040
  }, [openfort]);
1041
+ // Only log embedded state when it changes
1042
+ useEffect(() => {
1043
+ if (previousEmbeddedState.current !== embeddedState) {
1044
+ logger.log("Embedded state changed:", EmbeddedState[embeddedState]);
1045
+ previousEmbeddedState.current = embeddedState;
1046
+ }
1047
+ }, [embeddedState]);
1024
1048
  const startPollingEmbeddedState = useCallback(() => {
1025
1049
  if (!!pollingRef.current)
1026
1050
  return;
1027
- log("Starting polling embedded state", pollingRef.current, !!pollingRef.current);
1028
1051
  pollingRef.current = setInterval(pollEmbeddedState, 300);
1029
1052
  }, [pollEmbeddedState]);
1030
1053
  const stopPollingEmbeddedState = useCallback(() => {
1031
- log("Stopping polling embedded state");
1032
1054
  clearInterval(pollingRef.current || undefined);
1033
1055
  pollingRef.current = null;
1034
1056
  }, []);
@@ -1044,27 +1066,27 @@ const CoreOpenfortProvider = ({ children, debugMode, onConnect, onDisconnect, ..
1044
1066
  var _a, _b;
1045
1067
  if (!openfort)
1046
1068
  return null;
1047
- log("Updating user", { user, logoutOnError });
1069
+ logger.log("Updating user", { user, logoutOnError });
1048
1070
  if (user) {
1049
1071
  setUser(user);
1050
1072
  return user;
1051
1073
  }
1052
1074
  try {
1053
1075
  const user = await openfort.user.get();
1054
- log("Getting user");
1076
+ logger.log("Getting user");
1055
1077
  setUser(user);
1056
1078
  return user;
1057
1079
  }
1058
1080
  catch (err) {
1059
- log("Error getting user", err);
1081
+ logger.log("Error getting user", err);
1060
1082
  if (!logoutOnError)
1061
1083
  return null;
1062
1084
  if (((_a = err === null || err === void 0 ? void 0 : err.response) === null || _a === void 0 ? void 0 : _a.status) === 404) {
1063
- log("User not found, logging out");
1085
+ logger.log("User not found, logging out");
1064
1086
  logout();
1065
1087
  }
1066
1088
  else if (((_b = err === null || err === void 0 ? void 0 : err.response) === null || _b === void 0 ? void 0 : _b.status) === 401) {
1067
- log("User not authenticated, logging out");
1089
+ logger.log("User not authenticated, logging out");
1068
1090
  logout();
1069
1091
  }
1070
1092
  return null;
@@ -1074,7 +1096,7 @@ const CoreOpenfortProvider = ({ children, debugMode, onConnect, onDisconnect, ..
1074
1096
  useEffect(() => {
1075
1097
  if (!openfort || !walletConfig)
1076
1098
  return;
1077
- log("Getting ethereum provider", chainId);
1099
+ logger.log("Getting ethereum provider", chainId);
1078
1100
  const resolvePolicy = () => {
1079
1101
  const { ethereumProviderPolicyId } = walletConfig;
1080
1102
  if (!ethereumProviderPolicyId)
@@ -1084,7 +1106,7 @@ const CoreOpenfortProvider = ({ children, debugMode, onConnect, onDisconnect, ..
1084
1106
  }
1085
1107
  const policy = ethereumProviderPolicyId[chainId];
1086
1108
  if (!policy) {
1087
- log(`No policy found for chainId ${chainId}.`);
1109
+ logger.log(`No policy found for chainId ${chainId}.`);
1088
1110
  return undefined;
1089
1111
  }
1090
1112
  return { policy };
@@ -1108,7 +1130,6 @@ const CoreOpenfortProvider = ({ children, debugMode, onConnect, onDisconnect, ..
1108
1130
  if (!openfort)
1109
1131
  return;
1110
1132
  // Poll embedded signer state
1111
- log("Embedded state update", embeddedState);
1112
1133
  switch (embeddedState) {
1113
1134
  case EmbeddedState.NONE:
1114
1135
  case EmbeddedState.CREATING_ACCOUNT:
@@ -1125,14 +1146,14 @@ const CoreOpenfortProvider = ({ children, debugMode, onConnect, onDisconnect, ..
1125
1146
  case EmbeddedState.READY:
1126
1147
  (async () => {
1127
1148
  for (let i = 0; i < 5; i++) {
1128
- log("Trying to update user...", i);
1149
+ logger.log("Trying to update user...", i);
1129
1150
  try {
1130
1151
  const user = await updateUser(undefined, true);
1131
1152
  if (user)
1132
1153
  break;
1133
1154
  }
1134
1155
  catch (err) {
1135
- console.error("Error updating user, retrying...", err);
1156
+ logger.error("Error updating user, retrying...", err);
1136
1157
  }
1137
1158
  await new Promise((resolve) => setTimeout(resolve, 250));
1138
1159
  }
@@ -1153,7 +1174,7 @@ const CoreOpenfortProvider = ({ children, debugMode, onConnect, onDisconnect, ..
1153
1174
  const connector = connectors.find((connector) => connector.name === "Openfort");
1154
1175
  if (!connector)
1155
1176
  return;
1156
- log("Connecting to wagmi with Openfort");
1177
+ logger.log("Connecting to wagmi with Openfort");
1157
1178
  setIsConnectedWithEmbeddedSigner(true);
1158
1179
  connect({ connector });
1159
1180
  }, [connectors, embeddedState, address, user]);
@@ -1163,7 +1184,8 @@ const CoreOpenfortProvider = ({ children, debugMode, onConnect, onDisconnect, ..
1163
1184
  if (!openfort)
1164
1185
  return;
1165
1186
  setUser(null);
1166
- log('Logging out...');
1187
+ setWalletStatus({ status: "idle" });
1188
+ logger.log('Logging out...');
1167
1189
  await openfort.auth.logout();
1168
1190
  await disconnectAsync();
1169
1191
  queryClient.resetQueries({ queryKey: ['openfortEmbeddedAccountsList'] });
@@ -1174,12 +1196,12 @@ const CoreOpenfortProvider = ({ children, debugMode, onConnect, onDisconnect, ..
1174
1196
  if (!openfort)
1175
1197
  return;
1176
1198
  try {
1177
- log('Signing up as guest...');
1199
+ logger.log('Signing up as guest...');
1178
1200
  const res = await openfort.auth.signUpGuest();
1179
- log('Signed up as guest:', res);
1201
+ logger.log('Signed up as guest:', res);
1180
1202
  }
1181
1203
  catch (error) {
1182
- console.error('Error logging in as guest:', error);
1204
+ logger.error('Error logging in as guest:', error);
1183
1205
  }
1184
1206
  }, [openfort]);
1185
1207
  // ---- Return values ----
@@ -1218,6 +1240,8 @@ const CoreOpenfortProvider = ({ children, debugMode, onConnect, onDisconnect, ..
1218
1240
  updateUser,
1219
1241
  embeddedAccounts,
1220
1242
  isLoadingAccounts,
1243
+ walletStatus,
1244
+ setWalletStatus,
1221
1245
  client: openfort,
1222
1246
  };
1223
1247
  return createElement(Context$1.Provider, { value }, jsxs(Fragment, { children: [jsx(ConnectCallback, { onConnect: onConnect, onDisconnect: onDisconnect }), children] }));
@@ -4543,7 +4567,7 @@ function useLocales(replacements) {
4543
4567
  return getLocale(language);
4544
4568
  }, [language]);
4545
4569
  if (!translations) {
4546
- console.error(`Missing translations for: ${language}`);
4570
+ logger.error(`Missing translations for: ${language}`);
4547
4571
  throw new Error(`Missing translations for: ${language}`);
4548
4572
  }
4549
4573
  const translated = {};
@@ -4605,7 +4629,7 @@ function usePrevious(value, initial) {
4605
4629
  return ref.current.previous;
4606
4630
  }
4607
4631
 
4608
- const useWallet$1 = (id) => {
4632
+ const useWallet = (id) => {
4609
4633
  const wallets = useWallets$1();
4610
4634
  const wallet = wallets.find((c) => c.id === id);
4611
4635
  if (!wallet)
@@ -4902,7 +4926,7 @@ const Modal = ({ open, pages, pageId, positionInside, inline, demo, onClose, onB
4902
4926
  const context = useOpenfort();
4903
4927
  const themeContext = useThemeContext();
4904
4928
  const mobile = isMobile();
4905
- const wallet = useWallet$1((_a = context.connector) === null || _a === void 0 ? void 0 : _a.id);
4929
+ const wallet = useWallet((_a = context.connector) === null || _a === void 0 ? void 0 : _a.id);
4906
4930
  const walletInfo = {
4907
4931
  name: wallet === null || wallet === void 0 ? void 0 : wallet.name,
4908
4932
  shortName: (_b = wallet === null || wallet === void 0 ? void 0 : wallet.shortName) !== null && _b !== void 0 ? _b : wallet === null || wallet === void 0 ? void 0 : wallet.name,
@@ -7427,7 +7451,7 @@ CustomQRCode.displayName = 'CustomQRCode';
7427
7451
  const DownloadApp = () => {
7428
7452
  var _a, _b, _c;
7429
7453
  const context = useOpenfort();
7430
- const wallet = useWallet$1(context.connector.id);
7454
+ const wallet = useWallet(context.connector.id);
7431
7455
  const locales = useLocales({
7432
7456
  CONNECTORNAME: wallet === null || wallet === void 0 ? void 0 : wallet.name,
7433
7457
  });
@@ -9390,7 +9414,7 @@ function useProviders() {
9390
9414
  useEffect(() => {
9391
9415
  if (thirdPartyAuth) {
9392
9416
  setOpen(false);
9393
- console.error(new OpenfortError('When using external third party auth providers, openfort Auth providers are not available. Either remove the `thirdPartyAuth` or authenticate your users using Auth hooks.', OpenfortErrorType.CONFIGURATION_ERROR));
9417
+ logger.error(new OpenfortError('When using external third party auth providers, openfort Auth providers are not available. Either remove the `thirdPartyAuth` or authenticate your users using Auth hooks.', OpenfortErrorType.CONFIGURATION_ERROR));
9394
9418
  }
9395
9419
  }, [thirdPartyAuth, setOpen]);
9396
9420
  const maxProviders = 4;
@@ -10021,7 +10045,7 @@ function useConnectWithSiwe() {
10021
10045
  const { address, connector } = useAccount();
10022
10046
  const chainId = useChainId();
10023
10047
  const config = useConfig();
10024
- useWallet$1((connector === null || connector === void 0 ? void 0 : connector.id) || "");
10048
+ useWallet((connector === null || connector === void 0 ? void 0 : connector.id) || "");
10025
10049
  const connectWithSiwe = useCallback(async ({ onError, onConnect, } = {}) => {
10026
10050
  const connectorType = connector === null || connector === void 0 ? void 0 : connector.type;
10027
10051
  const walletClientType = connector === null || connector === void 0 ? void 0 : connector.id;
@@ -10136,7 +10160,7 @@ const ConnectWithInjector = ({ switchConnectMethod, forceState }) => {
10136
10160
  }
10137
10161
  },
10138
10162
  onError(err) {
10139
- console.error(err);
10163
+ logger.error(err);
10140
10164
  },
10141
10165
  onSettled(data, error) {
10142
10166
  var _a;
@@ -10175,7 +10199,8 @@ const ConnectWithInjector = ({ switchConnectMethod, forceState }) => {
10175
10199
  else if (data) {
10176
10200
  if (!wallet) {
10177
10201
  setStatus(states$3.FAILED);
10178
- throw console.error('No wallet found');
10202
+ logger.error('No wallet found');
10203
+ throw new Error('No wallet found');
10179
10204
  }
10180
10205
  // If already has linked account, don't link again
10181
10206
  if ((_a = openfort.user) === null || _a === void 0 ? void 0 : _a.linkedAccounts.find((acc) => { var _a; return acc.walletClientType === ((_a = wallet === null || wallet === void 0 ? void 0 : wallet.connector) === null || _a === void 0 ? void 0 : _a.name.toLowerCase()); })) {
@@ -10186,7 +10211,7 @@ const ConnectWithInjector = ({ switchConnectMethod, forceState }) => {
10186
10211
  // connectorType: wallet.connector.id,
10187
10212
  // walletClientType: wallet.connector.name.toLowerCase(),
10188
10213
  onError: (error, status) => {
10189
- console.error(error);
10214
+ logger.error(error);
10190
10215
  disconnect();
10191
10216
  if (status === 409) {
10192
10217
  setStatus(states$3.DUPLICATED);
@@ -10206,7 +10231,7 @@ const ConnectWithInjector = ({ switchConnectMethod, forceState }) => {
10206
10231
  });
10207
10232
  const { triggerResize, connector: c } = useOpenfort();
10208
10233
  const id = c.id;
10209
- const wallet = useWallet$1(id);
10234
+ const wallet = useWallet(id);
10210
10235
  const walletInfo = {
10211
10236
  name: wallet === null || wallet === void 0 ? void 0 : wallet.name,
10212
10237
  shortName: (_a = wallet === null || wallet === void 0 ? void 0 : wallet.shortName) !== null && _a !== void 0 ? _a : wallet === null || wallet === void 0 ? void 0 : wallet.name,
@@ -10338,7 +10363,7 @@ const ConnectWithQRCode = ({ switchConnectMethod }) => {
10338
10363
  var _a, _b, _c, _d, _e, _f, _g, _h;
10339
10364
  const context = useOpenfort();
10340
10365
  const id = context.connector.id;
10341
- const wallet = useWallet$1(context.connector.id);
10366
+ const wallet = useWallet(context.connector.id);
10342
10367
  const { open: openW3M, isOpen: isOpenW3M } = useWalletConnectModal();
10343
10368
  const { connect: { getUri }, } = useWeb3();
10344
10369
  const wcUri = getUri(id);
@@ -10541,7 +10566,7 @@ const ConnectWithOAuth = ({}) => {
10541
10566
  ].forEach((key) => url.searchParams.delete(key));
10542
10567
  window.history.replaceState({}, document.title, url.toString());
10543
10568
  if (!player || !accessToken || !refreshToken) {
10544
- console.error(`Missing player id or access token or refresh token: player=${player}, accessToken=${accessToken ? accessToken.substring(0, 10) + "..." : accessToken}, refreshToken=${refreshToken}`);
10569
+ logger.error(`Missing player id or access token or refresh token: player=${player}, accessToken=${accessToken ? accessToken.substring(0, 10) + "..." : accessToken}, refreshToken=${refreshToken}`);
10545
10570
  return;
10546
10571
  }
10547
10572
  client.auth.storeCredentials({
@@ -10565,7 +10590,7 @@ const ConnectWithOAuth = ({}) => {
10565
10590
  if (user) {
10566
10591
  const authToken = await client.getAccessToken();
10567
10592
  if (!authToken) {
10568
- console.error("No auth token found");
10593
+ logger.error("No auth token found");
10569
10594
  setRoute(routes.LOADING);
10570
10595
  return;
10571
10596
  }
@@ -10593,7 +10618,7 @@ const ConnectWithOAuth = ({}) => {
10593
10618
  }
10594
10619
  }
10595
10620
  catch (e) {
10596
- console.error("Error during OAuth initialization:", e);
10621
+ logger.error("Error during OAuth initialization:", e);
10597
10622
  setRoute(routes.CONNECT);
10598
10623
  setStatus(states$2.ERROR);
10599
10624
  if (e instanceof Error) {
@@ -10621,7 +10646,7 @@ const states$1 = {
10621
10646
  };
10622
10647
  const ConnectUsing = () => {
10623
10648
  const context = useOpenfort();
10624
- const wallet = useWallet$1(context.connector.id);
10649
+ const wallet = useWallet(context.connector.id);
10625
10650
  // If cannot be scanned, display injector flow, which if extension is not installed will show CTA to install it
10626
10651
  const isQrCode = !(wallet === null || wallet === void 0 ? void 0 : wallet.isInstalled) && (wallet === null || wallet === void 0 ? void 0 : wallet.getWalletConnectDeeplink);
10627
10652
  // For OAuth connectors, we don't need to show the injector flow
@@ -10824,82 +10849,6 @@ const onError = ({ hookOptions, options, error, }) => {
10824
10849
  return { error };
10825
10850
  };
10826
10851
 
10827
- var OpenfortStatus;
10828
- (function (OpenfortStatus) {
10829
- OpenfortStatus[OpenfortStatus["DISCONNECTED"] = 0] = "DISCONNECTED";
10830
- OpenfortStatus[OpenfortStatus["NEEDS_RECOVERY"] = 1] = "NEEDS_RECOVERY";
10831
- OpenfortStatus[OpenfortStatus["LOADING"] = 2] = "LOADING";
10832
- OpenfortStatus[OpenfortStatus["CONNECTED"] = 3] = "CONNECTED";
10833
- })(OpenfortStatus || (OpenfortStatus = {}));
10834
- /**
10835
- * Hook for monitoring Openfort connection and authentication status
10836
- *
10837
- * This hook provides real-time status information about the user's connection to Openfort
10838
- * services and embedded wallet state. It tracks various states including loading, connected,
10839
- * disconnected, and authentication status based on embedded wallet configuration and connection.
10840
- *
10841
- * @returns Current connection and authentication status flags
10842
- *
10843
- * @example
10844
- * ```tsx
10845
- * const status = useStatus();
10846
- *
10847
- * // Check connection states
10848
- * if (status.isLoading) {
10849
- * console.log('Initializing Openfort connection...');
10850
- * } else if (status.isConnecting) {
10851
- * console.log('Connecting to wallet...');
10852
- * } else if (status.isConnected) {
10853
- * console.log('Successfully connected to Openfort');
10854
- * } else if (status.isDisconnected) {
10855
- * console.log('Not connected to Openfort');
10856
- * }
10857
- *
10858
- * // Check authentication state
10859
- * if (status.isAuthenticated) {
10860
- * console.log('User is authenticated');
10861
- * // Show authenticated UI
10862
- * } else {
10863
- * console.log('User is not authenticated');
10864
- * // Show login UI
10865
- * }
10866
- *
10867
- * // Conditional rendering based on status
10868
- * const renderContent = () => {
10869
- * if (status.isLoading) return <LoadingSpinner />;
10870
- * if (status.isConnecting) return <ConnectingIndicator />;
10871
- * if (status.isConnected && status.isAuthenticated) return <AuthenticatedApp />;
10872
- * return <LoginForm />;
10873
- * };
10874
- * ```
10875
- */
10876
- function useStatus() {
10877
- const { embeddedState } = useOpenfortCore();
10878
- const { isConnected, isConnecting } = useAccount();
10879
- const getStatus = () => {
10880
- if (embeddedState === EmbeddedState.READY)
10881
- return OpenfortStatus.CONNECTED;
10882
- if (embeddedState === EmbeddedState.NONE)
10883
- return OpenfortStatus.LOADING;
10884
- // if (needsRecovery) return OpenfortStatus.NEEDS_RECOVERY;
10885
- if (embeddedState === EmbeddedState.EMBEDDED_SIGNER_NOT_CONFIGURED) {
10886
- if (isConnected)
10887
- return OpenfortStatus.CONNECTED;
10888
- else
10889
- return OpenfortStatus.NEEDS_RECOVERY;
10890
- }
10891
- return OpenfortStatus.DISCONNECTED;
10892
- };
10893
- const status = getStatus();
10894
- return {
10895
- isLoading: status === OpenfortStatus.LOADING,
10896
- isConnected: status === OpenfortStatus.CONNECTED,
10897
- isDisconnected: status === OpenfortStatus.DISCONNECTED,
10898
- isConnecting: isConnecting || embeddedState === EmbeddedState.CREATING_ACCOUNT,
10899
- isAuthenticated: embeddedState !== EmbeddedState.NONE && embeddedState !== EmbeddedState.UNAUTHENTICATED,
10900
- };
10901
- }
10902
-
10903
10852
  /**
10904
10853
  * Hook for accessing current user information and authentication state
10905
10854
  *
@@ -10945,8 +10894,7 @@ function useStatus() {
10945
10894
  * ```
10946
10895
  */
10947
10896
  function useUser() {
10948
- const { user, client } = useOpenfortCore();
10949
- const { isAuthenticated } = useStatus();
10897
+ const { user, client, embeddedState } = useOpenfortCore();
10950
10898
  const getAccessTokenAndUpdate = useCallback(async () => {
10951
10899
  await client.validateAndRefreshToken();
10952
10900
  const token = await client.getAccessToken();
@@ -10954,7 +10902,7 @@ function useUser() {
10954
10902
  }, [client]);
10955
10903
  return {
10956
10904
  user,
10957
- isAuthenticated,
10905
+ isAuthenticated: embeddedState !== EmbeddedState.NONE && embeddedState !== EmbeddedState.UNAUTHENTICATED,
10958
10906
  getAccessToken: getAccessTokenAndUpdate,
10959
10907
  validateAndRefreshToken: async () => await client.validateAndRefreshToken(),
10960
10908
  };
@@ -11006,12 +10954,6 @@ const mapWalletStatus = (status) => {
11006
10954
  * onSetActiveWalletSuccess: (result) => console.log('Wallet activated:', result.wallet),
11007
10955
  * });
11008
10956
  *
11009
- * // Check available wallets
11010
- * if (wallets.hasWallet) {
11011
- * console.log('Available wallets:', wallets.wallets);
11012
- * console.log('Active wallet:', wallets.activeWallet);
11013
- * }
11014
- *
11015
10957
  * // Create a new embedded wallet with automatic recovery
11016
10958
  * await wallets.createWallet({
11017
10959
  * recovery: { recoveryMethod: RecoveryMethod.AUTOMATIC },
@@ -11051,14 +10993,12 @@ function useWallets(hookOptions = {}) {
11051
10993
  const chainId = useChainId();
11052
10994
  const availableWallets = useWallets$1(); // TODO: Map wallets object to be the same as wallets
11053
10995
  const { disconnect, disconnectAsync } = useDisconnect();
11054
- const [status, setStatus] = useState({
11055
- status: "idle",
11056
- });
10996
+ const [status, setStatus] = useWalletStatus();
11057
10997
  const [connectToConnector, setConnectToConnector] = useState(undefined);
11058
10998
  const { connect } = useConnect$1({
11059
10999
  mutation: {
11060
11000
  onError: (e) => {
11061
- console.error("Error connecting ---", e);
11001
+ logger.error("Error connecting ---", e);
11062
11002
  const error = new OpenfortError("Failed to connect with wallet: ", OpenfortErrorType.AUTHENTICATION_ERROR, e);
11063
11003
  setStatus({
11064
11004
  status: 'error',
@@ -11072,7 +11012,7 @@ function useWallets(hookOptions = {}) {
11072
11012
  onSuccess: (data) => {
11073
11013
  setConnectToConnector(undefined);
11074
11014
  log("Connected with wallet", data, connectToConnector);
11075
- if ((connectToConnector === null || connectToConnector === void 0 ? void 0 : connectToConnector.address) && !data.accounts.some((a) => a === connectToConnector.address)) {
11015
+ if ((connectToConnector === null || connectToConnector === void 0 ? void 0 : connectToConnector.address) && !data.accounts.some((a) => { var _a; return a.toLowerCase() === ((_a = connectToConnector.address) === null || _a === void 0 ? void 0 : _a.toLowerCase()); })) {
11076
11016
  setStatus({
11077
11017
  status: 'error',
11078
11018
  error: new OpenfortError("Failed to connect with wallet: Address mismatch", OpenfortErrorType.AUTHENTICATION_ERROR),
@@ -11138,10 +11078,9 @@ function useWallets(hookOptions = {}) {
11138
11078
  throw new OpenfortError("No wallet address provided and no embedded wallet with passkey recovery found", OpenfortErrorType.VALIDATION_ERROR);
11139
11079
  }
11140
11080
  }
11141
- const details = (_b = embeddedAccounts.find(w => w.address === walletAddress && w.recoveryMethod === RecoveryMethod.PASSKEY)) === null || _b === void 0 ? void 0 : _b.recoveryMethodDetails;
11081
+ const details = (_b = embeddedAccounts.find(w => w.address.toLowerCase() === (walletAddress === null || walletAddress === void 0 ? void 0 : walletAddress.toLowerCase()) && w.recoveryMethod === RecoveryMethod.PASSKEY)) === null || _b === void 0 ? void 0 : _b.recoveryMethodDetails;
11142
11082
  const passkeyId = details === null || details === void 0 ? void 0 : details.passkeyId;
11143
- const passkeyEnv = details === null || details === void 0 ? void 0 : details.passkeyEnv;
11144
- if (!passkeyId || !passkeyEnv) {
11083
+ if (!passkeyId) {
11145
11084
  throw new OpenfortError("No passkey details found for the wallet", OpenfortErrorType.VALIDATION_ERROR);
11146
11085
  }
11147
11086
  return {
@@ -11170,7 +11109,7 @@ function useWallets(hookOptions = {}) {
11170
11109
  }) : [];
11171
11110
  embeddedAccounts === null || embeddedAccounts === void 0 ? void 0 : embeddedAccounts.forEach((embeddedAccount) => {
11172
11111
  // Remove duplicates (different chain ids)
11173
- if (userWallets.find(w => w.address === (embeddedAccount.address)))
11112
+ if (userWallets.find(w => w.address.toLowerCase() === embeddedAccount.address.toLowerCase()))
11174
11113
  return;
11175
11114
  userWallets.push(parseEmbeddedAccount(embeddedAccount, openfortConnector));
11176
11115
  });
@@ -11178,11 +11117,14 @@ function useWallets(hookOptions = {}) {
11178
11117
  }, [user === null || user === void 0 ? void 0 : user.linkedAccounts, embeddedAccounts]);
11179
11118
  const wallets = useMemo(() => {
11180
11119
  // log("Mapping wallets", { rawWallets, status, address, isConnected, connector: connector?.id });
11181
- return rawWallets.map((w) => ({
11182
- ...w,
11183
- isConnecting: status.status === 'connecting' && status.address === w.address,
11184
- isActive: w.address === address && isConnected && (connector === null || connector === void 0 ? void 0 : connector.id) === w.id,
11185
- }));
11120
+ return rawWallets.map((w) => {
11121
+ var _a;
11122
+ return ({
11123
+ ...w,
11124
+ isConnecting: status.status === 'connecting' && ((_a = status.address) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === w.address.toLowerCase(),
11125
+ isActive: w.address.toLowerCase() === (address === null || address === void 0 ? void 0 : address.toLowerCase()) && isConnected && (connector === null || connector === void 0 ? void 0 : connector.id) === w.id,
11126
+ });
11127
+ });
11186
11128
  }, [rawWallets.length, status.status, address, isConnected, connector === null || connector === void 0 ? void 0 : connector.id]);
11187
11129
  const activeWallet = isConnected && connector ? wallets.find((w) => w.isActive) : undefined;
11188
11130
  useEffect(() => {
@@ -11190,7 +11132,7 @@ function useWallets(hookOptions = {}) {
11190
11132
  connect({ connector: connectToConnector.connector });
11191
11133
  }, [connectToConnector]);
11192
11134
  const setActiveWallet = useCallback(async (options) => {
11193
- var _a, _b, _c, _d, _e;
11135
+ var _a, _b, _c, _d, _e, _f;
11194
11136
  const optionsObject = typeof options === "string" ? { walletId: options } : options;
11195
11137
  const { showUI } = optionsObject;
11196
11138
  let connector = null;
@@ -11210,7 +11152,7 @@ function useWallets(hookOptions = {}) {
11210
11152
  log("Connector not found", availableWallets, optionsObject.walletId);
11211
11153
  return { error: new OpenfortError("Connector not found", OpenfortErrorType.WALLET_ERROR) };
11212
11154
  }
11213
- if ((activeWallet === null || activeWallet === void 0 ? void 0 : activeWallet.id) === connector.id && address === optionsObject.address) {
11155
+ if ((activeWallet === null || activeWallet === void 0 ? void 0 : activeWallet.id) === connector.id && (address === null || address === void 0 ? void 0 : address.toLowerCase()) === ((_a = optionsObject.address) === null || _a === void 0 ? void 0 : _a.toLowerCase())) {
11214
11156
  log(`Already connected to ${connector.id} with address ${address}, skipping connection`);
11215
11157
  return { wallet: activeWallet };
11216
11158
  }
@@ -11270,12 +11212,13 @@ function useWallets(hookOptions = {}) {
11270
11212
  log("Embedded wallets", embeddedAccounts, chainId);
11271
11213
  let embeddedAccount;
11272
11214
  if (walletAddress) {
11215
+ const addressToMatch = walletAddress.toLowerCase();
11273
11216
  const accountToRecover = embeddedAccounts.find(w => {
11274
11217
  if ((walletConfig === null || walletConfig === void 0 ? void 0 : walletConfig.accountType) === AccountTypeEnum.EOA) {
11275
- return w.address === walletAddress;
11218
+ return w.address.toLowerCase() === addressToMatch;
11276
11219
  }
11277
11220
  else {
11278
- return w.address === walletAddress && w.chainId === chainId;
11221
+ return w.address.toLowerCase() === addressToMatch && w.chainId === chainId;
11279
11222
  }
11280
11223
  });
11281
11224
  if (!accountToRecover) {
@@ -11287,17 +11230,17 @@ function useWallets(hookOptions = {}) {
11287
11230
  });
11288
11231
  }
11289
11232
  log("Found embedded wallet to recover", accountToRecover);
11290
- if (((_a = optionsObject.recovery) === null || _a === void 0 ? void 0 : _a.recoveryMethod) && accountToRecover.recoveryMethod && optionsObject.recovery.recoveryMethod !== accountToRecover.recoveryMethod) {
11233
+ if (((_b = optionsObject.recovery) === null || _b === void 0 ? void 0 : _b.recoveryMethod) && accountToRecover.recoveryMethod && optionsObject.recovery.recoveryMethod !== accountToRecover.recoveryMethod) {
11291
11234
  log("Recovery method does not match", optionsObject.recovery.recoveryMethod, accountToRecover.recoveryMethod);
11292
11235
  return onError({
11293
- error: new OpenfortError("The recovery phrase you entered is incorrect and does not match the wallet's recovery method", OpenfortErrorType.WALLET_ERROR),
11236
+ error: new OpenfortError("The recovery method you entered is incorrect and does not match the wallet's recovery method", OpenfortErrorType.WALLET_ERROR),
11294
11237
  options: optionsObject,
11295
11238
  hookOptions
11296
11239
  });
11297
11240
  }
11298
11241
  const recovery = {
11299
- recoveryMethod: (_b = accountToRecover.recoveryMethod) !== null && _b !== void 0 ? _b : RecoveryMethod.AUTOMATIC,
11300
- password: (_c = optionsObject.recovery) === null || _c === void 0 ? void 0 : _c.password,
11242
+ recoveryMethod: (_c = accountToRecover.recoveryMethod) !== null && _c !== void 0 ? _c : RecoveryMethod.AUTOMATIC,
11243
+ password: (_d = optionsObject.recovery) === null || _d === void 0 ? void 0 : _d.password,
11301
11244
  };
11302
11245
  const recoveryParams = await parseWalletRecovery(recovery, embeddedAccounts, walletAddress);
11303
11246
  embeddedAccount = await client.embeddedWallet.recover({
@@ -11306,31 +11249,41 @@ function useWallets(hookOptions = {}) {
11306
11249
  });
11307
11250
  }
11308
11251
  else {
11252
+ let accountToRecover;
11309
11253
  // Check if the embedded wallet is already created in the current chain
11310
- if (embeddedAccounts.some((w) => w.chainId === chainId)) {
11311
- const accountToRecover = embeddedAccounts.find((w) => w.chainId === chainId);
11312
- log("Found embedded wallet to recover (without walletAddress)", accountToRecover);
11313
- const recovery = {
11314
- recoveryMethod: (_d = accountToRecover.recoveryMethod) !== null && _d !== void 0 ? _d : RecoveryMethod.AUTOMATIC,
11315
- password: (_e = optionsObject.recovery) === null || _e === void 0 ? void 0 : _e.password,
11316
- };
11317
- const recoveryParams = await parseWalletRecovery(recovery, embeddedAccounts, walletAddress);
11318
- embeddedAccount = await client.embeddedWallet.recover({
11319
- account: accountToRecover.id,
11320
- recoveryParams,
11321
- });
11322
- walletAddress = accountToRecover.address;
11254
+ if ((walletConfig === null || walletConfig === void 0 ? void 0 : walletConfig.accountType) === AccountTypeEnum.EOA) {
11255
+ accountToRecover = embeddedAccounts.find((w) => w.accountType === AccountTypeEnum.EOA);
11256
+ if (!accountToRecover) {
11257
+ return onError({
11258
+ error: new OpenfortError("No embedded wallet found with type EOA", OpenfortErrorType.WALLET_ERROR),
11259
+ options: optionsObject,
11260
+ hookOptions
11261
+ });
11262
+ }
11323
11263
  }
11324
11264
  else {
11325
- log("No embedded wallet found for the current chain");
11326
- // Here it should check if there is a wallet that can recover in another chain and recover it in the current chain (its a different account so its not supported yet)
11327
- // TODO: Connect to wallet in the other chain and then switch chain
11328
- return onError({
11329
- error: new OpenfortError("No embedded wallet found for the current chain", OpenfortErrorType.WALLET_ERROR),
11330
- options: optionsObject,
11331
- hookOptions
11332
- });
11265
+ const accountToRecover = embeddedAccounts.find((w) => w.chainId === chainId);
11266
+ if (!accountToRecover) {
11267
+ // Here it should check if there is a wallet that can recover in another chain and recover it in the current chain (its a different account so its not supported yet)
11268
+ // TODO: Connect to wallet in the other chain and then switch chain
11269
+ return onError({
11270
+ error: new OpenfortError("No embedded wallet found for the current chain", OpenfortErrorType.WALLET_ERROR),
11271
+ options: optionsObject,
11272
+ hookOptions
11273
+ });
11274
+ }
11333
11275
  }
11276
+ log("Found embedded wallet to recover (without walletAddress)", accountToRecover);
11277
+ const recovery = {
11278
+ recoveryMethod: (_e = accountToRecover.recoveryMethod) !== null && _e !== void 0 ? _e : RecoveryMethod.AUTOMATIC,
11279
+ password: (_f = optionsObject.recovery) === null || _f === void 0 ? void 0 : _f.password,
11280
+ };
11281
+ const recoveryParams = await parseWalletRecovery(recovery, embeddedAccounts, walletAddress);
11282
+ embeddedAccount = await client.embeddedWallet.recover({
11283
+ account: accountToRecover.id,
11284
+ recoveryParams,
11285
+ });
11286
+ walletAddress = accountToRecover.address;
11334
11287
  }
11335
11288
  if (!embeddedAccount) {
11336
11289
  return onError({
@@ -11475,7 +11428,6 @@ function useWallets(hookOptions = {}) {
11475
11428
  }
11476
11429
  }, [client, setStatus, hookOptions]);
11477
11430
  return {
11478
- hasWallet: wallets.length > 0,
11479
11431
  isLoadingWallets,
11480
11432
  wallets,
11481
11433
  availableWallets,
@@ -11621,7 +11573,7 @@ const useConnectToWalletPostAuth = () => {
11621
11573
  if (wallets.length === 0) {
11622
11574
  const createWalletResult = await createWallet();
11623
11575
  if (createWalletResult.error && signOutOnError) {
11624
- console.error("Error creating wallet:", createWalletResult.error);
11576
+ logger.error("Error creating wallet:", createWalletResult.error);
11625
11577
  // If there was an error and we should log out, we can call the logout function
11626
11578
  await signOut();
11627
11579
  return {};
@@ -11634,7 +11586,7 @@ const useConnectToWalletPostAuth = () => {
11634
11586
  walletId: embeddedWalletId,
11635
11587
  });
11636
11588
  if (!setWalletResult.wallet || (setWalletResult.error && signOutOnError)) {
11637
- console.error("Error recovering wallet:", setWalletResult.error);
11589
+ logger.error("Error recovering wallet:", setWalletResult.error);
11638
11590
  // If there was an error and we should log out, we can call the logout function
11639
11591
  await signOut();
11640
11592
  }
@@ -12197,7 +12149,7 @@ const EmailVerification = () => {
12197
12149
  const state = url.searchParams.get("state");
12198
12150
  const email = url.searchParams.get("email");
12199
12151
  if (!state) {
12200
- console.error("No state found in URL");
12152
+ logger.error("No state found in URL");
12201
12153
  return;
12202
12154
  }
12203
12155
  const removeParams = () => {
@@ -12533,7 +12485,7 @@ const AddressButNoUserCase = () => {
12533
12485
  disconnect();
12534
12486
  })
12535
12487
  .catch(() => {
12536
- console.error("Failed to update user");
12488
+ logger.error("Failed to update user");
12537
12489
  });
12538
12490
  }, []);
12539
12491
  return (jsx(PageContent, { children: jsx(Loader, { header: "Updating user" }) }));
@@ -13036,7 +12988,7 @@ const RecoverWallet = ({ wallet }) => {
13036
12988
  case RecoveryMethod.PASSKEY:
13037
12989
  return jsx(RecoverPasskeyWallet, { wallet: wallet });
13038
12990
  default:
13039
- console.error("Unsupported recovery method: " + wallet.recoveryMethod + ", defaulting to automatic.");
12991
+ logger.error("Unsupported recovery method: " + wallet.recoveryMethod + ", defaulting to automatic.");
13040
12992
  return jsx(RecoverAutomaticWallet, { walletAddress: wallet.address });
13041
12993
  }
13042
12994
  };
@@ -13091,7 +13043,7 @@ const CreateWallet = () => {
13091
13043
  case "other":
13092
13044
  return jsx(ChooseRecoveryMethod, { onChangeMethod: setUserSelectedMethod });
13093
13045
  default:
13094
- console.error("Unsupported recovery method: " + userSelectedMethod + uiConfig.walletRecovery.defaultMethod);
13046
+ logger.error("Unsupported recovery method: " + userSelectedMethod + uiConfig.walletRecovery.defaultMethod);
13095
13047
  return null;
13096
13048
  }
13097
13049
  };
@@ -13209,7 +13161,7 @@ const DownloadFooter = styled.div `
13209
13161
  const ConnectWithMobile = ({}) => {
13210
13162
  var _a, _b, _c;
13211
13163
  const { connector, setRoute } = useOpenfort();
13212
- const wallet = useWallet$1(connector.id) || walletConfigs[connector.id];
13164
+ const wallet = useWallet(connector.id) || walletConfigs[connector.id];
13213
13165
  const [status, setStatus] = useState(states.INIT);
13214
13166
  const [description, setDescription] = useState(undefined);
13215
13167
  const { connect: { getUri }, } = useWeb3();
@@ -13512,7 +13464,7 @@ const OpenfortProvider = ({ children, uiConfig, onConnect, onDisconnect, debugMo
13512
13464
  }
13513
13465
  if (safeUiConfig.walletRecovery.allowedMethods.includes(RecoveryMethod.AUTOMATIC) && !allowAutomaticRecovery) {
13514
13466
  safeUiConfig.walletRecovery.allowedMethods = safeUiConfig.walletRecovery.allowedMethods.filter(m => m !== RecoveryMethod.AUTOMATIC);
13515
- console.warn("Automatic recovery method was removed from allowedMethods because no recovery options are configured in the walletConfig. Please provide either createEncryptedSessionEndpoint or getEncryptionSession to enable automatic recovery.");
13467
+ logger.warn("Automatic recovery method was removed from allowedMethods because no recovery options are configured in the walletConfig. Please provide either createEncryptedSessionEndpoint or getEncryptionSession to enable automatic recovery.");
13516
13468
  }
13517
13469
  if (typeof window !== 'undefined') {
13518
13470
  // Buffer Polyfill, needed for bundlers that don't provide Node polyfills (e.g CRA, Vite, etc.)
@@ -13561,9 +13513,8 @@ const OpenfortProvider = ({ children, uiConfig, onConnect, onDisconnect, debugMo
13561
13513
  injectedConnector === null || injectedConnector === void 0 ? void 0 : injectedConnector.connect();
13562
13514
  }
13563
13515
  }, [injectedConnector]);
13564
- const log = debugMode ? console.log : () => { };
13565
13516
  useEffect(() => {
13566
- log("ROUTE", route);
13517
+ logger.log("ROUTE", route);
13567
13518
  }, [route]);
13568
13519
  const value = {
13569
13520
  setTheme,
@@ -13584,16 +13535,16 @@ const OpenfortProvider = ({ children, uiConfig, onConnect, onDisconnect, debugMo
13584
13535
  uiConfig: safeUiConfig,
13585
13536
  errorMessage,
13586
13537
  debugMode,
13587
- log,
13538
+ log: logger.log,
13588
13539
  emailInput,
13589
13540
  setEmailInput,
13590
13541
  displayError: (message, code) => {
13591
13542
  setErrorMessage(message);
13592
- console.log('---------OPENFORT DEBUG---------');
13593
- console.log(message);
13543
+ logger.log('---------OPENFORT DEBUG---------');
13544
+ logger.log(message);
13594
13545
  if (code)
13595
13546
  console.table(code);
13596
- console.log('---------/OPENFORT DEBUG---------');
13547
+ logger.log('---------/OPENFORT DEBUG---------');
13597
13548
  },
13598
13549
  resize,
13599
13550
  triggerResize: () => onResize((prev) => prev + 1),
@@ -14184,58 +14135,66 @@ onClick, }) {
14184
14135
  OpenfortButton.Custom = ConnectButtonRenderer;
14185
14136
 
14186
14137
  /**
14187
- * Hook for accessing the currently active wallet
14138
+ * Hook for signing EIP-7702 wallet authorizations
14188
14139
  *
14189
- * This hook provides access to the user's currently active/connected wallet.
14190
- * It's a simplified interface that returns just the active wallet from the
14191
- * useWallets hook, making it convenient when you only need the current wallet
14192
- * without all the wallet management functionality.
14140
+ * This hook leverages the embedded Openfort client to sign authorization payloads prepared via viem.
14141
+ * It mirrors viem's `signAuthorization` behaviour while always returning the structured authorization object,
14142
+ * keeping private key management inside the Openfort SDK.
14193
14143
  *
14194
- * @returns Currently active wallet or undefined if no wallet is connected
14144
+ * @returns Helper with a `signAuthorization` function that signs authorizations with the active Openfort wallet
14195
14145
  *
14196
14146
  * @example
14197
- * ```tsx
14198
- * const activeWallet = useWallet();
14147
+ * ```ts
14148
+ * import { prepareAuthorization } from 'viem/actions';
14149
+ * import { use7702Authorization } from '@openfort/openfort-react';
14199
14150
  *
14200
- * // Check if user has an active wallet
14201
- * if (activeWallet) {
14202
- * console.log('Active wallet:', {
14203
- * address: activeWallet.address,
14204
- * type: activeWallet.connectorType,
14205
- * id: activeWallet.id,
14206
- * });
14207
- * } else {
14208
- * console.log('No active wallet');
14209
- * }
14151
+ * const { signAuthorization } = use7702Authorization();
14210
14152
  *
14211
- * // Access wallet properties
14212
- * const walletAddress = activeWallet?.address;
14213
- * const walletType = activeWallet?.connectorType;
14214
- * const isEmbedded = activeWallet?.connectorType === 'embedded';
14153
+ * const authorization = await prepareAuthorization(pimlicoClient, {
14154
+ * account: eoaAccount.address,
14155
+ * contractAddress: implementationAddress,
14156
+ * });
14215
14157
  *
14216
- * // Example usage in component
14217
- * return (
14218
- * <div>
14219
- * {activeWallet ? (
14220
- * <div>
14221
- * <h3>Connected Wallet</h3>
14222
- * <p>Address: {activeWallet.address}</p>
14223
- * <p>Type: {activeWallet.connectorType}</p>
14224
- * {activeWallet.isConnecting && <span>Connecting...</span>}
14225
- * </div>
14226
- * ) : (
14227
- * <div>
14228
- * <p>No wallet connected</p>
14229
- * <button>Connect Wallet</button>
14230
- * </div>
14231
- * )}
14232
- * </div>
14233
- * );
14158
+ * const signedAuthorization = await signAuthorization({
14159
+ * ...authorization,
14160
+ * });
14234
14161
  * ```
14235
14162
  */
14236
- function useWallet() {
14237
- const { activeWallet } = useWallets();
14238
- return activeWallet;
14163
+ function use7702Authorization() {
14164
+ const { client } = useOpenfortCore();
14165
+ const signAuthorization = useCallback(async (parameters, options = {
14166
+ hashMessage: false,
14167
+ arrayifyMessage: false,
14168
+ }) => {
14169
+ if (!client) {
14170
+ throw new OpenfortError('Openfort client is not initialized.', OpenfortErrorType.CONFIGURATION_ERROR);
14171
+ }
14172
+ const authorization = parameters;
14173
+ if (!authorization.contractAddress) {
14174
+ throw new OpenfortError('Authorization is missing the contract address to sign.', OpenfortErrorType.VALIDATION_ERROR);
14175
+ }
14176
+ const hash = hashAuthorization(authorization);
14177
+ try {
14178
+ const signature = await client.embeddedWallet.signMessage(hash, {
14179
+ hashMessage: options.hashMessage,
14180
+ arrayifyMessage: options.arrayifyMessage,
14181
+ });
14182
+ const { r, s, v, yParity } = parseSignature(signature);
14183
+ return {
14184
+ address: authorization.contractAddress,
14185
+ chainId: authorization.chainId,
14186
+ nonce: authorization.nonce,
14187
+ r,
14188
+ s,
14189
+ v,
14190
+ yParity,
14191
+ };
14192
+ }
14193
+ catch (error) {
14194
+ throw new OpenfortError('Failed to sign authorization.', OpenfortErrorType.WALLET_ERROR, { error });
14195
+ }
14196
+ }, [client]);
14197
+ return { signAuthorization };
14239
14198
  }
14240
14199
 
14241
14200
  /**
@@ -14526,7 +14485,7 @@ const useAuthCallback = ({ enabled = true, // Automatically handle OAuth and ema
14526
14485
  const state = url.searchParams.get("state");
14527
14486
  const email = url.searchParams.get("email");
14528
14487
  if (!state || !email) {
14529
- console.error("No state or email found in URL");
14488
+ logger.error("No state or email found in URL");
14530
14489
  onError({
14531
14490
  hookOptions,
14532
14491
  options: {},
@@ -14566,7 +14525,7 @@ const useAuthCallback = ({ enabled = true, // Automatically handle OAuth and ema
14566
14525
  const accessToken = url.searchParams.get("access_token");
14567
14526
  const refreshToken = url.searchParams.get("refresh_token");
14568
14527
  if (!player || !accessToken || !refreshToken) {
14569
- console.error(`Missing player id or access token or refresh token`, {
14528
+ logger.error(`Missing player id or access token or refresh token`, {
14570
14529
  player,
14571
14530
  accessToken: accessToken ? accessToken.substring(0, 10) + "..." : accessToken,
14572
14531
  refreshToken,
@@ -14882,7 +14841,7 @@ const useWalletAuth = (hookOptions = {}) => {
14882
14841
  resolve();
14883
14842
  },
14884
14843
  onError: (e) => {
14885
- console.error("Error disconnecting", e);
14844
+ logger.error("Error disconnecting", e);
14886
14845
  const error = new OpenfortError("Failed to disconnect", OpenfortErrorType.AUTHENTICATION_ERROR, { error: e });
14887
14846
  handleError(error);
14888
14847
  resolve();
@@ -14897,7 +14856,7 @@ const useWalletAuth = (hookOptions = {}) => {
14897
14856
  log("Connected to wallet!!!", connector.id);
14898
14857
  }
14899
14858
  catch (error) {
14900
- console.error("Error connecting", error);
14859
+ logger.error("Error connecting", error);
14901
14860
  handleError(new OpenfortError("Failed to connect", OpenfortErrorType.AUTHENTICATION_ERROR, { error }));
14902
14861
  }
14903
14862
  }, [siwe, disconnect, updateUser, availableWallets, log, setStatus, hookOptions]);
@@ -14912,5 +14871,5 @@ const useWalletAuth = (hookOptions = {}) => {
14912
14871
  };
14913
14872
  };
14914
14873
 
14915
- export { UIAuthProvider as AuthProvider, Avatar, Chain as ChainIcon, OPENFORT_VERSION, OpenfortButton, OpenfortError, OpenfortErrorType, OpenfortProvider, OpenfortStatus, embeddedWalletId, defaultConfig as getDefaultConfig, defaultConnectors as getDefaultConnectors, useAuthCallback, useChainIsSupported, useChains, useConnectWithSiwe, useEmailAuth, useGuestAuth, useOAuth, useOpenfortCore as useOpenfort, useSignOut, useStatus, useUI, useUser, useWallet, useWalletAuth, useWallets, wallets };
14874
+ export { UIAuthProvider as AuthProvider, Avatar, Chain as ChainIcon, OPENFORT_VERSION, OpenfortButton, OpenfortError, OpenfortErrorType, OpenfortProvider, embeddedWalletId, defaultConfig as getDefaultConfig, defaultConnectors as getDefaultConnectors, use7702Authorization, useAuthCallback, useChainIsSupported, useChains, useConnectWithSiwe, useEmailAuth, useGuestAuth, useOAuth, useOpenfortCore as useOpenfort, useSignOut, useUI, useUser, useWalletAuth, useWallets, wallets };
14916
14875
  //# sourceMappingURL=index.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.es.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,6 +1,7 @@
1
1
  import { AuthPlayerResponse, EmbeddedAccount, EmbeddedState, Openfort } from '@openfort/openfort-js';
2
2
  import React, { PropsWithChildren } from 'react';
3
3
  import { useConnectCallbackProps } from '../hooks/useConnectCallback';
4
+ import { WalletFlowStatus } from '../hooks/openfort/useWallets';
4
5
  export type ContextValue = {
5
6
  signUpGuest: () => Promise<void>;
6
7
  embeddedState: EmbeddedState;
@@ -11,6 +12,8 @@ export type ContextValue = {
11
12
  embeddedAccounts?: EmbeddedAccount[];
12
13
  isLoadingAccounts: boolean;
13
14
  logout: () => void;
15
+ walletStatus: WalletFlowStatus;
16
+ setWalletStatus: (status: WalletFlowStatus) => void;
14
17
  client: Openfort;
15
18
  };
16
19
  export type CoreOpenfortProviderProps = {
@@ -1 +1,3 @@
1
+ import { WalletFlowStatus } from '../hooks/openfort/useWallets';
1
2
  export declare const useOpenfortCore: () => import("./CoreOpenfortProvider").ContextValue;
3
+ export declare const useWalletStatus: () => [WalletFlowStatus, (status: WalletFlowStatus) => void];
@@ -0,0 +1,7 @@
1
+ export declare const logger: {
2
+ log: (...args: any[]) => void;
3
+ error: (...args: any[]) => void;
4
+ warn: (...args: any[]) => void;
5
+ info: (...args: any[]) => void;
6
+ debug: (...args: any[]) => void;
7
+ };
@@ -1 +1 @@
1
- export declare const OPENFORT_VERSION = "0.0.22";
1
+ export declare const OPENFORT_VERSION = "0.0.24";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openfort/react",
3
- "version": "0.0.22",
3
+ "version": "0.0.24",
4
4
  "author": "Openfort (https://www.openfort.io)",
5
5
  "license": "BSD-2-Clause license",
6
6
  "description": "The easiest way to integrate Openfort to your project.",
@@ -38,7 +38,7 @@
38
38
  "react"
39
39
  ],
40
40
  "dependencies": {
41
- "@openfort/openfort-js": "^0.10.24",
41
+ "@openfort/openfort-js": "^0.10.26",
42
42
  "buffer": "^6.0.3",
43
43
  "detect-browser": "^5.3.0",
44
44
  "fast-password-entropy": "^1.1.1",
@@ -1,55 +0,0 @@
1
- export declare enum OpenfortStatus {
2
- DISCONNECTED = 0,
3
- NEEDS_RECOVERY = 1,
4
- LOADING = 2,
5
- CONNECTED = 3
6
- }
7
- /**
8
- * Hook for monitoring Openfort connection and authentication status
9
- *
10
- * This hook provides real-time status information about the user's connection to Openfort
11
- * services and embedded wallet state. It tracks various states including loading, connected,
12
- * disconnected, and authentication status based on embedded wallet configuration and connection.
13
- *
14
- * @returns Current connection and authentication status flags
15
- *
16
- * @example
17
- * ```tsx
18
- * const status = useStatus();
19
- *
20
- * // Check connection states
21
- * if (status.isLoading) {
22
- * console.log('Initializing Openfort connection...');
23
- * } else if (status.isConnecting) {
24
- * console.log('Connecting to wallet...');
25
- * } else if (status.isConnected) {
26
- * console.log('Successfully connected to Openfort');
27
- * } else if (status.isDisconnected) {
28
- * console.log('Not connected to Openfort');
29
- * }
30
- *
31
- * // Check authentication state
32
- * if (status.isAuthenticated) {
33
- * console.log('User is authenticated');
34
- * // Show authenticated UI
35
- * } else {
36
- * console.log('User is not authenticated');
37
- * // Show login UI
38
- * }
39
- *
40
- * // Conditional rendering based on status
41
- * const renderContent = () => {
42
- * if (status.isLoading) return <LoadingSpinner />;
43
- * if (status.isConnecting) return <ConnectingIndicator />;
44
- * if (status.isConnected && status.isAuthenticated) return <AuthenticatedApp />;
45
- * return <LoginForm />;
46
- * };
47
- * ```
48
- */
49
- export declare function useStatus(): {
50
- isLoading: boolean;
51
- isConnected: boolean;
52
- isDisconnected: boolean;
53
- isConnecting: boolean;
54
- isAuthenticated: boolean;
55
- };
@@ -1,51 +0,0 @@
1
- /**
2
- * Hook for accessing the currently active wallet
3
- *
4
- * This hook provides access to the user's currently active/connected wallet.
5
- * It's a simplified interface that returns just the active wallet from the
6
- * useWallets hook, making it convenient when you only need the current wallet
7
- * without all the wallet management functionality.
8
- *
9
- * @returns Currently active wallet or undefined if no wallet is connected
10
- *
11
- * @example
12
- * ```tsx
13
- * const activeWallet = useWallet();
14
- *
15
- * // Check if user has an active wallet
16
- * if (activeWallet) {
17
- * console.log('Active wallet:', {
18
- * address: activeWallet.address,
19
- * type: activeWallet.connectorType,
20
- * id: activeWallet.id,
21
- * });
22
- * } else {
23
- * console.log('No active wallet');
24
- * }
25
- *
26
- * // Access wallet properties
27
- * const walletAddress = activeWallet?.address;
28
- * const walletType = activeWallet?.connectorType;
29
- * const isEmbedded = activeWallet?.connectorType === 'embedded';
30
- *
31
- * // Example usage in component
32
- * return (
33
- * <div>
34
- * {activeWallet ? (
35
- * <div>
36
- * <h3>Connected Wallet</h3>
37
- * <p>Address: {activeWallet.address}</p>
38
- * <p>Type: {activeWallet.connectorType}</p>
39
- * {activeWallet.isConnecting && <span>Connecting...</span>}
40
- * </div>
41
- * ) : (
42
- * <div>
43
- * <p>No wallet connected</p>
44
- * <button>Connect Wallet</button>
45
- * </div>
46
- * )}
47
- * </div>
48
- * );
49
- * ```
50
- */
51
- export declare function useWallet(): import("./useWallets").UserWallet | undefined;