Skip to content

Commit

Permalink
feat: add toCbor() for debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
joacohoyos authored and EzePze committed Sep 8, 2024
1 parent a890bf5 commit 3946a63
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/nasty-emus-teach.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@blaze-cardano/tx": patch
---

Add toCbor() function to print partial transaction
9 changes: 9 additions & 0 deletions packages/blaze-tx/src/tx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 3946a63

Please sign in to comment.