@openfort/react 0.0.7 → 0.0.9
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 +3 -3
- package/build/assets/icons.d.ts +3 -0
- package/build/components/Common/Loading/index.d.ts +8 -3
- package/build/hooks/openfort/auth/useConnectToWalletPostAuth.d.ts +2 -2
- package/build/hooks/openfort/useWallets.d.ts +16 -12
- package/build/index.d.ts +1 -1
- package/build/index.es.js +388 -211
- package/build/index.es.js.map +1 -1
- package/build/openfort/CoreOpenfortProvider.d.ts +3 -1
- package/build/types.d.ts +2 -1
- package/build/version.d.ts +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
Website
|
|
7
7
|
</a>
|
|
8
8
|
<span> | </span>
|
|
9
|
-
<a href="https://www.openfort.io/docs/products/embedded-wallet/react/
|
|
9
|
+
<a href="https://www.openfort.io/docs/products/embedded-wallet/react/">
|
|
10
10
|
Documentation
|
|
11
11
|
</a>
|
|
12
12
|
<span> | </span>
|
|
@@ -25,11 +25,11 @@
|
|
|
25
25
|
|
|
26
26
|
[](https://www.npmjs.com/package/@openfort/react)
|
|
27
27
|
[](LICENSE)
|
|
28
|
-
[](https://www.openfort.io/docs/products/embedded-wallet/react/
|
|
28
|
+
[](https://www.openfort.io/docs/products/embedded-wallet/react/)
|
|
29
29
|
[](https://www.npmjs.org/package/@openfort/react)
|
|
30
30
|
|
|
31
31
|
|
|
32
|
-
The easiest way to use embedded wallets, with built-in authentication and payments capabilities.
|
|
32
|
+
The easiest way to use embedded wallets, with built-in authentication and payments capabilities in React.
|
|
33
33
|
|
|
34
34
|
## Features
|
|
35
35
|
|
package/build/assets/icons.d.ts
CHANGED
|
@@ -49,3 +49,6 @@ export declare const LockIcon: ({ ...props }: {
|
|
|
49
49
|
export declare const ShieldIcon: ({ ...props }: {
|
|
50
50
|
[x: string]: any;
|
|
51
51
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
52
|
+
export declare const FingerPrintIcon: ({ ...props }: {
|
|
53
|
+
[x: string]: any;
|
|
54
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,6 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
type LoaderProps = {
|
|
2
|
+
header: string;
|
|
3
|
+
description?: string | undefined;
|
|
3
4
|
isLoading?: boolean;
|
|
4
5
|
icon?: React.ReactNode;
|
|
5
|
-
|
|
6
|
+
isError?: boolean;
|
|
7
|
+
isSuccess?: boolean;
|
|
8
|
+
onRetry?: () => void;
|
|
9
|
+
};
|
|
10
|
+
declare const Loader: ({ header, description, icon, isError, isSuccess, isLoading, onRetry, }: LoaderProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
11
|
export default Loader;
|
|
@@ -9,10 +9,10 @@ export type CreateWalletPostAuthOptions = {
|
|
|
9
9
|
* @default true
|
|
10
10
|
* It will automatically try to recover the first wallet with automatic recovery.
|
|
11
11
|
*/
|
|
12
|
-
|
|
12
|
+
recoverWalletAutomatically?: boolean;
|
|
13
13
|
};
|
|
14
14
|
export declare const useConnectToWalletPostAuth: () => {
|
|
15
|
-
tryUseWallet: ({ logoutOnError: signOutOnError,
|
|
15
|
+
tryUseWallet: ({ logoutOnError: signOutOnError, recoverWalletAutomatically }: CreateWalletPostAuthOptions) => Promise<{
|
|
16
16
|
wallet?: UserWallet;
|
|
17
17
|
}>;
|
|
18
18
|
};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { AccountTypeEnum, RecoveryMethod, RecoveryParams } from "@openfort/openfort-js";
|
|
2
2
|
import { Hex } from "viem";
|
|
3
3
|
import { Connector } from "wagmi";
|
|
4
|
-
import { embeddedWalletId } from "../../constants/openfort";
|
|
5
4
|
import { OpenfortError, OpenfortHookOptions } from "../../types";
|
|
6
5
|
export type UserWallet = {
|
|
7
6
|
address: Hex;
|
|
@@ -13,25 +12,30 @@ export type UserWallet = {
|
|
|
13
12
|
isActive?: boolean;
|
|
14
13
|
isConnecting?: boolean;
|
|
15
14
|
recoveryMethod?: RecoveryMethod;
|
|
15
|
+
accountId?: string;
|
|
16
|
+
accountType?: AccountTypeEnum;
|
|
17
|
+
ownerAddress?: Hex;
|
|
18
|
+
implementationType?: string;
|
|
19
|
+
createdAt?: number;
|
|
20
|
+
salt?: string;
|
|
21
|
+
};
|
|
22
|
+
export type WalletRecovery = {
|
|
23
|
+
recoveryMethod: RecoveryMethod;
|
|
24
|
+
password?: string;
|
|
16
25
|
};
|
|
17
26
|
type SetActiveWalletResult = {
|
|
18
27
|
error?: OpenfortError;
|
|
19
28
|
wallet?: UserWallet;
|
|
20
29
|
};
|
|
21
30
|
type SetActiveWalletOptions = ({
|
|
22
|
-
|
|
31
|
+
walletId: string;
|
|
32
|
+
recovery?: WalletRecovery;
|
|
23
33
|
address?: Hex | undefined;
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
} | {
|
|
27
|
-
connector: typeof embeddedWalletId;
|
|
28
|
-
password?: string;
|
|
29
|
-
} | {
|
|
30
|
-
connector: Connector;
|
|
31
|
-
})) & OpenfortHookOptions<SetActiveWalletResult>;
|
|
34
|
+
showUI?: boolean;
|
|
35
|
+
}) & OpenfortHookOptions<SetActiveWalletResult>;
|
|
32
36
|
type CreateWalletResult = SetActiveWalletResult;
|
|
33
37
|
type CreateWalletOptions = {
|
|
34
|
-
|
|
38
|
+
recovery?: WalletRecovery;
|
|
35
39
|
accountType?: AccountTypeEnum;
|
|
36
40
|
} & OpenfortHookOptions<CreateWalletResult>;
|
|
37
41
|
type RecoverEmbeddedWalletResult = SetActiveWalletResult;
|
|
@@ -54,7 +58,7 @@ export declare function useWallets(hookOptions?: WalletOptions): {
|
|
|
54
58
|
activeWallet: UserWallet | undefined;
|
|
55
59
|
setRecovery: (params: SetRecoveryOptions) => Promise<RecoverEmbeddedWalletResult>;
|
|
56
60
|
reset: () => void;
|
|
57
|
-
createWallet: ({
|
|
61
|
+
createWallet: ({ recovery, ...options }?: CreateWalletOptions) => Promise<CreateWalletResult>;
|
|
58
62
|
setActiveWallet: (options: SetActiveWalletOptions | string) => Promise<SetActiveWalletResult>;
|
|
59
63
|
};
|
|
60
64
|
export {};
|
package/build/index.d.ts
CHANGED
|
@@ -15,7 +15,7 @@ export { useUser } from './hooks/openfort/useUser';
|
|
|
15
15
|
export { useUI } from "./hooks/openfort/useUI";
|
|
16
16
|
export { useWallets, UserWallet } from "./hooks/openfort/useWallets";
|
|
17
17
|
export { useWallet } from "./hooks/openfort/useWallet";
|
|
18
|
-
export { RecoveryMethod, AuthPlayerResponse } from "@openfort/openfort-js";
|
|
18
|
+
export { RecoveryMethod, AuthPlayerResponse, RecoveryParams } from "@openfort/openfort-js";
|
|
19
19
|
export { useOpenfortCore as useOpenfort } from './openfort/useOpenfort';
|
|
20
20
|
export { useConnectWithSiwe } from './hooks/openfort/useConnectWithSiwe';
|
|
21
21
|
export { embeddedWalletId } from './constants/openfort';
|