Transaction

Companion:
class
Source:
Transaction.scala
trait Product
trait Mirror
class Object
trait Matchable
class Any

Type members

Inherited types

type MirroredElemLabels <: Tuple

The names of the product elements

The names of the product elements

Inherited from:
Mirror
Source:
Mirror.scala

The name of the type

The name of the type

Inherited from:
Mirror
Source:
Mirror.scala

Value members

Concrete methods

def baseSize(tx: Transaction, protocolVersion: Long): Int
def correctlySpends(tx: Transaction, previousOutputs: Map[OutPoint, TxOut], scriptFlags: Int, callback: Option[Callback]): Unit
def correctlySpends(tx: Transaction, previousOutputs: Map[OutPoint, TxOut], scriptFlags: Int): Unit
def correctlySpends(tx: Transaction, inputs: Seq[Transaction], scriptFlags: Int, callback: Option[Callback]): Unit
def correctlySpends(tx: Transaction, inputs: Seq[Transaction], scriptFlags: Int): Unit
def hashForSigning(tx: Transaction, inputIndex: Int, previousOutputScript: ByteVector, sighashType: Int): ByteVector32

hash a tx for signing (pre-segwit)

hash a tx for signing (pre-segwit)

Value parameters:
inputIndex

index of the tx input that is being processed

previousOutputScript

public key script of the output claimed by this tx input

sighashType

signature hash type

tx

input transaction

Returns:

a hash which can be used to sign the referenced tx input

Source:
Transaction.scala
def hashForSigning(tx: Transaction, inputIndex: Int, previousOutputScript: Seq[ScriptElt], sighashType: Int): ByteVector32

hash a tx for signing (pre-segwit)

hash a tx for signing (pre-segwit)

Value parameters:
inputIndex

index of the tx input that is being processed

previousOutputScript

public key script of the output claimed by this tx input

sighashType

signature hash type

tx

input transaction

Returns:

a hash which can be used to sign the referenced tx input

Source:
Transaction.scala
def hashForSigning(tx: Transaction, inputIndex: Int, previousOutputScript: ByteVector, sighashType: Int, amount: Satoshi, signatureVersion: Int): ByteVector32

hash a tx for signing

hash a tx for signing

Value parameters:
amount

amount of the output claimed by this input

inputIndex

index of the tx input that is being processed

previousOutputScript

public key script of the output claimed by this tx input

sighashType

signature hash type

tx

input transaction

Returns:

a hash which can be used to sign the referenced tx input

Source:
Transaction.scala
def hashForSigning(tx: Transaction, inputIndex: Int, previousOutputScript: Seq[ScriptElt], sighashType: Int, amount: Satoshi, signatureVersion: Int): ByteVector32

hash a tx for signing

hash a tx for signing

Value parameters:
amount

amount of the output claimed by this input

inputIndex

index of the tx input that is being processed

previousOutputScript

public key script of the output claimed by this tx input

sighashType

signature hash type

tx

input transaction

Returns:

a hash which can be used to sign the referenced tx input

Source:
Transaction.scala
def prepareForSigning(tx: Transaction, inputIndex: Int, previousOutputScript: ByteVector, sighashType: Int): Transaction

prepare a transaction for signing a specific input

prepare a transaction for signing a specific input

Value parameters:
inputIndex

index of the tx input that is being processed

previousOutputScript

public key script of the output claimed by this tx input

sighashType

signature hash type

tx

input transaction

Returns:

a new transaction with proper inputs and outputs according to SIGHASH_TYPE rules

Source:
Transaction.scala
override def read(input: InputStream, protocolVersion: Long): Transaction
Definition Classes
Source:
Transaction.scala
Value parameters:
version

protocol version (and NOT transaction version !)

Returns:

true if protocol version specifies that witness data is to be serialized

Source:
Transaction.scala
def signInput(tx: Transaction, inputIndex: Int, previousOutputScript: ByteVector, sighashType: Int, amount: Satoshi, signatureVersion: Int, privateKey: PrivateKey): ByteVector

sign a tx input

sign a tx input

Value parameters:
amount

amount of the output claimed by this tx input

inputIndex

index of the tx input that is being processed

previousOutputScript

public key script of the output claimed by this tx input

privateKey

private key

sighashType

signature hash type, which will be appended to the signature

signatureVersion

signature version (1: segwit, 0: pre-segwit)

tx

input transaction

Returns:

the encoded signature of this tx for this specific tx input

Source:
Transaction.scala
def signInput(tx: Transaction, inputIndex: Int, previousOutputScript: Seq[ScriptElt], sighashType: Int, amount: Satoshi, signatureVersion: Int, privateKey: PrivateKey): ByteVector

sign a tx input

sign a tx input

Value parameters:
amount

amount of the output claimed by this tx input

inputIndex

index of the tx input that is being processed

previousOutputScript

public key script of the output claimed by this tx input

privateKey

private key

sighashType

signature hash type, which will be appended to the signature

signatureVersion

signature version (1: segwit, 0: pre-segwit)

tx

input transaction

Returns:

the encoded signature of this tx for this specific tx input

Source:
Transaction.scala
def totalSize(tx: Transaction, protocolVersion: Long): Int
override def validate(input: Transaction): Unit
Definition Classes
Source:
Transaction.scala
def weight(tx: Transaction, protocolVersion: Long): Int
override def write(tx: Transaction, out: OutputStream, protocolVersion: Long): Unit
Definition Classes
Source:
Transaction.scala

Inherited methods

Inherited from:
BtcSerializer
Source:
Protocol.scala
def read(in: String, protocolVersion: Long): Transaction

read a message from a hex string

read a message from a hex string

Value parameters:
in

message binary data in hex format

Returns:

a deserialized message of type T

Inherited from:
BtcSerializer
Source:
Protocol.scala
Inherited from:
BtcSerializer
Source:
Protocol.scala
def read(in: Array[Byte], protocolVersion: Long): Transaction

read a message from a byte array

read a message from a byte array

Value parameters:
in

serialized message

Returns:

a deserialized message

Inherited from:
BtcSerializer
Source:
Protocol.scala
def read(in: InputStream): Transaction
Inherited from:
BtcSerializer
Source:
Protocol.scala
def write(t: Transaction, protocolVersion: Long): ByteVector

write a message to a byte array

write a message to a byte array

Value parameters:
t

message

Returns:

a serialized message

Inherited from:
BtcSerializer
Source:
Protocol.scala
def write(t: Transaction, out: OutputStream): Unit
Inherited from:
BtcSerializer
Source:
Protocol.scala