Change

scalus.cardano.txbuilder.Change
object Change

Utilities for handling change outputs in transaction balancing.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Change.type

Members list

Value members

Concrete methods

def changeOutputDiffHandler(diff: Value, tx: Transaction, protocolParams: ProtocolParams, changeOutputIdx: Int): Either[TxBalancingError, Transaction]

Handles the diff by adjusting an existing change output at the specified index.

Handles the diff by adjusting an existing change output at the specified index.

This method is intended to be used as a diff handler function with TransactionBuilder.balanceFeeAndChangeWithTokens. It adjusts an existing change output rather than creating a new one.

Value parameters

changeOutputIdx

The index of the change output to modify

diff

The value difference to apply (positive to add, negative to remove)

protocolParams

Protocol parameters for minAda calculations

tx

The transaction to modify

Attributes

Returns

Either a TxBalancingError or the modified transaction

Throws
IllegalArgumentException

if changeOutputIdx is out of bounds