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 <string>
10
#include <vector>
11
#include <map>
12
#include <sstream>
13

14
namespace TW::WalletConsole {
15

16
using namespace std;
17

18 1
class Coin {
19
public:
20
    int c;
21
    string id;
22
    string name;
23
    string symbol;
24
    int curve; // TWCurve
25
    int pubKeyType; // TWPublicKeyType
26
    string derivPath;
27
};
28

29 1
class Coins {
30
public:
31 1
    Coins(ostream& out) : _out(out) {}
32
    void coins() const;
33
    bool findCoin(const string& coin, Coin& coin_out) const;
34
    void init();
35
protected:
36
    void scanCoins();
37
    int findCoinId(const string& coin) const;
38
    static int pubKeyTypeFromCurve(int cc);
39
    ostream& _out;
40
    map<int, Coin> _coinsByNum;
41
    map<string, Coin> _coinsById;
42
    map<string, Coin> _coinsByName;
43
    map<string, Coin> _coinsBySymbol;
44
};
45

46
} // namespace TW::WalletConsole

Read our documentation on viewing source code .

Loading