@openfort/react-native 0.1.14 → 0.1.16

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.
Files changed (61) hide show
  1. package/dist/components/AuthBoundary.js +0 -2
  2. package/dist/constants/config.js +1 -1
  3. package/dist/constants/index.js +1 -0
  4. package/dist/core/client.js +5 -5
  5. package/dist/core/index.js +3 -3
  6. package/dist/core/provider.js +13 -10
  7. package/dist/core/storage.js +5 -5
  8. package/dist/hooks/auth/index.js +3 -3
  9. package/dist/hooks/auth/useCreateWalletPostAuth.js +8 -4
  10. package/dist/hooks/auth/useEmailAuth.js +10 -8
  11. package/dist/hooks/auth/useGuestAuth.js +5 -3
  12. package/dist/hooks/auth/useOAuth.js +17 -11
  13. package/dist/hooks/auth/useSignOut.js +7 -7
  14. package/dist/hooks/auth/useWalletAuth.js +19 -11
  15. package/dist/hooks/core/useUser.js +2 -2
  16. package/dist/hooks/index.js +3 -2
  17. package/dist/hooks/wallet/useWallets.js +38 -32
  18. package/dist/index.js +8 -9
  19. package/dist/lib/logger.js +3 -11
  20. package/dist/native/index.js +4 -4
  21. package/dist/native/oauth.js +7 -12
  22. package/dist/native/storage.js +10 -2
  23. package/dist/native/webview.js +7 -5
  24. package/dist/types/baseFlowState.js +1 -1
  25. package/dist/types/components/AuthBoundary.d.ts +1 -2
  26. package/dist/types/components/index.d.ts +1 -1
  27. package/dist/types/constants/config.d.ts +1 -1
  28. package/dist/types/core/client.d.ts +1 -1
  29. package/dist/types/core/context.d.ts +2 -2
  30. package/dist/types/core/index.d.ts +5 -5
  31. package/dist/types/core/provider.d.ts +1 -1
  32. package/dist/types/core/storage.d.ts +1 -1
  33. package/dist/types/hooks/auth/index.d.ts +6 -2
  34. package/dist/types/hooks/auth/useCreateWalletPostAuth.d.ts +1 -15
  35. package/dist/types/hooks/auth/useEmailAuth.d.ts +2 -2
  36. package/dist/types/hooks/auth/useGuestAuth.d.ts +2 -2
  37. package/dist/types/hooks/auth/useOAuth.d.ts +2 -2
  38. package/dist/types/hooks/auth/useSignOut.d.ts +2 -2
  39. package/dist/types/hooks/auth/useWalletAuth.d.ts +2 -2
  40. package/dist/types/hooks/core/useOpenfort.d.ts +1 -1
  41. package/dist/types/hooks/index.d.ts +1 -1
  42. package/dist/types/hooks/wallet/useWallets.d.ts +4 -4
  43. package/dist/types/index.d.ts +4 -6
  44. package/dist/types/index.js +1 -1
  45. package/dist/types/lib/hookConsistency.d.ts +2 -2
  46. package/dist/types/lib/logger.d.ts +0 -2
  47. package/dist/types/native/index.d.ts +4 -4
  48. package/dist/types/native/oauth.d.ts +1 -1
  49. package/dist/types/native/webview.d.ts +1 -1
  50. package/dist/types/oauth.js +1 -1
  51. package/dist/types/types/baseFlowState.d.ts +2 -2
  52. package/dist/types/types/config.d.ts +0 -12
  53. package/dist/types/types/hookOption.d.ts +1 -1
  54. package/dist/types/types/index.d.ts +5 -5
  55. package/dist/types/types/predicates.d.ts +1 -1
  56. package/dist/types/types/wallet.d.ts +7 -7
  57. package/package.json +74 -19
  58. package/dist/hooks/auth/useAuthCallback.js +0 -1
  59. package/dist/types/hooks/auth/useAuthCallback.d.ts +0 -0
  60. package/dist/types/state.js +0 -1
  61. package/dist/types/types/state.d.ts +0 -0
@@ -1,2 +1,2 @@
1
1
  // Predicate functions (exported directly, not as types)
2
- export { isConnected, isReconnecting, isConnecting, isDisconnected, isNotCreated, isCreating, hasError, needsRecovery, isLoading, isReady, needsUserAction, isStable, canTransact, getStateDescription, getActionText, } from './predicates';
2
+ export { canTransact, getActionText, getStateDescription, hasError, isConnected, isConnecting, isCreating, isDisconnected, isLoading, isNotCreated, isReady, isReconnecting, isStable, needsRecovery, needsUserAction, } from './predicates';
@@ -1,5 +1,5 @@
1
- import { OpenfortHookOptions } from "../types/hookOption";
2
- import { OpenfortError } from "../types/openfortError";
1
+ import type { OpenfortHookOptions } from '../types/hookOption';
2
+ import type { OpenfortError } from '../types/openfortError';
3
3
  /**
4
4
  * Handles successful hook operation callbacks
5
5
  *
@@ -1,5 +1,4 @@
1
1
  import { EmbeddedState } from '@openfort/openfort-js';
2
- type LogLevel = 'debug' | 'info' | 'warn' | 'error';
3
2
  export declare const logger: {
4
3
  debug: (message: unknown, ...optionalParams: unknown[]) => void;
5
4
  info: (message: unknown, ...optionalParams: unknown[]) => void;
@@ -9,4 +8,3 @@ export declare const logger: {
9
8
  printVerboseWarning: () => void;
10
9
  };
11
10
  export declare const getEmbeddedStateName: (state: EmbeddedState) => string;
12
- export type { LogLevel };
@@ -1,5 +1,5 @@
1
- export { EmbeddedWalletWebView, WebViewUtils } from './webview';
2
- export { isSecureStorageMessage, handleSecureStorageMessage, NativeStorageUtils, } from './storage';
1
+ export type { AppleAuthResult, OAuthResult, OAuthSessionConfig, } from './oauth';
2
+ export { authenticateWithApple, createOAuthRedirectUri, isAppleSignInAvailable, OAuthUtils, openOAuthSession, parseOAuthUrl, } from './oauth';
3
3
  export type { SecureStorageMessage, SecureStorageResponse, } from './storage';
4
- export { openOAuthSession, authenticateWithApple, isAppleSignInAvailable, parseOAuthUrl, createOAuthRedirectUri, OAuthUtils, } from './oauth';
5
- export type { OAuthResult, AppleAuthResult, OAuthSessionConfig, } from './oauth';
4
+ export { handleSecureStorageMessage, isSecureStorageMessage, NativeStorageUtils, } from './storage';
5
+ export { EmbeddedWalletWebView, WebViewUtils } from './webview';
@@ -1,5 +1,5 @@
1
- import * as AppleAuthentication from 'expo-apple-authentication';
2
1
  import { OAuthProvider as OAuthProviderType } from '@openfort/openfort-js';
2
+ import * as AppleAuthentication from 'expo-apple-authentication';
3
3
  /**
4
4
  * OAuth authentication result
5
5
  */
@@ -1,6 +1,6 @@
1
+ import type { Openfort as OpenfortClient } from '@openfort/openfort-js';
1
2
  import React from 'react';
2
3
  import WebView from 'react-native-webview';
3
- import type { Openfort as OpenfortClient } from '@openfort/openfort-js';
4
4
  /**
5
5
  * Props for the EmbeddedWalletWebView component
6
6
  */
@@ -3,6 +3,6 @@ export const mapOAuthStatus = (status) => {
3
3
  isLoading: status.status === 'loading',
4
4
  isError: status.status === 'error',
5
5
  isSuccess: status.status === 'done',
6
- error: status.error
6
+ error: status.error,
7
7
  };
8
8
  };
@@ -1,6 +1,6 @@
1
- import { OpenfortError } from "./openfortError";
1
+ import type { OpenfortError } from './openfortError';
2
2
  export type BaseFlowState = {
3
- status: "idle" | 'awaiting-input' | 'loading' | 'success';
3
+ status: 'idle' | 'awaiting-input' | 'loading' | 'success';
4
4
  error?: never;
5
5
  } | {
6
6
  status: 'error';
@@ -1,15 +1,3 @@
1
- /**
2
- * Storage interface
3
- */
4
- export interface Storage {
5
- [key: string]: any;
6
- }
7
- /**
8
- * Chain configuration
9
- */
10
- export interface Chain {
11
- [key: string]: any;
12
- }
13
1
  /**
14
2
  * Custom authentication provider configuration
15
3
  */
@@ -1,4 +1,4 @@
1
- import { OpenfortError } from "./openfortError";
1
+ import type { OpenfortError } from './openfortError';
2
2
  export type OpenfortHookOptions<T = {
3
3
  error?: OpenfortError;
4
4
  }> = {
@@ -13,11 +13,11 @@ export interface UseOpenfort {
13
13
  /** A function that gets the current authenticated user's access token. */
14
14
  getAccessToken: () => Promise<string | null>;
15
15
  }
16
- export type { PasswordFlowState, SiweFlowState, RecoveryFlowState, CustomAuthFlowState, AuthSuccessCallback, AuthLinkSuccessCallback, ErrorCallback, EmailLoginHookOptions, EmailLinkHookOptions, EmailLoginHookResult, EmailLinkHookResult, SiweLoginHookOptions, SiweLinkHookOptions, SiweLoginHookResult, SiweLinkHookResult, GenerateSiweMessageResponse, GenerateSiweMessage, } from './auth';
17
- export type { OAuthFlowState, OAuthTokens, UseOAuthTokensOptions, LoginWithOAuthInput, LinkWithOAuthInput, UseLoginWithOAuth, UseLinkWithOAuth, UnlinkOAuthOptions, UnlinkOAuthParams, } from './oauth';
18
- export type { OpenfortEmbeddedWalletAccount, WalletRecoveryCallbacks, SolanaWalletRecoveryCallbacks, RecoveryMethodOptions, CreateSolanaEmbeddedWalletOpts, RecoverSolanaEmbeddedWalletOpts, EmbeddedEthereumWalletActions, EmbeddedEthereumWalletState, EmbeddedWalletStatus, ConnectedEmbeddedSolanaWallet, EmbeddedSolanaWalletActions, EmbeddedSolanaWalletConnectedState, EmbeddedSolanaWalletConnectingState, EmbeddedSolanaWalletReconnectingState, EmbeddedSolanaWalletDisconnectedState, EmbeddedSolanaWalletNeedsRecoveryState, EmbeddedSolanaWalletCreatingState, EmbeddedSolanaWalletErrorState, EmbeddedSolanaWalletState, EmbeddedSolanaWalletStatus, ConnectedEmbeddedEthereumWallet, UserWallet, } from './wallet';
19
- export type { CustomAuthProviderConfig, UseGuestAuth, UseOnEmbeddedWalletStateChange, SetRecoveryParams, UseSetEmbeddedWalletRecoveryResult, UseSetEmbeddedWalletRecovery, } from './config';
20
- export { isConnected, isReconnecting, isConnecting, isDisconnected, isNotCreated, isCreating, hasError, needsRecovery, isLoading, isReady, needsUserAction, isStable, canTransact, getStateDescription, getActionText, } from './predicates';
16
+ export type { AuthLinkSuccessCallback, AuthSuccessCallback, CustomAuthFlowState, EmailLinkHookOptions, EmailLinkHookResult, EmailLoginHookOptions, EmailLoginHookResult, ErrorCallback, GenerateSiweMessage, GenerateSiweMessageResponse, PasswordFlowState, RecoveryFlowState, SiweFlowState, SiweLinkHookOptions, SiweLinkHookResult, SiweLoginHookOptions, SiweLoginHookResult, } from './auth';
17
+ export type { CustomAuthProviderConfig, SetRecoveryParams, UseGuestAuth, UseOnEmbeddedWalletStateChange, UseSetEmbeddedWalletRecovery, UseSetEmbeddedWalletRecoveryResult, } from './config';
18
+ export type { LinkWithOAuthInput, LoginWithOAuthInput, OAuthFlowState, OAuthTokens, UnlinkOAuthOptions, UnlinkOAuthParams, UseLinkWithOAuth, UseLoginWithOAuth, UseOAuthTokensOptions, } from './oauth';
19
+ export { canTransact, getActionText, getStateDescription, hasError, isConnected, isConnecting, isCreating, isDisconnected, isLoading, isNotCreated, isReady, isReconnecting, isStable, needsRecovery, needsUserAction, } from './predicates';
20
+ export type { ConnectedEmbeddedEthereumWallet, ConnectedEmbeddedSolanaWallet, CreateSolanaEmbeddedWalletOpts, EmbeddedEthereumWalletActions, EmbeddedEthereumWalletState, EmbeddedSolanaWalletActions, EmbeddedSolanaWalletConnectedState, EmbeddedSolanaWalletConnectingState, EmbeddedSolanaWalletCreatingState, EmbeddedSolanaWalletDisconnectedState, EmbeddedSolanaWalletErrorState, EmbeddedSolanaWalletNeedsRecoveryState, EmbeddedSolanaWalletReconnectingState, EmbeddedSolanaWalletState, EmbeddedSolanaWalletStatus, EmbeddedWalletStatus, OpenfortEmbeddedWalletAccount, RecoverSolanaEmbeddedWalletOpts, RecoveryMethodOptions, SolanaWalletRecoveryCallbacks, UserWallet, WalletRecoveryCallbacks, } from './wallet';
21
21
  /**
22
22
  * Embedded wallet hook options with callbacks.
23
23
  */
@@ -1,4 +1,4 @@
1
- import type { EmbeddedEthereumWalletState, EmbeddedSolanaWalletState, EmbeddedSolanaWalletConnectedState, EmbeddedSolanaWalletConnectingState, EmbeddedSolanaWalletReconnectingState, EmbeddedSolanaWalletDisconnectedState, EmbeddedSolanaWalletNeedsRecoveryState, EmbeddedSolanaWalletCreatingState, EmbeddedSolanaWalletErrorState } from './wallet';
1
+ import type { EmbeddedEthereumWalletState, EmbeddedSolanaWalletConnectedState, EmbeddedSolanaWalletConnectingState, EmbeddedSolanaWalletCreatingState, EmbeddedSolanaWalletDisconnectedState, EmbeddedSolanaWalletErrorState, EmbeddedSolanaWalletNeedsRecoveryState, EmbeddedSolanaWalletReconnectingState, EmbeddedSolanaWalletState } from './wallet';
2
2
  /**
3
3
  * Type guard to check if embedded wallet is connected
4
4
  *
@@ -1,4 +1,4 @@
1
- export interface OpenfortEmbeddedEthereumWalletProvider {
1
+ interface OpenfortEmbeddedEthereumWalletProvider {
2
2
  request: (args: {
3
3
  method: string;
4
4
  params?: any[];
@@ -7,27 +7,27 @@ export interface OpenfortEmbeddedEthereumWalletProvider {
7
7
  removeListener: (event: string, handler: (...args: any[]) => void) => void;
8
8
  [key: string]: any;
9
9
  }
10
- export interface OpenfortEmbeddedSolanaWalletProvider {
10
+ interface OpenfortEmbeddedSolanaWalletProvider {
11
11
  signTransaction: (transaction: any) => Promise<any>;
12
12
  signAllTransactions: (transactions: any[]) => Promise<any[]>;
13
13
  publicKey: string;
14
14
  [key: string]: any;
15
15
  }
16
- export interface OpenfortEthereumEmbeddedWalletAccount {
16
+ interface OpenfortEthereumEmbeddedWalletAccount {
17
17
  address: string;
18
18
  ownerAddress?: string;
19
19
  implementationType?: string;
20
20
  chainType: 'ethereum';
21
21
  walletIndex: number;
22
22
  }
23
- export interface OpenfortSolanaEmbeddedWalletAccount {
23
+ interface OpenfortSolanaEmbeddedWalletAccount {
24
24
  address: string;
25
25
  chainType: 'solana';
26
26
  walletIndex: number;
27
27
  }
28
- import { ChainTypeEnum } from '@openfort/openfort-js';
28
+ import type { ChainTypeEnum } from '@openfort/openfort-js';
29
29
  import type { ErrorCallback } from './auth';
30
- import { Hex } from './hex';
30
+ import type { Hex } from './hex';
31
31
  /**
32
32
  * Openfort embedded wallet account union type
33
33
  */
@@ -149,7 +149,7 @@ export type EmbeddedEthereumWalletActions = {
149
149
  */
150
150
  wallets: ConnectedEmbeddedEthereumWallet[];
151
151
  };
152
- export type EthereumWalletState = IEmbeddedEthereumWalletConnectedState | IEmbeddedEthereumWalletConnectingState | IEmbeddedEthereumWalletReconnectingState | IEmbeddedEthereumWalletDisconnectedState | IEmbeddedEthereumWalletNeedsRecoveryState | IEmbeddedEthereumWalletCreatingState | IEmbeddedEthereumWalletErrorState;
152
+ type EthereumWalletState = IEmbeddedEthereumWalletConnectedState | IEmbeddedEthereumWalletConnectingState | IEmbeddedEthereumWalletReconnectingState | IEmbeddedEthereumWalletDisconnectedState | IEmbeddedEthereumWalletNeedsRecoveryState | IEmbeddedEthereumWalletCreatingState | IEmbeddedEthereumWalletErrorState;
153
153
  /**
154
154
  * Main embedded wallet state union
155
155
  */
package/package.json CHANGED
@@ -1,16 +1,9 @@
1
1
  {
2
2
  "name": "@openfort/react-native",
3
3
  "main": "dist/index.js",
4
- "version": "0.1.14",
4
+ "version": "0.1.16",
5
5
  "license": "MIT",
6
6
  "description": "React Native SDK for Openfort platform integration",
7
- "scripts": {
8
- "build": "rimraf dist && tsc",
9
- "lint": "eslint . --ignore-pattern dist",
10
- "link": "yarn link",
11
- "unlink": "yarn unlink",
12
- "docs:build": "typedoc"
13
- },
14
7
  "types": "dist/types/index.d.ts",
15
8
  "files": [
16
9
  "dist"
@@ -23,39 +16,101 @@
23
16
  }
24
17
  },
25
18
  "dependencies": {
26
- "@openfort/openfort-js": "^0.10.28"
19
+ "@openfort/openfort-js": "^0.10.35"
27
20
  },
28
21
  "peerDependencies": {
29
22
  "expo-apple-authentication": "*",
23
+ "expo-application": "*",
30
24
  "expo-crypto": "*",
31
25
  "expo-linking": "*",
32
26
  "expo-secure-store": "*",
33
27
  "expo-web-browser": "*",
34
28
  "react": "*",
35
- "expo-application": "*",
36
29
  "react-native": "*",
37
30
  "react-native-webview": "*"
38
31
  },
39
32
  "devDependencies": {
40
- "@eslint/js": "^9.17.0",
33
+ "@biomejs/biome": "^2.2.4",
34
+ "@changesets/changelog-github": "^0.5.1",
35
+ "@changesets/cli": "^2.29.7",
41
36
  "@types/react": "~18.3.12",
42
- "@types/react-test-renderer": "^18.3.0",
43
37
  "buffer": "^5.4.3",
44
- "eslint": "^9.17.0",
45
- "eslint-plugin-react": "^7.37.3",
46
38
  "expo-apple-authentication": "^7.2.4",
47
39
  "expo-application": "^6.1.4",
48
40
  "expo-crypto": "14.0.2",
49
41
  "expo-linking": "^7.1.5",
50
42
  "expo-secure-store": "^14.2.3",
51
43
  "expo-web-browser": "^14.1.6",
44
+ "knip": "^5.69.1",
52
45
  "react": "^18.3.1",
53
46
  "react-native": "0.77.1",
54
47
  "react-native-webview": "^13.15.0",
55
- "typedoc": "^0.26.5",
56
- "typescript": "^5.5.3",
57
- "typescript-eslint": "^8.19.0"
48
+ "typedoc": "^0.28.14",
49
+ "typescript": "^5.9.3"
50
+ },
51
+ "knip": {
52
+ "ignore": [
53
+ ".github/**",
54
+ ".husky/**",
55
+ ".parcel-cache/**",
56
+ "**/.next/**",
57
+ "**/dist/**",
58
+ "**/stats.html",
59
+ "sdk/copyVersion.cjs",
60
+ "sdk/scripts/**",
61
+ "test/**",
62
+ "**/next-env.d.ts",
63
+ "**/vite-env.d.ts"
64
+ ],
65
+ "ignoreDependencies": [
66
+ "buffer"
67
+ ],
68
+ "jest": {
69
+ "entry": [
70
+ "**/*.{test,spec}.{js,ts,tsx}"
71
+ ]
72
+ },
73
+ "workspaces": {
74
+ ".": {
75
+ "entry": [
76
+ "typedoc.json!"
77
+ ]
78
+ },
79
+ "sdk": {
80
+ "entry": [
81
+ "src/index.ts!"
82
+ ],
83
+ "ignore": [
84
+ "version.ts"
85
+ ],
86
+ "ignoreDependencies": [
87
+ "axios-retry"
88
+ ]
89
+ },
90
+ "packages/internal/openapi-clients": {
91
+ "entry": [
92
+ "src/backend-api-clients.ts!",
93
+ "src/backend/index.ts!"
94
+ ],
95
+ "ignore": [
96
+ "src/backend-openapi.json"
97
+ ]
98
+ }
99
+ }
58
100
  },
59
101
  "private": false,
60
- "packageManager": "yarn@1.22.17"
61
- }
102
+ "scripts": {
103
+ "build": "tsc",
104
+ "check": "biome check",
105
+ "clean": "rm -rf dist",
106
+ "changeset": "changeset",
107
+ "changeset:version": "pnpm install --lockfile-only && changeset version",
108
+ "changeset:publish": "pnpm build && changeset publish",
109
+ "check:unused": "pnpm clean && knip",
110
+ "check:fix": "biome check --write --unsafe",
111
+ "lint": "tsc -b && biome lint .",
112
+ "link": "pnpm link",
113
+ "unlink": "pnpm unlink",
114
+ "docs:build": "typedoc"
115
+ }
116
+ }
@@ -1 +0,0 @@
1
- "use strict";
File without changes
@@ -1 +0,0 @@
1
- "use strict";
File without changes