@nevuamarkets/poly-websockets 0.0.4 → 0.0.5
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.
|
@@ -89,9 +89,9 @@ class OrderBookCache {
|
|
|
89
89
|
if (!book)
|
|
90
90
|
throw new Error(`Book for ${assetId} not cached`);
|
|
91
91
|
if (book.asks.length === 0)
|
|
92
|
-
throw new Error(
|
|
92
|
+
throw new Error(`No asks in book for ${assetId}`);
|
|
93
93
|
if (book.bids.length === 0)
|
|
94
|
-
throw new Error(
|
|
94
|
+
throw new Error(`No bids in book for ${assetId}`);
|
|
95
95
|
/*
|
|
96
96
|
* Polymarket book events are currently sorted as such:
|
|
97
97
|
* - bids ascending
|
package/package.json
CHANGED
|
@@ -113,8 +113,8 @@ export class OrderBookCache {
|
|
|
113
113
|
public spreadOver(assetId: string, cents = 0.1): boolean {
|
|
114
114
|
const book = this.bookCache[assetId];
|
|
115
115
|
if (!book) throw new Error(`Book for ${assetId} not cached`);
|
|
116
|
-
if (book.asks.length === 0) throw new Error(
|
|
117
|
-
if (book.bids.length === 0) throw new Error(
|
|
116
|
+
if (book.asks.length === 0) throw new Error(`No asks in book for ${assetId}`);
|
|
117
|
+
if (book.bids.length === 0) throw new Error(`No bids in book for ${assetId}`);
|
|
118
118
|
|
|
119
119
|
/*
|
|
120
120
|
* Polymarket book events are currently sorted as such:
|