Skip to content

feat(transaction-pay-controller): expose required transaction count - #9897

Open
dan437 wants to merge 4 commits into
mainfrom
conf-1715-expose-funding-transaction-count
Open

feat(transaction-pay-controller): expose required transaction count#9897
dan437 wants to merge 4 commits into
mainfrom
conf-1715-expose-funding-transaction-count

Conversation

@dan437

@dan437 dan437 commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

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

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've communicated my changes to consumers by updating changelogs for packages I've changed
  • I've introduced breaking changes in this PR and have prepared draft pull requests for clients and consumer packages to resolve them

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 raw RelayQuote): 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, calculateSourceNetworkCost skips the gas station path so quotes no longer set fees.isSourceGasFeeToken or 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.

@dan437
dan437 marked this pull request as ready for review August 26, 2026 13:49
@dan437
dan437 requested review from a team as code owners August 26, 2026 13:49
@dan437
dan437 deployed to default-branch August 26, 2026 13:49 — with GitHub Actions Active
@matthewwalsh0
matthewwalsh0 self-requested a review August 26, 2026 14:02
* @param options.request - Associated quote request.
* @returns The expected child transaction count, or `undefined` when unknown.
*/
export function getRequiredTransactionCount({

@matthewwalsh0 matthewwalsh0 Aug 27, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

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