@0xmonaco/types 1.1.5-develop.129b2c6 → 1.1.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.
Files changed (40) hide show
  1. package/README.md +3 -1
  2. package/dist/applications/requests.d.ts +5 -5
  3. package/dist/buildercodes/index.d.ts +11 -13
  4. package/dist/buildercodes/responses.d.ts +0 -1
  5. package/dist/buildercodes/responses.js +0 -10
  6. package/dist/index.d.ts +0 -1
  7. package/dist/index.js +0 -1
  8. package/dist/margin-accounts/index.d.ts +2 -7
  9. package/dist/market/index.d.ts +20 -0
  10. package/dist/profile/index.d.ts +17 -10
  11. package/dist/rfq/responses.d.ts +0 -36
  12. package/dist/rfq/responses.js +0 -29
  13. package/dist/sdk/index.d.ts +1 -4
  14. package/dist/trading/index.d.ts +2 -4
  15. package/dist/trading/orders.d.ts +0 -11
  16. package/dist/trading/responses.d.ts +2 -2
  17. package/dist/validation/margin-accounts.d.ts +2 -2
  18. package/dist/validation/margin-accounts.js +5 -5
  19. package/dist/validation/trading.d.ts +0 -15
  20. package/dist/validation/trading.js +42 -34
  21. package/dist/websocket/base.d.ts +10 -40
  22. package/dist/websocket/client.d.ts +4 -32
  23. package/dist/websocket/events/orderbook-events.d.ts +1 -41
  24. package/dist/websocket/events/rfq-events.d.ts +1 -30
  25. package/dist/websocket/events/trade-events.d.ts +0 -31
  26. package/dist/websocket/index.d.ts +0 -1
  27. package/dist/websocket/index.js +0 -1
  28. package/dist/websocket/snapshots.d.ts +1 -23
  29. package/dist/wire/operations.d.ts +1 -1
  30. package/dist/wire/operations.js +0 -16
  31. package/dist/wire/schema.d.ts +295 -2308
  32. package/package.json +2 -2
  33. package/dist/analytics/builders.d.ts +0 -131
  34. package/dist/analytics/builders.js +0 -11
  35. package/dist/analytics/index.d.ts +0 -151
  36. package/dist/analytics/index.js +0 -27
  37. package/dist/analytics/wallets.d.ts +0 -193
  38. package/dist/analytics/wallets.js +0 -16
  39. package/dist/websocket/depth.d.ts +0 -142
  40. package/dist/websocket/depth.js +0 -13
@@ -1,142 +0,0 @@
1
- /**
2
- * Market-data depth and BBO types (0XM-3551).
3
- *
4
- * The `depth:<tradingPairId>:<SPOT|MARGIN>` and `bbo:<tradingPairId>:<SPOT|MARGIN>`
5
- * WebSocket channels carry the market-data service's sequenced book: a
6
- * subscribe-time snapshot, then live frames linked by `bookSeq` /
7
- * `prevBookSeq`. The SDK's `ws.depth` and `ws.bbo` helpers keep the local
8
- * state for you; the frame shapes are exported for callers that need them.
9
- *
10
- * Sequence numbers are durable-log positions (u64). They are surfaced as
11
- * decimal strings, since a u64 can exceed `Number.MAX_SAFE_INTEGER`; compare
12
- * them with `BigInt`.
13
- */
14
- import type { TradingMode } from "../trading";
15
- /** One price level, with its absolute (not incremental) values. */
16
- export interface DepthLevel {
17
- /** Price, a decimal string. */
18
- price: string;
19
- /** Resting quantity at this price, a decimal string. */
20
- quantity: string;
21
- /** Number of resting orders at this price. */
22
- orderCount: number;
23
- }
24
- /**
25
- * The `depth` channel's subscribe-time snapshot: up to 1000 levels per side,
26
- * best first, exact as of `bookSeq`.
27
- */
28
- export interface DepthSnapshot {
29
- tradingPairId: string;
30
- tradingMode: TradingMode | (string & {});
31
- /** The durable-log sequence the snapshot is exact as of (u64, decimal string). */
32
- bookSeq: string;
33
- bids: DepthLevel[];
34
- asks: DepthLevel[];
35
- /** Every bid level is in `bids`; when false, levels below the last one are unknown. */
36
- bidsComplete: boolean;
37
- /** Every ask level is in `asks`; when false, levels above the last one are unknown. */
38
- asksComplete: boolean;
39
- }
40
- /**
41
- * A live `depth` frame: only the levels that changed since `prevBookSeq`,
42
- * each with its absolute value at `bookSeq`. A quantity of `"0"` (order
43
- * count 0) removes the level.
44
- */
45
- export interface DepthDelta {
46
- tradingPairId: string;
47
- tradingMode: TradingMode | (string & {});
48
- /** The durable-log sequence of the last change this frame includes. */
49
- bookSeq: string;
50
- /** The `bookSeq` this frame continues from. */
51
- prevBookSeq: string;
52
- /** The durable-log timestamp of the step at `bookSeq`, in milliseconds. */
53
- timestampMs: number;
54
- bids: DepthLevel[];
55
- asks: DepthLevel[];
56
- /** Set while the publisher lags the durable log. */
57
- stale: boolean;
58
- }
59
- /** The local book `ws.depth` maintains and hands to its listener. */
60
- export interface DepthBook {
61
- tradingPairId: string;
62
- tradingMode: TradingMode | (string & {});
63
- /** The sequence the book is current as of (u64, decimal string). */
64
- bookSeq: string;
65
- /** Bids, best (highest) first. */
66
- bids: DepthLevel[];
67
- /** Asks, best (lowest) first. */
68
- asks: DepthLevel[];
69
- /**
70
- * Every bid level is known. When false, the book holds only levels at or
71
- * above the snapshot's deepest bid: a level below it that a removal would
72
- * promote stays unknown until the next snapshot.
73
- */
74
- bidsComplete: boolean;
75
- /** Every ask level is known (see `bidsComplete`). */
76
- asksComplete: boolean;
77
- /** The latest applied frame was published while the service lagged. */
78
- stale: boolean;
79
- /** Durable-log time of the latest applied frame; absent right after a snapshot. */
80
- timestampMs?: number;
81
- }
82
- /** The `bbo` channel's subscribe-time snapshot. An empty side is `null`. */
83
- export interface BboSnapshot {
84
- tradingPairId: string;
85
- tradingMode: TradingMode | (string & {});
86
- bookSeq: string;
87
- bestBid: string | null;
88
- /** Quantity resting at `bestBid`. */
89
- bidQty: string | null;
90
- bestAsk: string | null;
91
- /** Quantity resting at `bestAsk`. */
92
- askQty: string | null;
93
- }
94
- /** A live `bbo` frame. */
95
- export interface BboEvent extends BboSnapshot {
96
- prevBookSeq: string;
97
- timestampMs: number;
98
- stale: boolean;
99
- }
100
- /** The top of book `ws.bbo` maintains and hands to its listener. */
101
- export interface Bbo extends BboSnapshot {
102
- /** The latest applied frame was published while the service lagged. */
103
- stale: boolean;
104
- /** Durable-log time of the latest applied frame; absent right after a snapshot. */
105
- timestampMs?: number;
106
- }
107
- /** Why a local book was discarded and is being rebuilt from a new snapshot. */
108
- export type LocalBookResyncReason =
109
- /** A frame did not link to the book (a lost frame), or could not be read. */
110
- "gap"
111
- /**
112
- * The server could not serve a snapshot (`SNAPSHOT_UNAVAILABLE`; it retries
113
- * and sends one when the book heals), or the one it sent could not be read.
114
- */
115
- | "snapshot_unavailable"
116
- /**
117
- * A side whose snapshot was incomplete has thinned below half its snapshot
118
- * depth: the levels beyond its boundary are unknown, so a fresh snapshot is
119
- * taken.
120
- */
121
- | "truncated"
122
- /** The connection dropped; the book is rebuilt from the snapshot the reconnect brings. */
123
- | "disconnected";
124
- /** A channel-level error the server sent for a `depth` / `bbo` subscription. */
125
- export interface LocalBookError {
126
- /** The server's error code, e.g. `INVALID_SUBSCRIPTION`. */
127
- code: string;
128
- message: string;
129
- }
130
- /** Options for `ws.depth` and `ws.bbo`. */
131
- export interface LocalBookOptions {
132
- /**
133
- * Called when the local state is discarded to be rebuilt; the listener is
134
- * called again once the new snapshot arrives.
135
- */
136
- onResync?: (reason: LocalBookResyncReason) => void;
137
- /**
138
- * Called when the server rejects the subscription with an error other than
139
- * `SNAPSHOT_UNAVAILABLE` (which is retried): the book will not arrive.
140
- */
141
- onError?: (error: LocalBookError) => void;
142
- }
@@ -1,13 +0,0 @@
1
- /**
2
- * Market-data depth and BBO types (0XM-3551).
3
- *
4
- * The `depth:<tradingPairId>:<SPOT|MARGIN>` and `bbo:<tradingPairId>:<SPOT|MARGIN>`
5
- * WebSocket channels carry the market-data service's sequenced book: a
6
- * subscribe-time snapshot, then live frames linked by `bookSeq` /
7
- * `prevBookSeq`. The SDK's `ws.depth` and `ws.bbo` helpers keep the local
8
- * state for you; the frame shapes are exported for callers that need them.
9
- *
10
- * Sequence numbers are durable-log positions (u64). They are surfaced as
11
- * decimal strings, since a u64 can exceed `Number.MAX_SAFE_INTEGER`; compare
12
- * them with `BigInt`.
13
- */