fix: scope keyring send token to subject address - #9749
Open
n3ps wants to merge 3 commits into
Open
Conversation
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
n3ps
commented
Aug 1, 2026
| case KeyringTransactionType.Send: { | ||
| const fromToken = getToken(transaction.from, 'out'); | ||
| const fromSubject = subjectAddress | ||
| ? transaction.from.filter(({ address }) => address === subjectAddress) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Explanation
Non-EVM keyring sends (especially Solana bridge source legs) often include movements for many parties.
mapKeyringTransactionpreviously took the first movement infrom.When
subjectAddressis provided, Send mapping now filtersfromto that address before selecting the token.References
Checklist
Note
Low Risk
Narrow change to activity display mapping for Send when
subjectAddressis 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
frommovement.When
subjectAddressis passed intomapKeyringTransaction, Send mapping now filtersfromto 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 withoutsubjectAddressis unchanged; Bitcoin’sto-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.