Skip to content

fix(wallet): apply sendCalls dataSuffix when a call has no data - #5301

Merged
jxom merged 2 commits into
mainfrom
fix/send-calls-data-suffix-no-data
Oct 26, 2026
Merged

jxom merged 2 commits into
mainfrom
fix/send-calls-data-suffix-no-data

Conversation

@jxom

@jxom jxom commented Oct 26, 2026

Copy link
Copy Markdown
Member

Supersedes #5292 and keeps @mortezashojaei's original commit.

sendCalls only appended a call's dataSuffix when the call already had data. A call without data, such as a plain value transfer, lost its suffix on both the wallet_sendCalls request and the eth_sendTransaction fallback. A call with data: '0x' already got the suffix, so the behavior wasn't consistent. This is the same problem #4401 fixed for sendTransaction (#4343).

The fix appends the suffix to data ?? '0x', which matches sendTransaction, sendTransactionSync and simulateBlocks. Calls that already have data are unchanged. A client-level dataSuffix is still only sent as the dataSuffix capability on wallet_sendCalls.

Because the suffix is set per call, appending calldata to a value transfer is opt-in. Note that such a transfer to a contract with receive() but no fallback() will revert.

Changes:

  • src/actions/wallet/sendCalls.ts: apply the suffix when data is missing.
  • Tests: args: dataSuffix (no data) for the wallet_sendCalls request, and behavior: dataSuffix (no data) for the eth_sendTransaction fallback, which reads back the mined transaction's input.
  • Docs: calls.dataSuffix says a call without data is sent with the suffix as its data.
  • Patch changeset.

Out of scope, pre-existing: on the fallback, a per-call dataSuffix and client.dataSuffix both get appended (0x12345678cafe), although the action-level suffix is documented to take precedence.


Generated by Claude Code

mortezashojaei and others added 2 commits October 26, 2026 05:12
Adds a fallback test for a value-only call with a `dataSuffix`, and
documents that a call without `data` is sent with the suffix as its data.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01HZvmnnr4n6swjYTWpmKcpP
@vercel

vercel Bot commented Oct 26, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated
viem Building Building Preview Oct 26, 2026 5:15am UTC

Request Review

@changeset-bot

changeset-bot Bot commented Oct 26, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: bc14a02

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

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 26, 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-26T05:17:36.818748Z bc14a02 PR opened
ℹ️ 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 26, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/viem@5301

commit: bc14a02

@jxom
jxom merged commit efda1c4 into main Oct 26, 2026
39 of 40 checks passed
@jxom
jxom deleted the fix/send-calls-data-suffix-no-data branch October 26, 2026 05:20
@github-actions github-actions Bot mentioned this pull request Oct 26, 2026

This branch was successfully deployed

1 active deployment
Preview — bc14a022 Deployed Oct 26, 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.

3 participants