Skip to content

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

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

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).
  • Not run against a live environment.

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

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 4f9bea9 to e0db596 Compare October 30, 2026 09:26

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.

1 participant