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.
Motivation and Resolution
Ledger has released a new version 2.1.1 of the Starknet APP.
It includes improvements, including a comprehensive display of the details of V1 & V3 transactions.
Starknet.js is now able to use APP v1.1.1 & v2.1.1.
Usage related changes
Important
No breaking changes for code using Ledger APP v1.1.1 (just no comprehensive display, only blind signatures)
No change of the code :
LedgerSigner
andLedgerSigner111
classes are equivalent.They can also use the v1.1.1 signer ; they will only not have access to the display of transaction details.
Development related changes
LedgerSigner
andgetLedgerPathBuffer
are still there, and are related to v1.1.1 APP.They are now also named
LedgerSigner111
andgetLedgerPathBuffer111
.LedgerSigner211
andgetLedgerPathBuffer211
have been created to handle v2.1.1.As several functions are common for both signers, the
LedgerSigner211
is an extension of theLedgerSigner111
.Some maths included in
hashFeeField
(utils/hash/transactionHash/v3.ts) are necessary, and have been isolated in exportable functions.The new signer has been tested successfully in Node ( https://github.com/PhilippeR26/starknet.js-workshop-typescript/blob/main/src/scripts/ledgerNano/6.testLedgerAccount211.ts ) and in a demo DAPP ( https://github.com/PhilippeR26/Starknet-Ledger-Wallet )
Checklist: