terra_dart_keys 1.1.4 copy "terra_dart_keys: ^1.1.4" to clipboard
terra_dart_keys: ^1.1.4 copied to clipboard

A lightweight key management library for the terra ecosystem


A lightweight key management library for the terra ecosystem


GitHub GitHub GitHub

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 & Versatile support for key management solutions for anyone building on the Terra Ecosystem

Installation & Configuration #

Grab the latest version off Pub

dart pub add terra_dart_keys

Usage #

This package 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 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;
}

License #

This software is licensed under the MIT license. See LICENSE for full disclosure.

© 2022 TerraMystics.