iTransaction

A generalized UTXO-style transaction definition.

Inheritors

Properties

Link copied to clipboard

Which blockchain is this transaction for

Link copied to clipboard
abstract 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
abstract 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
abstract val idem: Hash256

Return this transaction's idem. If you change the transaction be sure to call changed() to update this value. Returns the id for blockchains that do not have an idem.

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

inputs to this transaction

Link copied to clipboard
open val inputTotal: Long

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

Link copied to clipboard
abstract var lockTime: Long

transaction lock time

Link copied to clipboard
abstract val outpoints: Array<out iTxOutpoint>

transaction outpoints (handles to the UTXO entries the outputs will generate)

Link copied to clipboard
abstract 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
abstract val size: Long

transaction size in bytes

Link copied to clipboard
abstract var version: Int

transaction version

Functions

Link copied to clipboard
abstract fun add(output: iTxOutput): iTransaction

Add an output to this transaction (at the end)

abstract fun add(spendable: Spendable, reserve: SpendableReservation? = SPENDABLE_RESERVE_UNTIL_QUIT): iTransaction

Add an input to this transaction (at the end)

abstract fun add(input: iTxInput, reserve: SpendableReservation? = SPENDABLE_RESERVE_UNTIL_QUIT): iTransaction

Append an input 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
abstract fun appendableSighash(extendInputs: Boolean = true, extendOutputs: Boolean = true): ByteArray

Return the sighash that allows new inputs and/or outputs to be appended to the transaction. This commits to all existing inputs and outputs.

Link copied to clipboard
Link copied to clipboard
abstract fun BCHserialize(format: SerializationType = SerializationType.UNKNOWN): BCHserialized
Link copied to clipboard
abstract fun changed()

Communicate that this transaction has been changed, so recalculation of id and idem are needed

Link copied to clipboard
abstract fun clone(): iTransaction

Creates a shallow copy of this transaction. The iTransaction object is different, but the inputs and outputs are the same.

Link copied to clipboard
abstract fun copy(): iTransaction

Creates a deep copy of this transaction. The iTransaction object and inputs and outputs are all copied

Link copied to clipboard
open fun createTdppUrl(requestingDomain: String = "", tdppFlags: Long = 0, applinkDomain: String? = "w.nexa.org"): String

Given this (partial) transaction, formulate a TDPP request that another wallet can complete.

Link copied to clipboard
abstract fun debugDump()

Dump this transaction to stdout

Link copied to clipboard
abstract fun details(): String

Pretty print the transaction details to a string

Link copied to clipboard
abstract fun firstnSighash(numInputs: Int = Int.MAX_VALUE, numOutputs: Int = Int.MAX_VALUE): ByteArray

Return the sighash that signs the first N inputs/outputs. Pass Int.MAX_VALUE to sign "all", otherwise pass a number to sign those. This commits to the first inputs and outputs.

Link copied to clipboard
abstract fun hasAuthority(grpId: GroupId, flags: ULong): Boolean

Returns true if this transaction has inputs that confer this authority. This function is used in transaction construction so if the input is read-only, it is assumed that it will be signed later (recall that unsigned read-only inputs are valid but do not confer any authorities), so true will be returned even though the authority is not conferred unless the read-only input is signed. If a blockchain does not support groups (or equivalent functionality), false is always returned.

Link copied to clipboard
abstract fun isCoinbase(): Boolean
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
abstract fun setInputs(inputs: MutableList<out iTxInput>): iTransaction

Overwrite all inputs in this transaction with the provided list.

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

Overwrite all outputs with the provided list

Link copied to clipboard
abstract fun spendable(index: Int): Spendable

Get outpoints that child transactions can use to spend the outputs of this transaction.

Link copied to clipboard
open fun toBase64Url(): String

Serialize this transaction into Base64Url format

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
abstract fun toHex(): String

Return the serialized hex representation