@0xmonaco/types 1.0.34 → 1.0.36
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/wire/operations.d.ts +1 -1
- package/dist/wire/operations.js +1 -0
- package/dist/wire/schema.d.ts +137 -0
- 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
|
+
*/
|
|
@@ -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;
|
|
@@ -5832,6 +5870,36 @@ export interface components {
|
|
|
5832
5870
|
*/
|
|
5833
5871
|
expiresAt?: number | null;
|
|
5834
5872
|
};
|
|
5873
|
+
RegisterRequest: {
|
|
5874
|
+
/**
|
|
5875
|
+
* @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.
|
|
5876
|
+
* @example 60eb377aab9f4ea18dcdf4747204c792
|
|
5877
|
+
*/
|
|
5878
|
+
clientId: string;
|
|
5879
|
+
/**
|
|
5880
|
+
* @description Address credited on the rollup, and half of the deposit address derivation
|
|
5881
|
+
* @example 0x742d35Cc6634C0532925a3b8D4060f31E2C3d8B5
|
|
5882
|
+
*/
|
|
5883
|
+
userAddress: string;
|
|
5884
|
+
};
|
|
5885
|
+
RegisterResponse: {
|
|
5886
|
+
/**
|
|
5887
|
+
* @description `registered` when the pair was added, `already_registered` when it was known before this call
|
|
5888
|
+
* @example registered
|
|
5889
|
+
* @enum {string|null}
|
|
5890
|
+
*/
|
|
5891
|
+
status?: "registered" | "already_registered" | null;
|
|
5892
|
+
/**
|
|
5893
|
+
* @description The pair's deposit address. Stable, and valid to publish and fund before any contract exists there.
|
|
5894
|
+
* @example 0xcf1eF339798914EF7Ee4984Ed45BD141D63a65C9
|
|
5895
|
+
*/
|
|
5896
|
+
sweeperAddress?: string | null;
|
|
5897
|
+
/**
|
|
5898
|
+
* @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.
|
|
5899
|
+
* @example false
|
|
5900
|
+
*/
|
|
5901
|
+
initialSweepCheck?: boolean | null;
|
|
5902
|
+
};
|
|
5835
5903
|
ReplaceOrderRequest: {
|
|
5836
5904
|
/**
|
|
5837
5905
|
* @description Use master account balance for sub-account orders
|
|
@@ -6530,6 +6598,16 @@ export interface components {
|
|
|
6530
6598
|
* @example 0.00001
|
|
6531
6599
|
*/
|
|
6532
6600
|
quantityStepSize?: string | null;
|
|
6601
|
+
/**
|
|
6602
|
+
* @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
|
|
6603
|
+
* @example Robinhood Markets
|
|
6604
|
+
*/
|
|
6605
|
+
baseAssetName?: string | null;
|
|
6606
|
+
/**
|
|
6607
|
+
* @description Human-readable quote asset display name, from the asset registry
|
|
6608
|
+
* @example USDC
|
|
6609
|
+
*/
|
|
6610
|
+
quoteAssetName?: string | null;
|
|
6533
6611
|
};
|
|
6534
6612
|
TransferCollateralFromMarginAccountRequest: {
|
|
6535
6613
|
/** @description Parent margin account UUID that releases collateral. */
|
|
@@ -10861,6 +10939,65 @@ export interface operations {
|
|
|
10861
10939
|
};
|
|
10862
10940
|
};
|
|
10863
10941
|
};
|
|
10942
|
+
register_deposit_address: {
|
|
10943
|
+
parameters: {
|
|
10944
|
+
query?: never;
|
|
10945
|
+
header?: never;
|
|
10946
|
+
path?: never;
|
|
10947
|
+
cookie?: never;
|
|
10948
|
+
};
|
|
10949
|
+
requestBody: {
|
|
10950
|
+
content: {
|
|
10951
|
+
"application/json": components["schemas"]["RegisterRequest"];
|
|
10952
|
+
};
|
|
10953
|
+
};
|
|
10954
|
+
responses: {
|
|
10955
|
+
/** @description OK */
|
|
10956
|
+
200: {
|
|
10957
|
+
headers: {
|
|
10958
|
+
[name: string]: unknown;
|
|
10959
|
+
};
|
|
10960
|
+
content: {
|
|
10961
|
+
"application/json": components["schemas"]["RegisterResponse"];
|
|
10962
|
+
};
|
|
10963
|
+
};
|
|
10964
|
+
/** @description Invalid request parameters */
|
|
10965
|
+
400: {
|
|
10966
|
+
headers: {
|
|
10967
|
+
[name: string]: unknown;
|
|
10968
|
+
};
|
|
10969
|
+
content?: never;
|
|
10970
|
+
};
|
|
10971
|
+
/** @description Application not found */
|
|
10972
|
+
404: {
|
|
10973
|
+
headers: {
|
|
10974
|
+
[name: string]: unknown;
|
|
10975
|
+
};
|
|
10976
|
+
content?: never;
|
|
10977
|
+
};
|
|
10978
|
+
/** @description Registration rate-limit exceeded */
|
|
10979
|
+
429: {
|
|
10980
|
+
headers: {
|
|
10981
|
+
[name: string]: unknown;
|
|
10982
|
+
};
|
|
10983
|
+
content?: never;
|
|
10984
|
+
};
|
|
10985
|
+
/** @description Internal server error */
|
|
10986
|
+
500: {
|
|
10987
|
+
headers: {
|
|
10988
|
+
[name: string]: unknown;
|
|
10989
|
+
};
|
|
10990
|
+
content?: never;
|
|
10991
|
+
};
|
|
10992
|
+
/** @description Sweeper unavailable (not configured or resolver down); nothing was registered, safe to retry */
|
|
10993
|
+
503: {
|
|
10994
|
+
headers: {
|
|
10995
|
+
[name: string]: unknown;
|
|
10996
|
+
};
|
|
10997
|
+
content?: never;
|
|
10998
|
+
};
|
|
10999
|
+
};
|
|
11000
|
+
};
|
|
10864
11001
|
get_trade_by_id: {
|
|
10865
11002
|
parameters: {
|
|
10866
11003
|
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.36",
|
|
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.36",
|
|
24
24
|
"zod": "^4.1.12"
|
|
25
25
|
},
|
|
26
26
|
"peerDependencies": {
|