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 "../CoinEntry.h"
10

11
namespace TW::Bitcoin {
12

13
/// Bitcoin entry dispatcher.
14
/// Note: do not put the implementation here (no matter how simple), to avoid having coin-specific includes in this file
15
class Entry: public CoinEntry {
16
public:
17 1
    virtual const std::vector<TWCoinType> coinTypes() const {
18 1
        return {
19
            TWCoinTypeBitcoin,
20
            TWCoinTypeBitcoinCash,
21
            TWCoinTypeBitcoinGold,
22
            TWCoinTypeDash,
23
            TWCoinTypeDigiByte,
24
            TWCoinTypeDogecoin,
25
            TWCoinTypeLitecoin,
26
            TWCoinTypeMonacoin,
27
            TWCoinTypeQtum,
28
            TWCoinTypeRavencoin,
29
            TWCoinTypeViacoin,
30
            TWCoinTypeZcoin,
31
        };
32
    }
33
    virtual bool validateAddress(TWCoinType coin, const std::string& address, TW::byte p2pkh, TW::byte p2sh, const char* hrp) const;
34
    virtual std::string normalizeAddress(TWCoinType coin, const std::string& address) const;
35
    virtual std::string deriveAddress(TWCoinType coin, const PublicKey& publicKey, TW::byte p2pkh, const char* hrp) const;
36
    virtual void sign(TWCoinType coin, const Data& dataIn, Data& dataOut) const;
37
    virtual void plan(TWCoinType coin, const Data& dataIn, Data& dataOut) const;
38
};
39

40
} // namespace TW::Bitcoin

Read our documentation on viewing source code .

Loading