feat(sdk-coin-ton): add setFullWithdrawalMessage() via w comment to SingleNominatorWithdrawBuilder#8297
Closed
bitgo-ai-agent-dev[bot] wants to merge 2 commits intomasterfrom
Closed
Conversation
…WithdrawBuilder Implements the "w" comment withdrawal path for TON single nominator contracts (orbs-network/single-nominator). This allows draining the full balance minus gas and MIN_TON_FOR_STORAGE automatically, without needing to specify an amount. - Add SINGLE_NOMINATOR_WITHDRAW_ALL_COMMENT = 'w' constant - Add isFullUnstake?: boolean to TxData interface - Add isFullUnstake field to Transaction class, expose in toJson() - Add setFullWithdrawalMessage() to SingleNominatorWithdrawBuilder - Parser detects "w" comment transactions, sets SingleNominatorWithdraw type and isFullUnstake = true - Add unit tests for setFullWithdrawalMessage() flow Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
feng-bitgo
reviewed
Mar 16, 2026
Full withdrawal is already unambiguous via transactionType === SingleNominatorWithdraw && !withdrawAmount, consistent with how TonWhales handles the equivalent case. No explicit isFullUnstake flag needed. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
feng-bitgo
reviewed
Mar 16, 2026
Contributor
feng-bitgo
left a comment
There was a problem hiding this comment.
looks good now but needs to fix commit lint
4 tasks
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
Implements the full-withdrawal path for TON single nominator contracts (
orbs-network/single-nominator), resolving ST-802.The single nominator contract supports a text comment
"w"that drainsbalance - gas - MIN_TON_FOR_STORAGEautomatically. This PR addssetFullWithdrawalMessage()toSingleNominatorWithdrawBuilder, mirroring the existingTonWhalesWithdrawalBuilder.setFullWithdrawalMessage().Changes
constants.ts: AddSINGLE_NOMINATOR_WITHDRAW_ALL_COMMENT = 'w'iface.ts: AddisFullUnstake?: booleantoTxDatainterfacetransaction.ts: AddisFullUnstakefield toTransaction, expose intoJson(), load infromRawTransaction(), detect"w"comment in parser to setSingleNominatorWithdrawtype andisFullUnstake = truesingleNominatorWithdrawBuilder.ts: AddsetFullWithdrawalMessage()— setsisFullUnstake = trueandmessage = 'w'test/unit/singleNominatorWithdrawBuilder.ts: Add test cases for full withdrawal build and round-tripUsage
Test plan
SingleNominatorWithdrawtx withisFullUnstake = true🤖 Generated with Claude Code