-
Notifications
You must be signed in to change notification settings - Fork 1.6k
/
Entry.h.erb
25 lines (20 loc) · 1.2 KB
/
Entry.h.erb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// Copyright © 2017-2020 Trust Wallet.
//
// This file is part of Trust. The full Trust copyright notice, including
// terms governing use, modification, and redistribution, is contained in the
// file LICENSE at the root of the source code distribution tree.
#pragma once
#include "../CoinEntry.h"
namespace TW::<%= format_name(coin) %> {
/// Entry point for implementation of <%= format_name(coin) %> coin.
/// Note: do not put the implementation here (no matter how simple), to avoid having coin-specific includes in this file
class Entry: public CoinEntry {
public:
virtual const std::vector<TWCoinType> coinTypes() const { return {TWCoinType<%= format_name(coin) %>}; }
virtual bool validateAddress(TWCoinType coin, const std::string& address, TW::byte p2pkh, TW::byte p2sh, const char* hrp) const;
virtual std::string deriveAddress(TWCoinType coin, const PublicKey& publicKey, TW::byte p2pkh, const char* hrp) const;
virtual void sign(TWCoinType coin, const Data& dataIn, Data& dataOut) const;
// normalizeAddress(): implement this if needed, e.g. Ethereum address is EIP55 checksummed
// plan(): implement this if the blockchain is UTXO based
};
} // namespace TW::<%= format_name(coin) %>