@openfort/react 1.0.16 → 1.1.1

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.
@@ -12,11 +12,16 @@ import { isFamily } from '../../utils/wallets.js';
12
12
  import { OpenfortContext, UIContext } from './context.js';
13
13
  import { UIAuthProvider, routes, defaultSendFormState, defaultBuyFormState, notStoredInHistoryRoutes } from './types.js';
14
14
 
15
- const SolanaContextProvider = lazy(() => import(/* @vite-ignore */ '../../solana/SolanaContext.js').then((m) => ({ default: m.SolanaContextProvider })));
16
- const LazyEmbeddedWalletWagmiSync = lazy(() => import(/* @vite-ignore */ '../../wagmi/useEmbeddedWalletWagmiSync.js').then((m) => ({
15
+ // These chunks are lazy-loaded with static specifiers so every bundler (Vite, Rollup, webpack)
16
+ // can resolve and code-split them. Do NOT add a vite-ignore hint to these imports: it makes
17
+ // Vite's dependency pre-bundler keep the import external, so the relative path resolves against
18
+ // node_modules/.vite/deps instead of the package and the provider fails to load in dev
19
+ // ("Failed to resolve import ../../solana/SolanaContext.js"), blanking any Vite app.
20
+ const SolanaContextProvider = lazy(() => import('../../solana/SolanaContext.js').then((m) => ({ default: m.SolanaContextProvider })));
21
+ const LazyEmbeddedWalletWagmiSync = lazy(() => import('../../wagmi/useEmbeddedWalletWagmiSync.js').then((m) => ({
17
22
  default: m.EmbeddedWalletWagmiSync,
18
23
  })));
19
- const LazyConnectKitModal = lazy(() => import(/* @vite-ignore */ '../ConnectModal/index.js'));
24
+ const LazyConnectKitModal = lazy(() => import('../ConnectModal/index.js'));
20
25
  let openfortProviderWarnedNoWagmi = false;
21
26
  /**
22
27
  * Root provider for Openfort. Wrap your app with this to enable connect modal, auth, and wallet features.
@@ -1 +1 @@
1
- {"version":3,"file":"OpenfortProvider.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"OpenfortProvider.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1 +1 @@
1
- export declare const OPENFORT_VERSION = "1.0.16";
1
+ export declare const OPENFORT_VERSION = "1.1.1";
package/build/version.js CHANGED
@@ -1,4 +1,4 @@
1
- const OPENFORT_VERSION = '1.0.16';
1
+ const OPENFORT_VERSION = '1.1.1';
2
2
 
3
3
  export { OPENFORT_VERSION };
4
4
  //# sourceMappingURL=version.js.map
@@ -13,7 +13,6 @@ const defaultConnectors = ({ app, walletConnectProjectId, coinbaseWalletPreferen
13
13
  connectors.push(coinbaseWallet({
14
14
  appName: app.name,
15
15
  appLogoUrl: app.icon,
16
- overrideIsMetaMask: false,
17
16
  preference: coinbaseWalletPreference,
18
17
  }));
19
18
  if (walletConnectProjectId) {
@@ -1 +1 @@
1
- {"version":3,"file":"defaultConnectors.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"defaultConnectors.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -62,6 +62,20 @@ function embeddedWalletConnector() {
62
62
  async getProvider() {
63
63
  return _provider !== null && _provider !== void 0 ? _provider : undefined;
64
64
  },
65
+ async switchChain({ chainId }) {
66
+ const provider = _provider;
67
+ if (!provider)
68
+ throw new Error('Embedded wallet provider not ready');
69
+ const chain = config.chains.find((c) => c.id === chainId);
70
+ if (!chain)
71
+ throw new Error(`Chain ${chainId} is not configured`);
72
+ await provider.request({
73
+ method: 'wallet_switchEthereumChain',
74
+ params: [{ chainId: `0x${chainId.toString(16)}` }],
75
+ });
76
+ config.emitter.emit('change', { chainId });
77
+ return chain;
78
+ },
65
79
  async isAuthorized() {
66
80
  if (!_provider)
67
81
  return false;
@@ -1 +1 @@
1
- {"version":3,"file":"embeddedConnector.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"embeddedConnector.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openfort/react",
3
- "version": "1.0.16",
3
+ "version": "1.1.1",
4
4
  "author": "Openfort (https://www.openfort.io)",
5
5
  "license": "BSD-2-Clause license",
6
6
  "description": "The easiest way to integrate Openfort to your project.",
@@ -65,47 +65,55 @@
65
65
  "react"
66
66
  ],
67
67
  "dependencies": {
68
- "@openfort/openfort-js": "1.3.4",
68
+ "@openfort/openfort-js": "^1.3.5",
69
69
  "buffer": "^6.0.3",
70
70
  "detect-browser": "^5.3.0",
71
71
  "fast-password-entropy": "^1.1.1",
72
72
  "framer-motion": "^6.3.11",
73
73
  "qrcode": "^1.5.0",
74
74
  "react-international-phone": "^4.6.0",
75
- "react-is": "^19.1.0",
75
+ "react-is": "^19.2.7",
76
76
  "react-transition-state": "^1.1.4",
77
77
  "react-use-measure": "^2.1.1",
78
78
  "resize-observer-polyfill": "^1.5.1",
79
79
  "styled-components": "^5.3.5",
80
- "zustand": "^5.0.11"
80
+ "zustand": "^5.0.14"
81
81
  },
82
82
  "peerDependencies": {
83
+ "@coinbase/wallet-sdk": "^4.3.6",
84
+ "@safe-global/safe-apps-provider": "~0.18.6",
85
+ "@safe-global/safe-apps-sdk": "^9.1.0",
83
86
  "@solana/kit": "^2.0.0 || ^5.0.0",
87
+ "@walletconnect/ethereum-provider": "^2.21.1",
84
88
  "react": "17.x || 18.x || 19.x",
85
89
  "react-dom": "17.x || 18.x || 19.x",
86
90
  "viem": "2.x",
87
- "wagmi": "2.x"
91
+ "wagmi": "3.x"
88
92
  },
89
93
  "devDependencies": {
90
- "@biomejs/biome": "^2.3.8",
91
- "@tanstack/react-query": "^5.90.21",
94
+ "@biomejs/biome": "^2.4.16",
95
+ "@coinbase/wallet-sdk": "^4.3.7",
96
+ "@safe-global/safe-apps-provider": "~0.18.6",
97
+ "@safe-global/safe-apps-sdk": "^9.1.0",
98
+ "@tanstack/react-query": "^5.101.0",
92
99
  "@testing-library/react": "^16.3.2",
93
100
  "@testing-library/react-hooks": "^8.0.1",
94
- "@types/node": "18.7.18",
101
+ "@types/node": "^25.9.2",
95
102
  "@types/qrcode": "^1.4.2",
96
103
  "@types/react": "^18.0.6",
97
104
  "@types/react-dom": "^18.0.2",
98
105
  "@types/styled-components": "^5.1.25",
99
- "@wagmi/connectors": "^6.2.0",
100
- "@wagmi/core": "^2.22.1",
101
- "happy-dom": "^20.8.9",
102
- "jsdom": "^28.1.0",
106
+ "@wagmi/connectors": "^8.0.15",
107
+ "@wagmi/core": "^3.5.0",
108
+ "@walletconnect/ethereum-provider": "^2.23.9",
109
+ "happy-dom": "^20.10.2",
110
+ "jsdom": "^29.1.1",
103
111
  "rollup-plugin-peer-deps-external": "^2.2.4",
104
- "rollup-plugin-typescript2": "^0.36.0",
105
- "typescript": "^5.0.4",
112
+ "rollup-plugin-typescript2": "^0.37.0",
113
+ "typescript": "^5.9.3",
106
114
  "typescript-plugin-styled-components": "^2.0.0",
107
- "vitest": "^2.0.0",
108
- "wagmi": "^2.18.2"
115
+ "vitest": "^4.1.0",
116
+ "wagmi": "^3.6.16"
109
117
  },
110
118
  "peerDependenciesMeta": {
111
119
  "@solana/kit": {
@@ -114,6 +122,18 @@
114
122
  "wagmi": {
115
123
  "optional": true
116
124
  },
125
+ "@coinbase/wallet-sdk": {
126
+ "optional": true
127
+ },
128
+ "@walletconnect/ethereum-provider": {
129
+ "optional": true
130
+ },
131
+ "@safe-global/safe-apps-provider": {
132
+ "optional": true
133
+ },
134
+ "@safe-global/safe-apps-sdk": {
135
+ "optional": true
136
+ },
117
137
  "@tanstack/react-query": {
118
138
  "optional": true
119
139
  }