@indigo-labs/indigo-sdk 0.1.16 → 0.1.18
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.js +16 -0
- package/dist/index.mjs +16 -0
- package/package.json +1 -1
- package/src/contracts/lrp.ts +18 -0
package/dist/index.js
CHANGED
|
@@ -2896,13 +2896,29 @@ async function redeemLrp(redemptionLrpsData, lrpRefScriptOutRef, priceOracleOutR
|
|
|
2896
2896
|
},
|
|
2897
2897
|
priceOracleDatum.price
|
|
2898
2898
|
).getOnChainInt;
|
|
2899
|
+
console.log(lovelacesForRedemption, redeemIAssetAmt, priceOracleDatum.price);
|
|
2899
2900
|
const reimburstmentLovelaces = calculateFeeFromPercentage2(
|
|
2900
2901
|
iassetDatum.redemptionReimbursementPercentage,
|
|
2901
2902
|
lovelacesForRedemption
|
|
2902
2903
|
);
|
|
2904
|
+
console.log(reimburstmentLovelaces, iassetDatum.redemptionReimbursementPercentage, lovelacesForRedemption);
|
|
2903
2905
|
const lrpDatum = parseLrpDatum(getInlineDatumOrThrow(lrpUtxo));
|
|
2904
2906
|
const outputLovelacesAmt = lrpUtxo.assets.lovelace - lovelacesForRedemption + reimburstmentLovelaces;
|
|
2905
2907
|
const assetUnit = (0, import_lucid34.toUnit)(lrpParams.iassetPolicyId, mainLrpDatum.iasset);
|
|
2908
|
+
console.log(
|
|
2909
|
+
lrpUtxo.address,
|
|
2910
|
+
{
|
|
2911
|
+
kind: "inline",
|
|
2912
|
+
value: serialiseLrpDatum({
|
|
2913
|
+
...lrpDatum,
|
|
2914
|
+
lovelacesToSpend: lrpDatum.lovelacesToSpend - lovelacesForRedemption
|
|
2915
|
+
})
|
|
2916
|
+
},
|
|
2917
|
+
{
|
|
2918
|
+
lovelace: outputLovelacesAmt,
|
|
2919
|
+
[assetUnit]: redeemIAssetAmt + (lrpUtxo.assets[assetUnit] ?? 0n)
|
|
2920
|
+
}
|
|
2921
|
+
);
|
|
2906
2922
|
return acc.collectFrom(
|
|
2907
2923
|
[lrpUtxo],
|
|
2908
2924
|
serialiseLrpRedeemer(
|
package/dist/index.mjs
CHANGED
|
@@ -2805,13 +2805,29 @@ async function redeemLrp(redemptionLrpsData, lrpRefScriptOutRef, priceOracleOutR
|
|
|
2805
2805
|
},
|
|
2806
2806
|
priceOracleDatum.price
|
|
2807
2807
|
).getOnChainInt;
|
|
2808
|
+
console.log(lovelacesForRedemption, redeemIAssetAmt, priceOracleDatum.price);
|
|
2808
2809
|
const reimburstmentLovelaces = calculateFeeFromPercentage2(
|
|
2809
2810
|
iassetDatum.redemptionReimbursementPercentage,
|
|
2810
2811
|
lovelacesForRedemption
|
|
2811
2812
|
);
|
|
2813
|
+
console.log(reimburstmentLovelaces, iassetDatum.redemptionReimbursementPercentage, lovelacesForRedemption);
|
|
2812
2814
|
const lrpDatum = parseLrpDatum(getInlineDatumOrThrow(lrpUtxo));
|
|
2813
2815
|
const outputLovelacesAmt = lrpUtxo.assets.lovelace - lovelacesForRedemption + reimburstmentLovelaces;
|
|
2814
2816
|
const assetUnit = toUnit4(lrpParams.iassetPolicyId, mainLrpDatum.iasset);
|
|
2817
|
+
console.log(
|
|
2818
|
+
lrpUtxo.address,
|
|
2819
|
+
{
|
|
2820
|
+
kind: "inline",
|
|
2821
|
+
value: serialiseLrpDatum({
|
|
2822
|
+
...lrpDatum,
|
|
2823
|
+
lovelacesToSpend: lrpDatum.lovelacesToSpend - lovelacesForRedemption
|
|
2824
|
+
})
|
|
2825
|
+
},
|
|
2826
|
+
{
|
|
2827
|
+
lovelace: outputLovelacesAmt,
|
|
2828
|
+
[assetUnit]: redeemIAssetAmt + (lrpUtxo.assets[assetUnit] ?? 0n)
|
|
2829
|
+
}
|
|
2830
|
+
);
|
|
2815
2831
|
return acc.collectFrom(
|
|
2816
2832
|
[lrpUtxo],
|
|
2817
2833
|
serialiseLrpRedeemer(
|
package/package.json
CHANGED
package/src/contracts/lrp.ts
CHANGED
|
@@ -153,15 +153,33 @@ export async function redeemLrp(
|
|
|
153
153
|
},
|
|
154
154
|
priceOracleDatum.price,
|
|
155
155
|
).getOnChainInt;
|
|
156
|
+
|
|
157
|
+
console.log(lovelacesForRedemption, redeemIAssetAmt, priceOracleDatum.price);
|
|
156
158
|
const reimburstmentLovelaces = calculateFeeFromPercentage(
|
|
157
159
|
iassetDatum.redemptionReimbursementPercentage,
|
|
158
160
|
lovelacesForRedemption,
|
|
159
161
|
);
|
|
160
162
|
|
|
163
|
+
console.log(reimburstmentLovelaces, iassetDatum.redemptionReimbursementPercentage, lovelacesForRedemption);
|
|
164
|
+
|
|
161
165
|
const lrpDatum = parseLrpDatum(getInlineDatumOrThrow(lrpUtxo));
|
|
162
166
|
const outputLovelacesAmt = lrpUtxo.assets.lovelace - lovelacesForRedemption + reimburstmentLovelaces;
|
|
163
167
|
const assetUnit = toUnit(lrpParams.iassetPolicyId, mainLrpDatum.iasset);
|
|
164
168
|
|
|
169
|
+
console.log(lrpUtxo.address,
|
|
170
|
+
{
|
|
171
|
+
kind: 'inline',
|
|
172
|
+
value: serialiseLrpDatum({
|
|
173
|
+
...lrpDatum,
|
|
174
|
+
lovelacesToSpend:
|
|
175
|
+
lrpDatum.lovelacesToSpend - lovelacesForRedemption,
|
|
176
|
+
}),
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
lovelace: outputLovelacesAmt,
|
|
180
|
+
[assetUnit]: redeemIAssetAmt + (lrpUtxo.assets[assetUnit] ?? 0n),
|
|
181
|
+
});
|
|
182
|
+
|
|
165
183
|
return acc
|
|
166
184
|
.collectFrom(
|
|
167
185
|
[lrpUtxo],
|