Skip to content

feat(sdk-core): add PolyxSwitchValidatorOptions for multi-nomination #9056

Merged
joshisakshi merged 1 commit into
masterfrom
SI-842
Jun 18, 2026
Merged

feat(sdk-core): add PolyxSwitchValidatorOptions for multi-nomination #9056
joshisakshi merged 1 commit into
masterfrom
SI-842

Conversation

@joshisakshi

Copy link
Copy Markdown
Contributor

TICKET: SI-842

Summary

  • Add PolyxSwitchValidatorOptions to @bitgo/sdk-core for POLYX multi-validator nomination switch requests
  • Widen IStakingWallet.switchValidator() and StakingWallet.switchValidator() to accept the new options type
  • Include PolyxSwitchValidatorOptions in the internal createStakingRequest() options union

POLYX switch-validator replaces the full nomination set and does not use validator or amount. The staking-service already accepts { delegationId, validators }; this change aligns the SDK types with that contract so UI callers no longer need as SwitchValidatorOptions.

Motivation

bitgo-ui / bitgo-retail currently type-assert the switch-validator payload when submitting POLYX multi-nomination requests, because SwitchValidatorOptions requires validator and amount. This follows the same approach as TaoSwitchValidatorOptions for coin-specific switch payloads.

Changes

File Change
modules/sdk-core/src/bitgo/staking/iStakingWallet.ts Add PolyxSwitchValidatorOptions; update switchValidator signature
modules/sdk-core/src/bitgo/staking/stakingWallet.ts Import new type; update switchValidator + createStakingRequest union

No runtime behavior change — createStakingRequest already forwards options as-is to staking-service.

Follow-up (separate PRs)

After this SDK version is published and bumped:

  1. bitgo-ui — remove payload as SwitchValidatorOptions in useCreateSwitchValidatorRequestMutation.ts; use PolyxSwitchValidatorOptions in the payload union
  2. bitgo-retail — same cleanup if applicable
  3. bitgo-microservices — no WP/SDK route changes expected; staking-service already supports the payload

Test plan

  • yarn compile in modules/sdk-core
  • Existing stakingWalletCommon switch-validator test still passes (no new test added — consistent with no dedicated test for TaoSwitchValidatorOptions)
  • After SDK bump in UI: POLYX multi-nomination switch validator submits without type assertion

@linear-code

linear-code Bot commented Jun 18, 2026

Copy link
Copy Markdown

SI-842

@joshisakshi joshisakshi marked this pull request as ready for review June 18, 2026 07:33
@joshisakshi joshisakshi requested review from a team as code owners June 18, 2026 07:33
Comment thread modules/sdk-core/src/bitgo/staking/iStakingWallet.ts

@Doddanna17 Doddanna17 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

commented

@Doddanna17 Doddanna17 self-requested a review June 18, 2026 07:51

@Doddanna17 Doddanna17 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@joshisakshi joshisakshi merged commit 6376d9a into master Jun 18, 2026
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants