Skip to content

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

Open
jxom wants to merge 8 commits into
0.xfrom
jxom/happy-pascal-cptf94-0.x
Open

jxom wants to merge 8 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 ( ).

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:types and pnpm check 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 Error Error Oct 24, 2026 11:05pm 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-24T23:07:53.493730Z 77648f7 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: 77648f7

@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 👍 / 👎.

Comment thread src/core/RpcTransport.ts
Comment on lines +114 to +117
signal:
signals.length > 1
? AbortSignal.any(signals)
: (signals[0] ?? null),

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 Avoid requiring AbortSignal.any on supported runtimes

When a caller supplies fetchOptions.signal with the default positive timeout, this unconditionally invokes AbortSignal.any. The compatibility page promises Node 18+ support, but this method was only added in Node 18.17, so requests on Node 18.0–18.16 now throw TypeError: AbortSignal.any is not a function before fetchFn runs; previously those requests worked, albeit without the transport timeout. Compose the signals with a fallback for runtimes that lack the static method.

Useful? React with 👍 / 👎.

…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

This branch had an error being deployed

1 failed deployment
Preview — 77648f7d Deployed Oct 24, 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