diff --git a/src/stableswap.ts b/src/stableswap.ts index 57f4512..3198fbb 100644 --- a/src/stableswap.ts +++ b/src/stableswap.ts @@ -343,9 +343,6 @@ export class Stableswap { }, orderAssets ); - if (Object.keys(reductionAssets).length !== 0) { - tx.payToAddress(sender, reductionAssets); - } if (customReceiver && customReceiver.receiverDatum) { const utxoForStoringDatum = buildUtxoToStoreDatum( @@ -363,6 +360,9 @@ export class Stableswap { } } } + if (Object.keys(reductionAssets).length !== 0) { + tx.payToAddress(sender, reductionAssets); + } tx.attachMetadata(674, { msg: [ orderOptions.length > 1