Releases: LedgerHQ/ledgerjs
v6.23.0
- hw-app-eth: Use ethersproject packages intead of ethers umbrella package (#763) thanks @FrederikBolding
- currencies: update CRO token code (#758) thanks @crypto-facs
- currencies: new tokens – LL-8972 (#765) thanks @adrienlacombe-ledger
- hw-transport-node-hid-singleton: LL-8941 Automatically release USB connection after 5s (#761) thanks @juan-cortes
6.22.x
Rework hw-app-eth to split out "ledger services" from the app logic #747
eth.signTransaction(path, txHex)
becomes deprecated in favor of
eth.signTransaction(path, txHex, resolution)
where resolution is an object with following shape:
{
erc20Tokens: Array<string>;
nfts: Array<string>;
externalPlugin: Array<{ payload: string; signature: string }>;
plugin: Array<string>;
}
This object contains all the hex serialized data the device may need to clear sign information on device screen.
Hopefully we also provide a default "service" to resolve this data, example:
import ledgerService from "@ledgerhq/hw-app-eth/lib/services/ledger"
async function main() {
...
const resolution = await ledgerService.resolveTransaction(txHex, loadConfig, resolutionConfig)
.catch(() => null); // <-- up to you if you want a fallback to blind sign. (which was previous behavior)
const result = eth.signTransaction("44'/60'/0'/0/0", txHex, resolution);
}
This allows us to decouple the transaction resolution from the device signature logic itself in order for you to have better control and for more usecases
- an alternative service (rather than Ledger's) could be used.
- we plan to make even more things dynamic, typically the way we load and resolve ERC20 and plugins are too monolithic. This rework pave the path to allow this even more easily.
- you may want to load the resolve data way ahead in your "validation process" and typically inform the user if an error occurs before it reach the device phase.
- you may want a finer control weither you allow blind sign or not. Typically, you may or may not use
.catch(() => null)
in the snippet above
loadConfig
loadConfig is a configuration file that allows to configure what endpoints are used for the resolution mecanism.
NFT resolution is not yet active in this current version but will be soon. That said, you need to explicitly request it in resolutionConfig.
you can set {}
object and it will be fallback to default values.
resolutionConfig
This is an object that specifies what need to be resolved, if any.
Here are all the possible flag to set at the moment:
{ nft: true, externalPlugins: true, erc20: true }
you can just { erc20: true }
if you just need to resolve ERC20 token signature. It gives context for the resolver to do the minimum.
You can also see:
nft
: is the mecanics to do clear signing. (it is not yet active, unless you set the correct loadConfig API)externalPlugins
: is the plugin mecanics (e.g. LIDO) to see what you sign in Ledger Live apps.
New libraries in ledgerjs
Others
- Update ERC20 list – LL-8868
- fix: cryptoassets exchange erc20 & coins import names (#752)
v6.21.3
v6.21.1
v6.21.0
v6.20.0
v6.19.0
v6.18.0
v6.17.0
@ledgerhq/cryptoassets
update- Add Celo to currencies (#723) thx @pawelnguyen
- LL-8289 avalanche to be having its own family (#729)
- added moonriver (#722) thx @albertov19
@ledgerhq/hw-app-eth
: All necessary fixes to support NFT@ledgerhq/hw-app-btc
: LL-8255: call onDeviceSignatureRequested at a more accurate time