polyseed 0.0.6 copy "polyseed: ^0.0.6" to clipboard
polyseed: ^0.0.6 copied to clipboard

A pure dart implementation of the 16-word seed scheme for monero

example/polyseed_example.dart

import 'dart:convert';

import 'package:polyseed/polyseed.dart';

void main() {
  var lang = PolyseedLang.getByName("English");

  var seed = Polyseed.create();
  var seedStr = seed.encode(lang, PolyseedCoin.POLYSEED_MONERO);
  print('Seed: $seedStr');

  var seed2 = Polyseed.decode(seedStr, lang, PolyseedCoin.POLYSEED_MONERO);
  print('seed2: ${seed2.encode(lang, PolyseedCoin.POLYSEED_MONERO)}');

  seed.crypt("CakeWallet");
  print(seed.isEncrypted); // true
  print('encrypted: ${seed.encode(lang, PolyseedCoin.POLYSEED_MONERO)}');

  seed.crypt("CakeWallet");
  print(seed.isEncrypted); // false
  print('decrypted: ${seed.encode(lang, PolyseedCoin.POLYSEED_MONERO)}');

  var seedFeatherStr =
      "unaware yard donate shallow slot sing oil oxygen loyal bench near hill surround forum execute lamp";
  var seedFeather =
      Polyseed.decode(seedFeatherStr, lang, PolyseedCoin.POLYSEED_MONERO);

  var key = seedFeather.generateKey(PolyseedCoin.POLYSEED_MONERO, 32);

  print(seedFeather.birthday); // 1693622412

  print(key.toHexString());
  // cbbd142d38347773d44aa830f5f01442aa6d0d3bb48571884479531248e6fa1c

  print(base64.encode(seedFeather.save()));
  //UE9MWVNFRUQWAP7QTFMwyWZ55hIVJOa7aluTxzP/Y3c=

  var seedLoaded = Polyseed.load(
      base64.decode("UE9MWVNFRUQWAP7QTFMwyWZ55hIVJOa7aluTxzP/Y3c="));
  print("seedLoaded: ${seedLoaded.encode(lang, PolyseedCoin.POLYSEED_MONERO)}");
  // seedLoaded: unaware yard donate shallow slot sing oil oxygen loyal bench near hill surround forum execute lamp

  var legacySeed =
      seedFeather.toLegacySeed(LegacySeedLang.getByName("English"));
  print("25 Word Legacy Seed: $legacySeed");
  // 25 Word Legacy Seed: avidly chlorine gave yeti ramped certain hybrid comb governing amply hinder pamphlet offend geometry narrate unopened robot epoxy annoyed glide ingested ascend were austere unopened
}
5
likes
150
points
796
downloads

Publisher

verified publishercakelabs.com

Weekly Downloads

A pure dart implementation of the 16-word seed scheme for monero

Homepage
Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

hashlib, pointycastle, unorm_dart

More

Packages that depend on polyseed