I am consuming a script output and also create a new one at the same script address. The validator script requires the output producer to provide the datum value due to making assertions on it. Therefore, I would like to know how can I provide a datum value for creating an output using the cardano serialization lib and not just the datum hash!
The only thing I saw was something called
TransactionBuilder.set_auxiliary_data() but I am not sure whether that fits what I need.
Thanks for any advice in the right direction.
Currently I am doing something like this which obviously only provides the datum hash - not the value.
txBuilder.add_output( TransactionOutputBuilder.new() .with_address(scriptAddress) .with_data_hash(hash_plutus_data(myDatum)) .next() .with_value(Value.new(amount)) .build() );