diff --git a/.changeset/nasty-emus-teach.md b/.changeset/nasty-emus-teach.md new file mode 100644 index 0000000..1254fa1 --- /dev/null +++ b/.changeset/nasty-emus-teach.md @@ -0,0 +1,5 @@ +--- +"@blaze-cardano/tx": patch +--- + +Add toCbor() function to print partial transaction diff --git a/packages/blaze-tx/src/tx.ts b/packages/blaze-tx/src/tx.ts index 9fd3adc..0d84ec8 100644 --- a/packages/blaze-tx/src/tx.ts +++ b/packages/blaze-tx/src/tx.ts @@ -1238,6 +1238,15 @@ export class TxBuilder { this.body.setTotalCollateral(totalCollateral); } + /** + * Prints the transaction cbor in its current state without trying to complete it + * @returns {string} The CBOR representation of the transaction + * */ + toCbor(): string { + const tw = this.buildTransactionWitnessSet(); + return new Transaction(this.body, tw, this.auxiliaryData).toCbor(); + } + /** * Completes the transaction by performing several key operations: * - Verifies the presence of a change address.