feat(sdk-core, express): consume userKeySigningRequired from coinSpecific#8712
Merged
zahin-mohammad merged 2 commits intomasterfrom May 7, 2026
Conversation
zahin-mohammad
commented
May 7, 2026
Shift the trading-account BitGo-key signing gate to read `coinSpecific.userKeySigningRequired` and fall back to the top-level `userKeySigningRequired` only when the coinSpecific subdocument does not carry it. The OFC subdocument's toJSON in bitgo-microservices flattens its fields directly into `coinSpecific`, so the field surfaces in the API response as `coinSpecific.userKeySigningRequired`. The top-level field is now `@deprecated` and will be removed in a follow-up major release. Tests cover both the coinSpecific shape and the top-level fallback, plus the precedence rule when both are present. Ticket: WCN-471 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…onse codec Narrow the WalletResponse `coinSpecific` codec from a bare `t.UnknownRecord` to an intersection that adds typed visibility for `coinSpecific.userKeySigningRequired` while keeping the unknown-record permissiveness intact for unrelated subdocument fields. The OFC subdocument toJSON in bitgo-microservices flattens its fields directly into coinSpecific, so the field surfaces unwrapped on the response. Add codec-decode tests covering wallets with arbitrary coinSpecific fields, the typed userKeySigningRequired shape, an empty coinSpecific, and rejection of wrong-typed values. Ticket: WCN-471 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
c9b247d to
0d223d5
Compare
Contributor
Author
|
Addressed all four review comments — pushed amended commits in place of the originals. Confirmed in Updated:
All tests/lint pass. PR description updated implicitly via the new commit messages. |
zahin-mohammad
commented
May 7, 2026
alextse-bg
approved these changes
May 7, 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
Phase 2 of the
userKeySigningRequiredlocation refactor (parent: WCN-460). The trading-account BitGo-key signing gate in BitGoJS now readswalletData.coinSpecific.ofc.userKeySigningRequired, falling back to the top-leveluserKeySigningRequiredonly when the coinSpecific subdocument is absent. The top-level field is marked@deprecatedand will be removed in a follow-up major release (Phase 3).The express
WalletResponsecodec gains typed visibility forcoinSpecific.ofc.userKeySigningRequiredviat.intersection([t.partial({ ofc: ... }), t.UnknownRecord]). The intersection preserves the existing permissivet.UnknownRecorddecode for wallets carrying other coinSpecific subdocuments (eth, terc20, etc.) — silently rejecting previously-decoding wallet responses would itself be an AP-0002 breaking change.feat(sdk-core): extendsWalletCoinSpecificwithofc?: { userKeySigningRequired?: boolean }, shifts the read insignPayloadByBitGoKey(), marksWalletData.userKeySigningRequireddeprecated.feat(express): typescoinSpecific.ofcon theWalletResponsecodec.Issue Number
WCN-471 — https://linear.app/bitgo/issue/WCN-471
Type of change
How Has This Been Tested?
sdk-core (
TradingAccountsuite — 16 passing, +2 new cases):coinSpecific.ofc.userKeySigningRequired: truethrows) — renamed and re-asserteduserKeySigningRequired: truestill throws whencoinSpecific.ofcis absent (fallback)coinSpecific.ofctakes precedence over top-level when both are presentexpress (
io-ts decode testssuite — 23 passing, +4 new cases):coinSpecific.eth)coinSpecific.ofc.userKeySigningRequired: truecoinSpecificcoinSpecific.ofc.userKeySigningRequiredof wrong typePhase 3 (out of scope, follow-up PR)
Removal of the top-level fallback and the
WalletData.userKeySigningRequiredfield is an AP-0002 breaking change, however no breaking change release will made as this is a feature still in development.Checklist
🤖 Generated with Claude Code