Skip to content

feat: tx-ctrl add excludeNativeTokenForFee param#8052

Open
maxime-oe wants to merge 1 commit intomainfrom
feat/poc-tempo-transactions-7702
Open

feat: tx-ctrl add excludeNativeTokenForFee param#8052
maxime-oe wants to merge 1 commit intomainfrom
feat/poc-tempo-transactions-7702

Conversation

@maxime-oe
Copy link
Contributor

@maxime-oe maxime-oe commented Feb 26, 2026

Explanation

Context:

With upcoming phase 1 for Tempo support, the initial approach will leverage EIP-7702 mechanics and UX.

  1. One difference vs. other chains is that Tempo doesn't have a concept of native token.
    --> This means that some current logic when we "fall back" to the native token for gas fee when user has enough native balance won't work. excludeNativeTokenForFee is a new parameter for signaling that native token should not be an option when set to true and when gasFeeToken is provided.

  2. Since the client dApps will trigger a call addTransactionBatch for some Tempo transactions - was only called internally until now - we add the actionId so such transactions appear on the Activity tab (transaction history). Otherwise such transactions still made it to the state but those without actionId don't appear in the activity tab.

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 transaction creation metadata and fee-token fallback behavior when gasFeeToken is provided, which can affect how gas payment is selected for batched/EIP-7702 flows. Impact is gated behind new optional params but touches core transaction creation paths.

Overview
Adds an optional excludeNativeTokenForFee flag to TransactionMeta, AddTransactionOptions, and TransactionBatchRequest to force use of gasFeeToken even when the user has native balance.

Updates addTransaction so isGasFeeTokenIgnoredIfBalance becomes false when excludeNativeTokenForFee is set, and persists excludeNativeTokenForFee on the transaction only when explicitly provided. Batch/EIP-7702 submission now also forwards optional actionId (for Activity visibility) and excludeNativeTokenForFee into addTransaction, with new unit tests covering both default and opt-in behaviors.

Written by Cursor Bugbot for commit 15dd7d6. This will update automatically on new commits. Configure here.

@maxime-oe maxime-oe force-pushed the feat/poc-tempo-transactions-7702 branch from 1764dfd to 1b21bb7 Compare March 2, 2026 08:44
@maxime-oe maxime-oe force-pushed the feat/poc-tempo-transactions-7702 branch from 1b21bb7 to c64b46d Compare March 4, 2026 09:56
@maxime-oe maxime-oe changed the title feat: tx-ctrl add forceGasFeeToken param feat: tx-ctrl add excludeNativeTokenForFee param Mar 5, 2026
@maxime-oe maxime-oe force-pushed the feat/poc-tempo-transactions-7702 branch 2 times, most recently from 94d0364 to 692c786 Compare March 6, 2026 10:13
@maxime-oe maxime-oe force-pushed the feat/poc-tempo-transactions-7702 branch from 692c786 to 15dd7d6 Compare March 6, 2026 11:18
@maxime-oe maxime-oe marked this pull request as ready for review March 6, 2026 11:23
@maxime-oe maxime-oe requested review from a team as code owners March 6, 2026 11:23
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

actionId,
batchId,
gasFeeToken,
excludeNativeTokenForFee: userRequest.excludeNativeTokenForFee,
Copy link

Choose a reason for hiding this comment

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

New parameters lost in hook fallback path

Medium Severity

actionId and excludeNativeTokenForFee are only passed through in the addTransactionBatchWith7702 path. If 7702 fails (e.g., chain doesn't support it) and the code falls back to addTransactionBatchWithHook, these parameters are silently dropped. The processTransactionWithHook function's call to addTransaction does not include actionId or excludeNativeTokenForFee, meaning transactions won't appear in the Activity tab and native token exclusion won't apply in the fallback path.

Additional Locations (1)

Fix in Cursor Fix in Web

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The intent of this is to have the minimum change possible to existing flows. Tempo first iteration of the implementation will only support 7702 flow, hence the parameters are only being added for this context and the intent is for the behavior to remain unchanged for the other flows.

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.

1 participant