fix: allow prepareTransactionRequest with calls and no top-level to#5079
Merged
tmm merged 3 commits intoApr 28, 2026
Merged
Conversation
prepareTransactionRequest (both the action and query options) previously required a top-level `to` parameter. This made it impossible to use with batched `calls` where each call carries its own `to` address (e.g. EIP-5792 sendCalls flows). - Make `to` optional in the action's type definition - Update `enabled` guard to accept `calls` as an alternative to `to` - Update `queryFn` guard to allow `calls` without `to` - Add test for calls-only usage Amp-Thread-ID: https://ampcode.com/threads/T-019dc057-ceff-76be-b95e-13c3135b46a2 Co-authored-by: Amp <amp@ampcode.com>
|
@deodad is attempting to deploy a commit to the Wevm Team on Vercel. A member of the Team first needs to authorize it. |
🦋 Changeset detectedLatest commit: faefa62 The changes in this PR will be included in the next version bump. This PR includes changesets to release 5 packages
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 |
…epare-transaction-request-calls-without-to
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
prepareTransactionRequest(both the core action and the query options used byusePrepareTransactionRequest) requires a top-leveltoparameter. The query options hardcode:This makes it impossible to use with batched
calls(e.g. EIP-5792sendCallsflows) where each call carries its owntoaddress and no top-leveltois needed. Viem's underlyingprepareTransactionRequestdoes not have this restriction.Fix
tooptional in the action's type definitionenabledguard to acceptcallsas an alternative totoqueryFnguard to allowcallswithoutto