@0xmonaco/types 1.0.47 → 1.0.50-develop.9c1b239
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/margin-accounts/index.d.ts +75 -2
- package/dist/portfolio/index.d.ts +12 -0
- package/dist/sdk/index.d.ts +1 -1
- package/dist/sweeper/index.d.ts +49 -27
- package/dist/sweeper/index.js +4 -6
- package/dist/trading/orders.d.ts +5 -0
- package/dist/validation/margin-accounts.d.ts +2 -0
- package/dist/validation/margin-accounts.js +4 -0
- package/dist/vault/index.d.ts +7 -1
- package/dist/websocket/base.d.ts +69 -0
- package/dist/websocket/events/account-events.d.ts +8 -5
- package/dist/websocket/events/balance-events.d.ts +1 -1
- package/dist/websocket/events/conditional-order-events.d.ts +71 -9
- package/dist/websocket/events/instrument-events.d.ts +12 -2
- package/dist/websocket/events/market-stats-events.d.ts +6 -1
- package/dist/websocket/events/ohlcv-events.d.ts +8 -3
- package/dist/websocket/events/orderbook-events.d.ts +2 -2
- package/dist/websocket/events/orders-events.d.ts +173 -64
- package/dist/websocket/events/position-events.d.ts +8 -2
- package/dist/websocket/events/trade-events.d.ts +2 -2
- package/dist/websocket/events/twap-order-events.d.ts +24 -6
- package/dist/wire/schema.d.ts +142 -21
- package/package.json +2 -2
package/dist/wire/schema.d.ts
CHANGED
|
@@ -869,6 +869,17 @@ export interface paths {
|
|
|
869
869
|
};
|
|
870
870
|
get?: never;
|
|
871
871
|
put?: never;
|
|
872
|
+
/**
|
|
873
|
+
* @deprecated
|
|
874
|
+
* @description DEPRECATED (0XM-2632): this endpoint overloads two unrelated operations —
|
|
875
|
+
* with `trading_pair_id` it allocates into that pair's isolated risk bucket
|
|
876
|
+
* (crediting the sole open position's stored margin), without it it performs
|
|
877
|
+
* a wallet-debiting deposit to the parent margin account. Use
|
|
878
|
+
* `TransferCollateralToRiskBucket` for bucket funding (which now applies the
|
|
879
|
+
* same position-margin credit) and `TransferCollateralToParentMarginAccount`
|
|
880
|
+
* for wallet-to-margin deposits. Kept for backward compatibility; no removal
|
|
881
|
+
* date scheduled.
|
|
882
|
+
*/
|
|
872
883
|
post: operations["transfer_collateral_to_margin_account"];
|
|
873
884
|
delete?: never;
|
|
874
885
|
options?: never;
|
|
@@ -1029,6 +1040,15 @@ export interface paths {
|
|
|
1029
1040
|
};
|
|
1030
1041
|
get?: never;
|
|
1031
1042
|
put?: never;
|
|
1043
|
+
/**
|
|
1044
|
+
* @description Fund a risk bucket from the parent margin account's unallocated
|
|
1045
|
+
* collateral (no wallet movement; the bucket is created if needed). Since
|
|
1046
|
+
* 0XM-2632, funding an ISOLATED bucket that holds an open position also
|
|
1047
|
+
* credits that position's stored margin — the same behavior as the
|
|
1048
|
+
* deprecated `TransferCollateralToMarginAccount` Adjust Margin rail — so
|
|
1049
|
+
* adding collateral to support a position has one behavior on every route.
|
|
1050
|
+
* A flat isolated bucket and the cross bucket stay plain allocations.
|
|
1051
|
+
*/
|
|
1032
1052
|
post: operations["transfer_collateral_to_risk_bucket"];
|
|
1033
1053
|
delete?: never;
|
|
1034
1054
|
options?: never;
|
|
@@ -2072,23 +2092,29 @@ export interface paths {
|
|
|
2072
2092
|
* Register a deposit address for monitoring
|
|
2073
2093
|
* @description Register a deposit address for monitoring.
|
|
2074
2094
|
*
|
|
2075
|
-
* Every (application, user)
|
|
2076
|
-
*
|
|
2077
|
-
* automatically forwards every ERC20 deposit into the
|
|
2078
|
-
*
|
|
2095
|
+
* Every (application, user, deposit target) triple has a deterministic
|
|
2096
|
+
* deposit address. This registers the caller's own address so the sweeper
|
|
2097
|
+
* service watches it and automatically forwards every ERC20 deposit into the
|
|
2098
|
+
* rollup, crediting the caller under the application.
|
|
2099
|
+
*
|
|
2100
|
+
* Authenticated, and the whole identity comes from the session: the
|
|
2101
|
+
* application is the one `login` established the session under, and the
|
|
2102
|
+
* credited address is the session's own. Neither is a request parameter, so a
|
|
2103
|
+
* caller can only ever register their own address under their own
|
|
2104
|
+
* application. The only thing the body carries is which ledger to aim at.
|
|
2079
2105
|
*
|
|
2080
2106
|
* Registration also runs a one-time initial check in the background: any
|
|
2081
2107
|
* balance already sitting on the address is swept without waiting for a new
|
|
2082
2108
|
* transfer. The response returns immediately with the derived address; it
|
|
2083
2109
|
* does not wait for that check.
|
|
2084
2110
|
*
|
|
2085
|
-
* Idempotent and safe to retry: re-registering an existing
|
|
2111
|
+
* Idempotent and safe to retry: re-registering an existing triple returns
|
|
2086
2112
|
* `already_registered` with the same address and never re-triggers the
|
|
2087
2113
|
* initial check.
|
|
2088
2114
|
*
|
|
2089
|
-
*
|
|
2090
|
-
*
|
|
2091
|
-
*
|
|
2115
|
+
* Globally rate-limited: registration creates durable state, so the endpoint
|
|
2116
|
+
* admits a bounded number per minute across all callers and answers `429`
|
|
2117
|
+
* beyond it.
|
|
2092
2118
|
*/
|
|
2093
2119
|
post: operations["register_deposit_address"];
|
|
2094
2120
|
delete?: never;
|
|
@@ -4064,6 +4090,14 @@ export interface components {
|
|
|
4064
4090
|
riskBucketId?: string | null;
|
|
4065
4091
|
marginMode?: string | null;
|
|
4066
4092
|
selectedTradingPairIds?: string[] | null;
|
|
4093
|
+
/**
|
|
4094
|
+
* @description See `MarginAccountSummary.available_order_collateral`: the collateral
|
|
4095
|
+
* still available to open NEW orders in this risk bucket, the risk engine
|
|
4096
|
+
* admission gate's own bound with parent auto top-up included. Present only
|
|
4097
|
+
* on risk-bucket rows served from a live engine snapshot; absent on parent
|
|
4098
|
+
* rows and persisted-fallback reads.
|
|
4099
|
+
*/
|
|
4100
|
+
availableOrderCollateral?: string | null;
|
|
4067
4101
|
};
|
|
4068
4102
|
GetMarkPriceResponse: {
|
|
4069
4103
|
/** Format: uuid */
|
|
@@ -5706,6 +5740,42 @@ export interface components {
|
|
|
5706
5740
|
marginMode?: string | null;
|
|
5707
5741
|
/** @description Present for cross risk-bucket summary rows. */
|
|
5708
5742
|
selectedTradingPairIds?: string[] | null;
|
|
5743
|
+
/**
|
|
5744
|
+
* @description The collateral still available to open NEW orders in this risk bucket:
|
|
5745
|
+
* the largest increase in the bucket's worst-case order reserve the risk
|
|
5746
|
+
* engine's admission gate accepts, automatic top-up from the parent margin
|
|
5747
|
+
* account's unallocated capacity included. Zero while the account or bucket
|
|
5748
|
+
* is frozen for liquidation, and for an isolated bucket whose market is
|
|
5749
|
+
* halted. (A cross bucket's market is chosen per order, so a halt cannot be
|
|
5750
|
+
* folded into its figure — a halted pair still refuses orders.)
|
|
5751
|
+
*
|
|
5752
|
+
* The trading-side sibling of `withdrawable_collateral`, and deliberately a
|
|
5753
|
+
* different figure: this one credits an unrealized gain in full, because a
|
|
5754
|
+
* gain is legitimate initial margin for new positions, while a withdrawal
|
|
5755
|
+
* never counts one. It already contains the bucket's live free collateral —
|
|
5756
|
+
* do not add `free_collateral` or `unrealized_pnl` on top. It can also
|
|
5757
|
+
* legitimately differ from this row's `free_collateral`, which is a
|
|
5758
|
+
* persisted reconstruction that cannot see the engine's worst-case
|
|
5759
|
+
* resting-order reserve.
|
|
5760
|
+
*
|
|
5761
|
+
* NOT additive across rows: every bucket's figure includes the SAME parent
|
|
5762
|
+
* unallocated headroom, so summing rows multiply-counts it, and committing
|
|
5763
|
+
* collateral in one bucket shrinks its siblings' figures.
|
|
5764
|
+
*
|
|
5765
|
+
* This is a requirement budget, not an order size: an order is charged the
|
|
5766
|
+
* increase it causes in the bucket's worst-case per-pair reserve, so a
|
|
5767
|
+
* reducing, reduce-only, or opposite-side order sheltered by a larger
|
|
5768
|
+
* resting ladder needs less or none of it (and can be admitted even when
|
|
5769
|
+
* this field is zero), while an order crossing a losing position can need
|
|
5770
|
+
* more than its own margin-plus-fee. Divide by a market's initial margin
|
|
5771
|
+
* rate for indicative notional capacity; the authoritative per-order answer
|
|
5772
|
+
* remains `simulate_risk_bucket_order_risk`.
|
|
5773
|
+
*
|
|
5774
|
+
* Present only on risk-bucket summary rows served from a live risk engine
|
|
5775
|
+
* snapshot; absent on parent rows and on persisted-fallback reads, where
|
|
5776
|
+
* neither of the gate's terms is reconstructable.
|
|
5777
|
+
*/
|
|
5778
|
+
availableOrderCollateral?: string | null;
|
|
5709
5779
|
};
|
|
5710
5780
|
MatchResult: {
|
|
5711
5781
|
/**
|
|
@@ -6081,6 +6151,19 @@ export interface components {
|
|
|
6081
6151
|
* may carry sub-tick tails).
|
|
6082
6152
|
*/
|
|
6083
6153
|
withdrawableCollateral?: string | null;
|
|
6154
|
+
/**
|
|
6155
|
+
* @description The collateral still available to open NEW orders in this risk bucket —
|
|
6156
|
+
* the same engine-served admission bound as
|
|
6157
|
+
* `MarginAccountSummary.available_order_collateral` (see that field for the
|
|
6158
|
+
* full semantics: an envelope delta with parent auto top-up included, NOT
|
|
6159
|
+
* additive across rows, zero while frozen), truncated toward zero at quote
|
|
6160
|
+
* decimals like `withdrawable_collateral` beside it.
|
|
6161
|
+
*
|
|
6162
|
+
* Present only when a live risk engine snapshot served the bound; absent on
|
|
6163
|
+
* persisted-fallback reads, where neither of the gate's terms is
|
|
6164
|
+
* reconstructable.
|
|
6165
|
+
*/
|
|
6166
|
+
availableOrderCollateral?: string | null;
|
|
6084
6167
|
};
|
|
6085
6168
|
PortfolioSeriesWindow: {
|
|
6086
6169
|
/**
|
|
@@ -6455,25 +6538,21 @@ export interface components {
|
|
|
6455
6538
|
};
|
|
6456
6539
|
RegisterRequest: {
|
|
6457
6540
|
/**
|
|
6458
|
-
* @description
|
|
6459
|
-
* @example
|
|
6460
|
-
|
|
6461
|
-
clientId: string;
|
|
6462
|
-
/**
|
|
6463
|
-
* @description Address credited on the rollup, and half of the deposit address derivation
|
|
6464
|
-
* @example 0x742d35Cc6634C0532925a3b8D4060f31E2C3d8B5
|
|
6541
|
+
* @description Which ledger swept deposits are requested to be credited to. `SPOT` (the default when omitted) credits the spot wallet; `MARGIN` asks for the parent margin account's collateral, skipping the separate collateral transfer. The target is part of the address derivation, so `SPOT` and `MARGIN` yield two different deposit addresses for the same pair, and each address carries its own request. `MARGIN` is a routing request rather than a guarantee: a deposit the matching engine cannot route to collateral — an unsupported collateral asset, or a margin account that fails validation — is credited to the spot wallet instead, so funds are never stranded. A `SPOT` address is never credited to margin.
|
|
6542
|
+
* @example MARGIN
|
|
6543
|
+
* @enum {string|null}
|
|
6465
6544
|
*/
|
|
6466
|
-
|
|
6545
|
+
depositTarget?: "SPOT" | "MARGIN" | null;
|
|
6467
6546
|
};
|
|
6468
6547
|
RegisterResponse: {
|
|
6469
6548
|
/**
|
|
6470
|
-
* @description `registered` when the
|
|
6549
|
+
* @description `registered` when the triple was added, `already_registered` when it was known before this call
|
|
6471
6550
|
* @example registered
|
|
6472
6551
|
* @enum {string|null}
|
|
6473
6552
|
*/
|
|
6474
6553
|
status?: "registered" | "already_registered" | null;
|
|
6475
6554
|
/**
|
|
6476
|
-
* @description The
|
|
6555
|
+
* @description The deposit address for this (application, user, deposit target) triple. Stable, and valid to publish and fund before any contract exists there.
|
|
6477
6556
|
* @example 0xcf1eF339798914EF7Ee4984Ed45BD141D63a65C9
|
|
6478
6557
|
*/
|
|
6479
6558
|
sweeperAddress?: string | null;
|
|
@@ -7298,6 +7377,16 @@ export interface components {
|
|
|
7298
7377
|
marginMode?: string | null;
|
|
7299
7378
|
/** @description Present for cross risk-bucket transfers. */
|
|
7300
7379
|
selectedTradingPairIds?: string[] | null;
|
|
7380
|
+
/**
|
|
7381
|
+
* @description Whether the transfer was committed to a position's stored margin.
|
|
7382
|
+
* Present only when a position-margin credit was in play: true — the credit
|
|
7383
|
+
* landed; false — a credit was requested (or defaulted) but degraded to a
|
|
7384
|
+
* plain allocation because the bucket's persisted position row was stale
|
|
7385
|
+
* (close/reopen race) — re-issue the Adjust Margin once the new position
|
|
7386
|
+
* row lands if the commitment still matters. Absent on plain allocations,
|
|
7387
|
+
* parent deposits, and releases.
|
|
7388
|
+
*/
|
|
7389
|
+
positionMarginCredited?: boolean | null;
|
|
7301
7390
|
};
|
|
7302
7391
|
TransferCollateralToParentMarginAccountRequest: {
|
|
7303
7392
|
asset?: string | null;
|
|
@@ -7317,6 +7406,31 @@ export interface components {
|
|
|
7317
7406
|
marginMode?: string | null;
|
|
7318
7407
|
/** @description Trading pair UUIDs selected into the cross risk bucket. Required when marginMode is CROSS. */
|
|
7319
7408
|
selectedTradingPairIds?: string[] | null;
|
|
7409
|
+
/**
|
|
7410
|
+
* @description What the transferred collateral becomes when the ISOLATED bucket holds an
|
|
7411
|
+
* open position. The two intents want opposite fates for the same dollars,
|
|
7412
|
+
* so the caller states theirs:
|
|
7413
|
+
*
|
|
7414
|
+
* - true (and UNSET — the default is the human "Adjust Margin" gesture):
|
|
7415
|
+
* the amount is COMMITTED to the position's stored margin. Effective
|
|
7416
|
+
* leverage drops and stays down, initial margin required rises by the
|
|
7417
|
+
* amount, free collateral is unchanged — new orders cannot spend it.
|
|
7418
|
+
* - false: plain allocation. Free collateral rises and the next order can
|
|
7419
|
+
* spend it. Programmatic funding loops that top a bucket up to a free
|
|
7420
|
+
* collateral target MUST pass false, or each top-up converts into
|
|
7421
|
+
* requirement and the loop never converges.
|
|
7422
|
+
*
|
|
7423
|
+
* Either way the liquidation cushion improves identically (the breach
|
|
7424
|
+
* check is bucket-equity based). On a FLAT isolated bucket there is no
|
|
7425
|
+
* position to commit to and both values are a plain allocation. Explicit
|
|
7426
|
+
* true is rejected for CROSS buckets (cross has no per-position margin);
|
|
7427
|
+
* unset/false is a plain allocation there.
|
|
7428
|
+
*
|
|
7429
|
+
* The response reports what actually happened in `position_margin_credited`
|
|
7430
|
+
* — a credit can degrade to a plain allocation when the persisted position
|
|
7431
|
+
* row is stale (close/reopen race).
|
|
7432
|
+
*/
|
|
7433
|
+
applyToPositionMargin?: boolean | null;
|
|
7320
7434
|
};
|
|
7321
7435
|
TransferRewardsRequest: {
|
|
7322
7436
|
/**
|
|
@@ -11951,14 +12065,21 @@ export interface operations {
|
|
|
11951
12065
|
};
|
|
11952
12066
|
content?: never;
|
|
11953
12067
|
};
|
|
11954
|
-
/** @description
|
|
11955
|
-
|
|
12068
|
+
/** @description Authentication required */
|
|
12069
|
+
401: {
|
|
12070
|
+
headers: {
|
|
12071
|
+
[name: string]: unknown;
|
|
12072
|
+
};
|
|
12073
|
+
content?: never;
|
|
12074
|
+
};
|
|
12075
|
+
/** @description The application for this session is not active */
|
|
12076
|
+
403: {
|
|
11956
12077
|
headers: {
|
|
11957
12078
|
[name: string]: unknown;
|
|
11958
12079
|
};
|
|
11959
12080
|
content?: never;
|
|
11960
12081
|
};
|
|
11961
|
-
/** @description Registration
|
|
12082
|
+
/** @description Registration admission limit exceeded; retry shortly */
|
|
11962
12083
|
429: {
|
|
11963
12084
|
headers: {
|
|
11964
12085
|
[name: string]: unknown;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@0xmonaco/types",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.50-develop.9c1b239",
|
|
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.0.50-develop.9c1b239",
|
|
20
20
|
"zod": "^4.1.12"
|
|
21
21
|
},
|
|
22
22
|
"peerDependencies": {
|