From e1c76f7e5d03756bff2f863f2d0718698818bc7e Mon Sep 17 00:00:00 2001 From: EzePze Date: Sun, 25 Feb 2024 03:59:52 +1100 Subject: [PATCH] sorted --- src/launchpad.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/launchpad.ts b/src/launchpad.ts index fe8fbf7..ae2fff2 100644 --- a/src/launchpad.ts +++ b/src/launchpad.ts @@ -235,6 +235,14 @@ export abstract class LaunchPad { throw new Error("Admin datum must be in the closed state!"); } + depositedUtxos.sort((a, b) => { + let txCompare = a.txHash.localeCompare(b.txHash) + if (txCompare==0){ + return a.outputIndex-b.outputIndex + } + return txCompare + }) + const depositReturns = depositedUtxos.map((depositUTxO) => { const depositDatum = Data.from(depositUTxO.datum!, SaleTypes2["_r"]); return calculateProrata(