A lightweight key management library for the terra ecosystem
Explore the Docs »
Example App
·
API Reference
·
Pub Package
·
GitHub
A lightweight key management library for dart
- Written in Dart, with type definitions
- Works with the Flutter & Dart Ecosystems, in the browser, and Mobile
- Easy & Versatile support for key management solutions for anyone building on the Terra Ecosystem
Grab the latest version off Pub
dart pub add terra_dart_keys
This package can be used for Mobile & Web Developers, or SDK Developers looking to extend the Terra Platform
MnemonicKey generateMnemonic() {
// Create a key out of a mnemonic string (recovery words)
String recoveryWords = "notice oak worry limit wrap speak medal online prefer cluster roof addict wrist behave treat actual wasp year salad speed social layer crew genius";
// If creating a random mnemonic, don't pass the recovery words
return MnemonicKey(recoveryWords);
}
//ONLY FOR TESTING & DEVELOPMENT PURPOSES: DO NOT EXPOSE PRIVATE KEY, IT COULD RISK EXPOSING THE WALLET FUNDS IF LOST
MnemonicKey generateMnemonicWithPrivateKey() {
String recoveryWords = "notice oak worry limit wrap speak medal online prefer cluster roof addict wrist behave treat actual wasp year salad speed social layer crew genius";
// Create a key out of a mnemonic string (recovery words)
var mnmonic = MnemonicKey(recoveryWords, exposePrivateKey: true);
print("PrivateKey: ${mnmonic.privateKeyExposed}");
return mnmonic;
}
This software is licensed under the MIT license. See LICENSE for full disclosure.
© 2022 TerraMystics.