cardano-serialization-lib icon indicating copy to clipboard operation
cardano-serialization-lib copied to clipboard

Ability to import `Transaction` into `TxBuilder`

Open FinleyMcIlwaine opened this issue 3 years ago • 1 comments

It would be nice if the TransactionBuilder API was able to "import" a pre-existing Transaction into the builder for further manipulation. Is there any reason this wouldn't be possible?

FinleyMcIlwaine avatar Sep 12 '22 18:09 FinleyMcIlwaine

Thank you for the request, @FinleyMcIlwaine! We'll look into trying to add this.

The only complication will be that internally the TransactionBuilder works by assuming many fields of the future transaction are empty or non-existing at the beginning and with initialising from an existing transaction that won't be true. For example, when the builder is called to calculate and add change if needed it calculates the fee size only if the value where not set before, with a pre-existing transaction the fee logically would also be already present. This might require some additional careful API changes.

vsubhuman avatar Sep 13 '22 08:09 vsubhuman