@indigo-labs/indigo-sdk 0.2.13 → 0.2.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.js +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
- package/src/contracts/price-oracle/helpers.ts +2 -1
package/dist/index.js
CHANGED
|
@@ -862,7 +862,7 @@ function computeInterestLovelacesFor100PercentCR(collateral, mintedAmt, price) {
|
|
|
862
862
|
// src/contracts/price-oracle/helpers.ts
|
|
863
863
|
var import_lucid10 = require("@lucid-evolution/lucid");
|
|
864
864
|
function oracleExpirationAwareValidity(currentSlot, biasTime, oracleExpiration, network) {
|
|
865
|
-
const validateFrom = (0, import_lucid10.slotToUnixTime)(network, currentSlot - 1);
|
|
865
|
+
const validateFrom = (0, import_lucid10.slotToUnixTime)(network, currentSlot - 1) - Math.min(120 * ONE_SECOND, biasTime);
|
|
866
866
|
const defaultValidateTo = validateFrom + biasTime;
|
|
867
867
|
const cappedValidateTo = (0, import_lucid10.slotToUnixTime)(
|
|
868
868
|
network,
|
package/dist/index.mjs
CHANGED
|
@@ -628,7 +628,7 @@ import {
|
|
|
628
628
|
unixTimeToSlot
|
|
629
629
|
} from "@lucid-evolution/lucid";
|
|
630
630
|
function oracleExpirationAwareValidity(currentSlot, biasTime, oracleExpiration, network) {
|
|
631
|
-
const validateFrom = slotToUnixTime(network, currentSlot - 1);
|
|
631
|
+
const validateFrom = slotToUnixTime(network, currentSlot - 1) - Math.min(120 * ONE_SECOND, biasTime);
|
|
632
632
|
const defaultValidateTo = validateFrom + biasTime;
|
|
633
633
|
const cappedValidateTo = slotToUnixTime(
|
|
634
634
|
network,
|
package/package.json
CHANGED
|
@@ -3,6 +3,7 @@ import {
|
|
|
3
3
|
slotToUnixTime,
|
|
4
4
|
unixTimeToSlot,
|
|
5
5
|
} from '@lucid-evolution/lucid';
|
|
6
|
+
import { ONE_SECOND } from '../../utils/time-helpers';
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* Calculates the validity range based on the oracle expiration,
|
|
@@ -17,7 +18,7 @@ export function oracleExpirationAwareValidity(
|
|
|
17
18
|
validFrom: number;
|
|
18
19
|
validTo: number;
|
|
19
20
|
} {
|
|
20
|
-
const validateFrom = slotToUnixTime(network, currentSlot - 1);
|
|
21
|
+
const validateFrom = slotToUnixTime(network, currentSlot - 1) - Math.min(120 * ONE_SECOND, biasTime);
|
|
21
22
|
const defaultValidateTo = validateFrom + biasTime;
|
|
22
23
|
/// Take the oracle expiration time - 1 slot which is the last acceptable non-expired valid_to time
|
|
23
24
|
/// for the current oracle.
|