@gvnrdao/dh-lit-actions 0.0.18 → 0.0.20

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
- 84a8466303485ebb09b869fbccc67837b02c24ddefad363f0e0bb56d1a33b388
1
+ 487c310167d785851cb9174b523c2463359e04cfa8e24d2a6afe12a7a7925b6b
@@ -1806,10 +1806,13 @@ var _LIT_ACTION_ = (() => {
1806
1806
  throw new Error("auth.signature is required");
1807
1807
  }
1808
1808
  const currentTime = Date.now();
1809
- const timestampAge = currentTime - auth.timestamp;
1809
+ const timestampThreshold = 1e10;
1810
+ const isTimestampInSeconds = auth.timestamp < timestampThreshold;
1811
+ const timestampMs = isTimestampInSeconds ? auth.timestamp * 1e3 : auth.timestamp;
1812
+ const timestampAge = currentTime - timestampMs;
1810
1813
  if (timestampAge < 0) {
1811
1814
  throw new Error(
1812
- `auth.timestamp is in the future: ${auth.timestamp} vs current ${currentTime}. This may indicate clock synchronization issues.`
1815
+ `auth.timestamp is in the future: ${auth.timestamp} ${isTimestampInSeconds ? "(seconds)" : "(milliseconds)"} vs current ${currentTime}ms. This may indicate clock synchronization issues.`
1813
1816
  );
1814
1817
  }
1815
1818
  if (timestampAge > MAX_TIMESTAMP_AGE_MS) {
@@ -1817,7 +1820,7 @@ var _LIT_ACTION_ = (() => {
1817
1820
  `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
1821
  );
1819
1822
  }
1820
- console.log(` \u2705 Timestamp validation passed (${Math.round(timestampAge / 1e3)}s old)`);
1823
+ console.log(` \u2705 Timestamp validation passed (${Math.round(timestampAge / 1e3)}s old, format: ${isTimestampInSeconds ? "seconds" : "milliseconds"})`);
1821
1824
  if (globalThis.amount === void 0 || globalThis.amount === null) {
1822
1825
  throw new Error('Missing required parameter: "amount"');
1823
1826
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gvnrdao/dh-lit-actions",
3
- "version": "0.0.18",
3
+ "version": "0.0.20",
4
4
  "type": "module",
5
5
  "description": "Diamond Hands Protocol LIT Actions - Deterministic, Auditable Builds",
6
6
  "main": "./pkg-dist/index.cjs",