@wagmi/connectors 0.2.1 → 0.2.2

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.
@@ -234,10 +234,18 @@ var InjectedConnector = class extends Connector {
234
234
  throw new ConnectorNotFoundError();
235
235
  const id = hexValue(chainId);
236
236
  try {
237
- await provider.request({
238
- method: "wallet_switchEthereumChain",
239
- params: [{ chainId: id }]
240
- });
237
+ await Promise.all([
238
+ provider.request({
239
+ method: "wallet_switchEthereumChain",
240
+ params: [{ chainId: id }]
241
+ }),
242
+ new Promise(
243
+ (res) => this.on("change", ({ chain }) => {
244
+ if (chain?.id === chainId)
245
+ res();
246
+ })
247
+ )
248
+ ]);
241
249
  return this.chains.find((x) => x.id === chainId) ?? {
242
250
  id: chainId,
243
251
  name: `Chain ${id}`,
package/dist/injected.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  InjectedConnector
3
- } from "./chunk-YUNHZJBB.js";
3
+ } from "./chunk-LNIFBRWC.js";
4
4
  import "./chunk-5NCTPR6C.js";
5
5
  export {
6
6
  InjectedConnector
package/dist/metaMask.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  InjectedConnector
3
- } from "./chunk-YUNHZJBB.js";
3
+ } from "./chunk-LNIFBRWC.js";
4
4
  import {
5
5
  __privateAdd,
6
6
  __privateGet,
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@wagmi/connectors",
3
3
  "description": "A collection of connectors for wagmi",
4
4
  "license": "MIT",
5
- "version": "0.2.1",
5
+ "version": "0.2.2",
6
6
  "peerDependencies": {
7
7
  "@wagmi/core": ">=0.9.x",
8
8
  "ethers": ">=5.5.1",