@lucid-evolution/utils 0.1.12 → 0.1.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +2 -3
- package/dist/index.js +2 -3
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1090,8 +1090,7 @@ var selectUTxOs = (utxos, totalAssets) => {
|
|
|
1090
1090
|
const selectedUtxos = [];
|
|
1091
1091
|
let isSelected = false;
|
|
1092
1092
|
const assetsRequired = new Map(Object.entries(totalAssets));
|
|
1093
|
-
const
|
|
1094
|
-
for (const utxo of sortedUtxos) {
|
|
1093
|
+
for (const utxo of utxos) {
|
|
1095
1094
|
isSelected = false;
|
|
1096
1095
|
for (const [unit, amount] of assetsRequired) {
|
|
1097
1096
|
if (Object.hasOwn(utxo.assets, unit)) {
|
|
@@ -1116,7 +1115,7 @@ var selectUTxOs = (utxos, totalAssets) => {
|
|
|
1116
1115
|
return selectedUtxos;
|
|
1117
1116
|
};
|
|
1118
1117
|
var sortUTxOs = (utxos, order = "descending") => {
|
|
1119
|
-
return utxos.
|
|
1118
|
+
return [...utxos].sort((a, b) => {
|
|
1120
1119
|
if (a.assets["lovelace"] > b.assets["lovelace"]) {
|
|
1121
1120
|
return order === "ascending" ? 1 : -1;
|
|
1122
1121
|
}
|
package/dist/index.js
CHANGED
|
@@ -1010,8 +1010,7 @@ var selectUTxOs = (utxos, totalAssets) => {
|
|
|
1010
1010
|
const selectedUtxos = [];
|
|
1011
1011
|
let isSelected = false;
|
|
1012
1012
|
const assetsRequired = new Map(Object.entries(totalAssets));
|
|
1013
|
-
const
|
|
1014
|
-
for (const utxo of sortedUtxos) {
|
|
1013
|
+
for (const utxo of utxos) {
|
|
1015
1014
|
isSelected = false;
|
|
1016
1015
|
for (const [unit, amount] of assetsRequired) {
|
|
1017
1016
|
if (Object.hasOwn(utxo.assets, unit)) {
|
|
@@ -1036,7 +1035,7 @@ var selectUTxOs = (utxos, totalAssets) => {
|
|
|
1036
1035
|
return selectedUtxos;
|
|
1037
1036
|
};
|
|
1038
1037
|
var sortUTxOs = (utxos, order = "descending") => {
|
|
1039
|
-
return utxos.
|
|
1038
|
+
return [...utxos].sort((a, b) => {
|
|
1040
1039
|
if (a.assets["lovelace"] > b.assets["lovelace"]) {
|
|
1041
1040
|
return order === "ascending" ? 1 : -1;
|
|
1042
1041
|
}
|