@0xmonaco/types 1.0.2 → 1.0.7
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/faucet/index.d.ts
CHANGED
|
@@ -45,10 +45,15 @@ export interface FaucetAPI extends BaseAPI {
|
|
|
45
45
|
/**
|
|
46
46
|
* Mints the full set of testnet tokens to the authenticated user.
|
|
47
47
|
*
|
|
48
|
-
* Testnet-only and rate-limited; see the module note.
|
|
49
|
-
*
|
|
48
|
+
* Testnet-only and rate-limited; see the module note. The call is
|
|
49
|
+
* synchronous and resolves only when every faucet transaction confirmed
|
|
50
|
+
* on-chain (HTTP 200). Failures reject with meaningful status codes:
|
|
51
|
+
* 429 when the daily quota is exhausted, 502 when transactions failed or
|
|
52
|
+
* were only partially confirmed on-chain (the error details carry the
|
|
53
|
+
* minted/failed breakdown; delivered legs still consume the quota), and
|
|
54
|
+
* 503 when the faucet is unavailable (nothing credited, safe to retry).
|
|
50
55
|
*
|
|
51
|
-
* @returns Promise resolving to the minted
|
|
56
|
+
* @returns Promise resolving to the minted tokens and remaining quota
|
|
52
57
|
*/
|
|
53
58
|
mint(): Promise<MintTokensResponse>;
|
|
54
59
|
}
|
|
@@ -145,6 +145,14 @@ export interface SimulateOrderRiskResponse {
|
|
|
145
145
|
maintenanceMarginRequiredAfter: string;
|
|
146
146
|
freeCollateralAfter: string;
|
|
147
147
|
estimatedFee?: string;
|
|
148
|
+
/**
|
|
149
|
+
* Estimated liquidation mark-price. In ISOLATED mode, this is the
|
|
150
|
+
* position/risk-bucket threshold. In CROSS mode, it is conditional: it varies
|
|
151
|
+
* only the target position's mark while all other marks in the cross risk
|
|
152
|
+
* bucket remain unchanged. Other position marks, funding, realized PnL,
|
|
153
|
+
* fees/reserves, and collateral can change it. Treat an absent or blank value
|
|
154
|
+
* as unavailable, never as zero.
|
|
155
|
+
*/
|
|
148
156
|
estimatedLiquidationPrice?: string;
|
|
149
157
|
}
|
|
150
158
|
export interface MarginAccountsAPI extends BaseAPI {
|
|
@@ -28,6 +28,14 @@ export interface Position {
|
|
|
28
28
|
* the market initial-margin floor; zero without open exposure.
|
|
29
29
|
*/
|
|
30
30
|
initialMarginRequired?: string;
|
|
31
|
+
/**
|
|
32
|
+
* Liquidation mark-price threshold. In ISOLATED mode, this is the
|
|
33
|
+
* position/risk-bucket threshold. In CROSS mode, it is conditional: it varies
|
|
34
|
+
* only this position's mark while all other marks in the cross risk bucket
|
|
35
|
+
* remain unchanged. Other position marks, funding, realized PnL,
|
|
36
|
+
* fees/reserves, and collateral can change it. Treat an absent or blank value
|
|
37
|
+
* as unavailable, never as zero.
|
|
38
|
+
*/
|
|
31
39
|
liquidationPrice: string;
|
|
32
40
|
status: PositionStatus;
|
|
33
41
|
updatedAt: string;
|
|
@@ -84,6 +92,14 @@ export interface PositionRisk {
|
|
|
84
92
|
markPrice: string;
|
|
85
93
|
indexPrice?: string;
|
|
86
94
|
unrealizedPnl: string;
|
|
95
|
+
/**
|
|
96
|
+
* Liquidation mark-price threshold. In ISOLATED mode, this is the
|
|
97
|
+
* position/risk-bucket threshold. In CROSS mode, it is conditional: it varies
|
|
98
|
+
* only this position's mark while all other marks in the cross risk bucket
|
|
99
|
+
* remain unchanged. Other position marks, funding, realized PnL,
|
|
100
|
+
* fees/reserves, and collateral can change it. Treat an absent or blank value
|
|
101
|
+
* as unavailable, never as zero.
|
|
102
|
+
*/
|
|
87
103
|
liquidationPrice: string;
|
|
88
104
|
marginRatio: string;
|
|
89
105
|
/**
|
|
@@ -138,17 +154,45 @@ export interface ListPositionHistoryParams {
|
|
|
138
154
|
tradingPairId?: string;
|
|
139
155
|
page?: number;
|
|
140
156
|
pageSize?: number;
|
|
157
|
+
/** Return only per-execution position reductions, closes, and liquidations. */
|
|
158
|
+
reductionOnly?: boolean;
|
|
141
159
|
}
|
|
142
160
|
export interface PositionHistoryEvent {
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
161
|
+
/** Wire-format event ID. */
|
|
162
|
+
id: string;
|
|
163
|
+
/** @deprecated Use id. */
|
|
164
|
+
event_id?: string;
|
|
165
|
+
positionId: string;
|
|
166
|
+
marginAccountId: string;
|
|
167
|
+
tradingPairId: string;
|
|
168
|
+
/** Lifecycle action from the API, for example DECREASE or CLOSE. */
|
|
169
|
+
action: string;
|
|
170
|
+
/** @deprecated Use action. */
|
|
171
|
+
eventType?: string;
|
|
172
|
+
/** Signed quantity change for lifecycle rows. */
|
|
173
|
+
sizeChange?: string;
|
|
174
|
+
/** @deprecated Use sizeChange. */
|
|
148
175
|
quantity?: string;
|
|
149
176
|
price?: string;
|
|
150
177
|
realizedPnl?: string;
|
|
151
|
-
|
|
178
|
+
feesPaid?: string;
|
|
179
|
+
collateralChange?: string;
|
|
180
|
+
orderId?: string;
|
|
181
|
+
createdAt: string;
|
|
182
|
+
/** @deprecated Use createdAt. */
|
|
183
|
+
timestamp?: string;
|
|
184
|
+
/** Average entry price before this reducing execution. */
|
|
185
|
+
entryPrice?: string;
|
|
186
|
+
/** Initial margin allocated to this reducing execution. */
|
|
187
|
+
allocatedInitialMargin?: string;
|
|
188
|
+
/** Funding allocated to this reducing execution; positive means paid. */
|
|
189
|
+
fundingPaid?: string;
|
|
190
|
+
/** Realized PnL after trading fees and funding. */
|
|
191
|
+
netRealizedPnl?: string;
|
|
192
|
+
/** Realized return on the allocated initial margin, as a percentage. */
|
|
193
|
+
realizedRoe?: string;
|
|
194
|
+
/** Side of the position before this reducing execution. */
|
|
195
|
+
positionSide?: "LONG" | "SHORT";
|
|
152
196
|
}
|
|
153
197
|
export interface ListPositionHistoryResponse {
|
|
154
198
|
events: PositionHistoryEvent[];
|
|
@@ -90,6 +90,7 @@ export declare const ListPositionHistorySchema: z.ZodObject<{
|
|
|
90
90
|
positionId: z.ZodOptional<z.ZodUUID>;
|
|
91
91
|
marginAccountId: z.ZodOptional<z.ZodUUID>;
|
|
92
92
|
tradingPairId: z.ZodOptional<z.ZodUUID>;
|
|
93
|
+
reductionOnly: z.ZodOptional<z.ZodBoolean>;
|
|
93
94
|
}, z.core.$strip>;
|
|
94
95
|
export declare const GetPositionPnlHistorySchema: z.ZodObject<{
|
|
95
96
|
positionId: z.ZodUUID;
|
|
@@ -94,6 +94,7 @@ export const ListPositionHistorySchema = PaginationSchema.extend({
|
|
|
94
94
|
positionId: UUIDSchema.optional(),
|
|
95
95
|
marginAccountId: UUIDSchema.optional(),
|
|
96
96
|
tradingPairId: UUIDSchema.optional(),
|
|
97
|
+
reductionOnly: z.boolean().optional(),
|
|
97
98
|
});
|
|
98
99
|
const PnlHistoryIntervalSchema = z.enum(["1m", "5m", "15m", "1h", "4h", "1d"], {
|
|
99
100
|
message: 'Interval must be one of "1m", "5m", "15m", "1h", "4h", "1d"',
|
package/dist/wire/schema.d.ts
CHANGED
|
@@ -671,7 +671,8 @@ export interface paths {
|
|
|
671
671
|
* @description Mint all testnet tokens.
|
|
672
672
|
*
|
|
673
673
|
* Mint all available testnet tokens to the authenticated user's address.
|
|
674
|
-
* Rate limited per 24 hours.
|
|
674
|
+
* Rate limited per 24 hours. The request is synchronous: it returns 200
|
|
675
|
+
* only once every faucet transaction is confirmed on-chain.
|
|
675
676
|
*/
|
|
676
677
|
post: operations["mint_tokens"];
|
|
677
678
|
delete?: never;
|
|
@@ -3993,6 +3994,14 @@ export interface components {
|
|
|
3993
3994
|
* position has no open exposure.
|
|
3994
3995
|
*/
|
|
3995
3996
|
initialMarginRequired?: string | null;
|
|
3997
|
+
/**
|
|
3998
|
+
* @description Liquidation mark-price threshold. In ISOLATED mode, this is the
|
|
3999
|
+
* position/risk-bucket threshold. In CROSS mode, it is conditional: it varies
|
|
4000
|
+
* only this position's mark while all other marks in the cross risk bucket
|
|
4001
|
+
* remain unchanged. Other position marks, funding, realized PnL,
|
|
4002
|
+
* fees/reserves, and collateral can change it. Treat an absent or blank value
|
|
4003
|
+
* as unavailable, never as zero.
|
|
4004
|
+
*/
|
|
3996
4005
|
liquidationPrice?: string | null;
|
|
3997
4006
|
status?: string | null;
|
|
3998
4007
|
updatedAt?: string | null;
|
|
@@ -4004,6 +4013,14 @@ export interface components {
|
|
|
4004
4013
|
markPrice?: string | null;
|
|
4005
4014
|
indexPrice?: string | null;
|
|
4006
4015
|
unrealizedPnl?: string | null;
|
|
4016
|
+
/**
|
|
4017
|
+
* @description Liquidation mark-price threshold. In ISOLATED mode, this is the
|
|
4018
|
+
* position/risk-bucket threshold. In CROSS mode, it is conditional: it varies
|
|
4019
|
+
* only this position's mark while all other marks in the cross risk bucket
|
|
4020
|
+
* remain unchanged. Other position marks, funding, realized PnL,
|
|
4021
|
+
* fees/reserves, and collateral can change it. Treat an absent or blank value
|
|
4022
|
+
* as unavailable, never as zero.
|
|
4023
|
+
*/
|
|
4007
4024
|
liquidationPrice?: string | null;
|
|
4008
4025
|
marginRatio?: string | null;
|
|
4009
4026
|
/**
|
|
@@ -4888,6 +4905,14 @@ export interface components {
|
|
|
4888
4905
|
* position has no open exposure.
|
|
4889
4906
|
*/
|
|
4890
4907
|
initialMarginRequired?: string | null;
|
|
4908
|
+
/**
|
|
4909
|
+
* @description Liquidation mark-price threshold. In ISOLATED mode, this is the
|
|
4910
|
+
* position/risk-bucket threshold. In CROSS mode, it is conditional: it varies
|
|
4911
|
+
* only this position's mark while all other marks in the cross risk bucket
|
|
4912
|
+
* remain unchanged. Other position marks, funding, realized PnL,
|
|
4913
|
+
* fees/reserves, and collateral can change it. Treat an absent or blank value
|
|
4914
|
+
* as unavailable, never as zero.
|
|
4915
|
+
*/
|
|
4891
4916
|
liquidationPrice?: string | null;
|
|
4892
4917
|
status?: string | null;
|
|
4893
4918
|
updatedAt?: string | null;
|
|
@@ -4909,6 +4934,18 @@ export interface components {
|
|
|
4909
4934
|
/** Format: uuid */
|
|
4910
4935
|
orderId?: string | null;
|
|
4911
4936
|
createdAt?: string | null;
|
|
4937
|
+
/** @description Average entry price immediately before this reduction execution. */
|
|
4938
|
+
entryPrice?: string | null;
|
|
4939
|
+
/** @description Initial margin allocated pro rata to this reduction execution. */
|
|
4940
|
+
allocatedInitialMargin?: string | null;
|
|
4941
|
+
/** @description Funding allocated pro rata to this reduction; positive means paid. */
|
|
4942
|
+
fundingPaid?: string | null;
|
|
4943
|
+
/** @description Realized PnL after trading fees and funding for this reduction execution. */
|
|
4944
|
+
netRealizedPnl?: string | null;
|
|
4945
|
+
/** @description Net realized PnL divided by allocated_initial_margin, expressed as a percentage. */
|
|
4946
|
+
realizedRoe?: string | null;
|
|
4947
|
+
/** @description Position side immediately before this reduction execution. */
|
|
4948
|
+
positionSide?: string | null;
|
|
4912
4949
|
};
|
|
4913
4950
|
/**
|
|
4914
4951
|
* @description One PnL state sample for a position in one bucket. Cumulative fields are
|
|
@@ -5330,6 +5367,14 @@ export interface components {
|
|
|
5330
5367
|
maintenanceMarginRequiredAfter?: string | null;
|
|
5331
5368
|
freeCollateralAfter?: string | null;
|
|
5332
5369
|
estimatedFee?: string | null;
|
|
5370
|
+
/**
|
|
5371
|
+
* @description Estimated liquidation mark-price. In ISOLATED mode, this is the
|
|
5372
|
+
* position/risk-bucket threshold. In CROSS mode, it is conditional: it varies
|
|
5373
|
+
* only the target position's mark while all other marks in the cross risk
|
|
5374
|
+
* bucket remain unchanged. Other position marks, funding, realized PnL,
|
|
5375
|
+
* fees/reserves, and collateral can change it. Treat an absent or blank value
|
|
5376
|
+
* as unavailable, never as zero.
|
|
5377
|
+
*/
|
|
5333
5378
|
estimatedLiquidationPrice?: string | null;
|
|
5334
5379
|
/**
|
|
5335
5380
|
* @description The margin account the simulation was resolved against. Always populated;
|
|
@@ -7504,6 +7549,20 @@ export interface operations {
|
|
|
7504
7549
|
};
|
|
7505
7550
|
content?: never;
|
|
7506
7551
|
};
|
|
7552
|
+
/** @description Faucet transactions failed or were only partially confirmed on-chain; the error details carry the minted/failed breakdown. Do not blindly retry: delivered legs consume the daily quota */
|
|
7553
|
+
502: {
|
|
7554
|
+
headers: {
|
|
7555
|
+
[name: string]: unknown;
|
|
7556
|
+
};
|
|
7557
|
+
content?: never;
|
|
7558
|
+
};
|
|
7559
|
+
/** @description Faucet unavailable (not configured, resolver down, or reply timed out); nothing is known to have been credited, safe to retry */
|
|
7560
|
+
503: {
|
|
7561
|
+
headers: {
|
|
7562
|
+
[name: string]: unknown;
|
|
7563
|
+
};
|
|
7564
|
+
content?: never;
|
|
7565
|
+
};
|
|
7507
7566
|
};
|
|
7508
7567
|
};
|
|
7509
7568
|
simulate_fees: {
|
|
@@ -9223,6 +9282,8 @@ export interface operations {
|
|
|
9223
9282
|
page?: number;
|
|
9224
9283
|
/** @description Items per page (max 100) */
|
|
9225
9284
|
pageSize?: number;
|
|
9285
|
+
/** @description When true, return only DECREASE, CLOSE, and LIQUIDATE execution rows. */
|
|
9286
|
+
reductionOnly?: boolean;
|
|
9226
9287
|
};
|
|
9227
9288
|
header?: never;
|
|
9228
9289
|
path?: never;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@0xmonaco/types",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.7",
|
|
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.7",
|
|
24
24
|
"zod": "^4.1.12"
|
|
25
25
|
},
|
|
26
26
|
"peerDependencies": {
|