@alpha-arcade/sdk 0.3.0 → 0.4.0

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/dist/index.d.cts CHANGED
@@ -147,6 +147,18 @@ type ProposeMatchParams = {
147
147
  /** Quantity to match in microunits */
148
148
  quantityMatched: number;
149
149
  };
150
+ /**
151
+ * Parameters for matching two existing limit orders (e.g. after an amend).
152
+ * The taker is the order placed last and pays the fee; the maker is the counterparty.
153
+ */
154
+ type ProcessMatchParams = {
155
+ /** Market app ID */
156
+ marketAppId: number;
157
+ /** Maker escrow app ID (existing order — was on the book first) */
158
+ makerEscrowAppId: number;
159
+ /** Taker escrow app ID (existing order — placed last, pays the fee) */
160
+ takerEscrowAppId: number;
161
+ };
150
162
  /** Parameters for amending (editing) an existing unfilled order */
151
163
  type AmendOrderParams = {
152
164
  /** Market app ID */
@@ -202,6 +214,15 @@ type ProposeMatchResult = {
202
214
  /** Confirmed round number */
203
215
  confirmedRound: number;
204
216
  };
217
+ /** Result of processing a match between two existing orders */
218
+ type ProcessMatchResult = {
219
+ /** Whether the match succeeded */
220
+ success: boolean;
221
+ /** Transaction IDs */
222
+ txIds: string[];
223
+ /** Confirmed round number */
224
+ confirmedRound: number;
225
+ };
205
226
  /** Result of amending an order */
206
227
  type AmendOrderResult = {
207
228
  /** Whether the amendment succeeded */
@@ -210,6 +231,10 @@ type AmendOrderResult = {
210
231
  txIds: string[];
211
232
  /** Confirmed round number */
212
233
  confirmedRound: number;
234
+ /** Total quantity matched against counterparty orders (if matching was performed) */
235
+ matchedQuantity?: number;
236
+ /** Volume-weighted average fill price in microunits (if any matches) */
237
+ matchedPrice?: number;
213
238
  };
214
239
  /** A single entry in the orderbook (one price level, one order) */
215
240
  type OrderbookEntry = {
@@ -337,6 +362,76 @@ type EscrowGlobalState = {
337
362
  asset_listed?: number;
338
363
  fee_timer_start?: number;
339
364
  };
365
+ /** Configuration for AlphaWebSocket */
366
+ type AlphaWebSocketConfig = {
367
+ /** WebSocket URL override (default: wss://wss.platform.alphaarcade.com) */
368
+ url?: string;
369
+ /** Enable auto-reconnect on unexpected disconnect (default: true) */
370
+ reconnect?: boolean;
371
+ /** Maximum reconnect attempts before giving up (default: Infinity) */
372
+ maxReconnectAttempts?: number;
373
+ /** Heartbeat interval in ms (default: 60000) */
374
+ heartbeatIntervalMs?: number;
375
+ /**
376
+ * WebSocket constructor to use. Defaults to the global `WebSocket`.
377
+ * On Node.js < 22, pass the `ws` package: `import WebSocket from 'ws'; new AlphaWebSocket({ WebSocket })`
378
+ */
379
+ WebSocket?: unknown;
380
+ };
381
+ /** Orderbook bid/ask entry at the top level (decimal cents) */
382
+ type WsOrderbookAggregatedEntry = {
383
+ price: number;
384
+ quantity: number;
385
+ total: number;
386
+ };
387
+ /** Orderbook bid/ask entry with escrow details (raw microunit prices) */
388
+ type WsOrderbookDetailEntry = {
389
+ price: number;
390
+ quantity: number;
391
+ total: number;
392
+ escrowAppId: number;
393
+ owner: string;
394
+ };
395
+ /** Per-side orderbook detail (yes or no) */
396
+ type WsOrderbookDetailSide = {
397
+ bids: WsOrderbookDetailEntry[];
398
+ asks: WsOrderbookDetailEntry[];
399
+ };
400
+ /** Orderbook data for a single app within the orderbook payload */
401
+ type WsOrderbookApp = {
402
+ bids: WsOrderbookAggregatedEntry[];
403
+ asks: WsOrderbookAggregatedEntry[];
404
+ spread: number;
405
+ yes: WsOrderbookDetailSide;
406
+ no: WsOrderbookDetailSide;
407
+ };
408
+ /** Payload for orderbook_changed events */
409
+ type OrderbookChangedEvent = {
410
+ type: 'orderbook_changed';
411
+ ts: number;
412
+ marketId: string;
413
+ orderbook: Record<string, WsOrderbookApp>;
414
+ };
415
+ /** Payload for markets_changed events (incremental diffs) */
416
+ type MarketsChangedEvent = {
417
+ type: 'markets_changed';
418
+ ts: number;
419
+ [key: string]: unknown;
420
+ };
421
+ /** Payload for market_changed events (single market) */
422
+ type MarketChangedEvent = {
423
+ type: 'market_changed';
424
+ ts: number;
425
+ [key: string]: unknown;
426
+ };
427
+ /** Payload for wallet_orders_changed events */
428
+ type WalletOrdersChangedEvent = {
429
+ type: 'wallet_orders_changed';
430
+ ts: number;
431
+ [key: string]: unknown;
432
+ };
433
+ /** Discriminated union of all WebSocket stream events */
434
+ type WebSocketStreamEvent = MarketsChangedEvent | MarketChangedEvent | OrderbookChangedEvent | WalletOrdersChangedEvent;
340
435
 
341
436
  /**
342
437
  * The main client for interacting with Alpha Market prediction markets on Algorand.
@@ -423,6 +518,17 @@ declare class AlphaClient {
423
518
  * @returns Whether the match succeeded
424
519
  */
425
520
  proposeMatch(params: ProposeMatchParams): Promise<ProposeMatchResult>;
521
+ /**
522
+ * Matches two existing limit orders (no create-escrow in the group).
523
+ *
524
+ * Calls the market app's process_potential_match(maker, taker). Use this
525
+ * after amending an order: the amended order is the taker (pays the fee),
526
+ * the counterparty is the maker.
527
+ *
528
+ * @param params - Process match params (marketAppId, makerEscrowAppId, takerEscrowAppId)
529
+ * @returns Whether the match succeeded
530
+ */
531
+ processMatch(params: ProcessMatchParams): Promise<ProcessMatchResult>;
426
532
  /**
427
533
  * Amends (edits) an existing unfilled order in-place.
428
534
  *
@@ -561,6 +667,93 @@ declare class AlphaClient {
561
667
  getMarketFromApi(marketId: string): Promise<Market | null>;
562
668
  }
563
669
 
670
+ /**
671
+ * Real-time WebSocket client for Alpha Market platform streams.
672
+ *
673
+ * Connects to `wss://wss.platform.alphaarcade.com` and provides typed,
674
+ * callback-based subscriptions for live market data. No auth required.
675
+ *
676
+ * @example
677
+ * ```typescript
678
+ * // Node.js 22+ or browser (native WebSocket)
679
+ * const ws = new AlphaWebSocket();
680
+ *
681
+ * // Node.js < 22 — pass the `ws` package
682
+ * import WebSocket from 'ws';
683
+ * const ws = new AlphaWebSocket({ WebSocket });
684
+ *
685
+ * const unsub = ws.subscribeOrderbook('will-btc-hit-100k', (event) => {
686
+ * console.log('Orderbook:', event.orderbook);
687
+ * });
688
+ *
689
+ * // Later
690
+ * unsub();
691
+ * ws.close();
692
+ * ```
693
+ */
694
+ declare class AlphaWebSocket {
695
+ private url;
696
+ private reconnectEnabled;
697
+ private maxReconnectAttempts;
698
+ private heartbeatIntervalMs;
699
+ private WebSocketImpl;
700
+ private ws;
701
+ private subscriptions;
702
+ private pendingRequests;
703
+ private heartbeatTimer;
704
+ private reconnectTimer;
705
+ private reconnectAttempts;
706
+ private intentionallyClosed;
707
+ private connectPromise;
708
+ constructor(config?: AlphaWebSocketConfig);
709
+ /** Whether the WebSocket is currently open and connected */
710
+ get connected(): boolean;
711
+ /**
712
+ * Subscribe to live market probability updates (incremental diffs).
713
+ * @returns An unsubscribe function
714
+ */
715
+ subscribeLiveMarkets(callback: (event: MarketsChangedEvent) => void): () => void;
716
+ /**
717
+ * Subscribe to change events for a single market.
718
+ * @param slug - The market slug
719
+ * @returns An unsubscribe function
720
+ */
721
+ subscribeMarket(slug: string, callback: (event: MarketChangedEvent) => void): () => void;
722
+ /**
723
+ * Subscribe to full orderbook snapshots (~5s interval on changes).
724
+ * @param slug - The market slug
725
+ * @returns An unsubscribe function
726
+ */
727
+ subscribeOrderbook(slug: string, callback: (event: OrderbookChangedEvent) => void): () => void;
728
+ /**
729
+ * Subscribe to wallet order updates.
730
+ * @param wallet - The wallet address
731
+ * @returns An unsubscribe function
732
+ */
733
+ subscribeWalletOrders(wallet: string, callback: (event: WalletOrdersChangedEvent) => void): () => void;
734
+ /** Query the server for the list of active subscriptions on this connection */
735
+ listSubscriptions(): Promise<unknown>;
736
+ /** Query a server property (e.g. "heartbeat", "limits") */
737
+ getProperty(property: string): Promise<unknown>;
738
+ /** Open the WebSocket connection. Called automatically on first subscribe. */
739
+ connect(): Promise<void>;
740
+ /** Close the connection and clean up all resources */
741
+ close(): void;
742
+ private buildStreamKey;
743
+ private buildQueryString;
744
+ private subscribe;
745
+ private doConnect;
746
+ private handleMessage;
747
+ private sendSubscribe;
748
+ private sendUnsubscribe;
749
+ private sendRequest;
750
+ private send;
751
+ private startHeartbeat;
752
+ private stopHeartbeat;
753
+ private scheduleReconnect;
754
+ private clearTimers;
755
+ }
756
+
564
757
  /**
565
758
  * Fetches all live, tradeable markets directly from the Algorand blockchain.
566
759
  *
@@ -603,6 +796,7 @@ declare const getLiveMarketsFromApi: (config: AlphaClientConfig) => Promise<Mark
603
796
  declare const getMarketFromApi: (config: AlphaClientConfig, marketId: string) => Promise<Market | null>;
604
797
 
605
798
  declare const DEFAULT_API_BASE_URL = "https://platform.alphaarcade.com/api";
799
+ declare const DEFAULT_WSS_BASE_URL = "wss://wss.platform.alphaarcade.com";
606
800
  declare const DEFAULT_MARKET_CREATOR_ADDRESS = "5P5Y6HTWUNG2E3VXBQDZN3ENZD3JPAIR5PKT3LOYJAPAUKOLFD6KANYTRY";
607
801
 
608
802
  /**
@@ -684,4 +878,4 @@ declare const getEscrowGlobalState: (indexerClient: algosdk.Indexer, escrowAppId
684
878
  */
685
879
  declare const checkAssetOptIn: (algodClient: algosdk.Algodv2, address: string, assetId: number) => Promise<boolean>;
686
880
 
687
- export { type AggregatedOrderbook, type AggregatedOrderbookEntry, type AggregatedOrderbookSide, AlphaClient, type AlphaClientConfig, type AmendOrderParams, type AmendOrderResult, type CancelOrderParams, type CancelOrderResult, type ClaimParams, type ClaimResult, type CounterpartyMatch, type CreateLimitOrderParams, type CreateMarketOrderParams, type CreateOrderResult, DEFAULT_API_BASE_URL, DEFAULT_MARKET_CREATOR_ADDRESS, type EscrowGlobalState, type Market, type MarketGlobalState, type MarketOption, type MergeSharesParams, type OpenOrder, type OrderSide, type Orderbook, type OrderbookEntry, type OrderbookSide, type Position, type ProposeMatchParams, type ProposeMatchResult, type SplitMergeResult, type SplitSharesParams, type WalletPosition, calculateFee, calculateFeeFromTotal, calculateMatchingOrders, checkAssetOptIn, decodeGlobalState, getEscrowGlobalState, getLiveMarketsFromApi, getMarketFromApi, getMarketGlobalState, getMarketOnChain, getMarketsOnChain };
881
+ export { type AggregatedOrderbook, type AggregatedOrderbookEntry, type AggregatedOrderbookSide, AlphaClient, type AlphaClientConfig, AlphaWebSocket, type AlphaWebSocketConfig, type AmendOrderParams, type AmendOrderResult, type CancelOrderParams, type CancelOrderResult, type ClaimParams, type ClaimResult, type CounterpartyMatch, type CreateLimitOrderParams, type CreateMarketOrderParams, type CreateOrderResult, DEFAULT_API_BASE_URL, DEFAULT_MARKET_CREATOR_ADDRESS, DEFAULT_WSS_BASE_URL, type EscrowGlobalState, type Market, type MarketChangedEvent, type MarketGlobalState, type MarketOption, type MarketsChangedEvent, type MergeSharesParams, type OpenOrder, type OrderSide, type Orderbook, type OrderbookChangedEvent, type OrderbookEntry, type OrderbookSide, type Position, type ProcessMatchParams, type ProcessMatchResult, type ProposeMatchParams, type ProposeMatchResult, type SplitMergeResult, type SplitSharesParams, type WalletOrdersChangedEvent, type WalletPosition, type WebSocketStreamEvent, type WsOrderbookAggregatedEntry, type WsOrderbookApp, type WsOrderbookDetailEntry, type WsOrderbookDetailSide, calculateFee, calculateFeeFromTotal, calculateMatchingOrders, checkAssetOptIn, decodeGlobalState, getEscrowGlobalState, getLiveMarketsFromApi, getMarketFromApi, getMarketGlobalState, getMarketOnChain, getMarketsOnChain };
package/dist/index.d.ts CHANGED
@@ -147,6 +147,18 @@ type ProposeMatchParams = {
147
147
  /** Quantity to match in microunits */
148
148
  quantityMatched: number;
149
149
  };
150
+ /**
151
+ * Parameters for matching two existing limit orders (e.g. after an amend).
152
+ * The taker is the order placed last and pays the fee; the maker is the counterparty.
153
+ */
154
+ type ProcessMatchParams = {
155
+ /** Market app ID */
156
+ marketAppId: number;
157
+ /** Maker escrow app ID (existing order — was on the book first) */
158
+ makerEscrowAppId: number;
159
+ /** Taker escrow app ID (existing order — placed last, pays the fee) */
160
+ takerEscrowAppId: number;
161
+ };
150
162
  /** Parameters for amending (editing) an existing unfilled order */
151
163
  type AmendOrderParams = {
152
164
  /** Market app ID */
@@ -202,6 +214,15 @@ type ProposeMatchResult = {
202
214
  /** Confirmed round number */
203
215
  confirmedRound: number;
204
216
  };
217
+ /** Result of processing a match between two existing orders */
218
+ type ProcessMatchResult = {
219
+ /** Whether the match succeeded */
220
+ success: boolean;
221
+ /** Transaction IDs */
222
+ txIds: string[];
223
+ /** Confirmed round number */
224
+ confirmedRound: number;
225
+ };
205
226
  /** Result of amending an order */
206
227
  type AmendOrderResult = {
207
228
  /** Whether the amendment succeeded */
@@ -210,6 +231,10 @@ type AmendOrderResult = {
210
231
  txIds: string[];
211
232
  /** Confirmed round number */
212
233
  confirmedRound: number;
234
+ /** Total quantity matched against counterparty orders (if matching was performed) */
235
+ matchedQuantity?: number;
236
+ /** Volume-weighted average fill price in microunits (if any matches) */
237
+ matchedPrice?: number;
213
238
  };
214
239
  /** A single entry in the orderbook (one price level, one order) */
215
240
  type OrderbookEntry = {
@@ -337,6 +362,76 @@ type EscrowGlobalState = {
337
362
  asset_listed?: number;
338
363
  fee_timer_start?: number;
339
364
  };
365
+ /** Configuration for AlphaWebSocket */
366
+ type AlphaWebSocketConfig = {
367
+ /** WebSocket URL override (default: wss://wss.platform.alphaarcade.com) */
368
+ url?: string;
369
+ /** Enable auto-reconnect on unexpected disconnect (default: true) */
370
+ reconnect?: boolean;
371
+ /** Maximum reconnect attempts before giving up (default: Infinity) */
372
+ maxReconnectAttempts?: number;
373
+ /** Heartbeat interval in ms (default: 60000) */
374
+ heartbeatIntervalMs?: number;
375
+ /**
376
+ * WebSocket constructor to use. Defaults to the global `WebSocket`.
377
+ * On Node.js < 22, pass the `ws` package: `import WebSocket from 'ws'; new AlphaWebSocket({ WebSocket })`
378
+ */
379
+ WebSocket?: unknown;
380
+ };
381
+ /** Orderbook bid/ask entry at the top level (decimal cents) */
382
+ type WsOrderbookAggregatedEntry = {
383
+ price: number;
384
+ quantity: number;
385
+ total: number;
386
+ };
387
+ /** Orderbook bid/ask entry with escrow details (raw microunit prices) */
388
+ type WsOrderbookDetailEntry = {
389
+ price: number;
390
+ quantity: number;
391
+ total: number;
392
+ escrowAppId: number;
393
+ owner: string;
394
+ };
395
+ /** Per-side orderbook detail (yes or no) */
396
+ type WsOrderbookDetailSide = {
397
+ bids: WsOrderbookDetailEntry[];
398
+ asks: WsOrderbookDetailEntry[];
399
+ };
400
+ /** Orderbook data for a single app within the orderbook payload */
401
+ type WsOrderbookApp = {
402
+ bids: WsOrderbookAggregatedEntry[];
403
+ asks: WsOrderbookAggregatedEntry[];
404
+ spread: number;
405
+ yes: WsOrderbookDetailSide;
406
+ no: WsOrderbookDetailSide;
407
+ };
408
+ /** Payload for orderbook_changed events */
409
+ type OrderbookChangedEvent = {
410
+ type: 'orderbook_changed';
411
+ ts: number;
412
+ marketId: string;
413
+ orderbook: Record<string, WsOrderbookApp>;
414
+ };
415
+ /** Payload for markets_changed events (incremental diffs) */
416
+ type MarketsChangedEvent = {
417
+ type: 'markets_changed';
418
+ ts: number;
419
+ [key: string]: unknown;
420
+ };
421
+ /** Payload for market_changed events (single market) */
422
+ type MarketChangedEvent = {
423
+ type: 'market_changed';
424
+ ts: number;
425
+ [key: string]: unknown;
426
+ };
427
+ /** Payload for wallet_orders_changed events */
428
+ type WalletOrdersChangedEvent = {
429
+ type: 'wallet_orders_changed';
430
+ ts: number;
431
+ [key: string]: unknown;
432
+ };
433
+ /** Discriminated union of all WebSocket stream events */
434
+ type WebSocketStreamEvent = MarketsChangedEvent | MarketChangedEvent | OrderbookChangedEvent | WalletOrdersChangedEvent;
340
435
 
341
436
  /**
342
437
  * The main client for interacting with Alpha Market prediction markets on Algorand.
@@ -423,6 +518,17 @@ declare class AlphaClient {
423
518
  * @returns Whether the match succeeded
424
519
  */
425
520
  proposeMatch(params: ProposeMatchParams): Promise<ProposeMatchResult>;
521
+ /**
522
+ * Matches two existing limit orders (no create-escrow in the group).
523
+ *
524
+ * Calls the market app's process_potential_match(maker, taker). Use this
525
+ * after amending an order: the amended order is the taker (pays the fee),
526
+ * the counterparty is the maker.
527
+ *
528
+ * @param params - Process match params (marketAppId, makerEscrowAppId, takerEscrowAppId)
529
+ * @returns Whether the match succeeded
530
+ */
531
+ processMatch(params: ProcessMatchParams): Promise<ProcessMatchResult>;
426
532
  /**
427
533
  * Amends (edits) an existing unfilled order in-place.
428
534
  *
@@ -561,6 +667,93 @@ declare class AlphaClient {
561
667
  getMarketFromApi(marketId: string): Promise<Market | null>;
562
668
  }
563
669
 
670
+ /**
671
+ * Real-time WebSocket client for Alpha Market platform streams.
672
+ *
673
+ * Connects to `wss://wss.platform.alphaarcade.com` and provides typed,
674
+ * callback-based subscriptions for live market data. No auth required.
675
+ *
676
+ * @example
677
+ * ```typescript
678
+ * // Node.js 22+ or browser (native WebSocket)
679
+ * const ws = new AlphaWebSocket();
680
+ *
681
+ * // Node.js < 22 — pass the `ws` package
682
+ * import WebSocket from 'ws';
683
+ * const ws = new AlphaWebSocket({ WebSocket });
684
+ *
685
+ * const unsub = ws.subscribeOrderbook('will-btc-hit-100k', (event) => {
686
+ * console.log('Orderbook:', event.orderbook);
687
+ * });
688
+ *
689
+ * // Later
690
+ * unsub();
691
+ * ws.close();
692
+ * ```
693
+ */
694
+ declare class AlphaWebSocket {
695
+ private url;
696
+ private reconnectEnabled;
697
+ private maxReconnectAttempts;
698
+ private heartbeatIntervalMs;
699
+ private WebSocketImpl;
700
+ private ws;
701
+ private subscriptions;
702
+ private pendingRequests;
703
+ private heartbeatTimer;
704
+ private reconnectTimer;
705
+ private reconnectAttempts;
706
+ private intentionallyClosed;
707
+ private connectPromise;
708
+ constructor(config?: AlphaWebSocketConfig);
709
+ /** Whether the WebSocket is currently open and connected */
710
+ get connected(): boolean;
711
+ /**
712
+ * Subscribe to live market probability updates (incremental diffs).
713
+ * @returns An unsubscribe function
714
+ */
715
+ subscribeLiveMarkets(callback: (event: MarketsChangedEvent) => void): () => void;
716
+ /**
717
+ * Subscribe to change events for a single market.
718
+ * @param slug - The market slug
719
+ * @returns An unsubscribe function
720
+ */
721
+ subscribeMarket(slug: string, callback: (event: MarketChangedEvent) => void): () => void;
722
+ /**
723
+ * Subscribe to full orderbook snapshots (~5s interval on changes).
724
+ * @param slug - The market slug
725
+ * @returns An unsubscribe function
726
+ */
727
+ subscribeOrderbook(slug: string, callback: (event: OrderbookChangedEvent) => void): () => void;
728
+ /**
729
+ * Subscribe to wallet order updates.
730
+ * @param wallet - The wallet address
731
+ * @returns An unsubscribe function
732
+ */
733
+ subscribeWalletOrders(wallet: string, callback: (event: WalletOrdersChangedEvent) => void): () => void;
734
+ /** Query the server for the list of active subscriptions on this connection */
735
+ listSubscriptions(): Promise<unknown>;
736
+ /** Query a server property (e.g. "heartbeat", "limits") */
737
+ getProperty(property: string): Promise<unknown>;
738
+ /** Open the WebSocket connection. Called automatically on first subscribe. */
739
+ connect(): Promise<void>;
740
+ /** Close the connection and clean up all resources */
741
+ close(): void;
742
+ private buildStreamKey;
743
+ private buildQueryString;
744
+ private subscribe;
745
+ private doConnect;
746
+ private handleMessage;
747
+ private sendSubscribe;
748
+ private sendUnsubscribe;
749
+ private sendRequest;
750
+ private send;
751
+ private startHeartbeat;
752
+ private stopHeartbeat;
753
+ private scheduleReconnect;
754
+ private clearTimers;
755
+ }
756
+
564
757
  /**
565
758
  * Fetches all live, tradeable markets directly from the Algorand blockchain.
566
759
  *
@@ -603,6 +796,7 @@ declare const getLiveMarketsFromApi: (config: AlphaClientConfig) => Promise<Mark
603
796
  declare const getMarketFromApi: (config: AlphaClientConfig, marketId: string) => Promise<Market | null>;
604
797
 
605
798
  declare const DEFAULT_API_BASE_URL = "https://platform.alphaarcade.com/api";
799
+ declare const DEFAULT_WSS_BASE_URL = "wss://wss.platform.alphaarcade.com";
606
800
  declare const DEFAULT_MARKET_CREATOR_ADDRESS = "5P5Y6HTWUNG2E3VXBQDZN3ENZD3JPAIR5PKT3LOYJAPAUKOLFD6KANYTRY";
607
801
 
608
802
  /**
@@ -684,4 +878,4 @@ declare const getEscrowGlobalState: (indexerClient: algosdk.Indexer, escrowAppId
684
878
  */
685
879
  declare const checkAssetOptIn: (algodClient: algosdk.Algodv2, address: string, assetId: number) => Promise<boolean>;
686
880
 
687
- export { type AggregatedOrderbook, type AggregatedOrderbookEntry, type AggregatedOrderbookSide, AlphaClient, type AlphaClientConfig, type AmendOrderParams, type AmendOrderResult, type CancelOrderParams, type CancelOrderResult, type ClaimParams, type ClaimResult, type CounterpartyMatch, type CreateLimitOrderParams, type CreateMarketOrderParams, type CreateOrderResult, DEFAULT_API_BASE_URL, DEFAULT_MARKET_CREATOR_ADDRESS, type EscrowGlobalState, type Market, type MarketGlobalState, type MarketOption, type MergeSharesParams, type OpenOrder, type OrderSide, type Orderbook, type OrderbookEntry, type OrderbookSide, type Position, type ProposeMatchParams, type ProposeMatchResult, type SplitMergeResult, type SplitSharesParams, type WalletPosition, calculateFee, calculateFeeFromTotal, calculateMatchingOrders, checkAssetOptIn, decodeGlobalState, getEscrowGlobalState, getLiveMarketsFromApi, getMarketFromApi, getMarketGlobalState, getMarketOnChain, getMarketsOnChain };
881
+ export { type AggregatedOrderbook, type AggregatedOrderbookEntry, type AggregatedOrderbookSide, AlphaClient, type AlphaClientConfig, AlphaWebSocket, type AlphaWebSocketConfig, type AmendOrderParams, type AmendOrderResult, type CancelOrderParams, type CancelOrderResult, type ClaimParams, type ClaimResult, type CounterpartyMatch, type CreateLimitOrderParams, type CreateMarketOrderParams, type CreateOrderResult, DEFAULT_API_BASE_URL, DEFAULT_MARKET_CREATOR_ADDRESS, DEFAULT_WSS_BASE_URL, type EscrowGlobalState, type Market, type MarketChangedEvent, type MarketGlobalState, type MarketOption, type MarketsChangedEvent, type MergeSharesParams, type OpenOrder, type OrderSide, type Orderbook, type OrderbookChangedEvent, type OrderbookEntry, type OrderbookSide, type Position, type ProcessMatchParams, type ProcessMatchResult, type ProposeMatchParams, type ProposeMatchResult, type SplitMergeResult, type SplitSharesParams, type WalletOrdersChangedEvent, type WalletPosition, type WebSocketStreamEvent, type WsOrderbookAggregatedEntry, type WsOrderbookApp, type WsOrderbookDetailEntry, type WsOrderbookDetailSide, calculateFee, calculateFeeFromTotal, calculateMatchingOrders, checkAssetOptIn, decodeGlobalState, getEscrowGlobalState, getLiveMarketsFromApi, getMarketFromApi, getMarketGlobalState, getMarketOnChain, getMarketsOnChain };