Attributes
- Companion
- object
- Graph
-
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Members list
Value members
Concrete methods
Finds the unique output paying back to ownInput's address, or fails with message.
Finds the unique output paying back to ownInput's address, or fails with message.
Compares the WHOLE address, staking credential included. The credential-only finders (findOutputsByScriptHash, findOutputsByCredential) leave the staking part unconstrained, which lets an attacker redirect the continuing output's delegation rewards. Fails when no output or more than one output pays to that address.
Attributes
- Example
-
val ownInput = tx.findInputOrFail(ownRef) val continuing = tx.findContinuingOutputOrFail(ownInput, "expected one continuing output") require(continuing.value.hasSameTokensAndAtLeastAda(ownInput.resolved.value), "value")
Finds a datum by its hash in this transaction's outputs or datum witness map.
Finds a datum by its hash in this transaction's outputs or datum witness map.
Attributes
Finds a transaction input by its output reference.
Finds a transaction input by its output reference.
Attributes
- Returns
-
Some(TxInInfo)if an input spendsoutRef,Noneotherwise
Finds a transaction input by its output reference, or fails with message.
Finds a transaction input by its output reference, or fails with message.
A direct scan with no intermediate Option. As a statement it is also the one-shot check: tx.findInputOrFail(seed, "seed must be spent").
Attributes
- Example
-
val ownInput = tx.findInputOrFail(ownRef, "own input not found")
Finds all inputs whose resolved address has the given payment credential.
Finds all inputs whose resolved address has the given payment credential.
Matches the payment credential only; the staking part is not constrained.
Attributes
Finds all outputs whose address has the given payment credential.
Finds all outputs whose address has the given payment credential.
Matches the PAYMENT credential only: the staking part of the address is not constrained. Do not use this to locate the continuing output of a script - an attacker can keep the payment credential and redirect the delegation rewards. Use findContinuingOutputOrFail, which compares the whole address.
Attributes
Finds all outputs whose payment credential is the given script hash.
Finds all outputs whose payment credential is the given script hash.
Matches the PAYMENT credential only: the staking part of the address is not constrained. Do not use this to locate the continuing output of a script - an attacker can keep the payment credential and redirect the delegation rewards. Use findContinuingOutputOrFail, which compares the whole address.
Attributes
true if some output pays EXACTLY value to addr and carries tag as its datum.
true if some output pays EXACTLY value to addr and carries tag as its datum.
The tagged-output defence against double satisfaction: with a TxOutRef-derived tag (see TxOutRef.deriveTokenName) no single output can satisfy two script instances. All three comparisons are exact; a >= on the value would reopen the hole.
Attributes
Attributes
- Returns
-
trueif the transaction signatories list includes the given keyHash,falseotherwise
true if any of keys signed the transaction.
true if any of keys signed the transaction.
A direct scan; keys.exists(tx.isSignedBy) allocates an Option per call.
Attributes
true if at least one token is minted or burned under policy and every quantity under it is negative.
true if at least one token is minted or burned under policy and every quantity under it is negative.
Not mint.tokens(policy).forall(_._2 < 0): forall over an EMPTY map is vacuously true, so that spelling passes a transaction that burns nothing at all. An auction that closes by burning its state NFT with the unguarded check lets a Close that mints nothing pay out while the NFT survives for replay. The emptiness guard is the operation. When the token name is known, mint.hasOnly(policy, name, -1) is stronger.
Attributes
The validity range's lower bound, or fails with message if it is unbounded.
The validity range's lower bound, or fails with message if it is unbounded.
INCLUSIVE: the ledger builds it with lowerBound (closed), so this is the earliest time at which the transaction can be included. It is the value to compare against a "not before" deadline: require(tx.validFromOrFail(msg) >= deadline, "too early").
Pairs with TxBuilder.validFrom. Replaces getValidityStartTime, which returned 0 for an unbounded range and let a transaction with no lower bound pass every deadline.
Attributes
The validity range's upper bound, or fails with message if it is unbounded.
The validity range's upper bound, or fails with message if it is unbounded.
EXCLUSIVE: the ledger builds it with strictUpperBound (open), so the transaction cannot be included at or after this time. A timestamp written into a datum from this value is an upper bound on the real posting time - it can be late, never early. It is the value to compare against a "not after" deadline: require(tx.validToOrFail(msg) <= deadline, "too late").
Pairs with TxBuilder.validTo.
Attributes
Total value paid to addr across all outputs, as a whole Value.
Total value paid to addr across all outputs, as a whole Value.
Compares the whole address. Sums every asset, not only lovelace; project with .getLovelace afterwards when only ADA matters.
Attributes
Total value spent from addr across all inputs, as a whole Value.
Total value spent from addr across all inputs, as a whole Value.
Compares the whole address. Sums every asset, not only lovelace.
Attributes
Deprecated methods
Deprecated spelling of findInputOrFail. Keeps its original Option-based body so the budgets of existing callers do not move until they migrate.
Deprecated spelling of findInputOrFail. Keeps its original Option-based body so the budgets of existing callers do not move until they migrate.
Attributes
- Deprecated
-
[Since version 1.1.1]use findInputOrFail
Same as inputs.filter(pred).
Same as inputs.filter(pred).
Attributes
- Deprecated
-
[Since version 1.1.1]use inputs.filter
Deprecated spelling of findInputsByCredential; original body kept.
Deprecated spelling of findInputsByCredential; original body kept.
Attributes
- Deprecated
-
[Since version 1.1.1]use findInputsByCredential
Same as outputs.filter(pred).
Same as outputs.filter(pred).
Attributes
- Deprecated
-
[Since version 1.1.1]use outputs.filter
Deprecated spelling of findOutputsByCredential; original body kept.
Deprecated spelling of findOutputsByCredential; original body kept.
Attributes
- Deprecated
-
[Since version 1.1.1]use findOutputsByCredential
Deprecated spelling of findOutputsByScriptHash; original body kept.
Deprecated spelling of findOutputsByScriptHash; original body kept.
Attributes
- Deprecated
-
[Since version 1.1.1]use findOutputsByScriptHash
Extracts the start time from the transaction's validity interval, or 0 if the range has no finite lower bound.
Extracts the start time from the transaction's validity interval, or 0 if the range has no finite lower bound.
A transaction with NO lower bound is then treated as happening at the Unix epoch, and every "has the deadline passed?" comparison flips. Use validFromOrFail.
Attributes
- Deprecated
-
[Since version 1.1.1]use validFromOrFail
Inherited methods
Attributes
- Inherited from:
- Product
Attributes
- Inherited from:
- Product