Skip to content

Conversation

@gomesalexandre
Copy link
Contributor

@gomesalexandre gomesalexandre commented Dec 11, 2025

Description

Does what it says on the box.

Testing

Screenshots

Summary by CodeRabbit

  • Chores

    • Removed an unused test module mapping and removed an external UTXO library; bumped many package versions to 1.62.35 across the project.
  • Bug Fixes

    • Simplified and unified Bitcoin/Zcash transaction construction and signing, with more robust handling of Zcash versioning and block-height logic.

✏️ Tip: You can customize this high-level summary in your review settings.

@gomesalexandre gomesalexandre requested a review from a team as a code owner December 11, 2025 18:59
@coderabbitai
Copy link

coderabbitai bot commented Dec 11, 2025

📝 Walkthrough

Walkthrough

Removed @bitgo/utxo-lib from manifests, removed a Jest moduleNameMapper alias, and refactored Ledger Bitcoin PSBT handling to use a unified PSBT flow with direct Zcash fields and simplified block-height/version handling. (50 words)

Changes

Cohort / File(s) Summary
Manifests & version bumps
lerna.json, integration/package.json, examples/sandbox/package.json, packages/*/package.json
Bumped release version from 1.62.341.62.35 across many packages and updated internal @shapeshiftoss/hdwallet-* dependency versions.
Removed BitGo UTXO lib
integration/package.json, packages/hdwallet-ledger/package.json
Removed dependency @bitgo/utxo-lib from manifests.
Test config
integration/jest.config.js
Removed moduleNameMapper alias for ^@brandonblack/musig/base_crypto$.
Ledger — Bitcoin PSBT refactor
packages/hdwallet-ledger/src/bitcoin.ts
Replaced BitGo/Zcash-specific PSBT flow with a unified PSBT construction (adds forkCoin), always builds outputs as { address, value }, sets Zcash fields (version, versionGroupId, consensusBranchId) directly, centralizes unsigned-tx extraction, uses max-positive-input blockHeight fallback, removed BitGo/Zcash-specific types/imports while keeping the trusted-input monkey-patch.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Suggested reviewers

  • NeOMakinG

Poem

🐰 I hopped through code and nudged a lib away,
One PSBT path now handles ZEC and BTC day,
Versions set neat, heights take the high,
No extra patches left to multiply,
I nibble carrots, release notes in play 🥕✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title accurately summarizes the main change: replacing @bitgo/utxo-lib with @shapeshiftoss/bitcoinjs-lib for Ledger Zcash PSBT handling, which is reflected in the code changes removing the BitGo dependency and updating Zcash PSBT logic.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat_bitgo_bitcoinjs_lib

📜 Recent review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between bc7fc91 and fa72b88.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (27)
  • examples/sandbox/package.json
  • integration/package.json
  • lerna.json
  • packages/hdwallet-coinbase/package.json
  • packages/hdwallet-core/package.json
  • packages/hdwallet-gridplus/package.json
  • packages/hdwallet-keepkey-chromeusb/package.json
  • packages/hdwallet-keepkey-electron/package.json
  • packages/hdwallet-keepkey-nodehid/package.json
  • packages/hdwallet-keepkey-nodewebusb/package.json
  • packages/hdwallet-keepkey-tcp/package.json
  • packages/hdwallet-keepkey-webusb/package.json
  • packages/hdwallet-keepkey/package.json
  • packages/hdwallet-keplr/package.json
  • packages/hdwallet-ledger-webhid/package.json
  • packages/hdwallet-ledger-webusb/package.json
  • packages/hdwallet-ledger/package.json
  • packages/hdwallet-metamask-multichain/package.json
  • packages/hdwallet-native-vault/package.json
  • packages/hdwallet-native/package.json
  • packages/hdwallet-phantom/package.json
  • packages/hdwallet-portis/package.json
  • packages/hdwallet-trezor-connect/package.json
  • packages/hdwallet-trezor/package.json
  • packages/hdwallet-vultisig/package.json
  • packages/hdwallet-walletconnect/package.json
  • packages/hdwallet-walletconnectV2/package.json
✅ Files skipped from review due to trivial changes (5)
  • lerna.json
  • packages/hdwallet-portis/package.json
  • packages/hdwallet-coinbase/package.json
  • packages/hdwallet-ledger-webhid/package.json
  • packages/hdwallet-keepkey-nodehid/package.json
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/hdwallet-ledger/package.json
🧰 Additional context used
🧠 Learnings (8)
📓 Common learnings
Learnt from: gomesalexandre
Repo: shapeshift/hdwallet PR: 726
File: packages/hdwallet-coinbase/package.json:18-18
Timestamp: 2025-08-07T15:23:54.858Z
Learning: In the shapeshiftoss/hdwallet monorepo, package version bumps are done in PRs before publishing. The packages are published after the PR is merged, so dependency versions may reference unpublished versions during the PR review phase. This is expected behavior in their release workflow.
📚 Learning: 2025-08-07T15:27:03.179Z
Learnt from: gomesalexandre
Repo: shapeshift/hdwallet PR: 726
File: packages/hdwallet-ledger/package.json:36-36
Timestamp: 2025-08-07T15:27:03.179Z
Learning: In the shapeshiftoss/hdwallet monorepo, the ledgerhq/hw-transport dependency in packages/hdwallet-ledger/package.json is pinned to an exact version (without caret) due to type mismatches that occur with newer versions. Other Ledger dependencies can safely use caret ranges.

Applied to files:

  • packages/hdwallet-native-vault/package.json
  • packages/hdwallet-keepkey-webusb/package.json
  • examples/sandbox/package.json
  • packages/hdwallet-keplr/package.json
  • packages/hdwallet-phantom/package.json
  • packages/hdwallet-walletconnect/package.json
  • packages/hdwallet-walletconnectV2/package.json
  • packages/hdwallet-keepkey-tcp/package.json
  • packages/hdwallet-keepkey-nodewebusb/package.json
  • packages/hdwallet-native/package.json
  • packages/hdwallet-keepkey-chromeusb/package.json
  • packages/hdwallet-metamask-multichain/package.json
  • packages/hdwallet-core/package.json
  • packages/hdwallet-trezor-connect/package.json
  • packages/hdwallet-trezor/package.json
  • packages/hdwallet-keepkey/package.json
  • integration/package.json
  • packages/hdwallet-gridplus/package.json
  • packages/hdwallet-vultisig/package.json
  • packages/hdwallet-ledger-webusb/package.json
  • packages/hdwallet-keepkey-electron/package.json
📚 Learning: 2025-08-07T15:23:54.858Z
Learnt from: gomesalexandre
Repo: shapeshift/hdwallet PR: 726
File: packages/hdwallet-coinbase/package.json:18-18
Timestamp: 2025-08-07T15:23:54.858Z
Learning: In the shapeshiftoss/hdwallet monorepo, package version bumps are done in PRs before publishing. The packages are published after the PR is merged, so dependency versions may reference unpublished versions during the PR review phase. This is expected behavior in their release workflow.

Applied to files:

  • packages/hdwallet-native-vault/package.json
  • packages/hdwallet-keepkey-webusb/package.json
  • examples/sandbox/package.json
  • packages/hdwallet-keplr/package.json
  • packages/hdwallet-phantom/package.json
  • packages/hdwallet-walletconnect/package.json
  • packages/hdwallet-walletconnectV2/package.json
  • packages/hdwallet-keepkey-tcp/package.json
  • packages/hdwallet-keepkey-nodewebusb/package.json
  • packages/hdwallet-native/package.json
  • packages/hdwallet-keepkey-chromeusb/package.json
  • packages/hdwallet-metamask-multichain/package.json
  • packages/hdwallet-core/package.json
  • packages/hdwallet-trezor-connect/package.json
  • packages/hdwallet-trezor/package.json
  • packages/hdwallet-keepkey/package.json
  • integration/package.json
  • packages/hdwallet-gridplus/package.json
  • packages/hdwallet-vultisig/package.json
  • packages/hdwallet-ledger-webusb/package.json
  • packages/hdwallet-keepkey-electron/package.json
📚 Learning: 2025-08-07T15:24:19.530Z
Learnt from: gomesalexandre
Repo: shapeshift/hdwallet PR: 726
File: packages/hdwallet-ledger-webusb/package.json:3-3
Timestamp: 2025-08-07T15:24:19.530Z
Learning: In the shapeshiftoss/hdwallet monorepo, the team runs `yarn build` before bumping versions and also before publishing packages. This ensures that dist/ artifacts (including UMD bundles) are properly regenerated after dependency updates.

Applied to files:

  • packages/hdwallet-native-vault/package.json
  • packages/hdwallet-keepkey-webusb/package.json
  • examples/sandbox/package.json
  • packages/hdwallet-keplr/package.json
  • packages/hdwallet-phantom/package.json
  • packages/hdwallet-walletconnect/package.json
  • packages/hdwallet-walletconnectV2/package.json
  • packages/hdwallet-keepkey-tcp/package.json
  • packages/hdwallet-keepkey-nodewebusb/package.json
  • packages/hdwallet-native/package.json
  • packages/hdwallet-keepkey-chromeusb/package.json
  • packages/hdwallet-metamask-multichain/package.json
  • packages/hdwallet-core/package.json
  • packages/hdwallet-trezor-connect/package.json
  • packages/hdwallet-trezor/package.json
  • packages/hdwallet-keepkey/package.json
  • integration/package.json
  • packages/hdwallet-gridplus/package.json
  • packages/hdwallet-vultisig/package.json
  • packages/hdwallet-ledger-webusb/package.json
  • packages/hdwallet-keepkey-electron/package.json
📚 Learning: 2025-12-09T13:48:55.139Z
Learnt from: gomesalexandre
Repo: shapeshift/hdwallet PR: 764
File: packages/hdwallet-gridplus/package.json:0-0
Timestamp: 2025-12-09T13:48:55.139Z
Learning: In the shapeshiftoss/hdwallet monorepo, the dist/ directory is not version controlled (not tracked in git). Build artifacts are generated during the build/publish workflow, not committed to the repository.

Applied to files:

  • packages/hdwallet-native-vault/package.json
  • packages/hdwallet-keepkey-webusb/package.json
  • examples/sandbox/package.json
  • packages/hdwallet-keplr/package.json
  • packages/hdwallet-phantom/package.json
  • packages/hdwallet-walletconnect/package.json
  • packages/hdwallet-walletconnectV2/package.json
  • packages/hdwallet-keepkey-tcp/package.json
  • packages/hdwallet-keepkey-nodewebusb/package.json
  • packages/hdwallet-native/package.json
  • packages/hdwallet-keepkey-chromeusb/package.json
  • packages/hdwallet-metamask-multichain/package.json
  • packages/hdwallet-core/package.json
  • packages/hdwallet-trezor-connect/package.json
  • packages/hdwallet-trezor/package.json
  • packages/hdwallet-keepkey/package.json
  • integration/package.json
  • packages/hdwallet-gridplus/package.json
  • packages/hdwallet-vultisig/package.json
  • packages/hdwallet-ledger-webusb/package.json
  • packages/hdwallet-keepkey-electron/package.json
📚 Learning: 2025-08-07T15:47:29.207Z
Learnt from: gomesalexandre
Repo: shapeshift/hdwallet PR: 726
File: packages/hdwallet-ledger/src/transport.ts:10-10
Timestamp: 2025-08-07T15:47:29.207Z
Learning: In the shapeshiftoss/hdwallet monorepo, ts-ignore is used instead of ts-expect-error for Ledger transport imports because the code works locally without TypeScript errors but has issues in CI environment. Using ts-expect-error would fail locally since there are no actual errors to suppress.

Applied to files:

  • packages/hdwallet-native-vault/package.json
  • packages/hdwallet-keepkey-webusb/package.json
  • examples/sandbox/package.json
  • packages/hdwallet-keplr/package.json
  • packages/hdwallet-phantom/package.json
  • packages/hdwallet-walletconnect/package.json
  • packages/hdwallet-walletconnectV2/package.json
  • packages/hdwallet-keepkey-tcp/package.json
  • packages/hdwallet-keepkey-nodewebusb/package.json
  • packages/hdwallet-native/package.json
  • packages/hdwallet-keepkey-chromeusb/package.json
  • packages/hdwallet-metamask-multichain/package.json
  • packages/hdwallet-core/package.json
  • packages/hdwallet-trezor-connect/package.json
  • packages/hdwallet-trezor/package.json
  • packages/hdwallet-keepkey/package.json
  • integration/package.json
  • packages/hdwallet-gridplus/package.json
  • packages/hdwallet-vultisig/package.json
  • packages/hdwallet-ledger-webusb/package.json
  • packages/hdwallet-keepkey-electron/package.json
📚 Learning: 2025-08-07T15:47:26.835Z
Learnt from: gomesalexandre
Repo: shapeshift/hdwallet PR: 726
File: packages/hdwallet-ledger-webusb/src/transport.ts:12-12
Timestamp: 2025-08-07T15:47:26.835Z
Learning: In the shapeshiftoss/hdwallet monorepo, ts-ignore is used instead of ts-expect-error for Ledger transport imports because the CI environment has different type checking behavior than local development. The code works locally without errors, but CI reports type issues, so ts-ignore is necessary to suppress the inconsistent type checking across environments.

Applied to files:

  • packages/hdwallet-native-vault/package.json
  • packages/hdwallet-keepkey-webusb/package.json
  • examples/sandbox/package.json
  • packages/hdwallet-keplr/package.json
  • packages/hdwallet-phantom/package.json
  • packages/hdwallet-walletconnect/package.json
  • packages/hdwallet-walletconnectV2/package.json
  • packages/hdwallet-keepkey-tcp/package.json
  • packages/hdwallet-keepkey-nodewebusb/package.json
  • packages/hdwallet-native/package.json
  • packages/hdwallet-keepkey-chromeusb/package.json
  • packages/hdwallet-metamask-multichain/package.json
  • packages/hdwallet-trezor-connect/package.json
  • packages/hdwallet-trezor/package.json
  • packages/hdwallet-keepkey/package.json
  • integration/package.json
  • packages/hdwallet-gridplus/package.json
  • packages/hdwallet-vultisig/package.json
  • packages/hdwallet-ledger-webusb/package.json
  • packages/hdwallet-keepkey-electron/package.json
📚 Learning: 2025-12-12T11:20:00.907Z
Learnt from: gomesalexandre
Repo: shapeshift/hdwallet PR: 769
File: packages/hdwallet-walletconnectV2/src/walletconnectV2.ts:150-152
Timestamp: 2025-12-12T11:20:00.907Z
Learning: In the shapeshift/hdwallet monorepo, the `ethSupportsNetwork()` method in wallet implementations is a legacy/relic method that is no longer used. Chain support is determined by the `_supports*` flags (e.g., `_supportsMonad`, `_supportsPlasma`, `_supportsHyperEvm`) on the wallet classes, not by the `ethSupportsNetwork()` method.

Applied to files:

  • packages/hdwallet-trezor/package.json
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Build and Release
🔇 Additional comments (21)
packages/hdwallet-phantom/package.json (1)

3-3: LGTM! Coordinated version bump.

The package version and core dependency version are correctly bumped to 1.62.35, maintaining consistency across the monorepo. Based on learnings, version bumps in PRs before publishing are expected workflow behavior.

Also applies to: 18-18

packages/hdwallet-keplr/package.json (1)

3-3: LGTM! Version bump aligns with monorepo release.

The package version and hdwallet-core dependency are correctly synchronized to 1.62.35.

Also applies to: 20-20

packages/hdwallet-keepkey-chromeusb/package.json (1)

3-3: LGTM! Version bump aligns with monorepo release.

The package version and all hdwallet-* dependencies are correctly synchronized to 1.62.35.

Also applies to: 17-18

examples/sandbox/package.json (1)

3-3: LGTM! Sandbox dependencies aligned with monorepo release.

All hdwallet-* dependencies are correctly synchronized to 1.62.35.

Also applies to: 15-33

packages/hdwallet-trezor-connect/package.json (1)

3-3: LGTM! Version bump aligns with monorepo release.

The package version and hdwallet dependencies are correctly synchronized to 1.62.35.

Also applies to: 17-18

packages/hdwallet-metamask-multichain/package.json (1)

3-3: LGTM! Version bump aligns with monorepo release.

The package version and hdwallet-core dependency are correctly synchronized to 1.62.35.

Also applies to: 20-20

packages/hdwallet-walletconnectV2/package.json (1)

3-3: LGTM! Version bump aligns with monorepo release.

The package version and hdwallet-core dependency are correctly synchronized to 1.62.35.

Also applies to: 18-18

packages/hdwallet-native/package.json (1)

3-3: LGTM! Version bump aligns with monorepo release.

The package version and hdwallet-core dependency are correctly synchronized to 1.62.35.

Also applies to: 21-21

packages/hdwallet-walletconnect/package.json (1)

3-3: LGTM! Version bump aligns with monorepo release.

The package version and hdwallet-core dependency are correctly synchronized to 1.62.35.

Also applies to: 18-18

packages/hdwallet-native-vault/package.json (1)

3-3: LGTM! Routine version bump aligned with monorepo release.

The version bump to 1.62.35 and the corresponding dependency update are consistent with the broader release across the hdwallet suite.

Also applies to: 18-18

packages/hdwallet-gridplus/package.json (1)

3-3: LGTM! Version bump consistent with monorepo release.

The package version and hdwallet-core dependency are correctly aligned at 1.62.35.

Also applies to: 23-23

packages/hdwallet-keepkey-webusb/package.json (1)

3-3: LGTM! Dependencies properly aligned with version bump.

Both hdwallet-core and hdwallet-keepkey dependencies are correctly updated to 1.62.35.

Also applies to: 17-18

packages/hdwallet-core/package.json (1)

3-3: LGTM! Core package version bump.

The core package version is updated to 1.62.35, which other packages in the monorepo will reference.

packages/hdwallet-keepkey-tcp/package.json (1)

3-3: LGTM! Dependencies correctly aligned.

Version bump and dependency updates to hdwallet-core and hdwallet-keepkey are properly synchronized at 1.62.35.

Also applies to: 17-18

packages/hdwallet-vultisig/package.json (1)

3-3: LGTM! Version aligned with core dependency.

Package version and hdwallet-core dependency are both correctly updated to 1.62.35.

Also applies to: 20-20

packages/hdwallet-keepkey-electron/package.json (1)

3-3: LGTM! Dependency version synchronized.

Package version and hdwallet-keepkey dependency are properly aligned at 1.62.35.

Also applies to: 17-17

packages/hdwallet-keepkey/package.json (1)

3-3: LGTM! Version and dependency properly synchronized.

Package version bump and hdwallet-core dependency update are correctly aligned at 1.62.35.

Also applies to: 24-24

packages/hdwallet-trezor/package.json (1)

3-3: Routine version bump.

The version and dependency updates to 1.62.35 are consistent with the monorepo-wide versioning strategy.

Also applies to: 20-20

packages/hdwallet-ledger-webusb/package.json (1)

3-3: Routine version bump.

The version and dependency updates to 1.62.35 are consistent with the monorepo-wide versioning strategy. The hdwallet-ledger dependency update will pull in the new bitcoinjs-lib changes for Zcash PSBT handling.

Also applies to: 23-24

packages/hdwallet-keepkey-nodewebusb/package.json (1)

3-3: Routine version bump.

The version and dependency updates to 1.62.35 are consistent with the monorepo-wide versioning strategy.

Also applies to: 17-18

integration/package.json (1)

3-3: Version bump and dependency cleanup verified.

The version bump to 1.62.35 and dependency updates are consistent with the monorepo-wide versioning strategy. The removal of @bitgo/utxo-lib is complete: no references to it exist in the integration package code or dependencies, confirming it has been successfully replaced as intended.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
packages/hdwallet-ledger/src/bitcoin.ts (1)

270-275: LGTM!

Explicit Zcash v5 transaction configuration with correct NU6 consensus branch ID (0x4dec4df0). The PSBT methods properly configure the transaction format.

Consider removing the unused ZCASH_VERSION_GROUP_ID[4] entry (line 18) if v4 transactions are no longer supported, to avoid dead code:

 const ZCASH_VERSION_GROUP_ID: Record<number, number> = {
-  4: 0x892f2085,
 };
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 2e82ad6 and ce612ea.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (29)
  • examples/sandbox/package.json (2 hunks)
  • integration/jest.config.js (0 hunks)
  • integration/package.json (0 hunks)
  • lerna.json (1 hunks)
  • packages/hdwallet-coinbase/package.json (2 hunks)
  • packages/hdwallet-core/package.json (1 hunks)
  • packages/hdwallet-gridplus/package.json (2 hunks)
  • packages/hdwallet-keepkey-chromeusb/package.json (2 hunks)
  • packages/hdwallet-keepkey-electron/package.json (2 hunks)
  • packages/hdwallet-keepkey-nodehid/package.json (2 hunks)
  • packages/hdwallet-keepkey-nodewebusb/package.json (2 hunks)
  • packages/hdwallet-keepkey-tcp/package.json (2 hunks)
  • packages/hdwallet-keepkey-webusb/package.json (2 hunks)
  • packages/hdwallet-keepkey/package.json (2 hunks)
  • packages/hdwallet-keplr/package.json (2 hunks)
  • packages/hdwallet-ledger-webhid/package.json (2 hunks)
  • packages/hdwallet-ledger-webusb/package.json (2 hunks)
  • packages/hdwallet-ledger/package.json (0 hunks)
  • packages/hdwallet-ledger/src/bitcoin.ts (4 hunks)
  • packages/hdwallet-metamask-multichain/package.json (2 hunks)
  • packages/hdwallet-native-vault/package.json (2 hunks)
  • packages/hdwallet-native/package.json (2 hunks)
  • packages/hdwallet-phantom/package.json (2 hunks)
  • packages/hdwallet-portis/package.json (2 hunks)
  • packages/hdwallet-trezor-connect/package.json (2 hunks)
  • packages/hdwallet-trezor/package.json (2 hunks)
  • packages/hdwallet-vultisig/package.json (2 hunks)
  • packages/hdwallet-walletconnect/package.json (2 hunks)
  • packages/hdwallet-walletconnectV2/package.json (2 hunks)
💤 Files with no reviewable changes (3)
  • integration/package.json
  • packages/hdwallet-ledger/package.json
  • integration/jest.config.js
🧰 Additional context used
🧠 Learnings (9)
📓 Common learnings
Learnt from: gomesalexandre
Repo: shapeshift/hdwallet PR: 726
File: packages/hdwallet-ledger/package.json:36-36
Timestamp: 2025-08-07T15:27:03.179Z
Learning: In the shapeshiftoss/hdwallet monorepo, the ledgerhq/hw-transport dependency in packages/hdwallet-ledger/package.json is pinned to an exact version (without caret) due to type mismatches that occur with newer versions. Other Ledger dependencies can safely use caret ranges.
Learnt from: gomesalexandre
Repo: shapeshift/hdwallet PR: 726
File: packages/hdwallet-coinbase/package.json:18-18
Timestamp: 2025-08-07T15:23:54.858Z
Learning: In the shapeshiftoss/hdwallet monorepo, package version bumps are done in PRs before publishing. The packages are published after the PR is merged, so dependency versions may reference unpublished versions during the PR review phase. This is expected behavior in their release workflow.
Learnt from: gomesalexandre
Repo: shapeshift/hdwallet PR: 726
File: packages/hdwallet-ledger-webusb/package.json:3-3
Timestamp: 2025-08-07T15:24:19.530Z
Learning: In the shapeshiftoss/hdwallet monorepo, the team runs `yarn build` before bumping versions and also before publishing packages. This ensures that dist/ artifacts (including UMD bundles) are properly regenerated after dependency updates.
Learnt from: gomesalexandre
Repo: shapeshift/hdwallet PR: 726
File: packages/hdwallet-ledger/src/transport.ts:10-10
Timestamp: 2025-08-07T15:47:29.207Z
Learning: In the shapeshiftoss/hdwallet monorepo, ts-ignore is used instead of ts-expect-error for Ledger transport imports because the code works locally without TypeScript errors but has issues in CI environment. Using ts-expect-error would fail locally since there are no actual errors to suppress.
📚 Learning: 2025-08-07T15:27:03.179Z
Learnt from: gomesalexandre
Repo: shapeshift/hdwallet PR: 726
File: packages/hdwallet-ledger/package.json:36-36
Timestamp: 2025-08-07T15:27:03.179Z
Learning: In the shapeshiftoss/hdwallet monorepo, the ledgerhq/hw-transport dependency in packages/hdwallet-ledger/package.json is pinned to an exact version (without caret) due to type mismatches that occur with newer versions. Other Ledger dependencies can safely use caret ranges.

Applied to files:

  • packages/hdwallet-vultisig/package.json
  • packages/hdwallet-walletconnect/package.json
  • packages/hdwallet-trezor-connect/package.json
  • packages/hdwallet-keepkey-nodewebusb/package.json
  • packages/hdwallet-keepkey-chromeusb/package.json
  • packages/hdwallet-core/package.json
  • packages/hdwallet-phantom/package.json
  • packages/hdwallet-keplr/package.json
  • packages/hdwallet-keepkey-tcp/package.json
  • packages/hdwallet-walletconnectV2/package.json
  • packages/hdwallet-keepkey-electron/package.json
  • packages/hdwallet-coinbase/package.json
  • packages/hdwallet-trezor/package.json
  • packages/hdwallet-ledger-webhid/package.json
  • examples/sandbox/package.json
  • packages/hdwallet-native/package.json
  • packages/hdwallet-portis/package.json
  • packages/hdwallet-keepkey-nodehid/package.json
  • packages/hdwallet-ledger-webusb/package.json
  • packages/hdwallet-gridplus/package.json
  • packages/hdwallet-keepkey-webusb/package.json
  • packages/hdwallet-metamask-multichain/package.json
  • packages/hdwallet-native-vault/package.json
  • packages/hdwallet-keepkey/package.json
📚 Learning: 2025-08-07T15:23:54.858Z
Learnt from: gomesalexandre
Repo: shapeshift/hdwallet PR: 726
File: packages/hdwallet-coinbase/package.json:18-18
Timestamp: 2025-08-07T15:23:54.858Z
Learning: In the shapeshiftoss/hdwallet monorepo, package version bumps are done in PRs before publishing. The packages are published after the PR is merged, so dependency versions may reference unpublished versions during the PR review phase. This is expected behavior in their release workflow.

Applied to files:

  • packages/hdwallet-vultisig/package.json
  • packages/hdwallet-walletconnect/package.json
  • packages/hdwallet-trezor-connect/package.json
  • packages/hdwallet-keepkey-nodewebusb/package.json
  • packages/hdwallet-keepkey-chromeusb/package.json
  • packages/hdwallet-core/package.json
  • packages/hdwallet-phantom/package.json
  • packages/hdwallet-keplr/package.json
  • packages/hdwallet-keepkey-tcp/package.json
  • packages/hdwallet-walletconnectV2/package.json
  • packages/hdwallet-keepkey-electron/package.json
  • packages/hdwallet-coinbase/package.json
  • packages/hdwallet-trezor/package.json
  • packages/hdwallet-ledger-webhid/package.json
  • examples/sandbox/package.json
  • packages/hdwallet-native/package.json
  • packages/hdwallet-portis/package.json
  • packages/hdwallet-keepkey-nodehid/package.json
  • packages/hdwallet-ledger-webusb/package.json
  • packages/hdwallet-gridplus/package.json
  • packages/hdwallet-keepkey-webusb/package.json
  • packages/hdwallet-metamask-multichain/package.json
  • packages/hdwallet-native-vault/package.json
  • packages/hdwallet-keepkey/package.json
📚 Learning: 2025-08-07T15:24:19.530Z
Learnt from: gomesalexandre
Repo: shapeshift/hdwallet PR: 726
File: packages/hdwallet-ledger-webusb/package.json:3-3
Timestamp: 2025-08-07T15:24:19.530Z
Learning: In the shapeshiftoss/hdwallet monorepo, the team runs `yarn build` before bumping versions and also before publishing packages. This ensures that dist/ artifacts (including UMD bundles) are properly regenerated after dependency updates.

Applied to files:

  • packages/hdwallet-vultisig/package.json
  • packages/hdwallet-walletconnect/package.json
  • packages/hdwallet-trezor-connect/package.json
  • packages/hdwallet-keepkey-nodewebusb/package.json
  • packages/hdwallet-keepkey-chromeusb/package.json
  • packages/hdwallet-core/package.json
  • packages/hdwallet-phantom/package.json
  • packages/hdwallet-keplr/package.json
  • packages/hdwallet-keepkey-tcp/package.json
  • packages/hdwallet-walletconnectV2/package.json
  • packages/hdwallet-keepkey-electron/package.json
  • packages/hdwallet-coinbase/package.json
  • packages/hdwallet-trezor/package.json
  • packages/hdwallet-ledger-webhid/package.json
  • examples/sandbox/package.json
  • packages/hdwallet-native/package.json
  • packages/hdwallet-portis/package.json
  • packages/hdwallet-keepkey-nodehid/package.json
  • packages/hdwallet-ledger-webusb/package.json
  • packages/hdwallet-gridplus/package.json
  • packages/hdwallet-keepkey-webusb/package.json
  • packages/hdwallet-metamask-multichain/package.json
  • packages/hdwallet-native-vault/package.json
  • packages/hdwallet-keepkey/package.json
📚 Learning: 2025-12-09T13:48:55.139Z
Learnt from: gomesalexandre
Repo: shapeshift/hdwallet PR: 764
File: packages/hdwallet-gridplus/package.json:0-0
Timestamp: 2025-12-09T13:48:55.139Z
Learning: In the shapeshiftoss/hdwallet monorepo, the dist/ directory is not version controlled (not tracked in git). Build artifacts are generated during the build/publish workflow, not committed to the repository.

Applied to files:

  • packages/hdwallet-vultisig/package.json
  • packages/hdwallet-walletconnect/package.json
  • packages/hdwallet-trezor-connect/package.json
  • packages/hdwallet-keepkey-nodewebusb/package.json
  • packages/hdwallet-keepkey-chromeusb/package.json
  • packages/hdwallet-core/package.json
  • packages/hdwallet-phantom/package.json
  • packages/hdwallet-keplr/package.json
  • packages/hdwallet-keepkey-tcp/package.json
  • packages/hdwallet-walletconnectV2/package.json
  • packages/hdwallet-keepkey-electron/package.json
  • packages/hdwallet-coinbase/package.json
  • packages/hdwallet-trezor/package.json
  • packages/hdwallet-ledger-webhid/package.json
  • examples/sandbox/package.json
  • packages/hdwallet-native/package.json
  • packages/hdwallet-portis/package.json
  • packages/hdwallet-keepkey-nodehid/package.json
  • packages/hdwallet-ledger-webusb/package.json
  • packages/hdwallet-gridplus/package.json
  • packages/hdwallet-keepkey-webusb/package.json
  • packages/hdwallet-metamask-multichain/package.json
  • packages/hdwallet-native-vault/package.json
  • packages/hdwallet-keepkey/package.json
📚 Learning: 2025-08-07T15:47:29.207Z
Learnt from: gomesalexandre
Repo: shapeshift/hdwallet PR: 726
File: packages/hdwallet-ledger/src/transport.ts:10-10
Timestamp: 2025-08-07T15:47:29.207Z
Learning: In the shapeshiftoss/hdwallet monorepo, ts-ignore is used instead of ts-expect-error for Ledger transport imports because the code works locally without TypeScript errors but has issues in CI environment. Using ts-expect-error would fail locally since there are no actual errors to suppress.

Applied to files:

  • packages/hdwallet-vultisig/package.json
  • packages/hdwallet-walletconnect/package.json
  • packages/hdwallet-trezor-connect/package.json
  • packages/hdwallet-keepkey-nodewebusb/package.json
  • packages/hdwallet-keepkey-chromeusb/package.json
  • packages/hdwallet-phantom/package.json
  • packages/hdwallet-keplr/package.json
  • packages/hdwallet-keepkey-tcp/package.json
  • packages/hdwallet-walletconnectV2/package.json
  • packages/hdwallet-keepkey-electron/package.json
  • packages/hdwallet-coinbase/package.json
  • packages/hdwallet-trezor/package.json
  • packages/hdwallet-ledger-webhid/package.json
  • examples/sandbox/package.json
  • packages/hdwallet-native/package.json
  • packages/hdwallet-portis/package.json
  • packages/hdwallet-keepkey-nodehid/package.json
  • packages/hdwallet-ledger-webusb/package.json
  • packages/hdwallet-gridplus/package.json
  • packages/hdwallet-keepkey-webusb/package.json
  • packages/hdwallet-metamask-multichain/package.json
  • packages/hdwallet-native-vault/package.json
  • packages/hdwallet-keepkey/package.json
  • packages/hdwallet-ledger/src/bitcoin.ts
📚 Learning: 2025-08-07T15:47:26.835Z
Learnt from: gomesalexandre
Repo: shapeshift/hdwallet PR: 726
File: packages/hdwallet-ledger-webusb/src/transport.ts:12-12
Timestamp: 2025-08-07T15:47:26.835Z
Learning: In the shapeshiftoss/hdwallet monorepo, ts-ignore is used instead of ts-expect-error for Ledger transport imports because the CI environment has different type checking behavior than local development. The code works locally without errors, but CI reports type issues, so ts-ignore is necessary to suppress the inconsistent type checking across environments.

Applied to files:

  • packages/hdwallet-vultisig/package.json
  • packages/hdwallet-trezor-connect/package.json
  • packages/hdwallet-keepkey-nodewebusb/package.json
  • packages/hdwallet-keepkey-chromeusb/package.json
  • packages/hdwallet-keplr/package.json
  • packages/hdwallet-keepkey-tcp/package.json
  • packages/hdwallet-keepkey-electron/package.json
  • packages/hdwallet-coinbase/package.json
  • packages/hdwallet-trezor/package.json
  • packages/hdwallet-ledger-webhid/package.json
  • examples/sandbox/package.json
  • packages/hdwallet-native/package.json
  • packages/hdwallet-portis/package.json
  • packages/hdwallet-keepkey-nodehid/package.json
  • packages/hdwallet-ledger-webusb/package.json
  • packages/hdwallet-gridplus/package.json
  • packages/hdwallet-keepkey-webusb/package.json
  • packages/hdwallet-metamask-multichain/package.json
  • packages/hdwallet-native-vault/package.json
  • packages/hdwallet-keepkey/package.json
  • packages/hdwallet-ledger/src/bitcoin.ts
📚 Learning: 2025-08-07T15:24:34.076Z
Learnt from: gomesalexandre
Repo: shapeshift/hdwallet PR: 726
File: examples/sandbox/package.json:15-31
Timestamp: 2025-08-07T15:24:34.076Z
Learning: Lerna v6+ supports workspace protocol syntax (workspace:*) but does not automatically convert exact versions to workspace protocol during version bumps. It only preserves existing workspace protocol syntax. Teams using Lerna for automated version bumps would need manual conversion to use workspace protocol, which negates automation benefits.

Applied to files:

  • lerna.json
📚 Learning: 2025-11-20T11:04:44.808Z
Learnt from: gomesalexandre
Repo: shapeshift/hdwallet PR: 737
File: packages/hdwallet-trezor/src/ethereum.ts:122-138
Timestamp: 2025-11-20T11:04:44.808Z
Learning: In packages/hdwallet-trezor/src/ethereum.ts, the ethSignTypedData function correctly returns the signature from res.payload.signature without adding a "0x" prefix. This works correctly in practice and has been tested, despite appearing inconsistent with ethSignMessage which does add the prefix. The Trezor Connect ethereumSignTypedData response already provides the signature in the correct format for consumption.

Applied to files:

  • packages/hdwallet-ledger/src/bitcoin.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Build and Release
🔇 Additional comments (23)
lerna.json (1)

3-3: Verify the rationale for the version downgrade.

The monorepo version is being downgraded from 1.62.28 to 1.62.26. While the change is consistent across all dependent files, the downgrade direction is unusual for a feature PR (feat: typically implies version increment, not decrement). This pattern is consistent with a rollback or correction of a previous erroneous version bump.

Please confirm: Is this downgrade intentional (e.g., rolling back to a known-good version before the feature), or should the version be incrementing instead?

packages/hdwallet-core/package.json (1)

1-31: Version downgrade is consistent across the monorepo.

The version change to 1.62.26 aligns with the lerna.json downgrade. Dependencies remain stable and no direct removals are visible here.

packages/hdwallet-portis/package.json (1)

1-30: Consistent version alignment with monorepo and core dependency.

Version and core dependency are properly synchronized to 1.62.26. No concerning changes.

packages/hdwallet-gridplus/package.json (1)

1-39: Consistent version alignment with monorepo and core dependency.

Version and core dependency are properly synchronized to 1.62.26.

packages/hdwallet-vultisig/package.json (1)

1-30: Consistent version alignment with monorepo and core dependency.

Version and core dependency are properly synchronized to 1.62.26.

packages/hdwallet-keepkey/package.json (1)

1-50: Consistent version alignment with monorepo and core dependency.

Version and core dependency are properly synchronized to 1.62.26.

packages/hdwallet-metamask-multichain/package.json (1)

1-31: Consistent version alignment with monorepo and core dependency.

Version and core dependency are properly synchronized to 1.62.26.

packages/hdwallet-ledger-webusb/package.json (2)

1-31: Consistent version alignment and proper dependency cascade.

Version and internal dependency versions are synchronized to 1.62.26. Ledger transport dependencies correctly remain pinned to exact versions per project standards. Based on learnings, exact pins for ledgerhq/hw-transport are intentional due to CI type-checking issues.


1-31: Main code changes for Zcash PSBT refactoring are not provided in this review batch.

The PR objective is to replace @bitgo/utxo-lib with @shapeshiftoss/bitcoinjs-lib for Ledger Zcash PSBT handling. However, the actual implementation changes (mentioned in the AI summary as occurring in packages/hdwallet-ledger/src/bitcoin.ts) are not included in the provided files. Similarly, the removal of @bitgo/utxo-lib from packages/hdwallet-ledger/package.json and integration files is not visible here.

Please ensure that the following are reviewed as part of this PR:

  1. Code changes in packages/hdwallet-ledger/src/bitcoin.ts showing the Zcash PSBT refactoring with @shapeshiftoss/bitcoinjs-lib
  2. Removal of @bitgo/utxo-lib from packages/hdwallet-ledger/package.json
  3. Integration changes mentioned in the AI summary (integration/jest.config.js, integration/package.json)
  4. Verification that the PR's testing checklist has been executed (Zcash sends, two consecutive Zcash sends, DOGE sanity test)
examples/sandbox/package.json (1)

3-3: Verify the rationale for version downgrade rather than upgrade.

All package versions and internal @shapeshiftoss/hdwallet-* dependencies are downgraded from 1.62.28 to 1.62.26. This is unusual—typically version changes increment, not decrement. Confirm this is intentional (e.g., bug fix, rollback) rather than an accidental regression.

Also applies to: 15-32

packages/hdwallet-native-vault/package.json (1)

3-3: LGTM!

Version and internal dependency updates are consistent. Based on learnings, version bumps referencing unpublished versions during PR review phase is expected behavior in this monorepo's release workflow.

Also applies to: 18-18

packages/hdwallet-keepkey-nodehid/package.json (1)

3-3: LGTM!

Version and dependency updates are consistent with the monorepo-wide version alignment.

Also applies to: 17-17

packages/hdwallet-keepkey-chromeusb/package.json (1)

3-3: LGTM!

Version and dependency updates are consistent with the monorepo-wide version alignment.

Also applies to: 17-18

packages/hdwallet-ledger-webhid/package.json (1)

3-3: LGTM!

Version and dependency updates are consistent with the monorepo-wide version alignment.

Also applies to: 21-22

packages/hdwallet-keepkey-webusb/package.json (1)

3-3: LGTM!

Version and dependency updates are consistent with the monorepo-wide version alignment.

Also applies to: 17-18

packages/hdwallet-ledger/src/bitcoin.ts (4)

220-224: LGTM!

Clean refactor replacing BitGo PSBT with @shapeshiftoss/bitcoinjs-lib. The forkCoin parameter correctly enables Zcash-specific serialization when needed.


257-257: LGTM!

Unified output addition using address field simplifies the code by letting the library handle address-to-script conversion internally.


277-277: LGTM!

Unified approach for extracting unsigned transaction hex from the PSBT works correctly with the new implementation.


371-380: The blockHeight fallback value is correct. The NU6 activation height for Zcash mainnet is 2,726,400, confirming the constant used in the code. The logic correctly uses Math.max to find the highest confirmed input blockHeight with this fallback, properly handling edge cases (undefined, zero, or negative values).

packages/hdwallet-walletconnectV2/package.json (1)

3-3: Version downgrade aligns with monorepo convention, but PR objective changes not visible in this file.

The version downgrade from 1.62.28 to 1.62.26 is consistent across package and core dependency. However, the PR objectives describe replacing @bitgo/utxo-lib with @shapeshiftoss/bitcoinjs-lib for Ledger Zcash PSBT handling, which is not evident in this file. This suggests the feature implementation is in other files (likely packages/hdwallet-ledger).

Also applies to: 18-18

packages/hdwallet-trezor/package.json (1)

3-3: Version downgrade consistent, but this Trezor package is unrelated to the Ledger Zcash PSBT feature.

The version downgrade from 1.62.28 to 1.62.26 is consistent with other files reviewed. However, this package is Trezor-specific and not directly related to the Ledger Zcash PSBT handling feature described in the PR objectives.

Also applies to: 20-20

packages/hdwallet-walletconnect/package.json (1)

3-3: Version downgrade is consistent across packages, but no feature changes visible in this file.

The version downgrade to 1.62.26 follows the same pattern as other packages. This WalletConnect integration file does not contain the Zcash PSBT handling changes mentioned in the PR objectives, which are likely in the hdwallet-ledger package.

Also applies to: 18-18

packages/hdwallet-trezor-connect/package.json (1)

3-3: Version downgrade is consistent, but the actual Zcash PSBT feature changes are not visible in these files.

All 4 package.json files show a uniform version downgrade from 1.62.28 to 1.62.26. However, the PR objectives mention replacing @bitgo/utxo-lib with @shapeshiftoss/bitcoinjs-lib for Ledger Zcash PSBT handling. These changes are not visible in any of the provided files, suggesting the feature implementation is in the hdwallet-ledger package (not included in this review).

Verification needed:

Please confirm that the hdwallet-ledger package.json contains the actual feature changes:

  • Removal of @bitgo/utxo-lib dependency
  • Addition of @shapeshiftoss/bitcoinjs-lib dependency
  • Any corresponding version updates for the ledger package itself

Additionally, as per your monorepo's standard workflow (from learnings), ensure that yarn build has been executed to regenerate dist artifacts after these dependency changes.

Also applies to: 17-17, 18-18

@gomesalexandre gomesalexandre force-pushed the feat_bitgo_bitcoinjs_lib branch from ce612ea to 2b18cd2 Compare December 11, 2025 19:06
@gomesalexandre gomesalexandre marked this pull request as draft December 11, 2025 19:08
@gomesalexandre gomesalexandre force-pushed the feat_bitgo_bitcoinjs_lib branch 4 times, most recently from ae9cdc1 to 74a311c Compare December 11, 2025 19:20
@gomesalexandre gomesalexandre force-pushed the feat_bitgo_bitcoinjs_lib branch from 74a311c to 352aa01 Compare December 11, 2025 19:22
NeOMakinG
NeOMakinG previously approved these changes Dec 16, 2025
Copy link
Contributor

@NeOMakinG NeOMakinG left a comment

Choose a reason for hiding this comment

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

https://jam.dev/c/d507240e-e0e3-422d-b8b7-bc3568736f22

Both broadcasted as expected!

Edit: fml, tested with native wallet first: https://jam.dev/c/e0b84366-e8d0-46dd-82fe-cfe60187286f

I failed at launching 2 TX in a row, but it might be because my ledger wallet doesn't have a lot of assets, happy to give it a stamp and leave to OPS to further testing with more funds as nothing seems to be breaking that from code reading!

Resolved conflict in integration/package.json by keeping origin/master
versions (1.62.29) and removing @bitgo/utxo-lib dependency as intended.
@gomesalexandre
Copy link
Contributor Author

@NeOMakinG tyvm ser! Moving to draft since this one is not urgent at all (things work perf as-is) to give it another go of testing with Ledger + Native and triple check this behaviour!

@gomesalexandre gomesalexandre marked this pull request as draft December 16, 2025 15:30
@gomesalexandre
Copy link
Contributor Author

I failed at launching 2 TX in a row, but it might be because my ledger wallet doesn't have a lot of assets, happy to give it a stamp and leave to OPS to further testing with more funds as nothing seems to be breaking that from code reading!

Nice catch! That is definitely a bug! It working when I tested was sheer luck because of the blockHeight back then, see repro: https://jam.dev/c/a4be2615-6c5b-4ba7-8d6b-466a688a03ef

@gomesalexandre gomesalexandre force-pushed the feat_bitgo_bitcoinjs_lib branch from 1849618 to bdd545f Compare December 16, 2025 18:19
@gomesalexandre
Copy link
Contributor Author

gomesalexandre commented Dec 16, 2025

@NeOMakinG should be happy after bdd545f though that commit shouldn't really matter, the actual fix is in web properly passing blockHeight https://github.com/shapeshift/web/pull/11374/changes#diff-c57ed3cf3c7d6cac82d78256887a33acb17e5619c68ac7d25b5db0c363a85849R357)

See Jam after fix https://jam.dev/c/03f55e0d-3818-4f53-8f64-34ff29de7b45

@gomesalexandre gomesalexandre marked this pull request as ready for review December 16, 2025 18:21
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
packages/hdwallet-ledger/src/bitcoin.ts (1)

371-377: Consider extracting the fallback height to a named constant.

The block height logic correctly handles edge cases (empty/undefined heights). The magic number 3150000 (above NU6.1 activation) could be extracted to a named constant for self-documentation:

+const ZCASH_NU6_1_FALLBACK_HEIGHT = 3150000; // Above NU6.1 activation (3146400)
+
 // ...
 
 blockHeight:
   msg.coin === "Zcash"
-    ? Math.max(...blockHeights.filter((h): h is number => h !== undefined && h > 0), 3150000)
+    ? Math.max(...blockHeights.filter((h): h is number => h !== undefined && h > 0), ZCASH_NU6_1_FALLBACK_HEIGHT)
     : undefined,
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 6e494e1 and bdd545f.

📒 Files selected for processing (3)
  • integration/package.json (1 hunks)
  • packages/hdwallet-ledger/package.json (0 hunks)
  • packages/hdwallet-ledger/src/bitcoin.ts (4 hunks)
💤 Files with no reviewable changes (1)
  • packages/hdwallet-ledger/package.json
🚧 Files skipped from review as they are similar to previous changes (1)
  • integration/package.json
🧰 Additional context used
🧠 Learnings (6)
📓 Common learnings
Learnt from: gomesalexandre
Repo: shapeshift/hdwallet PR: 726
File: packages/hdwallet-coinbase/package.json:18-18
Timestamp: 2025-08-07T15:23:54.858Z
Learning: In the shapeshiftoss/hdwallet monorepo, package version bumps are done in PRs before publishing. The packages are published after the PR is merged, so dependency versions may reference unpublished versions during the PR review phase. This is expected behavior in their release workflow.
Learnt from: gomesalexandre
Repo: shapeshift/hdwallet PR: 726
File: packages/hdwallet-ledger/package.json:36-36
Timestamp: 2025-08-07T15:27:03.179Z
Learning: In the shapeshiftoss/hdwallet monorepo, the ledgerhq/hw-transport dependency in packages/hdwallet-ledger/package.json is pinned to an exact version (without caret) due to type mismatches that occur with newer versions. Other Ledger dependencies can safely use caret ranges.
📚 Learning: 2025-11-20T11:04:44.808Z
Learnt from: gomesalexandre
Repo: shapeshift/hdwallet PR: 737
File: packages/hdwallet-trezor/src/ethereum.ts:122-138
Timestamp: 2025-11-20T11:04:44.808Z
Learning: In packages/hdwallet-trezor/src/ethereum.ts, the ethSignTypedData function correctly returns the signature from res.payload.signature without adding a "0x" prefix. This works correctly in practice and has been tested, despite appearing inconsistent with ethSignMessage which does add the prefix. The Trezor Connect ethereumSignTypedData response already provides the signature in the correct format for consumption.

Applied to files:

  • packages/hdwallet-ledger/src/bitcoin.ts
📚 Learning: 2025-08-07T15:47:29.207Z
Learnt from: gomesalexandre
Repo: shapeshift/hdwallet PR: 726
File: packages/hdwallet-ledger/src/transport.ts:10-10
Timestamp: 2025-08-07T15:47:29.207Z
Learning: In the shapeshiftoss/hdwallet monorepo, ts-ignore is used instead of ts-expect-error for Ledger transport imports because the code works locally without TypeScript errors but has issues in CI environment. Using ts-expect-error would fail locally since there are no actual errors to suppress.

Applied to files:

  • packages/hdwallet-ledger/src/bitcoin.ts
📚 Learning: 2025-08-07T15:27:03.179Z
Learnt from: gomesalexandre
Repo: shapeshift/hdwallet PR: 726
File: packages/hdwallet-ledger/package.json:36-36
Timestamp: 2025-08-07T15:27:03.179Z
Learning: In the shapeshiftoss/hdwallet monorepo, the ledgerhq/hw-transport dependency in packages/hdwallet-ledger/package.json is pinned to an exact version (without caret) due to type mismatches that occur with newer versions. Other Ledger dependencies can safely use caret ranges.

Applied to files:

  • packages/hdwallet-ledger/src/bitcoin.ts
📚 Learning: 2025-08-07T15:47:26.835Z
Learnt from: gomesalexandre
Repo: shapeshift/hdwallet PR: 726
File: packages/hdwallet-ledger-webusb/src/transport.ts:12-12
Timestamp: 2025-08-07T15:47:26.835Z
Learning: In the shapeshiftoss/hdwallet monorepo, ts-ignore is used instead of ts-expect-error for Ledger transport imports because the CI environment has different type checking behavior than local development. The code works locally without errors, but CI reports type issues, so ts-ignore is necessary to suppress the inconsistent type checking across environments.

Applied to files:

  • packages/hdwallet-ledger/src/bitcoin.ts
📚 Learning: 2025-12-12T11:19:53.263Z
Learnt from: gomesalexandre
Repo: shapeshift/hdwallet PR: 769
File: packages/hdwallet-walletconnectV2/src/walletconnectV2.ts:150-152
Timestamp: 2025-12-12T11:19:53.263Z
Learning: In the shapeshift/hdwallet monorepo, remove reliance on ethSupportsNetwork() across wallet implementations. This legacy method is no longer used to determine chain support. Instead, rely on the wallet class flags like _supportsMonad, _supportsPlasma, _supportsHyperEvm. Review all wallet implementations for ethSupportsNetwork() usage and migrate checks to the corresponding _supports* flags, updating tests and any affected logic accordingly.

Applied to files:

  • packages/hdwallet-ledger/src/bitcoin.ts
🧬 Code graph analysis (1)
packages/hdwallet-ledger/src/bitcoin.ts (1)
packages/hdwallet-ledger/src/utils.ts (1)
  • networksUtil (121-592)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Build and Release
🔇 Additional comments (4)
packages/hdwallet-ledger/src/bitcoin.ts (4)

220-224: Clean unified PSBT initialization.

The refactor to use a single PSBT constructor with forkCoin parameter simplifies the code path and removes the need for separate BitGo PSBT handling for Zcash.


257-258: Consistent output value handling using BigInt.

The unified output construction with BigInt(output.amount) aligns with the OP_RETURN output handling and modern bitcoinjs-lib conventions.


277-277: Centralized transaction extraction.

Using psbt.data.getTransaction() provides a unified way to extract the unsigned transaction across all coin types.


270-275: No changes needed. The hardcoded version 5 and consensus branch ID 0x4dec4df0 are correct and current for NU6.1 mainnet, which activated on November 24, 2025.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@vercel
Copy link

vercel bot commented Dec 28, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
hdwallet Ready Ready Preview, Comment Dec 28, 2025 7:44pm

@gomesalexandre
Copy link
Contributor Author

gomesalexandre commented Dec 28, 2025

@NeOMakinG definitive fix for mempool things is in web, see retest in https://jam.dev/c/24cd9fee-2db5-4ef6-bbcb-cbc6706e951a

Going to land this guy!

@gomesalexandre gomesalexandre merged commit 3125f09 into master Dec 28, 2025
5 checks passed
@gomesalexandre gomesalexandre deleted the feat_bitgo_bitcoinjs_lib branch December 28, 2025 20:07
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