Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zilpay/zilliqa_ledger_flutter
https://github.com/zilpay/zilliqa_ledger_flutter
Last synced: 3 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/zilpay/zilliqa_ledger_flutter
- Owner: zilpay
- License: mit
- Created: 2024-11-11T12:09:33.000Z (6 days ago)
- Default Branch: master
- Last Pushed: 2024-11-12T10:46:01.000Z (5 days ago)
- Last Synced: 2024-11-12T10:50:31.455Z (5 days ago)
- Language: Dart
- Size: 1.95 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
ledger-zilliqa
A Flutter Ledger App Plugin for the Zilliqa blockchain
Report Bug
ยท Request Feature
ยท Ledger Flutter
---
## Overview
Ledger Nano devices provide secure hardware wallet solutions for managing your cryptocurrencies. This Flutter package is a plugin for the [ledger_flutter](https://pub.dev/packages/ledger_flutter) package that enables interaction with the Zilliqa blockchain, allowing you to retrieve accounts and sign transactions using your Ledger hardware wallet.
## Features
- ๐ Get public keys and addresses
- ๐ Sign transactions
- ๐ Sign message hashes
- ๐ฑ Cross-platform support (iOS & Android)
- โก๏ธ Fast and efficient BLE communication
- ๐ Secure transaction signing## Getting Started
### Installation
Add the latest version of this package to your `pubspec.yaml`:
```yaml
dependencies:
zilliqa_ledger_flutter: ^latest-version
```For integration with the Ledger Flutter package, check out the documentation [here](https://pub.dev/packages/ledger_flutter).
### Setup
Create a new instance of a `ZilliqaLedgerApp` and pass an instance of your `Ledger` object:
```dart
final app = ZilliqaLedgerApp(ledger);
```## Usage
### Get Public Key and Address
You can retrieve the public key and address for a specific account index:
```dart
// 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 Transactions
Sign Zilliqa transactions using your Ledger device:
```dart
// Prepare your transaction bytes
final transaction = // Your encoded transaction bytesfinal signature = await app.signZilliqaTransaction(
device,
transaction,
accountIndex,
);// Use the signature with your transaction
print('Transaction signature: $signature');
```### Sign Message Hash
Sign message hashes for verification:
```dart
final hash = // Your message hash bytes
final signature = await app.signHash(
device,
hash,
accountIndex,
);print('Message signature: $signature');
```## Error Handling
The plugin includes comprehensive error handling for common Ledger operations:
```dart
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');
}
}
```## Contributing
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`.
1. Fork the Project
2. Create your Feature Branch (`git checkout -b feature/amazing-feature`)
3. Commit your Changes (`git commit -m 'feat: add some amazing feature'`)
4. Push to the Branch (`git push origin feature/amazing-feature`)
5. Open a Pull Request## License
The zilliqa_ledger_flutter package is released under the MIT License. See [LICENSE](LICENSE) for details.
## Support
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.