@indigo-labs/indigo-sdk 0.1.17 → 0.1.19
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 +3 -15
- package/dist/index.mjs +3 -15
- package/package.json +1 -1
- package/src/contracts/lrp.ts +5 -15
package/dist/index.js
CHANGED
|
@@ -2896,27 +2896,15 @@ 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);
|
|
2906
|
-
console.log(
|
|
2907
|
-
lrpUtxo.address,
|
|
2908
|
-
{
|
|
2909
|
-
kind: "inline",
|
|
2910
|
-
value: serialiseLrpDatum({
|
|
2911
|
-
...lrpDatum,
|
|
2912
|
-
lovelacesToSpend: lrpDatum.lovelacesToSpend - lovelacesForRedemption
|
|
2913
|
-
})
|
|
2914
|
-
},
|
|
2915
|
-
{
|
|
2916
|
-
lovelace: outputLovelacesAmt,
|
|
2917
|
-
[assetUnit]: redeemIAssetAmt + (lrpUtxo.assets[assetUnit] ?? 0n)
|
|
2918
|
-
}
|
|
2919
|
-
);
|
|
2920
2908
|
return acc.collectFrom(
|
|
2921
2909
|
[lrpUtxo],
|
|
2922
2910
|
serialiseLrpRedeemer(
|
|
@@ -2996,7 +2984,7 @@ async function adjustLrp(lucid, lrpOutRef, lovelacesAdjustAmt, lrpRefScriptOutRe
|
|
|
2996
2984
|
mkAssetsOf(rewardAssetClass, -rewardAssetsAmt),
|
|
2997
2985
|
mkLovelacesOf(lovelacesAdjustAmt)
|
|
2998
2986
|
)
|
|
2999
|
-
).
|
|
2987
|
+
).addSignerKey(lrpDatum.owner);
|
|
3000
2988
|
}
|
|
3001
2989
|
async function claimLrp(lucid, lrpOutRef, lrpRefScriptOutRef, lrpParams) {
|
|
3002
2990
|
return adjustLrp(lucid, lrpOutRef, 0n, lrpRefScriptOutRef, lrpParams);
|
package/dist/index.mjs
CHANGED
|
@@ -2805,27 +2805,15 @@ 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);
|
|
2815
|
-
console.log(
|
|
2816
|
-
lrpUtxo.address,
|
|
2817
|
-
{
|
|
2818
|
-
kind: "inline",
|
|
2819
|
-
value: serialiseLrpDatum({
|
|
2820
|
-
...lrpDatum,
|
|
2821
|
-
lovelacesToSpend: lrpDatum.lovelacesToSpend - lovelacesForRedemption
|
|
2822
|
-
})
|
|
2823
|
-
},
|
|
2824
|
-
{
|
|
2825
|
-
lovelace: outputLovelacesAmt,
|
|
2826
|
-
[assetUnit]: redeemIAssetAmt + (lrpUtxo.assets[assetUnit] ?? 0n)
|
|
2827
|
-
}
|
|
2828
|
-
);
|
|
2829
2817
|
return acc.collectFrom(
|
|
2830
2818
|
[lrpUtxo],
|
|
2831
2819
|
serialiseLrpRedeemer(
|
|
@@ -2905,7 +2893,7 @@ async function adjustLrp(lucid, lrpOutRef, lovelacesAdjustAmt, lrpRefScriptOutRe
|
|
|
2905
2893
|
mkAssetsOf(rewardAssetClass, -rewardAssetsAmt),
|
|
2906
2894
|
mkLovelacesOf(lovelacesAdjustAmt)
|
|
2907
2895
|
)
|
|
2908
|
-
).
|
|
2896
|
+
).addSignerKey(lrpDatum.owner);
|
|
2909
2897
|
}
|
|
2910
2898
|
async function claimLrp(lucid, lrpOutRef, lrpRefScriptOutRef, lrpParams) {
|
|
2911
2899
|
return adjustLrp(lucid, lrpOutRef, 0n, lrpRefScriptOutRef, lrpParams);
|
package/package.json
CHANGED
package/src/contracts/lrp.ts
CHANGED
|
@@ -153,29 +153,19 @@ 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
|
|
|
165
|
-
console.log(lrpUtxo.address,
|
|
166
|
-
{
|
|
167
|
-
kind: 'inline',
|
|
168
|
-
value: serialiseLrpDatum({
|
|
169
|
-
...lrpDatum,
|
|
170
|
-
lovelacesToSpend:
|
|
171
|
-
lrpDatum.lovelacesToSpend - lovelacesForRedemption,
|
|
172
|
-
}),
|
|
173
|
-
},
|
|
174
|
-
{
|
|
175
|
-
lovelace: outputLovelacesAmt,
|
|
176
|
-
[assetUnit]: redeemIAssetAmt + (lrpUtxo.assets[assetUnit] ?? 0n),
|
|
177
|
-
});
|
|
178
|
-
|
|
179
169
|
return acc
|
|
180
170
|
.collectFrom(
|
|
181
171
|
[lrpUtxo],
|
|
@@ -302,7 +292,7 @@ export async function adjustLrp(
|
|
|
302
292
|
mkLovelacesOf(lovelacesAdjustAmt),
|
|
303
293
|
),
|
|
304
294
|
)
|
|
305
|
-
.
|
|
295
|
+
.addSignerKey(lrpDatum.owner);
|
|
306
296
|
}
|
|
307
297
|
|
|
308
298
|
/**
|