@indigo-labs/indigo-sdk 0.3.8 → 0.3.10

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.
@@ -50,8 +50,8 @@ import {
50
50
  import {
51
51
  buildRedemptionsTx,
52
52
  isFullyRedeemed,
53
- MIN_ROB_COLLATERAL_AMT as MIN_ROB_COLLATERAL_AMT,
54
- robAmountToSpend,
53
+ MIN_ROB_COLLATERAL_AMT,
54
+ robAmtToSpend,
55
55
  } from './helpers';
56
56
  import { match, P } from 'ts-pattern';
57
57
  import { Rational } from '../../types/rational';
@@ -232,7 +232,9 @@ export async function redeemRob(
232
232
  0n,
233
233
  refInputIdxs[2],
234
234
  refInputIdxs[1],
235
- priceOracleOutRef !== undefined ? refInputIdxs[3] : null,
235
+ priceOracleOutRef !== undefined
236
+ ? { OracleRefInputIdx: refInputIdxs[3] }
237
+ : 'OracleVoid',
236
238
  );
237
239
 
238
240
  tx.readFrom(allRefInputs);
@@ -272,7 +274,10 @@ export async function adjustRob(
272
274
  const robDatum = parseRobDatumOrThrow(getInlineDatumOrThrow(robUtxo));
273
275
 
274
276
  // The claim case
275
- if (adjustmentAmt === 0n && isFullyRedeemed(robUtxo, robDatum, sysParams)) {
277
+ if (
278
+ adjustmentAmt === 0n &&
279
+ isFullyRedeemed(robUtxo, robDatum, sysParams.cdpParams.cdpAssetSymbol)
280
+ ) {
276
281
  throw new Error(
277
282
  "When there's no more lovelaces to spend, use close instead of claim.",
278
283
  );
@@ -281,7 +286,8 @@ export async function adjustRob(
281
286
  // Negative adjust case
282
287
  if (
283
288
  adjustmentAmt < 0 &&
284
- robAmountToSpend(robUtxo, robDatum, sysParams) <= -adjustmentAmt
289
+ robAmtToSpend(robUtxo, robDatum, sysParams.cdpParams.cdpAssetSymbol) <=
290
+ -adjustmentAmt
285
291
  ) {
286
292
  throw new Error(
287
293
  "Can't adjust negatively by more than available. Also, for adjusting by exactly the amount deposited, a close action should be used instead.",