@zerodev/wallet-react 0.0.1-alpha.11 → 0.0.1-alpha.12

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zerodev/wallet-react",
3
- "version": "0.0.1-alpha.11",
3
+ "version": "0.0.1-alpha.12",
4
4
  "description": "React hooks for ZeroDev Wallet SDK",
5
5
  "sideEffects": false,
6
6
  "main": "./dist/_cjs/index.js",
@@ -30,7 +30,7 @@
30
30
  "wagmi": "^3.0.0",
31
31
  "zustand": "^5.0.3",
32
32
  "ox": "^0.3.0",
33
- "@zerodev/wallet-core": "0.0.1-alpha.10"
33
+ "@zerodev/wallet-core": "0.0.1-alpha.11"
34
34
  },
35
35
  "devDependencies": {
36
36
  "@types/react": "^19",
package/src/connector.ts CHANGED
@@ -107,12 +107,19 @@ export function zeroDevWallet(
107
107
  return createConnector<Provider, Properties>((wagmiConfig) => {
108
108
  let store: ReturnType<typeof createZeroDevWalletStore>
109
109
  let provider: ReturnType<typeof createProvider>
110
+ let initPromise: Promise<void> | null = null
110
111
 
111
112
  // Get transports from Wagmi config (uses user's RPC URLs)
112
113
  const transports = wagmiConfig.transports
113
114
 
114
- // Lazy initialization - only runs on client side
115
+ // Lazy initialization - only runs on client side (idempotent)
115
116
  const initialize = async () => {
117
+ if (initPromise) return initPromise
118
+ initPromise = doInitialize()
119
+ return initPromise
120
+ }
121
+
122
+ const doInitialize = async () => {
116
123
  console.log('Initializing ZeroDevWallet connector...')
117
124
 
118
125
  // Initialize wallet SDK