ledger-core
Public Member Functions | List of all members
ledger::core::api::BitcoinLikeTransaction Class Referenceabstract

#include <BitcoinLikeTransaction.hpp>

+ Inheritance diagram for ledger::core::api::BitcoinLikeTransaction:

Public Member Functions

virtual std::string getHash ()=0
 
virtual std::vector< std::shared_ptr< BitcoinLikeInput > > getInputs ()=0
 
virtual std::vector< std::shared_ptr< BitcoinLikeOutput > > getOutputs ()=0
 
virtual std::shared_ptr< BitcoinLikeBlockgetBlock ()=0
 
virtual int64_t getLockTime ()=0
 
virtual std::shared_ptr< AmountgetFees ()=0
 
virtual std::chrono::system_clock::time_point getTime ()=0
 
virtual std::experimental::optional< int32_t > getTimestamp ()=0
 
virtual int32_t getVersion ()=0
 
virtual std::vector< uint8_t > serialize ()=0
 
virtual std::vector< uint8_t > serializeOutputs ()=0
 
virtual std::experimental::optional< std::vector< uint8_t > > getWitness ()=0
 
virtual EstimatedSize getEstimatedSize ()=0
 
virtual BitcoinLikeSignatureState setSignatures (const std::vector< BitcoinLikeSignature > &signatures, bool override)=0
 
virtual BitcoinLikeSignatureState setDERSignatures (const std::vector< std::vector< uint8_t >> &signatures, bool override)=0
 

Detailed Description

Class representing a Bitcoin transaction.

Member Function Documentation

◆ getBlock()

virtual std::shared_ptr<BitcoinLikeBlock> ledger::core::api::BitcoinLikeTransaction::getBlock ( )
pure virtual

Get the block in which the transaction is inserted if the transaction is confirmed.

Implemented in ledger::core::BitcoinLikeTransactionApi.

◆ getEstimatedSize()

virtual EstimatedSize ledger::core::api::BitcoinLikeTransaction::getEstimatedSize ( )
pure virtual

Estimate the size of the raw transaction in bytes. This method returns a minimum estimated size and a maximum estimated size.

Implemented in ledger::core::BitcoinLikeTransactionApi.

◆ getFees()

virtual std::shared_ptr<Amount> ledger::core::api::BitcoinLikeTransaction::getFees ( )
pure virtual

Get the amount of fees of the transaction.

Implemented in ledger::core::BitcoinLikeTransactionApi.

◆ getHash()

virtual std::string ledger::core::api::BitcoinLikeTransaction::getHash ( )
pure virtual

Get the hash of the transaction.

Implemented in ledger::core::BitcoinLikeTransactionApi.

◆ getInputs()

virtual std::vector<std::shared_ptr<BitcoinLikeInput> > ledger::core::api::BitcoinLikeTransaction::getInputs ( )
pure virtual

Get the input of the transaction.

Implemented in ledger::core::BitcoinLikeTransactionApi.

◆ getLockTime()

virtual int64_t ledger::core::api::BitcoinLikeTransaction::getLockTime ( )
pure virtual

Get the lock time of the transaction.

Implemented in ledger::core::BitcoinLikeTransactionApi.

◆ getOutputs()

virtual std::vector<std::shared_ptr<BitcoinLikeOutput> > ledger::core::api::BitcoinLikeTransaction::getOutputs ( )
pure virtual

Get the output of the transaction.

Implemented in ledger::core::BitcoinLikeTransactionApi.

◆ getTime()

virtual std::chrono::system_clock::time_point ledger::core::api::BitcoinLikeTransaction::getTime ( )
pure virtual

Get the time when the transaction was issued or the time of the block including this transaction.

Implemented in ledger::core::BitcoinLikeTransactionApi.

◆ getTimestamp()

virtual std::experimental::optional<int32_t> ledger::core::api::BitcoinLikeTransaction::getTimestamp ( )
pure virtual

Get the timestamps serialized in the raw transaction if the underlying currency handles it.

Implemented in ledger::core::BitcoinLikeTransactionApi.

◆ getVersion()

virtual int32_t ledger::core::api::BitcoinLikeTransaction::getVersion ( )
pure virtual

Get Transaction version.

Implemented in ledger::core::BitcoinLikeTransactionApi.

◆ getWitness()

virtual std::experimental::optional<std::vector<uint8_t> > ledger::core::api::BitcoinLikeTransaction::getWitness ( )
pure virtual

Get the witness if the underlying transaction is a segwit transaction.

Implemented in ledger::core::BitcoinLikeTransactionApi.

◆ serialize()

virtual std::vector<uint8_t> ledger::core::api::BitcoinLikeTransaction::serialize ( )
pure virtual

Serialize the transaction to its raw format.

Implemented in ledger::core::BitcoinLikeTransactionApi.

◆ serializeOutputs()

virtual std::vector<uint8_t> ledger::core::api::BitcoinLikeTransaction::serializeOutputs ( )
pure virtual

Serialize outputs of the raw transaction into a byte array using the bitcoin transaction format.

Implemented in ledger::core::BitcoinLikeTransactionApi.

◆ setDERSignatures()

virtual BitcoinLikeSignatureState ledger::core::api::BitcoinLikeTransaction::setDERSignatures ( const std::vector< std::vector< uint8_t >> &  signatures,
bool  override 
)
pure virtual

Sign all inputs for given transaction.

Returns
SIGNING_SUCCEED if succeed case else refers to BitcoinLikeSignatureState enumeration

Implemented in ledger::core::BitcoinLikeTransactionApi.

◆ setSignatures()

virtual BitcoinLikeSignatureState ledger::core::api::BitcoinLikeTransaction::setSignatures ( const std::vector< BitcoinLikeSignature > &  signatures,
bool  override 
)
pure virtual

Sign all inputs for given transaction. Build DER encoded signature from RSV data.

Returns
SIGNING_SUCCEED if succeed case else refers to BitcoinLikeSignatureState enumeration

The documentation for this class was generated from the following file: