Bitcoin Core  24.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 <map>
9 #include <string>
10 #include <optional>
11 
12 struct bilingual_str;
14 class UniValue;
15 struct CMutableTransaction;
16 class Coin;
17 class COutPoint;
18 class SigningProvider;
19 
29 void SignTransaction(CMutableTransaction& mtx, const SigningProvider* keystore, const std::map<COutPoint, Coin>& coins, const UniValue& hashType, UniValue& result);
30 void SignTransactionResultToJSON(CMutableTransaction& mtx, bool complete, const std::map<COutPoint, Coin>& coins, const std::map<int, bilingual_str>& input_errors, UniValue& result);
31 
39 void ParsePrevouts(const UniValue& prevTxsUnival, FillableSigningProvider* keystore, std::map<COutPoint, Coin>& coins);
40 
41 
43 void AddInputs(CMutableTransaction& rawTx, const UniValue& inputs_in, bool rbf);
44 
46 void AddOutputs(CMutableTransaction& rawTx, const UniValue& outputs_in);
47 
49 CMutableTransaction ConstructTransaction(const UniValue& inputs_in, const UniValue& outputs_in, const UniValue& locktime, std::optional<bool> rbf);
50 
51 #endif // BITCOIN_RPC_RAWTRANSACTION_UTIL_H
An outpoint - a combination of a transaction hash and an index n into its vout.
Definition: transaction.h:36
A UTXO entry.
Definition: coins.h:31
Fillable signing provider that keeps keys in an address->secret map.
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 univalue-represented outputs and add them to the transaction.
void ParsePrevouts(const UniValue &prevTxsUnival, FillableSigningProvider *keystore, std::map< COutPoint, Coin > &coins)
Parse a prevtxs UniValue array and get the map of coins from it.
void AddInputs(CMutableTransaction &rawTx, const UniValue &inputs_in, bool rbf)
Normalize univalue-represented inputs and add them to the transaction.
A mutable version of CTransaction.
Definition: transaction.h:380
Bilingual messages:
Definition: translation.h:18