31 #ifndef LEDGER_CORE_BITCOINLIKEADDRESS_HPP 32 #define LEDGER_CORE_BITCOINLIKEADDRESS_HPP 34 #include "../api/BitcoinLikeAddress.hpp" 35 #include "../api/BitcoinLikeNetworkParameters.hpp" 36 #include "../utils/optional.hpp" 37 #include <wallet/common/AbstractAddress.h> 38 #include <api/BitcoinLikeExtendedPublicKey.hpp> 39 #include <collections/DynamicObject.hpp> 45 const std::vector<uint8_t>& hash160,
46 const std::string &keychainEngine,
48 virtual std::vector<uint8_t>
getVersion()
override;
49 std::vector<uint8_t> getVersionFromKeychainEngine(
const std::string &keychainEngine,
51 virtual std::vector<uint8_t>
getHash160()
override;
53 virtual std::string
toBase58()
override;
54 virtual std::string
toBech32()
override;
57 virtual bool isP2SH()
override;
58 virtual bool isP2PKH()
override;
59 virtual bool isP2WSH()
override;
64 std::string getStringAddress()
const;
66 static std::shared_ptr<AbstractAddress> parse(
const std::string& address,
const api::Currency& currency,
68 static std::shared_ptr<BitcoinLikeAddress> fromBase58(
const std::string& address,
72 static std::shared_ptr<BitcoinLikeAddress> fromBech32(
const std::string& address,
76 static std::string fromPublicKey(
const std::shared_ptr<api::BitcoinLikeExtendedPublicKey> &pubKey,
78 const std::string &derivationPath,
79 const std::string &keychainEngine);
81 static std::vector<uint8_t> fromPublicKeyToHash160(
const std::vector<uint8_t> &pubKey,
82 const std::vector<uint8_t> &pubKeyHash160,
84 const std::string &keychainEngine);
86 static std::vector<uint8_t> fromPublicKeyToHash160(
const std::vector<uint8_t> &pubKey,
88 const std::string &keychainEngine);
92 const std::vector<uint8_t> _hash160;
95 const std::string _keychainEngine;
101 #endif //LEDGER_CORE_BITCOINLIKEADDRESS_HPP virtual std::string toBech32() override
Definition: BitcoinLikeAddress.cpp:105
virtual optional< std::string > getDerivationPath() override
Definition: BitcoinLikeAddress.cpp:125
virtual bool isP2SH() override
Definition: BitcoinLikeAddress.cpp:109
virtual std::string toBase58() override
Definition: BitcoinLikeAddress.cpp:90
virtual std::vector< uint8_t > getVersion() override
Definition: BitcoinLikeAddress.cpp:61
virtual bool isP2PKH() override
Definition: BitcoinLikeAddress.cpp:113
Definition: AbstractAddress.h:42
virtual bool isP2WSH() override
Definition: BitcoinLikeAddress.cpp:117
virtual std::vector< uint8_t > getHash160() override
Definition: BitcoinLikeAddress.cpp:82
virtual api::BitcoinLikeNetworkParameters getNetworkParameters() override
Definition: BitcoinLikeAddress.cpp:86
Definition: Currency.hpp:23
Definition: Account.cpp:8
Definition: BitcoinLikeAddress.hpp:42
std::string toString() override
Definition: BitcoinLikeAddress.cpp:154
virtual bool isP2WPKH() override
Definition: BitcoinLikeAddress.cpp:121
Definition: BitcoinLikeAddress.hpp:23
Definition: optional.hpp:177
Definition: BitcoinLikeNetworkParameters.hpp:17