@0xmonaco/types 1.0.91 → 1.0.93
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/README.md +4 -4
- package/dist/auth/index.d.ts +14 -0
- package/dist/auth/index.js +13 -0
- package/dist/compliance/index.d.ts +32 -0
- package/dist/compliance/index.js +10 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/sdk/index.d.ts +3 -3
- package/dist/websocket/base.d.ts +5 -2
- package/dist/websocket/events/movement-events.d.ts +13 -3
- package/dist/wire/operations.d.ts +1 -1
- package/dist/wire/operations.js +1 -1
- package/dist/wire/schema.d.ts +66 -109
- package/package.json +2 -2
- package/dist/whitelist/index.d.ts +0 -33
- package/dist/whitelist/index.js +0 -4
package/README.md
CHANGED
|
@@ -22,7 +22,7 @@ import { MonacoSDK, SDKConfig } from "@0xmonaco/types";
|
|
|
22
22
|
// SDK configuration
|
|
23
23
|
interface SDKConfig {
|
|
24
24
|
walletClient?: WalletClient; // Wallet client for signing operations
|
|
25
|
-
network: Network; // Use "
|
|
25
|
+
network: Network; // Use "mainnet" (Sei mainnet, production API)
|
|
26
26
|
seiRpcUrl: string; // RPC URL for Sei blockchain interactions
|
|
27
27
|
}
|
|
28
28
|
|
|
@@ -305,7 +305,7 @@ Types for network configuration:
|
|
|
305
305
|
```typescript
|
|
306
306
|
import { Network, NetworkEndpoints } from "@0xmonaco/types";
|
|
307
307
|
|
|
308
|
-
const publicNetwork: Network = "
|
|
308
|
+
const publicNetwork: Network = "mainnet";
|
|
309
309
|
|
|
310
310
|
interface NetworkEndpoints {
|
|
311
311
|
rpcUrl: string;
|
|
@@ -313,7 +313,7 @@ interface NetworkEndpoints {
|
|
|
313
313
|
}
|
|
314
314
|
```
|
|
315
315
|
|
|
316
|
-
For public integrations, use `"
|
|
316
|
+
For public integrations, use `"mainnet"`.
|
|
317
317
|
|
|
318
318
|
## Type Reference
|
|
319
319
|
|
|
@@ -321,7 +321,7 @@ For public integrations, use `"staging"` or `"mainnet"`.
|
|
|
321
321
|
|
|
322
322
|
- `MonacoSDK`: Main SDK interface with all API modules
|
|
323
323
|
- `SDKConfig`: Configuration options for the Monaco SDK
|
|
324
|
-
- `Network`: SDK network preset type. Public integrations should use `"
|
|
324
|
+
- `Network`: SDK network preset type. Public integrations should use `"mainnet"`.
|
|
325
325
|
- `AuthState`: Authentication state information
|
|
326
326
|
|
|
327
327
|
### Vault Types
|
package/dist/auth/index.d.ts
CHANGED
|
@@ -164,3 +164,17 @@ export declare const INVITE_ERROR_CODES: {
|
|
|
164
164
|
readonly INVITE_CODE_INVALID: "INVITE_CODE_INVALID";
|
|
165
165
|
};
|
|
166
166
|
export type InviteErrorCode = (typeof INVITE_ERROR_CODES)[keyof typeof INVITE_ERROR_CODES];
|
|
167
|
+
/**
|
|
168
|
+
* Stable codes for a wallet on the OFAC sanctions list, read from
|
|
169
|
+
* `APIError.serverCode` (REST error envelope `code`, which here is also the
|
|
170
|
+
* envelope `error`; gRPC `google.rpc.ErrorInfo` reason in the
|
|
171
|
+
* `auth.0xmonaco.com` domain). Both are HTTP 403 / gRPC `PERMISSION_DENIED`,
|
|
172
|
+
* and the envelope `message` is meant to be shown to the user as-is.
|
|
173
|
+
*/
|
|
174
|
+
export declare const SANCTIONS_ERROR_CODES: {
|
|
175
|
+
/** Sign-in with a listed wallet, or a withdrawal to a listed destination. */
|
|
176
|
+
readonly ADDRESS_RESTRICTED: "ADDRESS_RESTRICTED";
|
|
177
|
+
/** A live session whose wallet (or delegated agent) is listed; returned on every signed request and on WebSocket authentication/revalidation. */
|
|
178
|
+
readonly ACCOUNT_RESTRICTED: "ACCOUNT_RESTRICTED";
|
|
179
|
+
};
|
|
180
|
+
export type SanctionsErrorCode = (typeof SANCTIONS_ERROR_CODES)[keyof typeof SANCTIONS_ERROR_CODES];
|
package/dist/auth/index.js
CHANGED
|
@@ -20,3 +20,16 @@ export const INVITE_ERROR_CODES = {
|
|
|
20
20
|
/** The invite code was not accepted (wrong, already redeemed, revoked, or issued by a deactivated wallet; deliberately indistinguishable). */
|
|
21
21
|
INVITE_CODE_INVALID: "INVITE_CODE_INVALID",
|
|
22
22
|
};
|
|
23
|
+
/**
|
|
24
|
+
* Stable codes for a wallet on the OFAC sanctions list, read from
|
|
25
|
+
* `APIError.serverCode` (REST error envelope `code`, which here is also the
|
|
26
|
+
* envelope `error`; gRPC `google.rpc.ErrorInfo` reason in the
|
|
27
|
+
* `auth.0xmonaco.com` domain). Both are HTTP 403 / gRPC `PERMISSION_DENIED`,
|
|
28
|
+
* and the envelope `message` is meant to be shown to the user as-is.
|
|
29
|
+
*/
|
|
30
|
+
export const SANCTIONS_ERROR_CODES = {
|
|
31
|
+
/** Sign-in with a listed wallet, or a withdrawal to a listed destination. */
|
|
32
|
+
ADDRESS_RESTRICTED: "ADDRESS_RESTRICTED",
|
|
33
|
+
/** A live session whose wallet (or delegated agent) is listed; returned on every signed request and on WebSocket authentication/revalidation. */
|
|
34
|
+
ACCOUNT_RESTRICTED: "ACCOUNT_RESTRICTED",
|
|
35
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Compliance Types
|
|
3
|
+
*
|
|
4
|
+
* Types for the public region status endpoint. Monaco refuses callers from a
|
|
5
|
+
* restricted jurisdiction on every other endpoint with HTTP 451 and the error
|
|
6
|
+
* code `REGION_RESTRICTED`; this endpoint answers from every region so a
|
|
7
|
+
* frontend can show a region notice instead.
|
|
8
|
+
*
|
|
9
|
+
* NOTE: This endpoint is **public (unauthenticated)**.
|
|
10
|
+
*/
|
|
11
|
+
import type { BaseAPI } from "../api";
|
|
12
|
+
/** The caller's region status. */
|
|
13
|
+
export interface GetRegionStatusResponse {
|
|
14
|
+
/** True when Monaco is not available in the caller's region. */
|
|
15
|
+
restricted: boolean;
|
|
16
|
+
/** ISO 3166-1 alpha-2 country code (`T1` Tor, `XX` unknown); empty when the request carried no location. */
|
|
17
|
+
country: string;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Compliance API interface. The endpoint is public (no auth required).
|
|
21
|
+
*/
|
|
22
|
+
export interface ComplianceAPI extends BaseAPI {
|
|
23
|
+
/**
|
|
24
|
+
* Get the caller's region status.
|
|
25
|
+
*
|
|
26
|
+
* Public/unauthenticated and always answers 200, including from restricted
|
|
27
|
+
* regions.
|
|
28
|
+
*
|
|
29
|
+
* @returns Promise resolving to the caller's region status
|
|
30
|
+
*/
|
|
31
|
+
getRegionStatus(): Promise<GetRegionStatusResponse>;
|
|
32
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Compliance Types
|
|
3
|
+
*
|
|
4
|
+
* Types for the public region status endpoint. Monaco refuses callers from a
|
|
5
|
+
* restricted jurisdiction on every other endpoint with HTTP 451 and the error
|
|
6
|
+
* code `REGION_RESTRICTED`; this endpoint answers from every region so a
|
|
7
|
+
* frontend can show a region notice instead.
|
|
8
|
+
*
|
|
9
|
+
* NOTE: This endpoint is **public (unauthenticated)**.
|
|
10
|
+
*/
|
package/dist/index.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ export * from "./api";
|
|
|
8
8
|
export * from "./applications";
|
|
9
9
|
export * from "./auth";
|
|
10
10
|
export * from "./buildercodes";
|
|
11
|
+
export * from "./compliance";
|
|
11
12
|
export * from "./contracts";
|
|
12
13
|
export * from "./copy-trading";
|
|
13
14
|
export * from "./delegated-agents";
|
|
@@ -28,5 +29,4 @@ export * from "./trading";
|
|
|
28
29
|
export * from "./validation";
|
|
29
30
|
export * from "./vault";
|
|
30
31
|
export * from "./websocket";
|
|
31
|
-
export * from "./whitelist";
|
|
32
32
|
export * from "./withdrawals";
|
package/dist/index.js
CHANGED
|
@@ -9,6 +9,7 @@ export * from "./api";
|
|
|
9
9
|
export * from "./applications";
|
|
10
10
|
export * from "./auth";
|
|
11
11
|
export * from "./buildercodes";
|
|
12
|
+
export * from "./compliance";
|
|
12
13
|
export * from "./contracts";
|
|
13
14
|
export * from "./copy-trading";
|
|
14
15
|
export * from "./delegated-agents";
|
|
@@ -29,5 +30,4 @@ export * from "./trading";
|
|
|
29
30
|
export * from "./validation";
|
|
30
31
|
export * from "./vault";
|
|
31
32
|
export * from "./websocket";
|
|
32
|
-
export * from "./whitelist";
|
|
33
33
|
export * from "./withdrawals";
|
package/dist/sdk/index.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import type { Address, PublicClient, TransactionReceipt, WalletClient } from "vi
|
|
|
2
2
|
import type { ApplicationsAPI } from "../applications";
|
|
3
3
|
import type { AuthAPI, AuthState } from "../auth/index";
|
|
4
4
|
import type { BuildercodesAPI } from "../buildercodes";
|
|
5
|
+
import type { ComplianceAPI } from "../compliance";
|
|
5
6
|
import type { CopyTradingAPI } from "../copy-trading";
|
|
6
7
|
import type { DelegatedAgentsAPI } from "../delegated-agents";
|
|
7
8
|
import type { FaucetAPI } from "../faucet";
|
|
@@ -19,7 +20,6 @@ import type { TraderCodesAPI } from "../tradercodes";
|
|
|
19
20
|
import type { TradingAPI, TradingMode } from "../trading";
|
|
20
21
|
import type { VaultAPI } from "../vault";
|
|
21
22
|
import type { MonacoWebSocket, MonacoWebSocketConfig, OrderbookEvent, OrderbookQuotationMode, TradeEvent } from "../websocket";
|
|
22
|
-
import type { WhitelistAPI } from "../whitelist";
|
|
23
23
|
import type { WithdrawalsAPI } from "../withdrawals";
|
|
24
24
|
import type { Network } from "./network";
|
|
25
25
|
/** REST signing migration selector. WebSocket and gRPC authentication are unchanged. */
|
|
@@ -124,12 +124,12 @@ export interface MonacoSDK {
|
|
|
124
124
|
/** Deposit-address registration (sweeper) API; requires a session */
|
|
125
125
|
sweeper: SweeperAPI;
|
|
126
126
|
managedMarkets: ManagedMarketsAPI;
|
|
127
|
-
/** @deprecated Public whitelist applications are closed; submissions return HTTP 403. */
|
|
128
|
-
whitelist: WhitelistAPI;
|
|
129
127
|
/** Profile operations API */
|
|
130
128
|
profile: ProfileAPI;
|
|
131
129
|
/** Public market-pulse news feed API (cached, hourly-refreshed) */
|
|
132
130
|
pulse: PulseAPI;
|
|
131
|
+
/** Public region status API: whether Monaco is available in the caller's region */
|
|
132
|
+
compliance: ComplianceAPI;
|
|
133
133
|
/** Orderbook REST API for fetching orderbook snapshots */
|
|
134
134
|
orderbook: {
|
|
135
135
|
getOrderbook: (tradingPairId: string, options?: {
|
package/dist/websocket/base.d.ts
CHANGED
|
@@ -106,6 +106,8 @@ export type WebSocketErrorCode =
|
|
|
106
106
|
| "AUTH_FAILED"
|
|
107
107
|
/** The account is deactivated; the connection closes and must not automatically reconnect. */
|
|
108
108
|
| "ACCOUNT_DEACTIVATED"
|
|
109
|
+
/** The session's wallet is on the OFAC sanctions list; the connection closes and must not automatically reconnect. */
|
|
110
|
+
| "ACCOUNT_RESTRICTED"
|
|
109
111
|
/** The per-user concurrent-connection cap was reached; this connection is closed after the frame. */
|
|
110
112
|
| "CONNECTION_LIMIT"
|
|
111
113
|
/** The per-connection subscription-cardinality cap was reached. */
|
|
@@ -170,9 +172,10 @@ export interface WebSocketReauthenticationInfo {
|
|
|
170
172
|
/**
|
|
171
173
|
* The `Error` frame code that ended the connection: `SESSION_INVALID` (the
|
|
172
174
|
* session was revoked or expired after the handshake) or `AUTH_FAILED` (the
|
|
173
|
-
* `Authenticate` handshake itself was rejected),
|
|
175
|
+
* `Authenticate` handshake itself was rejected), `ACCOUNT_DEACTIVATED`, or
|
|
176
|
+
* `ACCOUNT_RESTRICTED` (the wallet is on the OFAC sanctions list).
|
|
174
177
|
*/
|
|
175
|
-
code: "SESSION_INVALID" | "AUTH_FAILED" | "ACCOUNT_DEACTIVATED";
|
|
178
|
+
code: "SESSION_INVALID" | "AUTH_FAILED" | "ACCOUNT_DEACTIVATED" | "ACCOUNT_RESTRICTED";
|
|
176
179
|
/** Human-readable description from the `Error` frame; for logging and display, never for branching. */
|
|
177
180
|
message: string;
|
|
178
181
|
/** WebSocket close code of the connection that was lost (1008 for `SESSION_INVALID`). */
|
|
@@ -9,12 +9,22 @@ import type { Address } from "viem";
|
|
|
9
9
|
* User movement event data containing ledger entry details
|
|
10
10
|
*/
|
|
11
11
|
export interface UserMovementEventData {
|
|
12
|
-
/**
|
|
12
|
+
/**
|
|
13
|
+
* Unique movement identifier (UUID). A funding movement and a spot order's
|
|
14
|
+
* released lock carry the id of their movement-history row.
|
|
15
|
+
*/
|
|
13
16
|
id: string;
|
|
14
|
-
/**
|
|
17
|
+
/**
|
|
18
|
+
* Entry type (e.g., "credit", "debit"). A spot order's released lock is
|
|
19
|
+
* "UNLOCK", upper-case like its movement-history row, so compare
|
|
20
|
+
* case-insensitively.
|
|
21
|
+
*/
|
|
15
22
|
entryType: string;
|
|
16
23
|
/**
|
|
17
24
|
* Transaction type (e.g., "deposit", "withdrawal", "trade", "funding").
|
|
25
|
+
* A spot order's released lock is "TRADE", and its reason
|
|
26
|
+
* (`OrderCancelled`, `OrderPartiallyCancelled`, `OrderExpired`) starts
|
|
27
|
+
* `description`.
|
|
18
28
|
* A `funding` movement records a funding payment already settled against
|
|
19
29
|
* margin collateral; it reconciles with the matching `balance_update` event
|
|
20
30
|
* whose `reason` is `funding`.
|
|
@@ -58,7 +68,7 @@ export interface UserMovementEventData {
|
|
|
58
68
|
lockedAfterRaw?: string;
|
|
59
69
|
/** Reference ID for related entity (UUID) */
|
|
60
70
|
referenceId?: string;
|
|
61
|
-
/** Reference type (e.g., "order
|
|
71
|
+
/** Reference type (e.g., "Order" on a spot order's released lock, "deposit") */
|
|
62
72
|
referenceType?: string;
|
|
63
73
|
/** Human-readable description */
|
|
64
74
|
description?: string;
|
|
@@ -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_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", "
|
|
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_region_status", "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", "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
|
@@ -82,6 +82,7 @@ export const OPERATION_IDS = [
|
|
|
82
82
|
"get_position_pnl_history",
|
|
83
83
|
"get_position_risk",
|
|
84
84
|
"get_pulse",
|
|
85
|
+
"get_region_status",
|
|
85
86
|
"get_rewards_balance",
|
|
86
87
|
"get_screener",
|
|
87
88
|
"get_self_trade_prevention_default",
|
|
@@ -151,7 +152,6 @@ export const OPERATION_IDS = [
|
|
|
151
152
|
"simulate_parent_margin_order_risk",
|
|
152
153
|
"simulate_risk_bucket_order_risk",
|
|
153
154
|
"stop_follow",
|
|
154
|
-
"submit_whitelist",
|
|
155
155
|
"transfer_collateral",
|
|
156
156
|
"transfer_collateral_from_margin_account",
|
|
157
157
|
"transfer_collateral_from_parent_margin_account",
|
package/dist/wire/schema.d.ts
CHANGED
|
@@ -968,6 +968,37 @@ export interface paths {
|
|
|
968
968
|
patch?: never;
|
|
969
969
|
trace?: never;
|
|
970
970
|
};
|
|
971
|
+
"/api/v1/compliance/region": {
|
|
972
|
+
parameters: {
|
|
973
|
+
query?: never;
|
|
974
|
+
header?: never;
|
|
975
|
+
path?: never;
|
|
976
|
+
cookie?: never;
|
|
977
|
+
};
|
|
978
|
+
/**
|
|
979
|
+
* Get the caller's region status
|
|
980
|
+
* @description Get the caller's region status.
|
|
981
|
+
*
|
|
982
|
+
* Reports whether Monaco is available in the caller's region, so a
|
|
983
|
+
* frontend can show a region notice instead of failing on the next call.
|
|
984
|
+
* Public endpoint — no authentication required — and always answers 200.
|
|
985
|
+
* Over REST it answers from restricted regions too: GET on this path is
|
|
986
|
+
* the one request the production edge lets through. Over gRPC the edge
|
|
987
|
+
* refuses a restricted caller with HTTP 451 before it reaches this RPC,
|
|
988
|
+
* so clients that need the notice should call the REST endpoint. Every
|
|
989
|
+
* other endpoint refuses callers from a restricted region with 451
|
|
990
|
+
* REGION_RESTRICTED (gRPC: PERMISSION_DENIED with a google.rpc.ErrorInfo
|
|
991
|
+
* reason REGION_RESTRICTED).
|
|
992
|
+
*/
|
|
993
|
+
get: operations["get_region_status"];
|
|
994
|
+
put?: never;
|
|
995
|
+
post?: never;
|
|
996
|
+
delete?: never;
|
|
997
|
+
options?: never;
|
|
998
|
+
head?: never;
|
|
999
|
+
patch?: never;
|
|
1000
|
+
trace?: never;
|
|
1001
|
+
};
|
|
971
1002
|
"/api/v1/copy-trading/follows": {
|
|
972
1003
|
parameters: {
|
|
973
1004
|
query?: never;
|
|
@@ -3484,31 +3515,6 @@ export interface paths {
|
|
|
3484
3515
|
patch?: never;
|
|
3485
3516
|
trace?: never;
|
|
3486
3517
|
};
|
|
3487
|
-
"/api/v1/whitelist": {
|
|
3488
|
-
parameters: {
|
|
3489
|
-
query?: never;
|
|
3490
|
-
header?: never;
|
|
3491
|
-
path?: never;
|
|
3492
|
-
cookie?: never;
|
|
3493
|
-
};
|
|
3494
|
-
get?: never;
|
|
3495
|
-
put?: never;
|
|
3496
|
-
/**
|
|
3497
|
-
* Whitelist applications closed
|
|
3498
|
-
* @deprecated
|
|
3499
|
-
* @description Public whitelist applications are closed.
|
|
3500
|
-
*
|
|
3501
|
-
* Retained for client compatibility. Every decoded submission is rejected with
|
|
3502
|
-
* HTTP 403 Forbidden / gRPC PERMISSION_DENIED and no applicant data is changed.
|
|
3503
|
-
* Existing applications and administrative approvals remain available.
|
|
3504
|
-
*/
|
|
3505
|
-
post: operations["submit_whitelist"];
|
|
3506
|
-
delete?: never;
|
|
3507
|
-
options?: never;
|
|
3508
|
-
head?: never;
|
|
3509
|
-
patch?: never;
|
|
3510
|
-
trace?: never;
|
|
3511
|
-
};
|
|
3512
3518
|
"/api/v1/withdrawals": {
|
|
3513
3519
|
parameters: {
|
|
3514
3520
|
query?: never;
|
|
@@ -7235,6 +7241,18 @@ export interface components {
|
|
|
7235
7241
|
/** @description Pulse items, pre-sorted: watchlist order first, MARKET last, most-recent-first within each asset. Items with unverified figures are removed server-side. */
|
|
7236
7242
|
items?: components["schemas"]["PulseItem"][] | null;
|
|
7237
7243
|
};
|
|
7244
|
+
GetRegionStatusResponse: {
|
|
7245
|
+
/**
|
|
7246
|
+
* @description True when Monaco is not available in the caller's region; every other endpoint then answers 451 REGION_RESTRICTED
|
|
7247
|
+
* @example false
|
|
7248
|
+
*/
|
|
7249
|
+
restricted?: boolean | null;
|
|
7250
|
+
/**
|
|
7251
|
+
* @description The caller's ISO 3166-1 alpha-2 country code as the edge geolocated it (T1 for Tor, XX for unknown); empty when the request carried no location
|
|
7252
|
+
* @example JP
|
|
7253
|
+
*/
|
|
7254
|
+
country?: string | null;
|
|
7255
|
+
};
|
|
7238
7256
|
GetRewardsBalanceResponse: {
|
|
7239
7257
|
/** @description One entry per reward token that has a non-zero available balance. */
|
|
7240
7258
|
balances?: components["schemas"]["RewardsBalanceEntry"][] | null;
|
|
@@ -10681,42 +10699,6 @@ export interface components {
|
|
|
10681
10699
|
*/
|
|
10682
10700
|
isActive?: boolean | null;
|
|
10683
10701
|
};
|
|
10684
|
-
SubmitWhitelistRequest: {
|
|
10685
|
-
/**
|
|
10686
|
-
* @description Applicant wallet address
|
|
10687
|
-
* @example 0x742d35Cc6634C0532925a3b8D4060f31E2C3d8B5
|
|
10688
|
-
*/
|
|
10689
|
-
walletAddress: string;
|
|
10690
|
-
/**
|
|
10691
|
-
* Format: email
|
|
10692
|
-
* @description Applicant email address
|
|
10693
|
-
* @example user@example.com
|
|
10694
|
-
*/
|
|
10695
|
-
email: string;
|
|
10696
|
-
/**
|
|
10697
|
-
* @description Applicant Twitter/X username
|
|
10698
|
-
* @example monaco_user
|
|
10699
|
-
*/
|
|
10700
|
-
twitterUsername?: string | null;
|
|
10701
|
-
/**
|
|
10702
|
-
* @description Applicant Telegram username
|
|
10703
|
-
* @example monaco_user
|
|
10704
|
-
*/
|
|
10705
|
-
telegramUsername?: string | null;
|
|
10706
|
-
};
|
|
10707
|
-
SubmitWhitelistResponse: {
|
|
10708
|
-
/**
|
|
10709
|
-
* @description Legacy success message; submissions now return HTTP 403 / gRPC PERMISSION_DENIED
|
|
10710
|
-
* @example Your whitelist application has been submitted successfully! We'll review it and get back to you soon.
|
|
10711
|
-
*/
|
|
10712
|
-
message?: string | null;
|
|
10713
|
-
/**
|
|
10714
|
-
* Format: uuid
|
|
10715
|
-
* @description Legacy created user UUID; retired submissions do not create users
|
|
10716
|
-
* @example 123e4567-e89b-12d3-a456-426614174000
|
|
10717
|
-
*/
|
|
10718
|
-
userId?: string | null;
|
|
10719
|
-
};
|
|
10720
10702
|
SweeperChain: {
|
|
10721
10703
|
/**
|
|
10722
10704
|
* Format: int64
|
|
@@ -13651,7 +13633,7 @@ export interface operations {
|
|
|
13651
13633
|
};
|
|
13652
13634
|
content?: never;
|
|
13653
13635
|
};
|
|
13654
|
-
/** @description Origin not allowed for this application */
|
|
13636
|
+
/** @description Origin not allowed for this application; or the wallet is on the OFAC sanctions list, refused with code ADDRESS_RESTRICTED (REST error envelope error and code; gRPC google.rpc.ErrorInfo reason, domain auth.0xmonaco.com) and the message "This wallet can't be used on Monaco." */
|
|
13655
13637
|
403: {
|
|
13656
13638
|
headers: {
|
|
13657
13639
|
[name: string]: unknown;
|
|
@@ -13814,7 +13796,7 @@ export interface operations {
|
|
|
13814
13796
|
};
|
|
13815
13797
|
content?: never;
|
|
13816
13798
|
};
|
|
13817
|
-
/** @description Origin not allowed for this application; the account or wallet is deactivated; or Mainnet Invite Mode is on and the wallet has no access grant and supplied no valid invite code. Auth refusals carry a stable code (REST error envelope code; gRPC google.rpc.ErrorInfo reason, domain auth.0xmonaco.com): ACCOUNT_DEACTIVATED for a deactivated signing account, INVITE_CODE_REQUIRED when no code was supplied, and INVITE_CODE_INVALID for a wrong, already redeemed or revoked code, or an unused code whose issuer is deactivated. No account identity or administrative deactivation reason is disclosed. Unused invites become usable again after issuer reactivation */
|
|
13799
|
+
/** @description Origin not allowed for this application; the account or wallet is deactivated; or Mainnet Invite Mode is on and the wallet has no access grant and supplied no valid invite code. Auth refusals carry a stable code (REST error envelope code; gRPC google.rpc.ErrorInfo reason, domain auth.0xmonaco.com): ACCOUNT_DEACTIVATED for a deactivated signing account, INVITE_CODE_REQUIRED when no code was supplied, and INVITE_CODE_INVALID for a wrong, already redeemed or revoked code, or an unused code whose issuer is deactivated. A wallet on the OFAC sanctions list is refused with ADDRESS_RESTRICTED. No account identity or administrative deactivation reason is disclosed. Unused invites become usable again after issuer reactivation */
|
|
13818
13800
|
403: {
|
|
13819
13801
|
headers: {
|
|
13820
13802
|
[name: string]: unknown;
|
|
@@ -14290,6 +14272,26 @@ export interface operations {
|
|
|
14290
14272
|
};
|
|
14291
14273
|
};
|
|
14292
14274
|
};
|
|
14275
|
+
get_region_status: {
|
|
14276
|
+
parameters: {
|
|
14277
|
+
query?: never;
|
|
14278
|
+
header?: never;
|
|
14279
|
+
path?: never;
|
|
14280
|
+
cookie?: never;
|
|
14281
|
+
};
|
|
14282
|
+
requestBody?: never;
|
|
14283
|
+
responses: {
|
|
14284
|
+
/** @description OK */
|
|
14285
|
+
200: {
|
|
14286
|
+
headers: {
|
|
14287
|
+
[name: string]: unknown;
|
|
14288
|
+
};
|
|
14289
|
+
content: {
|
|
14290
|
+
"application/json": components["schemas"]["GetRegionStatusResponse"];
|
|
14291
|
+
};
|
|
14292
|
+
};
|
|
14293
|
+
};
|
|
14294
|
+
};
|
|
14293
14295
|
list_my_follows: {
|
|
14294
14296
|
parameters: {
|
|
14295
14297
|
query?: {
|
|
@@ -19761,51 +19763,6 @@ export interface operations {
|
|
|
19761
19763
|
};
|
|
19762
19764
|
};
|
|
19763
19765
|
};
|
|
19764
|
-
submit_whitelist: {
|
|
19765
|
-
parameters: {
|
|
19766
|
-
query?: never;
|
|
19767
|
-
header?: never;
|
|
19768
|
-
path?: never;
|
|
19769
|
-
cookie?: never;
|
|
19770
|
-
};
|
|
19771
|
-
requestBody: {
|
|
19772
|
-
content: {
|
|
19773
|
-
"application/json": components["schemas"]["SubmitWhitelistRequest"];
|
|
19774
|
-
};
|
|
19775
|
-
};
|
|
19776
|
-
responses: {
|
|
19777
|
-
/** @description OK */
|
|
19778
|
-
200: {
|
|
19779
|
-
headers: {
|
|
19780
|
-
[name: string]: unknown;
|
|
19781
|
-
};
|
|
19782
|
-
content: {
|
|
19783
|
-
"application/json": components["schemas"]["SubmitWhitelistResponse"];
|
|
19784
|
-
};
|
|
19785
|
-
};
|
|
19786
|
-
/** @description Invalid request parameters */
|
|
19787
|
-
400: {
|
|
19788
|
-
headers: {
|
|
19789
|
-
[name: string]: unknown;
|
|
19790
|
-
};
|
|
19791
|
-
content?: never;
|
|
19792
|
-
};
|
|
19793
|
-
/** @description Public whitelist applications are closed. No applicant data is changed. */
|
|
19794
|
-
403: {
|
|
19795
|
-
headers: {
|
|
19796
|
-
[name: string]: unknown;
|
|
19797
|
-
};
|
|
19798
|
-
content?: never;
|
|
19799
|
-
};
|
|
19800
|
-
/** @description Internal server error */
|
|
19801
|
-
500: {
|
|
19802
|
-
headers: {
|
|
19803
|
-
[name: string]: unknown;
|
|
19804
|
-
};
|
|
19805
|
-
content?: never;
|
|
19806
|
-
};
|
|
19807
|
-
};
|
|
19808
|
-
};
|
|
19809
19766
|
list_pending_withdrawals: {
|
|
19810
19767
|
parameters: {
|
|
19811
19768
|
query?: {
|
|
@@ -19909,7 +19866,7 @@ export interface operations {
|
|
|
19909
19866
|
};
|
|
19910
19867
|
content?: never;
|
|
19911
19868
|
};
|
|
19912
|
-
/** @description Caller lacks the withdraw permission */
|
|
19869
|
+
/** @description Caller lacks the withdraw permission; or the destination is on the OFAC sanctions list, refused with code ADDRESS_RESTRICTED (REST error envelope error and code; gRPC google.rpc.ErrorInfo reason, domain auth.0xmonaco.com) and the message "Withdrawals to this address aren't supported." */
|
|
19913
19870
|
403: {
|
|
19914
19871
|
headers: {
|
|
19915
19872
|
[name: string]: unknown;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@0xmonaco/types",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.93",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"homepage": "https://docs.0xmonaco.com/sdk/typescript",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"lint": "biome lint ."
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@0xmonaco/contracts": "1.0.
|
|
19
|
+
"@0xmonaco/contracts": "1.0.93",
|
|
20
20
|
"zod": "^4.1.12"
|
|
21
21
|
},
|
|
22
22
|
"peerDependencies": {
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Compatibility types for the retired public whitelist endpoint.
|
|
3
|
-
* Submissions return HTTP 403 FORBIDDEN without changing applicant data.
|
|
4
|
-
*/
|
|
5
|
-
import type { BaseAPI } from "../api";
|
|
6
|
-
/** Body for a whitelist application. */
|
|
7
|
-
export interface SubmitWhitelistRequest {
|
|
8
|
-
/** Applicant wallet address (0x-prefixed, 40 hex chars) */
|
|
9
|
-
walletAddress: string;
|
|
10
|
-
/** Applicant email address */
|
|
11
|
-
email: string;
|
|
12
|
-
/** Applicant Twitter/X username (1-15 chars) */
|
|
13
|
-
twitterUsername?: string;
|
|
14
|
-
/** Applicant Telegram username (5-32 chars) */
|
|
15
|
-
telegramUsername?: string;
|
|
16
|
-
}
|
|
17
|
-
/** Legacy success response, retained for compatibility; retired submissions return HTTP 403. */
|
|
18
|
-
export interface SubmitWhitelistResponse {
|
|
19
|
-
/** Human-readable status message */
|
|
20
|
-
message: string;
|
|
21
|
-
/** Created user UUID (pending approval) */
|
|
22
|
-
userId: string | null;
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* Whitelist API interface. The submit endpoint is public (no auth required).
|
|
26
|
-
*/
|
|
27
|
-
export interface WhitelistAPI extends BaseAPI {
|
|
28
|
-
/**
|
|
29
|
-
* @deprecated Public whitelist applications are closed. The server returns HTTP 403.
|
|
30
|
-
* @param body - Legacy applicant details; the request shape is retained for compatibility.
|
|
31
|
-
*/
|
|
32
|
-
submit(body: SubmitWhitelistRequest): Promise<SubmitWhitelistResponse>;
|
|
33
|
-
}
|
package/dist/whitelist/index.js
DELETED