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