@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
package/dist/metaMask.js
CHANGED