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
#include <TrustWalletCore/TWCoinType.h>
8
#include <TrustWalletCore/TWHRP.h>
9

10
#include "../Coin.h"
11

12 1
enum TWBlockchain TWCoinTypeBlockchain(enum TWCoinType coin) {
13 1
    return TW::blockchain(coin);
14
}
15

16 0
enum TWPurpose TWCoinTypePurpose(enum TWCoinType coin) {
17 0
    return TW::purpose(coin);
18
}
19

20 1
enum TWCurve TWCoinTypeCurve(enum TWCoinType coin) {
21 1
    return TW::curve(coin);
22
}
23

24 0
enum TWHDVersion TWCoinTypeXpubVersion(enum TWCoinType coin) {
25 0
    return TW::xpubVersion(coin);
26
}
27

28 0
enum TWHDVersion TWCoinTypeXprvVersion(enum TWCoinType coin) {
29 0
    return TW::xprvVersion(coin);
30
}
31

32 0
bool TWCoinTypeValidate(enum TWCoinType coin, TWString *_Nonnull address) {
33 0
    return TW::validateAddress(coin, *reinterpret_cast<const std::string*>(address));
34
}
35

36 1
TWString *_Nonnull TWCoinTypeDerivationPath(enum TWCoinType coin) {
37 1
    const auto path = TW::derivationPath(coin);
38 1
    const auto string = path.string();
39 1
    return TWStringCreateWithUTF8Bytes(string.c_str());
40
}
41

42 1
TWString *_Nonnull TWCoinTypeDeriveAddress(enum TWCoinType coin, struct TWPrivateKey *_Nonnull privateKey) {
43 1
    const auto string = TW::deriveAddress(coin, privateKey->impl);
44 1
    return TWStringCreateWithUTF8Bytes(string.c_str());
45
}
46

47 1
TWString *_Nonnull TWCoinTypeDeriveAddressFromPublicKey(enum TWCoinType coin, struct TWPublicKey *_Nonnull publicKey) {
48 1
    const auto string = TW::deriveAddress(coin, publicKey->impl);
49 1
    return TWStringCreateWithUTF8Bytes(string.c_str());
50
}
51

52 1
enum TWHRP TWCoinTypeHRP(enum TWCoinType coin) {
53 1
    return TW::hrp(coin);
54
}
55

56 1
uint8_t TWCoinTypeP2pkhPrefix(enum TWCoinType coin) {
57 1
    return TW::p2pkhPrefix(coin);
58
}
59

60 1
uint8_t TWCoinTypeP2shPrefix(enum TWCoinType coin) {
61 1
    return TW::p2shPrefix(coin);
62
}
63

64 1
uint8_t TWCoinTypeStaticPrefix(enum TWCoinType coin) {
65 1
    return TW::staticPrefix(coin);
66
}
67

68 1
uint32_t TWCoinTypeSlip44Id(enum TWCoinType coin) {
69 1
    return TW::slip44Id(coin);
70
}

Read our documentation on viewing source code .

Loading