Skip to content

Comments

feat: add optional details field to Transaction type#445

Merged
danroc merged 5 commits intomainfrom
dr/tx-details
Feb 24, 2026
Merged

feat: add optional details field to Transaction type#445
danroc merged 5 commits intomainfrom
dr/tx-details

Conversation

@danroc
Copy link
Contributor

@danroc danroc commented Jan 22, 2026

Description

This PR adds an optional details field to the Transaction type to support transaction origin tracking and security alert responses.

Current State

The Transaction type currently lacks fields to track:

  • Where a transaction originated (MetaMask internally or a dapp)
  • Security assessment results from the Security Alert API

Solution

Adds an optional details object containing:

  • origin (optional string): Transaction request source (e.g., 'metamask' or dapp URL)
  • securityAlertResponse (optional enum): Security Alert API response (Benign, Warning, Malicious)

The implementation is backward compatible.

Examples

N/A - This is an API enhancement that consumers can adopt incrementally.

@danroc danroc requested a review from a team as a code owner January 22, 2026 16:45
@danroc danroc self-assigned this Jan 22, 2026
@danroc danroc added DO-NOT-MERGE PRs related to this issue should not be merged enhancement New feature or request labels Jan 22, 2026
Add optional details field containing transaction origin and security
alert response. The details field includes:
- origin: transaction request source (e.g., 'metamask' or dapp URL)
- securityAlertResponse: Security Alert API response enum (benign, warning, malicious)

The implementation uses exactOptional for full backward compatibility.
Copy link

@wzrdk3lly wzrdk3lly left a comment

Choose a reason for hiding this comment

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

Thanks this looks good. Correct the successful responses types from security alerts are Benign | Warning | Malicious .

@danroc danroc removed the DO-NOT-MERGE PRs related to this issue should not be merged label Feb 24, 2026
@danroc
Copy link
Contributor Author

danroc commented Feb 24, 2026

Thanks @wzrdk3lly, I updated the enum to match the casing.

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.

@danroc danroc added this pull request to the merge queue Feb 24, 2026
Merged via the queue into main with commit 2693c62 Feb 24, 2026
38 checks passed
@danroc danroc deleted the dr/tx-details branch February 24, 2026 14:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants