TransactionPreconditions

data class TransactionPreconditions(val timeBounds: TimeBounds? = null, val ledgerBounds: LedgerBounds? = null, val minSequenceNumber: Long? = null, val minSequenceAge: Long = 0, val minSequenceLedgerGap: Int = 0, val extraSigners: List<SignerKey> = emptyList())

Preconditions of a transaction per CAP-21

Transaction preconditions allow you to set constraints on when a transaction can be executed. This includes time bounds, ledger bounds, minimum sequence numbers, and required extra signers.

See also

Constructors

Link copied to clipboard
constructor(timeBounds: TimeBounds? = null, ledgerBounds: LedgerBounds? = null, minSequenceNumber: Long? = null, minSequenceAge: Long = 0, minSequenceLedgerGap: Int = 0, extraSigners: List<SignerKey> = emptyList())

Types

Link copied to clipboard
class Builder

Builder for creating TransactionPreconditions with a fluent API.

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

Required extra signers (V2 only). Maximum of 2 extra signers

Link copied to clipboard

The ledger bounds for the transaction (V2 only)

Link copied to clipboard

The minimum amount of time (in seconds) between source account sequence time and the ledger time when this transaction will become valid (V2 only). 0 means unrestricted

Link copied to clipboard

The minimum number of ledgers between source account sequence and the ledger number when this transaction will become valid (V2 only). 0 means unrestricted

Link copied to clipboard

The minimum source account sequence number this transaction is valid for (V2 only). If null, the transaction is valid when source account's sequence number == tx.sequence - 1

Link copied to clipboard

The time bounds for the transaction

Functions

Link copied to clipboard
fun hasV2(): Boolean

Returns true if the preconditions use V2 features.

Link copied to clipboard

Converts this TransactionPreconditions to its XDR representation.

Link copied to clipboard
fun validate()

Validates the preconditions.