@0xmonaco/types 1.0.88 → 1.0.91
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/buildercodes/index.d.ts +4 -2
- package/dist/fees/responses.d.ts +0 -2
- package/dist/fees/responses.js +0 -12
- package/dist/margin-accounts/index.d.ts +32 -0
- package/dist/market/index.d.ts +132 -0
- package/dist/portfolio/index.d.ts +6 -0
- package/dist/profile/index.d.ts +49 -12
- package/dist/sdk/index.d.ts +2 -1
- package/dist/sweeper/index.d.ts +128 -2
- package/dist/trading/orders.d.ts +1 -1
- package/dist/validation/margin-accounts.d.ts +7 -0
- package/dist/validation/margin-accounts.js +5 -1
- package/dist/validation/profile.d.ts +2 -0
- package/dist/validation/profile.js +2 -0
- package/dist/websocket/client.d.ts +8 -1
- package/dist/websocket/events/index.d.ts +1 -0
- package/dist/websocket/events/index.js +1 -0
- package/dist/websocket/events/market-liquidation-events.d.ts +26 -0
- package/dist/websocket/events/market-liquidation-events.js +1 -0
- package/dist/wire/operations.d.ts +1 -1
- package/dist/wire/operations.js +6 -0
- package/dist/wire/schema.d.ts +978 -48
- package/package.json +2 -2
|
@@ -57,7 +57,7 @@ import type { Interval } from "../market";
|
|
|
57
57
|
import type { TradingMode } from "../trading";
|
|
58
58
|
import type { SubscriptionChangeHandler, WebSocketStatus, WebSocketSubscriptionState } from "./base";
|
|
59
59
|
import type { OrderbookQuotationMode } from "./clients/orderbook-client";
|
|
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";
|
|
60
|
+
import type { AccountEvent, AccountEventData, ConditionalOrderEvent, ConditionalOrderEventData, CopyEvent, CopyRelationshipEventData, InstrumentEvent, InstrumentEventData, LiquidationEvent, LiquidationEventData, MarketLiquidationEvent, MarketStatsAllEvent, MarketStatsData, MarketStatsEvent, MarketStatsSummary, OHLCVEvent, OHLCVPriceType, OrderbookEvent, OrderEvent, PositionEvent, PositionEventData, PositionValuationEvent, TradeEvent, TradeEventData, TwapOrderEvent, TwapOrderEventData, UserBalanceEvent, UserBalanceEventData, UserMovementEvent } from "./events";
|
|
61
61
|
import type { OHLCVSnapshotCandle, OrderSnapshotItem, SnapshotHandler } from "./snapshots";
|
|
62
62
|
export type MessageHandler<T> = (data: T) => void;
|
|
63
63
|
export interface MonacoWebSocket {
|
|
@@ -120,6 +120,13 @@ export interface MonacoWebSocket {
|
|
|
120
120
|
positions: (handler: MessageHandler<PositionEvent>, tradingPairId?: string, onSnapshot?: SnapshotHandler<PositionEventData>, onValuation?: MessageHandler<PositionValuationEvent>) => () => void;
|
|
121
121
|
/** Subscribe to liquidation alerts (requires authentication); omit `tradingPairId` for all pairs */
|
|
122
122
|
liquidations: (handler: MessageHandler<LiquidationEvent>, tradingPairId?: string, onSnapshot?: SnapshotHandler<LiquidationEventData>) => () => void;
|
|
123
|
+
/**
|
|
124
|
+
* Subscribe to public per-fill liquidation events for one pair. Frames carry
|
|
125
|
+
* the persisted event ID, wallet, position side, size and event-time mark
|
|
126
|
+
* valuation. The stream has no snapshot; use event history to backfill after
|
|
127
|
+
* reconnect and deduplicate on `eventId`.
|
|
128
|
+
*/
|
|
129
|
+
marketLiquidations: (tradingPairId: string, handler: MessageHandler<MarketLiquidationEvent>) => () => void;
|
|
123
130
|
/** Subscribe to account-level margin health updates for the authenticated user (requires authentication) */
|
|
124
131
|
account: (handler: MessageHandler<AccountEvent>, onSnapshot?: SnapshotHandler<AccountEventData>) => () => void;
|
|
125
132
|
/**
|
|
@@ -4,6 +4,7 @@ export * from "./conditional-order-events";
|
|
|
4
4
|
export * from "./copy-events";
|
|
5
5
|
export * from "./instrument-events";
|
|
6
6
|
export * from "./liquidation-events";
|
|
7
|
+
export * from "./market-liquidation-events";
|
|
7
8
|
export * from "./market-stats-events";
|
|
8
9
|
export * from "./movement-events";
|
|
9
10
|
export * from "./ohlcv-events";
|
|
@@ -4,6 +4,7 @@ export * from "./conditional-order-events";
|
|
|
4
4
|
export * from "./copy-events";
|
|
5
5
|
export * from "./instrument-events";
|
|
6
6
|
export * from "./liquidation-events";
|
|
7
|
+
export * from "./market-liquidation-events";
|
|
7
8
|
export * from "./market-stats-events";
|
|
8
9
|
export * from "./movement-events";
|
|
9
10
|
export * from "./ohlcv-events";
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/** Public pair-scoped liquidation events. */
|
|
2
|
+
export interface MarketLiquidationEventData {
|
|
3
|
+
/** Stable ID shared with the persisted REST liquidation row. */
|
|
4
|
+
eventId: string;
|
|
5
|
+
/** Event timestamp as Unix milliseconds. */
|
|
6
|
+
timestamp: number;
|
|
7
|
+
/** Public wallet address associated with the liquidation event. */
|
|
8
|
+
wallet: string;
|
|
9
|
+
/** Side of the liquidated position, rather than execution direction. */
|
|
10
|
+
side: "LONG" | "SHORT" | (string & {});
|
|
11
|
+
/** Absolute position size in base-asset units. */
|
|
12
|
+
positionSize: string;
|
|
13
|
+
/** Mark price captured with this event, in quote units per base unit. */
|
|
14
|
+
markPrice: string;
|
|
15
|
+
/** Position size multiplied by this event's mark price, in quote units. */
|
|
16
|
+
markNotional: string;
|
|
17
|
+
/** Quote asset used for markNotional. */
|
|
18
|
+
quoteAssetSymbol: string;
|
|
19
|
+
}
|
|
20
|
+
export interface MarketLiquidationEvent {
|
|
21
|
+
/** Fixed market-event discriminator. */
|
|
22
|
+
eventType: "liquidation_event";
|
|
23
|
+
/** Trading pair UUID. */
|
|
24
|
+
tradingPairId: string;
|
|
25
|
+
data: MarketLiquidationEventData;
|
|
26
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/** Public pair-scoped liquidation events. */
|
|
@@ -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_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_rewards_balance", "get_screener", "get_self_trade_prevention_default", "get_sub_account_limits", "get_sweeper_chains", "get_trade_by_id", "get_trader_code_info", "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_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_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", "submit_whitelist", "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_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_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", "submit_whitelist", "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
|
@@ -50,6 +50,7 @@ export const OPERATION_IDS = [
|
|
|
50
50
|
"get_funding_state",
|
|
51
51
|
"get_index_price",
|
|
52
52
|
"get_lead_trader",
|
|
53
|
+
"get_liquidation_metrics",
|
|
53
54
|
"get_margin_account_movements",
|
|
54
55
|
"get_margin_account_pnl",
|
|
55
56
|
"get_margin_account_summary",
|
|
@@ -86,8 +87,11 @@ export const OPERATION_IDS = [
|
|
|
86
87
|
"get_self_trade_prevention_default",
|
|
87
88
|
"get_sub_account_limits",
|
|
88
89
|
"get_sweeper_chains",
|
|
90
|
+
"get_sweeper_deposit_status",
|
|
89
91
|
"get_trade_by_id",
|
|
92
|
+
"get_trade_flow",
|
|
90
93
|
"get_trader_code_info",
|
|
94
|
+
"get_trader_metrics",
|
|
91
95
|
"get_trades",
|
|
92
96
|
"get_trading_pair_by_id",
|
|
93
97
|
"get_twap_order",
|
|
@@ -117,6 +121,7 @@ export const OPERATION_IDS = [
|
|
|
117
121
|
"list_lead_trader_closed_trades",
|
|
118
122
|
"list_lead_trader_open_positions",
|
|
119
123
|
"list_lead_traders",
|
|
124
|
+
"list_liquidation_events",
|
|
120
125
|
"list_managed_market_assignments",
|
|
121
126
|
"list_margin_accounts",
|
|
122
127
|
"list_my_followers",
|
|
@@ -125,6 +130,7 @@ export const OPERATION_IDS = [
|
|
|
125
130
|
"list_position_history",
|
|
126
131
|
"list_positions",
|
|
127
132
|
"list_sub_accounts_with_balances",
|
|
133
|
+
"list_sweeper_deposits",
|
|
128
134
|
"list_trading_pairs",
|
|
129
135
|
"list_twap_order_slices",
|
|
130
136
|
"list_twap_orders",
|