fix(sdk-coin-sui): keep token coin type on addr-balance rebuild#9191
Merged
Conversation
Contributor
akarath
approved these changes
Jul 7, 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.
TICKET: CSHLD-1146
Token transfers funded from the Sui address balance embed the coin type in the redeem_funds MoveCall type argument and the BalanceWithdrawal input. When such a transaction is deserialized and rebuilt to attach a signature before broadcast, buildSuiTransaction re-derived the coin type from the coin config. If the builder was constructed with the parent chain config (e.g. tsui) rather than the token config (tsui:deep), packageId/module/symbol are undefined and the coin type became "undefined::undefined::undefined". The rebuilt bytes then differed from the signed payload, so the Sui node rejected the transaction with "Invalid user signature: Fail to verify user sig". Recover the coin type from the deserialized BalanceWithdrawal TypeTag in initBuilder and prefer it over the config-derived value, so a rebuild produces
byte-identical output regardless of which config the builder was created with.