Skip to content

Commit

Permalink
fix: add collateralUtxos to scope when searching for utxos to balance…
Browse files Browse the repository at this point in the history
… collateral change (#165)
  • Loading branch information
yHSJ authored Sep 11, 2024
1 parent bc7a59a commit ff8fd0a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/late-geese-tie.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@blaze-cardano/tx": patch
---

search collateralUtxos when balancing collateral change
5 changes: 4 additions & 1 deletion packages/blaze-tx/src/tx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1334,7 +1334,10 @@ export class TxBuilder {
return;
}
// Retrieve available UTXOs within scope.
const scope = [...this.utxoScope.values()];
const scope = [
...this.utxoScope.values(),
...this.collateralUtxos.values(),
];
// Calculate the total collateral based on the transaction fee and collateral percentage.
const totalCollateral = BigInt(
Math.ceil(
Expand Down

0 comments on commit ff8fd0a

Please sign in to comment.