Companion

object Companion : BtcSerializer<Transaction>

Functions

Link copied to clipboard
fun amountsSha256(inputs: List<TxOut>): ByteArray
Link copied to clipboard
fun baseSize(tx: Transaction, protocolVersion: Long = PROTOCOL_VERSION): Int

Total size of the transaction without witness data.

Link copied to clipboard
fun correctlySpends(    tx: Transaction,     parent: Transaction,     scriptFlags: Int)
fun correctlySpends(    tx: Transaction,     inputs: List<Transaction>,     scriptFlags: Int)
fun correctlySpends(    tx: Transaction,     previousOutputs: Map<OutPoint, TxOut>,     scriptFlags: Int)
Link copied to clipboard
fun hashForSigning(    tx: Transaction,     inputIndex: Int,     previousOutputScript: ByteArray,     sighashType: Int): ByteArray

hash a tx for signing (pre-segwit)

fun hashForSigning(    tx: Transaction,     inputIndex: Int,     previousOutputScript: ByteArray,     sighashType: Int,     amount: Satoshi,     signatureVersion: Int): ByteArray
fun hashForSigning(    tx: Transaction,     inputIndex: Int,     previousOutputScript: List<ScriptElt>,     sighashType: Int,     amount: Satoshi,     signatureVersion: Int): ByteArray

hash a tx for signing

Link copied to clipboard
fun hashForSigningSchnorr(    tx: Transaction,     inputIndex: Int,     inputs: List<TxOut>,     sighashType: Int,     sigVersion: Int,     executionData: Script.ExecutionData = Script.ExecutionData.empty): ByteVector32
Link copied to clipboard
fun isCoinbase(input: Transaction): Boolean
Link copied to clipboard
fun outputsSha256(tx: Transaction): ByteArray
Link copied to clipboard
fun prepareForSigning(    tx: Transaction,     inputIndex: Int,     previousOutputScript: ByteArray,     sighashType: Int): Transaction

prepare a transaction for signing a specific input

Link copied to clipboard
fun prevoutsSha256(tx: Transaction): ByteArray
Link copied to clipboard
fun read(input: Input): Transaction
open override fun read(input: ByteArray): Transaction
open override fun read(input: String): Transaction

fun read(input: ByteArray, protocolVersion: Long): Transaction

read a message from a byte array

fun read(input: String, protocolVersion: Long): Transaction

read a message from a hex string

open override fun read(input: Input, protocolVersion: Long): Transaction

read a message from a stream

Link copied to clipboard
fun scriptPubkeysSha256(inputs: List<TxOut>): ByteArray
Link copied to clipboard
fun sequencesSha256(tx: Transaction): ByteArray
Link copied to clipboard
fun serializeTxWitness(version: Long): Boolean
Link copied to clipboard
fun signInput(    tx: Transaction,     inputIndex: Int,     previousOutputScript: ByteVector,     sighashType: Int,     privateKey: PrivateKey): ByteArray
fun signInput(    tx: Transaction,     inputIndex: Int,     previousOutputScript: ByteArray,     sighashType: Int,     privateKey: PrivateKey): ByteArray
fun signInput(    tx: Transaction,     inputIndex: Int,     previousOutputScript: List<ScriptElt>,     sighashType: Int,     privateKey: PrivateKey): ByteArray
fun signInput(    tx: Transaction,     inputIndex: Int,     previousOutputScript: ByteVector,     sighashType: Int,     amount: Satoshi,     signatureVersion: Int,     privateKey: PrivateKey): ByteArray

fun signInput(    tx: Transaction,     inputIndex: Int,     previousOutputScript: ByteArray,     sighashType: Int,     amount: Satoshi,     signatureVersion: Int,     privateKey: PrivateKey): ByteArray
fun signInput(    tx: Transaction,     inputIndex: Int,     previousOutputScript: List<ScriptElt>,     sighashType: Int,     amount: Satoshi,     signatureVersion: Int,     privateKey: PrivateKey): ByteArray

sign a tx input

Link copied to clipboard
fun totalSize(tx: Transaction, protocolVersion: Long = PROTOCOL_VERSION): Int

Total size of the transaction with witness data, if any.

Link copied to clipboard
open override fun validate(input: Transaction)
Link copied to clipboard
fun weight(tx: Transaction): Int
fun weight(tx: Transaction, protocolVersion: Long = PROTOCOL_VERSION): Int
Link copied to clipboard
open override fun write(message: Transaction): ByteArray
fun write(message: Transaction, out: Output)

fun write(message: Transaction, protocolVersion: Long): ByteArray

write a message to a byte array

open override fun write(    tx: Transaction,     out: Output,     protocolVersion: Long)

write a message to a stream

Properties

Link copied to clipboard
const val LOCKTIME_THRESHOLD: Long = 500000000
Link copied to clipboard
const val SERIALIZE_TRANSACTION_NO_WITNESS: Long = 1073741824