trustwallet / wallet-core
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::Ethereum {
12

13
/// Entry point for Ethereum and Ethereum-fork coins.
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
            TWCoinTypeCallisto,
20
            TWCoinTypeEthereum,
21
            TWCoinTypeEthereumClassic,
22
            TWCoinTypeGoChain,
23
            TWCoinTypePOANetwork,
24
            TWCoinTypeThunderToken,
25
            TWCoinTypeTomoChain,
26
            TWCoinTypeSmartChainLegacy,
27
            TWCoinTypeSmartChain,
28
            TWCoinTypePolygon,
29
        };
30
    }
31
    virtual bool validateAddress(TWCoinType coin, const std::string& address, TW::byte p2pkh, TW::byte p2sh, const char* hrp) const;
32
    virtual std::string normalizeAddress(TWCoinType coin, const std::string& address) const;
33
    virtual std::string deriveAddress(TWCoinType coin, const PublicKey& publicKey, TW::byte p2pkh, const char* hrp) const;
34
    virtual void sign(TWCoinType coin, const Data& dataIn, Data& dataOut) const;
35 1
    virtual bool supportsJSONSigning() const { return true; }
36
    virtual std::string signJSON(TWCoinType coin, const std::string& json, const Data& key) const;
37
};
38

39
} // namespace TW::Ethereum

Read our documentation on viewing source code .

Loading