@proof-labs/trading-sdk 4.2.0 → 5.1.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 (73) hide show
  1. package/README.md +66 -10
  2. package/dist/client.d.ts +111 -41
  3. package/dist/client.d.ts.map +1 -1
  4. package/dist/client.js +431 -205
  5. package/dist/client.js.map +1 -1
  6. package/dist/codec-adapter.d.ts.map +1 -1
  7. package/dist/codec-adapter.js +20 -4
  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 +30 -3
  14. package/dist/errors.d.ts.map +1 -1
  15. package/dist/errors.js +123 -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 +110 -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 +101 -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 +11 -4
  38. package/dist/index.d.ts.map +1 -1
  39. package/dist/index.js +7 -4
  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-guards.d.ts +5 -0
  45. package/dist/oracle-guards.d.ts.map +1 -0
  46. package/dist/oracle-guards.js +27 -0
  47. package/dist/oracle-guards.js.map +1 -0
  48. package/dist/oracle-permissions.d.ts +13 -0
  49. package/dist/oracle-permissions.d.ts.map +1 -1
  50. package/dist/oracle-permissions.js +44 -1
  51. package/dist/oracle-permissions.js.map +1 -1
  52. package/dist/oracle-price-history.d.ts +30 -0
  53. package/dist/oracle-price-history.d.ts.map +1 -0
  54. package/dist/oracle-price-history.js +108 -0
  55. package/dist/oracle-price-history.js.map +1 -0
  56. package/dist/portfolio-history.d.ts +21 -0
  57. package/dist/portfolio-history.d.ts.map +1 -0
  58. package/dist/portfolio-history.js +49 -0
  59. package/dist/portfolio-history.js.map +1 -0
  60. package/dist/triggers.d.ts +26 -2
  61. package/dist/triggers.d.ts.map +1 -1
  62. package/dist/triggers.js +38 -6
  63. package/dist/triggers.js.map +1 -1
  64. package/dist/tx-result.d.ts +6 -0
  65. package/dist/tx-result.d.ts.map +1 -1
  66. package/dist/tx-result.js +42 -0
  67. package/dist/tx-result.js.map +1 -1
  68. package/dist/types.d.ts +206 -135
  69. package/dist/types.d.ts.map +1 -1
  70. package/dist/types.js +11 -7
  71. package/dist/types.js.map +1 -1
  72. package/dist/wasm/proof_trading_sdk_wasm_bg.wasm +0 -0
  73. package/package.json +5 -1
package/README.md CHANGED
@@ -185,6 +185,7 @@ class ExchangeClient {
185
185
  queryWithdrawal(id: bigint): Promise<WithdrawalRecord | null>;
186
186
  queryPositionTriggers(addressHex?: string): Promise<PositionTriggerInfo[]>;
187
187
  queryTriggerMarketConfigs(): Promise<TriggerMarketConfigInfo[]>;
188
+ // Deprecated: GET /v1/triggers/status is deleted upstream; see below.
188
189
  queryTriggerStatus(): Promise<TriggerStatus>;
189
190
  queryPositionTriggerHistory(addressHex?: string, filters?: PositionTriggerHistoryFilters): Promise<PositionTriggerHistoryPage>;
190
191
  queryTriggerMarketHistory(market: number, filters?: TriggerMarketHistoryFilters): Promise<TriggerMarketHistoryPage>;
@@ -198,6 +199,7 @@ class ExchangeClient {
198
199
  queryHistoryWithdrawals(...): Promise<HistoryCashFlow[]>;
199
200
  queryHistoryResolutions(...): Promise<HistoryResolution[]>;
200
201
  queryHistoryPositions(...): Promise<HistoryPositionSnapshot[]>;
202
+ queryHistoryPositionsPage(...): Promise<HistoryPositionsPage>;
201
203
 
202
204
  // Blocks
203
205
  getBlock(height?: number): Promise<Record<string, unknown>>;
@@ -222,7 +224,23 @@ policy, calendar epoch and verdict at an exact finalized height. It preserves
222
224
  u64 values as `bigint`, and returns `Legacy` with no permission claim while the
223
225
  new policy is inactive. `Satisfied` covers only this oracle dependency, not all
224
226
  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.
227
+ health; feeder freshness is a separate operational read, described below.
228
+
229
+ ### Oracle freshness for trading UIs
230
+
231
+ ```typescript
232
+ const response = await client.reads().oracleHealth({ signal });
233
+ const health = await response.json();
234
+ ```
235
+
236
+ This forwards `GET /v1/oracle/health` through the configured gateway, preserving
237
+ the response body, HTTP errors and cancellation. The Web-UI uses feeder freshness
238
+ for its existing delay warnings and order guards. Thresholds and display policy
239
+ remain in the application; `status: "ok"` alone does not mean fresh data, and
240
+ `embedded_feeder: false` must remain unavailable. This is operational evidence,
241
+ not trading authorization. Like every other gateway interaction, admin calls
242
+ included, it goes through the SDK
243
+ ([ADR 0003](docs/adr/0003-every-gateway-interaction-through-the-sdk.md)).
226
244
 
227
245
  ### Optional native Rust gateway transport
228
246
 
@@ -251,6 +269,38 @@ execution success, **not** an oracle permission certificate. Retry-After remains
251
269
  an exact delay, an absolute HTTP date, or explicitly `Invalid`; callers must not
252
270
  discard an invalid header and retry immediately.
253
271
 
272
+ `submit_signed_bytes_with_evidence` adds strict **per-attempt** refusal evidence
273
+ without changing the original method's behaviour. It returns
274
+ `SubmissionEvidence`, a `Submission<PreAdmissionRefusal>`: every outcome keeps
275
+ the locally calculated hash, and only `RejectedBeforeAdmission` carries the
276
+ typed `refusal`, so a refusal cannot disagree with its outcome. The original
277
+ method returns `Submission`, whose `RejectedBeforeAdmission` carries
278
+ `refusal: ()`. Only exact source-qualified body/status pairs qualify: authorization,
279
+ rate limiting, maintenance, admission overload/verifier disconnection, and
280
+ specific parse/signature refusals. Generic HTTP errors, unrecognized bodies,
281
+ unknown fields or a hash-bearing 503 remain unresolved. Maintenance requires
282
+ the exact error and `paused` or `cancel-only` mode; substring matching is not
283
+ used. These contracts are checked against
284
+ [`api-gateway@3c711c2`](https://github.com/Proof-labs/api-gateway/tree/3c711c2a3c29ca8f37d2d986fe817d21a9eeebc3)
285
+ (`src/server.rs`, `src/exchange.rs`, `src/types/exchange_response.rs`). Qualify
286
+ the actual deployed gateway image against that contract before using the
287
+ evidence operationally; a loopback fixture is not deployment qualification.
288
+
289
+ A refusal describes **this one request only**. The SDK does not know a
290
+ journal's earlier attempts: preserve any previous ambiguity, and retire an
291
+ entry on this evidence only after independently establishing the sole-attempt
292
+ condition. Neither method retries, re-signs, allocates a nonce or changes live
293
+ state beyond the caller-requested POST. Receipts remain exact-hash reads;
294
+ not-found is never proof that the transaction cannot execute.
295
+
296
+ The evidence method retains a `Retry-After` header even if it is invalid or
297
+ duplicated. Only an absent header uses JSON `retryAfterMs`, rounding **up** to
298
+ the existing whole-second representation without overflow or shortening. Null,
299
+ negative, fractional, non-numeric, duplicate or overflowing JSON delay values
300
+ are invalid, not an absent hint; invalid rate-limit bodies do not qualify as
301
+ pre-admission evidence. The caller owns its quiet period and reconciliation;
302
+ this SDK performs no sleep or automatic resubmission.
303
+
254
304
  For a deliberately read-only local contract probe, with no signing/key inputs:
255
305
 
256
306
  ```sh
@@ -277,9 +327,14 @@ absence means disabled. The optional pending policy is shown with its accepted
277
327
  and next-block effective heights. The SDK rejects malformed, empty, unsorted,
278
328
  or version-skipping policy state rather than inventing a default.
279
329
 
280
- `queryTriggerStatus()` reports the fail-closed next-height activation
281
- predicate. `queryPositionTriggerHistory()` returns immutable owner-bearing
282
- lifecycle events; `queryTriggerMarketHistory()` returns the shared market
330
+ `queryTriggerStatus()` is deprecated: `GET /v1/triggers/status` is deleted
331
+ upstream (the node dropped it with its activation gates, exchange#619,
332
+ genesis-first; the gateway drops it in gateway 4.0.0, api-gateway#175). Trigger
333
+ actions are permanently active, so there is nothing to read, and the call
334
+ rejects with an `API error` once a gateway or node stops serving the route. It
335
+ will be removed in the next major version.
336
+ `queryPositionTriggerHistory()` returns immutable owner-bearing lifecycle
337
+ events; `queryTriggerMarketHistory()` returns the shared market
283
338
  deferred/resumed stream. Both history methods always use the gateway, return an
284
339
  opaque filter-bound cursor, and preserve every coordinate/id as a decimal
285
340
  string—pass those strings and the cursor through unchanged.
@@ -366,12 +421,13 @@ loop at 9 s+ under load.
366
421
 
367
422
  The SDK reads that shape and stops working for it:
368
423
 
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 |
424
+ | Gateway answers | `TxResult` | Does the SDK poll? |
425
+ | --------------------------------------------------------------------------------- | ------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
426
+ | `code` + `height` | `ok` / `engine`, with `height` + `events` | **No** — the tx executed; there is nothing to wait for |
427
+ | `code`, no `height` | `engine` | **No** — a CheckTx reject never enters a block, so no DeliverTx will run |
428
+ | `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 |
429
+ | 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 |
430
+ | `{status:"ok"}` only | `ok`, no `height` | **Yes** — a pre-#90 gateway acks CheckTx only, so inclusion is still unknown |
375
431
 
376
432
  That last row is why upgrading the SDK is safe against a gateway that has not been
377
433
  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.
@@ -412,9 +444,16 @@ export declare class ExchangeClient {
412
444
  * Place a limit order for the loaded signer. `owner` is supplied
413
445
  * automatically. Equivalent to
414
446
  * `submitTx({ type: "PlaceOrder", data: { ...params, owner } })`.
447
+ * Optional `stopLoss`/`takeProfit` limbs attach a pre-fill bracket that
448
+ * installs on the order's first fill (validated client-side here and in
449
+ * the codec path; encoded as the proof-wire 2.1.0 trailing fields).
415
450
  */
416
451
  placeOrder(params: Omit<PlaceOrder, "owner">): Promise<TxResult>;
417
- /** Place a market order (crosses immediately) for the loaded signer. */
452
+ /**
453
+ * Place a market order (crosses immediately) for the loaded signer.
454
+ * Optional `stopLoss`/`takeProfit` limbs are validated like
455
+ * {@link ExchangeClient.placeOrder}.
456
+ */
418
457
  marketOrder(params: Omit<MarketOrder, "owner">): Promise<TxResult>;
419
458
  /** Cancel a resting order by its engine-assigned order ID. */
420
459
  cancelOrder(orderId: bigint): Promise<TxResult>;
@@ -456,21 +495,15 @@ export declare class ExchangeClient {
456
495
  queryMarketsSnapshot(): Promise<MarketsSnapshot>;
457
496
  /** List all registered market configs. */
458
497
  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. */
498
+ /** All events: each is two prediction-binary books (EBY/EBN) under one
499
+ * `EventInfo`, plus every conditional attached to it. Fail-closed like the
500
+ * governance reads: a missing envelope or malformed row is a refusal.
501
+ * Decoder pinned to the engine golden vector in governance-query.test.ts. */
469
502
  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. */
503
+ /** A single event by id, or `null` if it does not exist. The node returns
504
+ * 404 for a missing event (the engine's msgpack-nil), so a raw fetch is used
505
+ * here to map 404 -> null while still throwing on real transport / decode
506
+ * failures. */
474
507
  queryEvent(eventId: number): Promise<EventInfo | null>;
475
508
  /** Current whole-position trigger brackets for one owner. Immutable
476
509
  * lifecycle history is a separate gateway/indexer query below. */
@@ -479,7 +512,14 @@ export declare class ExchangeClient {
479
512
  * markets are disabled; callers must never synthesize a default policy. */
480
513
  queryTriggerMarketConfigs(): Promise<TriggerMarketConfigInfo[]>;
481
514
  /** Read the fail-closed next-height trigger admission predicate. Heights
482
- * are parsed from raw JSON into bigint without a lossy Number round-trip. */
515
+ * are parsed from raw JSON into bigint without a lossy Number round-trip.
516
+ *
517
+ * @deprecated `GET /v1/triggers/status` is deleted upstream: the node
518
+ * dropped it with its activation gates (exchange#619, genesis-first) and
519
+ * the gateway drops it in gateway 4.0.0 (api-gateway#175). Trigger actions
520
+ * are permanently active, so there is nothing to read. Against a gateway or
521
+ * node that no longer serves the route this rejects with an `API error`
522
+ * for the 404 response. It will be removed in the next major version. */
483
523
  queryTriggerStatus(): Promise<TriggerStatus>;
484
524
  /** One committed oracle dependency, not provider health or action authorization. */
485
525
  queryOraclePermissions(market: number): Promise<OraclePermissions>;
@@ -546,51 +586,68 @@ export declare class ExchangeClient {
546
586
  * and top-of-book blobs). Returns `null` if the market is unknown. Routes
547
587
  * through the gateway's `/v1/ticker`. */
548
588
  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). */
589
+ /** Direct relayer deposits and custody-confirmed deposits, newest first.
590
+ * Returns a bounded merged head, not a cursor over the complete history. */
552
591
  queryHistoryDeposits(addressHex?: string, opts?: {
553
592
  fromMs?: number;
554
593
  toMs?: number;
555
594
  limit?: number;
556
595
  }): 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. */
596
+ /** Direct relayer withdrawals and indexed custody events, newest first,
597
+ * capped after merging each kind's first page. This is not withdrawal status:
598
+ * ownerless confirmation events
599
+ * are not indexed for the account. Use queryWithdrawal(id) for status.
600
+ * Request/refund amounts exclude fees; unknown signedDelta stays empty. */
560
601
  queryHistoryWithdrawals(addressHex?: string, opts?: {
561
602
  fromMs?: number;
562
603
  toMs?: number;
563
604
  limit?: number;
564
605
  }): 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. */
606
+ /** Owner-filtered indexer events; never the removed node history routes. */
568
607
  private queryHistoryCashFlow;
569
608
  /** Per-user position-at-resolution log — each row is one settlement or
570
609
  * voided-conditional snapshot. Feeds the Portfolio "Resolved" tab
571
- * (P2 #7). Optional `impactMarketId` filter scopes to one event family.
610
+ * (P2 #7). Optional `eventId` filter scopes to one event.
572
611
  *
573
612
  * `fromMs` / `toMs` are unix-ms timestamps; omit for unbounded.
574
613
  * `limit` caps at 1000 server-side. Results are newest-first. */
575
614
  queryHistoryResolutions(addressHex?: string, opts?: {
576
- impactMarketId?: number;
615
+ eventId?: number;
577
616
  fromMs?: number;
578
617
  toMs?: number;
579
618
  limit?: number;
580
619
  }): 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. */
620
+ /** Named gateway responses for HTTP consumers that own body parsing, deadlines
621
+ * and scheduling. Prefer typed query methods when raw response metadata is unnecessary.
622
+ * Uses this client's gateway; never targets a node, even in internal node mode.
623
+ */
624
+ reads(opts?: {
625
+ fetch?: GatewayFetch;
626
+ }): GatewayReads;
627
+ /** Gateway/indexer portfolio page, including in internal node mode.
628
+ * Keep bounds fixed across opaque cursors. */
629
+ queryPortfolioHistory(owner: string, opts: PortfolioHistoryOptions): Promise<PortfolioHistoryPage>;
630
+ /** One newest-first gateway page of a market's indexed `price_updated`
631
+ * history. Keep market and bounds fixed across opaque cursors. */
632
+ queryOraclePriceHistory(market: number, options: OraclePriceHistoryOptions): Promise<OraclePriceHistoryPage>;
633
+ /** Compatibility array of position snapshots. Absent close fields are empty
634
+ * strings and timestamps are milliseconds. Use queryHistoryPositionsPage for
635
+ * nullable fields, exact block times and opaque cursor continuation. */
588
636
  queryHistoryPositions(addressHex?: string, opts?: {
589
637
  market?: number;
590
638
  fromMs?: number;
591
639
  toMs?: number;
592
640
  limit?: number;
593
641
  }): Promise<HistoryPositionSnapshot[]>;
642
+ /** Gateway/indexer snapshots, newest first. Preserve filters when passing an
643
+ * opaque nextCursor back in opts.cursor. Null close fields stay null. */
644
+ queryHistoryPositionsPage(addressHex?: string, opts?: {
645
+ market?: number;
646
+ fromMs?: number;
647
+ toMs?: number;
648
+ limit?: number;
649
+ cursor?: string;
650
+ }): Promise<HistoryPositionsPage>;
594
651
  /**
595
652
  * Executed fills for an owner, newest first, keyset-paged. The endpoint
596
653
  * returns an envelope rather than a bare array: pass `opts.cursor` from a
@@ -621,14 +678,16 @@ export declare class ExchangeClient {
621
678
  *
622
679
  * Auth: account streams require auth only when the gateway runs with
623
680
  * `--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`
681
+ * the SDK uses the gateway's signed-query auth instead — when a private key or external signer
682
+ * is connected it signs the `ProofExchange-account-events-v1`
626
683
  * message and appends `public_key` / `signature` / `timestamp_ms`. Against
627
684
  * an unauthenticated gateway (e.g. devnet) the owner alone is enough.
628
685
  *
629
686
  * Returns an unsubscribe function; `disconnect()` closes all streams.
630
687
  */
631
- subscribeAccountEvents(owner: Uint8Array | string, onEvent: (event: Record<string, unknown>) => void, opts?: WsStreamOptions): () => void;
688
+ subscribeAccountEvents(owner: Uint8Array | string, onEvent: (event: Record<string, unknown>) => void, opts?: WsStreamOptions & {
689
+ auth?: false;
690
+ }): () => void;
632
691
  /**
633
692
  * Subscribe to the L2 orderbook delta stream for a market
634
693
  * (`/orderbook-deltas`). Mirrors the Python SDK's `OrderbookDeltaStream`:
@@ -650,6 +709,17 @@ export declare class ExchangeClient {
650
709
  * socket.
651
710
  */
652
711
  private openStream;
712
+ /** Shared multiplexed /ws feed. Options apply on first creation only.
713
+ * Reconnect restores snapshots, not missed events. Default auth reads the current signer.
714
+ */
715
+ feed(opts?: Partial<GatewayFeedOptions>): GatewayFeed;
716
+ /** Account snapshot plus live stream, with auth renewed per reconnect. */
717
+ subscribeAccount(onFrame: (frame: AccountFrame) => void, opts?: {
718
+ owner?: string;
719
+ auth?: false;
720
+ }): () => void;
721
+ subscribeOrderbook(market: number, onFrame: (frame: OrderbookFrame) => void): () => void;
722
+ subscribeTrades(market: number, onFrame: (frame: TradeFrame) => void): () => void;
653
723
  /** Close every open WebSocket stream and stop their reconnect loops. */
654
724
  disconnect(): void;
655
725
  }
@@ -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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