Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
arobsn committed Sep 10, 2024
1 parent 9fc8086 commit 14c4a04
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions packages/core/src/builder/transactionBuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -273,12 +273,13 @@ export class TransactionBuilder {
let inputs = selector.select(target);

if (isDefined(this._changeAddress)) {
const manualMinting = target.tokens.some((x) => x.tokenId === inputs[0].boxId)
? inputs[0].boxId
const firstInputId = inputs[0].boxId;
const manualMintingTokenId = target.tokens.some((x) => x.tokenId === firstInputId)
? firstInputId
: undefined;

if (manualMinting) {
target.tokens = target.tokens.filter((x) => x.tokenId !== manualMinting);
if (manualMintingTokenId) {
target.tokens = target.tokens.filter((x) => x.tokenId !== manualMintingTokenId);
}

let change = utxoDiff(utxoSum(inputs), target);
Expand Down

0 comments on commit 14c4a04

Please sign in to comment.