2018-01-02 14:12:05 -03:00
|
|
|
// Copyright (c) 2009-2017 The Bitcoin Core developers
|
2014-12-13 01:09:33 -03:00
|
|
|
// Distributed under the MIT software license, see the accompanying
|
2014-08-01 02:39:06 -04:00
|
|
|
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
|
|
|
|
2014-11-03 12:16:40 -03:00
|
|
|
#ifndef BITCOIN_CORE_IO_H
|
|
|
|
#define BITCOIN_CORE_IO_H
|
2014-06-23 23:10:24 -04:00
|
|
|
|
2017-11-09 21:57:53 -03:00
|
|
|
#include <amount.h>
|
2017-08-07 08:38:39 -04:00
|
|
|
|
2014-06-23 23:10:24 -04:00
|
|
|
#include <string>
|
2014-08-01 02:32:41 -04:00
|
|
|
#include <vector>
|
2014-06-23 23:10:24 -04:00
|
|
|
|
2014-10-29 23:56:33 -03:00
|
|
|
class CBlock;
|
2014-06-23 23:16:33 -04:00
|
|
|
class CScript;
|
2014-06-23 23:10:24 -04:00
|
|
|
class CTransaction;
|
2016-12-05 07:13:17 -03:00
|
|
|
struct CMutableTransaction;
|
2018-06-28 22:04:40 -04:00
|
|
|
struct PartiallySignedTransaction;
|
2014-09-14 07:43:56 -03:00
|
|
|
class uint256;
|
2014-07-29 11:12:44 -04:00
|
|
|
class UniValue;
|
2014-06-23 23:10:24 -04:00
|
|
|
|
|
|
|
// core_read.cpp
|
2016-11-29 22:27:21 -03:00
|
|
|
CScript ParseScript(const std::string& s);
|
|
|
|
std::string ScriptToAsmStr(const CScript& script, const bool fAttemptSighashDecode = false);
|
2017-08-28 03:00:21 -03:00
|
|
|
bool DecodeHexTx(CMutableTransaction& tx, const std::string& hex_tx, bool try_no_witness = false, bool try_witness = true);
|
2016-11-29 22:27:21 -03:00
|
|
|
bool DecodeHexBlk(CBlock&, const std::string& strHexBlk);
|
|
|
|
uint256 ParseHashStr(const std::string&, const std::string& strName);
|
|
|
|
std::vector<unsigned char> ParseHexUV(const UniValue& v, const std::string& strName);
|
2018-06-28 22:04:40 -04:00
|
|
|
bool DecodePSBT(PartiallySignedTransaction& psbt, const std::string& base64_tx, std::string& error);
|
2014-06-23 23:10:24 -04:00
|
|
|
|
|
|
|
// core_write.cpp
|
2017-08-07 08:38:39 -04:00
|
|
|
UniValue ValueFromAmount(const CAmount& amount);
|
2016-11-29 22:27:21 -03:00
|
|
|
std::string FormatScript(const CScript& script);
|
2016-11-20 11:54:51 -03:00
|
|
|
std::string EncodeHexTx(const CTransaction& tx, const int serializeFlags = 0);
|
2018-06-28 22:04:40 -04:00
|
|
|
std::string SighashToStr(unsigned char sighash_type);
|
2016-11-29 22:27:21 -03:00
|
|
|
void ScriptPubKeyToUniv(const CScript& scriptPubKey, UniValue& out, bool fIncludeHex);
|
2018-06-28 22:04:40 -04:00
|
|
|
void ScriptToUniv(const CScript& script, UniValue& out, bool include_address);
|
2017-08-11 15:21:14 -04:00
|
|
|
void TxToUniv(const CTransaction& tx, const uint256& hashBlock, UniValue& entry, bool include_hex = true, int serialize_flags = 0);
|
2014-06-23 23:10:24 -04:00
|
|
|
|
2014-11-03 12:16:40 -03:00
|
|
|
#endif // BITCOIN_CORE_IO_H
|