Equity
Bitcoin Protocol Library
|
A Bitcoin transaction. More...
#include <Transaction.h>
Classes | |
struct | Input |
A transaction input. More... | |
struct | Output |
A transaction output. More... | |
Public Types | |
enum | Type { TYPE_PayToPubkeyHash, TYPE_PayToScriptHash, TYPE_OpReturn, TYPE_Other } |
The types of transactions. All but TYPE_Other are considered "standard". | |
typedef std::vector< Input > | InputList |
A list of transactions inputs. | |
typedef std::vector< Output > | OutputList |
A list of outputs. | |
Public Member Functions | |
Transaction (int version, InputList const &inputs, OutputList const &outputs, uint32_t lockTime) | |
Transaction (std::string const &json) | |
Transaction (uint8_t const *&in, size_t &size) | |
uint32_t | version () const |
Returns the version. | |
InputList | inputs () const |
Returns the transaction's inputs. | |
OutputList | outputs () const |
Returns the transaction's outputs. | |
uint32_t | lockTime () const |
Returns the locktime value. | |
bool | valid () const |
Returns true if the transaction is well-formed. | |
Overrides Serializable | |
virtual void | serialize (std::vector< uint8_t > &out) const override |
virtual json | toJson () const override |
A Bitcoin transaction.
A Bitcoin transaction moves bitcoins from outputs of other transactions to new outputs.
Transaction::Transaction | ( | int | version, |
InputList const & | inputs, | ||
OutputList const & | outputs, | ||
uint32_t | lockTime | ||
) |
version | version |
inputs | list of inputs |
outputs | list of outputs |
lockTime | locktime value |
Transaction::Transaction | ( | std::string const & | json | ) |
json | transaction in JSON form |
Transaction::Transaction | ( | uint8_t const *& | in, |
size_t & | size | ||
) |
[in,out] | in | pointer to the next byte to deserialize |
[in,out] | size | number of bytes remaining in the serialized stream |