Bitcoin Core 32.1.0
P2P Digital Currency
Loading...
Searching...
No Matches
core_io.h
Go to the documentation of this file.
1// Copyright (c) 2009-present 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.
4
5#ifndef BITCOIN_CORE_IO_H
6#define BITCOIN_CORE_IO_H
7
8#include <consensus/amount.h>
9#include <util/result.h>
10
11#include <cstdint>
12#include <functional>
13#include <string>
14
15class CBlock;
16class CBlockHeader;
17class CScript;
18class CTransaction;
20class SigningProvider;
21class uint256;
22class UniValue;
23class CTxUndo;
24class CTxOut;
25
34
35CScript ParseScript(const std::string& s);
36std::string ScriptToAsmStr(const CScript& script, bool fAttemptSighashDecode = false);
37[[nodiscard]] bool DecodeHexTx(CMutableTransaction& tx, const std::string& hex_tx, bool try_no_witness = false, bool try_witness = true);
38[[nodiscard]] bool DecodeHexBlk(CBlock&, const std::string& strHexBlk);
39bool DecodeHexBlockHeader(CBlockHeader&, const std::string& hex_header);
40
41[[nodiscard]] util::Result<int> SighashFromStr(const std::string& sighash);
42
44std::string FormatScript(const CScript& script);
45std::string EncodeHexTx(const CTransaction& tx);
46std::string SighashToStr(int32_t sighash_type);
47void ScriptToUniv(const CScript& script, UniValue& out, bool include_hex = true, bool include_address = false, const SigningProvider* provider = nullptr);
48void TxToUniv(const CTransaction& tx, const uint256& block_hash, UniValue& entry, bool include_hex = true, const CTxUndo* txundo = nullptr, TxVerbosity verbosity = TxVerbosity::SHOW_DETAILS, std::function<bool(const CTxOut&)> is_change_func = {});
49
50#endif // BITCOIN_CORE_IO_H
int64_t CAmount
Amount in satoshis (Can be negative).
Definition amount.h:12
Nodes collect new transactions into a block, hash them into a hash tree, and scan through nonce value...
Definition block.h:27
Definition block.h:74
Serialized script, used inside transaction inputs and outputs.
Definition script.h:406
The basic transaction that is broadcasted on the network and contained in blocks.
An output of a transaction.
Undo information for a CTransaction.
Definition undo.h:54
An interface to be implemented by keystores that support signing.
256-bit opaque blob.
Definition uint256.h:196
std::string EncodeHexTx(const CTransaction &tx)
Definition core_io.cpp:404
CScript ParseScript(const std::string &s)
Definition core_io.cpp:92
std::string FormatScript(const CScript &script)
Definition core_io.cpp:296
bool DecodeHexTx(CMutableTransaction &tx, const std::string &hex_tx, bool try_no_witness, bool try_witness)
Definition core_io.cpp:225
void ScriptToUniv(const CScript &script, UniValue &out, bool include_hex, bool include_address, const SigningProvider *provider)
Definition core_io.cpp:411
bool DecodeHexBlockHeader(CBlockHeader &header, const std::string &hex_header)
Definition core_io.cpp:235
util::Result< int > SighashFromStr(const std::string &sighash)
Definition core_io.cpp:264
std::string SighashToStr(int32_t sighash_type)
Definition core_io.cpp:341
void TxToUniv(const CTransaction &tx, const uint256 &block_hash, UniValue &entry, bool include_hex, const CTxUndo *txundo, TxVerbosity verbosity, std::function< bool(const CTxOut &)> is_change_func)
Definition core_io.cpp:432
std::string ScriptToAsmStr(const CScript &script, const bool fAttemptSighashDecode)
Create the assembly string representation of a CScript object.
Definition core_io.cpp:359
bool DecodeHexBlk(CBlock &block, const std::string &strHexBlk)
Definition core_io.cpp:248
UniValue ValueFromAmount(const CAmount amount)
Definition core_io.cpp:283
TxVerbosity
Verbose level for block's transaction.
Definition core_io.h:29
@ SHOW_DETAILS_AND_PREVOUT
The same as previous option with information about prevouts if available.
Definition core_io.h:32
@ SHOW_TXID
Only TXID for each block's transaction.
Definition core_io.h:30
@ SHOW_DETAILS
Include TXID, inputs, outputs, and other common block's transaction information.
Definition core_io.h:31
A mutable version of CTransaction.
FuzzedDataProvider provider