@proof-labs/trading-sdk 4.2.0 → 5.0.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.
Files changed (61) hide show
  1. package/README.md +57 -7
  2. package/dist/client.d.ts +95 -39
  3. package/dist/client.d.ts.map +1 -1
  4. package/dist/client.js +412 -202
  5. package/dist/client.js.map +1 -1
  6. package/dist/codec-adapter.d.ts.map +1 -1
  7. package/dist/codec-adapter.js +8 -3
  8. package/dist/codec-adapter.js.map +1 -1
  9. package/dist/crypto.d.ts +20 -0
  10. package/dist/crypto.d.ts.map +1 -1
  11. package/dist/crypto.js +39 -0
  12. package/dist/crypto.js.map +1 -1
  13. package/dist/errors.d.ts +26 -3
  14. package/dist/errors.d.ts.map +1 -1
  15. package/dist/errors.js +111 -15
  16. package/dist/errors.js.map +1 -1
  17. package/dist/feed-types.d.ts +76 -0
  18. package/dist/feed-types.d.ts.map +1 -0
  19. package/dist/feed-types.js +2 -0
  20. package/dist/feed-types.js.map +1 -0
  21. package/dist/feed.d.ts +158 -0
  22. package/dist/feed.d.ts.map +1 -0
  23. package/dist/feed.js +474 -0
  24. package/dist/feed.js.map +1 -0
  25. package/dist/gateway-reads.d.ts +74 -0
  26. package/dist/gateway-reads.d.ts.map +1 -0
  27. package/dist/gateway-reads.js +91 -0
  28. package/dist/gateway-reads.js.map +1 -0
  29. package/dist/governance-query.d.ts +6 -16
  30. package/dist/governance-query.d.ts.map +1 -1
  31. package/dist/governance-query.js +80 -93
  32. package/dist/governance-query.js.map +1 -1
  33. package/dist/history.d.ts +17 -0
  34. package/dist/history.d.ts.map +1 -0
  35. package/dist/history.js +150 -0
  36. package/dist/history.js.map +1 -0
  37. package/dist/index.d.ts +9 -3
  38. package/dist/index.d.ts.map +1 -1
  39. package/dist/index.js +5 -3
  40. package/dist/index.js.map +1 -1
  41. package/dist/market-snapshot.d.ts.map +1 -1
  42. package/dist/market-snapshot.js +4 -5
  43. package/dist/market-snapshot.js.map +1 -1
  44. package/dist/oracle-price-history.d.ts +30 -0
  45. package/dist/oracle-price-history.d.ts.map +1 -0
  46. package/dist/oracle-price-history.js +108 -0
  47. package/dist/oracle-price-history.js.map +1 -0
  48. package/dist/portfolio-history.d.ts +21 -0
  49. package/dist/portfolio-history.d.ts.map +1 -0
  50. package/dist/portfolio-history.js +49 -0
  51. package/dist/portfolio-history.js.map +1 -0
  52. package/dist/tx-result.d.ts +6 -0
  53. package/dist/tx-result.d.ts.map +1 -1
  54. package/dist/tx-result.js +42 -0
  55. package/dist/tx-result.js.map +1 -1
  56. package/dist/types.d.ts +160 -134
  57. package/dist/types.d.ts.map +1 -1
  58. package/dist/types.js +11 -7
  59. package/dist/types.js.map +1 -1
  60. package/dist/wasm/proof_trading_sdk_wasm_bg.wasm +0 -0
  61. package/package.json +5 -1
package/README.md CHANGED
@@ -198,6 +198,7 @@ class ExchangeClient {
198
198
  queryHistoryWithdrawals(...): Promise<HistoryCashFlow[]>;
199
199
  queryHistoryResolutions(...): Promise<HistoryResolution[]>;
200
200
  queryHistoryPositions(...): Promise<HistoryPositionSnapshot[]>;
201
+ queryHistoryPositionsPage(...): Promise<HistoryPositionsPage>;
201
202
 
202
203
  // Blocks
203
204
  getBlock(height?: number): Promise<Record<string, unknown>>;
@@ -222,7 +223,23 @@ policy, calendar epoch and verdict at an exact finalized height. It preserves
222
223
  u64 values as `bigint`, and returns `Legacy` with no permission claim while the
223
224
  new policy is inactive. `Satisfied` covers only this oracle dependency, not all
224
225
  portfolio dependencies or other trading checks. It never reads provider/observer
225
- health, and is separate from the prohibited operational-health API in ADR 0002.
226
+ health; feeder freshness is a separate operational read, described below.
227
+
228
+ ### Oracle freshness for trading UIs
229
+
230
+ ```typescript
231
+ const response = await client.reads().oracleHealth({ signal });
232
+ const health = await response.json();
233
+ ```
234
+
235
+ This forwards `GET /v1/oracle/health` through the configured gateway, preserving
236
+ the response body, HTTP errors and cancellation. The Web-UI uses feeder freshness
237
+ for its existing delay warnings and order guards. Thresholds and display policy
238
+ remain in the application; `status: "ok"` alone does not mean fresh data, and
239
+ `embedded_feeder: false` must remain unavailable. This is operational evidence,
240
+ not trading authorization. Like every other gateway interaction, admin calls
241
+ included, it goes through the SDK
242
+ ([ADR 0003](docs/adr/0003-every-gateway-interaction-through-the-sdk.md)).
226
243
 
227
244
  ### Optional native Rust gateway transport
228
245
 
@@ -251,6 +268,38 @@ execution success, **not** an oracle permission certificate. Retry-After remains
251
268
  an exact delay, an absolute HTTP date, or explicitly `Invalid`; callers must not
252
269
  discard an invalid header and retry immediately.
253
270
 
271
+ `submit_signed_bytes_with_evidence` adds strict **per-attempt** refusal evidence
272
+ without changing the original method's behaviour. It returns
273
+ `SubmissionEvidence`, a `Submission<PreAdmissionRefusal>`: every outcome keeps
274
+ the locally calculated hash, and only `RejectedBeforeAdmission` carries the
275
+ typed `refusal`, so a refusal cannot disagree with its outcome. The original
276
+ method returns `Submission`, whose `RejectedBeforeAdmission` carries
277
+ `refusal: ()`. Only exact source-qualified body/status pairs qualify: authorization,
278
+ rate limiting, maintenance, admission overload/verifier disconnection, and
279
+ specific parse/signature refusals. Generic HTTP errors, unrecognized bodies,
280
+ unknown fields or a hash-bearing 503 remain unresolved. Maintenance requires
281
+ the exact error and `paused` or `cancel-only` mode; substring matching is not
282
+ used. These contracts are checked against
283
+ [`api-gateway@3c711c2`](https://github.com/Proof-labs/api-gateway/tree/3c711c2a3c29ca8f37d2d986fe817d21a9eeebc3)
284
+ (`src/server.rs`, `src/exchange.rs`, `src/types/exchange_response.rs`). Qualify
285
+ the actual deployed gateway image against that contract before using the
286
+ evidence operationally; a loopback fixture is not deployment qualification.
287
+
288
+ A refusal describes **this one request only**. The SDK does not know a
289
+ journal's earlier attempts: preserve any previous ambiguity, and retire an
290
+ entry on this evidence only after independently establishing the sole-attempt
291
+ condition. Neither method retries, re-signs, allocates a nonce or changes live
292
+ state beyond the caller-requested POST. Receipts remain exact-hash reads;
293
+ not-found is never proof that the transaction cannot execute.
294
+
295
+ The evidence method retains a `Retry-After` header even if it is invalid or
296
+ duplicated. Only an absent header uses JSON `retryAfterMs`, rounding **up** to
297
+ the existing whole-second representation without overflow or shortening. Null,
298
+ negative, fractional, non-numeric, duplicate or overflowing JSON delay values
299
+ are invalid, not an absent hint; invalid rate-limit bodies do not qualify as
300
+ pre-admission evidence. The caller owns its quiet period and reconciliation;
301
+ this SDK performs no sleep or automatic resubmission.
302
+
254
303
  For a deliberately read-only local contract probe, with no signing/key inputs:
255
304
 
256
305
  ```sh
@@ -366,12 +415,13 @@ loop at 9 s+ under load.
366
415
 
367
416
  The SDK reads that shape and stops working for it:
368
417
 
369
- | Gateway answers | `TxResult` | Does the SDK poll? |
370
- | -------------------- | ----------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
371
- | `code` + `height` | `ok` / `engine`, with `height` + `events` | **No** — the tx executed; there is nothing to wait for |
372
- | `code`, no `height` | `engine` | **No** — a CheckTx reject never enters a block, so no DeliverTx will run |
373
- | `txHash`, no `code` | `timeout` | **Yes** — the gateway broadcast it but couldn't report the outcome in time (park deadline, duplicate in flight, unreadable result). The tx may still commit, so it is reconciled by hash — **not** reported as a rejection |
374
- | `{status:"ok"}` only | `ok`, no `height` | **Yes** — a pre-#90 gateway acks CheckTx only, so inclusion is still unknown |
418
+ | Gateway answers | `TxResult` | Does the SDK poll? |
419
+ | --------------------------------------------------------------------------------- | ------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
420
+ | `code` + `height` | `ok` / `engine`, with `height` + `events` | **No** — the tx executed; there is nothing to wait for |
421
+ | `code`, no `height` | `engine` | **No** — a CheckTx reject never enters a block, so no DeliverTx will run |
422
+ | `txHash`, no `code` | `timeout` | **Yes** — the gateway broadcast it but couldn't report the outcome in time (park deadline, duplicate in flight, unreadable result). The tx may still commit, so it is reconciled by hash — **not** reported as a rejection |
423
+ | Structured HTTP 200/503 refusal, a recognized reason, no admission/verdict fields | `transport` (code 1 / 503), original error reason | **No** — the gateway refused admission; an unrecognized message, unknown 5xx, or contradictory fields still reconcile by hash |
424
+ | `{status:"ok"}` only | `ok`, no `height` | **Yes** — a pre-#90 gateway acks CheckTx only, so inclusion is still unknown |
375
425
 
376
426
  That last row is why upgrading the SDK is safe against a gateway that has not been
377
427
  upgraded yet: absence of `code`/`height` still means "execution unknown", and the old
package/dist/client.d.ts CHANGED
@@ -1,6 +1,11 @@
1
+ import { GatewayFeed, type GatewayFeedOptions, type AccountFeedAuth } from "./feed.js";
2
+ import type { AccountFrame, OrderbookFrame, TradeFrame } from "./feed-types.js";
3
+ import { type PortfolioHistoryOptions, type PortfolioHistoryPage } from "./portfolio-history.js";
4
+ import { type OraclePriceHistoryOptions, type OraclePriceHistoryPage } from "./oracle-price-history.js";
5
+ import { GatewayReads, type GatewayFetch } from "./gateway-reads.js";
1
6
  import { type AccountState } from "./account-state.js";
2
7
  import { type FinancialState, type FinancialStateSelection } from "./financial-state.js";
3
- import type { Action, TxResult, PlaceOrder, MarketOrder, AccountInfo, HistoryCashFlow, HistoryFillsPage, HistoryPositionSnapshot, HistoryResolution, MarketConfig, OpenOrder, AdlQueueEntry, Orderbook, Ticker, WithdrawalRecord, AdminSignerRegistry, ProposalPage, ImpactMarketInfo, EventInfo, SetPositionTriggers, PositionTriggerInfo, TriggerStatus, PositionTriggerHistoryFilters, PositionTriggerHistoryPage, TriggerMarketHistoryFilters, TriggerMarketHistoryPage, TriggerMarketConfigInfo } from "./types.js";
8
+ import type { Action, TxResult, PlaceOrder, MarketOrder, AccountInfo, HistoryCashFlow, HistoryFillsPage, HistoryPositionSnapshot, HistoryPositionsPage, HistoryResolution, MarketConfig, OpenOrder, AdlQueueEntry, Orderbook, Ticker, WithdrawalRecord, AdminSignerRegistry, ProposalPage, EventInfo, SetPositionTriggers, PositionTriggerInfo, TriggerStatus, PositionTriggerHistoryFilters, PositionTriggerHistoryPage, TriggerMarketHistoryFilters, TriggerMarketHistoryPage, TriggerMarketConfigInfo } from "./types.js";
4
9
  import type { MarketsSnapshot } from "./types.js";
5
10
  import { type OraclePermissions } from "./oracle-permissions.js";
6
11
  /**
@@ -13,6 +18,11 @@ import { type OraclePermissions } from "./oracle-permissions.js";
13
18
  * bytes without going through a client instance.
14
19
  */
15
20
  export declare function fetchChainId(rpcUrl: string): Promise<Uint8Array>;
21
+ /** Vendor-neutral Ed25519 signer. The SDK owns domain, encoding and nonces. */
22
+ export interface ExternalSigner {
23
+ publicKey: Uint8Array;
24
+ signRaw(message: Uint8Array): Promise<Uint8Array>;
25
+ }
16
26
  export interface ExchangeClientOptions {
17
27
  /**
18
28
  * Override for the CometBFT RPC endpoint on the **internal**
@@ -138,6 +148,9 @@ export declare class ExchangeClient {
138
148
  /** Single-flight guard so concurrent submits share one /status fetch. */
139
149
  private chainIdPromise;
140
150
  private privateKey;
151
+ private externalSigner;
152
+ private signerRevision;
153
+ private gatewayFeed;
141
154
  private publicKey;
142
155
  private address;
143
156
  private addressHex;
@@ -221,6 +234,16 @@ export declare class ExchangeClient {
221
234
  getChainId(): Uint8Array | null;
222
235
  /** Set the private key for signing transactions. */
223
236
  setPrivateKey(key: Uint8Array): void;
237
+ /** Replace the signing connection; no private key is retained. */
238
+ setExternalSigner(signer: ExternalSigner): void;
239
+ /** Sign only. Cancellation or a replaced connection prevents submission. */
240
+ signTx(action: Action, opts?: {
241
+ signal?: AbortSignal;
242
+ }): Promise<Uint8Array>;
243
+ /** Sign existing gateway account-events auth bytes; call again per reconnect.
244
+ * Direct owner keys only; no delegated-owner authorization is inferred.
245
+ */
246
+ accountAuth(owner?: string, afterId?: bigint): Promise<AccountFeedAuth>;
224
247
  getAddress(): Uint8Array | null;
225
248
  getAddressHex(): string | null;
226
249
  getPublicKey(): Uint8Array | null;
@@ -236,16 +259,18 @@ export declare class ExchangeClient {
236
259
  /**
237
260
  * Allocate the next timestamp nonce.
238
261
  *
239
- * Algorithm: `max(now_ms, last_nonce + 1)` capped at `now_ms + 60s` to
240
- * bound the growth if the clock stops ticking.
262
+ * Algorithm: `max(now_ms, last_nonce + 1)`. Refuse allocation above
263
+ * `now_ms + 60s` without rewinding or repeating the last nonce.
241
264
  *
242
265
  * Engine window: `[block_time - 2 days, block_time + 1 day]`. All four
243
266
  * rejection modes (too old, too far future, replay, below oldest) map to
244
267
  * code 21 `InvalidNonce`. Nonces are burned on success — no rewinding.
245
268
  *
246
- * Thread-safe only through external serialization (caller's responsibility).
269
+ * Concurrent calls on this client reserve distinct nonces synchronously.
247
270
  */
248
271
  private nextTimestampNonce;
272
+ /** Highest locally allocated nonce; never rewound after rejection. */
273
+ get currentNonce(): bigint;
249
274
  /**
250
275
  * Sign and submit a transaction via broadcast_tx_sync.
251
276
  *
@@ -403,6 +428,13 @@ export declare class ExchangeClient {
403
428
  * unknown.
404
429
  */
405
430
  private awaitCommit;
431
+ /** Per-submission finality. Timeout/cancellation retains the hash as unknown.
432
+ * Never resubmits writes. Use setUnsafeFastSubmit(true) to avoid a second poller.
433
+ */
434
+ waitForDelivery(sync: TxResult, opts?: {
435
+ timeoutMs?: number;
436
+ signal?: AbortSignal;
437
+ }): Promise<TxResult>;
406
438
  /**
407
439
  * The loaded signer's 20-byte owner address, or throw if no key is set.
408
440
  * Every convenience builder needs it, so the guard lives here.
@@ -456,21 +488,15 @@ export declare class ExchangeClient {
456
488
  queryMarketsSnapshot(): Promise<MarketsSnapshot>;
457
489
  /** List all registered market configs. */
458
490
  queryMarkets(): Promise<MarketConfig[]>;
459
- /** List all impact-market families (the 5-book event structures: an
460
- * underlying perp plus CPY/CPN/EBY/EBN children). Fail-closed like the
461
- * governance reads: a missing envelope or a malformed row is a refusal,
462
- * never a partially-rendered list (decoder pinned to engine golden bytes
463
- * in governance-query.test.ts). */
464
- queryImpactMarkets(): Promise<ImpactMarketInfo[]>;
465
- /** All standalone events (G17). Each is two prediction-binary books (EBY/EBN)
466
- * under one `EventInfo`, no underlying perp. Fail-closed like the impact
467
- * read: a missing envelope or malformed row is a refusal. Decoder pinned to
468
- * the engine golden vector in governance-query.test.ts. */
491
+ /** All events: each is two prediction-binary books (EBY/EBN) under one
492
+ * `EventInfo`, plus every conditional attached to it. Fail-closed like the
493
+ * governance reads: a missing envelope or malformed row is a refusal.
494
+ * Decoder pinned to the engine golden vector in governance-query.test.ts. */
469
495
  queryEvents(): Promise<EventInfo[]>;
470
- /** A single standalone event by id, or `null` if it does not exist. The node
471
- * returns 404 for a missing event (the engine's msgpack-nil, translated like
472
- * the impact-market route), so a raw fetch is used here to map 404 -> null
473
- * while still throwing on real transport / decode failures. */
496
+ /** A single event by id, or `null` if it does not exist. The node returns
497
+ * 404 for a missing event (the engine's msgpack-nil), so a raw fetch is used
498
+ * here to map 404 -> null while still throwing on real transport / decode
499
+ * failures. */
474
500
  queryEvent(eventId: number): Promise<EventInfo | null>;
475
501
  /** Current whole-position trigger brackets for one owner. Immutable
476
502
  * lifecycle history is a separate gateway/indexer query below. */
@@ -546,51 +572,68 @@ export declare class ExchangeClient {
546
572
  * and top-of-book blobs). Returns `null` if the market is unknown. Routes
547
573
  * through the gateway's `/v1/ticker`. */
548
574
  queryTicker(market: number): Promise<Ticker | null>;
549
- /** Per-user deposit log — every `deposit_confirmed` event for this
550
- * owner, newest first. Feeds Portfolio EquityChart equity-over-time
551
- * reconstruction (P2 #6). */
575
+ /** Direct relayer deposits and custody-confirmed deposits, newest first.
576
+ * Returns a bounded merged head, not a cursor over the complete history. */
552
577
  queryHistoryDeposits(addressHex?: string, opts?: {
553
578
  fromMs?: number;
554
579
  toMs?: number;
555
580
  limit?: number;
556
581
  }): Promise<HistoryCashFlow[]>;
557
- /** Per-user withdrawal lifecycle log — withdraw_requested /
558
- * withdrawal_confirmed / withdrawal_failed, newest first. Filter by
559
- * `kind` client-side if you want only pending requests. P2 #6. */
582
+ /** Direct relayer withdrawals and indexed custody events, newest first,
583
+ * capped after merging each kind's first page. This is not withdrawal status:
584
+ * ownerless confirmation events
585
+ * are not indexed for the account. Use queryWithdrawal(id) for status.
586
+ * Request/refund amounts exclude fees; unknown signedDelta stays empty. */
560
587
  queryHistoryWithdrawals(addressHex?: string, opts?: {
561
588
  fromMs?: number;
562
589
  toMs?: number;
563
590
  limit?: number;
564
591
  }): Promise<HistoryCashFlow[]>;
565
- /** Internal: shared decoder for the two cash-flow endpoints. They
566
- * return identical row shapes (HistoryCashFlow); the difference is
567
- * which kinds the server includes. */
592
+ /** Owner-filtered indexer events; never the removed node history routes. */
568
593
  private queryHistoryCashFlow;
569
594
  /** Per-user position-at-resolution log — each row is one settlement or
570
595
  * voided-conditional snapshot. Feeds the Portfolio "Resolved" tab
571
- * (P2 #7). Optional `impactMarketId` filter scopes to one event family.
596
+ * (P2 #7). Optional `eventId` filter scopes to one event.
572
597
  *
573
598
  * `fromMs` / `toMs` are unix-ms timestamps; omit for unbounded.
574
599
  * `limit` caps at 1000 server-side. Results are newest-first. */
575
600
  queryHistoryResolutions(addressHex?: string, opts?: {
576
- impactMarketId?: number;
601
+ eventId?: number;
577
602
  fromMs?: number;
578
603
  toMs?: number;
579
604
  limit?: number;
580
605
  }): Promise<HistoryResolution[]>;
581
- /** Per-user position-history snapshot log. Each row is one
582
- * point-in-time snapshot persisted after a fill that changes the
583
- * position. A `size === "0"` row is a CLOSE event; the immediately
584
- * preceding non-zero snapshot for the same `(owner, market, side)`
585
- * carries the entry price. Feeds the trading-UI Position History tab
586
- * (FE-23). Optional `market` filter scopes to one book; `fromMs` /
587
- * `toMs` window the timestamps; `limit` caps server-side at 5000. */
606
+ /** Named gateway responses for HTTP consumers that own body parsing, deadlines
607
+ * and scheduling. Prefer typed query methods when raw response metadata is unnecessary.
608
+ * Uses this client's gateway; never targets a node, even in internal node mode.
609
+ */
610
+ reads(opts?: {
611
+ fetch?: GatewayFetch;
612
+ }): GatewayReads;
613
+ /** Gateway/indexer portfolio page, including in internal node mode.
614
+ * Keep bounds fixed across opaque cursors. */
615
+ queryPortfolioHistory(owner: string, opts: PortfolioHistoryOptions): Promise<PortfolioHistoryPage>;
616
+ /** One newest-first gateway page of a market's indexed `price_updated`
617
+ * history. Keep market and bounds fixed across opaque cursors. */
618
+ queryOraclePriceHistory(market: number, options: OraclePriceHistoryOptions): Promise<OraclePriceHistoryPage>;
619
+ /** Compatibility array of position snapshots. Absent close fields are empty
620
+ * strings and timestamps are milliseconds. Use queryHistoryPositionsPage for
621
+ * nullable fields, exact block times and opaque cursor continuation. */
588
622
  queryHistoryPositions(addressHex?: string, opts?: {
589
623
  market?: number;
590
624
  fromMs?: number;
591
625
  toMs?: number;
592
626
  limit?: number;
593
627
  }): Promise<HistoryPositionSnapshot[]>;
628
+ /** Gateway/indexer snapshots, newest first. Preserve filters when passing an
629
+ * opaque nextCursor back in opts.cursor. Null close fields stay null. */
630
+ queryHistoryPositionsPage(addressHex?: string, opts?: {
631
+ market?: number;
632
+ fromMs?: number;
633
+ toMs?: number;
634
+ limit?: number;
635
+ cursor?: string;
636
+ }): Promise<HistoryPositionsPage>;
594
637
  /**
595
638
  * Executed fills for an owner, newest first, keyset-paged. The endpoint
596
639
  * returns an envelope rather than a bare array: pass `opts.cursor` from a
@@ -621,14 +664,16 @@ export declare class ExchangeClient {
621
664
  *
622
665
  * Auth: account streams require auth only when the gateway runs with
623
666
  * `--api-key`. A browser `WebSocket` cannot send the `X-Api-Key` header, so
624
- * the SDK uses the gateway's signed-query auth instead — when a private key
625
- * is loaded (`setPrivateKey`) it signs the `ProofExchange-account-events-v1`
667
+ * the SDK uses the gateway's signed-query auth instead — when a private key or external signer
668
+ * is connected it signs the `ProofExchange-account-events-v1`
626
669
  * message and appends `public_key` / `signature` / `timestamp_ms`. Against
627
670
  * an unauthenticated gateway (e.g. devnet) the owner alone is enough.
628
671
  *
629
672
  * Returns an unsubscribe function; `disconnect()` closes all streams.
630
673
  */
631
- subscribeAccountEvents(owner: Uint8Array | string, onEvent: (event: Record<string, unknown>) => void, opts?: WsStreamOptions): () => void;
674
+ subscribeAccountEvents(owner: Uint8Array | string, onEvent: (event: Record<string, unknown>) => void, opts?: WsStreamOptions & {
675
+ auth?: false;
676
+ }): () => void;
632
677
  /**
633
678
  * Subscribe to the L2 orderbook delta stream for a market
634
679
  * (`/orderbook-deltas`). Mirrors the Python SDK's `OrderbookDeltaStream`:
@@ -650,6 +695,17 @@ export declare class ExchangeClient {
650
695
  * socket.
651
696
  */
652
697
  private openStream;
698
+ /** Shared multiplexed /ws feed. Options apply on first creation only.
699
+ * Reconnect restores snapshots, not missed events. Default auth reads the current signer.
700
+ */
701
+ feed(opts?: Partial<GatewayFeedOptions>): GatewayFeed;
702
+ /** Account snapshot plus live stream, with auth renewed per reconnect. */
703
+ subscribeAccount(onFrame: (frame: AccountFrame) => void, opts?: {
704
+ owner?: string;
705
+ auth?: false;
706
+ }): () => void;
707
+ subscribeOrderbook(market: number, onFrame: (frame: OrderbookFrame) => void): () => void;
708
+ subscribeTrades(market: number, onFrame: (frame: TradeFrame) => void): () => void;
653
709
  /** Close every open WebSocket stream and stop their reconnect loops. */
654
710
  disconnect(): void;
655
711
  }
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AACA,OAAO,EAAsB,KAAK,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAC3E,OAAO,EAEL,KAAK,cAAc,EACnB,KAAK,uBAAuB,EAC7B,MAAM,sBAAsB,CAAC;AAkB9B,OAAO,KAAK,EACV,MAAM,EAEN,QAAQ,EACR,UAAU,EACV,WAAW,EACX,WAAW,EAGX,eAAe,EACf,gBAAgB,EAChB,uBAAuB,EACvB,iBAAiB,EACjB,YAAY,EAGZ,SAAS,EACT,aAAa,EACb,SAAS,EAET,MAAM,EAEN,gBAAgB,EAEhB,mBAAmB,EACnB,YAAY,EACZ,gBAAgB,EAChB,SAAS,EACT,mBAAmB,EACnB,mBAAmB,EACnB,aAAa,EACb,6BAA6B,EAC7B,0BAA0B,EAC1B,2BAA2B,EAC3B,wBAAwB,EACxB,uBAAuB,EACxB,MAAM,YA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