@0xmonaco/types 1.0.99 → 1.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.
|
@@ -87,9 +87,12 @@ export interface MarginAccountSummary {
|
|
|
87
87
|
* reducing, reduce-only, or opposite-side order sheltered by a larger
|
|
88
88
|
* resting ladder needs less or none of it (and can be admitted even when
|
|
89
89
|
* this field is zero), while an order crossing a losing position can need
|
|
90
|
-
* more than its own margin-plus-fee.
|
|
91
|
-
*
|
|
92
|
-
*
|
|
90
|
+
* more than its own margin-plus-fee. A bucket below its initial margin pays
|
|
91
|
+
* that gap out of the parent headroom first: its next order that opens,
|
|
92
|
+
* adds to or flips a position draws the gap with its own requirement, so
|
|
93
|
+
* the figure there is the headroom less the gap. Divide by a market's
|
|
94
|
+
* initial margin rate for indicative notional capacity; the authoritative
|
|
95
|
+
* per-order answer remains `simulateRiskBucketOrderRisk`.
|
|
93
96
|
*
|
|
94
97
|
* Present only on risk-bucket rows served from a live risk engine snapshot;
|
|
95
98
|
* absent (the key is omitted, never null) on parent rows and on
|
package/dist/trading/orders.d.ts
CHANGED
|
@@ -46,7 +46,7 @@ export interface Order {
|
|
|
46
46
|
/** Trading mode (SPOT or MARGIN) */
|
|
47
47
|
tradingMode: TradingMode;
|
|
48
48
|
/**
|
|
49
|
-
* Time in force - GTC, IOC, or FOK
|
|
49
|
+
* Time in force - GTC, IOC, or FOK.
|
|
50
50
|
* Absent on a MARKET order, which has none.
|
|
51
51
|
*/
|
|
52
52
|
timeInForce?: TimeInForce;
|
|
@@ -269,12 +269,11 @@ export type TradingMode = "SPOT" | "MARGIN";
|
|
|
269
269
|
* - GTC: Good Till Cancel - remains active until filled or canceled
|
|
270
270
|
* - IOC: Immediate or Cancel - execute immediately and cancel unfilled portion
|
|
271
271
|
* - FOK: Fill or Kill - execute completely or cancel entirely
|
|
272
|
-
*
|
|
273
|
-
*
|
|
274
|
-
*
|
|
275
|
-
* `GTC` together with `expirationDate`.
|
|
272
|
+
*
|
|
273
|
+
* For an order that expires at a set time, use `GTC` together with
|
|
274
|
+
* `expirationDate`.
|
|
276
275
|
*/
|
|
277
|
-
export type TimeInForce = "GTC" | "IOC" | "FOK"
|
|
276
|
+
export type TimeInForce = "GTC" | "IOC" | "FOK";
|
|
278
277
|
/**
|
|
279
278
|
* Per-order self-trade-prevention override: how the engine resolves the order
|
|
280
279
|
* matching against one of your own resting orders (whole wallet family,
|
|
@@ -8,24 +8,20 @@ import type { Address } from "viem";
|
|
|
8
8
|
/**
|
|
9
9
|
* Reason for the balance update.
|
|
10
10
|
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
11
|
+
* Every `balance_update` carries one spot `user_balances` row. Its
|
|
12
|
+
* producer-owned `version`, when present, is scoped to the authenticated
|
|
13
|
+
* user/application and token: higher is newer, equal is idempotent. `fee` and `rebate` accompany a
|
|
14
|
+
* spot fill: `fee` when a taker/application fee is charged, `rebate` when a
|
|
15
|
+
* maker rebate is credited. A collateral transfer that moves the spot wallet
|
|
16
|
+
* row (`margin_transfer_in` / `margin_transfer_out`) sends a versioned spot
|
|
17
|
+
* frame for that leg.
|
|
18
18
|
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
* they are not spot rows, and a deposit notification can carry a delta rather
|
|
26
|
-
* than whole-row state.
|
|
27
|
-
* They cannot be reconciled against a spot snapshot or summed as separate
|
|
28
|
-
* credits; refresh authoritative margin-account state instead.
|
|
19
|
+
* Margin collateral is not a spot row and is not sent on this channel: a
|
|
20
|
+
* margin-routed deposit, a perp fill, a funding settlement, a liquidation and
|
|
21
|
+
* an auto-deleveraging close send no `balance_update`. Read margin collateral
|
|
22
|
+
* from the `account` channel. `margin_deposit`, `funding`, `liquidation` and
|
|
23
|
+
* `adl` stay in this union so existing code that names them still compiles;
|
|
24
|
+
* the server does not send them.
|
|
29
25
|
*/
|
|
30
26
|
export type BalanceUpdateReason = "lock" | "unlock" | "deposit" | "margin_deposit" | "withdrawal" | "trade" | "fee" | "rebate" | "funding" | "liquidation" | "adl" | "margin_transfer_in" | "margin_transfer_out";
|
|
31
27
|
/**
|
|
@@ -36,7 +32,7 @@ export interface UserBalanceEventData {
|
|
|
36
32
|
tokenAddress: Address;
|
|
37
33
|
/** Token symbol */
|
|
38
34
|
tokenSymbol: string | null;
|
|
39
|
-
/** Available balance
|
|
35
|
+
/** Available spot balance (normalized) */
|
|
40
36
|
available: string;
|
|
41
37
|
/** Available balance in raw format (wei) */
|
|
42
38
|
availableRaw: string;
|
|
@@ -49,8 +45,8 @@ export interface UserBalanceEventData {
|
|
|
49
45
|
/** Total balance in raw format (wei) */
|
|
50
46
|
totalRaw: string;
|
|
51
47
|
/**
|
|
52
|
-
* Opaque durable spot-row version.
|
|
53
|
-
*
|
|
48
|
+
* Opaque durable spot-row version. Absent on frames from a producer that
|
|
49
|
+
* does not stamp versions yet.
|
|
54
50
|
*
|
|
55
51
|
* Only a POSITIVE version is rankable. `0` is the legacy sentinel and means
|
|
56
52
|
* exactly what an absent field means — unranked — so normalize the two
|
package/dist/wire/schema.d.ts
CHANGED
|
@@ -8639,9 +8639,12 @@ export interface components {
|
|
|
8639
8639
|
* reducing, reduce-only, or opposite-side order sheltered by a larger
|
|
8640
8640
|
* resting ladder needs less or none of it (and can be admitted even when
|
|
8641
8641
|
* this field is zero), while an order crossing a losing position can need
|
|
8642
|
-
* more than its own margin-plus-fee.
|
|
8643
|
-
*
|
|
8644
|
-
*
|
|
8642
|
+
* more than its own margin-plus-fee. A bucket below its initial margin pays
|
|
8643
|
+
* that gap out of the parent headroom first: its next order that opens,
|
|
8644
|
+
* adds to or flips a position draws the gap with its own requirement, so
|
|
8645
|
+
* the figure there is the headroom less the gap. Divide by a market's
|
|
8646
|
+
* initial margin rate for indicative notional capacity; the authoritative
|
|
8647
|
+
* per-order answer remains `simulate_risk_bucket_order_risk`.
|
|
8645
8648
|
*
|
|
8646
8649
|
* Present only on risk-bucket summary rows served from a live risk engine
|
|
8647
8650
|
* snapshot; absent on parent rows and on persisted-fallback reads, where
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@0xmonaco/types",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"homepage": "https://docs.0xmonaco.com/sdk/typescript",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"lint": "biome lint ."
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@0xmonaco/contracts": "1.0
|
|
19
|
+
"@0xmonaco/contracts": "1.1.0",
|
|
20
20
|
"zod": "^4.6.7"
|
|
21
21
|
},
|
|
22
22
|
"peerDependencies": {
|