ledger-core
Public Member Functions | Static Public Member Functions | List of all members
ledger::core::BitcoinLikeTransactionApi Class Reference
+ Inheritance diagram for ledger::core::BitcoinLikeTransactionApi:
+ Collaboration diagram for ledger::core::BitcoinLikeTransactionApi:

Public Member Functions

 BitcoinLikeTransactionApi (const api::Currency &currency, const std::string &keychainEngine=api::KeychainEngines::BIP32_P2PKH, uint64_t currentBlockHeight=0)
 
 BitcoinLikeTransactionApi (const std::shared_ptr< OperationApi > &operation)
 
std::vector< std::shared_ptr< api::BitcoinLikeInput > > getInputs () override
 
std::vector< std::shared_ptr< api::BitcoinLikeOutput > > getOutputs () override
 
std::shared_ptr< api::BitcoinLikeBlockgetBlock () override
 
int64_t getLockTime () override
 
std::shared_ptr< api::AmountgetFees () override
 
std::string getHash () override
 
std::chrono::system_clock::time_point getTime () override
 
optional< int32_t > getTimestamp () override
 
std::vector< uint8_t > serialize () override
 
optional< std::vector< uint8_t > > getWitness () override
 
api::EstimatedSize getEstimatedSize () override
 
std::vector< uint8_t > serializeOutputs () override
 
int32_t getVersion () override
 
api::BitcoinLikeSignatureState setSignatures (const std::vector< api::BitcoinLikeSignature > &signatures, bool override=false) override
 
api::BitcoinLikeSignatureState setDERSignatures (const std::vector< std::vector< uint8_t >> &signatures, bool override=false) override
 
BitcoinLikeTransactionApiaddInput (const std::shared_ptr< BitcoinLikeWritableInputApi > &input)
 
BitcoinLikeTransactionApiaddOutput (const std::shared_ptr< api::BitcoinLikeOutput > &output)
 
BitcoinLikeTransactionApisetLockTime (uint32_t lockTime)
 
BitcoinLikeTransactionApisetVersion (uint32_t version)
 
BitcoinLikeTransactionApisetTimestamp (uint32_t timestamp)
 
BitcoinLikeTransactionApisetHash (const std::string &hash)
 
- Public Member Functions inherited from ledger::core::api::BitcoinLikeTransaction
virtual BitcoinLikeSignatureState setSignatures (const std::vector< BitcoinLikeSignature > &signatures, bool override)=0
 

Static Public Member Functions

static std::shared_ptr< api::BitcoinLikeTransactionparseRawTransaction (const api::Currency &currency, const std::vector< uint8_t > &rawTransaction, std::experimental::optional< int32_t > currentBlockHeight, bool isSigned)
 
static std::shared_ptr< api::BitcoinLikeTransactionparseRawSignedTransaction (const api::Currency &currency, const std::vector< uint8_t > &rawTransaction, std::experimental::optional< int32_t > currentBlockHeight)
 
static api::EstimatedSize estimateSize (std::size_t inputCount, std::size_t outputCount, const api::Currency &currency, const std::string &keychainEngine)
 

Member Function Documentation

◆ getBlock()

std::shared_ptr< api::BitcoinLikeBlock > ledger::core::BitcoinLikeTransactionApi::getBlock ( )
overridevirtual

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

Implements ledger::core::api::BitcoinLikeTransaction.

◆ getEstimatedSize()

api::EstimatedSize ledger::core::BitcoinLikeTransactionApi::getEstimatedSize ( )
overridevirtual

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

Implements ledger::core::api::BitcoinLikeTransaction.

◆ getFees()

std::shared_ptr< api::Amount > ledger::core::BitcoinLikeTransactionApi::getFees ( )
overridevirtual

Get the amount of fees of the transaction.

Implements ledger::core::api::BitcoinLikeTransaction.

◆ getHash()

std::string ledger::core::BitcoinLikeTransactionApi::getHash ( )
overridevirtual

Get the hash of the transaction.

Implements ledger::core::api::BitcoinLikeTransaction.

◆ getInputs()

std::vector< std::shared_ptr< api::BitcoinLikeInput > > ledger::core::BitcoinLikeTransactionApi::getInputs ( )
overridevirtual

Get the input of the transaction.

Implements ledger::core::api::BitcoinLikeTransaction.

◆ getLockTime()

int64_t ledger::core::BitcoinLikeTransactionApi::getLockTime ( )
overridevirtual

Get the lock time of the transaction.

Implements ledger::core::api::BitcoinLikeTransaction.

◆ getOutputs()

std::vector< std::shared_ptr< api::BitcoinLikeOutput > > ledger::core::BitcoinLikeTransactionApi::getOutputs ( )
overridevirtual

Get the output of the transaction.

Implements ledger::core::api::BitcoinLikeTransaction.

◆ getTime()

std::chrono::system_clock::time_point ledger::core::BitcoinLikeTransactionApi::getTime ( )
overridevirtual

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

Implements ledger::core::api::BitcoinLikeTransaction.

◆ getTimestamp()

optional< int32_t > ledger::core::BitcoinLikeTransactionApi::getTimestamp ( )
overridevirtual

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

Implements ledger::core::api::BitcoinLikeTransaction.

◆ getVersion()

int32_t ledger::core::BitcoinLikeTransactionApi::getVersion ( )
overridevirtual

Get Transaction version.

Implements ledger::core::api::BitcoinLikeTransaction.

◆ getWitness()

optional< std::vector< uint8_t > > ledger::core::BitcoinLikeTransactionApi::getWitness ( )
overridevirtual

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

Implements ledger::core::api::BitcoinLikeTransaction.

◆ serialize()

std::vector< uint8_t > ledger::core::BitcoinLikeTransactionApi::serialize ( )
overridevirtual

Serialize the transaction to its raw format.

Implements ledger::core::api::BitcoinLikeTransaction.

◆ serializeOutputs()

std::vector< uint8_t > ledger::core::BitcoinLikeTransactionApi::serializeOutputs ( )
overridevirtual

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

Implements ledger::core::api::BitcoinLikeTransaction.

◆ setDERSignatures()

api::BitcoinLikeSignatureState ledger::core::BitcoinLikeTransactionApi::setDERSignatures ( const std::vector< std::vector< uint8_t >> &  signatures,
bool  override = false 
)
overridevirtual

Sign all inputs for given transaction.

Returns
SIGNING_SUCCEED if succeed case else refers to BitcoinLikeSignatureState enumeration

Implements ledger::core::api::BitcoinLikeTransaction.


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