@openfort/react-native 1.0.3 → 1.0.5
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
|
@@ -175,8 +175,25 @@ export function useEmbeddedEthereumWallet(options = {}) {
|
|
|
175
175
|
}
|
|
176
176
|
return policy;
|
|
177
177
|
};
|
|
178
|
-
|
|
179
|
-
|
|
178
|
+
// Build chains map from supportedChains (chainId -> rpcUrl)
|
|
179
|
+
const resolveChains = () => {
|
|
180
|
+
if (!supportedChains || supportedChains.length === 0)
|
|
181
|
+
return undefined;
|
|
182
|
+
const chainsMap = {};
|
|
183
|
+
for (const chain of supportedChains) {
|
|
184
|
+
const rpcUrl = chain.rpcUrls?.default?.http?.[0];
|
|
185
|
+
if (rpcUrl) {
|
|
186
|
+
chainsMap[chain.id] = rpcUrl;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
return Object.keys(chainsMap).length > 0 ? chainsMap : undefined;
|
|
190
|
+
};
|
|
191
|
+
return await client.embeddedWallet.getEthereumProvider({
|
|
192
|
+
announceProvider: false,
|
|
193
|
+
policy: resolvePolicy(),
|
|
194
|
+
chains: resolveChains(),
|
|
195
|
+
});
|
|
196
|
+
}, [client.embeddedWallet, walletConfig, options.chainId, supportedChains]);
|
|
180
197
|
// Initialize provider when recovering an active wallet on mount
|
|
181
198
|
useEffect(() => {
|
|
182
199
|
// Only initialize if we have an account but no provider
|
package/dist/index.js
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
// Re-export commonly used types from @openfort/openfort-js
|
|
12
12
|
// Re-export enums and values from @openfort/openfort-js
|
|
13
13
|
// Re-export event listener functionality from @openfort/openfort-js
|
|
14
|
-
export { AccountTypeEnum, ChainTypeEnum, EmbeddedState, OAuthProvider, Openfort as OpenfortClient, OpenfortConfiguration, OpenfortError, OpenfortEvents, openfortEvents, RecoveryMethod, ShieldConfiguration, } from '@openfort/openfort-js';
|
|
14
|
+
export { AccountTypeEnum, ChainTypeEnum, EmbeddedState, OAuthProvider, Openfort as OpenfortClient, OpenfortConfiguration, OpenfortError, OpenfortEvents, openfortEvents, RecoveryMethod, ShieldConfiguration, ThirdPartyOAuthProvider, } from '@openfort/openfort-js';
|
|
15
15
|
// Re-export all components and UI elements
|
|
16
16
|
export * from './components';
|
|
17
17
|
// Re-export constants
|
package/dist/types/index.d.ts
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* required to integrate Openfort authentication and embedded wallets into React Native and
|
|
8
8
|
* Expo applications.
|
|
9
9
|
*/
|
|
10
|
-
export { AccountTypeEnum, AuthInitPayload, AuthResponse, ChainTypeEnum, EmbeddedAccount, EmbeddedState, OAuthProvider, Openfort as OpenfortClient, OpenfortConfiguration, OpenfortError, OpenfortEventMap, OpenfortEvents, openfortEvents, Provider, RecoveryMethod, RecoveryParams, ShieldConfiguration, SignedMessagePayload, } from '@openfort/openfort-js';
|
|
10
|
+
export { AccountTypeEnum, AuthInitPayload, AuthResponse, ChainTypeEnum, EmbeddedAccount, EmbeddedState, OAuthProvider, Openfort as OpenfortClient, OpenfortConfiguration, OpenfortError, OpenfortEventMap, OpenfortEvents, openfortEvents, Provider, RecoveryMethod, RecoveryParams, ShieldConfiguration, SignedMessagePayload, ThirdPartyOAuthProvider, } from '@openfort/openfort-js';
|
|
11
11
|
export * from './components';
|
|
12
12
|
export * from './constants';
|
|
13
13
|
export * from './core';
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openfort/react-native",
|
|
3
3
|
"main": "dist/index.js",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.5",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"description": "React Native SDK for Openfort platform integration",
|
|
7
7
|
"repository": {
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
}
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@openfort/openfort-js": "^1.1.
|
|
27
|
+
"@openfort/openfort-js": "^1.1.4"
|
|
28
28
|
},
|
|
29
29
|
"peerDependencies": {
|
|
30
30
|
"expo-apple-authentication": "*",
|