@zerodev/wallet-react 0.0.1-alpha.3 → 0.0.1-alpha.4
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
package/src/connector.ts
CHANGED
|
@@ -249,12 +249,13 @@ export function zeroDevWallet(
|
|
|
249
249
|
},
|
|
250
250
|
|
|
251
251
|
async getProvider() {
|
|
252
|
-
|
|
252
|
+
if (!provider) {
|
|
253
|
+
await initialize()
|
|
254
|
+
}
|
|
253
255
|
return provider
|
|
254
256
|
},
|
|
255
257
|
|
|
256
258
|
async switchChain({ chainId }) {
|
|
257
|
-
await initialize()
|
|
258
259
|
console.log(`Switching to chain ${chainId}...`)
|
|
259
260
|
const state = store.getState()
|
|
260
261
|
|
|
@@ -304,6 +305,7 @@ export function zeroDevWallet(
|
|
|
304
305
|
store.getState().setKernelClient(chainId, kernelClient)
|
|
305
306
|
}
|
|
306
307
|
|
|
308
|
+
wagmiConfig.emitter.emit('change', { chainId })
|
|
307
309
|
return params.chains.find((c) => c.id === chainId)!
|
|
308
310
|
},
|
|
309
311
|
|