Skip to content

Commit

Permalink
Merge pull request #150 from jmagan/main
Browse files Browse the repository at this point in the history
feat: add setTxRefInputs method
  • Loading branch information
abdelkrimdev authored Sep 1, 2023
2 parents 2c2f97a + 4b1d972 commit 7a52a43
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions packages/module/src/transaction/transaction.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -547,6 +547,22 @@ export class Transaction {
return this;
}

/**
* Sets the reference inputs for the transaction.
*
* @param {UTxO[]} inputs The reference inputs to set.
* @returns {Transaction} The transaction.
*/
setTxRefInputs(inputs: UTxO[]): Transaction {
inputs
.map((input) => toTxUnspentOutput(input))
.forEach((utxo) => {
this._txBuilder.add_reference_input(utxo.input())
});

return this;
}

withdrawRewards(rewardAddress: string, lovelace: string): Transaction {
const address = toRewardAddress(rewardAddress);

Expand Down

1 comment on commit 7a52a43

@vercel
Copy link

@vercel vercel bot commented on 7a52a43 Sep 1, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.