BchTransaction

class BchTransaction(val chainSelector: ChainSelector) : iTransaction

Bitcoin transaction

Constructors

Link copied to clipboard
constructor(chainSelector: ChainSelector, buf: ByteArray, format: SerializationType)

Deserialization constructor

constructor(chainSelector: ChainSelector, buf: BCHserialized)

Deserialization constructor

constructor(chainSelector: ChainSelector)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override val chainSelector: ChainSelector

Which blockchain is this transaction for

Link copied to clipboard
open override val fee: Long

What this transaction will be paying in transaction fees (might be calculated each time)

Link copied to clipboard
open val feeRate: Double

Transaction fee rate in satoshi/byte

Link copied to clipboard

Return this transaction's hash. Uses a cached value if one exists. If you change the transaction be sure to call calcHash() or invalidateHash() to update this value either greedily or lazily respectively

Link copied to clipboard
open override val id: Hash256

Return this transaction's id. If you change the transaction be sure to call changed() to update this value

Link copied to clipboard
open override val idem: Hash256

Return this transaction's id Uses a cached value if one exists. If you change the transaction be sure to call changed() to update this value

Link copied to clipboard
open override val inputs: MutableList<out iTxInput>

inputs to this transaction

Link copied to clipboard
Link copied to clipboard
open val inputTotal: Long

Total quantity of satoshis spent (input into this transaction), including grouped satoshis

Link copied to clipboard
open override var lockTime: Long

transaction lock time

Link copied to clipboard
open override val outpoints: Array<BchTxOutpoint>

Return the outpoints in this transaction

Link copied to clipboard
open override val outputs: MutableList<out iTxOutput>

outputs of this transaction

Link copied to clipboard
open val outputTotal: Long

Total quantity of satoshis sent (output from this transaction), including grouped satoshis

Link copied to clipboard
open override val size: Long

transaction size in bytes

Link copied to clipboard
open override var version: Int

transaction version

Functions

Link copied to clipboard
open override fun add(input: iTxInput): iTransaction

Add an input to this transaction (at the end)

open override fun add(output: iTxOutput): iTransaction

Add an output to this transaction (at the end)

Link copied to clipboard
fun iTransaction.addChange(wallet: Wallet, changeOverride: PayAddress? = null)
Link copied to clipboard
open fun amountSentTo(addr: PayAddress): Long
Link copied to clipboard
open override fun appendableSighash(extendInputs: Boolean, extendOutputs: Boolean): ByteArray

Return the sighash that allows new inputs and/or outputs to be appended to the transaction (but commits to all existing inputs and outputs)

Link copied to clipboard
open override fun BCHdeserialize(stream: BCHserialized): BCHserialized
Link copied to clipboard
open override fun BCHserialize(format: SerializationType): BCHserialized
Link copied to clipboard

Force recalculation of hash. To access the hash just use #hash

Link copied to clipboard
open override fun changed()

If you change transaction data, call this function to force lazy recalculation of the hash

Link copied to clipboard
open override fun debugDump()

Dump this transaction to stdout

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

Returns true if this transaction is a coinbase tx

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

Return true if this is an ownership challenge transaction. This means that this transaction is invalid and so can never be actually committed to the blockchain.

Link copied to clipboard
Link copied to clipboard
open override fun setInputs(inputs: MutableList<out iTxInput>): iTransaction

Overwrite all inputs with the provided list

Link copied to clipboard
open override fun setOutputs(outputs: MutableList<out iTxOutput>): iTransaction

Overwrite all outputs with the provided list

Link copied to clipboard
fun spendable(index: Int): Spendable
Link copied to clipboard
open fun toByteArray(format: SerializationType = SerializationType.UNKNOWN): ByteArray

Serialize this transaction into a byte array (using network serialization)

Link copied to clipboard
open override fun toHex(): String

Serialize this transaction and return it as a hex encoded string

Link copied to clipboard
open override fun toString(): String

Default display: print the transaction hash