fix(sdk-core): populate recipients in buildTokenEnablements for TSS wallets#8979
Merged
nvrakesh06 merged 1 commit intoJun 10, 2026
Merged
Conversation
…allets
TSS wallets were missing `buildParams.recipients` after `buildTokenEnablements`
because the TSS branch only called `prebuildTransaction(buildParams)` without
first mapping `enableTokens → recipients`. The non-TSS branch correctly did this
mapping. When `verifyTransaction` runs (`txParams = { ...txPrebuild.buildParams,
...params }`), `txParams.recipients` was undefined, causing `validateRawReceiver`
in near.ts to throw "missing token name in transaction parameters".
Unlike the non-TSS path, `enableTokens` is kept on `buildParams` for TSS since
the server needs it to build the enableToken intent.
Adds a regression test that exercises the real production call path —
using `txPrebuild.buildParams` as `txParams` — which is what the existing
TSS tests failed to do.
TICKET: WP-5782
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
ee4051e to
6fc31f6
Compare
0xPrabh
approved these changes
Jun 10, 2026
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.
Summary
"Error on token enablements: missing token name in transaction parameters"buildTokenEnablementsinwallet.tshad two paths — the non-TSS path correctly mappedenableTokens → recipients(withtokenName) before callingprebuildTransaction, but the TSS path skipped this and calledprebuildTransactiondirectly. WhenverifyTransactionlater ran withtxParams = { ...txPrebuild.buildParams, ...params },txParams.recipientswasundefined, causingnear.ts:validateRawReceiverto throwenableTokens → recipientsbefore callingprebuildTransaction. Unlike non-TSS,enableTokensis kept (not deleted) since the server needs it to build theenableTokenintentdde3a952b4(Aug 2022, "add enable token support for sol") and lay dormant until21500242aa(Sep 2025, "token enablement transaction validation") added validation that readtxParams.recipients[0].tokenName. The existing TSS tests passed because they manually hardcodedrecipientsintxParamsinstead of usingtxPrebuild.buildParamsLinear
CECHO-1296
Files changed
modules/sdk-core/src/bitgo/wallet/wallet.ts— populaterecipientsin the TSS branch ofbuildTokenEnablementsmodules/sdk-coin-near/test/unit/tokenEnablementValidation.ts— regression test that exercises the real production path (txParams = { ...txPrebuild.buildParams }) rather than manually constructingtxParamswith recipientsTest plan
should populate recipients from enableTokens in buildParams for TSS wallets— verifiestxPrebuild.buildParams.recipients[0].tokenNameis set, then callsverifyTransactionusingbuildParamsastxParams(mirroring the production flow)elsebranch)🤖 Generated with Claude Code