@wagmi/connectors 0.3.6 → 0.3.7

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.
@@ -11,6 +11,7 @@ import {
11
11
  AddChainError,
12
12
  ChainNotConfiguredError,
13
13
  ConnectorNotFoundError,
14
+ ProviderRpcError,
14
15
  ResourceUnavailableError,
15
16
  SwitchChainError,
16
17
  UserRejectedRequestError,
@@ -292,6 +293,12 @@ var InjectedConnector = class extends Connector {
292
293
  }
293
294
  ]
294
295
  });
296
+ const currentChainId = await this.getChainId();
297
+ if (currentChainId !== chainId)
298
+ throw new ProviderRpcError(
299
+ "User rejected switch after adding network.",
300
+ { code: 4001 }
301
+ );
295
302
  return chain;
296
303
  } catch (addError) {
297
304
  if (this.isUserRejectedRequestError(addError))
package/dist/injected.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  InjectedConnector
3
- } from "./chunk-QM3JMJ34.js";
3
+ } from "./chunk-L7G4NI56.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-QM3JMJ34.js";
3
+ } from "./chunk-L7G4NI56.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.3.6",
5
+ "version": "0.3.7",
6
6
  "peerDependencies": {
7
7
  "@wagmi/core": ">=0.9.x",
8
8
  "ethers": ">=5.5.1 <6",