@openfort/react 0.1.1 → 0.1.3

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 CHANGED
@@ -76,11 +76,7 @@ pnpm add @openfort/react @tanstack/react-query wagmi viem
76
76
 
77
77
  ## Examples
78
78
 
79
- There are various runnable examples included in this repository in the [examples folder](https://github.com/openfort-xyz/openfort-react/tree/main/examples):
80
-
81
- - [Create React App Example (TypeScript)](https://github.com/openfort-xyz/openfort-react/tree/main/examples/cra)
82
- - [Next.js Example (TypeScript)](https://github.com/openfort-xyz/openfort-react/tree/main/examples/nextjs)
83
- - [Vite Example (TypeScript)](https://github.com/openfort-xyz/openfort-react/tree/main/examples/vite)
79
+ There are various runnable examples included in this repository in the [examples folder](https://github.com/openfort-xyz/openfort-react/tree/main/examples)
84
80
 
85
81
  ### Running Examples Locally
86
82
 
@@ -95,15 +91,15 @@ $ pnpm install
95
91
  and start the code bundler:
96
92
 
97
93
  ```sh
98
- $ pnpm dev:kit
94
+ $ pnpm dev
99
95
  ```
100
96
 
101
97
  and then simply select the example you'd like to run:
102
98
 
103
99
  ```sh
104
- $ pnpm dev:vite # Vite
105
- $ pnpm dev:nextjs # Next.js
106
- $ pnpm dev:cra # Create React App
100
+ $ pnpm dev:playground # Playground
101
+ $ pnpm dev:headless # Headless
102
+ $ pnpm dev:openfort-ui # Openfort UI
107
103
  ```
108
104
 
109
105
  ## License
@@ -1,6 +1,3 @@
1
- export declare const ExternalLinkIcon: ({ ...props }: {
2
- [x: string]: any;
3
- }) => import("react/jsx-runtime").JSX.Element;
4
1
  export declare const AlertIcon: ({ ...props }: {
5
2
  [x: string]: any;
6
3
  }) => import("react/jsx-runtime").JSX.Element;
@@ -1,5 +1,2 @@
1
- import React from 'react';
2
- declare const ConnectWithQRCode: React.FC<{
3
- switchConnectMethod: (id?: string) => void;
4
- }>;
1
+ declare const ConnectWithQRCode: () => import("react/jsx-runtime").JSX.Element;
5
2
  export default ConnectWithQRCode;
@@ -2,10 +2,10 @@ import { type SDKOverrides, type ThirdPartyAuthConfiguration } from '@openfort/o
2
2
  import React from 'react';
3
3
  import type { useConnectCallbackProps } from '../../hooks/useConnectCallback';
4
4
  import { type ContextValue } from './context';
5
- import { type ConnectUIOptions, type OpenfortWalletConfig } from './types';
5
+ import { type ConnectUIOptions, type DebugModeOptions, type OpenfortWalletConfig } from './types';
6
6
  type OpenfortProviderProps = {
7
7
  children?: React.ReactNode;
8
- debugMode?: boolean;
8
+ debugMode?: boolean | DebugModeOptions;
9
9
  publishableKey: string;
10
10
  uiConfig?: ConnectUIOptions;
11
11
  walletConfig?: OpenfortWalletConfig;
@@ -2,7 +2,7 @@ import type { SDKOverrides, ThirdPartyAuthConfiguration } from '@openfort/openfo
2
2
  import type React from 'react';
3
3
  import type { useConnectCallbackProps } from '../../hooks/useConnectCallback';
4
4
  import type { CustomTheme, Languages, Mode, Theme } from '../../types';
5
- import type { Connector, ErrorMessage, OpenfortUIOptionsExtended, OpenfortWalletConfig, RouteOptions, SetRouteOptions } from './types';
5
+ import type { Connector, DebugModeOptions, ErrorMessage, OpenfortUIOptionsExtended, OpenfortWalletConfig, RouteOptions, SetRouteOptions } from './types';
6
6
  export type ContextValue = {
7
7
  setTheme: React.Dispatch<React.SetStateAction<Theme>>;
8
8
  mode: Mode;
@@ -23,7 +23,7 @@ export type ContextValue = {
23
23
  connector: Connector;
24
24
  setConnector: React.Dispatch<React.SetStateAction<Connector>>;
25
25
  errorMessage: ErrorMessage;
26
- debugMode?: boolean;
26
+ debugMode: Required<DebugModeOptions>;
27
27
  resize: number;
28
28
  triggerResize: () => void;
29
29
  uiConfig: OpenfortUIOptionsExtended;
@@ -79,6 +79,7 @@ type CommonWalletConfig = {
79
79
  /** Policy ID (pol_...) for the embedded signer. */
80
80
  ethereumProviderPolicyId?: PolicyConfig;
81
81
  accountType?: AccountTypeEnum;
82
+ /** @deprecated Use `debugMode` prop instead. */
82
83
  debug?: boolean;
83
84
  recoverWalletAutomaticallyAfterAuth?: boolean;
84
85
  };
@@ -91,6 +92,11 @@ type EncryptionSession = {
91
92
  getEncryptionSession?: never;
92
93
  createEncryptedSessionEndpoint?: string;
93
94
  };
95
+ export type DebugModeOptions = {
96
+ openfortReactDebugMode?: boolean;
97
+ openfortCoreDebugMode?: boolean;
98
+ shieldDebugMode?: boolean;
99
+ };
94
100
  /**
95
101
  * Configuration for wallet recovery behaviour.
96
102
  *
@@ -1,30 +1,4 @@
1
- /**
2
- * Provides reusable Web3 state and helpers to descendant components.
3
- *
4
- * @example
5
- * ```tsx
6
- * <Web3ContextProvider>
7
- * <WalletSelector />
8
- * </Web3ContextProvider>
9
- * ```
10
- */
11
- import type { Address, Chain } from 'viem';
12
- type Web3Context = {
13
- connect: {
14
- getUri: (id?: string) => string;
15
- };
16
- dapp: {
17
- chains: Chain[];
18
- };
19
- account?: {
20
- chain: Chain;
21
- chainIsSupported: boolean;
22
- address: Address;
23
- };
24
- };
25
- declare const Web3Context: import("react").Context<Web3Context>;
26
- export declare const Web3ContextProvider: ({ enabled, children }: {
27
- enabled?: boolean;
1
+ export declare const Web3ContextProvider: ({ children }: {
28
2
  children: React.ReactNode;
29
3
  }) => import("react/jsx-runtime").JSX.Element;
30
4
  /**
@@ -37,5 +11,3 @@ export declare const Web3ContextProvider: ({ enabled, children }: {
37
11
  * const { account } = useWeb3();
38
12
  * ```
39
13
  */
40
- export declare const useWeb3: () => Web3Context;
41
- export {};
@@ -15,6 +15,6 @@ export declare const useWalletAuth: (hookOptions?: OpenfortHookOptions) => {
15
15
  linkWallet: (options: ConnectWalletOptions) => Promise<{
16
16
  error: OpenfortError;
17
17
  } | undefined>;
18
- availableWallets: import("../../../wallets/useWallets").WalletProps[];
18
+ availableWallets: import("../../../wallets/useWagmiWallets").WalletProps[];
19
19
  };
20
20
  export {};
@@ -114,7 +114,7 @@ export declare function useWallets(hookOptions?: WalletOptions): {
114
114
  isConnecting: boolean;
115
115
  isLoadingWallets: boolean;
116
116
  wallets: UserWallet[];
117
- availableWallets: import("../../wallets/useWallets").WalletProps[];
117
+ availableWallets: import("../../wallets/useWagmiWallets").WalletProps[];
118
118
  activeWallet: UserWallet | undefined;
119
119
  setRecovery: (params: SetRecoveryOptions) => Promise<RecoverEmbeddedWalletResult>;
120
120
  reset: () => void;
@@ -3,4 +3,3 @@ export declare function useConnectors(): readonly Connector<import("wagmi").Crea
3
3
  export declare function useConnector(id: string, uuid?: string): Connector<import("wagmi").CreateConnectorFn> | undefined;
4
4
  export declare function useFamilyAccountsConnector(): Connector<import("wagmi").CreateConnectorFn> | undefined;
5
5
  export declare function useFamilyConnector(): Connector<import("wagmi").CreateConnectorFn> | undefined;
6
- export declare function useWalletConnectConnector(): Connector<import("wagmi").CreateConnectorFn> | undefined;