feat(sdk-coin-sui): add fundsInAddressBalance to WalrusStakingBuilder#9340
Draft
bitgo-ai-agent-dev[bot] wants to merge 1 commit into
Draft
feat(sdk-coin-sui): add fundsInAddressBalance to WalrusStakingBuilder#9340bitgo-ai-agent-dev[bot] wants to merge 1 commit into
bitgo-ai-agent-dev[bot] wants to merge 1 commit into
Conversation
Contributor
bitgo-ai-agent-dev
Bot
force-pushed
the
SI-1062-walrus-staking-funds-in-address-balance
branch
5 times, most recently
from
July 23, 2026 10:38
0a70969 to
86e89e1
Compare
benkelcher-bitgo
left a comment
Contributor
There was a problem hiding this comment.
i think that function is unused, unless i missed something - we should remove it if so
Add address-balance funding path for WAL staking, analogous to the addr-bal support added to SUI StakingBuilder in SI-1053. What changed: - WalrusStakingBuilder: adds fundsInAddressBalance(amount) setter (default 0 = existing behavior); validation relaxed to require inputObjects OR fundsInAddressBalance (addr-bal-only now allowed); buildSuiTransaction() emits redeem_funds(Coin<WAL>) before merge/split/stake_with_pool when addr-bal > 0; residual Coin<WAL> is transferred back to sender (no-drop safety); expiration and fundsInAddressBalance are propagated on the returned SuiTransaction; initBuilder() restores fundsInAddressBalance from BalanceWithdrawal - WalrusStakingTransaction: getTxData() passes BalanceWithdrawal inputs through unchanged; toJson() emits fundsInAddressBalance and expiration; getInputObjectsFromTx() now scans all transactions (not just [0]) so it handles the addr-bal-only and mixed PTB layouts correctly - Unit tests: mixed (objects + addr-bal), addr-bal-only exact, addr-bal partial/residual, round-trip restore, default unchanged, fail when neither source provided Why: Walrus wallets that hold WAL only in address balance (no Coin<WAL> objects) were unable to stake to Walrus validators. WAL principal must be sourced from coin objects, address balance, or a mix, identical to the token-transfer addr-bal pattern and SI-1053 for native SUI staking. Ticket: SI-1062 Session-Id: aca9f2f3-fd6e-4d57-b9c7-d625685c9134 Task-Id: 64820ae1-489e-41cb-9c47-958063a67a0c
bitgo-ai-agent-dev
Bot
force-pushed
the
SI-1062-walrus-staking-funds-in-address-balance
branch
2 times, most recently
from
July 23, 2026 12:27
ae93acc to
41f7988
Compare
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.
What
WalrusStakingBuilderexposesfundsInAddressBalance(amount: string)setter (default0= existing behavior unchanged)walrusConfig(WAL_PKG_ID::wal::WAL)inputObjects.length > 0ORfundsInAddressBalance > 0(addr-bal-only is now valid)fundsInAddressBalance > 0, PTB insertsredeem_funds(Coin<WAL>)before merge/split/stake_with_poolCoin<WAL>is always transferred back to sender when addr-bal is used (no-drop safety — WAL cannot be merged into the SUI gas coin)WalrusStakingTransaction.toJson()emitsfundsInAddressBalanceandexpiration;getTxData()handlesBalanceWithdrawalinputs (mirrorsStakingTransaction)initBuilder()restoresfundsInAddressBalancefrom theBalanceWithdrawalPTB inputgetInputObjectsFromTxnow scans all transactions (not just[0]) so mixed and addr-bal-only PTB layouts are handled correctlyinitBuilderrestore, default unchanged, fail when neither source providedWhy
Coin<WAL>objects) could not stake to Walrus validators — staking required at least oneinputObjectsentryTest plan
walrusStakingBuilderunit tests — newfundsInAddressBalancesuite passesTicket: SI-1062