Skip to content

Conversation

@dgca
Copy link
Contributor

@dgca dgca commented Jan 16, 2026

Implements proposal defined here to allow apps to set a default data suffix when creating a client. When transactions are placed with this client, it will automatically add the dataSuffix unless one is explicitly passed.

Note:

I initially tried only adding this to wallet clients, but found that:

  1. This was a bit convoluted and required adding the dataSuffix param in nonstandard ways in order to use it later
  2. estimateContractGas and simulateContract are methods on publicClient, so there was precedent to add this to the base client

I also had to add a dataSuffix param to sendTransaction and sendTransactionSync, as walletClient.writeContract needs to be able to take a dataSuffix and pass it to the underlying action and have that apply rather than the global client's dataSuffix.

@changeset-bot
Copy link

changeset-bot bot commented Jan 16, 2026

🦋 Changeset detected

Latest commit: e806de6

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

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

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

@pkg-pr-new
Copy link

pkg-pr-new bot commented Jan 16, 2026

Open in StackBlitz

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

commit: a976ae5

@dgca dgca marked this pull request as ready for review January 20, 2026 21:16
dgca and others added 10 commits January 20, 2026 14:28
- Use default param value for dataSuffix with client.dataSuffix fallback
- Inline data concatenation instead of separate variable
- writeContract passes dataSuffix through to sendTransaction
- Add dataSuffix param to sendTransaction/sendTransactionSync types
- Simplify sendCalls capabilities logic with imperative style
@jxom jxom merged commit 0e1d62d into wevm:main Jan 22, 2026
5 of 32 checks passed
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