@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('No asks in book');
92
+ throw new Error(`No asks in book for ${assetId}`);
93
93
  if (book.bids.length === 0)
94
- throw new Error('No bids in book');
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nevuamarkets/poly-websockets",
3
- "version": "0.0.4",
3
+ "version": "0.0.5",
4
4
  "description": "Plug-and-play Polymarket WebSocket price alerts",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -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('No asks in book');
117
- if (book.bids.length === 0) throw new Error('No bids in book');
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: