Skip to content
This repository was archived by the owner on May 11, 2026. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions src/utilities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,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
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we just added some new properties

* **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 = "";
Expand Down