@0xmonaco/types 1.0.60 → 1.0.62
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/applications/requests.d.ts +2 -2
- package/dist/applications/responses.d.ts +20 -4
- package/dist/auth/responses.d.ts +15 -0
- package/dist/margin-accounts/index.d.ts +65 -1
- package/dist/market/index.d.ts +64 -0
- package/dist/pitpass/index.d.ts +27 -3
- package/dist/pitpass/index.js +1 -1
- package/dist/pitpass/responses.d.ts +75 -0
- package/dist/pitpass/responses.js +78 -0
- package/dist/trading/index.d.ts +4 -1
- package/dist/validation/margin-accounts.d.ts +4 -0
- package/dist/validation/margin-accounts.js +16 -1
- package/dist/validation/trading.d.ts +7 -0
- package/dist/validation/trading.js +11 -0
- package/dist/websocket/events/account-events.d.ts +40 -14
- package/dist/websocket/events/account-events.js +16 -0
- package/dist/wire/operations.d.ts +1 -1
- package/dist/wire/operations.js +2 -0
- package/dist/wire/schema.d.ts +439 -7
- package/package.json +2 -2
|
@@ -9,6 +9,22 @@
|
|
|
9
9
|
* A lost key or terminal update need not have a later replacement. Each
|
|
10
10
|
* frame carries the account's full current health, so consume it as a
|
|
11
11
|
* terminal-state snapshot per margin account, never as an additive delta.
|
|
12
|
+
*
|
|
13
|
+
* A subscribe-time snapshot arrives ahead of the live diffs, carrying one row
|
|
14
|
+
* per margin account you own IN THE APPLICATION YOU AUTHENTICATED UNDER -
|
|
15
|
+
* including FLAT accounts, which the live producer never emits for. Live
|
|
16
|
+
* delivery is wider: it is per user and carries no application filter, so if
|
|
17
|
+
* the same wallet trades through more than one application you also receive
|
|
18
|
+
* live frames for those accounts. Do NOT treat an account absent from the
|
|
19
|
+
* snapshot as deleted - merge per `marginAccountId` rather than replacing your
|
|
20
|
+
* whole map. Snapshot rows are this same payload with `sequence` absent; see
|
|
21
|
+
* that field.
|
|
22
|
+
*
|
|
23
|
+
* Live frames emitted before your subscription activated are buffered during
|
|
24
|
+
* the snapshot read and delivered after it, so one can supersede a newer
|
|
25
|
+
* snapshot row. A later frame normally corrects that within the ~30s
|
|
26
|
+
* keepalive; if the account went flat in that window and its final frame never
|
|
27
|
+
* arrived, reconnect to re-seed.
|
|
12
28
|
*/
|
|
13
29
|
/**
|
|
14
30
|
* Account event data carrying the current margin health of a single account.
|
|
@@ -17,23 +33,33 @@ export interface AccountEventData {
|
|
|
17
33
|
/** Margin account this update describes (UUID) */
|
|
18
34
|
marginAccountId: string;
|
|
19
35
|
/**
|
|
20
|
-
* Monotonic per-account counter within one producer run
|
|
21
|
-
* published frames, may SKIP values (at-most-once
|
|
22
|
-
* resets to zero when the producer restarts —
|
|
23
|
-
* WebSocket stays connected, because the socket
|
|
24
|
-
* service. It is therefore never a gap detector and
|
|
25
|
-
* total order.
|
|
36
|
+
* Monotonic per-account counter within one producer run, on LIVE frames
|
|
37
|
+
* only. It advances only on published frames, may SKIP values (at-most-once
|
|
38
|
+
* publishing/delivery), and resets to zero when the producer restarts —
|
|
39
|
+
* which can happen while your WebSocket stays connected, because the socket
|
|
40
|
+
* is owned by a different service. It is therefore never a gap detector and
|
|
41
|
+
* never a cross-restart total order.
|
|
42
|
+
*
|
|
43
|
+
* Dedupe rule, LIVE FRAMES ONLY: order them per account by `updatedAt`,
|
|
44
|
+
* newest wins, and use `sequence` only to break ties between frames carrying
|
|
45
|
+
* the SAME `updatedAt` (those come from the same producer run). A snapshot
|
|
46
|
+
* row is not ranked this way — see below.
|
|
26
47
|
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
48
|
+
* **Absent on a subscribe-time snapshot row.** The counter belongs to the
|
|
49
|
+
* matching engine's own producer process and the snapshot is served by a
|
|
50
|
+
* different service, which cannot mint one; a `0` would be worse than
|
|
51
|
+
* absent, because it is indistinguishable from a restarted producer's first
|
|
52
|
+
* frame and would make you drop live frames behind the baseline.
|
|
30
53
|
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
54
|
+
* A snapshot row's `updatedAt` is the instant that account's state was
|
|
55
|
+
* PERSISTED (a database write), while a live frame's is when the engine
|
|
56
|
+
* SAMPLED it. Those clocks are not comparable under persistence lag, so the
|
|
57
|
+
* rule is simply that **a live frame always supersedes a snapshot row for the
|
|
58
|
+
* same `marginAccountId`** — rank `updatedAt` only between live frames, with
|
|
59
|
+
* `sequence` breaking ties inside one producer run, which a snapshot is not
|
|
60
|
+
* part of. Treat `undefined` as "unknown", never as zero.
|
|
35
61
|
*/
|
|
36
|
-
sequence
|
|
62
|
+
sequence?: number;
|
|
37
63
|
/** Mark-inclusive account equity: collateral + unrealized PnL + funding (decimal string) */
|
|
38
64
|
equity: string;
|
|
39
65
|
/** Raw deposited collateral in USD (decimal string) */
|
|
@@ -9,4 +9,20 @@
|
|
|
9
9
|
* A lost key or terminal update need not have a later replacement. Each
|
|
10
10
|
* frame carries the account's full current health, so consume it as a
|
|
11
11
|
* terminal-state snapshot per margin account, never as an additive delta.
|
|
12
|
+
*
|
|
13
|
+
* A subscribe-time snapshot arrives ahead of the live diffs, carrying one row
|
|
14
|
+
* per margin account you own IN THE APPLICATION YOU AUTHENTICATED UNDER -
|
|
15
|
+
* including FLAT accounts, which the live producer never emits for. Live
|
|
16
|
+
* delivery is wider: it is per user and carries no application filter, so if
|
|
17
|
+
* the same wallet trades through more than one application you also receive
|
|
18
|
+
* live frames for those accounts. Do NOT treat an account absent from the
|
|
19
|
+
* snapshot as deleted - merge per `marginAccountId` rather than replacing your
|
|
20
|
+
* whole map. Snapshot rows are this same payload with `sequence` absent; see
|
|
21
|
+
* that field.
|
|
22
|
+
*
|
|
23
|
+
* Live frames emitted before your subscription activated are buffered during
|
|
24
|
+
* the snapshot read and delivered after it, so one can supersede a newer
|
|
25
|
+
* snapshot row. A later frame normally corrects that within the ~30s
|
|
26
|
+
* keepalive; if the account went flat in that window and its final frame never
|
|
27
|
+
* arrived, reconnect to re-seed.
|
|
12
28
|
*/
|
|
@@ -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 ["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_position", "create_challenge", "create_delegated_session", "create_order", "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_funding_state", "get_index_price", "get_margin_account_movements", "get_margin_account_summary", "get_mark_price", "get_market_metadata", "get_market_stats", "get_my_fee_tier", "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_buildercode_payouts", "list_conditional_orders", "list_delegated_agent_owners", "list_delegated_agents", "list_funding_history", "list_funding_payments", "list_managed_market_assignments", "list_margin_accounts", "list_pending_withdrawals", "list_position_history", "list_positions", "list_sub_accounts_with_balances", "list_trading_pairs", "list_twap_orders", "mint_tokens", "refresh_managed_market_quotes", "refresh_session", "register_deposit_address", "replace_order", "revoke_delegated_agent", "revoke_session", "set_self_trade_prevention_default", "set_trader_code", "simulate_fees", "simulate_order_risk", "simulate_parent_margin_order_risk", "simulate_risk_bucket_order_risk", "submit_whitelist", "transfer_collateral_from_margin_account", "transfer_collateral_from_parent_margin_account", "transfer_collateral_to_margin_account", "transfer_collateral_to_parent_margin_account", "transfer_collateral_to_risk_bucket", "transfer_rewards", "update_sub_account_limit", "upsert_delegated_agent", "verify_signature"];
|
|
13
|
+
export declare const OPERATION_IDS: readonly ["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_position", "create_challenge", "create_delegated_session", "create_order", "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_funding_state", "get_index_price", "get_margin_account_movements", "get_margin_account_summary", "get_mark_price", "get_market_metadata", "get_market_stats", "get_my_fee_tier", "get_my_referral_downline", "get_my_referral_position", "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_buildercode_payouts", "list_conditional_orders", "list_delegated_agent_owners", "list_delegated_agents", "list_funding_history", "list_funding_payments", "list_managed_market_assignments", "list_margin_accounts", "list_pending_withdrawals", "list_position_history", "list_positions", "list_sub_accounts_with_balances", "list_trading_pairs", "list_twap_orders", "mint_tokens", "refresh_managed_market_quotes", "refresh_session", "register_deposit_address", "replace_order", "revoke_delegated_agent", "revoke_session", "set_self_trade_prevention_default", "set_trader_code", "simulate_fees", "simulate_order_risk", "simulate_parent_margin_order_risk", "simulate_risk_bucket_order_risk", "submit_whitelist", "transfer_collateral_from_margin_account", "transfer_collateral_from_parent_margin_account", "transfer_collateral_to_margin_account", "transfer_collateral_to_parent_margin_account", "transfer_collateral_to_risk_bucket", "transfer_rewards", "update_sub_account_limit", "upsert_delegated_agent", "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