@indigo-labs/indigo-sdk 0.1.10 → 0.1.12
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 +2 -2
- package/dist/index.mjs +2 -2
- package/package.json +1 -1
- package/src/contracts/lrp.ts +3 -3
package/dist/index.js
CHANGED
|
@@ -2837,7 +2837,6 @@ async function openLrp(assetTokenName, lovelacesAmt, maxPrice, lucid, lrpScriptH
|
|
|
2837
2837
|
);
|
|
2838
2838
|
}
|
|
2839
2839
|
async function cancelLrp(lrpOutRef, lrpRefScriptOutRef, lucid) {
|
|
2840
|
-
const ownAddr = await lucid.wallet().address();
|
|
2841
2840
|
const lrpScriptRefUtxo = matchSingle(
|
|
2842
2841
|
await lucid.utxosByOutRef([lrpRefScriptOutRef]),
|
|
2843
2842
|
(_) => new Error("Expected a single LRP Ref Script UTXO")
|
|
@@ -2846,7 +2845,8 @@ async function cancelLrp(lrpOutRef, lrpRefScriptOutRef, lucid) {
|
|
|
2846
2845
|
await lucid.utxosByOutRef([lrpOutRef]),
|
|
2847
2846
|
(_) => new Error("Expected a single LRP UTXO.")
|
|
2848
2847
|
);
|
|
2849
|
-
|
|
2848
|
+
const lrpDatum = parseLrpDatum(getInlineDatumOrThrow(lrpUtxo));
|
|
2849
|
+
return lucid.newTx().readFrom([lrpScriptRefUtxo]).collectFrom([lrpUtxo], serialiseLrpRedeemer("Cancel")).addSignerKey(lrpDatum.owner);
|
|
2850
2850
|
}
|
|
2851
2851
|
async function redeemLrp(redemptionLrpsData, lrpRefScriptOutRef, priceOracleOutRef, iassetOutRef, lucid, lrpParams, network) {
|
|
2852
2852
|
const lrpScriptRefUtxo = matchSingle(
|
package/dist/index.mjs
CHANGED
|
@@ -2752,7 +2752,6 @@ async function openLrp(assetTokenName, lovelacesAmt, maxPrice, lucid, lrpScriptH
|
|
|
2752
2752
|
);
|
|
2753
2753
|
}
|
|
2754
2754
|
async function cancelLrp(lrpOutRef, lrpRefScriptOutRef, lucid) {
|
|
2755
|
-
const ownAddr = await lucid.wallet().address();
|
|
2756
2755
|
const lrpScriptRefUtxo = matchSingle(
|
|
2757
2756
|
await lucid.utxosByOutRef([lrpRefScriptOutRef]),
|
|
2758
2757
|
(_) => new Error("Expected a single LRP Ref Script UTXO")
|
|
@@ -2761,7 +2760,8 @@ async function cancelLrp(lrpOutRef, lrpRefScriptOutRef, lucid) {
|
|
|
2761
2760
|
await lucid.utxosByOutRef([lrpOutRef]),
|
|
2762
2761
|
(_) => new Error("Expected a single LRP UTXO.")
|
|
2763
2762
|
);
|
|
2764
|
-
|
|
2763
|
+
const lrpDatum = parseLrpDatum(getInlineDatumOrThrow(lrpUtxo));
|
|
2764
|
+
return lucid.newTx().readFrom([lrpScriptRefUtxo]).collectFrom([lrpUtxo], serialiseLrpRedeemer("Cancel")).addSignerKey(lrpDatum.owner);
|
|
2765
2765
|
}
|
|
2766
2766
|
async function redeemLrp(redemptionLrpsData, lrpRefScriptOutRef, priceOracleOutRef, iassetOutRef, lucid, lrpParams, network) {
|
|
2767
2767
|
const lrpScriptRefUtxo = matchSingle(
|
package/package.json
CHANGED
package/src/contracts/lrp.ts
CHANGED
|
@@ -72,8 +72,6 @@ export async function cancelLrp(
|
|
|
72
72
|
lrpRefScriptOutRef: OutRef,
|
|
73
73
|
lucid: LucidEvolution,
|
|
74
74
|
): Promise<TxBuilder> {
|
|
75
|
-
const ownAddr = await lucid.wallet().address();
|
|
76
|
-
// TODO: use Promise.all
|
|
77
75
|
const lrpScriptRefUtxo = matchSingle(
|
|
78
76
|
await lucid.utxosByOutRef([lrpRefScriptOutRef]),
|
|
79
77
|
(_) => new Error('Expected a single LRP Ref Script UTXO'),
|
|
@@ -84,11 +82,13 @@ export async function cancelLrp(
|
|
|
84
82
|
(_) => new Error('Expected a single LRP UTXO.'),
|
|
85
83
|
);
|
|
86
84
|
|
|
85
|
+
const lrpDatum = parseLrpDatum(getInlineDatumOrThrow(lrpUtxo));
|
|
86
|
+
|
|
87
87
|
return lucid
|
|
88
88
|
.newTx()
|
|
89
89
|
.readFrom([lrpScriptRefUtxo])
|
|
90
90
|
.collectFrom([lrpUtxo], serialiseLrpRedeemer('Cancel'))
|
|
91
|
-
.
|
|
91
|
+
.addSignerKey(lrpDatum.owner);
|
|
92
92
|
}
|
|
93
93
|
|
|
94
94
|
export async function redeemLrp(
|