Repository navigation
Expand file tree
/
Copy pathCoin.h
More file actions
74 lines (52 loc) · 2.2 KB
/
Copy pathCoin.h
File metadata and controls
74 lines (52 loc) · 2.2 KB
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
// 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 "Data.h"
#include "Hash.h"
#include "DerivationPath.h"
#include "PrivateKey.h"
#include "PublicKey.h"
#include <TrustWalletCore/TWBlockchain.h>
#include <TrustWalletCore/TWCoinType.h>
#include <TrustWalletCore/TWCurve.h>
#include <TrustWalletCore/TWHDVersion.h>
#include <TrustWalletCore/TWPurpose.h>
#include <string>
#include <set>
namespace TW {
/// Validates an address for a particular coin.
bool validateAddress(TWCoinType coin, const std::string& address);
/// Returns the blockchain for a coin type.
TWBlockchain blockchain(TWCoinType coin);
/// Returns the purpose for a coin type.
TWPurpose purpose(TWCoinType coin);
/// Returns the curve that should be used for a coin type.
TWCurve curve(TWCoinType coin);
/// Returns the xpub HD version that should be used for a coin type.
TWHDVersion xpubVersion(TWCoinType coin);
/// Returns the xprv HD version that should be used for a coin type.
TWHDVersion xprvVersion(TWCoinType coin);
/// Returns the default derivation path for a particular coin.
DerivationPath derivationPath(TWCoinType coin);
/// Returns the public key type for a particular coin.
enum TWPublicKeyType publicKeyType(TWCoinType coin);
/// Derives the address for a particular coin from the private key.
std::string deriveAddress(TWCoinType coin, const PrivateKey& privateKey);
/// Derives the address for a particular coin from the private key.
std::string deriveAddress(TWCoinType coin, const PublicKey& publicKey);
/// Hasher for deriving the public key hash.
Hash::Hasher publicKeyHasher(TWCoinType coin);
/// Hasher to use for base 58 checksums.
Hash::Hasher base58Hasher(TWCoinType coin);
/// Returns static prefix for a coin type.
byte staticPrefix(TWCoinType coin);
/// Returns P2PKH prefix for a coin type.
byte p2pkhPrefix(TWCoinType coin);
/// Returns P2SH prefix for a coin type.
byte p2shPrefix(TWCoinType coin);
/// Returns human readable part for a coin type.
enum TWHRP hrp(TWCoinType coin);
} // namespace TW