@0xmonaco/types 1.0.35 → 1.0.37
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/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/market/index.d.ts +8 -0
- package/dist/sdk/index.d.ts +3 -0
- package/dist/sweeper/index.d.ts +67 -0
- package/dist/sweeper/index.js +12 -0
- package/dist/trading/index.d.ts +8 -0
- package/dist/trading/responses.d.ts +12 -0
- package/dist/validation/trading.d.ts +6 -0
- package/dist/validation/trading.js +22 -0
- package/dist/wire/operations.d.ts +1 -1
- package/dist/wire/operations.js +1 -0
- package/dist/wire/schema.d.ts +159 -2
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
package/dist/market/index.d.ts
CHANGED
|
@@ -16,8 +16,16 @@ export interface TradingPair {
|
|
|
16
16
|
symbol: string;
|
|
17
17
|
/** Base token symbol */
|
|
18
18
|
baseToken: string;
|
|
19
|
+
/**
|
|
20
|
+
* Human-readable base asset display name (e.g. "Robinhood Markets" for
|
|
21
|
+
* HOOD). Sourced from the asset registry; use it to match markets by
|
|
22
|
+
* company or asset name in search, not just by ticker.
|
|
23
|
+
*/
|
|
24
|
+
baseAssetName: string;
|
|
19
25
|
/** Quote token symbol */
|
|
20
26
|
quoteToken: string;
|
|
27
|
+
/** Human-readable quote asset display name (e.g. "USDC") */
|
|
28
|
+
quoteAssetName: string;
|
|
21
29
|
/** Base asset ID (UUID) */
|
|
22
30
|
baseAssetId: string;
|
|
23
31
|
/** Quote asset ID (UUID) */
|
package/dist/sdk/index.d.ts
CHANGED
|
@@ -12,6 +12,7 @@ import type { PositionsAPI } from "../positions";
|
|
|
12
12
|
import type { ProfileAPI } from "../profile";
|
|
13
13
|
import type { PulseAPI } from "../pulse";
|
|
14
14
|
import type { SubAccountsAPI } from "../sub-accounts";
|
|
15
|
+
import type { SweeperAPI } from "../sweeper";
|
|
15
16
|
import type { TradingAPI, TradingMode } from "../trading";
|
|
16
17
|
import type { VaultAPI } from "../vault";
|
|
17
18
|
import type { ConditionalOrderEvent, OHLCVEvent, OrderbookEvent, OrderbookQuotationMode, OrderEvent, TradeEvent, UserBalanceEvent, UserMovementEvent } from "../websocket";
|
|
@@ -98,6 +99,8 @@ export interface MonacoSDK {
|
|
|
98
99
|
pitpass: PitpassAPI;
|
|
99
100
|
/** Testnet faucet API */
|
|
100
101
|
faucet: FaucetAPI;
|
|
102
|
+
/** Public deposit-address registration (sweeper) API */
|
|
103
|
+
sweeper: SweeperAPI;
|
|
101
104
|
/** Public whitelist (waitlist) submission API */
|
|
102
105
|
whitelist: WhitelistAPI;
|
|
103
106
|
/** Profile operations API */
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sweeper Types
|
|
3
|
+
*
|
|
4
|
+
* Types for the public deposit-address registration endpoint. Wire shapes are
|
|
5
|
+
* snake_case; these are the camelCase ergonomic forms.
|
|
6
|
+
*
|
|
7
|
+
* NOTE: This endpoint is **public (unauthenticated)**. The deposit address is
|
|
8
|
+
* derived from the (application, user) pair and its destination is fixed in the
|
|
9
|
+
* contract's own bytecode, so a caller can only ever route funds to the user
|
|
10
|
+
* they already belong to. Abuse is bounded by a per-client rate limit and an
|
|
11
|
+
* active-application check instead of authentication.
|
|
12
|
+
*/
|
|
13
|
+
import type { BaseAPI } from "../api";
|
|
14
|
+
/**
|
|
15
|
+
* What happened to the registration.
|
|
16
|
+
*
|
|
17
|
+
* - `registered` — the pair was added; its deposit address is now monitored.
|
|
18
|
+
* - `already_registered` — the pair was known before this call; nothing was
|
|
19
|
+
* re-triggered.
|
|
20
|
+
*/
|
|
21
|
+
export type RegisterSweeperStatus = "registered" | "already_registered";
|
|
22
|
+
/** Body for a deposit-address registration. */
|
|
23
|
+
export interface RegisterSweeperRequest {
|
|
24
|
+
/**
|
|
25
|
+
* The application's client id — the same identifier rollup deposits carry
|
|
26
|
+
* and `login` takes. The deposit address is derived from these exact bytes
|
|
27
|
+
* and the application lookup is an exact string match, so the spelling must
|
|
28
|
+
* match the registered application precisely.
|
|
29
|
+
*/
|
|
30
|
+
clientId: string;
|
|
31
|
+
/** Address credited on the rollup, and half of the deposit-address derivation */
|
|
32
|
+
userAddress: string;
|
|
33
|
+
}
|
|
34
|
+
/** Result of a deposit-address registration. */
|
|
35
|
+
export interface RegisterSweeperResponse {
|
|
36
|
+
/** Whether this call added the pair or it was known before */
|
|
37
|
+
status: RegisterSweeperStatus;
|
|
38
|
+
/**
|
|
39
|
+
* The pair's deposit address. Stable, and valid to publish and fund before
|
|
40
|
+
* any contract exists there.
|
|
41
|
+
*/
|
|
42
|
+
sweeperAddress: string;
|
|
43
|
+
/**
|
|
44
|
+
* Whether the one-time registration balance check has completed. `false`
|
|
45
|
+
* right after a fresh registration; it runs in the background and flips
|
|
46
|
+
* once every pre-existing balance has been swept.
|
|
47
|
+
*/
|
|
48
|
+
initialSweepCheck: boolean;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Sweeper API interface. The register endpoint is public (no auth required).
|
|
52
|
+
*/
|
|
53
|
+
export interface SweeperAPI extends BaseAPI {
|
|
54
|
+
/**
|
|
55
|
+
* Registers an (application, user) pair so its deterministic deposit
|
|
56
|
+
* address is monitored and every ERC20 deposit is swept into the rollup
|
|
57
|
+
* automatically.
|
|
58
|
+
*
|
|
59
|
+
* Returns immediately with the derived deposit address; the one-time
|
|
60
|
+
* initial balance check runs in the background. Idempotent and safe to
|
|
61
|
+
* retry: re-registering answers `already_registered` with the same address
|
|
62
|
+
* and never re-triggers the initial check. An unknown client id — any
|
|
63
|
+
* respelling of a real one included, the lookup is exact — throws (404),
|
|
64
|
+
* and registrations are lightly rate-limited per client (429).
|
|
65
|
+
*/
|
|
66
|
+
register(body: RegisterSweeperRequest): Promise<RegisterSweeperResponse>;
|
|
67
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sweeper Types
|
|
3
|
+
*
|
|
4
|
+
* Types for the public deposit-address registration endpoint. Wire shapes are
|
|
5
|
+
* snake_case; these are the camelCase ergonomic forms.
|
|
6
|
+
*
|
|
7
|
+
* NOTE: This endpoint is **public (unauthenticated)**. The deposit address is
|
|
8
|
+
* derived from the (application, user) pair and its destination is fixed in the
|
|
9
|
+
* contract's own bytecode, so a caller can only ever route funds to the user
|
|
10
|
+
* they already belong to. Abuse is bounded by a per-client rate limit and an
|
|
11
|
+
* active-application check instead of authentication.
|
|
12
|
+
*/
|
package/dist/trading/index.d.ts
CHANGED
|
@@ -38,6 +38,12 @@ export interface TradingAPI extends BaseAPI {
|
|
|
38
38
|
positionSide?: PositionSide;
|
|
39
39
|
leverage?: string;
|
|
40
40
|
reduceOnly?: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* Maker-only: rejected with a 400 whose message contains
|
|
43
|
+
* `post-only order would cross` if this limit order would cross the
|
|
44
|
+
* book. LIMIT orders with GTC/GTD only; rejected together with IOC/FOK.
|
|
45
|
+
*/
|
|
46
|
+
postOnly?: boolean;
|
|
41
47
|
takeProfit?: ParentTpSlLegParams;
|
|
42
48
|
stopLoss?: ParentTpSlLegParams;
|
|
43
49
|
}): Promise<CreateOrderResponse>;
|
|
@@ -104,12 +110,14 @@ export interface TradingAPI extends BaseAPI {
|
|
|
104
110
|
* @param newOrder.price - New order price as string (optional)
|
|
105
111
|
* @param newOrder.quantity - New order quantity as string
|
|
106
112
|
* @param newOrder.useMasterBalance - Whether to use master balance (optional, defaults to false)
|
|
113
|
+
* @param newOrder.postOnly - Re-states post-only intent for the replacement (nothing is inherited from the original order)
|
|
107
114
|
* @returns Promise resolving to a `ReplaceOrderResponse`
|
|
108
115
|
*/
|
|
109
116
|
replaceOrder(orderId: string, newOrder: {
|
|
110
117
|
price?: string;
|
|
111
118
|
quantity?: string;
|
|
112
119
|
useMasterBalance?: boolean;
|
|
120
|
+
postOnly?: boolean;
|
|
113
121
|
}): Promise<ReplaceOrderResponse>;
|
|
114
122
|
/**
|
|
115
123
|
* Batch creates multiple orders in a single request.
|
|
@@ -356,6 +356,13 @@ export interface BatchCreateOrderParams {
|
|
|
356
356
|
leverage?: string;
|
|
357
357
|
/** Whether the order can only reduce existing exposure */
|
|
358
358
|
reduceOnly?: boolean;
|
|
359
|
+
/**
|
|
360
|
+
* Maker-only: rejected with a 400 whose message contains
|
|
361
|
+
* `post-only order would cross` if this limit order would cross the book.
|
|
362
|
+
* LIMIT orders with GTC/GTD only; rejected on MARKET orders and combined
|
|
363
|
+
* with IOC/FOK.
|
|
364
|
+
*/
|
|
365
|
+
postOnly?: boolean;
|
|
359
366
|
}
|
|
360
367
|
/**
|
|
361
368
|
* Parameters for a single order in a batch replace request
|
|
@@ -369,6 +376,11 @@ export interface BatchReplaceOrderParams {
|
|
|
369
376
|
quantity?: string;
|
|
370
377
|
/** For sub-accounts: use master's balance (optional) */
|
|
371
378
|
useMasterBalance?: boolean;
|
|
379
|
+
/**
|
|
380
|
+
* Re-states post-only intent for the replacement (optional). Nothing is
|
|
381
|
+
* inherited from the original order — see `TradingAPI.replaceOrder`.
|
|
382
|
+
*/
|
|
383
|
+
postOnly?: boolean;
|
|
372
384
|
}
|
|
373
385
|
export interface CancelConditionalOrderResponse {
|
|
374
386
|
conditionalOrderId: string;
|
|
@@ -119,6 +119,7 @@ export declare const PlaceLimitOrderSchema: z.ZodObject<{
|
|
|
119
119
|
}>>;
|
|
120
120
|
leverage: z.ZodOptional<z.ZodString>;
|
|
121
121
|
reduceOnly: z.ZodOptional<z.ZodBoolean>;
|
|
122
|
+
postOnly: z.ZodOptional<z.ZodBoolean>;
|
|
122
123
|
takeProfit: z.ZodOptional<z.ZodObject<{
|
|
123
124
|
triggerPrice: z.ZodString;
|
|
124
125
|
orderType: z.ZodEnum<{
|
|
@@ -230,6 +231,7 @@ export declare const ReplaceOrderSchema: z.ZodObject<{
|
|
|
230
231
|
price: z.ZodOptional<z.ZodString>;
|
|
231
232
|
quantity: z.ZodOptional<z.ZodString>;
|
|
232
233
|
useMasterBalance: z.ZodOptional<z.ZodBoolean>;
|
|
234
|
+
postOnly: z.ZodOptional<z.ZodBoolean>;
|
|
233
235
|
}, z.core.$strip>;
|
|
234
236
|
}, z.core.$strip>;
|
|
235
237
|
/**
|
|
@@ -356,6 +358,7 @@ export declare const BatchCreateOrderItemSchema: z.ZodObject<{
|
|
|
356
358
|
}>>;
|
|
357
359
|
leverage: z.ZodOptional<z.ZodString>;
|
|
358
360
|
reduceOnly: z.ZodOptional<z.ZodBoolean>;
|
|
361
|
+
postOnly: z.ZodOptional<z.ZodBoolean>;
|
|
359
362
|
}, z.core.$strip>;
|
|
360
363
|
/**
|
|
361
364
|
* Batch Create Orders validation schema
|
|
@@ -402,6 +405,7 @@ export declare const BatchCreateOrdersSchema: z.ZodObject<{
|
|
|
402
405
|
}>>;
|
|
403
406
|
leverage: z.ZodOptional<z.ZodString>;
|
|
404
407
|
reduceOnly: z.ZodOptional<z.ZodBoolean>;
|
|
408
|
+
postOnly: z.ZodOptional<z.ZodBoolean>;
|
|
405
409
|
}, z.core.$strip>>;
|
|
406
410
|
}, z.core.$strip>;
|
|
407
411
|
/**
|
|
@@ -415,6 +419,7 @@ export declare const BatchReplaceOrderItemSchema: z.ZodObject<{
|
|
|
415
419
|
price: z.ZodOptional<z.ZodString>;
|
|
416
420
|
quantity: z.ZodOptional<z.ZodString>;
|
|
417
421
|
useMasterBalance: z.ZodOptional<z.ZodBoolean>;
|
|
422
|
+
postOnly: z.ZodOptional<z.ZodBoolean>;
|
|
418
423
|
}, z.core.$strip>;
|
|
419
424
|
/**
|
|
420
425
|
* Batch Replace Orders validation schema
|
|
@@ -427,5 +432,6 @@ export declare const BatchReplaceOrdersSchema: z.ZodObject<{
|
|
|
427
432
|
price: z.ZodOptional<z.ZodString>;
|
|
428
433
|
quantity: z.ZodOptional<z.ZodString>;
|
|
429
434
|
useMasterBalance: z.ZodOptional<z.ZodBoolean>;
|
|
435
|
+
postOnly: z.ZodOptional<z.ZodBoolean>;
|
|
430
436
|
}, z.core.$strip>>;
|
|
431
437
|
}, z.core.$strip>;
|
|
@@ -128,6 +128,7 @@ export const PlaceLimitOrderSchema = z
|
|
|
128
128
|
positionSide: PositionSideSchema.optional(),
|
|
129
129
|
leverage: PositiveDecimalStringSchema.optional(),
|
|
130
130
|
reduceOnly: z.boolean().optional(),
|
|
131
|
+
postOnly: z.boolean().optional(),
|
|
131
132
|
takeProfit: ParentTpSlLegSchema.optional(),
|
|
132
133
|
stopLoss: ParentTpSlLegSchema.optional(),
|
|
133
134
|
})
|
|
@@ -180,6 +181,10 @@ export const PlaceLimitOrderSchema = z
|
|
|
180
181
|
.refine((data) => data.options?.riskBucketCollateral === undefined || data.options?.reduceOnly !== true, {
|
|
181
182
|
message: "reduceOnly orders cannot create a new risk bucket",
|
|
182
183
|
path: ["options", "reduceOnly"],
|
|
184
|
+
})
|
|
185
|
+
.refine((data) => data.options?.postOnly !== true || data.options?.timeInForce === undefined || (data.options.timeInForce !== "IOC" && data.options.timeInForce !== "FOK"), {
|
|
186
|
+
message: "postOnly cannot be combined with IOC/FOK time in force",
|
|
187
|
+
path: ["options", "timeInForce"],
|
|
183
188
|
});
|
|
184
189
|
/**
|
|
185
190
|
* Place Market Order validation schema
|
|
@@ -274,6 +279,10 @@ export const ReplaceOrderSchema = z.object({
|
|
|
274
279
|
price: PositiveDecimalStringSchema.optional(),
|
|
275
280
|
quantity: PositiveDecimalStringSchema.optional(),
|
|
276
281
|
useMasterBalance: z.boolean().optional(),
|
|
282
|
+
// No MARKET/IOC-FOK refine here: order type and time-in-force are not
|
|
283
|
+
// replaceable fields — the server validates postOnly against the
|
|
284
|
+
// persisted original order, which this client-side schema cannot see.
|
|
285
|
+
postOnly: z.boolean().optional(),
|
|
277
286
|
}),
|
|
278
287
|
});
|
|
279
288
|
/**
|
|
@@ -358,6 +367,7 @@ export const BatchCreateOrderItemSchema = z
|
|
|
358
367
|
positionSide: PositionSideSchema.optional(),
|
|
359
368
|
leverage: PositiveDecimalStringSchema.optional(),
|
|
360
369
|
reduceOnly: z.boolean().optional(),
|
|
370
|
+
postOnly: z.boolean().optional(),
|
|
361
371
|
})
|
|
362
372
|
.refine((data) => data.orderType !== "LIMIT" || data.price !== undefined, {
|
|
363
373
|
message: "Price is required for LIMIT orders",
|
|
@@ -370,6 +380,14 @@ export const BatchCreateOrderItemSchema = z
|
|
|
370
380
|
.refine((data) => data.orderType !== "MARKET" || data.timeInForce === undefined, {
|
|
371
381
|
message: "timeInForce must not be provided for MARKET orders",
|
|
372
382
|
path: ["timeInForce"],
|
|
383
|
+
})
|
|
384
|
+
.refine((data) => data.orderType !== "MARKET" || data.postOnly !== true, {
|
|
385
|
+
message: "postOnly must not be provided for MARKET orders",
|
|
386
|
+
path: ["postOnly"],
|
|
387
|
+
})
|
|
388
|
+
.refine((data) => data.postOnly !== true || data.timeInForce === undefined || (data.timeInForce !== "IOC" && data.timeInForce !== "FOK"), {
|
|
389
|
+
message: "postOnly cannot be combined with IOC/FOK time in force",
|
|
390
|
+
path: ["postOnly"],
|
|
373
391
|
})
|
|
374
392
|
.refine((data) => data.riskBucketCollateral === undefined || data.tradingMode === "MARGIN", {
|
|
375
393
|
message: "riskBucketCollateral is only supported for MARGIN orders",
|
|
@@ -431,6 +449,10 @@ export const BatchReplaceOrderItemSchema = z
|
|
|
431
449
|
price: PositiveDecimalStringSchema.optional(),
|
|
432
450
|
quantity: PositiveDecimalStringSchema.optional(),
|
|
433
451
|
useMasterBalance: z.boolean().optional(),
|
|
452
|
+
// No MARKET/IOC-FOK refine here: order type and time-in-force are not
|
|
453
|
+
// replaceable fields — the server validates postOnly against the
|
|
454
|
+
// persisted original order, which this client-side schema cannot see.
|
|
455
|
+
postOnly: z.boolean().optional(),
|
|
434
456
|
})
|
|
435
457
|
.refine((data) => data.price !== undefined || data.quantity !== undefined, {
|
|
436
458
|
message: "At least one of price or quantity must be provided",
|
|
@@ -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_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", "check_trader_code_availability", "clear_trader_code", "close_position", "create_challenge", "create_delegated_session", "create_order", "create_sub_account_limit", "delete_sub_account_limit", "get_application_config", "get_application_stats", "get_available_collateral", "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_sub_account_limits", "get_trade_by_id", "get_trader_code_info", "get_trades", "get_trading_pair_by_id", "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_conditional_orders", "list_delegated_agent_owners", "list_delegated_agents", "list_funding_history", "list_funding_payments", "list_margin_accounts", "list_pending_withdrawals", "list_position_history", "list_positions", "list_sub_accounts_with_balances", "list_trading_pairs", "mint_tokens", "reduce_position_margin", "refresh_session", "replace_order", "revoke_delegated_agent", "revoke_session", "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 ["add_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", "check_trader_code_availability", "clear_trader_code", "close_position", "create_challenge", "create_delegated_session", "create_order", "create_sub_account_limit", "delete_sub_account_limit", "get_application_config", "get_application_stats", "get_available_collateral", "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_sub_account_limits", "get_trade_by_id", "get_trader_code_info", "get_trades", "get_trading_pair_by_id", "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_conditional_orders", "list_delegated_agent_owners", "list_delegated_agents", "list_funding_history", "list_funding_payments", "list_margin_accounts", "list_pending_withdrawals", "list_position_history", "list_positions", "list_sub_accounts_with_balances", "list_trading_pairs", "mint_tokens", "reduce_position_margin", "refresh_session", "register_deposit_address", "replace_order", "revoke_delegated_agent", "revoke_session", "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
package/dist/wire/schema.d.ts
CHANGED
|
@@ -1973,6 +1973,44 @@ export interface paths {
|
|
|
1973
1973
|
patch?: never;
|
|
1974
1974
|
trace?: never;
|
|
1975
1975
|
};
|
|
1976
|
+
"/api/v1/sweeper/register": {
|
|
1977
|
+
parameters: {
|
|
1978
|
+
query?: never;
|
|
1979
|
+
header?: never;
|
|
1980
|
+
path?: never;
|
|
1981
|
+
cookie?: never;
|
|
1982
|
+
};
|
|
1983
|
+
get?: never;
|
|
1984
|
+
put?: never;
|
|
1985
|
+
/**
|
|
1986
|
+
* Register a deposit address for monitoring
|
|
1987
|
+
* @description Register a deposit address for monitoring.
|
|
1988
|
+
*
|
|
1989
|
+
* Every (application, user) pair has a deterministic deposit address. This
|
|
1990
|
+
* registers the pair so the sweeper service watches that address and
|
|
1991
|
+
* automatically forwards every ERC20 deposit into the rollup, crediting the
|
|
1992
|
+
* user under the application.
|
|
1993
|
+
*
|
|
1994
|
+
* Registration also runs a one-time initial check in the background: any
|
|
1995
|
+
* balance already sitting on the address is swept without waiting for a new
|
|
1996
|
+
* transfer. The response returns immediately with the derived address; it
|
|
1997
|
+
* does not wait for that check.
|
|
1998
|
+
*
|
|
1999
|
+
* Idempotent and safe to retry: re-registering an existing pair returns
|
|
2000
|
+
* `already_registered` with the same address and never re-triggers the
|
|
2001
|
+
* initial check.
|
|
2002
|
+
*
|
|
2003
|
+
* Lightly rate-limited per client, and the client id must name an existing
|
|
2004
|
+
* application — the lookup is an exact string match, which is what pins the
|
|
2005
|
+
* one spelling the deposit address is derived from.
|
|
2006
|
+
*/
|
|
2007
|
+
post: operations["register_deposit_address"];
|
|
2008
|
+
delete?: never;
|
|
2009
|
+
options?: never;
|
|
2010
|
+
head?: never;
|
|
2011
|
+
patch?: never;
|
|
2012
|
+
trace?: never;
|
|
2013
|
+
};
|
|
1976
2014
|
"/api/v1/trades/by-id/{tradeId}": {
|
|
1977
2015
|
parameters: {
|
|
1978
2016
|
query?: never;
|
|
@@ -2676,6 +2714,11 @@ export interface components {
|
|
|
2676
2714
|
* @enum {string|null}
|
|
2677
2715
|
*/
|
|
2678
2716
|
marginMode?: "ISOLATED" | "CROSS" | null;
|
|
2717
|
+
/**
|
|
2718
|
+
* @description Post-only: reject instead of matching if this limit order would cross the book (HTTP 400 / gRPC INVALID_ARGUMENT; the error message contains 'post-only order would cross'). LIMIT orders with GTC/GTD only; rejected on MARKET orders and IOC/FOK.
|
|
2719
|
+
* @example false
|
|
2720
|
+
*/
|
|
2721
|
+
postOnly?: boolean | null;
|
|
2679
2722
|
};
|
|
2680
2723
|
BatchCreateOrdersRequest: {
|
|
2681
2724
|
orders: components["schemas"]["BatchCreateOrderItem"][];
|
|
@@ -2745,6 +2788,11 @@ export interface components {
|
|
|
2745
2788
|
* @example false
|
|
2746
2789
|
*/
|
|
2747
2790
|
useMasterBalance?: boolean | null;
|
|
2791
|
+
/**
|
|
2792
|
+
* @description Post-only: reject instead of matching if this limit order would cross the book (HTTP 400 / gRPC INVALID_ARGUMENT; the error message contains 'post-only order would cross'). LIMIT orders with GTC/GTD only; rejected on MARKET orders and IOC/FOK.
|
|
2793
|
+
* @example false
|
|
2794
|
+
*/
|
|
2795
|
+
postOnly?: boolean | null;
|
|
2748
2796
|
};
|
|
2749
2797
|
BatchReplaceOrdersRequest: {
|
|
2750
2798
|
orders: components["schemas"]["BatchReplaceOrderItem"][];
|
|
@@ -3139,6 +3187,11 @@ export interface components {
|
|
|
3139
3187
|
* @enum {string|null}
|
|
3140
3188
|
*/
|
|
3141
3189
|
marginMode?: "ISOLATED" | "CROSS" | null;
|
|
3190
|
+
/**
|
|
3191
|
+
* @description Post-only: reject instead of matching if this limit order would cross the book (HTTP 400 / gRPC INVALID_ARGUMENT; the error message contains 'post-only order would cross'). LIMIT orders with GTC/GTD only; rejected on MARKET orders and IOC/FOK.
|
|
3192
|
+
* @example false
|
|
3193
|
+
*/
|
|
3194
|
+
postOnly?: boolean | null;
|
|
3142
3195
|
};
|
|
3143
3196
|
CreateOrderResponse: {
|
|
3144
3197
|
/**
|
|
@@ -5832,12 +5885,42 @@ export interface components {
|
|
|
5832
5885
|
*/
|
|
5833
5886
|
expiresAt?: number | null;
|
|
5834
5887
|
};
|
|
5888
|
+
RegisterRequest: {
|
|
5889
|
+
/**
|
|
5890
|
+
* @description The application's client id — the same identifier rollup deposits carry and `login` takes. The deposit address is derived from these exact bytes and the application lookup is an exact string match, so the spelling must match the registered application precisely.
|
|
5891
|
+
* @example 60eb377aab9f4ea18dcdf4747204c792
|
|
5892
|
+
*/
|
|
5893
|
+
clientId: string;
|
|
5894
|
+
/**
|
|
5895
|
+
* @description Address credited on the rollup, and half of the deposit address derivation
|
|
5896
|
+
* @example 0x742d35Cc6634C0532925a3b8D4060f31E2C3d8B5
|
|
5897
|
+
*/
|
|
5898
|
+
userAddress: string;
|
|
5899
|
+
};
|
|
5900
|
+
RegisterResponse: {
|
|
5901
|
+
/**
|
|
5902
|
+
* @description `registered` when the pair was added, `already_registered` when it was known before this call
|
|
5903
|
+
* @example registered
|
|
5904
|
+
* @enum {string|null}
|
|
5905
|
+
*/
|
|
5906
|
+
status?: "registered" | "already_registered" | null;
|
|
5907
|
+
/**
|
|
5908
|
+
* @description The pair's deposit address. Stable, and valid to publish and fund before any contract exists there.
|
|
5909
|
+
* @example 0xcf1eF339798914EF7Ee4984Ed45BD141D63a65C9
|
|
5910
|
+
*/
|
|
5911
|
+
sweeperAddress?: string | null;
|
|
5912
|
+
/**
|
|
5913
|
+
* @description Whether the one-time registration balance check has completed. `false` right after a fresh registration; it runs in the background and flips once every pre-existing balance has been swept.
|
|
5914
|
+
* @example false
|
|
5915
|
+
*/
|
|
5916
|
+
initialSweepCheck?: boolean | null;
|
|
5917
|
+
};
|
|
5835
5918
|
ReplaceOrderRequest: {
|
|
5836
5919
|
/**
|
|
5837
|
-
* @description
|
|
5920
|
+
* @description Post-only: reject instead of matching if this limit order would cross the book (HTTP 400 / gRPC INVALID_ARGUMENT; the error message contains 'post-only order would cross'). LIMIT orders with GTC/GTD only; rejected on MARKET orders and IOC/FOK.
|
|
5838
5921
|
* @example false
|
|
5839
5922
|
*/
|
|
5840
|
-
|
|
5923
|
+
postOnly?: boolean | null;
|
|
5841
5924
|
/**
|
|
5842
5925
|
* @description New limit price (if changing)
|
|
5843
5926
|
* @example 35500.00
|
|
@@ -5848,6 +5931,11 @@ export interface components {
|
|
|
5848
5931
|
* @example 0.7
|
|
5849
5932
|
*/
|
|
5850
5933
|
quantity?: string | null;
|
|
5934
|
+
/**
|
|
5935
|
+
* @description Use master account balance for sub-account orders
|
|
5936
|
+
* @example false
|
|
5937
|
+
*/
|
|
5938
|
+
useMasterBalance?: boolean | null;
|
|
5851
5939
|
};
|
|
5852
5940
|
ReplaceOrderResponse: {
|
|
5853
5941
|
/**
|
|
@@ -6530,6 +6618,16 @@ export interface components {
|
|
|
6530
6618
|
* @example 0.00001
|
|
6531
6619
|
*/
|
|
6532
6620
|
quantityStepSize?: string | null;
|
|
6621
|
+
/**
|
|
6622
|
+
* @description Human-readable base asset display name, from the asset registry. Lets clients match markets by company or asset name, e.g. a search for Robinhood finds HOOD
|
|
6623
|
+
* @example Robinhood Markets
|
|
6624
|
+
*/
|
|
6625
|
+
baseAssetName?: string | null;
|
|
6626
|
+
/**
|
|
6627
|
+
* @description Human-readable quote asset display name, from the asset registry
|
|
6628
|
+
* @example USDC
|
|
6629
|
+
*/
|
|
6630
|
+
quoteAssetName?: string | null;
|
|
6533
6631
|
};
|
|
6534
6632
|
TransferCollateralFromMarginAccountRequest: {
|
|
6535
6633
|
/** @description Parent margin account UUID that releases collateral. */
|
|
@@ -10861,6 +10959,65 @@ export interface operations {
|
|
|
10861
10959
|
};
|
|
10862
10960
|
};
|
|
10863
10961
|
};
|
|
10962
|
+
register_deposit_address: {
|
|
10963
|
+
parameters: {
|
|
10964
|
+
query?: never;
|
|
10965
|
+
header?: never;
|
|
10966
|
+
path?: never;
|
|
10967
|
+
cookie?: never;
|
|
10968
|
+
};
|
|
10969
|
+
requestBody: {
|
|
10970
|
+
content: {
|
|
10971
|
+
"application/json": components["schemas"]["RegisterRequest"];
|
|
10972
|
+
};
|
|
10973
|
+
};
|
|
10974
|
+
responses: {
|
|
10975
|
+
/** @description OK */
|
|
10976
|
+
200: {
|
|
10977
|
+
headers: {
|
|
10978
|
+
[name: string]: unknown;
|
|
10979
|
+
};
|
|
10980
|
+
content: {
|
|
10981
|
+
"application/json": components["schemas"]["RegisterResponse"];
|
|
10982
|
+
};
|
|
10983
|
+
};
|
|
10984
|
+
/** @description Invalid request parameters */
|
|
10985
|
+
400: {
|
|
10986
|
+
headers: {
|
|
10987
|
+
[name: string]: unknown;
|
|
10988
|
+
};
|
|
10989
|
+
content?: never;
|
|
10990
|
+
};
|
|
10991
|
+
/** @description Application not found */
|
|
10992
|
+
404: {
|
|
10993
|
+
headers: {
|
|
10994
|
+
[name: string]: unknown;
|
|
10995
|
+
};
|
|
10996
|
+
content?: never;
|
|
10997
|
+
};
|
|
10998
|
+
/** @description Registration rate-limit exceeded */
|
|
10999
|
+
429: {
|
|
11000
|
+
headers: {
|
|
11001
|
+
[name: string]: unknown;
|
|
11002
|
+
};
|
|
11003
|
+
content?: never;
|
|
11004
|
+
};
|
|
11005
|
+
/** @description Internal server error */
|
|
11006
|
+
500: {
|
|
11007
|
+
headers: {
|
|
11008
|
+
[name: string]: unknown;
|
|
11009
|
+
};
|
|
11010
|
+
content?: never;
|
|
11011
|
+
};
|
|
11012
|
+
/** @description Sweeper unavailable (not configured or resolver down); nothing was registered, safe to retry */
|
|
11013
|
+
503: {
|
|
11014
|
+
headers: {
|
|
11015
|
+
[name: string]: unknown;
|
|
11016
|
+
};
|
|
11017
|
+
content?: never;
|
|
11018
|
+
};
|
|
11019
|
+
};
|
|
11020
|
+
};
|
|
10864
11021
|
get_trade_by_id: {
|
|
10865
11022
|
parameters: {
|
|
10866
11023
|
query?: never;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@0xmonaco/types",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.37",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"lint": "biome lint ."
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@0xmonaco/contracts": "1.0.
|
|
23
|
+
"@0xmonaco/contracts": "1.0.37",
|
|
24
24
|
"zod": "^4.1.12"
|
|
25
25
|
},
|
|
26
26
|
"peerDependencies": {
|