Repository navigation
feat: add solana to ledger wallet - #1520
Open
RyukTheCoder wants to merge 8 commits into
Open
RyukTheCoder wants to merge 8 commits into
RyukTheCoder wants to merge 8 commits into
Conversation
RyukTheCoder
requested review from
arlert-armin,
llawliet-l-l and
yeager-eren
as code owners
October 5, 2026 12:07
RyukTheCoder
force-pushed
the
feat/add-solana-to-ledger-wallet
branch
from
October 20, 2026 13:01
4a9e9e8 to
a8219a1
Compare
RyukTheCoder
requested review from
Ikari-Shinji-re and
nikaaru
as code owners
October 20, 2026 13:01
RyukTheCoder
force-pushed
the
feat/add-solana-to-ledger-wallet
branch
2 times, most recently
from
October 20, 2026 13:22
cc15fb3 to
21e21a0
Compare
disconnect() dropped each namespace.disconnect() promise inside a forEach, so callers (e.g. single-namespace wallets switching namespace) started a new connect while the previous disconnect was still in flight.
hub3 doesn't await before hooks, so the Ledger session reset ran after disconnect resolved and raced the next namespace connect, causing a 'No session ID' error. Move the wallet disconnect into the action.
RyukTheCoder
force-pushed
the
feat/add-solana-to-ledger-wallet
branch
from
November 11, 2026 13:50
21e21a0 to
3518222
Compare
Upgrade ledger-wallet-provider and ledger-wallet-provider-core to 2.0.3,
and ledger-wallet-provider-evm and ledger-wallet-provider-solana to
1.0.3.
Pin the ledger-wallet-provider packages and the exact peers that evm and
solana require (device-management-kit, rxjs, xstate, purify-ts), and
dedupe rxjs to a single 7.8.2 copy. A second device-management-kit copy
next to the one ledger-wallet-provider-core bundles made instanceof
checks fail across copies, and EVM signing showed Ledger's generic sign
error. device-management-kit stays at 1.11.0, not the latest 1.11.1,
because the evm and solana peers and provider-core all require exactly
1.11.0. Document the pins in the readme.
Parcel's production build leaves the namespace re-export in ethers'
index (`export { ethers }`) undefined, so Ledger's calls to
`ethers.Transaction.from` threw "re_export$ethers is not defined" and
EVM signing failed on deployed builds only. Patch
ledger-wallet-provider-evm and device-signer-kit-ethereum to import
Transaction and Signature by name.
Rename the ledger patches to the new versions. None of their fixes are
upstream yet.
patch-package only runs on install, so a node_modules cache hit kept packages patched with whatever patches the cache was built with. Add patches/ to the cache key. Also drop the restore-keys fallback: yarn v1 doesn't prune stale nested packages when installing over an older node_modules, which shipped a second device-management-kit copy to the PR preview. A dependency or patch change now installs into an empty tree.
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds Solana support to the Ledger Wallet provider (
@rango-dev/provider-ledger-wallet) by upgrading to Ledger Wallet Provider v2.What changed
Dependencies
@ledgerhq/ledger-wallet-provider^1.4.2→^2.0.0.@ledgerhq/ledger-wallet-provider-evmand@ledgerhq/ledger-wallet-provider-solana. In v2 each blockchain family is a separate package that is passed toinitializeLedgerProviderthroughblockchainProviderFactories.@ledgerhq/device-management-kit(pinned to1.10.0). We don't import it, but it is a peer dependency of the two family packages. Without declaring it, yarn nests it underledger-wallet-provider-coreand the family packages can't resolve it.@hub3js/solana,@rango-dev/signer-solana,@wallet-standard/app,bs58, plus three type-only dev dependencies for the Wallet Standard types.Solana namespace (
src/namespaces/solana.ts)getWallets()instead of being announced like the EVM provider.connectanddisconnectactions, with an account-change subscription. When the user selects a non-Solana account in the Ledger Button, Ledger clears the Solana accounts and we disconnect the namespace.canEagerConnect: see "Known limitations".Solana signer (
src/signers/solana.ts)solana:signTransaction). Simulation, broadcast and confirmation go throughgeneralSolanaTransactionExecutor, the same as the MetaMask Solana signer.Loading and build
init, so they are not pulled in at widget startup.--splitting, so the EVM and Solana signers are emitted as separate chunks and@rango-dev/signer-evm/@rango-dev/signer-solanaare only loaded when signers are requested.Docs
wallets/readme.md: Ledger Wallet now lists Solana, and Auto Connect is marked partial.wallets/provider-ledger-wallet/readme.md: notes on Solana auto connect and on how signing errors surface.Patches
Ledger's v2 packages need several
patch-packagepatches to work in this repo. They only affect this repo'snode_modules; they are not shipped to integrators.ledger-wallet-provider+2.0.0,ledger-wallet-provider-core+2.0.0exportssodefaultis lastledger-wallet-provider-evm+1.0.0,ledger-wallet-provider-solana+1.0.0exportsreorder, and adds a missingBlockchainFamilyimport to two.d.tsfiles in each packagets-checkfails withTS2304: Cannot find name 'BlockchainFamily'. Reported upstream: LedgerHQ/ledger-button-public#4ledger-wallet-provider-core++@inversifyjs+core+9.2.0symboltounique symbolin inversify's typingsts-checkfails withTS1166ledger-wallet-provider-core++zod+4.5.4"sideEffects": truein zod'sv4/classic/package.jsonimport { z } from "zod"as an empty object, so Ledger crashes withz.string is not a functiondevice-signer-kit-ethereum++ethers+6.14.1"sideEffects": truein ethers'lib.esm/package.jsonethers.Transactionfrom theethersnamespace import, so every EVM signature fails with "Invalid transaction"ledger-wallet-provider-evm++ethers+6.17.0ethers.Signature, which Ledger uses to assemble the signed transactionThe last three are specific to Parcel (used by
widget/appandwidget/playground). The same imports bundle correctly with webpack 5.100, Vite 4.5, Vite 8 and esbuild.Known limitations
silentoption ofstandard:connectand doesn't expose accounts before connecting, so an existing session can't be detected without opening the modal. Reported upstream: Solana:standard:connectignoressilent, so a session cannot be restored without opening the modal LedgerHQ/ledger-button-public#66808(blind signing required) shows the generic signing error instead of "Blind signing disabled" LedgerHQ/ledger-button-public#5default-last inexports(for example Next 13), will hit the issues above until Ledger fixes them upstream.How did you test this change?
Automated checks on
@rango-dev/provider-ledger-wallet:yarn ts-checkyarn lintyarn build(output is split intomod.js, a shared chunk and one chunk per signer)yarn install --frozen-lockfileandpatch-packageapply all patches cleanlyManual, in
widget/appwith a Ledger device (requires aledgerWalletconfig withapiKeyanddAppIdentifier, and Solana enabled for that dApp identifier on Ledger's side):Checklist: