@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.
- package/dist/components/AuthBoundary.js +0 -2
- package/dist/constants/config.js +1 -1
- package/dist/constants/index.js +1 -0
- package/dist/core/client.js +5 -5
- package/dist/core/index.js +3 -3
- package/dist/core/provider.js +13 -10
- package/dist/core/storage.js +5 -5
- package/dist/hooks/auth/index.js +3 -3
- package/dist/hooks/auth/useCreateWalletPostAuth.js +8 -4
- package/dist/hooks/auth/useEmailAuth.js +10 -8
- package/dist/hooks/auth/useGuestAuth.js +5 -3
- package/dist/hooks/auth/useOAuth.js +17 -11
- package/dist/hooks/auth/useSignOut.js +7 -7
- package/dist/hooks/auth/useWalletAuth.js +19 -11
- package/dist/hooks/core/useUser.js +2 -2
- package/dist/hooks/index.js +3 -2
- package/dist/hooks/wallet/useWallets.js +38 -32
- package/dist/index.js +8 -9
- package/dist/lib/logger.js +3 -11
- package/dist/native/index.js +4 -4
- package/dist/native/oauth.js +7 -12
- package/dist/native/storage.js +10 -2
- package/dist/native/webview.js +7 -5
- package/dist/types/baseFlowState.js +1 -1
- package/dist/types/components/AuthBoundary.d.ts +1 -2
- package/dist/types/components/index.d.ts +1 -1
- package/dist/types/constants/config.d.ts +1 -1
- package/dist/types/core/client.d.ts +1 -1
- package/dist/types/core/context.d.ts +2 -2
- package/dist/types/core/index.d.ts +5 -5
- package/dist/types/core/provider.d.ts +1 -1
- package/dist/types/core/storage.d.ts +1 -1
- package/dist/types/hooks/auth/index.d.ts +6 -2
- package/dist/types/hooks/auth/useCreateWalletPostAuth.d.ts +1 -15
- package/dist/types/hooks/auth/useEmailAuth.d.ts +2 -2
- package/dist/types/hooks/auth/useGuestAuth.d.ts +2 -2
- package/dist/types/hooks/auth/useOAuth.d.ts +2 -2
- package/dist/types/hooks/auth/useSignOut.d.ts +2 -2
- package/dist/types/hooks/auth/useWalletAuth.d.ts +2 -2
- package/dist/types/hooks/core/useOpenfort.d.ts +1 -1
- package/dist/types/hooks/index.d.ts +1 -1
- package/dist/types/hooks/wallet/useWallets.d.ts +4 -4
- package/dist/types/index.d.ts +4 -6
- package/dist/types/index.js +1 -1
- package/dist/types/lib/hookConsistency.d.ts +2 -2
- package/dist/types/lib/logger.d.ts +0 -2
- package/dist/types/native/index.d.ts +4 -4
- package/dist/types/native/oauth.d.ts +1 -1
- package/dist/types/native/webview.d.ts +1 -1
- package/dist/types/oauth.js +1 -1
- package/dist/types/types/baseFlowState.d.ts +2 -2
- package/dist/types/types/config.d.ts +0 -12
- package/dist/types/types/hookOption.d.ts +1 -1
- package/dist/types/types/index.d.ts +5 -5
- package/dist/types/types/predicates.d.ts +1 -1
- package/dist/types/types/wallet.d.ts +7 -7
- package/package.json +74 -19
- package/dist/hooks/auth/useAuthCallback.js +0 -1
- package/dist/types/hooks/auth/useAuthCallback.d.ts +0 -0
- package/dist/types/state.js +0 -1
- package/dist/types/types/state.d.ts +0 -0
package/dist/types/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// Predicate functions (exported directly, not as types)
|
|
2
|
-
export {
|
|
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
|
|
2
|
-
import { OpenfortError } from
|
|
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 {
|
|
2
|
-
export {
|
|
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 {
|
|
5
|
-
export
|
|
4
|
+
export { handleSecureStorageMessage, isSecureStorageMessage, NativeStorageUtils, } from './storage';
|
|
5
|
+
export { EmbeddedWalletWebView, WebViewUtils } from './webview';
|
|
@@ -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
|
*/
|
package/dist/types/oauth.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { OpenfortError } from
|
|
1
|
+
import type { OpenfortError } from './openfortError';
|
|
2
2
|
export type BaseFlowState = {
|
|
3
|
-
status:
|
|
3
|
+
status: 'idle' | 'awaiting-input' | 'loading' | 'success';
|
|
4
4
|
error?: never;
|
|
5
5
|
} | {
|
|
6
6
|
status: 'error';
|
|
@@ -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 {
|
|
17
|
-
export type {
|
|
18
|
-
export type {
|
|
19
|
-
export
|
|
20
|
-
export {
|
|
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,
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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.
|
|
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.
|
|
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
|
-
"@
|
|
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.
|
|
56
|
-
"typescript": "^5.
|
|
57
|
-
|
|
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
|
-
"
|
|
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
|
package/dist/types/state.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
File without changes
|