fix: WebHID/WebUSB transport for modern browsers - #36
Open
christopheSeeka wants to merge 3 commits into
Open
Conversation
Restore Ledger connectivity in modern Chrome/Edge. U2F default preserved for legacy WavesLedger. Adds unit tests and bumps version to 4.0.2. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
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
Fixes
@waves/ledgerfor modern Chrome/Edge browsers. Ledger WAVES holders have been unable to sign transactions because the library defaults to deprecated U2F transport (removed from browsers in 2022).Changes
WavesLedgerSync— new recommended API with WebHID → WebUSB auto-connecttransport.ts—createLedgerTransport()used by defaultbuildSignPayload()— extracted signing logic + unit tests (no device required)signProtocol: 'auto'(default) picks v1.0 / v1.1 / v1.2 from Waves app version viagetVersion()0x9102deprecated protocol)@ledgerhq/logsto v6 — fixesLocalTracer is not a constructorwith hw-transport v6WavesLedgerunchanged (U2F default preserved for backward compatibility)Motivation
@waves/ledger@4.0.1is broken in all current browsers (U2F dead)4.0.2-beta.3added WebUSB-onlyWavesLedgerSyncbut was never merged to master@waves/provider-ledgerdepends on the unpublished betaTest plan
npm test— 8 protocol unit tests pass (no Ledger device)npm run build— TypeScript compilesHardware validation used a test UI at https://ledger.blockai.dev with vendored build from this branch (
WavesLedgerSync, outer signing protocol v1.1).Test dApp on mainnet:
3PDBYhfP8JtGkUPEWSoHzXaHbs8MsJbsF67— callabledummy(str: String).Breaking changes
None for existing
WavesLedgercallers. New integrations should useWavesLedgerSync.