Transaction

class Transaction(transactionBytes: List<UByte>)

A bitcoin transaction.

Parameters

transactionBytes

The transaction bytes, bitcoin consensus encoded.

Constructors

Link copied to clipboard
fun Transaction(transactionBytes: List<UByte>)

Build a new Bitcoin Transaction.

Functions

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

List of transaction inputs.

Link copied to clipboard
fun isCoinBase(): Boolean

Is this a coin base transaction?

Link copied to clipboard
fun isExplicitlyRbf(): Boolean

Returns true if the transaction itself opted in to be BIP-125-replaceable (RBF). This does not cover the case where a transaction becomes replaceable due to ancestors being RBF.

Link copied to clipboard
fun isLockTimeEnabled(): Boolean

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

Link copied to clipboard
fun lockTime(): UInt

Block height or timestamp. Transaction cannot be included in a block until this height/time. Relevant BIPs BIP-65 OP_CHECKLOCKTIMEVERIFY BIP-113 Median time-past as endpoint for lock-time calculations

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

List of transaction outputs.

Link copied to clipboard
fun serialize(): List<UByte>

Return the transaction bytes, bitcoin consensus encoded.

Link copied to clipboard
fun size(): ULong

Returns the regular byte-wise consensus-serialized size of this transaction.

Link copied to clipboard
fun txid(): String

Computes the txid.

Link copied to clipboard
fun version(): Int

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

Link copied to clipboard
fun vsize(): ULong

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

Link copied to clipboard
fun weight(): ULong

Returns the "weight" of this transaction, as defined by BIP141.