1 // Copyright (c) 2009-2017 The Bitcoin Core developers
2 // Distributed under the MIT software license, see the accompanying
3 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
5 #ifndef BITCOIN_CORE_IO_H
6 #define BITCOIN_CORE_IO_H
16 struct CMutableTransaction
;
21 CScript
ParseScript(const std::string
& s
);
22 std::string
ScriptToAsmStr(const CScript
& script
, const bool fAttemptSighashDecode
= false);
23 bool DecodeHexTx(CMutableTransaction
& tx
, const std::string
& hex_tx
, bool try_no_witness
= false, bool try_witness
= true);
24 bool DecodeHexBlk(CBlock
&, const std::string
& strHexBlk
);
25 uint256
ParseHashUV(const UniValue
& v
, const std::string
& strName
);
26 uint256
ParseHashStr(const std::string
&, const std::string
& strName
);
27 std::vector
<unsigned char> ParseHexUV(const UniValue
& v
, const std::string
& strName
);
30 UniValue
ValueFromAmount(const CAmount
& amount
);
31 std::string
FormatScript(const CScript
& script
);
32 std::string
EncodeHexTx(const CTransaction
& tx
, const int serializeFlags
= 0);
33 void ScriptPubKeyToUniv(const CScript
& scriptPubKey
, UniValue
& out
, bool fIncludeHex
);
34 void TxToUniv(const CTransaction
& tx
, const uint256
& hashBlock
, UniValue
& entry
, bool include_hex
= true, int serialize_flags
= 0);
36 #endif // BITCOIN_CORE_IO_H