Add Transaction struct, update PSBT and Blockchain to use it

This commit is contained in:
Steve Myers
2023-01-23 12:12:35 -06:00
parent 302ad8dea8
commit 8e54ada436
5 changed files with 75 additions and 20 deletions

View File

@@ -248,7 +248,7 @@ class Blockchain(
config: BlockchainConfig
) {
/** Broadcast a transaction. */
fun broadcast(psbt: PartiallySignedBitcoinTransaction) {}
fun broadcast(transaction: Transaction) {}
/** Estimate the fee rate required to confirm a transaction in a given target of blocks. */
fun estimateFee(target: ULong): FeeRate {}
@@ -260,6 +260,18 @@ class Blockchain(
fun getBlockHash(height: UInt): String {}
}
/**
* A bitcoin transaction.
*
* @constructor Build a new Bitcoin Transaction.
*
* @param transactionBytes The transaction bytes, bitcoin consensus encoded.
*/
class Transaction(transactionBytes: List<UByte>) {
/** Return the transaction bytes, bitcoin consensus encoded. */
fun serialize(): List<UByte> {}
}
/**
* A partially signed bitcoin transaction.
*
@@ -274,8 +286,8 @@ class PartiallySignedBitcoinTransaction(psbtBase64: String) {
/** Get the txid of the PSBT. */
fun txid(): String {}
/** Return the transaction as bytes. */
fun extractTx(): List<UByte>
/** Extract the transaction. */
fun extractTx(): Transaction {}
/**
* Combines this PartiallySignedTransaction with another PSBT as described by BIP 174.