@0xmonaco/types 1.0.98 → 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.
- package/dist/fees/index.d.ts +23 -3
- package/dist/fees/index.js +1 -1
- package/dist/fees/responses.d.ts +28 -0
- package/dist/fees/responses.js +16 -0
- package/dist/margin-accounts/index.d.ts +6 -3
- package/dist/trading/orders.d.ts +32 -6
- package/dist/websocket/events/balance-events.d.ts +16 -20
- package/dist/websocket/events/orders-events.d.ts +22 -0
- package/dist/websocket/snapshots.d.ts +18 -2
- package/dist/wire/operations.d.ts +1 -1
- package/dist/wire/operations.js +1 -0
- package/dist/wire/schema.d.ts +90 -3
- package/package.json +2 -2
package/dist/fees/index.d.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Types for fees operations including fee simulation.
|
|
5
5
|
*/
|
|
6
6
|
import type { BaseAPI } from "../api/index";
|
|
7
|
-
import type { GetMyFeeTierParams, GetMyFeeTierResponse, SimulateFeeParams, SimulateFeeResponse } from "./responses";
|
|
7
|
+
import type { GetFeeScheduleResponse, GetMyFeeTierParams, GetMyFeeTierResponse, SimulateFeeParams, SimulateFeeResponse } from "./responses";
|
|
8
8
|
/**
|
|
9
9
|
* Fees API interface.
|
|
10
10
|
* Provides methods for simulating and calculating trading fees.
|
|
@@ -59,6 +59,26 @@ export interface FeesAPI extends BaseAPI {
|
|
|
59
59
|
* ```
|
|
60
60
|
*/
|
|
61
61
|
getMyFeeTier(params: GetMyFeeTierParams): Promise<GetMyFeeTierResponse>;
|
|
62
|
+
/**
|
|
63
|
+
* Get a trading pair's fee tier schedule. Public: needs no authentication.
|
|
64
|
+
*
|
|
65
|
+
* Returns the pair's Monaco fee schedule ordered by tier level: each row's
|
|
66
|
+
* weighted 14-day volume threshold and its maker/taker fee in basis points
|
|
67
|
+
* (a negative maker fee is a rebate). Your own tier and rate come from
|
|
68
|
+
* {@link FeesAPI.getMyFeeTier}.
|
|
69
|
+
*
|
|
70
|
+
* @param tradingPairId - Trading pair whose fee schedule to return
|
|
71
|
+
* @returns Promise resolving to the pair's fee tier schedule
|
|
72
|
+
*
|
|
73
|
+
* @example
|
|
74
|
+
* ```typescript
|
|
75
|
+
* const { feeSchedule } = await feesAPI.getFeeSchedule("123e4567-e89b-12d3-a456-426614174000");
|
|
76
|
+
* for (const row of feeSchedule) {
|
|
77
|
+
* console.log(`Tier ${row.tierLevel}: maker ${row.makerFeeBps} bps, taker ${row.takerFeeBps} bps`);
|
|
78
|
+
* }
|
|
79
|
+
* ```
|
|
80
|
+
*/
|
|
81
|
+
getFeeSchedule(tradingPairId: string): Promise<GetFeeScheduleResponse>;
|
|
62
82
|
}
|
|
63
|
-
export type { FeeTierScheduleRow, GetMyFeeTierParams, GetMyFeeTierResponse, SimulateFeeParams, SimulateFeeResponse, } from "./responses";
|
|
64
|
-
export { FeeTierScheduleRowSchema, GetMyFeeTierParamsSchema, GetMyFeeTierResponseSchema, SimulateFeeParamsSchema, SimulateFeeResponseSchema, } from "./responses";
|
|
83
|
+
export type { FeeTierScheduleRow, GetFeeScheduleParams, GetFeeScheduleResponse, GetMyFeeTierParams, GetMyFeeTierResponse, SimulateFeeParams, SimulateFeeResponse, } from "./responses";
|
|
84
|
+
export { FeeTierScheduleRowSchema, GetFeeScheduleParamsSchema, GetFeeScheduleResponseSchema, GetMyFeeTierParamsSchema, GetMyFeeTierResponseSchema, SimulateFeeParamsSchema, SimulateFeeResponseSchema, } from "./responses";
|
package/dist/fees/index.js
CHANGED
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Types for fees operations including fee simulation.
|
|
5
5
|
*/
|
|
6
|
-
export { FeeTierScheduleRowSchema, GetMyFeeTierParamsSchema, GetMyFeeTierResponseSchema, SimulateFeeParamsSchema, SimulateFeeResponseSchema, } from "./responses";
|
|
6
|
+
export { FeeTierScheduleRowSchema, GetFeeScheduleParamsSchema, GetFeeScheduleResponseSchema, GetMyFeeTierParamsSchema, GetMyFeeTierResponseSchema, SimulateFeeParamsSchema, SimulateFeeResponseSchema, } from "./responses";
|
package/dist/fees/responses.d.ts
CHANGED
|
@@ -86,6 +86,24 @@ export declare const GetMyFeeTierResponseSchema: z.ZodObject<{
|
|
|
86
86
|
takerFeeBps: z.ZodString;
|
|
87
87
|
}, z.core.$strip>>;
|
|
88
88
|
}, z.core.$strip>;
|
|
89
|
+
/**
|
|
90
|
+
* Zod schema for the parameters of a public fee schedule lookup
|
|
91
|
+
*/
|
|
92
|
+
export declare const GetFeeScheduleParamsSchema: z.ZodObject<{
|
|
93
|
+
tradingPairId: z.ZodString;
|
|
94
|
+
}, z.core.$strip>;
|
|
95
|
+
/**
|
|
96
|
+
* Zod schema for the public fee schedule response
|
|
97
|
+
*/
|
|
98
|
+
export declare const GetFeeScheduleResponseSchema: z.ZodObject<{
|
|
99
|
+
tradingPairId: z.ZodString;
|
|
100
|
+
feeSchedule: z.ZodArray<z.ZodObject<{
|
|
101
|
+
tierLevel: z.ZodNumber;
|
|
102
|
+
minVolumeThreshold: z.ZodString;
|
|
103
|
+
makerFeeBps: z.ZodString;
|
|
104
|
+
takerFeeBps: z.ZodString;
|
|
105
|
+
}, z.core.$strip>>;
|
|
106
|
+
}, z.core.$strip>;
|
|
89
107
|
/**
|
|
90
108
|
* Parameters for a "my fee tier" lookup
|
|
91
109
|
* @remarks Type is inferred from GetMyFeeTierParamsSchema
|
|
@@ -101,3 +119,13 @@ export type FeeTierScheduleRow = z.infer<typeof FeeTierScheduleRowSchema>;
|
|
|
101
119
|
* @remarks Type is inferred from GetMyFeeTierResponseSchema
|
|
102
120
|
*/
|
|
103
121
|
export type GetMyFeeTierResponse = z.infer<typeof GetMyFeeTierResponseSchema>;
|
|
122
|
+
/**
|
|
123
|
+
* Parameters for a public fee schedule lookup
|
|
124
|
+
* @remarks Type is inferred from GetFeeScheduleParamsSchema
|
|
125
|
+
*/
|
|
126
|
+
export type GetFeeScheduleParams = z.infer<typeof GetFeeScheduleParamsSchema>;
|
|
127
|
+
/**
|
|
128
|
+
* A trading pair's public fee tier schedule
|
|
129
|
+
* @remarks Type is inferred from GetFeeScheduleResponseSchema
|
|
130
|
+
*/
|
|
131
|
+
export type GetFeeScheduleResponse = z.infer<typeof GetFeeScheduleResponseSchema>;
|
package/dist/fees/responses.js
CHANGED
|
@@ -133,3 +133,19 @@ export const GetMyFeeTierResponseSchema = z.object({
|
|
|
133
133
|
/** Six-row fee schedule for the requested pair, ascending by tier */
|
|
134
134
|
feeSchedule: z.array(FeeTierScheduleRowSchema),
|
|
135
135
|
});
|
|
136
|
+
/**
|
|
137
|
+
* Zod schema for the parameters of a public fee schedule lookup
|
|
138
|
+
*/
|
|
139
|
+
export const GetFeeScheduleParamsSchema = z.object({
|
|
140
|
+
/** Trading pair ID whose fee tier schedule to return */
|
|
141
|
+
tradingPairId: z.string().trim().min(1, "Trading pair ID is required and cannot be empty"),
|
|
142
|
+
});
|
|
143
|
+
/**
|
|
144
|
+
* Zod schema for the public fee schedule response
|
|
145
|
+
*/
|
|
146
|
+
export const GetFeeScheduleResponseSchema = z.object({
|
|
147
|
+
/** Trading pair the schedule belongs to (UUID) */
|
|
148
|
+
tradingPairId: z.string(),
|
|
149
|
+
/** The pair's fee tier schedule, ascending by tier level */
|
|
150
|
+
feeSchedule: z.array(FeeTierScheduleRowSchema),
|
|
151
|
+
});
|
|
@@ -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;
|
|
@@ -137,6 +137,33 @@ export interface Order {
|
|
|
137
137
|
* SDK version does not know still reaches you. Wire: `origin`.
|
|
138
138
|
*/
|
|
139
139
|
origin?: OrderOrigin | (string & {});
|
|
140
|
+
/**
|
|
141
|
+
* Monaco taker fee rate fixed when this order was placed (re-fixed on
|
|
142
|
+
* replace), in basis points, as a decimal string such as `"4.5"`. A rate,
|
|
143
|
+
* not an amount: the amounts charged are `monacoTakerFee` and
|
|
144
|
+
* `monacoMakerRebate`.
|
|
145
|
+
*
|
|
146
|
+
* The fee actually charged on a fill can be lower for a maker rebate: a
|
|
147
|
+
* rebate never exceeds the taker fee of the same fill.
|
|
148
|
+
*
|
|
149
|
+
* Absent (never `"0"`) for orders placed before rates were stored. The same
|
|
150
|
+
* value the order WebSocket events and `orders` snapshot rows carry.
|
|
151
|
+
* Wire: `placementTakerFeeBps`.
|
|
152
|
+
*/
|
|
153
|
+
placementTakerFeeBps?: string;
|
|
154
|
+
/**
|
|
155
|
+
* Monaco maker fee rate fixed when this order was placed (re-fixed on
|
|
156
|
+
* replace), in basis points, as a decimal string such as `"-0.1"`. Negative
|
|
157
|
+
* means rebate. A rate, not an amount: the amount is `monacoMakerRebate`.
|
|
158
|
+
*
|
|
159
|
+
* The rebate actually paid on a fill can be smaller: a rebate never exceeds
|
|
160
|
+
* the taker fee of the same fill.
|
|
161
|
+
*
|
|
162
|
+
* Absent (never `"0"`) for orders placed before rates were stored. The same
|
|
163
|
+
* value the order WebSocket events and `orders` snapshot rows carry.
|
|
164
|
+
* Wire: `placementMakerFeeBps`.
|
|
165
|
+
*/
|
|
166
|
+
placementMakerFeeBps?: string;
|
|
140
167
|
/**
|
|
141
168
|
* Opaque, compare-only revision counter for this order's state: a strictly
|
|
142
169
|
* higher value is strictly newer state for that order, and equal values
|
|
@@ -242,12 +269,11 @@ export type TradingMode = "SPOT" | "MARGIN";
|
|
|
242
269
|
* - GTC: Good Till Cancel - remains active until filled or canceled
|
|
243
270
|
* - IOC: Immediate or Cancel - execute immediately and cancel unfilled portion
|
|
244
271
|
* - FOK: Fill or Kill - execute completely or cancel entirely
|
|
245
|
-
*
|
|
246
|
-
*
|
|
247
|
-
*
|
|
248
|
-
* `GTC` together with `expirationDate`.
|
|
272
|
+
*
|
|
273
|
+
* For an order that expires at a set time, use `GTC` together with
|
|
274
|
+
* `expirationDate`.
|
|
249
275
|
*/
|
|
250
|
-
export type TimeInForce = "GTC" | "IOC" | "FOK"
|
|
276
|
+
export type TimeInForce = "GTC" | "IOC" | "FOK";
|
|
251
277
|
/**
|
|
252
278
|
* Per-order self-trade-prevention override: how the engine resolves the order
|
|
253
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
|
|
@@ -201,6 +201,28 @@ export interface CommonOrderEventData {
|
|
|
201
201
|
* servers predating the field. Wire: `position_id`.
|
|
202
202
|
*/
|
|
203
203
|
positionId?: string;
|
|
204
|
+
/**
|
|
205
|
+
* Monaco taker fee rate fixed when this order was placed (re-fixed on
|
|
206
|
+
* replace), in basis points, as a decimal string such as `"4.5"`. The same
|
|
207
|
+
* value REST `getOrder` returns as `placementTakerFeeBps`. The fee actually
|
|
208
|
+
* charged on a fill can be lower for a maker rebate: a rebate never exceeds
|
|
209
|
+
* the taker fee of the same fill. Carried on every order event; a maker fill
|
|
210
|
+
* reports the MAKER order's own rate. Omitted, never `"0"`, for an order
|
|
211
|
+
* placed before rates were stored and by servers predating the field.
|
|
212
|
+
* Wire: `placement_taker_fee_bps`.
|
|
213
|
+
*/
|
|
214
|
+
placementTakerFeeBps?: string;
|
|
215
|
+
/**
|
|
216
|
+
* Monaco maker fee rate fixed when this order was placed (re-fixed on
|
|
217
|
+
* replace), in basis points, as a decimal string such as `"-0.1"`. Negative
|
|
218
|
+
* means rebate. The same value REST `getOrder` returns as
|
|
219
|
+
* `placementMakerFeeBps`. The rebate actually paid on a fill can be smaller:
|
|
220
|
+
* a rebate never exceeds the taker fee of the same fill. Carried on every
|
|
221
|
+
* order event; a maker fill reports the MAKER order's own rate. Omitted,
|
|
222
|
+
* never `"0"`, for an order placed before rates were stored and by servers
|
|
223
|
+
* predating the field. Wire: `placement_maker_fee_bps`.
|
|
224
|
+
*/
|
|
225
|
+
placementMakerFeeBps?: string;
|
|
204
226
|
}
|
|
205
227
|
/**
|
|
206
228
|
* What placed an order, as carried on order events' `origin` (0XM-2848).
|
|
@@ -86,8 +86,9 @@ export type OHLCVSnapshotCandle = Omit<Candlestick, "s">;
|
|
|
86
86
|
* `Option` serialized WITHOUT `skip_serializing_if`, so the key is always
|
|
87
87
|
* present and carries `null` when unset — hence `| null` rather than `?`.
|
|
88
88
|
* `clientOrderId`, `selfTradePreventionMode`, `parentOrderId`, `postOnly`,
|
|
89
|
-
* `expirationDate`, `triggerPrice`, `positionSide`, `version
|
|
90
|
-
*
|
|
89
|
+
* `expirationDate`, `triggerPrice`, `positionSide`, `version`, `origin`,
|
|
90
|
+
* `placementTakerFeeBps` and `placementMakerFeeBps` are the fields the server
|
|
91
|
+
* omits outright, so they are the `?`s.
|
|
91
92
|
*
|
|
92
93
|
* The value unions are widened (`Union | (string & {})`) for the same reason
|
|
93
94
|
* the order event's are: the parser hands an unrecognized value through rather
|
|
@@ -207,4 +208,19 @@ export interface OrderSnapshotItem {
|
|
|
207
208
|
* Wire: `origin`.
|
|
208
209
|
*/
|
|
209
210
|
origin?: OrderOrigin | (string & {});
|
|
211
|
+
/**
|
|
212
|
+
* Monaco taker fee rate fixed when this order was placed (re-fixed on
|
|
213
|
+
* replace), in basis points (decimal string), as REST `getOrder` and the
|
|
214
|
+
* live order events report it. Omitted — not `null`, never `"0"` — for an
|
|
215
|
+
* order placed before rates were stored. Wire: `placement_taker_fee_bps`.
|
|
216
|
+
*/
|
|
217
|
+
placementTakerFeeBps?: string;
|
|
218
|
+
/**
|
|
219
|
+
* Monaco maker fee rate fixed when this order was placed (re-fixed on
|
|
220
|
+
* replace), in basis points (decimal string); negative means rebate. As
|
|
221
|
+
* REST `getOrder` and the live order events report it. Omitted — not
|
|
222
|
+
* `null`, never `"0"` — for an order placed before rates were stored.
|
|
223
|
+
* Wire: `placement_maker_fee_bps`.
|
|
224
|
+
*/
|
|
225
|
+
placementMakerFeeBps?: string;
|
|
210
226
|
}
|
|
@@ -10,6 +10,6 @@
|
|
|
10
10
|
* hand-written SDK surface. CI regenerates it and fails on a diff, identical to
|
|
11
11
|
* the `schema.ts` wire-types tripwire (MON-1476), so it can never go stale.
|
|
12
12
|
*/
|
|
13
|
-
export declare const OPERATION_IDS: readonly ["add_follow_position_margin", "attach_position_tp_sl", "batch_cancel_all", "batch_cancel_all_by_pair", "batch_cancel_orders", "batch_close_all_positions", "batch_create_orders", "batch_replace_orders", "cancel_conditional_order", "cancel_order", "cancel_twap_order", "check_trader_code_availability", "claim_buildercode_rewards", "claim_managed_market_lease", "clear_trader_code", "close_all_copy_positions", "close_follow_positions", "close_position", "close_sub_account", "create_challenge", "create_delegated_session", "create_order", "create_sub_account", "create_sub_account_limit", "create_twap_order", "delete_sub_account_limit", "get_application_config", "get_application_stats", "get_available_collateral", "get_buildercode_payout_summary", "get_buildercode_rewards_balance", "get_buildercodes_config", "get_candles", "get_conditional_order", "get_faucet_info", "get_follow", "get_funding_state", "get_index_price", "get_lead_trader", "get_liquidation_metrics", "get_margin_account_movements", "get_margin_account_pnl", "get_margin_account_summary", "get_mark_price", "get_market_metadata", "get_market_stats", "get_my_fee_tier", "get_my_lead_trader", "get_my_referral_downline", "get_my_referral_position", "get_my_referral_tree", "get_my_trader_code", "get_open_interest", "get_order_by_id", "get_orderbook_snapshot", "get_orders", "get_parent_margin_account_movements", "get_parent_margin_account_summary", "get_perp_market_config", "get_perp_market_summary", "get_portfolio_assets", "get_portfolio_chart", "get_portfolio_margin", "get_portfolio_performance", "get_portfolio_realized_pnl", "get_portfolio_stats", "get_portfolio_summary", "get_position", "get_position_pnl_history", "get_position_risk", "get_pulse", "get_region_status", "get_rewards_balance", "get_screener", "get_self_trade_prevention_default", "get_sub_account_limits", "get_sweeper_chains", "get_sweeper_deposit_status", "get_trade_by_id", "get_trade_flow", "get_trader_code_info", "get_trader_metrics", "get_trades", "get_trading_pair_by_id", "get_twap_order", "get_twap_order_tca", "get_user_balance_by_asset", "get_user_balances", "get_user_movements", "get_user_profile", "get_user_trades", "get_withdrawal", "health_check", "initiate_withdrawal", "list_all_funding_history", "list_application_balances", "list_application_movements", "list_application_orders", "list_application_users", "list_builder_fee_changes", "list_buildercode_payouts", "list_conditional_orders", "list_delegated_agent_owners", "list_delegated_agents", "list_follow_leader_positions", "list_funding_history", "list_funding_payments", "list_invite_codes", "list_lead_trader_closed_trades", "list_lead_trader_open_positions", "list_lead_traders", "list_liquidation_events", "list_managed_market_assignments", "list_margin_accounts", "list_my_followers", "list_my_follows", "list_pending_withdrawals", "list_position_history", "list_positions", "list_sub_accounts_with_balances", "list_sweeper_deposits", "list_trading_pairs", "list_twap_order_slices", "list_twap_orders", "mint_tokens", "preview_follow", "refresh_managed_market_quotes", "refresh_session", "register_deposit_address", "replace_order", "request_invite_codes", "revoke_delegated_agent", "revoke_session", "set_builder_fee", "set_self_trade_prevention_default", "set_trader_code", "simulate_fees", "simulate_order_risk", "simulate_parent_margin_order_risk", "simulate_risk_bucket_order_risk", "stop_follow", "transfer_collateral", "transfer_collateral_from_margin_account", "transfer_collateral_from_parent_margin_account", "transfer_collateral_from_sub_account", "transfer_collateral_to_margin_account", "transfer_collateral_to_parent_margin_account", "transfer_collateral_to_risk_bucket", "transfer_collateral_to_sub_account", "transfer_rewards", "update_sub_account_limit", "upsert_delegated_agent", "upsert_follow", "upsert_lead_trader", "verify_signature"];
|
|
13
|
+
export declare const OPERATION_IDS: readonly ["add_follow_position_margin", "attach_position_tp_sl", "batch_cancel_all", "batch_cancel_all_by_pair", "batch_cancel_orders", "batch_close_all_positions", "batch_create_orders", "batch_replace_orders", "cancel_conditional_order", "cancel_order", "cancel_twap_order", "check_trader_code_availability", "claim_buildercode_rewards", "claim_managed_market_lease", "clear_trader_code", "close_all_copy_positions", "close_follow_positions", "close_position", "close_sub_account", "create_challenge", "create_delegated_session", "create_order", "create_sub_account", "create_sub_account_limit", "create_twap_order", "delete_sub_account_limit", "get_application_config", "get_application_stats", "get_available_collateral", "get_buildercode_payout_summary", "get_buildercode_rewards_balance", "get_buildercodes_config", "get_candles", "get_conditional_order", "get_faucet_info", "get_fee_schedule", "get_follow", "get_funding_state", "get_index_price", "get_lead_trader", "get_liquidation_metrics", "get_margin_account_movements", "get_margin_account_pnl", "get_margin_account_summary", "get_mark_price", "get_market_metadata", "get_market_stats", "get_my_fee_tier", "get_my_lead_trader", "get_my_referral_downline", "get_my_referral_position", "get_my_referral_tree", "get_my_trader_code", "get_open_interest", "get_order_by_id", "get_orderbook_snapshot", "get_orders", "get_parent_margin_account_movements", "get_parent_margin_account_summary", "get_perp_market_config", "get_perp_market_summary", "get_portfolio_assets", "get_portfolio_chart", "get_portfolio_margin", "get_portfolio_performance", "get_portfolio_realized_pnl", "get_portfolio_stats", "get_portfolio_summary", "get_position", "get_position_pnl_history", "get_position_risk", "get_pulse", "get_region_status", "get_rewards_balance", "get_screener", "get_self_trade_prevention_default", "get_sub_account_limits", "get_sweeper_chains", "get_sweeper_deposit_status", "get_trade_by_id", "get_trade_flow", "get_trader_code_info", "get_trader_metrics", "get_trades", "get_trading_pair_by_id", "get_twap_order", "get_twap_order_tca", "get_user_balance_by_asset", "get_user_balances", "get_user_movements", "get_user_profile", "get_user_trades", "get_withdrawal", "health_check", "initiate_withdrawal", "list_all_funding_history", "list_application_balances", "list_application_movements", "list_application_orders", "list_application_users", "list_builder_fee_changes", "list_buildercode_payouts", "list_conditional_orders", "list_delegated_agent_owners", "list_delegated_agents", "list_follow_leader_positions", "list_funding_history", "list_funding_payments", "list_invite_codes", "list_lead_trader_closed_trades", "list_lead_trader_open_positions", "list_lead_traders", "list_liquidation_events", "list_managed_market_assignments", "list_margin_accounts", "list_my_followers", "list_my_follows", "list_pending_withdrawals", "list_position_history", "list_positions", "list_sub_accounts_with_balances", "list_sweeper_deposits", "list_trading_pairs", "list_twap_order_slices", "list_twap_orders", "mint_tokens", "preview_follow", "refresh_managed_market_quotes", "refresh_session", "register_deposit_address", "replace_order", "request_invite_codes", "revoke_delegated_agent", "revoke_session", "set_builder_fee", "set_self_trade_prevention_default", "set_trader_code", "simulate_fees", "simulate_order_risk", "simulate_parent_margin_order_risk", "simulate_risk_bucket_order_risk", "stop_follow", "transfer_collateral", "transfer_collateral_from_margin_account", "transfer_collateral_from_parent_margin_account", "transfer_collateral_from_sub_account", "transfer_collateral_to_margin_account", "transfer_collateral_to_parent_margin_account", "transfer_collateral_to_risk_bucket", "transfer_collateral_to_sub_account", "transfer_rewards", "update_sub_account_limit", "upsert_delegated_agent", "upsert_follow", "upsert_lead_trader", "verify_signature"];
|
|
14
14
|
/** Union of every OpenAPI operationId in the spec. */
|
|
15
15
|
export type OperationId = (typeof OPERATION_IDS)[number];
|
package/dist/wire/operations.js
CHANGED
package/dist/wire/schema.d.ts
CHANGED
|
@@ -1562,6 +1562,26 @@ export interface paths {
|
|
|
1562
1562
|
patch?: never;
|
|
1563
1563
|
trace?: never;
|
|
1564
1564
|
};
|
|
1565
|
+
"/api/v1/fees/schedule": {
|
|
1566
|
+
parameters: {
|
|
1567
|
+
query?: never;
|
|
1568
|
+
header?: never;
|
|
1569
|
+
path?: never;
|
|
1570
|
+
cookie?: never;
|
|
1571
|
+
};
|
|
1572
|
+
/**
|
|
1573
|
+
* Get a trading pair's fee tier schedule
|
|
1574
|
+
* @description Public. The tier schedule a pair charges, ordered by tier level. Your own tier and rate: GET /api/v1/fees/tier.
|
|
1575
|
+
*/
|
|
1576
|
+
get: operations["get_fee_schedule"];
|
|
1577
|
+
put?: never;
|
|
1578
|
+
post?: never;
|
|
1579
|
+
delete?: never;
|
|
1580
|
+
options?: never;
|
|
1581
|
+
head?: never;
|
|
1582
|
+
patch?: never;
|
|
1583
|
+
trace?: never;
|
|
1584
|
+
};
|
|
1565
1585
|
"/api/v1/fees/simulate": {
|
|
1566
1586
|
parameters: {
|
|
1567
1587
|
query?: never;
|
|
@@ -5947,6 +5967,16 @@ export interface components {
|
|
|
5947
5967
|
*/
|
|
5948
5968
|
recentRequests?: components["schemas"]["FaucetRequestRecord"][] | null;
|
|
5949
5969
|
};
|
|
5970
|
+
GetFeeScheduleResponse: {
|
|
5971
|
+
/**
|
|
5972
|
+
* Format: uuid
|
|
5973
|
+
* @description Trading pair UUID the schedule belongs to
|
|
5974
|
+
* @example 123e4567-e89b-12d3-a456-426614174000
|
|
5975
|
+
*/
|
|
5976
|
+
tradingPairId?: string | null;
|
|
5977
|
+
/** @description The pair's fee tier schedule, ascending by tier level */
|
|
5978
|
+
feeSchedule?: components["schemas"]["FeeTierScheduleRow"][] | null;
|
|
5979
|
+
};
|
|
5950
5980
|
GetFollowResponse: {
|
|
5951
5981
|
/** @description The follow. */
|
|
5952
5982
|
follow?: components["schemas"]["Follow"] | null;
|
|
@@ -6650,6 +6680,16 @@ export interface components {
|
|
|
6650
6680
|
* @example LIQUIDATION
|
|
6651
6681
|
*/
|
|
6652
6682
|
origin?: string | null;
|
|
6683
|
+
/**
|
|
6684
|
+
* @description Monaco taker fee rate fixed when this order was placed (re-fixed on replace), in basis points. The fee actually charged on a fill can be lower for a maker rebate: a rebate never exceeds the taker fee of the same fill. Absent for orders placed before rates were stored.
|
|
6685
|
+
* @example 4.5
|
|
6686
|
+
*/
|
|
6687
|
+
placementTakerFeeBps?: string | null;
|
|
6688
|
+
/**
|
|
6689
|
+
* @description Monaco maker fee rate fixed when this order was placed (re-fixed on replace), in basis points. Negative means rebate. The rebate actually paid on a fill can be smaller: a rebate never exceeds the taker fee of the same fill. Absent for orders placed before rates were stored.
|
|
6690
|
+
* @example -0.1
|
|
6691
|
+
*/
|
|
6692
|
+
placementMakerFeeBps?: string | null;
|
|
6653
6693
|
};
|
|
6654
6694
|
/** @description Orderbook snapshot with token metadata and sequence number. */
|
|
6655
6695
|
GetOrderbookResponse: {
|
|
@@ -8599,9 +8639,12 @@ export interface components {
|
|
|
8599
8639
|
* reducing, reduce-only, or opposite-side order sheltered by a larger
|
|
8600
8640
|
* resting ladder needs less or none of it (and can be admitted even when
|
|
8601
8641
|
* this field is zero), while an order crossing a losing position can need
|
|
8602
|
-
* more than its own margin-plus-fee.
|
|
8603
|
-
*
|
|
8604
|
-
*
|
|
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`.
|
|
8605
8648
|
*
|
|
8606
8649
|
* Present only on risk-bucket summary rows served from a live risk engine
|
|
8607
8650
|
* snapshot; absent on parent rows and on persisted-fallback reads, where
|
|
@@ -15678,6 +15721,50 @@ export interface operations {
|
|
|
15678
15721
|
};
|
|
15679
15722
|
};
|
|
15680
15723
|
};
|
|
15724
|
+
get_fee_schedule: {
|
|
15725
|
+
parameters: {
|
|
15726
|
+
query?: {
|
|
15727
|
+
/** @description Trading pair identifier (UUID) */
|
|
15728
|
+
tradingPairId?: string;
|
|
15729
|
+
};
|
|
15730
|
+
header?: never;
|
|
15731
|
+
path?: never;
|
|
15732
|
+
cookie?: never;
|
|
15733
|
+
};
|
|
15734
|
+
requestBody?: never;
|
|
15735
|
+
responses: {
|
|
15736
|
+
/** @description OK */
|
|
15737
|
+
200: {
|
|
15738
|
+
headers: {
|
|
15739
|
+
[name: string]: unknown;
|
|
15740
|
+
};
|
|
15741
|
+
content: {
|
|
15742
|
+
"application/json": components["schemas"]["GetFeeScheduleResponse"];
|
|
15743
|
+
};
|
|
15744
|
+
};
|
|
15745
|
+
/** @description Invalid trading pair ID format */
|
|
15746
|
+
400: {
|
|
15747
|
+
headers: {
|
|
15748
|
+
[name: string]: unknown;
|
|
15749
|
+
};
|
|
15750
|
+
content?: never;
|
|
15751
|
+
};
|
|
15752
|
+
/** @description Trading pair or fee tier schedule not found */
|
|
15753
|
+
404: {
|
|
15754
|
+
headers: {
|
|
15755
|
+
[name: string]: unknown;
|
|
15756
|
+
};
|
|
15757
|
+
content?: never;
|
|
15758
|
+
};
|
|
15759
|
+
/** @description Internal server error */
|
|
15760
|
+
500: {
|
|
15761
|
+
headers: {
|
|
15762
|
+
[name: string]: unknown;
|
|
15763
|
+
};
|
|
15764
|
+
content?: never;
|
|
15765
|
+
};
|
|
15766
|
+
};
|
|
15767
|
+
};
|
|
15681
15768
|
simulate_fees: {
|
|
15682
15769
|
parameters: {
|
|
15683
15770
|
query: {
|
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": {
|