@gvnrdao/dh-lit-actions 0.0.19 → 0.0.21
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
46aa819403d99c80e8fc953aa6e8e887f2962f761f7e78d65c6e4e39b6a03a59
|
|
@@ -1250,6 +1250,7 @@ var _LIT_ACTION_ = (() => {
|
|
|
1250
1250
|
];
|
|
1251
1251
|
try {
|
|
1252
1252
|
const result = await Lit.Actions.call({
|
|
1253
|
+
ipfsId: "",
|
|
1253
1254
|
chain: this.chain,
|
|
1254
1255
|
contractAddress: this.loanOpsManagerAddress,
|
|
1255
1256
|
abi,
|
|
@@ -1290,6 +1291,7 @@ var _LIT_ACTION_ = (() => {
|
|
|
1290
1291
|
];
|
|
1291
1292
|
try {
|
|
1292
1293
|
const result = await Lit.Actions.call({
|
|
1294
|
+
ipfsId: "",
|
|
1293
1295
|
chain: this.chain,
|
|
1294
1296
|
contractAddress: this.termManagerAddress,
|
|
1295
1297
|
abi,
|
|
@@ -1564,6 +1566,7 @@ var _LIT_ACTION_ = (() => {
|
|
|
1564
1566
|
}];
|
|
1565
1567
|
try {
|
|
1566
1568
|
const result = await Lit.Actions.call({
|
|
1569
|
+
ipfsId: "",
|
|
1567
1570
|
chain,
|
|
1568
1571
|
contractAddress,
|
|
1569
1572
|
abi: pausedAbi,
|
|
@@ -1592,6 +1595,7 @@ var _LIT_ACTION_ = (() => {
|
|
|
1592
1595
|
}];
|
|
1593
1596
|
try {
|
|
1594
1597
|
const result = await Lit.Actions.call({
|
|
1598
|
+
ipfsId: "",
|
|
1595
1599
|
chain,
|
|
1596
1600
|
contractAddress,
|
|
1597
1601
|
abi: emergencyModeAbi,
|
|
@@ -1620,6 +1624,7 @@ var _LIT_ACTION_ = (() => {
|
|
|
1620
1624
|
}];
|
|
1621
1625
|
try {
|
|
1622
1626
|
const result = await Lit.Actions.call({
|
|
1627
|
+
ipfsId: "",
|
|
1623
1628
|
chain,
|
|
1624
1629
|
contractAddress,
|
|
1625
1630
|
abi: circuitBreakerAbi,
|
|
@@ -1648,6 +1653,7 @@ var _LIT_ACTION_ = (() => {
|
|
|
1648
1653
|
}];
|
|
1649
1654
|
try {
|
|
1650
1655
|
const result = await Lit.Actions.call({
|
|
1656
|
+
ipfsId: "",
|
|
1651
1657
|
chain,
|
|
1652
1658
|
contractAddress,
|
|
1653
1659
|
abi: transfersPausedAbi,
|
|
@@ -1806,10 +1812,13 @@ var _LIT_ACTION_ = (() => {
|
|
|
1806
1812
|
throw new Error("auth.signature is required");
|
|
1807
1813
|
}
|
|
1808
1814
|
const currentTime = Date.now();
|
|
1809
|
-
const
|
|
1815
|
+
const timestampThreshold = 1e10;
|
|
1816
|
+
const isTimestampInSeconds = auth.timestamp < timestampThreshold;
|
|
1817
|
+
const timestampMs = isTimestampInSeconds ? auth.timestamp * 1e3 : auth.timestamp;
|
|
1818
|
+
const timestampAge = currentTime - timestampMs;
|
|
1810
1819
|
if (timestampAge < 0) {
|
|
1811
1820
|
throw new Error(
|
|
1812
|
-
`auth.timestamp is in the future: ${auth.timestamp} vs current ${currentTime}. This may indicate clock synchronization issues.`
|
|
1821
|
+
`auth.timestamp is in the future: ${auth.timestamp} ${isTimestampInSeconds ? "(seconds)" : "(milliseconds)"} vs current ${currentTime}ms. This may indicate clock synchronization issues.`
|
|
1813
1822
|
);
|
|
1814
1823
|
}
|
|
1815
1824
|
if (timestampAge > MAX_TIMESTAMP_AGE_MS) {
|
|
@@ -1817,7 +1826,7 @@ var _LIT_ACTION_ = (() => {
|
|
|
1817
1826
|
`auth.timestamp is too old: ${Math.round(timestampAge / 1e3)}s ago (max ${Math.round(MAX_TIMESTAMP_AGE_MS / 1e3)}s). Please refresh your authorization and try again.`
|
|
1818
1827
|
);
|
|
1819
1828
|
}
|
|
1820
|
-
console.log(` \u2705 Timestamp validation passed (${Math.round(timestampAge / 1e3)}s old)`);
|
|
1829
|
+
console.log(` \u2705 Timestamp validation passed (${Math.round(timestampAge / 1e3)}s old, format: ${isTimestampInSeconds ? "seconds" : "milliseconds"})`);
|
|
1821
1830
|
if (globalThis.amount === void 0 || globalThis.amount === null) {
|
|
1822
1831
|
throw new Error('Missing required parameter: "amount"');
|
|
1823
1832
|
}
|
|
@@ -1827,6 +1836,7 @@ var _LIT_ACTION_ = (() => {
|
|
|
1827
1836
|
}
|
|
1828
1837
|
console.log(" Fetching protocol mint limits...");
|
|
1829
1838
|
const minLoanValueResult = await Lit.Actions.call({
|
|
1839
|
+
ipfsId: "",
|
|
1830
1840
|
chain,
|
|
1831
1841
|
contractAddress: LOAN_OPS_MANAGER_ADDRESS,
|
|
1832
1842
|
abi: ABI_MINIMUM_LOAN_VALUE_WEI,
|
|
@@ -1835,6 +1845,7 @@ var _LIT_ACTION_ = (() => {
|
|
|
1835
1845
|
});
|
|
1836
1846
|
const MIN_MINT_AMOUNT = BigInt(minLoanValueResult.toString());
|
|
1837
1847
|
const maxLoanValueUcdResult = await Lit.Actions.call({
|
|
1848
|
+
ipfsId: "",
|
|
1838
1849
|
chain,
|
|
1839
1850
|
contractAddress: LOAN_OPS_MANAGER_ADDRESS,
|
|
1840
1851
|
abi: ABI_MAXIMUM_LOAN_VALUE_UCD,
|
|
@@ -1956,6 +1967,7 @@ var _LIT_ACTION_ = (() => {
|
|
|
1956
1967
|
console.log("[Step 4a] Validating daily mint limit...");
|
|
1957
1968
|
const totalMintAmount = amount + mintFee;
|
|
1958
1969
|
const remainingCapacity = await Lit.Actions.call({
|
|
1970
|
+
ipfsId: "",
|
|
1959
1971
|
chain,
|
|
1960
1972
|
contractAddress: UCD_CONTROLLER_ADDRESS,
|
|
1961
1973
|
abi: ABI_REMAINING_MINT_CAPACITY,
|
|
@@ -1978,6 +1990,7 @@ var _LIT_ACTION_ = (() => {
|
|
|
1978
1990
|
currentStep = "4b";
|
|
1979
1991
|
console.log("[Step 4b] Validating max supply limit...");
|
|
1980
1992
|
const maxSupplyResult = await Lit.Actions.call({
|
|
1993
|
+
ipfsId: "",
|
|
1981
1994
|
chain,
|
|
1982
1995
|
contractAddress: UCD_CONTROLLER_ADDRESS,
|
|
1983
1996
|
abi: ABI_MAX_SUPPLY,
|
|
@@ -1987,6 +2000,7 @@ var _LIT_ACTION_ = (() => {
|
|
|
1987
2000
|
const maxSupply = BigInt(maxSupplyResult.toString());
|
|
1988
2001
|
if (maxSupply > 0n) {
|
|
1989
2002
|
const currentSupplyResult = await Lit.Actions.call({
|
|
2003
|
+
ipfsId: "",
|
|
1990
2004
|
chain,
|
|
1991
2005
|
contractAddress: UCD_CONTROLLER_ADDRESS,
|
|
1992
2006
|
abi: ABI_CURRENT_SUPPLY,
|