feat(hbar): add stakedAccountId support to AccountUpdateBuilder#8948
Merged
Conversation
8aba978 to
a91c175
Compare
Add account-level indirect staking support to the HBAR AccountUpdateBuilder. This enables staking to another account (not just consensus nodes) via the CryptoUpdateTransactionBody protobuf's oneof staked_id field. Changes: - Add stakedAccountId field and method to AccountUpdateBuilder - Update initBuilder to read stakedAccountId from proto using oneOf discriminator - Update buildImplementation to set stakedAccountId on proto - Update validateMandatoryFields to require either stakedNodeId OR stakedAccountId (mutually exclusive) - Update transaction getAccountUpdateData to extract stakedAccountId from proto - Add stakedAccountId to AccountUpdateInstruction interface - Add tests for stake-to-account, unstake sentinel (0.0.0), mutual exclusivity, round-trip serialization Ticket: SI-768
a91c175 to
0c292c3
Compare
joshisakshi
approved these changes
Jun 5, 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
stakedAccountIdsupport to HBARAccountUpdateBuilderfor account-level indirect staking (Phase 2)oneof staked_idfield -- settingstakedAccountIdauto-clearsstakedNodeIdand vice versastakedNodeIdorstakedAccountIdmust be set0.0.0clears account staking (parallels-1for node unstaking)Changes
accountUpdateBuilder.ts: NewstakedAccountId()method, updatedinitBuilder/buildImplementation/validateMandatoryFieldsiface.ts: AddedstakedAccountIdtoAccountUpdateInstructioninterfacetransaction.ts: UpdatedgetAccountUpdateData()to extractstakedAccountIdusing oneOf discriminatoraccountUpdateBuilder.ts(test): 7 new tests covering stake-to-account, unstake sentinel, mutual exclusivity, round-tripTest plan
Ticket: SI-768