1
// Copyright © 2017-2020 Trust Wallet.
2
//
3
// This file is part of Trust. The full Trust copyright notice, including
4
// terms governing use, modification, and redistribution, is contained in the
5
// file LICENSE at the root of the source code distribution tree.
6

7
#pragma once
8

9
#include "Coins.h"
10
#include "HexCoding.h"
11
#include "Data.h"
12

13
#include <string>
14
#include <iostream>
15

16
namespace TW::WalletConsole {
17

18
using namespace std;
19

20 1
class Keys {
21
private:
22
    ostream& _out;
23
    const Coins& _coins;
24
    string _currentMnemonic;
25
    
26
public:
27
    Keys(ostream& out, const Coins& coins);
28
    bool newKey(const string& coinid, string& res);
29
    /// Public key from private key, ED25519
30
    bool pubPri(const string& coinid, const string& p, string& res);
31
    bool priPub(const string& p, string& res);
32 1
    string getMnemo() const { return _currentMnemonic; }
33
    /// Set given mnemonic; list of separate words
34
    void setMnemonic(const vector<string>& param);
35
    /// Generate and store new mnemonic
36
    bool newMnemonic(const string& param1, string& res);
37
    /// Dump seed of current mnemonic
38
    bool dumpSeed(string& res);
39
    /// Dump the current mnemonic
40
    bool dumpMnemonic(string& res);
41
    /// Dump default derivation path of coin
42
    bool dumpDP(const string& coinid, string& res);
43
    /// Dump XPUB of current mnemonic
44
    bool dumpXpub(const string& coinid, string& res);
45
    /// Derive a private key from the mnemonic with derivation path
46
    bool priDP(const string& coinid, const string& dp, string& res);
47
};
48

49
} // namespace TW::WalletConsole

Read our documentation on viewing source code .

Loading