terra_dart_keys 1.0.3  terra_dart_keys: ^1.0.3 copied to clipboard
terra_dart_keys: ^1.0.3 copied to clipboard
A lightweight key management library for the terra ecosystem
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
Features #
- Written in Dart, with type definitions
- Works with the Flutter & Dart Ecosystems, in the browser, and Mobile
- Easy key management for anyone building on the Terra Ecosystem
Installation & Configuration #
Grab the latest version off Pub
dart pub add terra_dart_keys
Usage #
Terra.Dart.Keys can be used for Mobile & Web Developers, or SDK Developers looking to extend the Terra Platform
Generating a Mnemonic Key #
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 new 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 =  new MnemonicKey(recoveryWords, exposePrivateKey: true);
    
  Console.WriteLine($"PrivateKey: {mnmonic.privateKeyExposed}");
    
  return mnmonic;
}
License #
This software is licensed under the MIT license. See LICENSE for full disclosure.
© 2022 TerraMystics.