]>
Commit | Line | Data |
---|---|---|
3d31e09c PW |
1 | // Copyright (c) 2009-2010 Satoshi Nakamoto |
2 | // Copyright (c) 2009-2015 The Bitcoin Core developers | |
3 | // Copyright (c) 2016-2018 The Zcash developers | |
4 | // Distributed under the MIT software license, see the accompanying | |
bc909a7a | 5 | // file COPYING or https://www.opensource.org/licenses/mit-license.php . |
3d31e09c PW |
6 | |
7 | #ifndef BITCOIN_KEYIO_H | |
8 | #define BITCOIN_KEYIO_H | |
9 | ||
10 | #include <chainparams.h> | |
11 | #include <key.h> | |
12 | #include <pubkey.h> | |
3d31e09c | 13 | #include <zcash/Address.hpp> |
70b4ad2d | 14 | #include <zcash/zip32.h> |
3d31e09c PW |
15 | |
16 | #include <string> | |
17 | ||
6e62f837 | 18 | extern CIdentityID VERUS_DEFAULTID; |
19 | extern bool VERUS_PRIVATECHANGE; | |
20 | extern std::string VERUS_DEFAULT_ZADDR; | |
21 | ||
56fe75cb | 22 | std::string TrimLeading(const std::string &Name, unsigned char ch); |
23 | std::string TrimTrailing(const std::string &Name, unsigned char ch); | |
24 | std::string TrimSpaces(const std::string &Name); | |
25 | ||
3d31e09c PW |
26 | CKey DecodeSecret(const std::string& str); |
27 | std::string EncodeSecret(const CKey& key); | |
28 | ||
29 | CExtKey DecodeExtKey(const std::string& str); | |
30 | std::string EncodeExtKey(const CExtKey& extkey); | |
31 | CExtPubKey DecodeExtPubKey(const std::string& str); | |
32 | std::string EncodeExtPubKey(const CExtPubKey& extpubkey); | |
33 | ||
34 | std::string EncodeDestination(const CTxDestination& dest); | |
b2a98c42 MT |
35 | std::vector<unsigned char> GetDestinationBytes(const CTxDestination& dest); |
36 | uint160 GetDestinationID(const CTxDestination dest); | |
3d31e09c PW |
37 | CTxDestination DecodeDestination(const std::string& str); |
38 | bool IsValidDestinationString(const std::string& str); | |
39 | bool IsValidDestinationString(const std::string& str, const CChainParams& params); | |
40 | ||
41 | std::string EncodePaymentAddress(const libzcash::PaymentAddress& zaddr); | |
e5eab182 | 42 | libzcash::PaymentAddress DecodePaymentAddress(const std::string& str); |
5f63373e | 43 | bool IsValidPaymentAddressString(const std::string& str, uint32_t consensusBranchId); |
3d31e09c PW |
44 | |
45 | std::string EncodeViewingKey(const libzcash::ViewingKey& vk); | |
e5eab182 | 46 | libzcash::ViewingKey DecodeViewingKey(const std::string& str); |
3d31e09c PW |
47 | |
48 | std::string EncodeSpendingKey(const libzcash::SpendingKey& zkey); | |
e5eab182 | 49 | libzcash::SpendingKey DecodeSpendingKey(const std::string& str); |
3d31e09c PW |
50 | |
51 | #endif // BITCOIN_KEYIO_H |