Sign In

@pear-protocol/utils

Package Overview
Dependencies
Maintainers
4
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@pear-protocol/utils - npm Package Compare versions

Comparing version
0.4.1
to
0.4.2
+5
-1
dist/index.js
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) {

+2
-2

@@ -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;
{
"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 @@ },