Transaction

Bitcoin transaction. An authenticated movement of coins.

Constructors

Link copied to clipboard
constructor(pointer: Pointer)
constructor(noPointer: NoPointer)

This constructor can be used to instantiate a fake object. Only used for tests. Any attempt to actually use an object constructed this way will fail as there is no connected Rust object.

constructor(transactionBytes: ByteArray)

Creates a new Transaction instance from serialized transaction bytes.

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
open override fun close()
Link copied to clipboard
open override fun computeTxid(): String

Computes the Txid. Hashes the transaction excluding the segwit data (i.e. the marker, flag bytes, and the witness fields themselves).

Link copied to clipboard
open override fun destroy()
Link copied to clipboard
open override fun input(): List<TxIn>

List of transaction inputs.

Link copied to clipboard
open override fun isCoinbase(): Boolean

Checks if this is a coinbase transaction. The first transaction in the block distributes the mining reward and is called the coinbase transaction. It is impossible to check if the transaction is first in the block, so this function checks the structure of the transaction instead - the previous output must be all-zeros (creates satoshis “out of thin air”).

Link copied to clipboard
open override fun isExplicitlyRbf(): Boolean

Returns true if the transaction itself opted in to be BIP-125-replaceable (RBF).

Link copied to clipboard
open override fun isLockTimeEnabled(): Boolean

Returns true if this transactions nLockTime is enabled (BIP-65).

Link copied to clipboard
open override fun lockTime(): UInt

Block height or timestamp. Transaction cannot be included in a block until this height/time.

Link copied to clipboard
open override fun output(): List<TxOut>

List of transaction outputs.

Link copied to clipboard
open override fun serialize(): ByteArray

Serialize transaction into consensus-valid format. See https://docs.rs/bitcoin/latest/bitcoin/struct.Transaction.html#serialization-notes for more notes on transaction serialization.

Link copied to clipboard
open override fun totalSize(): ULong

Returns the total transaction size

Link copied to clipboard
fun uniffiClonePointer(): Pointer
Link copied to clipboard
open override fun version(): Int

The protocol version, is currently expected to be 1 or 2 (BIP 68).

Link copied to clipboard
open override fun vsize(): ULong

Returns the "virtual size" (vsize) of this transaction.

Link copied to clipboard
open override fun weight(): ULong

Returns the weight of this transaction, as defined by BIP-141.