feat(transaction-pay-controller): expose required transaction count - #9897
Open
dan437 wants to merge 4 commits into
Open
feat(transaction-pay-controller): expose required transaction count#9897dan437 wants to merge 4 commits into
dan437 wants to merge 4 commits into
Conversation
10 tasks
dan437
marked this pull request as ready for review
August 26, 2026 13:49
matthewwalsh0
self-requested a review
August 26, 2026 14:02
matthewwalsh0
requested changes
Aug 27, 2026
| * @param options.request - Associated quote request. | ||
| * @returns The expected child transaction count, or `undefined` when unknown. | ||
| */ | ||
| export function getRequiredTransactionCount({ |
Member
There was a problem hiding this comment.
The pay controller is just one instance where we call addTransactionBatch and may sequentially sign if EIP-7702 is supported.
So rather than coupling the modal to every instance that does this, should we instead provide this information at the source within the TransactionController?
Maybe some transient state such as signatureCounts that is keyed on batch ID that is set within addTransactionBatch?
Then the hardware modal can check using the batchId of the transaction it's signing?
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.
Explanation
Expose the expected number of TransactionController child transactions on Relay-backed payment quotes. The value uses the same Relay submission logic, handles EIP-7702 batches as one transaction, and stays undefined for unsupported paths.
This belongs in the controller because only it knows whether Relay steps will become one EIP-7702 batch or multiple sequential TransactionController transactions. Keeping that logic in Core prevents clients from parsing provider-specific quote data and duplicating submission rules.
Relay quotes also avoid gas fee token sponsorship when the source account cannot use EIP-7702. Eligibility must be correct at the quote source so every client avoids unsupported hardware routes. The Mobile consumer depends on this PR and a package release before it can use
requiredTransactionCount.References
Checklist
Note
Medium Risk
Changes Relay quote fee presentation and adds a new quote field used by Mobile pay UX; incorrect counts or gas-station gating could mislead confirmation flows or offer unsupported EIP-7702 sponsorship.
Overview
Relay-backed TransactionPayQuote values can now include an optional
requiredTransactionCount, computed during quote normalization so clients know how many TransactionController child transactions execution will create without re-parsing Relay steps.The count reuses
getRelayTransactionStepData(now exported and typed against rawRelayQuote): sequential flows report one per local step, EIP-7702 batches report 1, and the field is omitted when the count is unknown (execute quotes, post-quote / payment-override / HyperLiquid / Polymarket deposit paths, empty or malformed step data).Gas fee token sponsorship on Relay quotes is gated on
accountSupports7702: when the source account does not support EIP-7702,calculateSourceNetworkCostskips the gas station path so quotes no longer setfees.isSourceGasFeeTokenor call gas-fee-token lookup—aligning quoted fees with hardware and other non-7702 accounts.Reviewed by Cursor Bugbot for commit af4ba6d. Bugbot is set up for automated code reviews on this repo. Configure here.