Skip to content

feat: hdwallet-gridplus add SafeCard validation - #748

Merged
gomesalexandre merged 45 commits into
masterfrom
feat_gridplus_validation_v2
Nov 28, 2025
Merged

feat: hdwallet-gridplus add SafeCard validation#748
gomesalexandre merged 45 commits into
masterfrom
feat_gridplus_validation_v2

Conversation

@gomesalexandre

@gomesalexandre gomesalexandre commented Nov 26, 2025

Copy link
Copy Markdown
Contributor

Description

Test me with the matching web PR

This PR:

  • Adds proper safecard setting on safecard connection
  • Adds safecard validation on safecard reconnection
  • Adds safecard validation before key signing times

Screenshots

gridplus.validation.final.testing.mov
image Screenshot 2025-11-26 at 20 41 55 Screenshot 2025-11-26 at 20 41 08 Screenshot 2025-11-26 at 19 41 29 Screenshot 2025-11-26 at 19 21 35 Screenshot 2025-11-26 at 19 21 29

Summary by CodeRabbit

  • New Features

    • Pairing now returns wallet plus active wallet ID and card type.
    • Optional expectations can be set to validate the active card before use.
    • Improved detection and prioritization between external and internal cards.
  • Bug Fixes

    • Signing operations now enforce active-wallet validation to prevent mismatched signing.
    • Reconnect flow more robustly resets active-wallet state and surfaces an error if no active wallet is found.
  • Chores

    • Package versions updated across the workspace.

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

Implements three-point validation for GridPlus SafeCards:
1. Initial pairing - capture wallet UID
2. Reconnection - validate correct SafeCard inserted
3. Just-in-time before signing - prevent wrong SafeCard swaps

Changes:
- Add validateActiveWallet() to fetch and validate wallet UID
- Add setExpectedWalletUid() for JIT validation setup
- Add validateBeforeSigning() called before all signing methods
- Update adapter pairDevice() to return walletUid and isExternal
- Update adapter connectDevice() to accept expectedWalletUid
- Wire validation to: ETH, BTC, Solana, Cosmos, Thorchain, Mayachain

Note: Built on top of a1a7c01 which has type errors in bitcoin.ts
Need to fix base commit type errors before this can build.
@coderabbitai

coderabbitai Bot commented Nov 26, 2025

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

GridPlus adapter and wallet code now surface and validate SafeCard active-wallet metadata. connectDevice/pairDevice signatures and returns changed to include activeWalletId and type. GridPlusHDWallet stores expected active-wallet info and enforces validation before pairing and all signing operations.

Changes

Cohort / File(s) Summary
Adapter changes
packages/hdwallet-gridplus/src/adapter.ts
connectDevice signature changed to (deviceId, expectedActiveWalletId?, expectedType?); pairDevice now returns { wallet, activeWalletId, type }; hashing input adjusted; resetActiveWallets() added on reconnect; explicit error path when no active wallet found.
GridPlus wallet implementation
packages/hdwallet-gridplus/src/gridplus.ts
Added SafeCardType (`"external"
Signing pre-validation
packages/hdwallet-gridplus/src/gridplus.ts
Signing methods (btcSignTx, ethSignTx, ethSignTypedData, ethSignMessage, solanaSignTx, cosmosSignTx, thorchainSignTx, mayachainSignTx) require expectedActiveWalletId and call validateActiveWallet(...) before proceeding; Solana retains firmware pre-check.
Example update
examples/sandbox/index.ts
Updated pairing flow to destructure { wallet, activeWalletId, type } from pairDevice and assign wallet locally before updating global reference.
Manifests / version bumps
examples/sandbox/package.json, integration/package.json, lerna.json, many packages/*/package.json
Bumped package versions from 1.62.151.62.16; updated internal hdwallet dependency versions accordingly across multiple package.json files.

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant Adapter as GridPlus Adapter
    participant Device as GridPlus Device
    participant Wallet as GridPlusHDWallet

    Note over Client,Adapter: Pairing returns wallet + active metadata
    Client->>Adapter: pairDevice(pairingCode)
    Adapter->>Device: establish pairing/session
    Device-->>Adapter: pairing success
    Adapter->>Device: query active wallet data
    Device-->>Adapter: { activeWalletId, type }
    Adapter-->>Client: { wallet, activeWalletId, type }

    Note over Client,Adapter: Connect with expectations
    Client->>Adapter: connectDevice(deviceId, expectedActiveWalletId?, expectedType?)
    Adapter->>Wallet: setExpectedActiveWalletId(...)
    Wallet->>Device: query active wallet
    Wallet-->>Adapter: { activeWalletId, type } or Error
    Adapter-->>Client: GridPlusHDWallet or undefined/error

    Note over Client,Wallet: Signing requires validation
    Client->>Wallet: ethSignTx(tx)
    Wallet->>Wallet: validateActiveWallet(expectedActiveWalletId, expectedType)
    alt validated
        Wallet->>Device: Sign tx
        Device-->>Wallet: signature
        Wallet-->>Client: signed result
    else validation failed
        Wallet-->>Client: Error (active wallet mismatch)
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • Areas to focus:
    • validateActiveWallet priority/order and edge cases (no safecard connected)
    • Correct propagation of expectedActiveWalletId/expectedType from adapter → wallet (pairDevice → connectDevice)
    • Call sites updated to handle the new pairDevice return shape
    • Error types/messages and unit/interop behavior for signing when expectations are unset/mismatched

Possibly related PRs

Suggested reviewers

  • NeOMakinG
  • kaladinlight

Poem

🐰 I hop through code with whiskers bright,
I pair the card and check its light,
I guard the key and match the id,
Then signatures blossom — hop, we did! 🥕✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately and concisely summarizes the primary change: adding SafeCard validation to the hdwallet-gridplus adapter.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat_gridplus_validation_v2

📜 Recent 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 951a647 and b32d09c.

📒 Files selected for processing (27)
  • examples/sandbox/package.json (2 hunks)
  • integration/package.json (2 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 (2 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 skipped from review as they are similar to previous changes (23)
  • packages/hdwallet-phantom/package.json
  • packages/hdwallet-metamask-multichain/package.json
  • packages/hdwallet-walletconnectV2/package.json
  • lerna.json
  • packages/hdwallet-coinbase/package.json
  • packages/hdwallet-ledger-webusb/package.json
  • packages/hdwallet-gridplus/package.json
  • packages/hdwallet-keepkey-tcp/package.json
  • packages/hdwallet-keepkey-webusb/package.json
  • packages/hdwallet-ledger/package.json
  • packages/hdwallet-portis/package.json
  • packages/hdwallet-native/package.json
  • packages/hdwallet-trezor-connect/package.json
  • packages/hdwallet-native-vault/package.json
  • packages/hdwallet-walletconnect/package.json
  • packages/hdwallet-keplr/package.json
  • integration/package.json
  • packages/hdwallet-core/package.json
  • packages/hdwallet-ledger-webhid/package.json
  • packages/hdwallet-keepkey-electron/package.json
  • packages/hdwallet-keepkey-nodehid/package.json
  • packages/hdwallet-keepkey-nodewebusb/package.json
  • packages/hdwallet-keepkey/package.json
🧰 Additional context used
🧠 Learnings (6)
📓 Common learnings
Learnt from: gomesalexandre
Repo: shapeshift/hdwallet PR: 731
File: packages/hdwallet-gridplus/src/thormaya.ts:99-105
Timestamp: 2025-10-15T23:22:26.842Z
Learning: In packages/hdwallet-gridplus/src/thormaya.ts, the GridPlus SDK (gridplus-sdk) automatically pads the r and s signature components to 32 bytes, so explicit padding in the code may be redundant but is not required. The thorchainSignTx implementation works without explicit padding because the SDK handles it.
Learnt from: gomesalexandre
Repo: shapeshift/hdwallet PR: 731
File: packages/hdwallet-gridplus/src/ethereum.ts:117-124
Timestamp: 2025-10-14T20:59:48.768Z
Learning: In packages/hdwallet-gridplus/src/ethereum.ts, the GridPlus SDK's sign method returns v as a number (integer), not a Buffer, so the Buffer.isBuffer(v) check is always false and vRaw = v is used directly.
📚 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-trezor/package.json
  • packages/hdwallet-keepkey-chromeusb/package.json
  • examples/sandbox/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-trezor/package.json
  • packages/hdwallet-keepkey-chromeusb/package.json
  • examples/sandbox/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-trezor/package.json
  • packages/hdwallet-keepkey-chromeusb/package.json
  • examples/sandbox/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-trezor/package.json
  • packages/hdwallet-keepkey-chromeusb/package.json
  • examples/sandbox/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-vultisig/package.json
  • packages/hdwallet-trezor/package.json
  • packages/hdwallet-keepkey-chromeusb/package.json
  • examples/sandbox/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 (4)
packages/hdwallet-keepkey-chromeusb/package.json (1)

3-3: Version bump consistency looks good.

The package version and dependency versions are all aligned to 1.62.16, maintaining consistency across the keepkey-chromeusb adapter and its core dependencies. This aligns with the repository-wide version update as part of this PR. Based on learnings, version bumps in PRs before publishing is the expected workflow in this monorepo.

Also applies to: 17-18

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

3-3: Version bump is consistent and follows monorepo patterns.

The coordinated version bump from 1.62.15 to 1.62.16 for both the package and its @shapeshiftoss/hdwallet-core dependency is correct. The exact-pin versioning for @shapeshiftoss/* packages aligns with the established pattern in this monorepo.

Also applies to: 20-20

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

3-3: Version and dependency bump aligned with monorepo release cycle.

The version update to 1.62.16 and corresponding @shapeshiftoss/hdwallet-core dependency update are consistent with the monorepo-wide coordinate version bump. Based on learnings, this follows the standard release workflow for this repository.

Also applies to: 20-20

examples/sandbox/package.json (1)

3-3: Comprehensive and consistent dependency version updates.

All 18 @shapeshiftoss/hdwallet-* dependencies are properly updated from 1.62.15 to 1.62.16. The use of exact versions (no caret ranges) is appropriate for tightly-coupled internal monorepo packages and prevents version drift.

Also applies to: 15-32


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.

gomesalexandre and others added 9 commits November 26, 2025 16:02
SafeCards are the base case, internal wallet is the edge case.
Updated naming to reflect this throughout.
- Changed isInternal boolean to type: 'external' | 'internal'
- Simplified validateActiveWallet logic using type to index activeWallets
- Removed all console.log statements
- Much cleaner diff\!
Calling validateActiveWallet() after pair() caused Device Locked error
because it triggered a second fetchActiveWallet() call while device was
still processing the first one from SDK's pair() function.

Fixed by using client.getActiveWallet() which returns cached data.
Renamed across GridPlus adapter and wallet implementation:
- walletUid → activeWalletId
- expectedWalletUid → expectedActiveWalletId
- setExpectedWalletUid → setExpectedActiveWalletId
- uid field in return types → activeWalletId

Also bumped to 1.62.13-gridplus-validation.12

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

Co-Authored-By: Claude <noreply@anthropic.com>
During initial pairing flow, connectDevice() was being called twice:
1. From Connect screen (not yet paired)
2. From Pair screen (after entering pairing code)

The second call would hit the else branch and call resetActiveWallets(),
but this was unnecessary during pairing and could interfere with the
cache populated by pair().

Removed the resetActiveWallets() call from connectDevice(). Cache
clearing is not needed during normal pairing flow - only for
reconnection/switching scenarios which will be handled separately.

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

Co-Authored-By: Claude <noreply@anthropic.com>
Previous commit incorrectly removed this - it's needed for proper
cache management when client already exists. The Device Locked error
was actually caused by duplicate connectDevice() calls in web utils,
not by this resetActiveWallets() call.

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

Co-Authored-By: Claude <noreply@anthropic.com>
@gomesalexandre gomesalexandre changed the title wip: add SafeCard validation wip: hdwallet-gridplus add SafeCard validation Nov 26, 2025
gomesalexandre and others added 13 commits November 26, 2025 19:23
When expectedType is 'internal' and validation fails, throw more
specific error: "Remove inserted SafeCard to access internal GridPlus wallet"

This allows web to show different error messages for:
- External SafeCard mismatch: "Wrong SafeCard inserted..."
- Internal wallet blocked by external card: "Remove inserted SafeCard..."

Changes:
- Added expectedType property to track expected wallet type
- Updated setExpectedActiveWalletId() to accept optional type parameter
- Throw different error messages based on expected type

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

Co-Authored-By: Claude <noreply@anthropic.com>
Replaced direct Buffer.equals(ZERO_BUFFER) calls with semantic
isEmptyWallet() helper function for better readability.

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

Co-Authored-By: Claude <noreply@anthropic.com>
Replaced ZERO_BUFFER allocation with buffer.every(b => b === 0)
for more efficient zero-check without allocating comparison buffer.

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

Co-Authored-By: Claude <noreply@anthropic.com>
Combined improvements:
- Optimized buffer comparison using buffer.every() instead of allocating ZERO_BUFFER
- Added expectedType property for context-aware error messages
- setExpectedActiveWalletId() now accepts optional type parameter
- Throws specific errors:
  - Internal: "Remove inserted SafeCard to access internal GridPlus wallet"
  - External: "Active SafeCard doesn't match expected SafeCard"

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

Co-Authored-By: Claude <noreply@anthropic.com>
Updated validateActiveWallet() and connectDevice() signatures to accept
expectedType parameter, and pass it through from all signing methods.

This ensures the correct context-aware error message is thrown based on
whether internal or external wallet is expected.

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

Co-Authored-By: Claude <noreply@anthropic.com>
Reverted all package.json and lerna.json files to origin/master to
keep diff focused on actual code changes only.

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

Co-Authored-By: Claude <noreply@anthropic.com>
Keep diff focused only on GridPlus validation changes.

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

Co-Authored-By: Claude <noreply@anthropic.com>
Re-added comment from master explaining why resetActiveWallets is
called when client already exists.

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

Co-Authored-By: Claude <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
TypeScript infers the type from the ternary expression.

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

Co-Authored-By: Claude <noreply@anthropic.com>
Created SafeCardType = 'external' | 'internal' to reduce repetition
and improve maintainability.

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

Co-Authored-By: Claude <noreply@anthropic.com>
The walletName field was never used and is always empty anyway.

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

Co-Authored-By: Claude <noreply@anthropic.com>
Replaced buffer.every() with hex string comparison against viem's
zeroHash constant for cleaner and more semantic code.

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

Co-Authored-By: Claude <noreply@anthropic.com>
@gomesalexandre gomesalexandre changed the title wip: hdwallet-gridplus add SafeCard validation feat: hdwallet-gridplus add SafeCard validation Nov 26, 2025
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Comment thread packages/hdwallet-gridplus/src/gridplus.ts Outdated
Comment thread packages/hdwallet-gridplus/src/gridplus.ts
…ment

- Renamed to isZeroSafecardUid for better clarity
- Updated validateActiveWallet JSDoc to reflect current implementation

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

Co-Authored-By: Claude <noreply@anthropic.com>
gomesalexandre and others added 7 commits November 26, 2025 23:24
Positive logic (isSafecardConnected) is clearer than double negative
(!isSafecardDisconnected).

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

Co-Authored-By: Claude <noreply@anthropic.com>
Changed from silently skipping validation to throwing an error if
expectedActiveWalletId is not set. This catches bugs where we forget
to call setExpectedActiveWalletId() after wallet setup.

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

Co-Authored-By: Claude <noreply@anthropic.com>
Comment thread packages/hdwallet-gridplus/src/gridplus.ts
@gomesalexandre
gomesalexandre marked this pull request as ready for review November 27, 2025 00:26
@gomesalexandre
gomesalexandre requested a review from a team as a code owner November 27, 2025 00:26

@coderabbitai coderabbitai 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.

Actionable comments posted: 2

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

476-478: Consider extracting repeated validation pattern.

The validation pattern (check expectedActiveWalletId, call validateActiveWallet) is repeated identically across all signing methods (lines 476-478, 497-499, 505-507, 513-515, 542-544, 555-557, 568-570, 581-583). While functional, this creates maintenance overhead.

Consider extracting to a private helper:

private async ensureValidatedWallet(): Promise<void> {
  if (!this.expectedActiveWalletId) throw new Error("Expected SafeCard ID not set");
  await this.validateActiveWallet(this.expectedActiveWalletId, this.expectedType);
}

Then use in signing methods:

 async btcSignTx(msg: core.BTCSignTx): Promise<core.BTCSignedTx | null> {
   if (!this.client) throw new Error("Device not connected");
-  if (!this.expectedActiveWalletId) throw new Error("Expected SafeCard ID not set");
-
-  await this.validateActiveWallet(this.expectedActiveWalletId, this.expectedType);
+  await this.ensureValidatedWallet();
   return btc.btcSignTx(this.client, msg);
 }
📜 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 a1a7c01 and 9cf7045.

📒 Files selected for processing (2)
  • packages/hdwallet-gridplus/src/adapter.ts (4 hunks)
  • packages/hdwallet-gridplus/src/gridplus.ts (10 hunks)
🧰 Additional context used
🧠 Learnings (6)
📓 Common learnings
Learnt from: gomesalexandre
Repo: shapeshift/hdwallet PR: 731
File: packages/hdwallet-gridplus/src/thormaya.ts:99-105
Timestamp: 2025-10-15T23:22:26.842Z
Learning: In packages/hdwallet-gridplus/src/thormaya.ts, the GridPlus SDK (gridplus-sdk) automatically pads the r and s signature components to 32 bytes, so explicit padding in the code may be redundant but is not required. The thorchainSignTx implementation works without explicit padding because the SDK handles it.
Learnt from: gomesalexandre
Repo: shapeshift/hdwallet PR: 731
File: packages/hdwallet-gridplus/src/ethereum.ts:117-124
Timestamp: 2025-10-14T20:59:48.768Z
Learning: In packages/hdwallet-gridplus/src/ethereum.ts, the GridPlus SDK's sign method returns v as a number (integer), not a Buffer, so the Buffer.isBuffer(v) check is always false and vRaw = v is used directly.
📚 Learning: 2025-10-15T23:22:26.842Z
Learnt from: gomesalexandre
Repo: shapeshift/hdwallet PR: 731
File: packages/hdwallet-gridplus/src/thormaya.ts:99-105
Timestamp: 2025-10-15T23:22:26.842Z
Learning: In packages/hdwallet-gridplus/src/thormaya.ts, the GridPlus SDK (gridplus-sdk) automatically pads the r and s signature components to 32 bytes, so explicit padding in the code may be redundant but is not required. The thorchainSignTx implementation works without explicit padding because the SDK handles it.

Applied to files:

  • packages/hdwallet-gridplus/src/adapter.ts
  • packages/hdwallet-gridplus/src/gridplus.ts
📚 Learning: 2025-10-14T20:59:48.768Z
Learnt from: gomesalexandre
Repo: shapeshift/hdwallet PR: 731
File: packages/hdwallet-gridplus/src/ethereum.ts:117-124
Timestamp: 2025-10-14T20:59:48.768Z
Learning: In packages/hdwallet-gridplus/src/ethereum.ts, the GridPlus SDK's sign method returns v as a number (integer), not a Buffer, so the Buffer.isBuffer(v) check is always false and vRaw = v is used directly.

Applied to files:

  • packages/hdwallet-gridplus/src/adapter.ts
  • packages/hdwallet-gridplus/src/gridplus.ts
📚 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-gridplus/src/gridplus.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-gridplus/src/gridplus.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-gridplus/src/gridplus.ts
🧬 Code graph analysis (1)
packages/hdwallet-gridplus/src/adapter.ts (1)
packages/hdwallet-gridplus/src/gridplus.ts (1)
  • GridPlusHDWallet (275-586)
🔇 Additional comments (15)
packages/hdwallet-gridplus/src/adapter.ts (4)

34-40: Good practice: Resetting active wallets on reconnect.

The explicit call to resetActiveWallets() when reusing an existing client is well-commented and ensures fresh wallet state from the device, which is critical for SafeCard switching scenarios.


42-50: LGTM: Clean validation flow.

The optional validation pattern allows backward compatibility while enforcing SafeCard validation when required. The early return on pairing failure and conditional validation logic are well-structured.


30-32: I'll help you verify the impact of removing the password from the hash input. Let me investigate the codebase to understand the context and confirm whether this is truly a breaking change.
<function_calls>

#!/bin/bash

First, let's examine the file structure and find the adapter.ts file

fd "adapter.ts" -t f

Get file size to determine how to read it

wc -l packages/hdwallet-gridplus/src/adapter.ts 2>/dev/null || echo "File not found in initial search"


</function_calls>
<function_calls>

#!/bin/bash

Read the adapter.ts file around the lines in question (25-50)

cat -n packages/hdwallet-gridplus/src/adapter.ts | sed -n '20,55p'


</function_calls>
<function_calls>

#!/bin/bash

Search for git history showing what the previous version looked like

cd /tmp && git clone --depth=1 https://github.com/shapeshift/hdwallet.git 2>/dev/null || echo "Clone check"
cd packages/hdwallet-gridplus 2>/dev/null || echo "Not in cloned repo"

Get the full history of the specific file to see if password was previously included

git log --oneline packages/hdwallet-gridplus/src/adapter.ts 2>/dev/null | head -20


</function_calls>
<function_calls>

#!/bin/bash

Search for password-related patterns in the adapter file

rg -nC5 "password" packages/hdwallet-gridplus/src/adapter.ts


</function_calls>
<function_calls>

#!/bin/bash

Search for migration logic or breaking change documentation

rg -nC3 "migration|re-pair|re-pairing|breaking change|deviceId.*password" --type=ts packages/hdwallet-gridplus/


</function_calls>
<function_calls>

#!/bin/bash

Look at the connectDevice method signature and surrounding context more carefully

cat -n packages/hdwallet-gridplus/src/adapter.ts | sed -n '1,100p'


</function_calls>


65-70: The code's null check is correct. GridPlus SDK's Client.getActiveWallet() returns null or undefined when no wallet is active, not an object with undefined properties.

According to GridPlus SDK documentation, getActiveWallet() returns an object containing:

  • uid — 32-byte Buffer
  • name — string
  • capabilities — 4-byte flag
  • external — boolean

The null check at line 66 (if (!activeWallet)) properly handles the case when no wallet is active, and the subsequent property access is safe.

packages/hdwallet-gridplus/src/gridplus.ts (11)

15-15: LGTM: Clear SafeCard detection logic.

The isSafecardConnected helper correctly identifies active SafeCards by checking for non-zero UIDs. The use of zeroHash from viem provides a well-known constant for comparison.


305-306: LGTM: Appropriate state management.

The private optional fields for tracking expected wallet ID and type are well-scoped and align with the validation workflow introduced in this PR.


313-316: LGTM: Simple setter for expected wallet state.

The public setter allows the adapter to configure expected wallet credentials after pairing or connecting, enabling subsequent validation during signing operations.


375-382: LGTM: Simplified with helper function.

The refactored getActiveWalletId correctly uses the isSafecardConnected helper to determine which wallet (external prioritized over internal) is active.


388-419: LGTM: Robust validation with clear error messages.

The validateActiveWallet method implements thorough SafeCard validation with appropriate error handling:

  • Prioritizes external over internal wallets (line 401-402)
  • Provides context-specific error messages for internal wallet access vs. SafeCard mismatch (lines 412-415)
  • Returns validated wallet details for downstream use

495-500: Validation pattern already covered in previous comment for btcSignTx.


503-516: Validation pattern already covered in previous refactor suggestion.


523-533: LGTM: Appropriate firmware version check.

The assertSolanaFwSupport method uses a TypeScript assertion function to ensure firmware compatibility before Solana operations. The version check (>= 0.14.0) and clear error message are well-implemented.


540-545: Validation pattern already covered in previous refactor suggestion.


553-585: Validation patterns for cosmosSignTx, thorchainSignTx, and mayachainSignTx already covered in previous refactor suggestion.


4-4: Add viem to package dependencies in packages/hdwallet-gridplus/package.json.

The code imports zeroHash from viem at line 4, but viem is not declared as a dependency. This will cause a runtime error. viem v2.40.3 has no known security vulnerabilities, but it must be added to the package.json dependencies before this code can function. Verify the appropriate version constraint (e.g., ^2.40.3) and add it to both dependencies and any peer dependency declarations as needed.

⛔ Skipped due to 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-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.
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.
Learnt from: gomesalexandre
Repo: shapeshift/hdwallet PR: 731
File: packages/hdwallet-gridplus/src/ethereum.ts:117-124
Timestamp: 2025-10-14T20:59:48.768Z
Learning: In packages/hdwallet-gridplus/src/ethereum.ts, the GridPlus SDK's sign method returns v as a number (integer), not a Buffer, so the Buffer.isBuffer(v) check is always false and vRaw = v is used directly.

Comment thread packages/hdwallet-gridplus/src/adapter.ts Outdated
Comment thread packages/hdwallet-gridplus/src/adapter.ts

@coderabbitai coderabbitai 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.

Actionable comments posted: 2

📜 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 d5ed205 and 951a647.

📒 Files selected for processing (27)
  • examples/sandbox/package.json (2 hunks)
  • integration/package.json (2 hunks)
  • lerna.json (1 hunks)
  • packages/hdwallet-coinbase/package.json (2 hunks)
  • packages/hdwallet-core/package.json (2 hunks)
  • packages/hdwallet-gridplus/package.json (3 hunks)
  • packages/hdwallet-keepkey-chromeusb/package.json (2 hunks)
  • packages/hdwallet-keepkey-electron/package.json (3 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 (3 hunks)
  • packages/hdwallet-keplr/package.json (3 hunks)
  • packages/hdwallet-ledger-webhid/package.json (2 hunks)
  • packages/hdwallet-ledger-webusb/package.json (2 hunks)
  • packages/hdwallet-ledger/package.json (3 hunks)
  • packages/hdwallet-metamask-multichain/package.json (3 hunks)
  • packages/hdwallet-native-vault/package.json (3 hunks)
  • packages/hdwallet-native/package.json (3 hunks)
  • packages/hdwallet-phantom/package.json (3 hunks)
  • packages/hdwallet-portis/package.json (3 hunks)
  • packages/hdwallet-trezor-connect/package.json (2 hunks)
  • packages/hdwallet-trezor/package.json (3 hunks)
  • packages/hdwallet-vultisig/package.json (3 hunks)
  • packages/hdwallet-walletconnect/package.json (2 hunks)
  • packages/hdwallet-walletconnectV2/package.json (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (16)
  • lerna.json
  • packages/hdwallet-native-vault/package.json
  • packages/hdwallet-vultisig/package.json
  • packages/hdwallet-trezor/package.json
  • packages/hdwallet-portis/package.json
  • packages/hdwallet-coinbase/package.json
  • packages/hdwallet-keplr/package.json
  • packages/hdwallet-phantom/package.json
  • packages/hdwallet-gridplus/package.json
  • packages/hdwallet-keepkey-webusb/package.json
  • packages/hdwallet-keepkey/package.json
  • packages/hdwallet-keepkey-nodehid/package.json
  • packages/hdwallet-walletconnect/package.json
  • examples/sandbox/package.json
  • packages/hdwallet-native/package.json
  • packages/hdwallet-keepkey-tcp/package.json
🧰 Additional context used
🧠 Learnings (6)
📓 Common learnings
Learnt from: gomesalexandre
Repo: shapeshift/hdwallet PR: 731
File: packages/hdwallet-gridplus/src/thormaya.ts:99-105
Timestamp: 2025-10-15T23:22:26.842Z
Learning: In packages/hdwallet-gridplus/src/thormaya.ts, the GridPlus SDK (gridplus-sdk) automatically pads the r and s signature components to 32 bytes, so explicit padding in the code may be redundant but is not required. The thorchainSignTx implementation works without explicit padding because the SDK handles it.
Learnt from: gomesalexandre
Repo: shapeshift/hdwallet PR: 731
File: packages/hdwallet-gridplus/src/ethereum.ts:117-124
Timestamp: 2025-10-14T20:59:48.768Z
Learning: In packages/hdwallet-gridplus/src/ethereum.ts, the GridPlus SDK's sign method returns v as a number (integer), not a Buffer, so the Buffer.isBuffer(v) check is always false and vRaw = v is used directly.
📚 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-keepkey-chromeusb/package.json
  • packages/hdwallet-ledger-webhid/package.json
  • packages/hdwallet-ledger/package.json
  • packages/hdwallet-ledger-webusb/package.json
  • integration/package.json
  • packages/hdwallet-metamask-multichain/package.json
  • packages/hdwallet-walletconnectV2/package.json
  • packages/hdwallet-trezor-connect/package.json
  • packages/hdwallet-keepkey-electron/package.json
  • packages/hdwallet-keepkey-nodewebusb/package.json
  • packages/hdwallet-core/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-keepkey-chromeusb/package.json
  • packages/hdwallet-ledger-webhid/package.json
  • packages/hdwallet-ledger/package.json
  • packages/hdwallet-ledger-webusb/package.json
  • integration/package.json
  • packages/hdwallet-metamask-multichain/package.json
  • packages/hdwallet-walletconnectV2/package.json
  • packages/hdwallet-trezor-connect/package.json
  • packages/hdwallet-keepkey-electron/package.json
  • packages/hdwallet-keepkey-nodewebusb/package.json
  • packages/hdwallet-core/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-keepkey-chromeusb/package.json
  • packages/hdwallet-ledger-webhid/package.json
  • packages/hdwallet-ledger/package.json
  • packages/hdwallet-ledger-webusb/package.json
  • integration/package.json
  • packages/hdwallet-metamask-multichain/package.json
  • packages/hdwallet-walletconnectV2/package.json
  • packages/hdwallet-trezor-connect/package.json
  • packages/hdwallet-keepkey-electron/package.json
  • packages/hdwallet-keepkey-nodewebusb/package.json
  • packages/hdwallet-core/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-keepkey-chromeusb/package.json
  • packages/hdwallet-ledger-webhid/package.json
  • packages/hdwallet-ledger/package.json
  • packages/hdwallet-ledger-webusb/package.json
  • integration/package.json
  • packages/hdwallet-metamask-multichain/package.json
  • packages/hdwallet-walletconnectV2/package.json
  • packages/hdwallet-trezor-connect/package.json
  • packages/hdwallet-keepkey-electron/package.json
  • packages/hdwallet-keepkey-nodewebusb/package.json
  • packages/hdwallet-core/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-keepkey-chromeusb/package.json
  • packages/hdwallet-ledger-webhid/package.json
  • packages/hdwallet-ledger/package.json
  • packages/hdwallet-ledger-webusb/package.json
  • integration/package.json
  • packages/hdwallet-metamask-multichain/package.json
  • packages/hdwallet-walletconnectV2/package.json
  • packages/hdwallet-trezor-connect/package.json
  • packages/hdwallet-keepkey-electron/package.json
  • packages/hdwallet-keepkey-nodewebusb/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 (13)
integration/package.json (1)

3-3: Version and dependency synchronization consistent across integration package.

All hdwallet-related dependencies have been updated to the new prerelease version ^1.62.16-bro-seriously-fml.0 in alignment with the coordinated version bump across the monorepo.

Also applies to: 14-23

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

3-3: Version and gitHead metadata properly synchronized.

Package version bumped to prerelease identifier and gitHead field added consistently with the monorepo's release pattern. Core dependency properly updated to match.

Also applies to: 28-28, 47-47

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

3-3: Core package version and metadata updated consistently.

Version and gitHead fields properly synchronized as part of the coordinated prerelease.

Also applies to: 31-31

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

3-3: WalletConnectV2 adapter synchronized with core version bump.

Version, core dependency, and gitHead metadata all properly updated.

Also applies to: 18-18, 23-23

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

3-3: KeepKey ChromeUSB transport dependencies properly synchronized.

Both core and keepkey adapter dependencies updated to prerelease version with consistent gitHead metadata.

Also applies to: 17-18, 20-20

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

3-3: Metamask multichain adapter version and dependencies synchronized.

Version, core dependency, and gitHead consistent with monorepo prerelease pattern.

Also applies to: 20-20, 31-31

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

3-3: KeepKey NodeWebUSB transport dependencies properly versioned.

Both core and keepkey adapter dependencies updated to prerelease version with consistent gitHead metadata.

Also applies to: 17-18, 26-26

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

3-3: Trezor Connect adapter version and dependencies synchronized.

Both core and trezor adapter dependencies updated to prerelease version with consistent gitHead metadata.

Also applies to: 17-18, 21-21


1-22: Verify that build artifacts have been regenerated.

Per your team's workflow, ensure that yarn build has been executed across all modified packages to regenerate dist/ artifacts and TypeScript build info before finalizing this PR.

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

23-24: Verify caret ranges are appropriate for pre-release dependency versions.

Caret version ranges (^1.62.16-bro-seriously-fml.0) may not behave predictably with pre-release versions during dependency resolution. Confirm that the dependency resolution aligns with your intended version constraints.

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

25-25: Added gitHead metadata.

The new gitHead field follows the monorepo's standard publishing pattern and appears appropriate.


3-3: Based on my verification, the original review comment is completely justified and reveals a critical issue. Here's what I found:

Key findings:

  1. Monorepo-wide problem: The version string "1.62.16-bro-seriously-fml.0" appears in all 19 package.json files plus lerna.json (the monorepo root configuration)

  2. Systematic, not accidental: This is not a typo in one file—it's consistent across:

    • All core packages (hdwallet-core, hdwallet-ledger, hdwallet-ledger-webhid, etc.)
    • All wallet adapters (Trezor, KeepKey, Keplr, etc.)
    • Integration tests and examples
    • Dependency versions are synchronized to match
  3. Auto-generated by build process: The git commit message states "chore: update internal dependencies after prepublish build"—indicating this version was set by an automated monorepo versioning tool (Lerna) during a build step

  4. Will be published publicly: The package.json includes "publishConfig": { "access": "public" }, confirming this is destined for the npm public registry where this version string will be permanently visible

This is a critical issue that must be resolved before merging or publishing.


The version string "1.62.16-bro-seriously-fml.0" is set across the entire monorepo and will be published to npm if this PR is merged. This must be corrected to a valid semantic version (e.g., "1.62.16") before release.

All 19 packages in packages/, examples/, and integration/ directories, plus the lerna.json root config, contain this version. Verify the automated versioning process and ensure it generates production-appropriate version strings.

⛔ Skipped due to 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.
packages/hdwallet-keepkey-electron/package.json (1)

3-3: Version naming is intentional and consistent across the entire monorepo—not a debug artifact.

The verification confirms that "1.62.16-bro-seriously-fml.0" is applied uniformly to all 26 package.json files in the monorepo (not just keepkey-electron). The gitHead field (50218b2) is also consistently added across 24+ packages. This is a coordinated monorepo-wide version bump and metadata standardization, not isolated to a single package. The commit message "chore: update internal dependencies after prepublish build" indicates this follows the team's prepublish workflow. While the version string's informal tone is unconventional, it is semver-compliant and intentional across the entire release.

Comment thread packages/hdwallet-ledger-webusb/package.json Outdated
Comment thread packages/hdwallet-ledger-webusb/package.json Outdated
@gomesalexandre

Copy link
Copy Markdown
Contributor Author

Going to yeet this, rationale:

@NeOMakinG NeOMakinG 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.

Can't test as I'm inside a car right now but code looks sane

@gomesalexandre
gomesalexandre merged commit 7e373a3 into master Nov 28, 2025
3 checks passed
@gomesalexandre
gomesalexandre deleted the feat_gridplus_validation_v2 branch November 28, 2025 12:50
@coderabbitai coderabbitai Bot mentioned this pull request Dec 10, 2025
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.

2 participants