Skip to content

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 compatibile.

Examples

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


Note

Adds optional context to transactions while preserving backward compatibility.

  • Introduces Transaction.details (optional) with origin and securityAlertResponse
  • Adds SecurityAlertResponse enum (benign, warning, malicious) and TransactionDetailsStruct using exactOptional
  • Updates TransactionStruct to include details; type tests in transaction.test-d.ts and runtime validation tests in transaction.test.ts
  • Changelog updated

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

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.
@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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

DO-NOT-MERGE PRs related to this issue should not be merged enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants