Skip to content

fix(chains): build explorer api requests with URL params#4625

Merged
jxom merged 1 commit into
mainfrom
fix/chains-explorer-apiurl-searchparams
May 17, 2026
Merged

fix(chains): build explorer api requests with URL params#4625
jxom merged 1 commit into
mainfrom
fix/chains-explorer-apiurl-searchparams

Conversation

@jxom
Copy link
Copy Markdown
Member

@jxom jxom commented May 17, 2026

Summary

  • Replace template-string concatenation in test/scripts/chains.test.ts (blockExplorer.apiUrl path) with new URL() + searchParams.set(), so values are encoded safely and pre-existing query params (e.g. Etherscan v2 chainid=...) are preserved.
  • Drop trailing ? from morphHolesky.apiUrl so the URL is well-formed.
  • Add patch changeset for the morphHolesky fix.

Based on #4602 by @tn0vak — credit to them for the diagnosis and original patch.

Test plan

  • pnpm test:chains passes against the updated blockExplorer.apiUrl path.
  • Morph Holesky explorer request resolves without a doubled ?.

Replaces fragile template-string concatenation in the
`blockExplorer.apiUrl` test path with `new URL()` + `searchParams`,
which encodes values safely and preserves pre-existing query params
(e.g. Etherscan v2's `chainid=...`). Also normalizes
`morphHolesky.apiUrl` to drop the trailing `?`.
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 17, 2026

🦋 Changeset detected

Latest commit: 25274c1

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
viem Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel
Copy link
Copy Markdown

vercel Bot commented May 17, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
viem Building Building Preview, Comment May 17, 2026 7:23am

Request Review

@jxom jxom merged commit ddee0b2 into main May 17, 2026
20 of 27 checks passed
@jxom jxom deleted the fix/chains-explorer-apiurl-searchparams branch May 17, 2026 07:24
@github-actions github-actions Bot mentioned this pull request May 17, 2026
@tmm tmm mentioned this pull request May 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant