ledger_ethereum
A Flutter Package to support communicate between Ledger Nano X device and EVM compatible chains apps
Fully support at Avacus so you can have the best experience.
Feel free to use and don't hesitate to raise issue if there are.
Getting Started
Installation
Install the latest version of this package via pub.dev:
ledger_ethereum: ^latest-version
For integration with the Ledger Flutter package, check out the documentation here.
Setup
Create a new instance of an EthereumLedgerApp
and pass an instance of your Ledger
object.
final app = EthereumLedgerApp(ledger);
Usage
Get accounts
final accounts = await app.getAccounts(device);
Sign personal message
final signature = await app.signPersonalMessage(
device,
messageInBytes,
);
Sign typed data
final signature = await app.signEIP712Message(
device,
messageInJson,
);
Sign transaction
final transactionInBytes = TransactionHandler.encodeTx(transaction, chainId);
final signature = await app.signTransaction(
device,
transactionInBytes,
);