Skip to content

Commit

Permalink
add collateral only when using plutus
Browse files Browse the repository at this point in the history
  • Loading branch information
baymac committed Apr 10, 2024
1 parent 7af6dc8 commit 03ef8b7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/translucent/src/translucent/tx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -840,8 +840,10 @@ export class Tx {
);
}
this.txBuilder.select_utxos(2);

{
const isUsingPlutus = this.UTxOs.some((utxo) =>
utxo.output().address().payment_cred()?.to_scripthash()
&& utxo.output().datum())
if (isUsingPlutus) {
let foundUtxo = walletUTxOs.find(
(x) =>
BigInt(x.output().amount().coin().to_str()) >=
Expand Down

0 comments on commit 03ef8b7

Please sign in to comment.