@openfort/react 0.0.4 → 0.0.5
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/build/components/Openfort/OpenfortProvider.d.ts +4 -1
- package/build/components/Openfort/context.d.ts +3 -1
- package/build/components/Openfort/types.d.ts +7 -4
- package/build/hooks/openfort/auth/useSignOut.d.ts +1 -1
- package/build/hooks/openfort/useWallets.d.ts +9 -9
- package/build/index.d.ts +0 -1
- package/build/index.es.js +196 -174
- package/build/index.es.js.map +1 -1
- package/build/openfort/CoreOpenfortProvider.d.ts +1 -1
- package/build/openfort/core/client.d.ts +1 -1
- package/build/openfort/core/index.d.ts +0 -2
- package/build/types.d.ts +3 -1
- package/build/version.d.ts +1 -1
- package/package.json +2 -2
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { SDKOverrides, ThirdPartyAuthConfiguration } from '@openfort/openfort-js';
|
|
2
3
|
import { useConnectCallbackProps } from '../../hooks/useConnectCallback';
|
|
3
4
|
import { ContextValue } from './context';
|
|
4
5
|
import { ConnectUIOptions, OpenfortWalletConfig } from './types';
|
|
@@ -8,6 +9,8 @@ type OpenfortProviderProps = {
|
|
|
8
9
|
publishableKey: string;
|
|
9
10
|
uiConfig?: ConnectUIOptions;
|
|
10
11
|
walletConfig?: OpenfortWalletConfig;
|
|
12
|
+
overrides?: SDKOverrides;
|
|
13
|
+
thirdPartyAuth?: ThirdPartyAuthConfiguration;
|
|
11
14
|
} & useConnectCallbackProps;
|
|
12
15
|
/**
|
|
13
16
|
* OpenfortProvider component provides context and configuration for Openfort.
|
|
@@ -24,5 +27,5 @@ type OpenfortProviderProps = {
|
|
|
24
27
|
* @param {OpenfortOptions} [openfortOptions] - Options for Openfort integration.
|
|
25
28
|
* @throws Will throw an error if used outside of a WagmiProvider or if nested usages are detected.
|
|
26
29
|
*/
|
|
27
|
-
export declare const OpenfortProvider: ({ children, uiConfig, onConnect, onDisconnect, debugMode, publishableKey, walletConfig, }: OpenfortProviderProps) => React.FunctionComponentElement<React.ProviderProps<ContextValue | null>>;
|
|
30
|
+
export declare const OpenfortProvider: ({ children, uiConfig, onConnect, onDisconnect, debugMode, publishableKey, walletConfig, overrides, thirdPartyAuth, }: OpenfortProviderProps) => React.FunctionComponentElement<React.ProviderProps<ContextValue | null>>;
|
|
28
31
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { CustomTheme, Languages, Mode, Theme } from '../../types';
|
|
3
|
-
import { OAuthProvider } from '@openfort/openfort-js';
|
|
3
|
+
import { OAuthProvider, SDKOverrides, ThirdPartyAuthConfiguration } from '@openfort/openfort-js';
|
|
4
4
|
import { ValueOf } from 'viem/_types/types/utils';
|
|
5
5
|
import { useConnectCallbackProps } from '../../hooks/useConnectCallback';
|
|
6
6
|
import { OpenfortUIOptionsExtended, OpenfortWalletConfig, routes } from './types';
|
|
@@ -33,6 +33,8 @@ export type ContextValue = {
|
|
|
33
33
|
triggerResize: () => void;
|
|
34
34
|
uiConfig?: OpenfortUIOptionsExtended;
|
|
35
35
|
walletConfig?: OpenfortWalletConfig;
|
|
36
|
+
overrides?: SDKOverrides;
|
|
37
|
+
thirdPartyAuth?: ThirdPartyAuthConfiguration;
|
|
36
38
|
} & useConnectCallbackProps;
|
|
37
39
|
export declare const Openfortcontext: React.Context<ContextValue | null>;
|
|
38
40
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { ReactNode } from 'react';
|
|
2
2
|
import { CustomAvatarProps, CustomTheme, Languages, Mode, Theme } from '../../types';
|
|
3
|
-
import { RecoveryMethod } from '@openfort/openfort-js';
|
|
3
|
+
import { AccountTypeEnum, RecoveryMethod } from '@openfort/openfort-js';
|
|
4
4
|
import { CoreOpenfortProviderProps } from '../../openfort/CoreOpenfortProvider';
|
|
5
5
|
export declare const routes: {
|
|
6
6
|
readonly PROVIDERS: "providers";
|
|
@@ -35,6 +35,7 @@ type CommonWalletConfig = {
|
|
|
35
35
|
shieldPublishableKey: string;
|
|
36
36
|
/** Policy ID (pol_...) for the embedded signer */
|
|
37
37
|
ethereumProviderPolicyId?: string;
|
|
38
|
+
accountType?: AccountTypeEnum;
|
|
38
39
|
debug?: boolean;
|
|
39
40
|
};
|
|
40
41
|
type EncryptionSession = {
|
|
@@ -77,13 +78,15 @@ type PasswordRecoveryWalletConfig = {
|
|
|
77
78
|
* - `getEncryptionSession.` as a function that returns a promise.
|
|
78
79
|
*/
|
|
79
80
|
export type OpenfortWalletConfig = CommonWalletConfig & (AutomaticRecoveryWalletConfig | PasswordRecoveryWalletConfig);
|
|
80
|
-
export type
|
|
81
|
+
export type OpenfortUIOptions = {
|
|
81
82
|
linkWalletOnSignUp?: boolean;
|
|
82
83
|
authProviders?: AuthProvider[];
|
|
83
84
|
skipEmailVerification?: boolean;
|
|
84
85
|
termsOfServiceUrl?: string;
|
|
85
86
|
privacyPolicyUrl?: string;
|
|
86
87
|
logo?: React.ReactNode;
|
|
88
|
+
};
|
|
89
|
+
export type OpenfortSDKOptions = {
|
|
87
90
|
overrides?: CoreOpenfortProviderProps['overrides'];
|
|
88
91
|
};
|
|
89
92
|
export type ConnectUIOptions = {
|
|
@@ -106,7 +109,7 @@ export type ConnectUIOptions = {
|
|
|
106
109
|
initialChainId?: number;
|
|
107
110
|
enforceSupportedChains?: boolean;
|
|
108
111
|
overlayBlur?: number;
|
|
109
|
-
} &
|
|
112
|
+
} & OpenfortUIOptions;
|
|
110
113
|
export type OpenfortUIOptionsExtended = {
|
|
111
114
|
theme: Theme;
|
|
112
115
|
mode: Mode;
|
|
@@ -132,5 +135,5 @@ export type OpenfortUIOptionsExtended = {
|
|
|
132
135
|
walletOnboardingUrl?: string;
|
|
133
136
|
disableSiweRedirect?: boolean;
|
|
134
137
|
overlayBlur?: number;
|
|
135
|
-
} &
|
|
138
|
+
} & OpenfortUIOptions;
|
|
136
139
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { OpenfortHookOptions, OpenfortError } from '../../../types';
|
|
2
2
|
export declare function useSignOut(hookOptions?: OpenfortHookOptions): {
|
|
3
|
-
signOut: (options?: OpenfortHookOptions) => Promise<{}
|
|
3
|
+
signOut: (options?: OpenfortHookOptions) => Promise<{}>;
|
|
4
4
|
isLoading: boolean;
|
|
5
5
|
isError: boolean;
|
|
6
6
|
isSuccess: boolean;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AccountTypeEnum, RecoveryParams } from "@openfort/openfort-js";
|
|
2
2
|
import { Hex } from "viem";
|
|
3
3
|
import { Connector } from "wagmi";
|
|
4
4
|
import { embeddedWalletId } from "../../constants/openfort";
|
|
5
5
|
import { OpenfortError, OpenfortHookOptions } from "../../types";
|
|
6
6
|
export type UserWallet = {
|
|
7
|
-
address
|
|
7
|
+
address: Hex;
|
|
8
8
|
connectorType?: string;
|
|
9
9
|
walletClientType?: string;
|
|
10
10
|
connector?: Connector;
|
|
@@ -31,11 +31,12 @@ type SetActiveWalletOptions = ({
|
|
|
31
31
|
type CreateWalletResult = SetActiveWalletResult;
|
|
32
32
|
type CreateWalletOptions = {
|
|
33
33
|
password?: string;
|
|
34
|
+
accountType?: AccountTypeEnum;
|
|
34
35
|
} & OpenfortHookOptions<CreateWalletResult>;
|
|
35
36
|
type RecoverEmbeddedWalletResult = SetActiveWalletResult;
|
|
36
37
|
type SetRecoveryOptions = {
|
|
37
|
-
|
|
38
|
-
|
|
38
|
+
previousRecovery: RecoveryParams;
|
|
39
|
+
newRecovery: RecoveryParams;
|
|
39
40
|
} & OpenfortHookOptions<CreateWalletResult>;
|
|
40
41
|
type WalletOptions = OpenfortHookOptions<SetActiveWalletResult | CreateWalletResult>;
|
|
41
42
|
export declare function useWallets(hookOptions?: WalletOptions): {
|
|
@@ -45,15 +46,14 @@ export declare function useWallets(hookOptions?: WalletOptions): {
|
|
|
45
46
|
isSuccess: boolean;
|
|
46
47
|
isCreating: boolean;
|
|
47
48
|
isConnecting: boolean;
|
|
49
|
+
hasWallet: boolean;
|
|
50
|
+
isLoadingWallets: boolean;
|
|
48
51
|
wallets: UserWallet[];
|
|
49
52
|
availableWallets: import("../../wallets/useWallets").WalletProps[];
|
|
50
53
|
activeWallet: UserWallet | undefined;
|
|
51
54
|
setRecovery: (params: SetRecoveryOptions) => Promise<RecoverEmbeddedWalletResult>;
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
} | {
|
|
55
|
-
wallet: UserWallet;
|
|
56
|
-
}>;
|
|
55
|
+
reset: () => void;
|
|
56
|
+
createWallet: ({ password, ...options }?: CreateWalletOptions) => Promise<CreateWalletResult>;
|
|
57
57
|
setActiveWallet: (options: SetActiveWalletOptions | string) => Promise<SetActiveWalletResult>;
|
|
58
58
|
};
|
|
59
59
|
export {};
|
package/build/index.d.ts
CHANGED
|
@@ -4,7 +4,6 @@ export { default as getDefaultConfig } from './defaultConfig';
|
|
|
4
4
|
export { default as getDefaultConnectors } from './defaultConnectors';
|
|
5
5
|
export { wallets } from './wallets';
|
|
6
6
|
export { AuthProvider, } from './components/Openfort/types';
|
|
7
|
-
export { Openfortcontext, } from './components/Openfort/context';
|
|
8
7
|
export { OpenfortProvider, } from './components/Openfort/OpenfortProvider';
|
|
9
8
|
export { OpenfortButton } from './components/ConnectButton';
|
|
10
9
|
export { default as Avatar } from './components/Common/Avatar';
|
package/build/index.es.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
+
import { Openfort as Openfort$1, RecoveryMethod, EmbeddedState, AuthActionRequiredActions, OAuthProvider, MissingRecoveryPasswordError, AccountTypeEnum, ChainTypeEnum } from '@openfort/openfort-js';
|
|
2
|
+
export { RecoveryMethod, ThirdPartyOAuthProvider } from '@openfort/openfort-js';
|
|
1
3
|
import { http, useConfig, useConnectors as useConnectors$1, useConnect as useConnect$1, useAccount, useDisconnect, useSwitchChain, createConfig, useEnsAddress, useEnsName, useEnsAvatar, useBalance, useChainId, WagmiContext, useBlockNumber } from 'wagmi';
|
|
2
4
|
import { mainnet, polygon, optimism, arbitrum, sepolia } from 'wagmi/chains';
|
|
3
5
|
import { safe, injected, coinbaseWallet, walletConnect } from '@wagmi/connectors';
|
|
4
6
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
5
|
-
import React, {
|
|
7
|
+
import React, { useEffect, createContext, useState, useMemo, useRef, useCallback, createElement, useLayoutEffect } from 'react';
|
|
6
8
|
import { detect } from 'detect-browser';
|
|
7
9
|
import { Buffer } from 'buffer';
|
|
8
|
-
import { Openfort as Openfort$1, RecoveryMethod, EmbeddedState, AuthActionRequiredActions, OAuthProvider, ShieldAuthType, MissingRecoveryPasswordError, AccountTypeEnum, ChainTypeEnum } from '@openfort/openfort-js';
|
|
9
|
-
export { RecoveryMethod } from '@openfort/openfort-js';
|
|
10
10
|
import { polygonAmoy } from 'viem/chains';
|
|
11
11
|
import { motion, AnimatePresence, MotionConfig } from 'framer-motion';
|
|
12
12
|
import styled$1, { css, keyframes } from 'styled-components';
|
|
@@ -22,12 +22,13 @@ import { createSiweMessage } from 'viem/siwe';
|
|
|
22
22
|
import { signMessage } from '@wagmi/core';
|
|
23
23
|
import { useQuery, useQueryClient } from '@tanstack/react-query';
|
|
24
24
|
|
|
25
|
-
const OPENFORT_VERSION = '0.0.
|
|
25
|
+
const OPENFORT_VERSION = '0.0.5';
|
|
26
26
|
|
|
27
27
|
var OpenfortErrorType;
|
|
28
28
|
(function (OpenfortErrorType) {
|
|
29
29
|
OpenfortErrorType["AUTHENTICATION_ERROR"] = "AUTHENTICATION_ERROR";
|
|
30
30
|
OpenfortErrorType["WALLET_ERROR"] = "WALLET_ERROR";
|
|
31
|
+
OpenfortErrorType["CONFIGURATION_ERROR"] = "CONFIGURATION_ERROR";
|
|
31
32
|
})(OpenfortErrorType || (OpenfortErrorType = {}));
|
|
32
33
|
class OpenfortError extends Error {
|
|
33
34
|
constructor(message, type, data) {
|
|
@@ -788,8 +789,6 @@ const socialProviders = [
|
|
|
788
789
|
AuthProvider.FACEBOOK,
|
|
789
790
|
];
|
|
790
791
|
|
|
791
|
-
const Openfortcontext = createContext(null);
|
|
792
|
-
|
|
793
792
|
function useChainIsSupported(chainId) {
|
|
794
793
|
const { chains } = useConfig();
|
|
795
794
|
if (!chainId)
|
|
@@ -868,6 +867,8 @@ function useThemeFont(theme) {
|
|
|
868
867
|
useGoogleFont(font !== null && font !== void 0 ? font : '');
|
|
869
868
|
}
|
|
870
869
|
|
|
870
|
+
const Openfortcontext = createContext(null);
|
|
871
|
+
|
|
871
872
|
const useOpenfort = () => {
|
|
872
873
|
const context = React.useContext(Openfortcontext);
|
|
873
874
|
if (!context)
|
|
@@ -974,14 +975,8 @@ const useConnectCallback = ({ onConnect, onDisconnect, }) => {
|
|
|
974
975
|
*
|
|
975
976
|
* const token = await client.getAccessToken();
|
|
976
977
|
*/
|
|
977
|
-
function createOpenfortClient(
|
|
978
|
-
return new Openfort$1(
|
|
979
|
-
baseConfiguration,
|
|
980
|
-
overrides: {
|
|
981
|
-
...overrides,
|
|
982
|
-
},
|
|
983
|
-
shieldConfiguration
|
|
984
|
-
});
|
|
978
|
+
function createOpenfortClient(config) {
|
|
979
|
+
return new Openfort$1(config);
|
|
985
980
|
}
|
|
986
981
|
|
|
987
982
|
const ConnectCallback = ({ onConnect, onDisconnect }) => {
|
|
@@ -1001,7 +996,7 @@ const CoreOpenfortProvider = ({ children, debugMode, onConnect, onDisconnect, ..
|
|
|
1001
996
|
const automaticRecovery = walletConfig && walletConfig.recoveryMethod === RecoveryMethod.AUTOMATIC;
|
|
1002
997
|
// ---- Openfort instance ----
|
|
1003
998
|
const openfort = useMemo(() => {
|
|
1004
|
-
log('Creating Openfort instance.');
|
|
999
|
+
log('Creating Openfort instance.', openfortProps);
|
|
1005
1000
|
if (!openfortProps.baseConfiguration.publishableKey)
|
|
1006
1001
|
throw Error('CoreOpenfortProvider requires a publishableKey to be set in the baseConfiguration.');
|
|
1007
1002
|
const newClient = createOpenfortClient(openfortProps);
|
|
@@ -1054,6 +1049,7 @@ const CoreOpenfortProvider = ({ children, debugMode, onConnect, onDisconnect, ..
|
|
|
1054
1049
|
var _a, _b;
|
|
1055
1050
|
if (!openfort)
|
|
1056
1051
|
return null;
|
|
1052
|
+
log("Updating user", { user, logoutOnError });
|
|
1057
1053
|
if (user) {
|
|
1058
1054
|
setUser(user);
|
|
1059
1055
|
return user;
|
|
@@ -1113,11 +1109,20 @@ const CoreOpenfortProvider = ({ children, debugMode, onConnect, onDisconnect, ..
|
|
|
1113
1109
|
setIsConnectedWithEmbeddedSigner(false);
|
|
1114
1110
|
break;
|
|
1115
1111
|
case EmbeddedState.READY:
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1112
|
+
(async () => {
|
|
1113
|
+
for (let i = 0; i < 5; i++) {
|
|
1114
|
+
log("Trying to update user...", i);
|
|
1115
|
+
try {
|
|
1116
|
+
const user = await updateUser(undefined, true);
|
|
1117
|
+
if (user)
|
|
1118
|
+
break;
|
|
1119
|
+
}
|
|
1120
|
+
catch (err) {
|
|
1121
|
+
console.error("Error updating user, retrying...", err);
|
|
1122
|
+
}
|
|
1123
|
+
await new Promise((resolve) => setTimeout(resolve, 250));
|
|
1124
|
+
}
|
|
1125
|
+
})();
|
|
1121
1126
|
break;
|
|
1122
1127
|
default:
|
|
1123
1128
|
throw new Error(`Unknown embedded state: ${embeddedState}`);
|
|
@@ -9201,7 +9206,7 @@ var Wallet = ({ ...props }) => {
|
|
|
9201
9206
|
|
|
9202
9207
|
function useProviders() {
|
|
9203
9208
|
const { user } = useOpenfortCore();
|
|
9204
|
-
const { uiConfig: options } = useOpenfort();
|
|
9209
|
+
const { uiConfig: options, thirdPartyAuth, setOpen } = useOpenfort();
|
|
9205
9210
|
const allProviders = (options === null || options === void 0 ? void 0 : options.authProviders) || [];
|
|
9206
9211
|
const providers = allProviders.filter(p => p !== AuthProvider.GUEST) || [];
|
|
9207
9212
|
const linkedProviders = user ? providers.filter(p => { var _a; return (_a = user.linkedAccounts) === null || _a === void 0 ? void 0 : _a.find(a => a.provider === p); }) : [];
|
|
@@ -9213,6 +9218,12 @@ function useProviders() {
|
|
|
9213
9218
|
return !((_a = user.linkedAccounts) === null || _a === void 0 ? void 0 : _a.find(a => a.provider === provider));
|
|
9214
9219
|
})
|
|
9215
9220
|
: providers;
|
|
9221
|
+
useEffect(() => {
|
|
9222
|
+
if (thirdPartyAuth) {
|
|
9223
|
+
setOpen(false);
|
|
9224
|
+
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));
|
|
9225
|
+
}
|
|
9226
|
+
}, []);
|
|
9216
9227
|
return {
|
|
9217
9228
|
availableProviders,
|
|
9218
9229
|
linkedProviders,
|
|
@@ -10480,14 +10491,14 @@ const EmailLogin = () => {
|
|
|
10480
10491
|
setLoginLoading(false);
|
|
10481
10492
|
setLoginError("Invalid email or password.");
|
|
10482
10493
|
}).then((user) => {
|
|
10483
|
-
//
|
|
10494
|
+
// log("User", user);
|
|
10484
10495
|
if (!user) {
|
|
10485
10496
|
setLoginLoading(false);
|
|
10486
10497
|
setLoginError("Invalid email or password.");
|
|
10487
10498
|
return;
|
|
10488
10499
|
}
|
|
10489
10500
|
if ("action" in user && user.action === AuthActionRequiredActions.ACTION_VERIFY_EMAIL) {
|
|
10490
|
-
|
|
10501
|
+
log("User needs to verify email");
|
|
10491
10502
|
localStorage.setItem(emailToVerifyLocalStorageKey, email);
|
|
10492
10503
|
setRoute(routes.EMAIL_VERIFICATION);
|
|
10493
10504
|
}
|
|
@@ -10959,6 +10970,56 @@ const onError = ({ hookOptions, options, error, }) => {
|
|
|
10959
10970
|
return { error };
|
|
10960
10971
|
};
|
|
10961
10972
|
|
|
10973
|
+
var OpenfortStatus;
|
|
10974
|
+
(function (OpenfortStatus) {
|
|
10975
|
+
OpenfortStatus[OpenfortStatus["DISCONNECTED"] = 0] = "DISCONNECTED";
|
|
10976
|
+
OpenfortStatus[OpenfortStatus["NEEDS_RECOVERY"] = 1] = "NEEDS_RECOVERY";
|
|
10977
|
+
OpenfortStatus[OpenfortStatus["LOADING"] = 2] = "LOADING";
|
|
10978
|
+
OpenfortStatus[OpenfortStatus["CONNECTED"] = 3] = "CONNECTED";
|
|
10979
|
+
})(OpenfortStatus || (OpenfortStatus = {}));
|
|
10980
|
+
function useStatus() {
|
|
10981
|
+
const { embeddedState } = useOpenfortCore();
|
|
10982
|
+
const { isConnected, isConnecting } = useAccount();
|
|
10983
|
+
const getStatus = () => {
|
|
10984
|
+
if (embeddedState === EmbeddedState.READY)
|
|
10985
|
+
return OpenfortStatus.CONNECTED;
|
|
10986
|
+
if (embeddedState === EmbeddedState.NONE)
|
|
10987
|
+
return OpenfortStatus.LOADING;
|
|
10988
|
+
// if (needsRecovery) return OpenfortStatus.NEEDS_RECOVERY;
|
|
10989
|
+
if (embeddedState === EmbeddedState.EMBEDDED_SIGNER_NOT_CONFIGURED) {
|
|
10990
|
+
if (isConnected)
|
|
10991
|
+
return OpenfortStatus.CONNECTED;
|
|
10992
|
+
else
|
|
10993
|
+
return OpenfortStatus.NEEDS_RECOVERY;
|
|
10994
|
+
}
|
|
10995
|
+
return OpenfortStatus.DISCONNECTED;
|
|
10996
|
+
};
|
|
10997
|
+
const status = getStatus();
|
|
10998
|
+
return {
|
|
10999
|
+
isLoading: status === OpenfortStatus.LOADING,
|
|
11000
|
+
isConnected: status === OpenfortStatus.CONNECTED,
|
|
11001
|
+
isDisconnected: status === OpenfortStatus.DISCONNECTED,
|
|
11002
|
+
isConnecting: isConnecting || embeddedState === EmbeddedState.CREATING_ACCOUNT,
|
|
11003
|
+
isAuthenticated: embeddedState !== EmbeddedState.NONE && embeddedState !== EmbeddedState.UNAUTHENTICATED,
|
|
11004
|
+
};
|
|
11005
|
+
}
|
|
11006
|
+
|
|
11007
|
+
function useUser() {
|
|
11008
|
+
const { user, client } = useOpenfortCore();
|
|
11009
|
+
const { isAuthenticated } = useStatus();
|
|
11010
|
+
const getAccessTokenAndUpdate = useCallback(async () => {
|
|
11011
|
+
await client.validateAndRefreshToken();
|
|
11012
|
+
const token = await client.getAccessToken();
|
|
11013
|
+
return token;
|
|
11014
|
+
}, [client]);
|
|
11015
|
+
return {
|
|
11016
|
+
user,
|
|
11017
|
+
isAuthenticated,
|
|
11018
|
+
getAccessToken: getAccessTokenAndUpdate,
|
|
11019
|
+
validateAndRefreshToken: async () => await client.validateAndRefreshToken(),
|
|
11020
|
+
};
|
|
11021
|
+
}
|
|
11022
|
+
|
|
10962
11023
|
const createOpenfortWallet = ({ address, }) => ({
|
|
10963
11024
|
connectorType: "embedded",
|
|
10964
11025
|
walletClientType: "openfort",
|
|
@@ -10976,7 +11037,8 @@ const mapWalletStatus = (status) => {
|
|
|
10976
11037
|
};
|
|
10977
11038
|
};
|
|
10978
11039
|
function useWallets(hookOptions = {}) {
|
|
10979
|
-
const {
|
|
11040
|
+
const { client } = useOpenfortCore();
|
|
11041
|
+
const { user } = useUser();
|
|
10980
11042
|
const { walletConfig, log, setOpen, setRoute, setConnector, uiConfig } = useOpenfort();
|
|
10981
11043
|
const { connector, isConnected, address } = useAccount();
|
|
10982
11044
|
const chainId = useChainId();
|
|
@@ -11017,14 +11079,16 @@ function useWallets(hookOptions = {}) {
|
|
|
11017
11079
|
}
|
|
11018
11080
|
}
|
|
11019
11081
|
});
|
|
11020
|
-
|
|
11082
|
+
// will reset on logout
|
|
11083
|
+
const { data: embeddedWallets, refetch, isPending: isLoadingWallets } = useQuery({
|
|
11021
11084
|
queryKey: ['openfortEmbeddedWalletList'],
|
|
11022
|
-
queryFn: () =>
|
|
11085
|
+
queryFn: () => client.embeddedWallet.list(),
|
|
11086
|
+
refetchOnMount: false,
|
|
11087
|
+
refetchOnWindowFocus: false,
|
|
11023
11088
|
});
|
|
11024
|
-
useEffect(() => {
|
|
11025
|
-
|
|
11026
|
-
|
|
11027
|
-
}, [!!user, refetch]);
|
|
11089
|
+
// useEffect(() => {
|
|
11090
|
+
// queryClient.resetQueries({ queryKey: ['openfortEmbeddedWalletList'] })
|
|
11091
|
+
// }, [!!user, refetch]);
|
|
11028
11092
|
const getEncryptionSession = useCallback(async () => {
|
|
11029
11093
|
if (!walletConfig || !walletConfig.createEncryptedSessionEndpoint) {
|
|
11030
11094
|
throw new Error("No createEncryptedSessionEndpoint set in walletConfig");
|
|
@@ -11065,9 +11129,8 @@ function useWallets(hookOptions = {}) {
|
|
|
11065
11129
|
return userWallets;
|
|
11066
11130
|
}, [user === null || user === void 0 ? void 0 : user.linkedAccounts, embeddedWallets]);
|
|
11067
11131
|
const wallets = useMemo(() => {
|
|
11068
|
-
if (!isConnected || !address)
|
|
11069
|
-
|
|
11070
|
-
console.log("Mapping wallets", { rawWallets, status, address, isConnected, connector });
|
|
11132
|
+
// if (!isConnected || !address) return rawWallets;
|
|
11133
|
+
log("Mapping wallets", { rawWallets, status, address, isConnected, connector });
|
|
11071
11134
|
return rawWallets.map((w) => ({
|
|
11072
11135
|
...w,
|
|
11073
11136
|
isConnecting: status.status === 'connecting' && status.address === w.address,
|
|
@@ -11148,34 +11211,22 @@ function useWallets(hookOptions = {}) {
|
|
|
11148
11211
|
}
|
|
11149
11212
|
log(`Handling recovery with Openfort: ${password ? "with password" : "without password"}, chainId=${chainId}`);
|
|
11150
11213
|
try {
|
|
11151
|
-
const accessToken = await client.getAccessToken();
|
|
11152
|
-
if (!accessToken) {
|
|
11153
|
-
throw new Error("Openfort access token not found");
|
|
11154
|
-
}
|
|
11155
|
-
log("Access token");
|
|
11156
|
-
const shieldAuthentication = password ? {
|
|
11157
|
-
auth: ShieldAuthType.OPENFORT,
|
|
11158
|
-
token: accessToken,
|
|
11159
|
-
} : {
|
|
11160
|
-
auth: ShieldAuthType.OPENFORT,
|
|
11161
|
-
token: accessToken,
|
|
11162
|
-
encryptionSession: walletConfig.getEncryptionSession ?
|
|
11163
|
-
await walletConfig.getEncryptionSession() :
|
|
11164
|
-
await getEncryptionSession(),
|
|
11165
|
-
};
|
|
11166
|
-
log("Shield authentication");
|
|
11167
11214
|
const recoveryParams = password ? {
|
|
11168
11215
|
recoveryMethod: RecoveryMethod.PASSWORD,
|
|
11169
11216
|
password,
|
|
11170
11217
|
} : {
|
|
11171
11218
|
recoveryMethod: RecoveryMethod.AUTOMATIC,
|
|
11219
|
+
encryptionSession: walletConfig.getEncryptionSession ?
|
|
11220
|
+
await walletConfig.getEncryptionSession() :
|
|
11221
|
+
await getEncryptionSession()
|
|
11172
11222
|
};
|
|
11173
11223
|
// Ensure that the embedded wallet is listed
|
|
11174
11224
|
const embeddedWallets = await client.embeddedWallet.list();
|
|
11175
11225
|
log("Recovery params", optionsObject.address);
|
|
11176
11226
|
log("Embedded wallets", embeddedWallets, chainId);
|
|
11177
|
-
|
|
11178
|
-
|
|
11227
|
+
let walletAddress = optionsObject.address;
|
|
11228
|
+
if (walletAddress) {
|
|
11229
|
+
const walletId = (_a = embeddedWallets === null || embeddedWallets === void 0 ? void 0 : embeddedWallets.find((w) => w.address === walletAddress && w.chainId === chainId)) === null || _a === void 0 ? void 0 : _a.id;
|
|
11179
11230
|
if (!walletId) {
|
|
11180
11231
|
return onError({
|
|
11181
11232
|
error: new OpenfortError("Embedded wallet not found for address", OpenfortErrorType.WALLET_ERROR),
|
|
@@ -11185,23 +11236,27 @@ function useWallets(hookOptions = {}) {
|
|
|
11185
11236
|
}
|
|
11186
11237
|
await client.embeddedWallet.recover({
|
|
11187
11238
|
account: walletId,
|
|
11188
|
-
shieldAuthentication,
|
|
11189
11239
|
recoveryParams,
|
|
11190
11240
|
});
|
|
11191
11241
|
}
|
|
11192
11242
|
else {
|
|
11193
11243
|
// Check if the embedded wallet is already created in the current chain
|
|
11194
11244
|
if (embeddedWallets.some((w) => w.chainId === chainId)) {
|
|
11245
|
+
const walletToRecover = embeddedWallets.find((w) => w.chainId === chainId);
|
|
11195
11246
|
await client.embeddedWallet.recover({
|
|
11196
|
-
account:
|
|
11197
|
-
shieldAuthentication,
|
|
11247
|
+
account: walletToRecover.id,
|
|
11198
11248
|
recoveryParams,
|
|
11199
11249
|
});
|
|
11250
|
+
walletAddress = walletToRecover.address;
|
|
11200
11251
|
}
|
|
11201
11252
|
else {
|
|
11202
|
-
await createWallet({
|
|
11253
|
+
const wallet = await createWallet({
|
|
11203
11254
|
password,
|
|
11204
11255
|
});
|
|
11256
|
+
if (!wallet.wallet) {
|
|
11257
|
+
return { error: wallet.error || new OpenfortError("Failed to create embedded wallet", OpenfortErrorType.WALLET_ERROR) };
|
|
11258
|
+
}
|
|
11259
|
+
walletAddress = wallet.wallet.address;
|
|
11205
11260
|
}
|
|
11206
11261
|
}
|
|
11207
11262
|
setStatus({
|
|
@@ -11210,7 +11265,7 @@ function useWallets(hookOptions = {}) {
|
|
|
11210
11265
|
return onSuccess({
|
|
11211
11266
|
data: {
|
|
11212
11267
|
wallet: createOpenfortWallet({
|
|
11213
|
-
address:
|
|
11268
|
+
address: walletAddress,
|
|
11214
11269
|
}),
|
|
11215
11270
|
},
|
|
11216
11271
|
options: optionsObject,
|
|
@@ -11220,25 +11275,36 @@ function useWallets(hookOptions = {}) {
|
|
|
11220
11275
|
catch (err) {
|
|
11221
11276
|
log('Error handling recovery with Openfort:', err);
|
|
11222
11277
|
if (err instanceof MissingRecoveryPasswordError) {
|
|
11278
|
+
const error = new OpenfortError("Missing recovery password", OpenfortErrorType.WALLET_ERROR);
|
|
11279
|
+
setStatus({
|
|
11280
|
+
status: 'error',
|
|
11281
|
+
error,
|
|
11282
|
+
});
|
|
11223
11283
|
return onError({
|
|
11224
|
-
error
|
|
11284
|
+
error,
|
|
11225
11285
|
options: optionsObject,
|
|
11226
11286
|
hookOptions
|
|
11227
11287
|
});
|
|
11228
11288
|
}
|
|
11229
11289
|
if (typeof err === 'string') {
|
|
11290
|
+
const error = new OpenfortError(err, OpenfortErrorType.WALLET_ERROR);
|
|
11291
|
+
setStatus({
|
|
11292
|
+
status: 'error',
|
|
11293
|
+
error,
|
|
11294
|
+
});
|
|
11230
11295
|
return onError({
|
|
11231
|
-
error
|
|
11296
|
+
error,
|
|
11232
11297
|
options: optionsObject,
|
|
11233
11298
|
hookOptions
|
|
11234
11299
|
});
|
|
11235
11300
|
}
|
|
11236
|
-
|
|
11237
|
-
|
|
11238
|
-
|
|
11239
|
-
|
|
11301
|
+
const error = new OpenfortError("The recovery phrase you entered is incorrect.", OpenfortErrorType.WALLET_ERROR);
|
|
11302
|
+
setStatus({
|
|
11303
|
+
status: 'error',
|
|
11304
|
+
error,
|
|
11305
|
+
});
|
|
11240
11306
|
return onError({
|
|
11241
|
-
error
|
|
11307
|
+
error,
|
|
11242
11308
|
options: optionsObject,
|
|
11243
11309
|
hookOptions
|
|
11244
11310
|
});
|
|
@@ -11262,52 +11328,62 @@ function useWallets(hookOptions = {}) {
|
|
|
11262
11328
|
status: 'creating',
|
|
11263
11329
|
});
|
|
11264
11330
|
log("Creating wallet", { password: !!password, options });
|
|
11265
|
-
|
|
11266
|
-
|
|
11267
|
-
|
|
11268
|
-
|
|
11269
|
-
|
|
11270
|
-
|
|
11331
|
+
try {
|
|
11332
|
+
const accessToken = await client.getAccessToken();
|
|
11333
|
+
if (!accessToken) {
|
|
11334
|
+
return onError({
|
|
11335
|
+
error: new OpenfortError("Openfort access token not found", OpenfortErrorType.WALLET_ERROR),
|
|
11336
|
+
hookOptions,
|
|
11337
|
+
options,
|
|
11338
|
+
});
|
|
11339
|
+
}
|
|
11340
|
+
if (!walletConfig) {
|
|
11341
|
+
return onError({
|
|
11342
|
+
error: new OpenfortError("Embedded signer not enabled", OpenfortErrorType.WALLET_ERROR),
|
|
11343
|
+
hookOptions,
|
|
11344
|
+
options,
|
|
11345
|
+
});
|
|
11346
|
+
}
|
|
11347
|
+
const recoveryParams = password ? {
|
|
11348
|
+
recoveryMethod: RecoveryMethod.PASSWORD,
|
|
11349
|
+
password,
|
|
11350
|
+
} : {
|
|
11351
|
+
recoveryMethod: RecoveryMethod.AUTOMATIC,
|
|
11352
|
+
encryptionSession: walletConfig.getEncryptionSession ?
|
|
11353
|
+
await walletConfig.getEncryptionSession() :
|
|
11354
|
+
await getEncryptionSession()
|
|
11355
|
+
};
|
|
11356
|
+
const wallet = await client.embeddedWallet.create({
|
|
11357
|
+
chainId: (_a = uiConfig === null || uiConfig === void 0 ? void 0 : uiConfig.initialChainId) !== null && _a !== void 0 ? _a : chainId,
|
|
11358
|
+
accountType: (options === null || options === void 0 ? void 0 : options.accountType) || (walletConfig === null || walletConfig === void 0 ? void 0 : walletConfig.accountType) || AccountTypeEnum.SMART_ACCOUNT,
|
|
11359
|
+
chainType: ChainTypeEnum.EVM,
|
|
11360
|
+
recoveryParams,
|
|
11361
|
+
});
|
|
11362
|
+
setStatus({
|
|
11363
|
+
status: 'success',
|
|
11364
|
+
});
|
|
11365
|
+
refetch();
|
|
11366
|
+
return onSuccess({
|
|
11367
|
+
data: {
|
|
11368
|
+
wallet: createOpenfortWallet({
|
|
11369
|
+
address: wallet.address,
|
|
11370
|
+
})
|
|
11371
|
+
}
|
|
11271
11372
|
});
|
|
11272
11373
|
}
|
|
11273
|
-
|
|
11374
|
+
catch (e) {
|
|
11375
|
+
const errorObj = e instanceof Error ? e : new Error('Failed to create wallet');
|
|
11376
|
+
const error = new OpenfortError('Failed to create wallet', OpenfortErrorType.WALLET_ERROR, { error: errorObj });
|
|
11377
|
+
setStatus({
|
|
11378
|
+
status: 'error',
|
|
11379
|
+
error,
|
|
11380
|
+
});
|
|
11274
11381
|
return onError({
|
|
11275
|
-
error
|
|
11382
|
+
error,
|
|
11276
11383
|
hookOptions,
|
|
11277
11384
|
options,
|
|
11278
11385
|
});
|
|
11279
11386
|
}
|
|
11280
|
-
const shieldAuthentication = {
|
|
11281
|
-
auth: ShieldAuthType.OPENFORT,
|
|
11282
|
-
token: accessToken,
|
|
11283
|
-
encryptionSession: walletConfig.getEncryptionSession ?
|
|
11284
|
-
await walletConfig.getEncryptionSession() :
|
|
11285
|
-
await getEncryptionSession(),
|
|
11286
|
-
};
|
|
11287
|
-
const recoveryParams = password ? {
|
|
11288
|
-
recoveryMethod: RecoveryMethod.PASSWORD,
|
|
11289
|
-
password,
|
|
11290
|
-
} : {
|
|
11291
|
-
recoveryMethod: RecoveryMethod.AUTOMATIC,
|
|
11292
|
-
};
|
|
11293
|
-
const wallet = await client.embeddedWallet.create({
|
|
11294
|
-
chainId: (_a = uiConfig === null || uiConfig === void 0 ? void 0 : uiConfig.initialChainId) !== null && _a !== void 0 ? _a : chainId,
|
|
11295
|
-
accountType: AccountTypeEnum.SMART_ACCOUNT,
|
|
11296
|
-
chainType: ChainTypeEnum.EVM,
|
|
11297
|
-
recoveryParams,
|
|
11298
|
-
shieldAuthentication
|
|
11299
|
-
});
|
|
11300
|
-
setStatus({
|
|
11301
|
-
status: 'success',
|
|
11302
|
-
});
|
|
11303
|
-
refetch();
|
|
11304
|
-
return onSuccess({
|
|
11305
|
-
data: {
|
|
11306
|
-
wallet: createOpenfortWallet({
|
|
11307
|
-
address: wallet.address,
|
|
11308
|
-
})
|
|
11309
|
-
}
|
|
11310
|
-
});
|
|
11311
11387
|
}, [refetch, client, uiConfig, chainId]);
|
|
11312
11388
|
const setRecovery = useCallback(async (params) => {
|
|
11313
11389
|
try {
|
|
@@ -11315,17 +11391,7 @@ function useWallets(hookOptions = {}) {
|
|
|
11315
11391
|
status: 'loading',
|
|
11316
11392
|
});
|
|
11317
11393
|
// Set embedded wallet recovery method
|
|
11318
|
-
|
|
11319
|
-
await client.embeddedWallet.setEmbeddedRecovery({
|
|
11320
|
-
recoveryMethod: RecoveryMethod.PASSWORD,
|
|
11321
|
-
recoveryPassword: params.recoveryPassword
|
|
11322
|
-
});
|
|
11323
|
-
}
|
|
11324
|
-
else {
|
|
11325
|
-
await client.embeddedWallet.setEmbeddedRecovery({
|
|
11326
|
-
recoveryMethod: RecoveryMethod.AUTOMATIC
|
|
11327
|
-
});
|
|
11328
|
-
}
|
|
11394
|
+
await client.embeddedWallet.setRecoveryMethod(params.previousRecovery, params.newRecovery);
|
|
11329
11395
|
// Get the updated embedded account
|
|
11330
11396
|
const embeddedAccount = await client.embeddedWallet.get();
|
|
11331
11397
|
setStatus({ status: 'success' });
|
|
@@ -11349,10 +11415,13 @@ function useWallets(hookOptions = {}) {
|
|
|
11349
11415
|
}
|
|
11350
11416
|
}, [client, setStatus, hookOptions]);
|
|
11351
11417
|
return {
|
|
11418
|
+
hasWallet: wallets.length > 0,
|
|
11419
|
+
isLoadingWallets,
|
|
11352
11420
|
wallets,
|
|
11353
11421
|
availableWallets: deviceWallets,
|
|
11354
11422
|
activeWallet,
|
|
11355
11423
|
setRecovery,
|
|
11424
|
+
reset: () => setStatus({ status: 'idle' }),
|
|
11356
11425
|
createWallet,
|
|
11357
11426
|
setActiveWallet,
|
|
11358
11427
|
...mapWalletStatus(status),
|
|
@@ -11623,8 +11692,8 @@ const ConnectModal = ({ mode = 'auto', theme = 'auto', customTheme = customTheme
|
|
|
11623
11692
|
* @param {OpenfortOptions} [openfortOptions] - Options for Openfort integration.
|
|
11624
11693
|
* @throws Will throw an error if used outside of a WagmiProvider or if nested usages are detected.
|
|
11625
11694
|
*/
|
|
11626
|
-
const OpenfortProvider = ({ children, uiConfig, onConnect, onDisconnect, debugMode = false, publishableKey, walletConfig, }) => {
|
|
11627
|
-
var _a, _b, _c, _d, _e, _f, _g, _h
|
|
11695
|
+
const OpenfortProvider = ({ children, uiConfig, onConnect, onDisconnect, debugMode = false, publishableKey, walletConfig, overrides, thirdPartyAuth, }) => {
|
|
11696
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
11628
11697
|
// OpenfortProvider must be within a WagmiProvider
|
|
11629
11698
|
if (!React.useContext(WagmiContext)) {
|
|
11630
11699
|
throw Error('OpenfortProvider must be within a WagmiProvider');
|
|
@@ -11664,7 +11733,7 @@ const OpenfortProvider = ({ children, uiConfig, onConnect, onDisconnect, debugMo
|
|
|
11664
11733
|
authProviders: [],
|
|
11665
11734
|
};
|
|
11666
11735
|
const opts = Object.assign({}, defaultOptions, uiConfig);
|
|
11667
|
-
if (
|
|
11736
|
+
if (!opts.authProviders || opts.authProviders.length === 0) {
|
|
11668
11737
|
opts.authProviders = [
|
|
11669
11738
|
AuthProvider.GUEST,
|
|
11670
11739
|
AuthProvider.EMAIL,
|
|
@@ -11674,7 +11743,7 @@ const OpenfortProvider = ({ children, uiConfig, onConnect, onDisconnect, debugMo
|
|
|
11674
11743
|
if (typeof window !== 'undefined') {
|
|
11675
11744
|
// Buffer Polyfill, needed for bundlers that don't provide Node polyfills (e.g CRA, Vite, etc.)
|
|
11676
11745
|
if (opts.bufferPolyfill)
|
|
11677
|
-
window.Buffer = (
|
|
11746
|
+
window.Buffer = (_b = window.Buffer) !== null && _b !== void 0 ? _b : Buffer;
|
|
11678
11747
|
// Some bundlers may need `global` and `process.env` polyfills as well
|
|
11679
11748
|
// Not implemented here to avoid unexpected behaviors, but leaving example here for future reference
|
|
11680
11749
|
/*
|
|
@@ -11682,9 +11751,9 @@ const OpenfortProvider = ({ children, uiConfig, onConnect, onDisconnect, debugMo
|
|
|
11682
11751
|
* window.process = window.process ?? { env: {} };
|
|
11683
11752
|
*/
|
|
11684
11753
|
}
|
|
11685
|
-
const [ckTheme, setTheme] = useState((
|
|
11686
|
-
const [ckMode, setMode] = useState((
|
|
11687
|
-
const [ckCustomTheme, setCustomTheme] = useState((
|
|
11754
|
+
const [ckTheme, setTheme] = useState((_d = (_c = uiConfig === null || uiConfig === void 0 ? void 0 : uiConfig.theme) !== null && _c !== void 0 ? _c : defaultOptions.theme) !== null && _d !== void 0 ? _d : "auto");
|
|
11755
|
+
const [ckMode, setMode] = useState((_f = (_e = uiConfig === null || uiConfig === void 0 ? void 0 : uiConfig.mode) !== null && _e !== void 0 ? _e : defaultOptions.mode) !== null && _f !== void 0 ? _f : 'auto');
|
|
11756
|
+
const [ckCustomTheme, setCustomTheme] = useState((_g = uiConfig === null || uiConfig === void 0 ? void 0 : uiConfig.customTheme) !== null && _g !== void 0 ? _g : {});
|
|
11688
11757
|
const [ckLang, setLang] = useState('en-US');
|
|
11689
11758
|
const [open, setOpen] = useState(false);
|
|
11690
11759
|
const [connector, setConnector] = useState({
|
|
@@ -11733,6 +11802,7 @@ const OpenfortProvider = ({ children, uiConfig, onConnect, onDisconnect, debugMo
|
|
|
11733
11802
|
connector,
|
|
11734
11803
|
setConnector,
|
|
11735
11804
|
onConnect,
|
|
11805
|
+
onDisconnect,
|
|
11736
11806
|
// Other configuration
|
|
11737
11807
|
uiConfig: opts,
|
|
11738
11808
|
errorMessage,
|
|
@@ -11749,6 +11819,8 @@ const OpenfortProvider = ({ children, uiConfig, onConnect, onDisconnect, debugMo
|
|
|
11749
11819
|
resize,
|
|
11750
11820
|
triggerResize: () => onResize((prev) => prev + 1),
|
|
11751
11821
|
walletConfig,
|
|
11822
|
+
overrides,
|
|
11823
|
+
thirdPartyAuth,
|
|
11752
11824
|
};
|
|
11753
11825
|
return createElement(Openfortcontext.Provider, { value }, jsx(Fragment, { children: jsx(Web3ContextProvider, { enabled: open, children: jsxs(CoreOpenfortProvider, { baseConfiguration: {
|
|
11754
11826
|
publishableKey,
|
|
@@ -11756,7 +11828,7 @@ const OpenfortProvider = ({ children, uiConfig, onConnect, onDisconnect, debugMo
|
|
|
11756
11828
|
shieldPublishableKey: walletConfig.shieldPublishableKey,
|
|
11757
11829
|
shieldEncryptionKey: walletConfig.recoveryMethod === RecoveryMethod.PASSWORD ? walletConfig.shieldEncryptionKey : undefined,
|
|
11758
11830
|
debug: debugMode,
|
|
11759
|
-
} : undefined, overrides:
|
|
11831
|
+
} : undefined, overrides: overrides, thirdPartyAuth: thirdPartyAuth, debugMode: debugMode, onConnect: onConnect, onDisconnect: onDisconnect, children: [children, jsx(ConnectModal, { lang: ckLang, theme: ckTheme, mode: (_h = uiConfig === null || uiConfig === void 0 ? void 0 : uiConfig.mode) !== null && _h !== void 0 ? _h : ckMode, customTheme: ckCustomTheme })] }) }) }));
|
|
11760
11832
|
};
|
|
11761
11833
|
|
|
11762
11834
|
const Container$1 = styled(motion.div) `
|
|
@@ -12270,56 +12342,6 @@ onClick, }) {
|
|
|
12270
12342
|
}
|
|
12271
12343
|
OpenfortButton.Custom = ConnectButtonRenderer;
|
|
12272
12344
|
|
|
12273
|
-
var OpenfortStatus;
|
|
12274
|
-
(function (OpenfortStatus) {
|
|
12275
|
-
OpenfortStatus[OpenfortStatus["DISCONNECTED"] = 0] = "DISCONNECTED";
|
|
12276
|
-
OpenfortStatus[OpenfortStatus["NEEDS_RECOVERY"] = 1] = "NEEDS_RECOVERY";
|
|
12277
|
-
OpenfortStatus[OpenfortStatus["LOADING"] = 2] = "LOADING";
|
|
12278
|
-
OpenfortStatus[OpenfortStatus["CONNECTED"] = 3] = "CONNECTED";
|
|
12279
|
-
})(OpenfortStatus || (OpenfortStatus = {}));
|
|
12280
|
-
function useStatus() {
|
|
12281
|
-
const { embeddedState } = useOpenfortCore();
|
|
12282
|
-
const { isConnected, isConnecting } = useAccount();
|
|
12283
|
-
const getStatus = () => {
|
|
12284
|
-
if (embeddedState === EmbeddedState.READY)
|
|
12285
|
-
return OpenfortStatus.CONNECTED;
|
|
12286
|
-
if (embeddedState === EmbeddedState.NONE)
|
|
12287
|
-
return OpenfortStatus.LOADING;
|
|
12288
|
-
// if (needsRecovery) return OpenfortStatus.NEEDS_RECOVERY;
|
|
12289
|
-
if (embeddedState === EmbeddedState.EMBEDDED_SIGNER_NOT_CONFIGURED) {
|
|
12290
|
-
if (isConnected)
|
|
12291
|
-
return OpenfortStatus.CONNECTED;
|
|
12292
|
-
else
|
|
12293
|
-
return OpenfortStatus.NEEDS_RECOVERY;
|
|
12294
|
-
}
|
|
12295
|
-
return OpenfortStatus.DISCONNECTED;
|
|
12296
|
-
};
|
|
12297
|
-
const status = getStatus();
|
|
12298
|
-
return {
|
|
12299
|
-
isLoading: status === OpenfortStatus.LOADING,
|
|
12300
|
-
isConnected: status === OpenfortStatus.CONNECTED,
|
|
12301
|
-
isDisconnected: status === OpenfortStatus.DISCONNECTED,
|
|
12302
|
-
isConnecting: isConnecting || embeddedState === EmbeddedState.CREATING_ACCOUNT,
|
|
12303
|
-
isAuthenticated: embeddedState !== EmbeddedState.NONE && embeddedState !== EmbeddedState.UNAUTHENTICATED,
|
|
12304
|
-
};
|
|
12305
|
-
}
|
|
12306
|
-
|
|
12307
|
-
function useUser() {
|
|
12308
|
-
const { user, client } = useOpenfortCore();
|
|
12309
|
-
const { isAuthenticated } = useStatus();
|
|
12310
|
-
const getAccessTokenAndUpdate = useCallback(async () => {
|
|
12311
|
-
await client.validateAndRefreshToken();
|
|
12312
|
-
const token = await client.getAccessToken();
|
|
12313
|
-
return token;
|
|
12314
|
-
}, [client]);
|
|
12315
|
-
return {
|
|
12316
|
-
user,
|
|
12317
|
-
isAuthenticated,
|
|
12318
|
-
getAccessToken: getAccessTokenAndUpdate,
|
|
12319
|
-
validateAndRefreshToken: async () => await client.validateAndRefreshToken(),
|
|
12320
|
-
};
|
|
12321
|
-
}
|
|
12322
|
-
|
|
12323
12345
|
function useWallet() {
|
|
12324
12346
|
const { activeWallet } = useWallets();
|
|
12325
12347
|
return activeWallet;
|
|
@@ -12352,14 +12374,14 @@ function useSignOut(hookOptions = {}) {
|
|
|
12352
12374
|
status: "idle",
|
|
12353
12375
|
});
|
|
12354
12376
|
const { disconnect } = useDisconnect();
|
|
12377
|
+
const queryClient = useQueryClient();
|
|
12355
12378
|
const signOut = useCallback(async (options = {}) => {
|
|
12356
|
-
if (!user)
|
|
12357
|
-
return;
|
|
12358
12379
|
setStatus({
|
|
12359
12380
|
status: 'loading',
|
|
12360
12381
|
});
|
|
12361
12382
|
try {
|
|
12362
12383
|
await client.auth.logout();
|
|
12384
|
+
queryClient.resetQueries({ queryKey: ['openfortEmbeddedWalletList'] });
|
|
12363
12385
|
disconnect();
|
|
12364
12386
|
updateUser();
|
|
12365
12387
|
setStatus({
|
|
@@ -13218,5 +13240,5 @@ const useWalletAuth = (hookOptions = {}) => {
|
|
|
13218
13240
|
};
|
|
13219
13241
|
};
|
|
13220
13242
|
|
|
13221
|
-
export { AuthProvider, Avatar, Chain as ChainIcon, OPENFORT_VERSION, OpenfortButton, OpenfortError, OpenfortErrorType, OpenfortProvider, OpenfortStatus,
|
|
13243
|
+
export { 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 };
|
|
13222
13244
|
//# sourceMappingURL=index.es.js.map
|
package/build/index.es.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AuthPlayerResponse, EmbeddedState, Openfort } from '@openfort/openfort-js';
|
|
2
2
|
import React, { PropsWithChildren } from 'react';
|
|
3
3
|
import { useConnectCallbackProps } from '../hooks/useConnectCallback';
|
|
4
4
|
export type ContextValue = {
|
|
@@ -11,7 +11,7 @@ import { Openfort as OpenfortClient, OpenfortSDKConfiguration } from '@openfort/
|
|
|
11
11
|
*
|
|
12
12
|
* const token = await client.getAccessToken();
|
|
13
13
|
*/
|
|
14
|
-
export declare function createOpenfortClient(
|
|
14
|
+
export declare function createOpenfortClient(config: OpenfortSDKConfiguration): OpenfortClient;
|
|
15
15
|
/**
|
|
16
16
|
* Gets or creates the default Openfort client instance
|
|
17
17
|
* @internal
|
package/build/types.d.ts
CHANGED
|
@@ -13,7 +13,8 @@ export type { ConnectUIOptions as OpenfortOptions, OpenfortWalletConfig } from '
|
|
|
13
13
|
export type { CustomAvatarProps } from './components/Common/Avatar';
|
|
14
14
|
export declare enum OpenfortErrorType {
|
|
15
15
|
AUTHENTICATION_ERROR = "AUTHENTICATION_ERROR",
|
|
16
|
-
WALLET_ERROR = "WALLET_ERROR"
|
|
16
|
+
WALLET_ERROR = "WALLET_ERROR",
|
|
17
|
+
CONFIGURATION_ERROR = "CONFIGURATION_ERROR"
|
|
17
18
|
}
|
|
18
19
|
interface Data {
|
|
19
20
|
[key: string]: any;
|
|
@@ -31,3 +32,4 @@ export type OpenfortHookOptions<T = {
|
|
|
31
32
|
onSettled?: (data: T | undefined | null, error: OpenfortError | null) => void;
|
|
32
33
|
throwOnError?: boolean;
|
|
33
34
|
};
|
|
35
|
+
export { SDKOverrides, RecoveryMethod, ThirdPartyOAuthProvider, } from '@openfort/openfort-js';
|
package/build/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const OPENFORT_VERSION = "0.0.
|
|
1
|
+
export declare const OPENFORT_VERSION = "0.0.5";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openfort/react",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.5",
|
|
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.
|
|
41
|
+
"@openfort/openfort-js": "^0.10.4",
|
|
42
42
|
"buffer": "^6.0.3",
|
|
43
43
|
"detect-browser": "^5.3.0",
|
|
44
44
|
"framer-motion": "^6.3.11",
|