@0xarchive/sdk 0.3.4 → 0.3.6

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.
package/README.md CHANGED
@@ -21,7 +21,7 @@ const client = new OxArchive({ apiKey: 'ox_your_api_key' });
21
21
 
22
22
  // Get current order book
23
23
  const orderbook = await client.orderbook.get('BTC');
24
- console.log(`BTC mid price: ${orderbook.mid_price}`);
24
+ console.log(`BTC mid price: ${orderbook.midPrice}`);
25
25
 
26
26
  // Get historical order book snapshots
27
27
  const history = await client.orderbook.history('ETH', {
@@ -158,7 +158,7 @@ ws.subscribeAllTickers();
158
158
 
159
159
  // Handle real-time data with typed callbacks
160
160
  ws.onOrderbook((coin, data) => {
161
- console.log(`${coin} mid price: ${data.mid_price}`);
161
+ console.log(`${coin} mid price: ${data.midPrice}`);
162
162
  });
163
163
 
164
164
  ws.onTrades((coin, trades) => {
@@ -185,7 +185,7 @@ ws.connect();
185
185
 
186
186
  // Handle replay data - this is where historical records arrive
187
187
  ws.onHistoricalData((coin, timestamp, data) => {
188
- console.log(`${new Date(timestamp).toISOString()}: ${data.mid_price}`);
188
+ console.log(`${new Date(timestamp).toISOString()}: ${data.midPrice}`);
189
189
  });
190
190
 
191
191
  // Replay lifecycle events