From 513399899586a73cb962fb749087fac7a03a0f59 Mon Sep 17 00:00:00 2001 From: Goran Legris Date: Fri, 23 May 2025 23:32:25 -0400 Subject: [PATCH] - Added jsdoc to inform user that they must have correct properties orders to generate correct hash --- src/utilities.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/utilities.ts b/src/utilities.ts index ab2096e2..003c228e 100644 --- a/src/utilities.ts +++ b/src/utilities.ts @@ -70,9 +70,12 @@ export const decimalPlaces = (num: number): number => { }; /** - * Calculates the hash for the given orderbook - * @param orderbook - * @returns + * Calculates the SHA‑1 hash for the given orderbook. + * + * @param {OrderBookSummary} orderbook + * **must** have its properties in _exactly_ this order: + * `market`, `asset_id`, `timestamp`, `hash`, `bids`, `asks` + * @returns {string} the hex‑encoded SHA‑1 */ export const generateOrderBookSummaryHash = (orderbook: OrderBookSummary): string => { orderbook.hash = "";