Changeset View
Changeset View
Standalone View
Standalone View
src/base58.h
Show All 11 Lines | |||||
* - E-mail usually won't line-break if there's no punctuation to break at. | * - E-mail usually won't line-break if there's no punctuation to break at. | ||||
* - Double-clicking selects the whole string as one word if it's all | * - Double-clicking selects the whole string as one word if it's all | ||||
* alphanumeric. | * alphanumeric. | ||||
*/ | */ | ||||
#ifndef BITCOIN_BASE58_H | #ifndef BITCOIN_BASE58_H | ||||
#define BITCOIN_BASE58_H | #define BITCOIN_BASE58_H | ||||
#include "chainparams.h" | #include "chainparams.h" | ||||
// key.h and pubkey.h are not used here, but gcc doesn't want to instantiate | |||||
// CTxDestination if types are unknown | |||||
#include "key.h" | #include "key.h" | ||||
#include "pubkey.h" | #include "pubkey.h" | ||||
#include "script/standard.h" | #include "script/standard.h" | ||||
#include "support/allocators/zeroafterfree.h" | #include "support/allocators/zeroafterfree.h" | ||||
#include <string> | #include <string> | ||||
#include <vector> | #include <vector> | ||||
/** | /** | ||||
* Encode a byte sequence as a base58-encoded string. | * Encode a byte sequence as a base58-encoded string. | ||||
* pbegin and pend cannot be nullptr, unless both are. | * pbegin and pend cannot be nullptr, unless both are. | ||||
*/ | */ | ||||
std::string EncodeBase58(const uint8_t *pbegin, const uint8_t *pend); | std::string EncodeBase58(const uint8_t *pbegin, const uint8_t *pend); | ||||
▲ Show 20 Lines • Show All 117 Lines • ▼ Show 20 Lines | |||||
typedef CBitcoinExtKeyBase<CExtKey, BIP32_EXTKEY_SIZE, | typedef CBitcoinExtKeyBase<CExtKey, BIP32_EXTKEY_SIZE, | ||||
CChainParams::EXT_SECRET_KEY> | CChainParams::EXT_SECRET_KEY> | ||||
CBitcoinExtKey; | CBitcoinExtKey; | ||||
typedef CBitcoinExtKeyBase<CExtPubKey, BIP32_EXTKEY_SIZE, | typedef CBitcoinExtKeyBase<CExtPubKey, BIP32_EXTKEY_SIZE, | ||||
CChainParams::EXT_PUBLIC_KEY> | CChainParams::EXT_PUBLIC_KEY> | ||||
CBitcoinExtPubKey; | CBitcoinExtPubKey; | ||||
std::string EncodeDestination(const CTxDestination &dest); | std::string EncodeLegacyAddr(const CTxDestination &dest, const CChainParams &); | ||||
CTxDestination DecodeDestination(const std::string &str); | CTxDestination DecodeLegacyAddr(const std::string &str, const CChainParams &); | ||||
bool IsValidDestinationString(const std::string &str); | |||||
bool IsValidDestinationString(const std::string &str, | |||||
const CChainParams ¶ms); | |||||
#endif // BITCOIN_BASE58_H | #endif // BITCOIN_BASE58_H |