forked from trustwallet/wallet-core
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathTWCoinType.h
More file actions
140 lines (122 loc) · 4.08 KB
/
TWCoinType.h
File metadata and controls
140 lines (122 loc) · 4.08 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
// Copyright © 2017-2019 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 "TWBase.h"
#include "TWBlockchain.h"
#include "TWCurve.h"
#include "TWPrivateKey.h"
#include "TWPurpose.h"
#include "TWString.h"
#include "TWHDVersion.h"
#include "TWHRP.h"
TW_EXTERN_C_BEGIN
/// Coin type for Level 2 of BIP44.
///
/// - SeeAlso: https://github.com/satoshilabs/slips/blob/master/slip-0044.md
TW_EXPORT_ENUM(uint32_t)
enum TWCoinType {
TWCoinTypeAeternity = 457,
TWCoinTypeAion = 425,
TWCoinTypeBinance = 714,
TWCoinTypeCoinex = 688,
TWCoinTypeBitcoin = 0,
TWCoinTypeBitcoinCash = 145,
TWCoinTypeBitcoinSV = 236,
TWCoinTypeSimpleLedger = 245,
TWCoinTypeBravoCoin = 282,
TWCoinTypeCallisto = 820,
TWCoinTypeCosmos = 118,
TWCoinTypeDash = 5,
TWCoinTypeDecred = 42,
TWCoinTypeDigiByte = 20,
TWCoinTypeDogecoin = 3,
TWCoinTypeEllaism = 163,
TWCoinTypeEOS = 194,
TWCoinTypeEthereum = 60,
TWCoinTypeEthereumClassic = 61,
TWCoinTypeEthersocial = 31102,
TWCoinTypeFIO = 235,
TWCoinTypeGoChain = 6060,
TWCoinTypeGroestlcoin = 17,
TWCoinTypeICON = 74,
TWCoinTypeIOST = 291,
TWCoinTypeIoTeX = 304,
TWCoinTypeKin = 2017,
TWCoinTypeLitecoin = 2,
TWCoinTypeMonacoin = 22,
TWCoinTypeNebulas = 2718,
TWCoinTypeLux = 3003,
TWCoinTypeNano = 165,
TWCoinTypeNEO = 888,
TWCoinTypeNimiq = 242,
TWCoinTypeOntology = 1024,
TWCoinTypePOANetwork = 178,
TWCoinTypeQtum = 2301,
TWCoinTypeXRP = 144,
TWCoinTypeSteem = 135,
TWCoinTypeStellar = 148,
TWCoinTypeTezos = 1729,
TWCoinTypeTheta = 500,
TWCoinTypeThunderToken = 1001,
TWCoinTypeTomoChain = 889,
TWCoinTypeTron = 195,
TWCoinTypeVeChain = 818,
TWCoinTypeViacoin = 14,
TWCoinTypeWanchain = 5718350,
TWCoinTypeXDai = 700,
TWCoinTypeZcash = 133,
TWCoinTypeZcoin = 136,
TWCoinTypeZilliqa = 313,
TWCoinTypeSemux = 7562605,
TWCoinTypeDEXON = 237,
TWCoinTypeZelcash = 19167,
TWCoinTypeARK = 111,
TWCoinTypeRavencoin = 175,
TWCoinTypeWaves = 5741564,
TWCoinTypeTerra = 330,
TWCoinTypeSeele = 456,
TWCoinTypeFreeCash = 485,
};
/// Returns the blockchain for a coin type.
TW_EXPORT_PROPERTY
enum TWBlockchain TWCoinTypeBlockchain(enum TWCoinType coin);
/// Returns the purpose for a coin type.
TW_EXPORT_PROPERTY
enum TWPurpose TWCoinTypePurpose(enum TWCoinType coin);
/// Returns the curve that should be used for a coin type.
TW_EXPORT_PROPERTY
enum TWCurve TWCoinTypeCurve(enum TWCoinType coin);
/// Returns the xpub HD version that should be used for a coin type.
TW_EXPORT_PROPERTY
enum TWHDVersion TWCoinTypeXpubVersion(enum TWCoinType coin);
/// Returns the xprv HD version that should be used for a coin type.
TW_EXPORT_PROPERTY
enum TWHDVersion TWCoinTypeXprvVersion(enum TWCoinType coin);
/// Validates an address string.
TW_EXPORT_METHOD
bool TWCoinTypeValidate(enum TWCoinType coin, TWString *_Nonnull address);
/// Returns the default derivation path for a particular coin.
TW_EXPORT_METHOD
TWString *_Nonnull TWCoinTypeDerivationPath(enum TWCoinType coin);
/// Derives the address for a particular coin from the private key.
TW_EXPORT_METHOD
TWString *_Nonnull TWCoinTypeDeriveAddress(enum TWCoinType coin, struct TWPrivateKey *_Nonnull privateKey);
/// Derives the address for a particular coin from the public key.
TW_EXPORT_METHOD
TWString *_Nonnull TWCoinTypeDeriveAddressFromPublicKey(enum TWCoinType coin, struct TWPublicKey *_Nonnull publicKey);
/// HRP for this coin type
TW_EXPORT_PROPERTY
enum TWHRP TWCoinTypeHRP(enum TWCoinType coin);
/// P2PKH prefix for this coin type
TW_EXPORT_PROPERTY
uint8_t TWCoinTypeP2pkhPrefix(enum TWCoinType coin);
/// P2SH prefix for this coin type
TW_EXPORT_PROPERTY
uint8_t TWCoinTypeP2shPrefix(enum TWCoinType coin);
/// Static prefix for this coin type
TW_EXPORT_PROPERTY
uint8_t TWCoinTypeStaticPrefix(enum TWCoinType coin);
TW_EXTERN_C_END