Skip to content

Conversation

@gomesalexandre
Copy link
Contributor

@gomesalexandre gomesalexandre commented Dec 27, 2025

Implements Near chain support in hdwallet for native and Ledger.
Test me with web fren

Summary by CodeRabbit

  • New Features

    • Full NEAR support: account path discovery, address derivation, and transaction signing across native and Ledger integrations (webUSB/webHID).
    • New NEAR crypto adapter using Ed25519 for public key derivation, address formatting, hashing and signing.
    • Transport layers updated to resolve and route NEAR methods to Ledger NEAR app.
    • SLIP-44 entry added for NEAR (397).
  • Chores

    • Package version bumps and dependency updates to roll out NEAR support.

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

gomesalexandre and others added 4 commits December 26, 2025 17:41
- Add NEAR core interfaces (NearGetAddress, NearSignTx, NearSignedTx)
- Add NEAR SLIP-0044 coin type 397
- Add NearAdapter for Ed25519 key derivation and signing
- Add native wallet mixins (MixinNativeNearWalletInfo, MixinNativeNearWallet)
- Integrate NEAR into NativeHDWallet class

NEAR uses Ed25519 curve with derivation path m/44'/397'/account'/0'/0'
Implicit accounts are 64-char hex of the Ed25519 public key

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@gomesalexandre gomesalexandre requested a review from a team as a code owner December 27, 2025 00:05
@vercel
Copy link

vercel bot commented Dec 27, 2025

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

Project Deployment Review Updated (UTC)
hdwallet Ready Ready Preview, Comment Dec 30, 2025 6:45pm

@coderabbitai
Copy link

coderabbitai bot commented Dec 27, 2025

📝 Walkthrough

Walkthrough

Adds NEAR support across the monorepo: core types and SLIP‑44 entry, native Ed25519 isolation adapter and mixins, Ledger app/transport integration, and coordinated package/version bumps to expose NEAR address and signing flows.

Changes

Cohort / File(s) Summary
Core types & utils
packages/hdwallet-core/src/index.ts, packages/hdwallet-core/src/near.ts, packages/hdwallet-core/src/utils.ts
Export NEAR public API; add Near* interfaces and helpers (nearDescribePath, nearGetAccountPaths); add SLIP‑44 mapping Near: 397.
Native implementation & adapters
packages/hdwallet-native/src/near.ts, packages/hdwallet-native/src/native.ts, packages/hdwallet-native/src/crypto/isolation/adapters/near.ts, packages/hdwallet-native/src/crypto/isolation/adapters/index.ts
Add Near mixins (info + wallet), lifecycle hooks (nearInitializeWallet, nearWipe), mnemonic guards, and NearAdapter (Ed25519 derivation, getAddress, getPublicKey, signTransaction).
Ledger integration & utilities
packages/hdwallet-ledger/src/near.ts, packages/hdwallet-ledger/src/ledger.ts, packages/hdwallet-ledger/src/transport.ts, packages/hdwallet-ledger/src/utils.ts, packages/hdwallet-ledger/package.json
Add Ledger NEAR helpers (nearGetAddress, nearSignTx), account path helpers and nextAccountPath, include Near in transport types, map SLIP‑44 397→"NEAR", and add @ledgerhq/hw-app-near dependency.
Ledger transports (webhid/webusb)
packages/hdwallet-ledger-webhid/src/transport.ts, packages/hdwallet-ledger-webusb/src/transport.ts
Extend translateCoinAndMethod to instantiate and bind Near methods when coin is "Near".
Package/version bumps
examples/sandbox/package.json, integration/package.json, lerna.json, ...many packages/*/package.json
Bump versions to 1.62.36 and update internal @shapeshiftoss/* dependency references to align with core/ledger/native NEAR additions.

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant NativeWallet as Native Wallet
    participant NearAdapter
    participant Ed25519Node as Ed25519 Node
    participant Crypto as SHA-256 / Ed25519

    rect rgba(200,230,255,0.20)
    Note over Client,NativeWallet: Native NEAR signing flow
    Client->>NativeWallet: nearSignTx(msg)
    NativeWallet->>NearAdapter: signTransaction(txBytes, addressNList)
    NearAdapter->>Ed25519Node: derive node for BIP32 path
    NearAdapter->>Crypto: sha256(txBytes)
    NearAdapter->>Crypto: ed25519.sign(hash, node)
    Crypto-->>NearAdapter: signature
    NearAdapter-->>NativeWallet: { signature, publicKey }
    NativeWallet-->>Client: NearSignedTx
    end
Loading
sequenceDiagram
    participant Client
    participant LedgerWallet as Ledger Wallet
    participant Transport
    participant LedgerApp as Ledger Device (NEAR App)

    rect rgba(220,255,220,0.20)
    Note over Client,LedgerApp: Ledger NEAR signing flow
    Client->>LedgerWallet: nearSignTx(msg)
    LedgerWallet->>Transport: nearSignTx(transport, msg)
    Transport->>LedgerApp: getAddress(BIP32Path) / signTransaction(BIP32Path, txBytes)
    LedgerApp-->>Transport: publicKey / signature
    Transport-->>LedgerWallet: { signature, publicKey }
    LedgerWallet-->>Client: NearSignedTx
    end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Poem

🐇 I hop through hardened lanes so neat,

Ed25519 beats its steady beat,
Ledger and native share the cheer,
SLIP‑44 planted NEAR right here,
A rabbit signs — the chain's complete.

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 16.67% 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 'feat: near chain' clearly and concisely describes the main change: adding NEAR chain support to the hdwallet library. It aligns with conventional commit format and accurately reflects the primary objective of the PR.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch near_chain

📜 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 a1bb377 and fe01b0b.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (28)
  • 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-ledger/src/near.ts
  • 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 (1)
  • lerna.json
🚧 Files skipped from review as they are similar to previous changes (16)
  • packages/hdwallet-keepkey-electron/package.json
  • packages/hdwallet-ledger/package.json
  • packages/hdwallet-keplr/package.json
  • packages/hdwallet-native/package.json
  • examples/sandbox/package.json
  • packages/hdwallet-keepkey-webusb/package.json
  • packages/hdwallet-core/package.json
  • packages/hdwallet-keepkey-nodewebusb/package.json
  • packages/hdwallet-ledger/src/near.ts
  • packages/hdwallet-gridplus/package.json
  • packages/hdwallet-walletconnect/package.json
  • packages/hdwallet-vultisig/package.json
  • packages/hdwallet-phantom/package.json
  • packages/hdwallet-keepkey-tcp/package.json
  • integration/package.json
  • packages/hdwallet-ledger-webhid/package.json
🧰 Additional context used
🧠 Learnings (7)
📚 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-coinbase/package.json
  • packages/hdwallet-keepkey-nodehid/package.json
  • packages/hdwallet-keepkey/package.json
  • packages/hdwallet-trezor/package.json
  • packages/hdwallet-trezor-connect/package.json
  • packages/hdwallet-keepkey-chromeusb/package.json
  • packages/hdwallet-ledger-webusb/package.json
  • packages/hdwallet-walletconnectV2/package.json
  • packages/hdwallet-metamask-multichain/package.json
  • packages/hdwallet-native-vault/package.json
  • packages/hdwallet-portis/package.json
📚 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-coinbase/package.json
  • packages/hdwallet-keepkey-nodehid/package.json
  • packages/hdwallet-keepkey/package.json
  • packages/hdwallet-trezor/package.json
  • packages/hdwallet-trezor-connect/package.json
  • packages/hdwallet-keepkey-chromeusb/package.json
  • packages/hdwallet-ledger-webusb/package.json
  • packages/hdwallet-walletconnectV2/package.json
  • packages/hdwallet-metamask-multichain/package.json
  • packages/hdwallet-native-vault/package.json
  • packages/hdwallet-portis/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-coinbase/package.json
  • packages/hdwallet-keepkey-nodehid/package.json
  • packages/hdwallet-keepkey/package.json
  • packages/hdwallet-trezor/package.json
  • packages/hdwallet-trezor-connect/package.json
  • packages/hdwallet-keepkey-chromeusb/package.json
  • packages/hdwallet-ledger-webusb/package.json
  • packages/hdwallet-walletconnectV2/package.json
  • packages/hdwallet-metamask-multichain/package.json
  • packages/hdwallet-native-vault/package.json
  • packages/hdwallet-portis/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-coinbase/package.json
  • packages/hdwallet-keepkey-nodehid/package.json
  • packages/hdwallet-keepkey/package.json
  • packages/hdwallet-trezor/package.json
  • packages/hdwallet-trezor-connect/package.json
  • packages/hdwallet-keepkey-chromeusb/package.json
  • packages/hdwallet-ledger-webusb/package.json
  • packages/hdwallet-walletconnectV2/package.json
  • packages/hdwallet-metamask-multichain/package.json
  • packages/hdwallet-native-vault/package.json
  • packages/hdwallet-portis/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-coinbase/package.json
  • packages/hdwallet-keepkey-nodehid/package.json
  • packages/hdwallet-keepkey/package.json
  • packages/hdwallet-trezor/package.json
  • packages/hdwallet-trezor-connect/package.json
  • packages/hdwallet-keepkey-chromeusb/package.json
  • packages/hdwallet-ledger-webusb/package.json
  • packages/hdwallet-walletconnectV2/package.json
  • packages/hdwallet-metamask-multichain/package.json
  • packages/hdwallet-native-vault/package.json
  • packages/hdwallet-portis/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-coinbase/package.json
  • packages/hdwallet-keepkey-nodehid/package.json
  • packages/hdwallet-keepkey/package.json
  • packages/hdwallet-trezor/package.json
  • packages/hdwallet-trezor-connect/package.json
  • packages/hdwallet-keepkey-chromeusb/package.json
  • packages/hdwallet-ledger-webusb/package.json
  • packages/hdwallet-walletconnectV2/package.json
  • packages/hdwallet-metamask-multichain/package.json
  • packages/hdwallet-native-vault/package.json
  • packages/hdwallet-portis/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 (12)
packages/hdwallet-walletconnectV2/package.json (1)

3-3: LGTM! Version bump is consistent.

The package version and @shapeshiftoss/hdwallet-core dependency are both correctly bumped to 1.62.36. This coordinated version bump aligns with the NEAR chain support added to hdwallet-core.

Based on learnings, dependency versions referencing unpublished packages during PR review are expected in your release workflow.

Also applies to: 18-18

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

3-3: LGTM! Version bump is coordinated properly.

The patch version increment from 1.62.35 to 1.62.36 is appropriate for adding NEAR chain support and aligns with the coordinated version bump across the monorepo.


18-18: LGTM! Dependency version is correctly synchronized.

The @shapeshiftoss/hdwallet-native dependency version correctly matches the package version bump. The exact version pinning (without caret) is appropriate for internal monorepo dependencies.

Based on learnings, referencing unpublished versions during PR review is expected behavior in this project's workflow.

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

3-3: LGTM! Version alignment with hdwallet-core 1.62.36.

The package version and core dependency are correctly synchronized to support the NEAR chain integration.

Also applies to: 24-24

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

3-3: LGTM! Version alignment with hdwallet-core 1.62.36.

The package version and core dependency are correctly synchronized.

Also applies to: 18-18

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

3-3: LGTM! Version alignment with hdwallet-core and hdwallet-keepkey 1.62.36.

The package version and dependencies are correctly synchronized.

Also applies to: 17-18

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

3-3: LGTM! Version alignment with hdwallet-keepkey 1.62.36.

The package version and keepkey dependency are correctly synchronized.

Also applies to: 17-17

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

3-3: LGTM! Version alignment with hdwallet-core 1.62.36.

The package version and core dependency are correctly synchronized.

Also applies to: 19-19

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

3-3: LGTM! Version alignment with hdwallet-core and hdwallet-ledger 1.62.36.

The package version and dependencies are correctly synchronized to support NEAR integration in Ledger transport.

Also applies to: 23-24

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

3-3: LGTM! Version alignment with hdwallet-core 1.62.36.

The package version and core dependency are correctly synchronized.

Also applies to: 20-20

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

3-3: LGTM! Version alignment with hdwallet-core 1.62.36.

The package version and core dependency are correctly synchronized.

Also applies to: 20-20

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

3-3: Version bumps look correct.

The coordinated version bump to 1.62.36 across this package and its dependencies follows the expected monorepo pattern. The PR description mentions NEAR support for "native and Ledger" but not Trezor—please confirm that excluding Trezor NEAR support in this release is intentional.

Based on learnings, version bumps before publishing and referencing unpublished dependency versions during PR review is expected behavior in this repository's release workflow.

Also applies to: 17-18

Warning

Review ran into problems

🔥 Problems

Errors were encountered while retrieving linked issues.

Errors (1)
  • SLIP-44: Entity not found: Issue - Could not find referenced Issue.

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: 1

🧹 Nitpick comments (2)
packages/hdwallet-core/src/near.ts (1)

51-74: Prefer strict equality operators.

The path validation logic is correct and properly enforces SLIP-0010 hardened derivation for Ed25519. However, use strict equality (!==) instead of loose equality (!=) for type safety and consistency with modern JavaScript best practices.

🔎 Proposed fix using strict equality
-  if (path.length != 5) return unknown;
-  if (path[0] != 0x80000000 + 44) return unknown;
-  if (path[1] != 0x80000000 + slip44ByCoin("Near")) return unknown;
+  if (path.length !== 5) return unknown;
+  if (path[0] !== 0x80000000 + 44) return unknown;
+  if (path[1] !== 0x80000000 + slip44ByCoin("Near")) return unknown;
packages/hdwallet-native/src/crypto/isolation/adapters/near.ts (1)

50-68: Consider using static import for crypto module.

The dynamic import("crypto") on line 56 incurs overhead on every transaction signing. Since crypto is a Node.js built-in module always available in this context, a static import at the top of the file would be more efficient.

Additionally, accessing nodeAdapter.node.sign() directly on line 60 reaches into the internal structure. Verify this is the intended API pattern, as other adapters may use a different method signature.

🔎 Proposed refactor for static crypto import
 import * as core from "@shapeshiftoss/hdwallet-core";
+import { createHash } from "crypto";
 
 import { Isolation } from "../..";

Then update the usage:

-    const crypto = await import("crypto");
-    const messageHash = crypto.createHash("sha256").update(txBytes).digest();
+    const messageHash = createHash("sha256").update(txBytes).digest();
📜 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 4f5859c and 987189a.

📒 Files selected for processing (34)
  • examples/sandbox/package.json
  • integration/package.json
  • lerna.json
  • packages/hdwallet-coinbase/package.json
  • packages/hdwallet-core/package.json
  • packages/hdwallet-core/src/index.ts
  • packages/hdwallet-core/src/near.ts
  • packages/hdwallet-core/src/utils.ts
  • 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-native/src/crypto/isolation/adapters/index.ts
  • packages/hdwallet-native/src/crypto/isolation/adapters/near.ts
  • packages/hdwallet-native/src/native.ts
  • packages/hdwallet-native/src/near.ts
  • 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
🧰 Additional context used
🧠 Learnings (13)
📓 Common learnings
Learnt from: gomesalexandre
Repo: shapeshift/hdwallet PR: 774
File: packages/hdwallet-native/src/starknet.ts:16-18
Timestamp: 2025-12-24T17:35:53.100Z
Learning: In packages/hdwallet-native/src/ chain implementation files (e.g., tron.ts, sui.ts, solana.ts, starknet.ts), the `NextAccountPath()` methods in WalletInfo mixins conventionally throw `new Error("Method not implemented")`. This is an intentional pattern across chain families and these methods are unused.
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.
📚 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-native/src/crypto/isolation/adapters/index.ts
  • packages/hdwallet-core/src/index.ts
  • packages/hdwallet-core/src/utils.ts
  • packages/hdwallet-native/src/near.ts
  • packages/hdwallet-core/src/near.ts
  • packages/hdwallet-native/src/native.ts
  • packages/hdwallet-native/src/crypto/isolation/adapters/near.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-core/src/index.ts
  • packages/hdwallet-ledger-webhid/package.json
  • packages/hdwallet-keepkey-tcp/package.json
  • packages/hdwallet-keepkey-chromeusb/package.json
  • packages/hdwallet-native/package.json
  • packages/hdwallet-metamask-multichain/package.json
  • packages/hdwallet-keepkey-electron/package.json
  • packages/hdwallet-native-vault/package.json
  • packages/hdwallet-walletconnect/package.json
  • packages/hdwallet-vultisig/package.json
  • packages/hdwallet-ledger-webusb/package.json
  • packages/hdwallet-walletconnectV2/package.json
  • packages/hdwallet-trezor-connect/package.json
  • packages/hdwallet-keepkey-nodewebusb/package.json
  • packages/hdwallet-keepkey-nodehid/package.json
  • packages/hdwallet-keepkey-webusb/package.json
  • packages/hdwallet-ledger/package.json
  • integration/package.json
  • packages/hdwallet-phantom/package.json
  • packages/hdwallet-keplr/package.json
  • packages/hdwallet-keepkey/package.json
  • packages/hdwallet-gridplus/package.json
  • examples/sandbox/package.json
  • packages/hdwallet-coinbase/package.json
  • packages/hdwallet-trezor/package.json
  • packages/hdwallet-portis/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-core/src/index.ts
  • packages/hdwallet-ledger-webhid/package.json
  • packages/hdwallet-keepkey-tcp/package.json
  • packages/hdwallet-keepkey-chromeusb/package.json
  • packages/hdwallet-native/package.json
  • packages/hdwallet-metamask-multichain/package.json
  • packages/hdwallet-native-vault/package.json
  • packages/hdwallet-ledger-webusb/package.json
  • packages/hdwallet-trezor-connect/package.json
  • packages/hdwallet-keepkey-nodewebusb/package.json
  • packages/hdwallet-keepkey-nodehid/package.json
  • packages/hdwallet-keepkey-webusb/package.json
  • packages/hdwallet-ledger/package.json
  • integration/package.json
  • packages/hdwallet-keplr/package.json
  • packages/hdwallet-keepkey/package.json
  • packages/hdwallet-gridplus/package.json
  • examples/sandbox/package.json
  • packages/hdwallet-coinbase/package.json
  • packages/hdwallet-trezor/package.json
  • packages/hdwallet-portis/package.json
📚 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-webhid/package.json
  • packages/hdwallet-keepkey-tcp/package.json
  • packages/hdwallet-keepkey-chromeusb/package.json
  • packages/hdwallet-native/package.json
  • packages/hdwallet-metamask-multichain/package.json
  • packages/hdwallet-keepkey-electron/package.json
  • packages/hdwallet-native-vault/package.json
  • packages/hdwallet-core/package.json
  • packages/hdwallet-walletconnect/package.json
  • packages/hdwallet-vultisig/package.json
  • packages/hdwallet-ledger-webusb/package.json
  • packages/hdwallet-walletconnectV2/package.json
  • packages/hdwallet-trezor-connect/package.json
  • packages/hdwallet-keepkey-nodewebusb/package.json
  • packages/hdwallet-keepkey-nodehid/package.json
  • packages/hdwallet-keepkey-webusb/package.json
  • packages/hdwallet-ledger/package.json
  • integration/package.json
  • packages/hdwallet-phantom/package.json
  • packages/hdwallet-keplr/package.json
  • packages/hdwallet-keepkey/package.json
  • packages/hdwallet-gridplus/package.json
  • examples/sandbox/package.json
  • packages/hdwallet-coinbase/package.json
  • packages/hdwallet-trezor/package.json
  • packages/hdwallet-portis/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-ledger-webhid/package.json
  • packages/hdwallet-keepkey-tcp/package.json
  • packages/hdwallet-keepkey-chromeusb/package.json
  • packages/hdwallet-native/package.json
  • packages/hdwallet-metamask-multichain/package.json
  • packages/hdwallet-keepkey-electron/package.json
  • packages/hdwallet-native-vault/package.json
  • packages/hdwallet-core/package.json
  • packages/hdwallet-walletconnect/package.json
  • packages/hdwallet-vultisig/package.json
  • packages/hdwallet-ledger-webusb/package.json
  • packages/hdwallet-walletconnectV2/package.json
  • packages/hdwallet-trezor-connect/package.json
  • packages/hdwallet-keepkey-nodewebusb/package.json
  • packages/hdwallet-keepkey-nodehid/package.json
  • packages/hdwallet-keepkey-webusb/package.json
  • packages/hdwallet-ledger/package.json
  • integration/package.json
  • packages/hdwallet-phantom/package.json
  • packages/hdwallet-keplr/package.json
  • packages/hdwallet-keepkey/package.json
  • packages/hdwallet-gridplus/package.json
  • examples/sandbox/package.json
  • packages/hdwallet-coinbase/package.json
  • lerna.json
  • packages/hdwallet-trezor/package.json
  • packages/hdwallet-portis/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-ledger-webhid/package.json
  • packages/hdwallet-keepkey-tcp/package.json
  • packages/hdwallet-keepkey-chromeusb/package.json
  • packages/hdwallet-native/package.json
  • packages/hdwallet-metamask-multichain/package.json
  • packages/hdwallet-keepkey-electron/package.json
  • packages/hdwallet-native-vault/package.json
  • packages/hdwallet-core/package.json
  • packages/hdwallet-walletconnect/package.json
  • packages/hdwallet-vultisig/package.json
  • packages/hdwallet-ledger-webusb/package.json
  • packages/hdwallet-walletconnectV2/package.json
  • packages/hdwallet-trezor-connect/package.json
  • packages/hdwallet-keepkey-nodewebusb/package.json
  • packages/hdwallet-keepkey-nodehid/package.json
  • packages/hdwallet-keepkey-webusb/package.json
  • packages/hdwallet-ledger/package.json
  • integration/package.json
  • packages/hdwallet-phantom/package.json
  • packages/hdwallet-keplr/package.json
  • packages/hdwallet-keepkey/package.json
  • packages/hdwallet-gridplus/package.json
  • examples/sandbox/package.json
  • packages/hdwallet-coinbase/package.json
  • lerna.json
  • packages/hdwallet-trezor/package.json
  • packages/hdwallet-portis/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-ledger-webhid/package.json
  • packages/hdwallet-keepkey-tcp/package.json
  • packages/hdwallet-keepkey-chromeusb/package.json
  • packages/hdwallet-native/package.json
  • packages/hdwallet-metamask-multichain/package.json
  • packages/hdwallet-keepkey-electron/package.json
  • packages/hdwallet-native-vault/package.json
  • packages/hdwallet-core/package.json
  • packages/hdwallet-walletconnect/package.json
  • packages/hdwallet-vultisig/package.json
  • packages/hdwallet-ledger-webusb/package.json
  • packages/hdwallet-walletconnectV2/package.json
  • packages/hdwallet-trezor-connect/package.json
  • packages/hdwallet-keepkey-nodewebusb/package.json
  • packages/hdwallet-keepkey-nodehid/package.json
  • packages/hdwallet-keepkey-webusb/package.json
  • packages/hdwallet-ledger/package.json
  • integration/package.json
  • packages/hdwallet-phantom/package.json
  • packages/hdwallet-keplr/package.json
  • packages/hdwallet-keepkey/package.json
  • packages/hdwallet-gridplus/package.json
  • examples/sandbox/package.json
  • packages/hdwallet-coinbase/package.json
  • packages/hdwallet-trezor/package.json
  • packages/hdwallet-portis/package.json
📚 Learning: 2025-12-12T11:19:53.179Z
Learnt from: gomesalexandre
Repo: shapeshift/hdwallet PR: 769
File: packages/hdwallet-ledger/src/ledger.ts:403-405
Timestamp: 2025-12-12T11:19:53.179Z
Learning: In packages/hdwallet-ledger/src/ethereum.ts, the ethSupportsNetwork function is a legacy/unused function that only returns true for chainId === 1. The Ledger ETH module does not call ethSupportsNetwork to validate chain support during signing operations - it accepts any chainId passed in the ETHSignTx message directly, so chain support flags can be enabled without needing to update ethSupportsNetwork.

Applied to files:

  • packages/hdwallet-ledger-webhid/package.json
  • packages/hdwallet-gridplus/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-native/package.json
  • packages/hdwallet-metamask-multichain/package.json
  • packages/hdwallet-walletconnect/package.json
  • packages/hdwallet-walletconnectV2/package.json
  • packages/hdwallet-gridplus/package.json
  • examples/sandbox/package.json
  • packages/hdwallet-coinbase/package.json
  • packages/hdwallet-trezor/package.json
📚 Learning: 2025-12-24T17:35:44.759Z
Learnt from: gomesalexandre
Repo: shapeshift/hdwallet PR: 774
File: packages/hdwallet-native/src/starknet.ts:16-18
Timestamp: 2025-12-24T17:35:44.759Z
Learning: In the files under packages/hdwallet-native/src (e.g., tron.ts, sui.ts, solana.ts, starknet.ts), the NextAccountPath() methods in WalletInfo mixins intentionally throw new Error("Method not implemented"). These methods exist as placeholders and are not used by the chain implementations. Treat these methods as intentionally non-operational: do not call them, and consider removing or documenting them to avoid confusion. This guideline applies broadly to all chain implementation files in this directory.

Applied to files:

  • packages/hdwallet-native/src/near.ts
  • packages/hdwallet-native/src/native.ts
📚 Learning: 2025-12-24T17:35:53.100Z
Learnt from: gomesalexandre
Repo: shapeshift/hdwallet PR: 774
File: packages/hdwallet-native/src/starknet.ts:16-18
Timestamp: 2025-12-24T17:35:53.100Z
Learning: In packages/hdwallet-native/src/ chain implementation files (e.g., tron.ts, sui.ts, solana.ts, starknet.ts), the `NextAccountPath()` methods in WalletInfo mixins conventionally throw `new Error("Method not implemented")`. This is an intentional pattern across chain families and these methods are unused.

Applied to files:

  • packages/hdwallet-core/src/near.ts
  • packages/hdwallet-native/src/crypto/isolation/adapters/near.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
🧬 Code graph analysis (2)
packages/hdwallet-core/src/near.ts (2)
packages/hdwallet-core/src/wallet.ts (4)
  • BIP32Path (23-23)
  • HDWalletInfo (303-359)
  • HDWallet (361-476)
  • PathDescription (88-98)
packages/hdwallet-core/src/utils.ts (2)
  • addressNListToBIP32 (96-98)
  • slip44ByCoin (180-182)
packages/hdwallet-native/src/native.ts (2)
packages/hdwallet-native/src/near.ts (2)
  • MixinNativeNearWalletInfo (7-21)
  • MixinNativeNearWallet (23-57)
packages/hdwallet-core/src/near.ts (2)
  • NearWalletInfo (28-41)
  • NearWallet (43-49)
🔇 Additional comments (46)
lerna.json (2)

3-3: LGTM on version bump to near-chain prerelease.

The version bump to 1.62.35-near-chain.1 appropriately uses prerelease versioning for the NEAR chain feature branch.


11-16: Nice formatting improvement.

The multi-line array format improves readability while maintaining identical ignore patterns.

packages/hdwallet-native/src/crypto/isolation/adapters/index.ts (1)

12-12: LGTM on Near adapter export.

The Near adapter export follows the established pattern and maintains alphabetical ordering.

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

3-3: LGTM on core package version bump.

The version bump aligns with the monorepo-wide update for NEAR support.

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

3-3: LGTM on version bump and dependency update.

Both the package version and hdwallet-core dependency are correctly updated to the near-chain prerelease with appropriate caret range.

Also applies to: 20-20

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

3-3: LGTM on version bump and dependency updates.

The package version and both internal dependencies are consistently updated to the near-chain prerelease with appropriate caret ranges.

Also applies to: 17-18

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

3-3: LGTM on version bump and dependency update.

The package version and hdwallet-core dependency are correctly updated with appropriate caret range.

Also applies to: 18-18

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

3-3: LGTM on version bump and dependency updates.

Consistent updates to package version and internal dependencies with appropriate caret ranges.

Also applies to: 17-18

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

3-3: LGTM on version bump and dependency update.

The package version and hdwallet-core dependency are correctly updated to match the monorepo-wide near-chain prerelease.

Also applies to: 20-20

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

3-3: LGTM! Consistent version coordination for NEAR chain prerelease.

The version bump and dependency update align with the PR-wide near-chain prerelease versioning strategy. The caret range for the prerelease dependency is appropriate.

Also applies to: 18-18

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

3-3: LGTM! Version coordination matches PR-wide near-chain prerelease.

The version and dependency updates are consistent with the broader prerelease strategy.

Also applies to: 18-18

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

3-3: LGTM! Consistent near-chain prerelease versioning.

Version and dependency updates follow the established pattern across the monorepo.

Also applies to: 20-20

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

3-3: LGTM! Near-chain prerelease versioning applied correctly.

Version bump and hdwallet-core dependency update are consistent with the PR-wide strategy. The existing hw-transport pinning strategy (without caret) remains unchanged, which is correct per established practices.

Also applies to: 31-31

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

3-3: LGTM! Consistent multi-dependency version coordination.

Version bump and both hdwallet-core and hdwallet-ledger dependency updates are correctly aligned with the near-chain prerelease versioning.

Also applies to: 21-22

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

3-3: LGTM! Standard near-chain prerelease version coordination.

Version and dependency updates follow the established pattern.

Also applies to: 18-18

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

3-3: LGTM! Near-chain prerelease versioning correctly applied.

Version bump and dependency update are consistent with the monorepo-wide near-chain prerelease strategy.

Also applies to: 20-20

packages/hdwallet-core/src/index.ts (1)

22-22: LGTM! NEAR module export follows established pattern.

The new NEAR export is correctly placed and follows the existing pattern for chain integrations in the core package.

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

3-3: LGTM! Consistent version bump and dependency updates.

The version bump to 1.62.35-near-chain.1 and the dependency updates to use caret ranges are consistent with the broader NEAR chain integration across the monorepo.

Also applies to: 17-18

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

3-3: LGTM! Consistent version bump and dependency update.

The version bump and dependency update align with the NEAR chain integration pattern across the monorepo.

Also applies to: 19-19

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

3-3: LGTM! Consistent version bump for NEAR support.

The version bump and dependency update are consistent with the NEAR chain integration. This package is central to the native NEAR wallet implementation.

Also applies to: 21-21

packages/hdwallet-core/src/utils.ts (1)

163-163: LGTM! Correct SLIP-44 coin type for NEAR Protocol.

The SLIP-44 standard confirms that NEAR_PROTOCOL has coin type 397, making this entry correct for NEAR blockchain support.

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

3-3: LGTM! Consistent version bump and dependency updates.

The version bump and dependency updates are consistent with the NEAR chain integration across the monorepo.

Also applies to: 23-24

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

3-3: LGTM! Consistent version bump and dependency update.

The version bump and dependency update align with the broader NEAR chain integration.

Also applies to: 23-23

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

3-3: LGTM! Consistent version bump and dependency update.

The version bump and dependency update are consistent with the NEAR chain integration pattern.

Also applies to: 18-18

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

3-3: LGTM! Consistent version bump and dependency update.

The version bump and dependency update align with the NEAR chain integration across the monorepo.

Also applies to: 17-17

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

3-3: LGTM - Version bump aligns with NEAR integration.

The prerelease version bump and dependency update to ^1.62.35-near-chain.1 are consistent with the broader monorepo NEAR integration. Based on learnings, these unpublished version references are expected in the PR workflow, as packages are published after merge.

Also applies to: 24-24

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

3-3: LGTM - Version bump is consistent.

Version and dependency updates align with the NEAR integration prerelease across the monorepo.

Also applies to: 17-17

examples/sandbox/package.json (1)

3-3: LGTM - Comprehensive version alignment for sandbox.

All hdwallet dependencies updated consistently to the NEAR prerelease version range.

Also applies to: 15-33

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

3-3: LGTM - Version bump is consistent.

Version and dependency updates align with the broader NEAR integration.

Also applies to: 17-18

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

3-3: LGTM - Version bump is consistent.

Version and dependency updates align with the broader NEAR integration.

Also applies to: 17-18

packages/hdwallet-core/src/near.ts (2)

1-49: LGTM - Well-structured NEAR integration interfaces.

The interfaces and type definitions follow established patterns in the hdwallet-core module. The NearWalletInfo and NearWallet interfaces properly extend HDWalletInfo and HDWallet with NEAR-specific capabilities using the _supportsNear and _supportsNearInfo flags pattern.


76-86: LGTM - Correct NEAR derivation path implementation.

The function properly implements the standard NEAR derivation path m/44'/397'/<account>'/0'/0' with all indices hardened as required by SLIP-0010 for Ed25519. The documentation clearly explains the rationale.

integration/package.json (1)

3-3: LGTM - Integration package aligned with NEAR prerelease.

Version and dependency updates are consistent with the broader monorepo NEAR integration.

Also applies to: 15-24

packages/hdwallet-native/src/near.ts (2)

7-21: LGTM - NearWalletInfo mixin follows established patterns.

The mixin correctly implements the NearWalletInfo interface by delegating to core helpers. The nearNextAccountPath method intentionally throws "Method not implemented" as per the established pattern in chain implementation files (based on learnings from starknet.ts, solana.ts, etc.).


23-57: LGTM - NearWallet implementation is well-structured.

The mixin properly implements NEAR wallet operations:

  • nearInitializeWallet correctly initializes the Ed25519 adapter and wraps it in NearAdapter
  • nearWipe cleans up resources appropriately
  • nearGetAddress and nearSignTx properly use needsMnemonic guards to ensure the wallet has a mnemonic before proceeding
  • Async operations are handled correctly with proper error propagation

The implementation follows established patterns from other chain integrations in the native wallet.

packages/hdwallet-native/src/native.ts (8)

16-16: LGTM!

Import follows the established alphabetical ordering pattern for chain imports.


138-150: LGTM!

The mixin composition correctly integrates MixinNativeNearWalletInfo into the chain, maintaining consistency with the existing pattern for Ed25519-based chains.


169-169: LGTM!

Interface implementation correctly declares core.NearWalletInfo support.


208-209: LGTM!

The describePath case for NEAR follows the established pattern. Other chains like Solana and Sui also use single identifiers, so this is consistent.


249-260: LGTM!

The NativeHDWallet mixin composition mirrors the NativeHDWalletInfo pattern correctly, maintaining consistent ordering.


278-278: LGTM!

Interface declaration is correctly placed in the implements list.


424-424: LGTM!

nearInitializeWallet correctly uses ed25519MasterKey, consistent with NEAR's Ed25519 cryptography requirements and other Ed25519-based chains (Solana, Sui).


468-468: LGTM!

nearWipe() is correctly added to the cleanup sequence, properly grouped with other Ed25519-based chain wipes.

packages/hdwallet-native/src/crypto/isolation/adapters/near.ts (3)

1-12: LGTM!

Class structure follows established patterns with appropriate visibility modifiers.


23-37: LGTM!

The address derivation correctly implements NEAR's implicit account format (64-character lowercase hex of Ed25519 public key) per the NEAR documentation.


86-87: LGTM!

Providing both named and default exports is a common pattern for import flexibility.

gomesalexandre and others added 2 commits December 27, 2025 15:03
- Add hw-app-near dependency to hdwallet-ledger
- Implement nearGetAddress and nearSignTx for Ledger
- Implement nearGetAddress, nearGetAddresses, and nearSignTx for Trezor
- Add NearWalletInfo and NearWallet interface implementations
- Add nearAddressNListToBIP32 utility to hdwallet-core
- Add SLIP-44 397 mapping for NEAR in Ledger utils

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
gomesalexandre and others added 3 commits December 27, 2025 16:57
…Connect)

Trezor Connect doesn't have nearGetAddress or nearSignTransaction methods.
Their marketing page was misleading - Trezor doesn't actually support NEAR.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@gomesalexandre gomesalexandre changed the title wip: near chain feat: near chain Dec 27, 2025
NeOMakinG
NeOMakinG previously approved these changes Dec 30, 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/189478c6-5174-43b8-a684-ef223c589126

Had to fix derivations paths to be equal to trust addresses but looks good with it!

@NeOMakinG NeOMakinG merged commit c716c4c into master Dec 30, 2025
5 checks passed
@NeOMakinG NeOMakinG deleted the near_chain branch December 30, 2025 18:55
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