From d3e183a498dcf0764544adeb0c8d2232b0f00df0 Mon Sep 17 00:00:00 2001 From: thunderbiscuit Date: Wed, 8 Mar 2023 15:20:14 -0500 Subject: [PATCH] Add Kotlin API docs for new Transaction methods --- .../src/main/kotlin/org/bitcoindevkit/bdk.kt | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/api-docs/kotlin/src/main/kotlin/org/bitcoindevkit/bdk.kt b/api-docs/kotlin/src/main/kotlin/org/bitcoindevkit/bdk.kt index 77ad251..baf8976 100644 --- a/api-docs/kotlin/src/main/kotlin/org/bitcoindevkit/bdk.kt +++ b/api-docs/kotlin/src/main/kotlin/org/bitcoindevkit/bdk.kt @@ -290,6 +290,23 @@ class Blockchain( class Transaction(transactionBytes: List) { /** Return the transaction bytes, bitcoin consensus encoded. */ fun serialize(): List {} + + /** + * Returns the "weight" of this transaction, as defined by BIP141. + * + * For transactions with an empty witness, this is simply the consensus-serialized size times four. For transactions with a witness, this is the non-witness consensus-serialized size multiplied by three plus the with-witness consensus-serialized size. + */ + fun weight(): ULong {} + + /** Returns the regular byte-wise consensus-serialized size of this transaction. */ + fun size(): ULong {} + + /** + * Returns the "virtual size" (vsize) of this transaction. + * + * Will be ceil(weight / 4.0). Note this implements the virtual size as per BIP141, which is different to what is implemented in Bitcoin Core. The computation should be the same for any remotely sane transaction. + */ + fun vsize(): ULong {} } /**