Changeset View
Changeset View
Standalone View
Standalone View
src/core_io.h
Show All 11 Lines | |||||
#include <vector> | #include <vector> | ||||
struct Amount; | struct Amount; | ||||
class CBlock; | class CBlock; | ||||
class CBlockHeader; | class CBlockHeader; | ||||
class CMutableTransaction; | class CMutableTransaction; | ||||
class CScript; | class CScript; | ||||
class CTransaction; | class CTransaction; | ||||
struct PartiallySignedTransaction; | |||||
class uint256; | class uint256; | ||||
class UniValue; | class UniValue; | ||||
// core_read.cpp | // core_read.cpp | ||||
CScript ParseScript(const std::string &s); | CScript ParseScript(const std::string &s); | ||||
std::string ScriptToAsmStr(const CScript &script, | std::string ScriptToAsmStr(const CScript &script, | ||||
const bool fAttemptSighashDecode = false); | const bool fAttemptSighashDecode = false); | ||||
NODISCARD bool DecodeHexTx(CMutableTransaction &tx, | NODISCARD bool DecodeHexTx(CMutableTransaction &tx, | ||||
const std::string &strHexTx); | const std::string &strHexTx); | ||||
NODISCARD bool DecodeHexBlk(CBlock &, const std::string &strHexBlk); | NODISCARD bool DecodeHexBlk(CBlock &, const std::string &strHexBlk); | ||||
bool DecodeHexBlockHeader(CBlockHeader &, const std::string &hex_header); | bool DecodeHexBlockHeader(CBlockHeader &, const std::string &hex_header); | ||||
/** | /** | ||||
* Parse a hex string into 256 bits | * Parse a hex string into 256 bits | ||||
* @param[in] strHex a hex-formatted, 64-character string | * @param[in] strHex a hex-formatted, 64-character string | ||||
* @param[out] result the result of the parasing | * @param[out] result the result of the parasing | ||||
* @returns true if successful, false if not | * @returns true if successful, false if not | ||||
* | * | ||||
* @see ParseHashV for an RPC-oriented version of this | * @see ParseHashV for an RPC-oriented version of this | ||||
*/ | */ | ||||
bool ParseHashStr(const std::string &strHex, uint256 &result); | bool ParseHashStr(const std::string &strHex, uint256 &result); | ||||
std::vector<uint8_t> ParseHexUV(const UniValue &v, const std::string &strName); | std::vector<uint8_t> ParseHexUV(const UniValue &v, const std::string &strName); | ||||
//! Decode a base64ed PSBT into a PartiallySignedTransaction | |||||
NODISCARD bool DecodeBase64PSBT(PartiallySignedTransaction &decoded_psbt, | |||||
const std::string &base64_psbt, | |||||
std::string &error); | |||||
//! Decode a raw (binary blob) PSBT into a PartiallySignedTransaction | |||||
NODISCARD bool DecodeRawPSBT(PartiallySignedTransaction &decoded_psbt, | |||||
const std::string &raw_psbt, std::string &error); | |||||
SigHashType ParseSighashString(const UniValue &sighash); | SigHashType ParseSighashString(const UniValue &sighash); | ||||
// core_write.cpp | // core_write.cpp | ||||
UniValue ValueFromAmount(const Amount &amount); | UniValue ValueFromAmount(const Amount &amount); | ||||
std::string FormatScript(const CScript &script); | std::string FormatScript(const CScript &script); | ||||
std::string EncodeHexTx(const CTransaction &tx, const int serializeFlags = 0); | std::string EncodeHexTx(const CTransaction &tx, const int serializeFlags = 0); | ||||
std::string SighashToStr(uint8_t sighash_type); | std::string SighashToStr(uint8_t sighash_type); | ||||
void ScriptPubKeyToUniv(const CScript &scriptPubKey, UniValue &out, | void ScriptPubKeyToUniv(const CScript &scriptPubKey, UniValue &out, | ||||
bool fIncludeHex); | bool fIncludeHex); | ||||
void ScriptToUniv(const CScript &script, UniValue &out, bool include_address); | void ScriptToUniv(const CScript &script, UniValue &out, bool include_address); | ||||
void TxToUniv(const CTransaction &tx, const uint256 &hashBlock, UniValue &entry, | void TxToUniv(const CTransaction &tx, const uint256 &hashBlock, UniValue &entry, | ||||
bool include_hex = true, int serialize_flags = 0); | bool include_hex = true, int serialize_flags = 0); | ||||
#endif // BITCOIN_CORE_IO_H | #endif // BITCOIN_CORE_IO_H |