scalus.cardano.txbuilder

Members list

Type members

Classlikes

case class BuilderContext(env: Environment, wallet: Wallet, evaluator: PlutusScriptEvaluator)

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
object Change

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
Change.type
class ChangeOutputDiffHandler(protocolParams: ProtocolParams, changeOutputIdx: Int)

Attributes

Supertypes
class Object
trait Matchable
class Any
sealed trait Datum

Datums in UTxOs can be stored in two forms: inline datums or datum hashes. When there's a hash, we need to provide a datum corresponding to this hash, which can be done by either providing the value literally, or using a reference input where it is stored inline. The latter is not supported, since we haven't seen it in the wild - you can work with the datum of a reference/other input directly. Please open an issue if you need it.

Datums in UTxOs can be stored in two forms: inline datums or datum hashes. When there's a hash, we need to provide a datum corresponding to this hash, which can be done by either providing the value literally, or using a reference input where it is stored inline. The latter is not supported, since we haven't seen it in the wild - you can work with the datum of a reference/other input directly. Please open an issue if you need it.

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object DatumInlined
class DatumValue
object Datum

Attributes

Companion
trait
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
Datum.type
case class DelayedRedeemerSpec(utxo: Utxo, redeemerBuilder: Transaction => Data, validator: PlutusScript, datum: Option[Data], step: TransactionBuilderStep)

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
case class DetachedRedeemer(datum: Data, purpose: RedeemerPurpose)

Redeemer that was detached from a transaction. Contains just enough info for it to be re-attached again, if a transaction needs a redeemer for some action.

Redeemer that was detached from a transaction. Contains just enough info for it to be re-attached again, if a transaction needs a redeemer for some action.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
case class EditableTransaction(transaction: Transaction, redeemers: Vector[DetachedRedeemer])

A transaction with redeemers detached.

A transaction with redeemers detached.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object Environment

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
case class ExpectedSigner(hash: AddrKeyHash)

An scalus.cardano.address.AddrKeyHash that is expected to sign some scalus.cardano.ledger.Transaction.

An scalus.cardano.address.AddrKeyHash that is expected to sign some scalus.cardano.ledger.Transaction.

The purpose for signing is not presently tracked. For a sketch, see commit https://github.com/cardano-hydrozoa/hydrozoa/commit/1a8c9c73fbfb33e79456a0a8b9f08688ef39b749

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
case class NativeScriptWitness(scriptSource: ScriptSource[Native], additionalSigners: Set[ExpectedSigner]) extends Witness

Witnesses for native scripts. Can appear several times, but with the same additionalSigners.

Witnesses for native scripts. Can appear several times, but with the same additionalSigners.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Witness
class Object
trait Matchable
class Any
Show all

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
case class PaymentBuilder(context: BuilderContext, payments: Seq[(Address, Value, Option[DatumOption])] = ..., scriptInputs: Set[(Utxo, Witness)] = ..., collateral: Option[(Utxo, Witness)] = ..., additionalSteps: Seq[TransactionBuilderStep] = ...)

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
case object PubKeyWitness extends Witness

Use this value to indicate there will be a signature. The corresponding verification key hash will be tracked automatically in the context.

Use this value to indicate there will be a signature. The corresponding verification key hash will be tracked automatically in the context.

Attributes

Supertypes
trait Singleton
trait Product
trait Mirror
trait Serializable
trait Product
trait Equals
trait Witness
class Object
trait Matchable
class Any
Show all
Self type
case class RedeemerIndexingInternalError(detachedRedeemer: DetachedRedeemer, steps: Seq[TransactionBuilderStep])

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
sealed trait RedeemerPurpose

Contains a value that a redeemer corresponds to. Allows finding a redeemer index, given a transaction contains the value.

Contains a value that a redeemer corresponds to. Allows finding a redeemer index, given a transaction contains the value.

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class ForCert
class ForMint
class ForPropose
class ForReward
class ForSpend
class ForVote
Show all

Attributes

Companion
trait
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
case class RedeemersContext(inputs: Vector[TransactionInput] = ..., mintingPolicyHashes: Vector[ScriptHash] = ..., rewardAddresses: Vector[RewardAccount] = ..., certs: Vector[Certificate] = ..., proposals: Vector[ProposalProcedure] = ..., voters: Vector[Voter] = ...)

Contains parts of a transaction that are needed for redeemer processing.

Contains parts of a transaction that are needed for redeemer processing.

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type

Attributes

Supertypes
trait Enum
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
sealed trait ScriptSource[+A <: Script]

Specifies how the transaction should find the source code for the script.

Specifies how the transaction should find the source code for the script.

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object ScriptSource

Attributes

Companion
trait
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type

These are the sum type for any errors that may occur during different phases and that can be returned thrown by a higher-level TxBuilder

These are the sum type for any errors that may occur during different phases and that can be returned thrown by a higher-level TxBuilder

Attributes

Supertypes
trait Enum
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
case class StakeCredential(credential: Credential)

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object StepError

Attributes

Companion
trait
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
StepError.type
case class ThreeArgumentPlutusScriptWitness(scriptSource: ScriptSource[PlutusScript], redeemer: Data, datum: Datum, additionalSigners: Set[ExpectedSigner]) extends Witness

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Witness
class Object
trait Matchable
class Any
Show all

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
sealed trait TransactionBuilderStep

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes

Steps to build the transaction:

Steps to build the transaction:

  • generally non-commutative, so the order matters
  • some are additive (e.g. Mint), some are not, e.g., (Spend)

Attributes

Companion
trait
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type
case class TwoArgumentPlutusScriptWitness(scriptSource: ScriptSource[PlutusScript], redeemer: Data, additionalSigners: Set[ExpectedSigner]) extends Witness

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Witness
class Object
trait Matchable
class Any
Show all

Attributes

Supertypes
trait Enum
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
case class TxBuilder(env: Environment, context: Context, evaluator: PlutusScriptEvaluator, diffHandlerOpt: Option[DiffHandler] = ..., steps: Seq[TransactionBuilderStep] = ..., attachedScripts: Map[ScriptHash, Script] = ..., attachedData: Map[DataHash, Data] = ..., changeAddressOpt: Option[Address] = ..., providerOpt: Option[Provider] = ...)

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object TxBuilder

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
TxBuilder.type
trait Wallet

Owns a set of pubkey-controlled UTXOs.

Owns a set of pubkey-controlled UTXOs.

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
object Wallet

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type
Wallet.type
sealed trait Witness

A witness to conduct an authorized operation on-chain. This could be spending an input, minting, rewarding, governance ops, certificate ops, etc.

A witness to conduct an authorized operation on-chain. This could be spending an input, minting, rewarding, governance ops, certificate ops, etc.

The only ways to do this as of writing (2025-10-03) are

  • PubKey
  • Native Script
  • Plutus Script

The types include all additional data required to authorize the operation.

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes

Deprecated types

Attributes

Deprecated
[Since version 0.13.0] Use scalus.cardano.ledger.Utxo instead

Value members

Concrete methods

def addDummySignatures(numberOfKeys: Int, tx: Transaction): Transaction

add at most 256 keys

add at most 256 keys

Attributes

def appendDistinct[A](elem: A, seq: Seq[A]): Seq[A]

Append an element to a sequence, returning distinct values only and preserving the order of elements.

Append an element to a sequence, returning distinct values only and preserving the order of elements.

Attributes

def calculateChangeLovelace(tx: Transaction, utxo: Utxos, params: ProtocolParams): Long
def keepRawL[A : Encoder](): Lens[KeepRaw[A], A]
def removeDummySignatures(numberOfKeys: Int, tx: Transaction): Transaction

remove at most 256 keys, must be used in conjunction with addDummyVKeys

remove at most 256 keys, must be used in conjunction with addDummyVKeys

Attributes

def setFee(amount: Coin)(tx: Transaction): Transaction
def txOutputsL: Lens[Transaction, IndexedSeq[Sized[TransactionOutput]]]
def txRedeemersL: Lens[Transaction, Option[KeepRaw[Redeemers]]]

Deprecated fields

Attributes

Deprecated
[Since version 0.13.0] Use scalus.cardano.ledger.Utxo instead

Extensions

Extensions

extension [S, A, B](lens: Lens[S, A])
def >>>[C](other: Lens[A, C]): Lens[S, C]

Deprecated extensions

extension (network: Network)
def toNetworkId: Int

Attributes

Deprecated
[Since version 0.13.0] Use Network.networkId instead