@0xmonaco/types 1.1.8 → 1.1.10

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.
@@ -70,6 +70,13 @@ export const CancelRfqSchema = z
70
70
  })
71
71
  .strict();
72
72
  /** Params for placing or replacing a quote: a bid, an ask or both. */
73
+ /** `listRfqs` paging: 1 to 100 per page, and the previous page's token. */
74
+ export const ListRfqsSchema = z
75
+ .object({
76
+ pageSize: z.number().int().min(1).max(100).optional(),
77
+ pageToken: z.string().min(1).optional(),
78
+ })
79
+ .strict();
73
80
  export const UpsertRfqQuoteSchema = z
74
81
  .object({
75
82
  /** Your current version for this RFQ (`ownLatestVersion`); 0 for your first quote. */
@@ -369,8 +369,7 @@ export const ReplaceOrderSchema = z.object({
369
369
  quantity: PositiveDecimalStringSchema.optional(),
370
370
  useMasterBalance: z.boolean().optional(),
371
371
  // No MARKET/IOC-FOK refine here: order type and time-in-force are not
372
- // replaceable fields — the server validates postOnly against the
373
- // persisted original order, which this client-side schema cannot see.
372
+ // replaceable fields, and only a live resting order can be replaced.
374
373
  postOnly: z.boolean().optional(),
375
374
  // Re-stated per replace, never inherited from the original order.
376
375
  selfTradePreventionMode: SelfTradePreventionModeSchema.optional(),
@@ -703,8 +702,7 @@ export const BatchReplaceOrderItemSchema = z
703
702
  quantity: PositiveDecimalStringSchema.optional(),
704
703
  useMasterBalance: z.boolean().optional(),
705
704
  // No MARKET/IOC-FOK refine here: order type and time-in-force are not
706
- // replaceable fields — the server validates postOnly against the
707
- // persisted original order, which this client-side schema cannot see.
705
+ // replaceable fields, and only a live resting order can be replaced.
708
706
  postOnly: z.boolean().optional(),
709
707
  // Re-stated per replace, never inherited from the original order.
710
708
  selfTradePreventionMode: SelfTradePreventionModeSchema.optional(),
@@ -60,7 +60,7 @@ import type { TradingMode } from "../trading";
60
60
  import type { SubscriptionChangeHandler, WebSocketStatus, WebSocketSubscriptionState } from "./base";
61
61
  import type { OrderbookQuotationMode } from "./clients/orderbook-client";
62
62
  import type { Bbo, DepthBook, LocalBookOptions } from "./depth";
63
- import type { AccountEvent, AccountEventData, ConditionalOrderEvent, ConditionalOrderEventData, CopyEvent, CopyRelationshipEventData, InstrumentEvent, InstrumentEventData, LiquidationEvent, LiquidationEventData, MarketLiquidationEvent, MarketStatsAllEvent, MarketStatsData, MarketStatsEvent, MarketStatsSummary, OHLCVEvent, OHLCVPriceType, OrderbookEvent, OrderEvent, PositionEvent, PositionEventData, PositionValuationEvent, RfqEvent, RfqTradeEvent, TradeEvent, TradeEventData, TradeGap, TwapOrderEvent, TwapOrderEventData, UserBalanceEvent, UserBalanceEventData, UserMovementEvent } from "./events";
63
+ import type { AccountEvent, AccountEventData, ConditionalOrderEvent, ConditionalOrderEventData, CopyEvent, CopyRelationshipEventData, InstrumentEvent, InstrumentEventData, LiquidationEvent, LiquidationEventData, MarketLiquidationEvent, MarketStatsAllEvent, MarketStatsData, MarketStatsEvent, MarketStatsSummary, OHLCVEvent, OHLCVPriceType, OrderbookEvent, OrderEvent, PositionEvent, PositionEventData, PositionValuationEvent, RfqEvent, RfqTradeEvent, RfqTradeEventData, TradeEvent, TradeEventData, TradeGap, TwapOrderEvent, TwapOrderEventData, UserBalanceEvent, UserBalanceEventData, UserMovementEvent } from "./events";
64
64
  import type { OHLCVSnapshotCandle, OrderSnapshotItem, SnapshotHandler } from "./snapshots";
65
65
  /** Options for `ws.trades`. */
66
66
  export interface TradesOptions {
@@ -200,9 +200,12 @@ export interface MonacoWebSocket {
200
200
  rfq: (handler: MessageHandler<RfqEvent>) => () => void;
201
201
  /**
202
202
  * Subscribe to the public, anonymised RFQ block prints for one pair. RFQ
203
- * fills never print on `trades`. There is no snapshot: deduplicate on
204
- * `data.executionId`, and backfill from the REST trade reads, which include
205
- * RFQ fills with `executionSource: "RFQ"`.
203
+ * fills never print on `trades`. Prints are best-effort: deduplicate on
204
+ * `data.executionId`, and recover any you missed with
205
+ * `trades.recoverRfqTrades`, which pages the pair's RFQ history
206
+ * (`getTrades` with `executionSource: "RFQ"`). `onSnapshot`, if given,
207
+ * receives the pair's newest RFQ prints from that history at subscribe
208
+ * time; a snapshot row's `publishedAt` is its `executedAt`.
206
209
  */
207
- rfqTrades: (tradingPairId: string, handler: MessageHandler<RfqTradeEvent>) => () => void;
210
+ rfqTrades: (tradingPairId: string, handler: MessageHandler<RfqTradeEvent>, onSnapshot?: SnapshotHandler<RfqTradeEventData>) => () => void;
208
211
  }
@@ -181,6 +181,12 @@ export interface MarketStatsSummary {
181
181
  * and omitted (never zero) until both open interest and a price are known.
182
182
  */
183
183
  openInterestNotional?: string;
184
+ /**
185
+ * The 24h volumes split into their order-book and RFQ parts, as on the
186
+ * per-market frame. Omitted while any candle in the window has no recorded
187
+ * split.
188
+ */
189
+ dailyVolumeBySource?: DailyVolumeBySource;
184
190
  }
185
191
  /**
186
192
  * All-markets summary event on the `market_stats` channel: one
@@ -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 ["accept_rfq", "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_all_after", "cancel_conditional_order", "cancel_order", "cancel_rfq", "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_rfq", "create_sub_account", "create_sub_account_limit", "create_twap_order", "delete_sub_account_limit", "get_application_config", "get_application_stats", "get_available_collateral", "get_builder", "get_builder_series", "get_builder_totals", "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_protocol_series", "get_protocol_totals", "get_pulse", "get_region_status", "get_rewards_balance", "get_rfq", "get_rfq_capabilities", "get_screener", "get_self_trade_prevention_default", "get_sub_account_limits", "get_sweeper_chains", "get_sweeper_deposit_status", "get_token_custody", "get_trade_by_id", "get_trade_flow", "get_trader_code_info", "get_trader_metrics", "get_trades", "get_trading_pair_by_id", "get_treasury_net_fees", "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_wallet_summary", "get_withdrawal", "health_check", "initiate_withdrawal", "list_all_funding_history", "list_all_liquidation_events", "list_application_balances", "list_application_movements", "list_application_orders", "list_application_users", "list_builder_fee_changes", "list_builder_leaderboard", "list_buildercode_payouts", "list_builders", "list_conditional_orders", "list_delegated_agent_owners", "list_delegated_agents", "list_follow_leader_positions", "list_funding_history", "list_funding_payments", "list_insurance_funds", "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_market_volumes", "list_my_followers", "list_my_follows", "list_pending_withdrawals", "list_position_history", "list_positions", "list_sub_accounts_with_balances", "list_sweeper_deposits", "list_token_custody", "list_trades", "list_trading_pairs", "list_twap_order_slices", "list_twap_orders", "list_vault_deposits", "list_vault_withdrawals", "list_wallet_leaderboard", "list_wallet_liquidations", "mint_tokens", "preview_follow", "refresh_managed_market_quotes", "refresh_session", "register_deposit_address", "replace_order", "request_invite_codes", "respond_rfq_last_look", "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", "upsert_rfq_quote", "verify_signature", "withdraw_rfq_quote"];
13
+ export declare const OPERATION_IDS: readonly ["accept_rfq", "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_all_after", "cancel_conditional_order", "cancel_order", "cancel_rfq", "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_rfq", "create_sub_account", "create_sub_account_limit", "create_twap_order", "delete_sub_account_limit", "get_application_config", "get_application_stats", "get_available_collateral", "get_builder", "get_builder_series", "get_builder_totals", "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_protocol_series", "get_protocol_totals", "get_pulse", "get_region_status", "get_rewards_balance", "get_rfq", "get_rfq_capabilities", "get_screener", "get_self_trade_prevention_default", "get_sub_account_limits", "get_sweeper_chains", "get_sweeper_deposit_status", "get_token_custody", "get_trade_by_id", "get_trade_flow", "get_trader_code_info", "get_trader_metrics", "get_trades", "get_trading_pair_by_id", "get_treasury_net_fees", "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_wallet_summary", "get_withdrawal", "health_check", "initiate_withdrawal", "list_all_funding_history", "list_all_liquidation_events", "list_application_balances", "list_application_margin_accounts", "list_application_movements", "list_application_orders", "list_application_users", "list_builder_fee_changes", "list_builder_leaderboard", "list_buildercode_payouts", "list_builders", "list_conditional_orders", "list_delegated_agent_owners", "list_delegated_agents", "list_follow_leader_positions", "list_funding_history", "list_funding_payments", "list_insurance_funds", "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_market_volumes", "list_my_followers", "list_my_follows", "list_pending_withdrawals", "list_position_history", "list_positions", "list_rfqs", "list_sub_accounts_with_balances", "list_sweeper_deposits", "list_token_custody", "list_trades", "list_trading_pairs", "list_twap_order_slices", "list_twap_orders", "list_vault_deposits", "list_vault_withdrawals", "list_wallet_leaderboard", "list_wallet_liquidations", "mint_tokens", "preview_follow", "refresh_managed_market_quotes", "refresh_session", "register_deposit_address", "replace_order", "request_invite_codes", "respond_rfq_last_look", "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", "upsert_rfq_quote", "verify_signature", "withdraw_rfq_quote"];
14
14
  /** Union of every OpenAPI operationId in the spec. */
15
15
  export type OperationId = (typeof OPERATION_IDS)[number];
@@ -123,6 +123,7 @@ export const OPERATION_IDS = [
123
123
  "list_all_funding_history",
124
124
  "list_all_liquidation_events",
125
125
  "list_application_balances",
126
+ "list_application_margin_accounts",
126
127
  "list_application_movements",
127
128
  "list_application_orders",
128
129
  "list_application_users",
@@ -150,6 +151,7 @@ export const OPERATION_IDS = [
150
151
  "list_pending_withdrawals",
151
152
  "list_position_history",
152
153
  "list_positions",
154
+ "list_rfqs",
153
155
  "list_sub_accounts_with_balances",
154
156
  "list_sweeper_deposits",
155
157
  "list_token_custody",