@0xmonaco/types 1.0.21 → 1.0.25-develop.1fab96c

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.
@@ -33,10 +33,10 @@ export interface FailedMint {
33
33
  export interface MintTokensParams {
34
34
  /**
35
35
  * Cloudflare Turnstile token proving the request came from a real client.
36
- * Required when the gateway has captcha enforcement enabled; ignored
37
- * otherwise.
36
+ * Required on every faucet mint request; requests without a valid token are
37
+ * rejected.
38
38
  */
39
- turnstileToken?: string;
39
+ turnstileToken: string;
40
40
  }
41
41
  /** Result of a faucet mint request. */
42
42
  export interface MintTokensResponse {
@@ -47,6 +47,47 @@ export interface MintTokensResponse {
47
47
  /** Remaining faucet requests in the next 24h */
48
48
  remainingRequests24h: number;
49
49
  }
50
+ /** One token minted by a past faucet request. */
51
+ export interface FaucetMintRecord {
52
+ /** Asset UUID */
53
+ assetId: string;
54
+ /** Token symbol */
55
+ symbol: string;
56
+ /** Amount minted in token units */
57
+ amount: string;
58
+ /**
59
+ * On-chain transaction hash; absent when the transaction was submitted but
60
+ * never confirmed
61
+ */
62
+ txHash?: string;
63
+ }
64
+ /** One past faucet request (one endpoint call; all tokens minted together). */
65
+ export interface FaucetRequestRecord {
66
+ /**
67
+ * Timestamp (ISO 8601) of the request, truncated to the minute (the
68
+ * quota-session granularity)
69
+ */
70
+ requestedAt: string;
71
+ /** Tokens minted by the request */
72
+ minted: FaucetMintRecord[];
73
+ }
74
+ /** Result of a faucet info request. */
75
+ export interface GetFaucetInfoResponse {
76
+ /** Remaining faucet requests in the rolling 24h window */
77
+ remainingRequests24h: number;
78
+ /** Maximum faucet requests per rolling 24h window */
79
+ dailyLimit: number;
80
+ /**
81
+ * Timestamp (ISO 8601) safe to retry at or after: when the wallet's next
82
+ * faucet slot frees under the current daily limit, with a small safety
83
+ * margin. When remainingRequests24h is 0 this is when the next mint
84
+ * becomes possible. Absent when no requests are in the rolling 24h window
85
+ * or when the daily limit is 0. Not a calendar-day reset.
86
+ */
87
+ nextAvailableAt?: string;
88
+ /** Up to 5 most recent faucet requests, newest first */
89
+ recentRequests: FaucetRequestRecord[];
90
+ }
50
91
  /**
51
92
  * Faucet API interface. Session-authenticated.
52
93
  */
@@ -57,14 +98,25 @@ export interface FaucetAPI extends BaseAPI {
57
98
  * Testnet-only and rate-limited; see the module note. The call is
58
99
  * synchronous and resolves only when every faucet transaction confirmed
59
100
  * on-chain (HTTP 200). Failures reject with meaningful status codes:
60
- * 429 when the daily quota is exhausted, 502 when transactions failed or
61
- * were only partially confirmed on-chain (the error details carry the
62
- * minted/failed breakdown; delivered legs still consume the quota), and
63
- * 503 when the faucet is unavailable (nothing credited, safe to retry).
101
+ * 400 when the Turnstile token is missing or invalid, 429 when the daily
102
+ * quota is exhausted, 502 when transactions failed or were only partially
103
+ * confirmed on-chain (the error details carry the minted/failed breakdown;
104
+ * delivered legs still consume the quota), and 503 when the faucet is
105
+ * unavailable (nothing credited, safe to retry).
64
106
  *
65
- * @param params - Optional parameters (Turnstile captcha token when the
66
- * gateway requires one)
107
+ * @param params - Mint parameters, including the required Turnstile captcha
108
+ * token
67
109
  * @returns Promise resolving to the minted tokens and remaining quota
68
110
  */
69
- mint(params?: MintTokensParams): Promise<MintTokensResponse>;
111
+ mint(params: MintTokensParams): Promise<MintTokensResponse>;
112
+ /**
113
+ * Fetches the authenticated wallet's faucet quota and recent requests.
114
+ *
115
+ * Read-only: remaining requests in the rolling 24h window, when the next
116
+ * request becomes available, and the 5 most recent requests. Wallet-scoped
117
+ * across apps, matching mint enforcement.
118
+ *
119
+ * @returns Promise resolving to the quota and recent-request history
120
+ */
121
+ getInfo(): Promise<GetFaucetInfoResponse>;
70
122
  }
@@ -114,11 +114,13 @@ export interface GetMarginAccountMovementsResponse {
114
114
  export interface SimulateOrderRiskRequest {
115
115
  tradingPairId: string;
116
116
  side: OrderSide;
117
- positionSide: PositionSide;
117
+ /** @deprecated `side` is authoritative; when present BUY=LONG and SELL=SHORT. */
118
+ positionSide?: PositionSide;
118
119
  orderType: OrderType;
119
120
  price?: string;
120
121
  quantity: string;
121
- leverage: string;
122
+ /** Required for normal orders; optional and ignored for reduce-only. */
123
+ leverage?: string;
122
124
  reduceOnly?: boolean;
123
125
  }
124
126
  export type SimulateIsolatedRiskBucketOrderRiskRequest = SimulateOrderRiskRequest & {
@@ -273,11 +273,12 @@ export interface MarketStats {
273
273
  totalTradeCountLtd: number;
274
274
  }
275
275
  export interface RiskTier {
276
- notional_floor: string;
277
- notional_cap?: string;
278
276
  initialMarginRatio: string;
279
277
  maintenanceMarginRatio: string;
280
- maxLeverage: string;
278
+ /** Maximum authoritative absolute base-asset quantity. */
279
+ maxPositionSize?: string;
280
+ /** @deprecated This legacy alias is base quantity, not notional. */
281
+ maxPositionNotional?: string;
281
282
  }
282
283
  export interface PerpMarketConfig {
283
284
  tradingPairId: string;
@@ -133,6 +133,8 @@ export interface TpSlLeg {
133
133
  orderType: OrderType;
134
134
  limitPrice?: string;
135
135
  quantity?: string;
136
+ /** Resolve the full live position size when triggered. */
137
+ closePosition?: boolean;
136
138
  timeInForce?: Extract<TimeInForce, "GTC" | "IOC">;
137
139
  slippageToleranceBps?: number;
138
140
  expiresAt?: string;
@@ -140,6 +142,8 @@ export interface TpSlLeg {
140
142
  export interface AttachPositionTpSlRequest {
141
143
  takeProfit?: TpSlLeg;
142
144
  stopLoss?: TpSlLeg;
145
+ /** Cancel the sibling after one leg triggers. Requires both legs. */
146
+ oco?: boolean;
143
147
  }
144
148
  export interface AttachPositionTpSlResponse {
145
149
  positionId: string;
@@ -56,6 +56,14 @@ export interface SDKConfig {
56
56
  * (e.g. Docker DNS `ws://ws-api:8080/ws`). Must be a valid absolute URL.
57
57
  */
58
58
  wsUrl?: string;
59
+ /**
60
+ * Polling frequency in milliseconds for the SDK's internal viem public
61
+ * client (e.g. `waitForTransactionReceipt` during vault deposits). Sei
62
+ * produces sub-second blocks, so a value near the chain's block time
63
+ * confirms transactions much sooner than viem's 4000ms default. Defaults to
64
+ * 750ms when omitted. Must be a positive finite number when provided.
65
+ */
66
+ pollingInterval?: number;
59
67
  }
60
68
  /**
61
69
  * Core SDK interface providing access to all Monaco functionality.
@@ -34,10 +34,13 @@ export interface TradingAPI extends BaseAPI {
34
34
  riskBucketId?: string;
35
35
  riskBucketCollateral?: string;
36
36
  strategyKey?: string;
37
+ /** @deprecated Order side is authoritative. */
37
38
  positionSide?: PositionSide;
38
39
  leverage?: string;
39
40
  reduceOnly?: boolean;
41
+ /** @deprecated Entry-attached TP/SL is rejected; use position TP/SL. */
40
42
  takeProfit?: ParentTpSlLegParams;
43
+ /** @deprecated Entry-attached TP/SL is rejected; use position TP/SL. */
41
44
  stopLoss?: ParentTpSlLegParams;
42
45
  }): Promise<CreateOrderResponse>;
43
46
  /**
@@ -58,10 +61,13 @@ export interface TradingAPI extends BaseAPI {
58
61
  riskBucketId?: string;
59
62
  riskBucketCollateral?: string;
60
63
  strategyKey?: string;
64
+ /** @deprecated Order side is authoritative. */
61
65
  positionSide?: PositionSide;
62
66
  leverage?: string;
63
67
  reduceOnly?: boolean;
68
+ /** @deprecated Entry-attached TP/SL is rejected; use position TP/SL. */
64
69
  takeProfit?: ParentTpSlLegParams;
70
+ /** @deprecated Entry-attached TP/SL is rejected; use position TP/SL. */
65
71
  stopLoss?: ParentTpSlLegParams;
66
72
  }): Promise<CreateOrderResponse>;
67
73
  /**
@@ -140,6 +146,6 @@ export interface TradingAPI extends BaseAPI {
140
146
  */
141
147
  getOrder(orderId: string): Promise<GetOrderResponse>;
142
148
  }
143
- export type { ConditionalOrderConditionType, ConditionalOrderState, ConditionalOrderTriggerSource, Order, OrderRole, OrderSide, OrderStatus, OrderType, PositionSide, TimeInForce, TradingMode, } from "./orders";
149
+ export type { ConditionalOrderConditionType, ConditionalOrderState, ConditionalOrderTriggerSource, Order, OrderRole, OrderSide, OrderStatus, OrderTerminalReason, OrderType, PositionSide, TimeInForce, TradingMode, } from "./orders";
144
150
  export { ORDER_STATUS_VALUES } from "./orders";
145
151
  export type { BatchCancelError, BatchCancelOrdersResponse, BatchCancelResult, BatchCreateOrderParams, BatchCreateOrdersResponse, BatchCreateResult, BatchError, BatchReplaceOrderParams, BatchReplaceOrdersResponse, BatchReplaceResult, CancelConditionalOrderResponse, CancelOrderResponse, ConditionalOrder, CreateOrderResponse, GetOrderResponse, GetPaginatedOrdersParams, GetPaginatedOrdersResponse, ListConditionalOrdersParams, ListConditionalOrdersResponse, MatchResult, ParentTpSlLegParams, ReplaceOrderResponse, UpdatedFields, } from "./responses";
@@ -70,7 +70,11 @@ export interface Order {
70
70
  reduceOnly?: boolean;
71
71
  /** Position ID linked to the order, when available */
72
72
  positionId?: string;
73
+ /** Stable cause when status is CANCELLED */
74
+ terminalReason?: OrderTerminalReason;
73
75
  }
76
+ /** Stable terminal causes for accepted orders that end as CANCELLED. */
77
+ export type OrderTerminalReason = "USER_REQUESTED" | "REPLACED" | "LIQUIDATION" | "INSUFFICIENT_MARGIN" | "REDUCE_ONLY_EXHAUSTED" | "POSITION_CLOSED" | "OCO_SIBLING_TRIGGERED" | "SYSTEM";
74
78
  /**
75
79
  * Role of the creator or order
76
80
  */
@@ -38,7 +38,7 @@ export interface MatchResult {
38
38
  } | null;
39
39
  }
40
40
  /**
41
- * Parent TP/SL leg attached to a normal margin order.
41
+ * @deprecated Entry-attached TP/SL is rejected. Use position-associated TP/SL.
42
42
  *
43
43
  * Parent TP/SL follows the parent order quantity and becomes active once the
44
44
  * parent order creates or extends a position.
@@ -75,18 +75,18 @@ export declare const SimulateOrderRiskSchema: z.ZodObject<{
75
75
  BUY: "BUY";
76
76
  SELL: "SELL";
77
77
  }>;
78
- positionSide: z.ZodEnum<{
78
+ positionSide: z.ZodOptional<z.ZodEnum<{
79
79
  LONG: "LONG";
80
80
  SHORT: "SHORT";
81
81
  NONE: "NONE";
82
- }>;
82
+ }>>;
83
83
  orderType: z.ZodEnum<{
84
84
  LIMIT: "LIMIT";
85
85
  MARKET: "MARKET";
86
86
  }>;
87
87
  price: z.ZodOptional<z.ZodString>;
88
88
  quantity: z.ZodString;
89
- leverage: z.ZodString;
89
+ leverage: z.ZodOptional<z.ZodString>;
90
90
  reduceOnly: z.ZodOptional<z.ZodBoolean>;
91
91
  }, z.core.$strict>;
92
92
  }, z.core.$strip>;
@@ -97,18 +97,18 @@ export declare const SimulateParentMarginOrderRiskSchema: z.ZodObject<{
97
97
  BUY: "BUY";
98
98
  SELL: "SELL";
99
99
  }>;
100
- positionSide: z.ZodEnum<{
100
+ positionSide: z.ZodOptional<z.ZodEnum<{
101
101
  LONG: "LONG";
102
102
  SHORT: "SHORT";
103
103
  NONE: "NONE";
104
- }>;
104
+ }>>;
105
105
  orderType: z.ZodEnum<{
106
106
  LIMIT: "LIMIT";
107
107
  MARKET: "MARKET";
108
108
  }>;
109
109
  price: z.ZodOptional<z.ZodString>;
110
110
  quantity: z.ZodString;
111
- leverage: z.ZodString;
111
+ leverage: z.ZodOptional<z.ZodString>;
112
112
  reduceOnly: z.ZodOptional<z.ZodBoolean>;
113
113
  }, z.core.$strict>;
114
114
  }, z.core.$strip>;
@@ -118,18 +118,18 @@ export declare const SimulateRiskBucketOrderRiskSchema: z.ZodObject<{
118
118
  BUY: "BUY";
119
119
  SELL: "SELL";
120
120
  }>;
121
- positionSide: z.ZodEnum<{
121
+ positionSide: z.ZodOptional<z.ZodEnum<{
122
122
  LONG: "LONG";
123
123
  SHORT: "SHORT";
124
124
  NONE: "NONE";
125
- }>;
125
+ }>>;
126
126
  orderType: z.ZodEnum<{
127
127
  LIMIT: "LIMIT";
128
128
  MARKET: "MARKET";
129
129
  }>;
130
130
  price: z.ZodOptional<z.ZodString>;
131
131
  quantity: z.ZodString;
132
- leverage: z.ZodString;
132
+ leverage: z.ZodOptional<z.ZodString>;
133
133
  reduceOnly: z.ZodOptional<z.ZodBoolean>;
134
134
  tradingPairId: z.ZodUUID;
135
135
  strategyKey: z.ZodOptional<z.ZodString>;
@@ -141,18 +141,18 @@ export declare const SimulateRiskBucketOrderRiskSchema: z.ZodObject<{
141
141
  BUY: "BUY";
142
142
  SELL: "SELL";
143
143
  }>;
144
- positionSide: z.ZodEnum<{
144
+ positionSide: z.ZodOptional<z.ZodEnum<{
145
145
  LONG: "LONG";
146
146
  SHORT: "SHORT";
147
147
  NONE: "NONE";
148
- }>;
148
+ }>>;
149
149
  orderType: z.ZodEnum<{
150
150
  LIMIT: "LIMIT";
151
151
  MARKET: "MARKET";
152
152
  }>;
153
153
  price: z.ZodOptional<z.ZodString>;
154
154
  quantity: z.ZodString;
155
- leverage: z.ZodString;
155
+ leverage: z.ZodOptional<z.ZodString>;
156
156
  reduceOnly: z.ZodOptional<z.ZodBoolean>;
157
157
  marginMode: z.ZodLiteral<"CROSS">;
158
158
  selectedTradingPairIds: z.ZodArray<z.ZodUUID>;
@@ -78,17 +78,39 @@ export const GetParentMarginAccountMovementsSchema = PaginationSchema.extend({
78
78
  const BaseSimulateOrderRiskRequestSchema = z.object({
79
79
  tradingPairId: UUIDSchema,
80
80
  side: OrderSideSchema,
81
- positionSide: PositionSideSchema,
81
+ positionSide: PositionSideSchema.optional(),
82
82
  orderType: OrderTypeSchema,
83
83
  price: PositiveDecimalStringSchema.optional(),
84
84
  quantity: PositiveDecimalStringSchema,
85
- leverage: PositiveDecimalStringSchema,
85
+ leverage: PositiveDecimalStringSchema.optional(),
86
86
  reduceOnly: z.boolean().optional(),
87
87
  });
88
- const SimulateOrderRiskRequestSchema = BaseSimulateOrderRiskRequestSchema.strict();
89
- const SimulateIsolatedRiskBucketOrderRiskRequestSchema = BaseSimulateOrderRiskRequestSchema.merge(IsolatedRiskBucketRequestSchema).strict();
88
+ const validateOneWaySimulationFields = (data, ctx) => {
89
+ if (data.positionSide !== undefined) {
90
+ const expected = data.side === "BUY" ? "LONG" : "SHORT";
91
+ if (data.positionSide !== expected) {
92
+ ctx.addIssue({
93
+ code: z.ZodIssueCode.custom,
94
+ message: "positionSide must match side when provided (BUY=LONG, SELL=SHORT)",
95
+ path: ["positionSide"],
96
+ });
97
+ }
98
+ }
99
+ if (data.reduceOnly !== true && data.leverage === undefined) {
100
+ ctx.addIssue({
101
+ code: z.ZodIssueCode.custom,
102
+ message: "leverage is required for normal margin orders",
103
+ path: ["leverage"],
104
+ });
105
+ }
106
+ };
107
+ const SimulateOrderRiskRequestSchema = BaseSimulateOrderRiskRequestSchema.strict().superRefine(validateOneWaySimulationFields);
108
+ const SimulateIsolatedRiskBucketOrderRiskRequestSchema = BaseSimulateOrderRiskRequestSchema.merge(IsolatedRiskBucketRequestSchema)
109
+ .strict()
110
+ .superRefine(validateOneWaySimulationFields);
90
111
  const SimulateCrossRiskBucketOrderRiskRequestSchema = BaseSimulateOrderRiskRequestSchema.merge(CrossRiskBucketScopeSchema)
91
112
  .strict()
113
+ .superRefine(validateOneWaySimulationFields)
92
114
  .refine((data) => data.selectedTradingPairIds.includes(data.tradingPairId), {
93
115
  message: "tradingPairId must be included in selectedTradingPairIds for CROSS risk buckets",
94
116
  path: ["selectedTradingPairIds"],
@@ -60,6 +60,7 @@ export declare const AttachPositionTpSlSchema: z.ZodObject<{
60
60
  }>;
61
61
  limitPrice: z.ZodOptional<z.ZodString>;
62
62
  quantity: z.ZodOptional<z.ZodString>;
63
+ closePosition: z.ZodOptional<z.ZodBoolean>;
63
64
  timeInForce: z.ZodOptional<z.ZodEnum<{
64
65
  GTC: "GTC";
65
66
  IOC: "IOC";
@@ -75,6 +76,7 @@ export declare const AttachPositionTpSlSchema: z.ZodObject<{
75
76
  }>;
76
77
  limitPrice: z.ZodOptional<z.ZodString>;
77
78
  quantity: z.ZodOptional<z.ZodString>;
79
+ closePosition: z.ZodOptional<z.ZodBoolean>;
78
80
  timeInForce: z.ZodOptional<z.ZodEnum<{
79
81
  GTC: "GTC";
80
82
  IOC: "IOC";
@@ -82,6 +84,7 @@ export declare const AttachPositionTpSlSchema: z.ZodObject<{
82
84
  slippageToleranceBps: z.ZodOptional<z.ZodNumber>;
83
85
  expiresAt: z.ZodOptional<z.ZodISODateTime>;
84
86
  }, z.core.$strip>>;
87
+ oco: z.ZodOptional<z.ZodBoolean>;
85
88
  }, z.core.$strip>;
86
89
  }, z.core.$strip>;
87
90
  export declare const ListPositionHistorySchema: z.ZodObject<{
@@ -60,6 +60,7 @@ const TpSlLegSchema = z
60
60
  orderType: OrderTypeSchema,
61
61
  limitPrice: PositiveDecimalStringSchema.optional(),
62
62
  quantity: PositiveDecimalStringSchema.optional(),
63
+ closePosition: z.boolean().optional(),
63
64
  timeInForce: ConditionalTimeInForceSchema.optional(),
64
65
  slippageToleranceBps: SlippageToleranceBpsSchema.optional(),
65
66
  expiresAt: ISO8601DateSchema.optional(),
@@ -79,15 +80,28 @@ const TpSlLegSchema = z
79
80
  .refine((data) => data.orderType !== "LIMIT" || data.slippageToleranceBps === undefined, {
80
81
  message: "slippageToleranceBps is only allowed for MARKET TP/SL legs",
81
82
  path: ["slippageToleranceBps"],
83
+ })
84
+ .refine((data) => data.closePosition !== true || data.quantity === undefined, {
85
+ message: "quantity must be omitted when closePosition is true",
86
+ path: ["quantity"],
87
+ })
88
+ .refine((data) => data.quantity !== undefined || data.closePosition !== false, {
89
+ message: "quantity is required when closePosition is false",
90
+ path: ["closePosition"],
82
91
  });
83
92
  export const AttachPositionTpSlSchema = PositionIdSchema.extend({
84
93
  request: z
85
94
  .object({
86
95
  takeProfit: TpSlLegSchema.optional(),
87
96
  stopLoss: TpSlLegSchema.optional(),
97
+ oco: z.boolean().optional(),
88
98
  })
89
99
  .refine((data) => data.takeProfit !== undefined || data.stopLoss !== undefined, {
90
100
  message: "At least one of takeProfit or stopLoss is required",
101
+ })
102
+ .refine((data) => data.oco !== true || (data.takeProfit !== undefined && data.stopLoss !== undefined), {
103
+ message: "oco=true requires both takeProfit and stopLoss",
104
+ path: ["oco"],
91
105
  }),
92
106
  });
93
107
  export const ListPositionHistorySchema = PaginationSchema.extend({
@@ -19,12 +19,12 @@ export declare const LedgerEntryTypeSchema: z.ZodEnum<{
19
19
  * Transaction type validation
20
20
  */
21
21
  export declare const TransactionTypeSchema: z.ZodEnum<{
22
+ LIQUIDATION: "LIQUIDATION";
22
23
  FEE: "FEE";
23
24
  DEPOSIT: "DEPOSIT";
24
25
  WITHDRAWAL: "WITHDRAWAL";
25
26
  TRADE: "TRADE";
26
27
  FUNDING: "FUNDING";
27
- LIQUIDATION: "LIQUIDATION";
28
28
  INTEREST: "INTEREST";
29
29
  REWARD: "REWARD";
30
30
  }>;
@@ -45,12 +45,12 @@ export declare const GetUserMovementsSchema: z.ZodObject<{
45
45
  FEE: "FEE";
46
46
  }>>;
47
47
  transactionType: z.ZodOptional<z.ZodEnum<{
48
+ LIQUIDATION: "LIQUIDATION";
48
49
  FEE: "FEE";
49
50
  DEPOSIT: "DEPOSIT";
50
51
  WITHDRAWAL: "WITHDRAWAL";
51
52
  TRADE: "TRADE";
52
53
  FUNDING: "FUNDING";
53
- LIQUIDATION: "LIQUIDATION";
54
54
  INTEREST: "INTEREST";
55
55
  REWARD: "REWARD";
56
56
  }>>;
@@ -104,6 +104,7 @@ export const ParentTpSlLegSchema = z
104
104
  path: ["slippageToleranceBps"],
105
105
  });
106
106
  const hasParentTpSl = (options) => options?.takeProfit !== undefined || options?.stopLoss !== undefined;
107
+ const legacyPositionSideMatchesOrderSide = (side, positionSide) => positionSide === undefined || (positionSide !== "NONE" && ((side === "BUY" && positionSide === "LONG") || (side === "SELL" && positionSide === "SHORT")));
107
108
  /**
108
109
  * Place Limit Order validation schema
109
110
  */
@@ -132,25 +133,17 @@ export const PlaceLimitOrderSchema = z
132
133
  })
133
134
  .optional(),
134
135
  })
135
- .refine((data) => data.options?.tradingMode !== "MARGIN" || data.options.positionSide !== undefined, {
136
- message: "positionSide is required for MARGIN orders",
136
+ .refine((data) => legacyPositionSideMatchesOrderSide(data.side, data.options?.positionSide), {
137
+ message: "positionSide is deprecated; when supplied BUY requires LONG and SELL requires SHORT",
137
138
  path: ["options", "positionSide"],
138
139
  })
139
- .refine((data) => data.options?.tradingMode !== "MARGIN" || data.options.leverage !== undefined, {
140
- message: "leverage is required for MARGIN orders",
140
+ .refine((data) => data.options?.tradingMode !== "MARGIN" || data.options.reduceOnly === true || data.options.leverage !== undefined, {
141
+ message: "leverage is required for normal MARGIN orders",
141
142
  path: ["options", "leverage"],
142
143
  })
143
- .refine((data) => !hasParentTpSl(data.options) || data.options?.tradingMode === "MARGIN", {
144
- message: "Parent TP/SL is only supported for MARGIN orders",
145
- path: ["options", "tradingMode"],
146
- })
147
- .refine((data) => !hasParentTpSl(data.options) || data.options?.positionSide !== "NONE", {
148
- message: "Parent TP/SL requires positionSide to be LONG or SHORT",
149
- path: ["options", "positionSide"],
150
- })
151
- .refine((data) => !hasParentTpSl(data.options) || data.options?.reduceOnly !== true, {
152
- message: "Parent TP/SL cannot be attached to reduceOnly orders",
153
- path: ["options", "reduceOnly"],
144
+ .refine((data) => !hasParentTpSl(data.options), {
145
+ message: "Entry-attached TP/SL are no longer supported; create position TP/SL after the position opens",
146
+ path: ["options"],
154
147
  })
155
148
  .refine((data) => data.options?.riskBucketCollateral === undefined || data.options?.tradingMode === "MARGIN", {
156
149
  message: "riskBucketCollateral is only supported for MARGIN orders",
@@ -209,25 +202,17 @@ export const PlaceMarketOrderSchema = z
209
202
  })
210
203
  .optional(),
211
204
  })
212
- .refine((data) => data.options?.tradingMode !== "MARGIN" || data.options.positionSide !== undefined, {
213
- message: "positionSide is required for MARGIN orders",
205
+ .refine((data) => legacyPositionSideMatchesOrderSide(data.side, data.options?.positionSide), {
206
+ message: "positionSide is deprecated; when supplied BUY requires LONG and SELL requires SHORT",
214
207
  path: ["options", "positionSide"],
215
208
  })
216
- .refine((data) => data.options?.tradingMode !== "MARGIN" || data.options.leverage !== undefined, {
217
- message: "leverage is required for MARGIN orders",
209
+ .refine((data) => data.options?.tradingMode !== "MARGIN" || data.options.reduceOnly === true || data.options.leverage !== undefined, {
210
+ message: "leverage is required for normal MARGIN orders",
218
211
  path: ["options", "leverage"],
219
212
  })
220
- .refine((data) => !hasParentTpSl(data.options) || data.options?.tradingMode === "MARGIN", {
221
- message: "Parent TP/SL is only supported for MARGIN orders",
222
- path: ["options", "tradingMode"],
223
- })
224
- .refine((data) => !hasParentTpSl(data.options) || data.options?.positionSide !== "NONE", {
225
- message: "Parent TP/SL requires positionSide to be LONG or SHORT",
226
- path: ["options", "positionSide"],
227
- })
228
- .refine((data) => !hasParentTpSl(data.options) || data.options?.reduceOnly !== true, {
229
- message: "Parent TP/SL cannot be attached to reduceOnly orders",
230
- path: ["options", "reduceOnly"],
213
+ .refine((data) => !hasParentTpSl(data.options), {
214
+ message: "Entry-attached TP/SL are no longer supported; create position TP/SL after the position opens",
215
+ path: ["options"],
231
216
  })
232
217
  .refine((data) => data.options?.riskBucketCollateral === undefined || data.options?.tradingMode === "MARGIN", {
233
218
  message: "riskBucketCollateral is only supported for MARGIN orders",
@@ -391,12 +376,12 @@ export const BatchCreateOrderItemSchema = z
391
376
  message: "reduceOnly orders cannot create a new risk bucket",
392
377
  path: ["reduceOnly"],
393
378
  })
394
- .refine((data) => data.tradingMode !== "MARGIN" || data.positionSide !== undefined, {
395
- message: "positionSide is required for MARGIN orders",
379
+ .refine((data) => legacyPositionSideMatchesOrderSide(data.side, data.positionSide), {
380
+ message: "positionSide is deprecated; when supplied BUY requires LONG and SELL requires SHORT",
396
381
  path: ["positionSide"],
397
382
  })
398
- .refine((data) => data.tradingMode !== "MARGIN" || data.leverage !== undefined, {
399
- message: "leverage is required for MARGIN orders",
383
+ .refine((data) => data.tradingMode !== "MARGIN" || data.reduceOnly === true || data.leverage !== undefined, {
384
+ message: "leverage is required for normal MARGIN orders",
400
385
  path: ["leverage"],
401
386
  });
402
387
  /**
@@ -4,7 +4,7 @@
4
4
  * TypeScript types for order websocket events matching the Rust backend definitions.
5
5
  * Each event type has specific data fields based on the event context.
6
6
  */
7
- import type { OrderRole, OrderSide, OrderStatus, OrderType, TimeInForce, TradingMode } from "../../trading";
7
+ import type { OrderRole, OrderSide, OrderStatus, OrderTerminalReason, OrderType, TimeInForce, TradingMode } from "../../trading";
8
8
  import type { RawEventMessage } from "../base";
9
9
  /**
10
10
  * Order event types
@@ -197,6 +197,8 @@ export interface OrderCancelledEvent extends OrderEvent {
197
197
  data: CommonOrderEventData & {
198
198
  /** Reason for cancellation */
199
199
  reason?: string;
200
+ /** Stable machine-readable cancellation cause */
201
+ terminalReason?: OrderTerminalReason;
200
202
  /** Total filled quantity before cancellation */
201
203
  totalFilled?: string;
202
204
  /** Remaining quantity when canceled */
@@ -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", "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_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_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_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", "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", "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_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_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", "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];
@@ -32,6 +32,7 @@ export const OPERATION_IDS = [
32
32
  "get_available_collateral",
33
33
  "get_candles",
34
34
  "get_conditional_order",
35
+ "get_faucet_info",
35
36
  "get_funding_state",
36
37
  "get_index_price",
37
38
  "get_margin_account_movements",
@@ -734,6 +734,32 @@ export interface paths {
734
734
  patch?: never;
735
735
  trace?: never;
736
736
  };
737
+ "/api/v1/faucet/info": {
738
+ parameters: {
739
+ query?: never;
740
+ header?: never;
741
+ path?: never;
742
+ cookie?: never;
743
+ };
744
+ /**
745
+ * Get faucet quota and recent requests
746
+ * @description Get faucet quota and recent requests.
747
+ *
748
+ * Returns the authenticated wallet's remaining faucet requests in the
749
+ * rolling 24h window, when the next request becomes available, and the
750
+ * 5 most recent faucet requests. Quota is wallet-scoped: it aggregates
751
+ * across all user rows sharing the wallet address, matching mint
752
+ * enforcement.
753
+ */
754
+ get: operations["get_faucet_info"];
755
+ put?: never;
756
+ post?: never;
757
+ delete?: never;
758
+ options?: never;
759
+ head?: never;
760
+ patch?: never;
761
+ trace?: never;
762
+ };
737
763
  "/api/v1/faucet/mint": {
738
764
  parameters: {
739
765
  query?: never;
@@ -2280,8 +2306,13 @@ export interface components {
2280
2306
  updatedAt?: string | null;
2281
2307
  };
2282
2308
  AttachPositionTpSlRequest: {
2283
- stopLoss?: components["schemas"]["TpSlLeg"];
2309
+ /**
2310
+ * @description One-cancels-the-other. Defaults to false. When true, both take_profit and
2311
+ * stop_loss are required and the sibling is cancelled after either triggers.
2312
+ */
2313
+ oco?: boolean | null;
2284
2314
  takeProfit?: components["schemas"]["TpSlLeg"];
2315
+ stopLoss?: components["schemas"]["TpSlLeg"];
2285
2316
  };
2286
2317
  AttachPositionTpSlResponse: {
2287
2318
  positionId?: string | null;
@@ -2499,13 +2530,14 @@ export interface components {
2499
2530
  */
2500
2531
  riskBucketCollateral?: string | null;
2501
2532
  /**
2502
- * @description Position side for margin orders: LONG, SHORT, or NONE
2533
+ * @deprecated
2534
+ * @description DEPRECATED compatibility field. Order side is authoritative. When supplied, BUY requires LONG and SELL requires SHORT; NONE is rejected.
2503
2535
  * @example LONG
2504
2536
  * @enum {string|null}
2505
2537
  */
2506
- positionSide?: "LONG" | "SHORT" | "NONE" | null;
2538
+ positionSide?: "LONG" | "SHORT" | null;
2507
2539
  /**
2508
- * @description Leverage multiplier as decimal string for margin orders
2540
+ * @description Leverage multiplier as a decimal string. Required for normal margin orders; optional and ignored for reduce-only orders.
2509
2541
  * @example 5
2510
2542
  */
2511
2543
  leverage?: string | null;
@@ -2947,13 +2979,14 @@ export interface components {
2947
2979
  */
2948
2980
  riskBucketCollateral?: string | null;
2949
2981
  /**
2950
- * @description Position side for margin orders: LONG, SHORT, or NONE
2982
+ * @deprecated
2983
+ * @description DEPRECATED compatibility field. Order side is authoritative. When supplied, BUY requires LONG and SELL requires SHORT; NONE is rejected.
2951
2984
  * @example LONG
2952
2985
  * @enum {string|null}
2953
2986
  */
2954
- positionSide?: "LONG" | "SHORT" | "NONE" | null;
2987
+ positionSide?: "LONG" | "SHORT" | null;
2955
2988
  /**
2956
- * @description Leverage multiplier as decimal string for margin orders
2989
+ * @description Leverage multiplier as a decimal string. Required for normal margin orders; optional and ignored for reduce-only orders.
2957
2990
  * @example 5
2958
2991
  */
2959
2992
  leverage?: string | null;
@@ -3123,6 +3156,32 @@ export interface components {
3123
3156
  */
3124
3157
  error?: string | null;
3125
3158
  };
3159
+ /** @description One token minted by a past faucet request. */
3160
+ FaucetMintRecord: {
3161
+ /**
3162
+ * Format: uuid
3163
+ * @description Asset UUID
3164
+ */
3165
+ assetId?: string | null;
3166
+ /**
3167
+ * @description Token symbol
3168
+ * @example USDC
3169
+ */
3170
+ symbol?: string | null;
3171
+ /**
3172
+ * @description Amount minted in token units
3173
+ * @example 1000
3174
+ */
3175
+ amount?: string | null;
3176
+ /** @description On-chain transaction hash; absent when the transaction was submitted but never confirmed */
3177
+ txHash?: string | null;
3178
+ };
3179
+ /** @description One past faucet request (one endpoint call; all tokens minted together). */
3180
+ FaucetRequestRecord: {
3181
+ /** @description Timestamp (ISO 8601) of the request, truncated to the minute (the quota-session granularity) */
3182
+ requestedAt?: string | null;
3183
+ minted?: components["schemas"]["FaucetMintRecord"][] | null;
3184
+ };
3126
3185
  FeeTierScheduleRow: {
3127
3186
  /**
3128
3187
  * Format: int32
@@ -3372,6 +3431,27 @@ export interface components {
3372
3431
  */
3373
3432
  clientId?: string | null;
3374
3433
  };
3434
+ GetFaucetInfoResponse: {
3435
+ /**
3436
+ * Format: uint32
3437
+ * @description Remaining faucet requests in the rolling 24h window
3438
+ * @example 2
3439
+ */
3440
+ remainingRequests24h?: number | null;
3441
+ /**
3442
+ * Format: uint32
3443
+ * @description Maximum faucet requests per rolling 24h window
3444
+ * @example 3
3445
+ */
3446
+ dailyLimit?: number | null;
3447
+ /** @description Timestamp (ISO 8601) safe to retry at or after: when the wallet's next faucet slot frees under the current daily limit, with a small safety margin. When remaining_requests_24h is 0 this is when the next mint becomes possible. Absent when no requests are in the rolling 24h window or when the daily limit is 0. Not a calendar-day reset. */
3448
+ nextAvailableAt?: string | null;
3449
+ /**
3450
+ * @description Up to 5 most recent faucet requests, newest first, regardless of the
3451
+ * 24h window.
3452
+ */
3453
+ recentRequests?: components["schemas"]["FaucetRequestRecord"][] | null;
3454
+ };
3375
3455
  GetFundingStateResponse: {
3376
3456
  /** Format: uuid */
3377
3457
  tradingPairId?: string | null;
@@ -3739,7 +3819,8 @@ export interface components {
3739
3819
  */
3740
3820
  marginAccountId?: string | null;
3741
3821
  /**
3742
- * @description Position side for margin orders
3822
+ * @deprecated
3823
+ * @description DEPRECATED derived compatibility value. Order side is authoritative.
3743
3824
  * @example LONG
3744
3825
  */
3745
3826
  positionSide?: string | null;
@@ -3831,6 +3912,11 @@ export interface components {
3831
3912
  * @description Batch UUID for batch orders
3832
3913
  */
3833
3914
  batchId?: string | null;
3915
+ /**
3916
+ * @description Stable terminal cause for a cancelled order: USER_REQUESTED, REPLACED, LIQUIDATION, INSUFFICIENT_MARGIN, REDUCE_ONLY_EXHAUSTED, POSITION_CLOSED, OCO_SIBLING_TRIGGERED, or SYSTEM
3917
+ * @example REDUCE_ONLY_EXHAUSTED
3918
+ */
3919
+ terminalReason?: string | null;
3834
3920
  };
3835
3921
  /** @description Orderbook snapshot with token metadata and sequence number. */
3836
3922
  GetOrderbookResponse: {
@@ -4810,8 +4896,8 @@ export interface components {
4810
4896
  executionPriceRange?: components["schemas"]["ExecutionPriceRange"];
4811
4897
  };
4812
4898
  MintTokensRequest: {
4813
- /** @description Cloudflare Turnstile token; required when faucet captcha enforcement is enabled */
4814
- turnstileToken?: string | null;
4899
+ /** @description Cloudflare Turnstile token proving the request came from a real client. Required on every faucet mint request. */
4900
+ turnstileToken: string;
4815
4901
  };
4816
4902
  MintTokensResponse: {
4817
4903
  minted?: components["schemas"]["MintedToken"][] | null;
@@ -5415,7 +5501,13 @@ export interface components {
5415
5501
  RiskTier: {
5416
5502
  initialMarginRatio?: string | null;
5417
5503
  maintenanceMarginRatio?: string | null;
5504
+ /**
5505
+ * @deprecated
5506
+ * @description DEPRECATED compatibility alias. This value is a maximum absolute base-asset quantity, not a notional. Use maxPositionSize.
5507
+ */
5418
5508
  maxPositionNotional?: string | null;
5509
+ /** @description Maximum authoritative absolute position size in base-asset quantity. */
5510
+ maxPositionSize?: string | null;
5419
5511
  };
5420
5512
  /** @description Per-pair screener row. Window fields null when insufficient history. */
5421
5513
  ScreenerItem: {
@@ -5615,10 +5707,15 @@ export interface components {
5615
5707
  /** Format: uuid */
5616
5708
  tradingPairId?: string | null;
5617
5709
  side?: string | null;
5710
+ /**
5711
+ * @description Deprecated compatibility value. `side` is authoritative; when present,
5712
+ * BUY must carry LONG and SELL must carry SHORT.
5713
+ */
5618
5714
  positionSide?: string | null;
5619
5715
  orderType?: string | null;
5620
5716
  price?: string | null;
5621
5717
  quantity?: string | null;
5718
+ /** @description Required for normal orders; optional and ignored for reduce-only. */
5622
5719
  leverage?: string | null;
5623
5720
  reduceOnly?: boolean | null;
5624
5721
  };
@@ -5657,10 +5754,12 @@ export interface components {
5657
5754
  /** Format: uuid */
5658
5755
  tradingPairId?: string | null;
5659
5756
  side?: string | null;
5757
+ /** @description Deprecated compatibility value; `side` is authoritative. */
5660
5758
  positionSide?: string | null;
5661
5759
  orderType?: string | null;
5662
5760
  price?: string | null;
5663
5761
  quantity?: string | null;
5762
+ /** @description Required for normal orders; optional and ignored for reduce-only. */
5664
5763
  leverage?: string | null;
5665
5764
  reduceOnly?: boolean | null;
5666
5765
  };
@@ -5669,10 +5768,12 @@ export interface components {
5669
5768
  tradingPairId?: string | null;
5670
5769
  strategyKey?: string | null;
5671
5770
  side?: string | null;
5771
+ /** @description Deprecated compatibility value; `side` is authoritative. */
5672
5772
  positionSide?: string | null;
5673
5773
  orderType?: string | null;
5674
5774
  price?: string | null;
5675
5775
  quantity?: string | null;
5776
+ /** @description Required for normal orders; optional and ignored for reduce-only. */
5676
5777
  leverage?: string | null;
5677
5778
  reduceOnly?: boolean | null;
5678
5779
  /** @description Risk bucket mode. Defaults to ISOLATED. Values: ISOLATED, CROSS. */
@@ -5814,6 +5915,12 @@ export interface components {
5814
5915
  /** Format: int32 */
5815
5916
  slippageToleranceBps?: number | null;
5816
5917
  expiresAt?: string | null;
5918
+ /**
5919
+ * @description Resolve the full live position size when triggered. Mutually exclusive
5920
+ * with quantity. For compatibility, omitting both quantity and this field
5921
+ * also means full-position close.
5922
+ */
5923
+ closePosition?: boolean | null;
5817
5924
  };
5818
5925
  /** @description Core fields of a single executed trade, nested under `data` in the public trade event envelope. */
5819
5926
  TradeData: {
@@ -7964,6 +8071,47 @@ export interface operations {
7964
8071
  };
7965
8072
  };
7966
8073
  };
8074
+ get_faucet_info: {
8075
+ parameters: {
8076
+ query?: never;
8077
+ header?: never;
8078
+ path?: never;
8079
+ cookie?: never;
8080
+ };
8081
+ requestBody?: never;
8082
+ responses: {
8083
+ /** @description OK */
8084
+ 200: {
8085
+ headers: {
8086
+ [name: string]: unknown;
8087
+ };
8088
+ content: {
8089
+ "application/json": components["schemas"]["GetFaucetInfoResponse"];
8090
+ };
8091
+ };
8092
+ /** @description Authentication required */
8093
+ 401: {
8094
+ headers: {
8095
+ [name: string]: unknown;
8096
+ };
8097
+ content?: never;
8098
+ };
8099
+ /** @description Internal server error */
8100
+ 500: {
8101
+ headers: {
8102
+ [name: string]: unknown;
8103
+ };
8104
+ content?: never;
8105
+ };
8106
+ /** @description Faucet quota configuration unavailable; safe to retry */
8107
+ 503: {
8108
+ headers: {
8109
+ [name: string]: unknown;
8110
+ };
8111
+ content?: never;
8112
+ };
8113
+ };
8114
+ };
7967
8115
  mint_tokens: {
7968
8116
  parameters: {
7969
8117
  query?: never;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@0xmonaco/types",
3
- "version": "1.0.21",
3
+ "version": "1.0.25-develop.1fab96c",
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.21",
23
+ "@0xmonaco/contracts": "1.0.25-develop.1fab96c",
24
24
  "zod": "^4.1.12"
25
25
  },
26
26
  "peerDependencies": {