user5085: 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()
);



user5085: Thanks to Sebastien, there is an open issue for this.
Github Feature Request
Besides, one can attach the datum separately to the tx witness set, like so for example:
const datums = PlutusList.new();
datums.add(datumOfCurrentOutputToBeConsumed);
datums.add(datumOfNewOutputToBeCreated);

const transactionWitnessSet = TransactionWitnessSet.new();
transactionWitnessSet.set_plutus_data(datums);


5085: <p>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!</p>
<p>The only thing I saw was something called <code>TransactionBuilder.set_auxiliary_data()</code> but I am not sure whether that fits what I need.</p>
<p>Thanks for any advice in the right direction.</p>
<p>Currently I am doing something like this which obviously only provides the datum hash - not the value.</p>
<pre><code>txBuilder.add_output(
    TransactionOutputBuilder.new()
        .with_address(scriptAddress)
        .with_data_hash(hash_plutus_data(myDatum))
        .next()
        .with_value(Value.new(amount))
        .build()
);

</code></pre>
 5085: <p>Thanks to Sebastien, there is an open issue for this.
<a href="https://github.com/dcSpark/cardano-multiplatform-lib/issues/56" rel="nofollow noreferrer">Github Feature Request</a></p>
<p>Besides, one can attach the datum separately to the tx witness set, like so for example:</p>
<pre><code>const datums = PlutusList.new();
datums.add(datumOfCurrentOutputToBeConsumed);
datums.add(datumOfNewOutputToBeCreated);

const transactionWitnessSet = TransactionWitnessSet.new();
transactionWitnessSet.set_plutus_data(datums);
</code></pre>
