@pear-protocol/utils
Advanced tools
+5
-1
| import BigNumber9 from 'bignumber.js'; | ||
| import { sha256 } from '@noble/hashes/sha256'; | ||
| import { bytesToHex } from '@noble/hashes/utils'; | ||
| import { WATERMARK_FUTURE_SKEW_MS } from '@pear-protocol/types'; | ||
@@ -1666,3 +1667,6 @@ // src/asset/compute.ts | ||
| function _isValidExternalTimestamp(timestamp) { | ||
| return Number.isFinite(timestamp) && timestamp >= 0; | ||
| if (!Number.isFinite(timestamp) || timestamp < 0) { | ||
| return false; | ||
| } | ||
| return timestamp <= Date.now() + WATERMARK_FUTURE_SKEW_MS; | ||
| } | ||
@@ -1669,0 +1673,0 @@ function groupConfirmablesByPosition(confirmableFills) { |
@@ -1,2 +0,2 @@ | ||
| import type { HttpTypes } from '@pear-protocol/types'; | ||
| import { type HttpTypes } from '@pear-protocol/types'; | ||
| import type { ComputeSyncPayloadArgs, ComputeSyncPayloadResult } from './types'; | ||
@@ -32,3 +32,3 @@ /** | ||
| export declare function _isValidExternalQuantity(quantity: string): boolean; | ||
| /** Returns true only when the timestamp is a non-negative finite number. */ | ||
| /** Returns true only when the timestamp is a non-negative finite number no further than clock skew ahead of now. */ | ||
| export declare function _isValidExternalTimestamp(timestamp: number): boolean; |
+2
-2
| { | ||
| "name": "@pear-protocol/utils", | ||
| "version": "0.4.1", | ||
| "version": "0.4.2", | ||
| "description": "Pear Protocol Utility functions", | ||
@@ -30,3 +30,3 @@ "private": false, | ||
| "@noble/hashes": "^1.3.2", | ||
| "@pear-protocol/types": "^1.15.1", | ||
| "@pear-protocol/types": "^1.16.0", | ||
| "bignumber.js": "9.3.1" | ||
@@ -33,0 +33,0 @@ }, |
99117
0.19%2593
0.15%Updated