ledger-sui
A Flutter Ledger App Plugin for the Sui blockchain
« Explore the docs »
Report Bug
· Request Feature
· Ledger Flutter
Overview
Ledger Nano devices are the perfect hardware wallets for managing your crypto & NFTs on the go. This Flutter package is a plugin for the ledger_flutter package to get public keys and sign transactions on the Sui blockchain.
Web3 Ecosystem Integrations
We are expanding the Flutter ecosystem to grow the Web3 community. Check out our other Web3 packages below:
Getting started
Installation
Install the latest version of this package via pub.dev:
ledger_sui: ^latest-version
For integration with the Ledger Flutter package, check out the documentation here.
Setup
Create a new instance of a SuiLedgerApp and pass an instance of your Ledger object.
final suiApp = SuiLedgerApp(ledger);
Usage
Get public key
Fetch the public key and address from the Ledger Nano device.
final result = await suiApp.getPublicKey(device);
print(result.publicKey); // Ed25519 public key
print(result.address); // Sui address
Discover multiple accounts
Fetch a page of Sui accounts by derivation index.
final accounts = await suiApp.getAccountsWithDetails(
device,
startIndex: 0,
count: 5,
);
for (final account in accounts) {
print(account.accountIndex);
print(account.addressHex);
}
Signing transactions
You can sign transactions using the SuiLedgerApp. The signing flow uses a block-chain protocol to handle large transactions:
final signature = await suiApp.signTransaction(
device,
transaction,
);
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.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/my-feature) - Commit your Changes (
git commit -m 'feat: my new feature) - Push to the Branch (
git push origin feature/my-feature) - Open a Pull Request
Please read our Contributing guidelines and try to follow Conventional Commits.
License
The ledger_sui SDK is released under the Apache License 2.0. See LICENSE for details.