Skip to content

feat(solana): align transaction confirmation warnings with shared contract - #502

Open
taran-a wants to merge 6 commits into
mainfrom
feat/solana-align-trx-confirmation-security
Open

taran-a wants to merge 6 commits into
mainfrom
feat/solana-align-trx-confirmation-security

Conversation

@taran-a

@taran-a taran-a commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Explanation

Aligns the Solana snap's transaction confirmation with the shared transaction warning contract (Stellar/EVM reference behaviour / warn path), adopting the new shared components from snap-networks-utils:

  • Malicious verdicts — confirm button swaps to alert "Confirm", opening an acknowledgement screen with a risk checkbox; confirmable only after explicit acknowledgement (never hard-blocked)
  • Background re-scans — no longer show the "checking" state or disable confirm; only the initial scan does
  • Warning verdicts — soft "This request may be risky" copy instead of malicious-request copy
  • Preference gating — verdict banners require useSecurityAlerts; scan-failure banners stay active while any scan preference is on
  • Re-scans — run with the same preference-selected scan options as the initial scan (previously always requested simulation+validation) and also run when only security alerts are enabled
Securiy alert + simulation warning Warning confirm screen Warning acknowledgement screen

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

@taran-a
taran-a requested review from a team as code owners October 22, 2026 17:54
@taran-a
taran-a requested a review from a team as a code owner October 22, 2026 17:54
@taran-a
taran-a force-pushed the feat/solana-align-trx-confirmation-security branch 2 times, most recently from 20949ec to 5c7844e Compare October 29, 2026 10:01
@taran-a
taran-a force-pushed the feat/solana-align-trx-confirmation-security branch from 5c7844e to aaf1197 Compare October 29, 2026 10:54
@taran-a
taran-a added this pull request to stack #536 October 29, 2026 14:22
@taran-a
taran-a force-pushed the feat/solana-align-trx-confirmation-security branch 2 times, most recently from 2d2598a to 0114758 Compare November 2, 2026 10:22

@mikesposito mikesposito left a comment

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.

Have you considered implementing this in @metamask/snap-networks-utils (or all the function we can share at least) instead of the Solana Snap, so we can reuse them 1:1 for other Snaps?

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.

Why are we adding EN messages to non-EN locales? 🤔

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

in solana when there is a missing key in locale we return that key as a message.

I actually have just removed my changes to unused locales - we use only en, es no.

but for es I thought its our approach that we add en as I found several already were there.

@taran-a

taran-a commented Nov 2, 2026

Copy link
Copy Markdown
Contributor Author

Have you considered implementing this in @metamask/snap-networks-utils (or all the function we can share at least) instead of the Solana Snap, so we can reuse them 1:1 for other Snaps?

I have another PR in this stack with some UI components, maybe later I will see some candidates to move into the shared lib, but not it hard to decide

@taran-a
taran-a requested a review from mikesposito November 2, 2026 18:33
Base automatically changed from feat/add-shared-security-scan-components to main November 3, 2026 16:38
@taran-a
taran-a force-pushed the feat/solana-align-trx-confirmation-security branch from f0d2f31 to b38e90e Compare November 3, 2026 16:38
@sonarqubecloud

sonarqubecloud Bot commented Nov 3, 2026

Copy link
Copy Markdown

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants