Skip to content

fix: scope keyring mapping to subject address - #9749

Merged
n3ps merged 3 commits into
mainfrom
n3ps/fix-non-evm-bridge
Aug 3, 2026
Merged

fix: scope keyring mapping to subject address#9749
n3ps merged 3 commits into
mainfrom
n3ps/fix-non-evm-bridge

Conversation

@n3ps

@n3ps n3ps commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Explanation

Non-EVM keyring send transactions (especially those that are part of Solana bridge) often include movements for many parties. mapKeyringTransaction previously took the first movement in from. When subjectAddress is provided, Send mapping now filters from to that address before selecting the token.

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

Low Risk
Narrow change to activity display mapping for Send when subjectAddress is provided; no auth, persistence, or transaction execution impact.

Overview
Fixes incorrect send activity for multi-party keyring transactions (notably Solana bridge source legs) where activity showed another address’s token because mapping used the first from movement.

When subjectAddress is passed into mapKeyringTransaction, Send mapping now filters from to that address before choosing the outbound fungible token, so the listed asset matches what the user actually sent (e.g. SOL instead of a counterparty’s USDC). Behavior without subjectAddress is unchanged; Bitcoin’s to-side fallback is untouched.

Adds a Solana bridge fixture and regression test, plus an Unreleased changelog entry under Fixed.

Reviewed by Cursor Bugbot for commit 9c81416. Bugbot is set up for automated code reviews on this repo. Configure here.

@n3ps
n3ps marked this pull request as ready for review August 1, 2026 04:58
@n3ps
n3ps requested review from a team as code owners August 1, 2026 04:58
@n3ps
n3ps temporarily deployed to default-branch August 1, 2026 04:59 — with GitHub Actions Inactive
case KeyringTransactionType.Send: {
const fromToken = getToken(transaction.from, 'out');
const fromSubject = subjectAddress
? transaction.from.filter(({ address }) => address === subjectAddress)

@n3ps n3ps Aug 1, 2026

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.

Point of interest: filter transaction.from before looking for the token

@n3ps
n3ps enabled auto-merge August 2, 2026 04:33
type: 'priority',
},
],
from: [

@n3ps n3ps Aug 2, 2026

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.

Payload with multiple from entries

@n3ps n3ps changed the title fix: scope keyring send token to subject address fix: scope keyring mapping to subject address Aug 2, 2026
@n3ps
n3ps added this pull request to the merge queue Aug 3, 2026
Merged via the queue into main with commit 6475a91 Aug 3, 2026
50 checks passed
@n3ps
n3ps deleted the n3ps/fix-non-evm-bridge branch August 3, 2026 14:34
@n3ps

n3ps commented Aug 3, 2026

Copy link
Copy Markdown
Contributor Author

@metamaskbot publish-previews

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