Bitcoin Core 28.99.0
P2P Digital Currency
rawtransaction_util.h
Go to the documentation of this file.
1// Copyright (c) 2017-2022 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_RPC_RAWTRANSACTION_UTIL_H
6#define BITCOIN_RPC_RAWTRANSACTION_UTIL_H
7
8#include <addresstype.h>
9#include <consensus/amount.h>
10#include <map>
11#include <string>
12#include <optional>
13
14struct bilingual_str;
16class UniValue;
18class Coin;
19class COutPoint;
20class SigningProvider;
21
31void SignTransaction(CMutableTransaction& mtx, const SigningProvider* keystore, const std::map<COutPoint, Coin>& coins, const UniValue& hashType, UniValue& result);
32void SignTransactionResultToJSON(CMutableTransaction& mtx, bool complete, const std::map<COutPoint, Coin>& coins, const std::map<int, bilingual_str>& input_errors, UniValue& result);
33
41void ParsePrevouts(const UniValue& prevTxsUnival, FlatSigningProvider* keystore, std::map<COutPoint, Coin>& coins);
42
44void AddInputs(CMutableTransaction& rawTx, const UniValue& inputs_in, bool rbf);
45
47UniValue NormalizeOutputs(const UniValue& outputs_in);
48
50std::vector<std::pair<CTxDestination, CAmount>> ParseOutputs(const UniValue& outputs);
51
53void AddOutputs(CMutableTransaction& rawTx, const UniValue& outputs_in);
54
56CMutableTransaction ConstructTransaction(const UniValue& inputs_in, const UniValue& outputs_in, const UniValue& locktime, std::optional<bool> rbf);
57
58#endif // BITCOIN_RPC_RAWTRANSACTION_UTIL_H
An outpoint - a combination of a transaction hash and an index n into its vout.
Definition: transaction.h:29
A UTXO entry.
Definition: coins.h:33
An interface to be implemented by keystores that support signing.
void SignTransactionResultToJSON(CMutableTransaction &mtx, bool complete, const std::map< COutPoint, Coin > &coins, const std::map< int, bilingual_str > &input_errors, UniValue &result)
CMutableTransaction ConstructTransaction(const UniValue &inputs_in, const UniValue &outputs_in, const UniValue &locktime, std::optional< bool > rbf)
Create a transaction from univalue parameters.
void SignTransaction(CMutableTransaction &mtx, const SigningProvider *keystore, const std::map< COutPoint, Coin > &coins, const UniValue &hashType, UniValue &result)
Sign a transaction with the given keystore and previous transactions.
void AddOutputs(CMutableTransaction &rawTx, const UniValue &outputs_in)
Normalize, parse, and add outputs to the transaction.
std::vector< std::pair< CTxDestination, CAmount > > ParseOutputs(const UniValue &outputs)
Parse normalized outputs into destination, amount tuples.
void AddInputs(CMutableTransaction &rawTx, const UniValue &inputs_in, bool rbf)
Normalize univalue-represented inputs and add them to the transaction.
UniValue NormalizeOutputs(const UniValue &outputs_in)
Normalize univalue-represented outputs.
void ParsePrevouts(const UniValue &prevTxsUnival, FlatSigningProvider *keystore, std::map< COutPoint, Coin > &coins)
Parse a prevtxs UniValue array and get the map of coins from it.
A mutable version of CTransaction.
Definition: transaction.h:378
Bilingual messages:
Definition: translation.h:21