feat(sdk-coin-polyx): add NominateBuilder for standalone nominate transactions (SI-686)#8844
Draft
bitgo-ai-agent-dev[bot] wants to merge 1 commit into
Draft
feat(sdk-coin-polyx): add NominateBuilder for standalone nominate transactions (SI-686)#8844bitgo-ai-agent-dev[bot] wants to merge 1 commit into
bitgo-ai-agent-dev[bot] wants to merge 1 commit into
Conversation
- Add NominateBuilder extending PolyxBaseBuilder with validators()/ buildTransaction()/validateDecodedTransaction()/fromImplementation() - transactionType returns TransactionType.StakingVote - validators() enforces 1..16 addresses with per-address validation - Add getNominateBuilder() to TransactionBuilderFactory; route methodName === 'nominate' to NominateBuilder (batchAll bond+nominate still routes to BatchStakingBuilder) - Add max(16) to NominateTransactionSchema and batch nominate schemas - Export NominateBuilder from src/lib/index.ts - Add nominateTx/nominateSender/nominateValidators to test resources - Add nominateBuilder unit tests (type, validation, build, parse, round-trip, factory routing) Ticket: SI-686 Session-Id: cb0b09be-f8c9-4945-bd04-91833ab3dac2 Task-Id: 074c7742-b4dc-4fc0-82d6-5a716882f778
1a96271 to
9f18bec
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.
Summary
NominateBuilder(src/lib/nominateBuilder.ts) extendingPolyxBaseBuilder:validators(validators: string[])— validates each address, enforces 1–16 rangebuildTransaction()→methods.staking.nominate({ targets: validators }, ...)transactionType→TransactionType.StakingVotevalidateDecodedTransaction()formethod.name === 'nominate'fromImplementation()parses targets back into builder statesrc/lib/txnSchema.ts) — addedmax(16)toNominateTransactionSchemaand both batch nominate validators schemassrc/lib/transactionBuilderFactory.ts) — addedgetNominateBuilder();methodName === 'nominate'now routes toNominateBuilder(batchAll bond+nominate still routes toBatchStakingBuilder)src/lib/index.ts) —NominateBuilderexportednominateTx(signed hex from ticket),nominateSender,nominateValidatorstest/unit/transactionBuilder/nominateBuilder.ts) — 14 tests covering transaction type, validators validation, build, parse, round-trip, and factory routingTest plan
Polyx Nominate Buildersuite (14 tests) all passnominateextrinsic toNominateBuilderbatchAllbond+nominate toBatchBuilderfrom()→ validators preservedTicket: SI-686
🤖 Generated with Ralph