Skip to content

fix(0.x): port recent viem fixes to AbiItem, AbiEvent, TypedData, Hex, and RpcTransport - #527

Merged
jxom merged 12 commits into
0.xfrom
jxom/happy-pascal-cptf94-0.x
Oct 25, 2026
Merged

jxom merged 12 commits into
0.xfrom
jxom/happy-pascal-cptf94-0.x

Conversation

@jxom

@jxom jxom commented Oct 24, 2026 •

Copy link
Copy Markdown
Member

Backports #526 to 0.x, adapted to the 0.x code and in sync with viem main at 2867b2a. It also includes #516, which 0.x never received.

Fix 0.x change
wevm/viem#5240 TypedData.extractEip712DomainTypes keeps an empty version. Same as main.
wevm/viem#5283 Hex.assert / Hex.validate even option. Same as main.
wevm/viem#5281 AbiItem.fromAbi array overload resolution, tuple object args read by component name, and empty-array ambiguity for address[] vs string[]/bytes[]. Same as main, keeping the inline regexes of 0.x.
wevm/viem#5238, wevm/viem#5280 AbiEvent.assertArgs: indexed string args never matched, since Hash.keccak256(Bytes) returns bytes on 0.x. They now hash to hex, as on main. Non-indexed string/bytes now match by value, and bytes/bytesN match in either hex case. 0.x has no extractLogs, so only assertArgs changes.
wevm/viem#5200 RpcTransport.fromHttp applies timeout to the response body. It also keeps the timeout when fetchOptions.signal is set, using the AbortSignal.any composition from main.
#516 Cherry-picked normalizeSignature fix (keeps the first parameter after ( ).
#414 Ported the docgen Variable link case from main. Without it, every 0.x docs deployment has failed since #509.

Not included: the Signature.toHex padding from main. 0.x stores r/s as bigints and already serializes them with Hex.fromNumber(…, { size: 32 }).

Validation: pnpm check, pnpm check:types, pnpm check:tsdoc, pnpm docs:gen, and pnpm --filter site build pass. The changed suites pass in the core project without Anvil global setup, except existing tests that need a local Anvil node, which wasn't available. The new AbiEvent, AbiItem, and RpcTransport tests were confirmed to fail without their fixes.

🤖 Generated with Claude Code

https://claude.ai/code/session_0133zgX2g8oLCoH4KuY8tM9b

claude and others added 7 commits October 24, 2026 02:03
Ports wevm/viem#5283.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0133zgX2g8oLCoH4KuY8tM9b
Ports wevm/viem#5281.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0133zgX2g8oLCoH4KuY8tM9b
…ith a caller signal

Ports wevm/viem#5200.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0133zgX2g8oLCoH4KuY8tM9b
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0133zgX2g8oLCoH4KuY8tM9b
@vercel

vercel Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
ox Ready Ready Preview Oct 25, 2026 11:47pm UTC

Request Review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-25T23:43:47.299160Z 1e4ee6b New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@pkg-pr-new

pkg-pr-new Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/ox@527

commit: 1e4ee6b

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f470db61a6

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/core/RpcTransport.ts

// Read the body within the timeout too, so a response that stalls
// after its headers cannot hang the request.
const data = await (async () => {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve caller aborts while reading the response body

When response headers have arrived but response.json() or response.text() is still pending, aborting fetchOptions.signal now rejects the body read with AbortError inside promise.withTimeout; that helper converts every AbortError into Promise.TimeoutError. Before this change the body was read outside the timeout wrapper, so this phase propagated the caller's abort normally. Distinguish the timeout controller from the caller signal so user cancellation is not reported as a timeout.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Keeping this as is. A caller abort already rejects with Promise.TimeoutError before the response headers arrive, and the existing options: signal test asserts that. Reading the body inside withTimeout gives the body phase the same behavior. Reporting caller aborts separately would change promise.withTimeout, and with it the abort error this transport has always returned. That's out of scope for this backport, and main behaves the same way.


Generated by Claude Code

Comment thread src/core/RpcTransport.ts Resolved
…m.fromAbi` overloads

Syncs with the merged wevm/viem#5281: tuple object args are read by component
name, and an empty array is ambiguous for `address[]` vs `string[]`/`bytes[]`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0133zgX2g8oLCoH4KuY8tM9b
Ports the `Variable` case of `getLinkForApiItem` from `main` (#414). Without
it, the `{@link ox#AccountConfig.maxSignatures}` reference added in #509
fails `docs:gen` and every `0.x` docs deployment.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0133zgX2g8oLCoH4KuY8tM9b

jxom commented Oct 25, 2026

Copy link
Copy Markdown
Member Author

The Vercel deployment failure isn't caused by this PR. Every 0.x docs deployment has failed since #509 (including #519 and the release #520), and pnpm docs:gen fails the same way on unmodified 0.x. The cause is Missing URL structure for Variable: the 0.x docgen can't build a link to {@link ox#AccountConfig.maxSignatures}, which is a constant. bb55721 ports the two-line Variable case of getLinkForApiItem from main (#414). With it, pnpm docs:gen and pnpm --filter site build both pass locally on this branch.


Generated by Claude Code

…Transport.fromHttp`

`AbortSignal.any` is missing on Node < 18.17 and older browsers, which the
0.x line supports. There, the transport now uses the caller signal alone,
as it did before, instead of throwing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0133zgX2g8oLCoH4KuY8tM9b
jxom pushed a commit that referenced this pull request Oct 25, 2026
…Transport.fromHttp`

Matches the 0.x backport (#527): runtimes without `AbortSignal.any`
(Node < 18.17, older browsers) use the caller signal alone instead of
throwing. Also aligns the `AbiEvent.assertArgs` test and the
`getComponentValue` comment with 0.x.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0133zgX2g8oLCoH4KuY8tM9b
Matches the main-branch test in #526.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0133zgX2g8oLCoH4KuY8tM9b
jxom added a commit that referenced this pull request Oct 25, 2026
…ypedData`, `Hex`, and `RpcTransport` (#526)

* fix: keep empty `version` in `TypedData.extractEip712DomainTypes`

Ports wevm/viem#5240.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0133zgX2g8oLCoH4KuY8tM9b

* feat: add `even` option to `Hex.assert` and `Hex.validate`

Ports wevm/viem#5283.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0133zgX2g8oLCoH4KuY8tM9b

* fix: left-pad short `r` and `s` in `Signature.toHex`

Ports wevm/viem#5279.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0133zgX2g8oLCoH4KuY8tM9b

* fix: array overload resolution in `AbiItem.fromAbi`

Ports wevm/viem#5281.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0133zgX2g8oLCoH4KuY8tM9b

* fix: `AbiEvent.assertArgs` and `AbiEvent.extractLogs` `args` matching

Ports wevm/viem#5280.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0133zgX2g8oLCoH4KuY8tM9b

* fix: apply `RpcTransport.fromHttp` timeout to the response body

Ports wevm/viem#5200.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0133zgX2g8oLCoH4KuY8tM9b

* fix: read tuple object args by name and match empty arrays in `AbiItem.fromAbi` overloads

Syncs with the merged wevm/viem#5281: tuple object args are read by component
name, and an empty array is ambiguous for `address[]` vs `string[]`/`bytes[]`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0133zgX2g8oLCoH4KuY8tM9b

* fix: keep the caller signal when `AbortSignal.any` is missing in `RpcTransport.fromHttp`

Matches the 0.x backport (#527): runtimes without `AbortSignal.any`
(Node < 18.17, older browsers) use the caller signal alone instead of
throwing. Also aligns the `AbiEvent.assertArgs` test and the
`getComponentValue` comment with 0.x.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0133zgX2g8oLCoH4KuY8tM9b

---------

Co-authored-by: Claude <noreply@anthropic.com>
@jxom
jxom merged commit b0588e1 into 0.x Oct 25, 2026
13 of 14 checks passed
@jxom
jxom deleted the jxom/happy-pascal-cptf94-0.x branch October 25, 2026 23:43
@github-actions github-actions Bot mentioned this pull request Oct 25, 2026

This branch was successfully deployed

1 active deployment
Preview — 1e4ee6ba Deployed Oct 25, 2026 by vercel[bot]
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.

2 participants