@0xmonaco/types 1.0.80 → 1.0.81
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/auth/responses.d.ts +1 -1
- package/dist/margin-accounts/index.d.ts +10 -0
- package/dist/pitpass/index.d.ts +5 -5
- package/dist/pitpass/index.js +2 -2
- package/dist/pitpass/responses.d.ts +2 -2
- package/dist/pitpass/responses.js +3 -3
- package/dist/positions/index.d.ts +9 -4
- package/dist/sdk/index.d.ts +1 -1
- package/dist/trading/index.d.ts +16 -0
- package/dist/websocket/client.d.ts +14 -9
- package/dist/websocket/client.js +8 -6
- package/dist/websocket/events/copy-events.d.ts +1 -1
- package/dist/websocket/events/position-events.d.ts +14 -0
- package/dist/websocket/snapshots.d.ts +21 -3
- package/dist/websocket/snapshots.js +5 -3
- package/dist/wire/schema.d.ts +32 -17
- package/package.json +2 -2
package/dist/auth/responses.d.ts
CHANGED
|
@@ -51,7 +51,7 @@ export interface AuthState {
|
|
|
51
51
|
*/
|
|
52
52
|
isNewUser?: boolean;
|
|
53
53
|
/**
|
|
54
|
-
* True when a
|
|
54
|
+
* True when a TraderCodes referral relationship was recorded on this verify: a
|
|
55
55
|
* valid, non-self TraderCode was presented on the wallet's first-ever sign-in
|
|
56
56
|
* and resolved to a known referrer. Use it to confirm the referral landed on
|
|
57
57
|
* the signup-success screen. Absent on responses from a server that predates
|
|
@@ -423,6 +423,16 @@ export type SimulateRiskBucketOrderRiskRequest = SimulateIsolatedRiskBucketOrder
|
|
|
423
423
|
export interface SimulateOrderRiskResponse {
|
|
424
424
|
accepted: boolean;
|
|
425
425
|
rejectReason?: string;
|
|
426
|
+
/**
|
|
427
|
+
* Structured code of the refusal behind `rejectReason`: the same code
|
|
428
|
+
* placing the order would return in the error envelope (for example
|
|
429
|
+
* `MARGIN_MODE_CONFLICT` when the margin account holds the pair in its other
|
|
430
|
+
* margin mode, `INVALID_ORDER` for the catch-all). Present for
|
|
431
|
+
* client-class refusals; absent on an accepted preview, and absent when the
|
|
432
|
+
* preview failed on a server-side fault (`rejectReason` is then a generic
|
|
433
|
+
* retry message).
|
|
434
|
+
*/
|
|
435
|
+
rejectCode?: string;
|
|
426
436
|
marginAccountId: string;
|
|
427
437
|
strategyKey?: string;
|
|
428
438
|
riskBucketId?: string;
|
package/dist/pitpass/index.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* TraderCodes Types (`sdk.pitpass`)
|
|
3
3
|
*
|
|
4
|
-
* Types for
|
|
4
|
+
* Types for the TraderCodes API: code lookup, rewards balance, and transfer.
|
|
5
5
|
*/
|
|
6
6
|
import type { BaseAPI } from "../api";
|
|
7
7
|
import type { GetMyReferralDownlineParams, GetMyReferralDownlineResponse, GetMyReferralPositionResponse, GetMyReferralTreeParams, GetMyReferralTreeResponse, GetRewardsBalanceResponse, TraderCodeAvailabilityResponse, TraderCodeInfoResponse, TraderCodeResponse, TransferRewardsParams, TransferRewardsResponse } from "./responses";
|
|
8
8
|
/**
|
|
9
|
-
*
|
|
9
|
+
* TraderCodes API interface (`sdk.pitpass`).
|
|
10
10
|
*
|
|
11
11
|
* Provides methods for reading your wallet-derived TraderCode, looking up a
|
|
12
12
|
* referral code at sign-up, reading your accrued rewards balance, and
|
|
@@ -71,7 +71,7 @@ export interface PitpassAPI extends BaseAPI {
|
|
|
71
71
|
*/
|
|
72
72
|
getTraderCodeInfo(code: string): Promise<TraderCodeInfoResponse>;
|
|
73
73
|
/**
|
|
74
|
-
* Return the caller's current
|
|
74
|
+
* Return the caller's current TraderCodes rewards-bucket balances.
|
|
75
75
|
*
|
|
76
76
|
* Rewards accumulate here as referred users trade. Call
|
|
77
77
|
* {@link transferRewards} to move them into a tradeable balance.
|
|
@@ -81,7 +81,7 @@ export interface PitpassAPI extends BaseAPI {
|
|
|
81
81
|
*/
|
|
82
82
|
getRewardsBalance(): Promise<GetRewardsBalanceResponse>;
|
|
83
83
|
/**
|
|
84
|
-
* Transfer earned
|
|
84
|
+
* Transfer earned TraderCodes rewards into a trading balance.
|
|
85
85
|
*
|
|
86
86
|
* Moves the specified amount of a reward token from the caller's rewards
|
|
87
87
|
* bucket into their trading balance under the authenticated application.
|
package/dist/pitpass/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* TraderCodes Types (`sdk.pitpass`)
|
|
3
3
|
*
|
|
4
|
-
* Types for
|
|
4
|
+
* Types for the TraderCodes API: code lookup, rewards balance, and transfer.
|
|
5
5
|
*/
|
|
6
6
|
export { GetMyReferralDownlineParamsSchema, GetMyReferralDownlineResponseSchema, GetMyReferralPositionResponseSchema, GetMyReferralTreeParamsSchema, GetMyReferralTreeResponseSchema, GetRewardsBalanceResponseSchema, LevelEarningsSchema, ReferralDirectRefereeSchema, ReferralEarningsSourceSchema, ReferralEarningsSummarySchema, ReferralRewardEntrySchema, ReferralTreeNodeSchema, ReferralUplineEntrySchema, RewardsBalanceEntrySchema, SetTraderCodeParamsSchema, TraderCodeAvailabilityReasonSchema, TraderCodeAvailabilityResponseSchema, TraderCodeInfoResponseSchema, TraderCodeResponseSchema, TransferRewardsParamsSchema, TransferRewardsResponseSchema, } from "./responses";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* TraderCodes Response Types
|
|
3
3
|
*
|
|
4
|
-
* Types for
|
|
4
|
+
* Types for TraderCodes API responses and requests.
|
|
5
5
|
* All types are derived from Zod schemas for runtime validation.
|
|
6
6
|
*/
|
|
7
7
|
import { z } from "zod";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* TraderCodes Response Types
|
|
3
3
|
*
|
|
4
|
-
* Types for
|
|
4
|
+
* Types for TraderCodes API responses and requests.
|
|
5
5
|
* All types are derived from Zod schemas for runtime validation.
|
|
6
6
|
*/
|
|
7
7
|
import { z } from "zod";
|
|
@@ -194,7 +194,7 @@ export const ReferralEarningsSummarySchema = z.object({
|
|
|
194
194
|
level3Earned: z.string(),
|
|
195
195
|
/**
|
|
196
196
|
* Earnings per level, ascending, one entry per level with earnings. Covers
|
|
197
|
-
* every level, including levels deeper than
|
|
197
|
+
* every level, including levels deeper than TraderCodes rewards today.
|
|
198
198
|
*/
|
|
199
199
|
byLevel: z.array(LevelEarningsSchema),
|
|
200
200
|
});
|
|
@@ -39,7 +39,8 @@ export type ClosePositionType = "MARKET" | "LIMIT" | "IOC";
|
|
|
39
39
|
* repaired by the background reconcile (e.g. `exitPrice` can be present
|
|
40
40
|
* while `cumFees` is absent). `OPEN` and `LIQUIDATING` positions are
|
|
41
41
|
* checked against realized PnL too: an `OPEN` or `LIQUIDATING` row whose
|
|
42
|
-
* reductions do not account for it is INCOMPLETE with no `cumFees
|
|
42
|
+
* reductions do not account for it is INCOMPLETE with no `cumFees` and no
|
|
43
|
+
* `fundingPaid`.
|
|
43
44
|
*
|
|
44
45
|
* Never read an absent lifetime field as zero.
|
|
45
46
|
*/
|
|
@@ -117,9 +118,13 @@ export interface Position {
|
|
|
117
118
|
*/
|
|
118
119
|
exitPrice?: string;
|
|
119
120
|
/**
|
|
120
|
-
* Lifetime funding paid (signed; negative means
|
|
121
|
-
*
|
|
122
|
-
*
|
|
121
|
+
* Lifetime funding paid since the position opened (signed; negative means
|
|
122
|
+
* received). On a terminal row, summed over the position's reducing
|
|
123
|
+
* executions. On an open row, the funding accrued on the size still open
|
|
124
|
+
* plus the funding its partial closes settled, so the last open value
|
|
125
|
+
* equals the terminal value. Absent when unavailable, including on an open
|
|
126
|
+
* row whose `lifetimeTotalsStatus` is not `LIFETIME_TOTALS_STATUS_COMPLETE`;
|
|
127
|
+
* never an understated partial.
|
|
123
128
|
*/
|
|
124
129
|
fundingPaid?: string;
|
|
125
130
|
/**
|
package/dist/sdk/index.d.ts
CHANGED
|
@@ -112,7 +112,7 @@ export interface MonacoSDK {
|
|
|
112
112
|
portfolio: PortfolioAPI;
|
|
113
113
|
/** Sub-account management API */
|
|
114
114
|
subAccounts: SubAccountsAPI;
|
|
115
|
-
/**
|
|
115
|
+
/** TraderCodes referral and rewards API */
|
|
116
116
|
pitpass: PitpassAPI;
|
|
117
117
|
/** BuilderCodes frontend revenue-share payout API */
|
|
118
118
|
buildercodes: BuildercodesAPI;
|
package/dist/trading/index.d.ts
CHANGED
|
@@ -30,6 +30,14 @@ export interface TradingAPI extends BaseAPI {
|
|
|
30
30
|
expirationDate?: string;
|
|
31
31
|
timeInForce?: TimeInForce;
|
|
32
32
|
marginAccountId?: string;
|
|
33
|
+
/**
|
|
34
|
+
* Defaults to `ISOLATED`. One margin mode per market and margin account:
|
|
35
|
+
* while the account holds the pair in its other risk bucket (an open
|
|
36
|
+
* position, or a resting order that is not reduce-only) an order that is
|
|
37
|
+
* not reduce-only is rejected with `MARGIN_MODE_CONFLICT`; reduce-only
|
|
38
|
+
* orders always pass. On an isolated-only market a `CROSS` order that is
|
|
39
|
+
* not reduce-only is rejected with `CROSS_MARGIN_NOT_ALLOWED`.
|
|
40
|
+
*/
|
|
33
41
|
marginMode?: MarginMode;
|
|
34
42
|
riskBucketId?: string;
|
|
35
43
|
/** Initial order budget; unfilled funds do not back the isolated position. */
|
|
@@ -84,6 +92,14 @@ export interface TradingAPI extends BaseAPI {
|
|
|
84
92
|
tradingMode?: TradingMode;
|
|
85
93
|
slippageTolerance?: number;
|
|
86
94
|
marginAccountId?: string;
|
|
95
|
+
/**
|
|
96
|
+
* Defaults to `ISOLATED`. One margin mode per market and margin account:
|
|
97
|
+
* while the account holds the pair in its other risk bucket (an open
|
|
98
|
+
* position, or a resting order that is not reduce-only) an order that is
|
|
99
|
+
* not reduce-only is rejected with `MARGIN_MODE_CONFLICT`; reduce-only
|
|
100
|
+
* orders always pass. On an isolated-only market a `CROSS` order that is
|
|
101
|
+
* not reduce-only is rejected with `CROSS_MARGIN_NOT_ALLOWED`.
|
|
102
|
+
*/
|
|
87
103
|
marginMode?: MarginMode;
|
|
88
104
|
riskBucketId?: string;
|
|
89
105
|
/** Initial order budget; unfilled funds do not back the isolated position. */
|
|
@@ -42,13 +42,15 @@
|
|
|
42
42
|
* baseline over REST for the extra consumer.
|
|
43
43
|
*
|
|
44
44
|
* Where the server has no snapshot arm for a channel yet, the callback is
|
|
45
|
-
* simply never invoked — a silent no-op, not an error. `orderbook
|
|
46
|
-
*
|
|
45
|
+
* simply never invoked — a silent no-op, not an error. `orderbook` and
|
|
46
|
+
* `movements` take no `onSnapshot` at all: they stream events rather than
|
|
47
47
|
* state, and the channel-coverage lock pins that classification against the
|
|
48
|
-
* server's own snapshot dispatch. `trades`
|
|
49
|
-
* `onSnapshot` delivers
|
|
50
|
-
*
|
|
51
|
-
* subscribe, so a consumer dedupes on `tradeId`.
|
|
48
|
+
* server's own snapshot dispatch. `trades` and `ohlcv` are also event streams,
|
|
49
|
+
* but their `onSnapshot` delivers recent history as a baseline. `trades` sends
|
|
50
|
+
* the pair's newest trades, which can overlap the first live trades or miss
|
|
51
|
+
* one executed just before the subscribe, so a consumer dedupes on `tradeId`.
|
|
52
|
+
* `ohlcv` sends the series' newest candles, whose newest candle can be partial
|
|
53
|
+
* or missing, so a consumer upserts live candles by `T`.
|
|
52
54
|
*/
|
|
53
55
|
import type { SessionCredentials } from "../auth/index";
|
|
54
56
|
import type { Interval } from "../market";
|
|
@@ -56,7 +58,7 @@ import type { TradingMode } from "../trading";
|
|
|
56
58
|
import type { WebSocketStatus } from "./base";
|
|
57
59
|
import type { OrderbookQuotationMode } from "./clients/orderbook-client";
|
|
58
60
|
import type { AccountEvent, AccountEventData, ConditionalOrderEvent, ConditionalOrderEventData, CopyEvent, CopyRelationshipEventData, InstrumentEvent, InstrumentEventData, LiquidationEvent, LiquidationEventData, MarketStatsAllEvent, MarketStatsData, MarketStatsEvent, MarketStatsSummary, OHLCVEvent, OHLCVPriceType, OrderbookEvent, OrderEvent, PositionEvent, PositionEventData, PositionValuationEvent, TradeEvent, TradeEventData, TwapOrderEvent, TwapOrderEventData, UserBalanceEvent, UserBalanceEventData, UserMovementEvent } from "./events";
|
|
59
|
-
import type { OrderSnapshotItem, SnapshotHandler } from "./snapshots";
|
|
61
|
+
import type { OHLCVSnapshotCandle, OrderSnapshotItem, SnapshotHandler } from "./snapshots";
|
|
60
62
|
export type MessageHandler<T> = (data: T) => void;
|
|
61
63
|
export interface MonacoWebSocket {
|
|
62
64
|
/** Connect to the WebSocket server */
|
|
@@ -73,8 +75,11 @@ export interface MonacoWebSocket {
|
|
|
73
75
|
orders: (tradingPairId: string, tradingMode: TradingMode, handler: MessageHandler<OrderEvent>, onSnapshot?: SnapshotHandler<OrderSnapshotItem>) => () => void;
|
|
74
76
|
/** Subscribe to orderbook events (public) */
|
|
75
77
|
orderbook: (tradingPairId: string, tradingMode: TradingMode, magnitude: number, quotationMode: OrderbookQuotationMode, handler: MessageHandler<OrderbookEvent>) => () => void;
|
|
76
|
-
/**
|
|
77
|
-
|
|
78
|
+
/**
|
|
79
|
+
* Subscribe to OHLCV candlestick events (public); `onSnapshot` receives the series' newest 350 candles, oldest first.
|
|
80
|
+
* The newest snapshot candle can be partial or missing, so upsert live candles by `T`. A `*` price type gets no snapshot.
|
|
81
|
+
*/
|
|
82
|
+
ohlcv: (tradingPairId: string, tradingMode: TradingMode, interval: Interval, handler: MessageHandler<OHLCVEvent>, priceType?: OHLCVPriceType, onSnapshot?: SnapshotHandler<OHLCVSnapshotCandle>) => () => void;
|
|
78
83
|
/**
|
|
79
84
|
* Subscribe to trade events (public); `onSnapshot` receives the pair's newest 50 trades, newest first.
|
|
80
85
|
* The snapshot can overlap the first live trades or miss one executed just before subscribing, so dedupe on `tradeId`.
|
package/dist/websocket/client.js
CHANGED
|
@@ -42,11 +42,13 @@
|
|
|
42
42
|
* baseline over REST for the extra consumer.
|
|
43
43
|
*
|
|
44
44
|
* Where the server has no snapshot arm for a channel yet, the callback is
|
|
45
|
-
* simply never invoked — a silent no-op, not an error. `orderbook
|
|
46
|
-
*
|
|
45
|
+
* simply never invoked — a silent no-op, not an error. `orderbook` and
|
|
46
|
+
* `movements` take no `onSnapshot` at all: they stream events rather than
|
|
47
47
|
* state, and the channel-coverage lock pins that classification against the
|
|
48
|
-
* server's own snapshot dispatch. `trades`
|
|
49
|
-
* `onSnapshot` delivers
|
|
50
|
-
*
|
|
51
|
-
* subscribe, so a consumer dedupes on `tradeId`.
|
|
48
|
+
* server's own snapshot dispatch. `trades` and `ohlcv` are also event streams,
|
|
49
|
+
* but their `onSnapshot` delivers recent history as a baseline. `trades` sends
|
|
50
|
+
* the pair's newest trades, which can overlap the first live trades or miss
|
|
51
|
+
* one executed just before the subscribe, so a consumer dedupes on `tradeId`.
|
|
52
|
+
* `ohlcv` sends the series' newest candles, whose newest candle can be partial
|
|
53
|
+
* or missing, so a consumer upserts live candles by `T`.
|
|
52
54
|
*/
|
|
@@ -29,7 +29,7 @@ export type CopyStopReason = "FOLLOWER" | "STOP_LOSS" | "SKIP_LIMIT" | "ADMIN" |
|
|
|
29
29
|
* Why a leader fill was not mirrored. Only `INSUFFICIENT_MARGIN` advances the
|
|
30
30
|
* relationship's `consecutiveSkips` streak.
|
|
31
31
|
*/
|
|
32
|
-
export type CopySkipReason = "INSUFFICIENT_MARGIN" | "BELOW_MIN" | "LEVERAGE_MISMATCH" | "MARKET_STATE" | "LEADER_EQUITY" | "NO_LIQUIDITY";
|
|
32
|
+
export type CopySkipReason = "INSUFFICIENT_MARGIN" | "BELOW_MIN" | "LEVERAGE_MISMATCH" | "MARKET_STATE" | "LEADER_EQUITY" | "NO_LIQUIDITY" | "MARGIN_MODE_CONFLICT";
|
|
33
33
|
/**
|
|
34
34
|
* Why a relationship frame was sent. `snapshot` marks a subscribe-time
|
|
35
35
|
* baseline row; every other value names the change that produced a live
|
|
@@ -205,6 +205,20 @@ export interface PositionEventData {
|
|
|
205
205
|
* released only after durable acknowledgement.
|
|
206
206
|
*/
|
|
207
207
|
version?: number;
|
|
208
|
+
/**
|
|
209
|
+
* Lifetime funding since the position opened (decimal string; positive
|
|
210
|
+
* means paid, negative means received): the funding accrued on the size
|
|
211
|
+
* still open plus the funding its partial closes settled. A terminal frame
|
|
212
|
+
* carries the closed position's whole-life total, the same `fundingPaid` a
|
|
213
|
+
* REST read of the closed position returns. The subscribe-time snapshot
|
|
214
|
+
* carries the REST value for the same row.
|
|
215
|
+
*
|
|
216
|
+
* Absent means UNKNOWN, never zero: the server cannot account for every
|
|
217
|
+
* earlier reduction yet (a value would understate it), or a deployment
|
|
218
|
+
* older than this field sent the frame. Keep the last known value rather
|
|
219
|
+
* than clearing it.
|
|
220
|
+
*/
|
|
221
|
+
fundingPaid?: string;
|
|
208
222
|
}
|
|
209
223
|
/**
|
|
210
224
|
* Position event emitted when a user's position state changes.
|
|
@@ -5,9 +5,11 @@
|
|
|
5
5
|
* `Subscribed` ack and before that subscription's first live diff. Its `data`
|
|
6
6
|
* is the channel's COMPLETE current state as a flat array — a consumer that
|
|
7
7
|
* applies it wholesale needs no REST baseline read for that channel. `trades`
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* or miss one executed just before the subscribe — dedupe on
|
|
8
|
+
* and `ohlcv` are the exceptions: their arrays are recent history rather than
|
|
9
|
+
* complete state. `trades` is the pair's newest trades, which can overlap the
|
|
10
|
+
* first live trades or miss one executed just before the subscribe — dedupe on
|
|
11
|
+
* `tradeId`. `ohlcv` is the subscribed series' newest candles, whose newest
|
|
12
|
+
* candle can be partial or missing — upsert live candles by `T`.
|
|
11
13
|
*
|
|
12
14
|
* Two rules hold across every channel:
|
|
13
15
|
*
|
|
@@ -27,6 +29,7 @@
|
|
|
27
29
|
* frame, so its callback is never invoked. That is a silent no-op, never an
|
|
28
30
|
* error.
|
|
29
31
|
*/
|
|
32
|
+
import type { Candlestick } from "../market";
|
|
30
33
|
import type { OrderSide, OrderType, SelfTradePreventionMode, TimeInForce, TradingMode } from "../trading";
|
|
31
34
|
/**
|
|
32
35
|
* Receives one channel's complete subscribe-time state.
|
|
@@ -45,6 +48,21 @@ import type { OrderSide, OrderType, SelfTradePreventionMode, TimeInForce, Tradin
|
|
|
45
48
|
* see `MonacoWebSocket` for the full rule.
|
|
46
49
|
*/
|
|
47
50
|
export type SnapshotHandler<T> = (items: T[]) => void;
|
|
51
|
+
/**
|
|
52
|
+
* One candle in an `ohlcv` channel snapshot: the live frame's candlestick
|
|
53
|
+
* without `s`.
|
|
54
|
+
*
|
|
55
|
+
* The channel fixes the pair, interval and price series, so a row carries no
|
|
56
|
+
* envelope and no symbol; `i` is the subscription's interval. `T` is the
|
|
57
|
+
* period start and `t` the period end (start plus the interval), as on a live
|
|
58
|
+
* candle.
|
|
59
|
+
*
|
|
60
|
+
* The snapshot is the series' newest candles, oldest first: recent history,
|
|
61
|
+
* not a gap-free replay. The newest candle can be partial or missing, so a
|
|
62
|
+
* consumer upserts live candles by `T` — a live candle replaces the snapshot
|
|
63
|
+
* candle with the same `T`, or appends a newer one.
|
|
64
|
+
*/
|
|
65
|
+
export type OHLCVSnapshotCandle = Omit<Candlestick, "s">;
|
|
48
66
|
/**
|
|
49
67
|
* One resting order in an `orders` channel snapshot.
|
|
50
68
|
*
|
|
@@ -5,9 +5,11 @@
|
|
|
5
5
|
* `Subscribed` ack and before that subscription's first live diff. Its `data`
|
|
6
6
|
* is the channel's COMPLETE current state as a flat array — a consumer that
|
|
7
7
|
* applies it wholesale needs no REST baseline read for that channel. `trades`
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* or miss one executed just before the subscribe — dedupe on
|
|
8
|
+
* and `ohlcv` are the exceptions: their arrays are recent history rather than
|
|
9
|
+
* complete state. `trades` is the pair's newest trades, which can overlap the
|
|
10
|
+
* first live trades or miss one executed just before the subscribe — dedupe on
|
|
11
|
+
* `tradeId`. `ohlcv` is the subscribed series' newest candles, whose newest
|
|
12
|
+
* candle can be partial or missing — upsert live candles by `T`.
|
|
11
13
|
*
|
|
12
14
|
* Two rules hold across every channel:
|
|
13
15
|
*
|
package/dist/wire/schema.d.ts
CHANGED
|
@@ -2895,7 +2895,7 @@ export interface paths {
|
|
|
2895
2895
|
};
|
|
2896
2896
|
/**
|
|
2897
2897
|
* Get your rewards balance
|
|
2898
|
-
* @description Read accrued
|
|
2898
|
+
* @description Read accrued TraderCodes rewards balance.
|
|
2899
2899
|
*
|
|
2900
2900
|
* Return the caller's current rewards-bucket balances across all reward tokens.
|
|
2901
2901
|
* Rewards accumulate here as referred users trade; call TransferRewards to move
|
|
@@ -2924,7 +2924,7 @@ export interface paths {
|
|
|
2924
2924
|
* Transfer rewards into a trading balance
|
|
2925
2925
|
* @description Transfer earned rewards into a trading balance.
|
|
2926
2926
|
*
|
|
2927
|
-
* Move spendable
|
|
2927
|
+
* Move spendable TraderCodes reward balance from your rewards bucket into a
|
|
2928
2928
|
* trading balance under the authenticated application, making it tradeable
|
|
2929
2929
|
* immediately. Ledger-only (one shared vault + one backend ledger) — no
|
|
2930
2930
|
* on-chain transaction and no gas. Fails with 402 when the rewards balance is
|
|
@@ -3935,7 +3935,7 @@ export interface components {
|
|
|
3935
3935
|
*/
|
|
3936
3936
|
strategyKey?: string | null;
|
|
3937
3937
|
/**
|
|
3938
|
-
* @description Risk bucket mode for margin orders. Defaults to ISOLATED. Values: ISOLATED, CROSS. On an isolated-only market (TradingPairData.isolated_only) a CROSS order that is not reduce-only is rejected with HTTP 400 / gRPC INVALID_ARGUMENT carrying the structured error code CROSS_MARGIN_NOT_ALLOWED.
|
|
3938
|
+
* @description Risk bucket mode for margin orders. Defaults to ISOLATED. Values: ISOLATED, CROSS. On an isolated-only market (TradingPairData.isolated_only) a CROSS order that is not reduce-only is rejected with HTTP 400 / gRPC INVALID_ARGUMENT carrying the structured error code CROSS_MARGIN_NOT_ALLOWED. One margin mode per market and margin account: while the account holds the pair in its other risk bucket (an open position, or a resting order that is not reduce-only), an order that is not reduce-only is rejected with HTTP 400 / gRPC INVALID_ARGUMENT carrying the structured error code MARGIN_MODE_CONFLICT; reduce-only orders always pass, so a pair already held in both modes can be reduced on either side until one closes.
|
|
3939
3939
|
* @example CROSS
|
|
3940
3940
|
* @enum {string|null}
|
|
3941
3941
|
*/
|
|
@@ -4736,7 +4736,7 @@ export interface components {
|
|
|
4736
4736
|
*/
|
|
4737
4737
|
strategyKey?: string | null;
|
|
4738
4738
|
/**
|
|
4739
|
-
* @description Risk bucket mode for margin orders. Defaults to ISOLATED. Values: ISOLATED, CROSS. On an isolated-only market (TradingPairData.isolated_only) a CROSS order that is not reduce-only is rejected with HTTP 400 / gRPC INVALID_ARGUMENT carrying the structured error code CROSS_MARGIN_NOT_ALLOWED.
|
|
4739
|
+
* @description Risk bucket mode for margin orders. Defaults to ISOLATED. Values: ISOLATED, CROSS. On an isolated-only market (TradingPairData.isolated_only) a CROSS order that is not reduce-only is rejected with HTTP 400 / gRPC INVALID_ARGUMENT carrying the structured error code CROSS_MARGIN_NOT_ALLOWED. One margin mode per market and margin account: while the account holds the pair in its other risk bucket (an open position, or a resting order that is not reduce-only), an order that is not reduce-only is rejected with HTTP 400 / gRPC INVALID_ARGUMENT carrying the structured error code MARGIN_MODE_CONFLICT; reduce-only orders always pass, so a pair already held in both modes can be reduced on either side until one closes.
|
|
4740
4740
|
* @example CROSS
|
|
4741
4741
|
* @enum {string|null}
|
|
4742
4742
|
*/
|
|
@@ -4902,7 +4902,7 @@ export interface components {
|
|
|
4902
4902
|
*/
|
|
4903
4903
|
riskBucketId?: string | null;
|
|
4904
4904
|
/**
|
|
4905
|
-
* @description Risk bucket mode for margin TWAP orders. Defaults to ISOLATED. Values: ISOLATED, CROSS. On an isolated-only market (TradingPairData.isolated_only) a CROSS order that is not reduce-only is rejected with HTTP 400 / gRPC INVALID_ARGUMENT carrying the structured error code CROSS_MARGIN_NOT_ALLOWED.
|
|
4905
|
+
* @description Risk bucket mode for margin TWAP orders. Defaults to ISOLATED. Values: ISOLATED, CROSS. On an isolated-only market (TradingPairData.isolated_only) a CROSS order that is not reduce-only is rejected with HTTP 400 / gRPC INVALID_ARGUMENT carrying the structured error code CROSS_MARGIN_NOT_ALLOWED. One margin mode per market and margin account: while the account holds the pair in its other risk bucket (an open position, or a resting order that is not reduce-only), an order that is not reduce-only is rejected with HTTP 400 / gRPC INVALID_ARGUMENT carrying the structured error code MARGIN_MODE_CONFLICT; reduce-only orders always pass, so a pair already held in both modes can be reduced on either side until one closes.
|
|
4906
4906
|
* @example CROSS
|
|
4907
4907
|
* @enum {string|null}
|
|
4908
4908
|
*/
|
|
@@ -6669,9 +6669,14 @@ export interface components {
|
|
|
6669
6669
|
*/
|
|
6670
6670
|
exitPrice?: string | null;
|
|
6671
6671
|
/**
|
|
6672
|
-
* @description Lifetime funding paid (signed; negative means
|
|
6673
|
-
*
|
|
6674
|
-
*
|
|
6672
|
+
* @description Lifetime funding paid since the position opened (signed; negative means
|
|
6673
|
+
* received). On a terminal row, summed over the position's reducing
|
|
6674
|
+
* executions. On an OPEN or LIQUIDATING row, the funding accrued on the size
|
|
6675
|
+
* still open plus the funding its partial closes settled, so the last open
|
|
6676
|
+
* value equals the terminal value. Absent when the position's reducing
|
|
6677
|
+
* executions do not account for its whole lifetime, and on an OPEN or
|
|
6678
|
+
* LIQUIDATING row whenever lifetime_totals_status is not COMPLETE; never an
|
|
6679
|
+
* understated partial.
|
|
6675
6680
|
*/
|
|
6676
6681
|
fundingPaid?: string | null;
|
|
6677
6682
|
/**
|
|
@@ -8642,9 +8647,14 @@ export interface components {
|
|
|
8642
8647
|
*/
|
|
8643
8648
|
exitPrice?: string | null;
|
|
8644
8649
|
/**
|
|
8645
|
-
* @description Lifetime funding paid (signed; negative means
|
|
8646
|
-
*
|
|
8647
|
-
*
|
|
8650
|
+
* @description Lifetime funding paid since the position opened (signed; negative means
|
|
8651
|
+
* received). On a terminal row, summed over the position's reducing
|
|
8652
|
+
* executions. On an OPEN or LIQUIDATING row, the funding accrued on the size
|
|
8653
|
+
* still open plus the funding its partial closes settled, so the last open
|
|
8654
|
+
* value equals the terminal value. Absent when the position's reducing
|
|
8655
|
+
* executions do not account for its whole lifetime, and on an OPEN or
|
|
8656
|
+
* LIQUIDATING row whenever lifetime_totals_status is not COMPLETE; never an
|
|
8657
|
+
* understated partial.
|
|
8648
8658
|
*/
|
|
8649
8659
|
fundingPaid?: string | null;
|
|
8650
8660
|
/**
|
|
@@ -8722,8 +8732,8 @@ export interface components {
|
|
|
8722
8732
|
* checkpoint is seeded, PENDING arises only when the position row changed
|
|
8723
8733
|
* between the row read and the totals read. OPEN and LIQUIDATING positions
|
|
8724
8734
|
* are checked against realized PnL too, and are INCOMPLETE without cum_fees
|
|
8725
|
-
* when their reductions do not account for it. Set on every
|
|
8726
|
-
* gRPC reads; WebSocket position frames do not carry it.
|
|
8735
|
+
* or funding_paid when their reductions do not account for it. Set on every
|
|
8736
|
+
* row of the REST and gRPC reads; WebSocket position frames do not carry it.
|
|
8727
8737
|
* @enum {string|null}
|
|
8728
8738
|
*/
|
|
8729
8739
|
lifetimeTotalsStatus?: "LIFETIME_TOTALS_STATUS_UNSPECIFIED" | "LIFETIME_TOTALS_STATUS_COMPLETE" | "LIFETIME_TOTALS_STATUS_PENDING" | "LIFETIME_TOTALS_STATUS_INCOMPLETE" | null;
|
|
@@ -9036,7 +9046,7 @@ export interface components {
|
|
|
9036
9046
|
source?: string | null;
|
|
9037
9047
|
/**
|
|
9038
9048
|
* Format: int32
|
|
9039
|
-
* @description Referral level the caller earns from this source at: 1 (direct), 2, and so on (at most 10). Rows at a level deeper than
|
|
9049
|
+
* @description Referral level the caller earns from this source at: 1 (direct), 2, and so on (at most 10). Rows at a level deeper than TraderCodes rewards today are earlier earnings, kept as history.
|
|
9040
9050
|
* @example 1
|
|
9041
9051
|
*/
|
|
9042
9052
|
level?: number | null;
|
|
@@ -9065,7 +9075,7 @@ export interface components {
|
|
|
9065
9075
|
* `GetRewardsBalance` reports the live bucket, which `TransferRewards` draws
|
|
9066
9076
|
* down, so the two diverge after any transfer. Read the rewards balance for
|
|
9067
9077
|
* current availability. Denominated in the single reward token's atomic units
|
|
9068
|
-
* (Monaco pays
|
|
9078
|
+
* (Monaco pays TraderCodes rewards in one token — the quote asset); if a deployment
|
|
9069
9079
|
* ever pays in more than one reward token, atomic units across tokens are not
|
|
9070
9080
|
* additive, so read the per-token `earnings_by_source` rows for a correct
|
|
9071
9081
|
* breakdown.
|
|
@@ -9098,7 +9108,7 @@ export interface components {
|
|
|
9098
9108
|
* @example 100000
|
|
9099
9109
|
*/
|
|
9100
9110
|
level3Earned?: string | null;
|
|
9101
|
-
/** @description All-time credited earnings per referral level, ascending by level, one entry per level the caller has earned at (levels with nothing earned are omitted). Covers every level, including levels deeper than
|
|
9111
|
+
/** @description All-time credited earnings per referral level, ascending by level, one entry per level the caller has earned at (levels with nothing earned are omitted). Covers every level, including levels deeper than TraderCodes rewards today. */
|
|
9102
9112
|
byLevel?: components["schemas"]["LevelEarnings"][] | null;
|
|
9103
9113
|
};
|
|
9104
9114
|
/** @description A single reward the caller has earned, one row per referred trade × level. */
|
|
@@ -9802,6 +9812,11 @@ export interface components {
|
|
|
9802
9812
|
* @example 100.25
|
|
9803
9813
|
*/
|
|
9804
9814
|
referencePrice?: string | null;
|
|
9815
|
+
/**
|
|
9816
|
+
* @description Structured code of the refusal behind rejectReason, the same code placing the order would return in the error envelope (e.g. MARGIN_MODE_CONFLICT when the margin account holds the pair in its other margin mode; INVALID_ORDER for the catch-all). Present for client-class refusals; absent on an accepted preview, and absent when the preview failed on a server-side fault (rejectReason is then a generic retry message).
|
|
9817
|
+
* @example MARGIN_MODE_CONFLICT
|
|
9818
|
+
*/
|
|
9819
|
+
rejectCode?: string | null;
|
|
9805
9820
|
};
|
|
9806
9821
|
SimulateParentMarginOrderRiskRequest: {
|
|
9807
9822
|
/** Format: uuid */
|
|
@@ -11007,7 +11022,7 @@ export interface components {
|
|
|
11007
11022
|
*/
|
|
11008
11023
|
isNewUser?: boolean | null;
|
|
11009
11024
|
/**
|
|
11010
|
-
* @description True when a
|
|
11025
|
+
* @description True when a TraderCodes referral relationship was recorded on this verify: a valid, non-self TraderCode presented on the wallet's first sign-in to THIS application resolved to a known referrer. Scoped like `is_new_user` (per `(wallet, application)`), so a wallet already registered on another application can still see this on its first sign-in to a new one. False for a returning user of this application, an absent or unknown code, or a self-referral. Confirms the referral landed for the signup success screen.
|
|
11011
11026
|
* @example true
|
|
11012
11027
|
*/
|
|
11013
11028
|
referralApplied?: boolean | null;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@0xmonaco/types",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.81",
|
|
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.81",
|
|
20
20
|
"zod": "^4.1.12"
|
|
21
21
|
},
|
|
22
22
|
"peerDependencies": {
|