TransactionBuilderStep

scalus.cardano.txbuilder.TransactionBuilderStep
See theTransactionBuilderStep companion trait

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
Graph
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type

Members list

Type members

Classlikes

case class AddCollateral(utxo: Utxo) extends TransactionBuilderStep

Add a utxo as a collateral input. Utxo should contain ada only and be controlled by a key, not a script. If you need set collateral outputs ot totalCollateral field, please use optics.

Add a utxo as a collateral input. Utxo should contain ada only and be controlled by a key, not a script. If you need set collateral outputs ot totalCollateral field, please use optics.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
case class Fee(fee: Coin) extends TransactionBuilderStep

Set the minimal fee.

Set the minimal fee.

Attributes

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

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
case class Mint(scriptHash: ScriptHash, assetName: AssetName, amount: Long, witness: NativeScriptWitness | TwoArgumentPlutusScriptWitness) extends TransactionBuilderStep

Mint/burn tokens using a native/plutus script. Additive - sum monoid over amount. You should determine your aggregate mint amount outside of the builder. Chaining steps together to calculate the mint amount.

Mint/burn tokens using a native/plutus script. Additive - sum monoid over amount. You should determine your aggregate mint amount outside of the builder. Chaining steps together to calculate the mint amount.

WARNING: If you explicitly pass amount == 0, this will return a Left.

WARNING: If you do a reciprocal pair of mint/burn of the same amount (i.e., Mint 4, Mint -4), you will nullify the mint amount, but the additionalSigners/requiredSigners/witnesses will not be removed.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
case class ModifyAuxiliaryData(f: (Option[AuxiliaryData]) => Option[AuxiliaryData]) extends TransactionBuilderStep

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
case class ReferenceOutput(utxo: Utxo) extends TransactionBuilderStep

Add a scalus.cardano.ledger.Utxo as a CIP-31 reference input. Consuming the same UTxO twice (reference or spend) is an error

Add a scalus.cardano.ledger.Utxo as a CIP-31 reference input. Consuming the same UTxO twice (reference or spend) is an error

The reason that action is represented as a step is that reference utxos should be added to the context and also may be required to create a WitnessForSpend.

Value parameters

utxo

any utxo

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
case class Send(output: TransactionOutput) extends TransactionBuilderStep

Send some funds/data to an address. Multiple identical steps are acceptable.

Send some funds/data to an address. Multiple identical steps are acceptable.

Attributes

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

Spend any utxo. An attempt to consume (reference or spend) the same utxo twice will error. If a reference script is used, the containing utxo should be added beforehand with ReferenceOutput or Spend steps.

Spend any utxo. An attempt to consume (reference or spend) the same utxo twice will error. If a reference script is used, the containing utxo should be added beforehand with ReferenceOutput or Spend steps.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
case class SpendWithDelayedRedeemer(utxo: Utxo, redeemerBuilder: Transaction => Data, validator: PlutusScript, datum: Option[Data] = ...) extends TransactionBuilderStep

Spend a utxo guarded by plutus script.

Spend a utxo guarded by plutus script.

The redeemerBuilder is invoked after TransactionBuilder.build, but before it's balanced by the low lever builder. As a result, the number and order of inputs, outputs, certificates etc. is predetermined.

Use this instead of Spend when assembling the redeemer requires the knowledge of the transaction contents, e.g. to include the indices of inputs or outputs.

Attributes

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

Attributes

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

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
case class ValidityEndSlot(slot: Long) extends TransactionBuilderStep

Set transaction validity end slot (aka TTL), can be used once.

Set transaction validity end slot (aka TTL), can be used once.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
case class ValidityStartSlot(slot: Long) extends TransactionBuilderStep

Set transactions validity start slot, can be used once.

Set transactions validity start slot, can be used once.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
case class WithdrawRewards(stakeCredential: StakeCredential, amount: Coin, witness: PubKeyWitness.type | NativeScriptWitness | TwoArgumentPlutusScriptWitness = ...) extends TransactionBuilderStep

Attributes

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

Inherited and Abstract types

type MirroredElemLabels <: Tuple

The names of the product elements

The names of the product elements

Attributes

Inherited from:
Mirror
type MirroredLabel <: String

The name of the type

The name of the type

Attributes

Inherited from:
Mirror