A Flutter Ledger App Plugin for the Zilliqa blockchain
Report Bug
· Request Feature
· Ledger Flutter
Ledger Nano devices provide secure hardware wallet solutions for managing your cryptocurrencies. This Flutter package is a plugin for the ledger_flutter package that enables interaction with the Zilliqa blockchain, allowing you to retrieve accounts and sign transactions using your Ledger hardware wallet.
- 🔑 Get public keys and addresses
- 📝 Sign transactions
- 🔐 Sign message hashes
- 📱 Cross-platform support (iOS & Android)
- ⚡️ Fast and efficient BLE communication
- 🔒 Secure transaction signing
Add the latest version of this package to your pubspec.yaml
:
dependencies:
zilliqa_ledger_flutter: ^latest-version
For integration with the Ledger Flutter package, check out the documentation here.
Create a new instance of a ZilliqaLedgerApp
and pass an instance of your Ledger
object:
final app = ZilliqaLedgerApp(ledger);
You can retrieve the public key and address for a specific account index:
// Get public key
final publicKey = await app.getPublicKey(device, accountIndex);
// Get public address
final addressInfo = await app.getPublicAddress(device, accountIndex);
print('Address: ${addressInfo.address}');
print('Public Key: ${addressInfo.publicKey}');
Sign Zilliqa transactions using your Ledger device:
// Prepare your transaction bytes
final transaction = // Your encoded transaction bytes
final signature = await app.signZilliqaTransaction(
device,
transaction,
accountIndex,
);
// Use the signature with your transaction
print('Transaction signature: $signature');
Sign message hashes for verification:
final hash = // Your message hash bytes
final signature = await app.signHash(
device,
hash,
accountIndex,
);
print('Message signature: $signature');
The plugin includes comprehensive error handling for common Ledger operations:
try {
final publicKey = await app.getPublicKey(device, accountIndex);
} catch (e) {
if (e is LedgerException) {
// Handle Ledger-specific errors
print('Ledger error: ${e.message}');
} else {
// Handle other errors
print('Error: $e');
}
}
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag enhancement
.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/amazing-feature
) - Commit your Changes (
git commit -m 'feat: add some amazing feature'
) - Push to the Branch (
git push origin feature/amazing-feature
) - Open a Pull Request
The zilliqa_ledger_flutter package is released under the MIT License. See LICENSE for details.
If you like this package, consider supporting it by:
- ⭐️ Starring the repository
- 🐛 Reporting bugs
- 📝 Contributing to the codebase
- 💡 Suggesting new featuresrom the package authors, and more.