Skip to content

Commit

Permalink
fix: error when adding chains without explorers to MetaMask (#3653)
Browse files Browse the repository at this point in the history
* excluding blockExplorerUrls for chains that do not have blockExplorers

* add changeset
  • Loading branch information
tash-2s committed Mar 17, 2024
1 parent 7e60b5e commit 88a2d74
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions .changeset/two-deers-love.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@wagmi/connectors": patch
"@wagmi/core": patch
---

Fixed error occurring when adding chains without explorers to MetaMask.
2 changes: 1 addition & 1 deletion packages/connectors/src/metaMask.ts
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ export function metaMask(parameters: MetaMaskParameters = {}) {
try {
const { default: blockExplorer, ...blockExplorers } =
chain.blockExplorers ?? {}
let blockExplorerUrls: string[] = []
let blockExplorerUrls
if (blockExplorer)
blockExplorerUrls = [
blockExplorer.url,
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/connectors/injected.ts
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ export function injected(parameters: InjectedParameters = {}) {
try {
const { default: blockExplorer, ...blockExplorers } =
chain.blockExplorers ?? {}
let blockExplorerUrls: string[] = []
let blockExplorerUrls
if (blockExplorer)
blockExplorerUrls = [
blockExplorer.url,
Expand Down

0 comments on commit 88a2d74

Please sign in to comment.