@openfort/react 0.0.3 → 0.0.4
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/README.md +4 -4
- package/build/components/ConnectButton/index.d.ts +3 -3
- package/build/components/Openfort/{OpenfortKit.d.ts → OpenfortProvider.d.ts} +1 -1
- package/build/components/Openfort/context.d.ts +1 -1
- package/build/components/Openfort/types.d.ts +2 -2
- package/build/components/Openfort/useOpenfort.d.ts +1 -0
- package/build/hooks/openfort/auth/useAuthCallback.d.ts +1 -1
- package/build/hooks/openfort/auth/useEmailAuth.d.ts +1 -1
- package/build/hooks/openfort/auth/useGuestAuth.d.ts +1 -1
- package/build/hooks/openfort/auth/useOAuth.d.ts +4 -4
- package/build/hooks/openfort/useStatus.d.ts +1 -1
- package/build/hooks/openfort/useWallets.d.ts +12 -12
- package/build/index.d.ts +5 -5
- package/build/index.es.js +184 -155
- package/build/index.es.js.map +1 -1
- package/build/openfort/context.d.ts +1 -1
- package/build/openfort/useOpenfort.d.ts +1 -1
- package/build/styles/styled/index.d.ts +1 -1
- package/build/styles/types.d.ts +1 -1
- package/build/types.d.ts +1 -1
- package/build/version.d.ts +1 -1
- package/package.json +2 -2
- package/build/components/Openfort/useOpenfortKit.d.ts +0 -1
- /package/build/openfort/{OpenfortProvider.d.ts → CoreOpenfortProvider.d.ts} +0 -0
package/README.md
CHANGED
|
@@ -44,7 +44,7 @@ and much more...
|
|
|
44
44
|
|
|
45
45
|
### New app
|
|
46
46
|
|
|
47
|
-
Get started with `create`
|
|
47
|
+
Get started with `create` Openfort + [wagmi](https://wagmi.sh/) + [viem](https://viem.sh) project by running one of the following in your terminal:
|
|
48
48
|
|
|
49
49
|
#### npm
|
|
50
50
|
|
|
@@ -99,7 +99,7 @@ There are various runnable examples included in this repository in the [examples
|
|
|
99
99
|
Clone the project and install the necessary dependencies:
|
|
100
100
|
|
|
101
101
|
```sh
|
|
102
|
-
$ git clone git@github.com:openfort-xyz/openfort-
|
|
102
|
+
$ git clone git@github.com:openfort-xyz/openfort-react.git
|
|
103
103
|
$ cd openfort
|
|
104
104
|
$ yarn install
|
|
105
105
|
```
|
|
@@ -120,8 +120,8 @@ $ yarn dev:cra # Create React App
|
|
|
120
120
|
|
|
121
121
|
## License
|
|
122
122
|
|
|
123
|
-
See [LICENSE](https://github.com/openfort-xyz/openfort-
|
|
123
|
+
See [LICENSE](https://github.com/openfort-xyz/openfort-react/blob/main/LICENSE) for more information.
|
|
124
124
|
|
|
125
125
|
## Credits
|
|
126
126
|
|
|
127
|
-
|
|
127
|
+
Openfort is a fork of [Connectkit](https://github.com/openfort-xyz/openfort-react) developed by [Family](https://family.co). We're grateful to them for making Connectkit fast, beautiful and open-source.
|
|
@@ -17,7 +17,7 @@ type ConnectButtonRendererProps = {
|
|
|
17
17
|
ensName?: string;
|
|
18
18
|
}) => React.ReactNode;
|
|
19
19
|
};
|
|
20
|
-
type
|
|
20
|
+
type OpenfortButtonProps = {
|
|
21
21
|
label?: string;
|
|
22
22
|
showBalance?: boolean;
|
|
23
23
|
showAvatar?: boolean;
|
|
@@ -26,8 +26,8 @@ type OpenfortKitButtonProps = {
|
|
|
26
26
|
customTheme?: CustomTheme;
|
|
27
27
|
onClick?: (open: () => void) => void;
|
|
28
28
|
};
|
|
29
|
-
export declare function
|
|
30
|
-
export declare namespace
|
|
29
|
+
export declare function OpenfortButton({ label, showBalance, showAvatar, theme, mode, customTheme, onClick, }: OpenfortButtonProps): import("react/jsx-runtime").JSX.Element | null;
|
|
30
|
+
export declare namespace OpenfortButton {
|
|
31
31
|
var Custom: React.FC<ConnectButtonRendererProps>;
|
|
32
32
|
}
|
|
33
33
|
export {};
|
|
@@ -10,7 +10,7 @@ type OpenfortProviderProps = {
|
|
|
10
10
|
walletConfig?: OpenfortWalletConfig;
|
|
11
11
|
} & useConnectCallbackProps;
|
|
12
12
|
/**
|
|
13
|
-
* OpenfortProvider component provides context and configuration for
|
|
13
|
+
* OpenfortProvider component provides context and configuration for Openfort.
|
|
14
14
|
* It must be used within a WagmiProvider.
|
|
15
15
|
*
|
|
16
16
|
* @param {React.ReactNode} children - The child components to be wrapped by the provider.
|
|
@@ -34,5 +34,5 @@ export type ContextValue = {
|
|
|
34
34
|
uiConfig?: OpenfortUIOptionsExtended;
|
|
35
35
|
walletConfig?: OpenfortWalletConfig;
|
|
36
36
|
} & useConnectCallbackProps;
|
|
37
|
-
export declare const
|
|
37
|
+
export declare const Openfortcontext: React.Context<ContextValue | null>;
|
|
38
38
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { ReactNode } from 'react';
|
|
2
2
|
import { CustomAvatarProps, CustomTheme, Languages, Mode, Theme } from '../../types';
|
|
3
3
|
import { RecoveryMethod } from '@openfort/openfort-js';
|
|
4
|
-
import { CoreOpenfortProviderProps } from '../../openfort/
|
|
4
|
+
import { CoreOpenfortProviderProps } from '../../openfort/CoreOpenfortProvider';
|
|
5
5
|
export declare const routes: {
|
|
6
6
|
readonly PROVIDERS: "providers";
|
|
7
7
|
readonly SOCIAL_PROVIDERS: "socialProviders";
|
|
@@ -84,7 +84,7 @@ export type OpenfortOptions = {
|
|
|
84
84
|
termsOfServiceUrl?: string;
|
|
85
85
|
privacyPolicyUrl?: string;
|
|
86
86
|
logo?: React.ReactNode;
|
|
87
|
-
|
|
87
|
+
overrides?: CoreOpenfortProviderProps['overrides'];
|
|
88
88
|
};
|
|
89
89
|
export type ConnectUIOptions = {
|
|
90
90
|
theme?: Theme;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useOpenfort: () => import("./context").ContextValue;
|
|
@@ -14,7 +14,7 @@ type UseAuthCallbackOptions = {
|
|
|
14
14
|
export declare const useAuthCallback: ({ enabled, ...hookOptions }?: UseAuthCallbackOptions) => {
|
|
15
15
|
email: string | null;
|
|
16
16
|
provider: AuthProvider | null;
|
|
17
|
-
verifyEmail: (
|
|
17
|
+
verifyEmail: (options: import("./useEmailAuth").VerifyEmailOptions) => Promise<EmailVerificationResult>;
|
|
18
18
|
storeCredentials: ({ player, accessToken, refreshToken, ...options }: import("./useOAuth").StoreCredentialsOptions) => Promise<StoreCredentialsResult>;
|
|
19
19
|
isLoading: boolean;
|
|
20
20
|
isError: boolean;
|
|
@@ -53,7 +53,7 @@ export declare const useEmailAuth: (hookOptions?: UseEmailHookOptions) => {
|
|
|
53
53
|
error: OpenfortError | null | undefined;
|
|
54
54
|
signInEmail: (options: SignInEmailOptions) => Promise<EmailAuthResult>;
|
|
55
55
|
signUpEmail: (options: SignUpEmailOptions) => Promise<EmailAuthResult>;
|
|
56
|
-
verifyEmail: (
|
|
56
|
+
verifyEmail: (options: VerifyEmailOptions) => Promise<EmailVerificationResult>;
|
|
57
57
|
linkEmail: (options: LinkEmailOptions) => Promise<EmailAuthResult>;
|
|
58
58
|
requestResetPassword: (options: RequestResetPasswordOptions) => Promise<EmailAuthResult>;
|
|
59
59
|
resetPassword: (options: ResetPasswordOptions) => Promise<EmailAuthResult>;
|
|
@@ -7,7 +7,7 @@ export type GuestHookResult = {
|
|
|
7
7
|
user?: OpenfortUser;
|
|
8
8
|
wallet?: UserWallet;
|
|
9
9
|
};
|
|
10
|
-
export type GuestHookOptions = OpenfortHookOptions<
|
|
10
|
+
export type GuestHookOptions = OpenfortHookOptions<GuestHookResult> & CreateWalletPostAuthOptions;
|
|
11
11
|
export declare const useGuestAuth: (hookOptions?: GuestHookOptions) => {
|
|
12
12
|
isLoading: boolean;
|
|
13
13
|
isError: boolean;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { OAuthProvider } from '@openfort/openfort-js';
|
|
2
2
|
import { OpenfortHookOptions, OpenfortError } from '../../../types';
|
|
3
3
|
import { CreateWalletPostAuthOptions } from './useCreateWalletPostAuth';
|
|
4
4
|
import { UserWallet } from "../useWallets";
|
|
5
5
|
import { type AuthPlayerResponse as OpenfortUser } from '@openfort/openfort-js';
|
|
6
6
|
export type InitializeOAuthOptions = {
|
|
7
|
-
provider:
|
|
7
|
+
provider: OAuthProvider;
|
|
8
8
|
redirectTo?: string;
|
|
9
|
-
} & OpenfortHookOptions
|
|
9
|
+
} & OpenfortHookOptions<InitOAuthReturnType>;
|
|
10
10
|
export type InitOAuthReturnType = {
|
|
11
11
|
error?: OpenfortError;
|
|
12
12
|
};
|
|
@@ -22,7 +22,7 @@ export type StoreCredentialsOptions = {
|
|
|
22
22
|
} & OpenfortHookOptions<StoreCredentialsResult> & CreateWalletPostAuthOptions;
|
|
23
23
|
export type AuthHookOptions = {
|
|
24
24
|
redirectTo?: string;
|
|
25
|
-
} & OpenfortHookOptions<StoreCredentialsResult> & CreateWalletPostAuthOptions;
|
|
25
|
+
} & OpenfortHookOptions<StoreCredentialsResult | InitOAuthReturnType> & CreateWalletPostAuthOptions;
|
|
26
26
|
export declare const useOAuth: (hookOptions?: AuthHookOptions) => {
|
|
27
27
|
isLoading: boolean;
|
|
28
28
|
isError: boolean;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import { RecoveryMethod } from "@openfort/openfort-js";
|
|
1
2
|
import { Hex } from "viem";
|
|
2
3
|
import { Connector } from "wagmi";
|
|
3
4
|
import { embeddedWalletId } from "../../constants/openfort";
|
|
4
5
|
import { OpenfortError, OpenfortHookOptions } from "../../types";
|
|
5
6
|
export type UserWallet = {
|
|
6
|
-
address?:
|
|
7
|
+
address?: Hex;
|
|
7
8
|
connectorType?: string;
|
|
8
9
|
walletClientType?: string;
|
|
9
10
|
connector?: Connector;
|
|
@@ -24,11 +25,18 @@ type SetActiveWalletOptions = ({
|
|
|
24
25
|
} | {
|
|
25
26
|
connector: typeof embeddedWalletId;
|
|
26
27
|
password?: string;
|
|
28
|
+
} | {
|
|
29
|
+
connector: Connector;
|
|
27
30
|
})) & OpenfortHookOptions<SetActiveWalletResult>;
|
|
28
31
|
type CreateWalletResult = SetActiveWalletResult;
|
|
29
32
|
type CreateWalletOptions = {
|
|
30
33
|
password?: string;
|
|
31
34
|
} & OpenfortHookOptions<CreateWalletResult>;
|
|
35
|
+
type RecoverEmbeddedWalletResult = SetActiveWalletResult;
|
|
36
|
+
type SetRecoveryOptions = {
|
|
37
|
+
recoveryMethod: RecoveryMethod;
|
|
38
|
+
recoveryPassword?: string;
|
|
39
|
+
} & OpenfortHookOptions<CreateWalletResult>;
|
|
32
40
|
type WalletOptions = OpenfortHookOptions<SetActiveWalletResult | CreateWalletResult>;
|
|
33
41
|
export declare function useWallets(hookOptions?: WalletOptions): {
|
|
34
42
|
exportPrivateKey: () => Promise<string>;
|
|
@@ -37,23 +45,15 @@ export declare function useWallets(hookOptions?: WalletOptions): {
|
|
|
37
45
|
isSuccess: boolean;
|
|
38
46
|
isCreating: boolean;
|
|
39
47
|
isConnecting: boolean;
|
|
40
|
-
wallets:
|
|
41
|
-
isConnecting: boolean;
|
|
42
|
-
isActive: boolean;
|
|
43
|
-
address?: `0x${string}`;
|
|
44
|
-
connectorType?: string;
|
|
45
|
-
walletClientType?: string;
|
|
46
|
-
connector?: Connector;
|
|
47
|
-
id: string;
|
|
48
|
-
isAvailable: boolean;
|
|
49
|
-
}[];
|
|
48
|
+
wallets: UserWallet[];
|
|
50
49
|
availableWallets: import("../../wallets/useWallets").WalletProps[];
|
|
51
50
|
activeWallet: UserWallet | undefined;
|
|
52
|
-
|
|
51
|
+
setRecovery: (params: SetRecoveryOptions) => Promise<RecoverEmbeddedWalletResult>;
|
|
53
52
|
createWallet: ({ password, ...options }?: CreateWalletOptions) => Promise<{
|
|
54
53
|
error: OpenfortError;
|
|
55
54
|
} | {
|
|
56
55
|
wallet: UserWallet;
|
|
57
56
|
}>;
|
|
57
|
+
setActiveWallet: (options: SetActiveWalletOptions | string) => Promise<SetActiveWalletResult>;
|
|
58
58
|
};
|
|
59
59
|
export {};
|
package/build/index.d.ts
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { OPENFORT_VERSION } from './version';
|
|
2
2
|
export * from './types';
|
|
3
3
|
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 {
|
|
8
|
-
export { OpenfortProvider, } from './components/Openfort/
|
|
9
|
-
export {
|
|
7
|
+
export { Openfortcontext, } from './components/Openfort/context';
|
|
8
|
+
export { OpenfortProvider, } from './components/Openfort/OpenfortProvider';
|
|
9
|
+
export { OpenfortButton } from './components/ConnectButton';
|
|
10
10
|
export { default as Avatar } from './components/Common/Avatar';
|
|
11
11
|
export { default as ChainIcon } from './components/Common/Chain';
|
|
12
12
|
export { useChains } from './hooks/useChains';
|
|
13
13
|
export { useChainIsSupported } from './hooks/useChainIsSupported';
|
|
14
|
-
export { useStatus,
|
|
14
|
+
export { useStatus, OpenfortStatus } from './hooks/openfort/useStatus';
|
|
15
15
|
export { useUser } from './hooks/openfort/useUser';
|
|
16
16
|
export { useUI } from "./hooks/openfort/useUI";
|
|
17
17
|
export { useWallets, UserWallet } from "./hooks/openfort/useWallets";
|