fix(sdk-core): detect intent token symbols via statics - #9886
abhijeet848 wants to merge 1 commit into
Conversation
6bf4dfd to
368d34a
Compare
|
@claude Please do a thorough review of this PR. Focus especially on:
Please call out concrete issues clearly and separate them by severity if possible |
|
Claude finished @abhijeet848's task —— View job Code Review for PR #9886: fix(sdk-core): detect intent token symbols via statics
Review Checklist:
SummaryThis PR successfully fixes the TSS token transfer verification issue by improving how token names are detected in intent recipients. The core change shifts from comparing 🔍 Core Logic Analysis✅ Correct ImplementationThe main logic change in // OLD: Compared symbol to chain name
const tokenName = intentRecipient.tokenData?.tokenName ||
(symbol && coins.has(symbol) && coins.get(symbol).isToken ? symbol : undefined);Strengths:
✅ Parameter SimplificationThe removal of the
🧪 Test Coverage Analysis✅ Comprehensive Test UpdatesThe test file shows excellent coverage improvements:
Key test scenarios validated:
|
|
|

Problem
Signing SOL token transfers from TSS hot wallets fails with:
When no recipients are passed, the SDK builds them from the txRequest intent. It set
tokenNameonly if the intent symbol differed from the coin the wallet was loaded with. The "Sign transaction request" dialog loads the wallet as the token itself (tsol:usdcv2), so the symbol matched,tokenNamewas dropped, and the check never derived the recipient's ATA. It compared the native address with the ATA and rejected a valid transaction.Fix
Decide whether the intent symbol is a token from statics (
isToken), not by comparing it with the loaded coin.tsol:usdcv2always getstokenName;tsolnever does. The now-unusedchainNameparameter is removed.Testing
tsolortsol:usdcv2.Note
Tokens known only through AMS (not in statics) get no
tokenName, so signing them without recipients still fails.Ticket: SCAAS-11565