Skip to content

Commit

Permalink
Add convert to Legacy Seed
Browse files Browse the repository at this point in the history
  • Loading branch information
konstantinullrich committed Dec 8, 2023
1 parent 504d58a commit 242dbc3
Show file tree
Hide file tree
Showing 25 changed files with 21,530 additions and 20 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Dart CI

on:
push:
branches: [ trunk ]
pull_request:
branches: [ trunk ]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: dart-lang/setup-dart@v1
with:
sdk: stable

- name: Install dependencies
run: dart pub get

- name: Run tests
run: dart pub run test
18 changes: 13 additions & 5 deletions example/polyseed_example.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import 'dart:convert';

import 'package:polyseed/polyseed.dart';
import 'package:polyseed/src/utils/key_utils.dart';

void main() {
var lang = PolyseedLang.getByName("English");
Expand All @@ -27,13 +26,22 @@ void main() {
Polyseed.decode(seedFeatherStr, lang, PolyseedCoin.POLYSEED_MONERO);

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

print(seedFeather.birthday); // 1693622412
print(keyToHexString(
key)); // cbbd142d38347773d44aa830f5f01442aa6d0d3bb48571884479531248e6fa1c
print(base64.encode(
seedFeather.save())); //UE9MWVNFRUQWAP7QTFMwyWZ55hIVJOa7aluTxzP/Y3c=

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 changes: 4 additions & 1 deletion lib/polyseed.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
library polyseed;

export 'src/mnemonics/legacy/legacy_seed_lang.dart';
export 'src/mnemonics/polyseed_lang.dart';
export 'src/polyseed.dart';
export 'src/polyseed_coin.dart';
export 'src/mnemonics/polyseed_lang.dart';
export 'src/utils/legacy_polyseed_extension.dart';
export 'src/utils/string_uint8list_extension.dart';
Loading

0 comments on commit 242dbc3

Please sign in to comment.