Skip to content

fix(sdk-core): forward unstakingParams on custodial tx/initiate - #10103

Open
OttoAllmendinger wants to merge 1 commit into
masterfrom
otto/SI-2167-custodial-early-exit-initiate
Open

OttoAllmendinger wants to merge 1 commit into
masterfrom
otto/SI-2167-custodial-early-exit-initiate

Conversation

@OttoAllmendinger

@OttoAllmendinger OttoAllmendinger commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Problem

pairedWallet.sendMany({ ..., unstakingParams: { pox5: { branch: 'early-exit', principalPreimage } } }) on a custodial PoX-5 paired wallet created a pending approval whose stored buildParams had no unstakingParams, so the server built a late-exit PSBT (locktime = unlock height, no preimage) instead of an early exit. The SDK dropped the field in three places before the request left the client:

  • BuildParams (buildParamKeys) did not list unstakingParams
  • Wallet.initiateTransaction picked only the keys of TxSendBody from @bitgo/public-types, which does not declare unstakingParams
  • the TxSendBody codec is exact and strips unknown keys on encode

Change

  • Add unstakingParams to BuildParams and PrebuildTransactionOptions.
  • Extend the initiate whitelist and codec locally (TxInitiateBody, whitelistedInitiateParams in wallet.ts) until @bitgo/public-types declares it on TxSendBody.
  • Unit test (custodialInitiate.ts): the encoded initiate body keeps unstakingParams.

Testing

  • modules/sdk-core: custodialInitiate.ts (2 passing); prettier and eslint clean on touched files.
  • Live (staging tbtcstx, 2026-11-02, SI-2167): a custodial PoX-5 early exit via sendMany({ unstakingParams: { pox5: { branch: 'early-exit', principalPreimage } } }) with this change passed end to end (tx 6fde203b632e5e6baabed754396ab165fe35df5841f486ce78b23b083a43ac6b). The server-side halves, Wallet Platform (BitGo/bitgo-microservices#63950 and BitGo/bitgo-microservices#63958), and HSM firmware 3.79.3 were deployed on staging for the run.
  • The only CI failure on the previous head was Starknet deploy account RPC wire format (live Sepolia) in sdk-coin-starknet, a live-network test unrelated to this change.

Follow-up

@bitgo/public-types 7.2.0 (latest) does not declare unstakingParams on TxSendBody, so the local TxInitiateBody extension stays. Tracked in SI-2170; once published, drop the extension and bump the dependency.

Refs: SI-2167

🤖 Generated with Claude Code

@linear-code

linear-code Bot commented Oct 30, 2026

Copy link
Copy Markdown
Contributor

SI-2167

@github-actions

github-actions Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

⚠️ Compatibility checks are failing on Node.js 27-nightly (experimental, non-blocking). This does not block merge, but it signals an incompatibility to fix before this release becomes supported.

View run

@OttoAllmendinger
OttoAllmendinger force-pushed the otto/SI-2167-custodial-early-exit-initiate branch from 4f9bea9 to e0db596 Compare October 30, 2026 09:26
sendMany on a custodial wallet dropped unstakingParams in three places,
so a PoX-5 early exit (unstakingParams.pox5.branch = 'early-exit') was
built as a late exit by the server:

- BuildParams (buildParamKeys) did not list unstakingParams
- initiateTransaction picked only TxSendBody keys from @bitgo/public-types
- the TxSendBody codec is exact and strips unknown keys on encode

Add unstakingParams to BuildParams and PrebuildTransactionOptions, and
extend the initiate whitelist and codec locally until public-types
declares it on TxSendBody.

Refs: SI-2167

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@OttoAllmendinger
OttoAllmendinger force-pushed the otto/SI-2167-custodial-early-exit-initiate branch from e0db596 to c37461f Compare November 2, 2026 14:29
@OttoAllmendinger
OttoAllmendinger marked this pull request as ready for review November 3, 2026 14:46
@OttoAllmendinger
OttoAllmendinger requested review from a team as code owners November 3, 2026 14:46

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review for a one-time review, or @claude review always to subscribe this PR to a review on every future push.

Tip: disable this comment in your organization's Code Review settings.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants