@polymarket/bindings 0.12.0 → 0.14.0
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/chunk-JPPG656Y.js +2 -0
- package/dist/chunk-JPPG656Y.js.map +1 -0
- package/dist/chunk-YXNKEMRF.js +2 -0
- package/dist/chunk-YXNKEMRF.js.map +1 -0
- package/dist/chunk-ZMJTXTXA.js +2 -0
- package/dist/chunk-ZMJTXTXA.js.map +1 -0
- package/dist/clob/index.d.ts +489 -8
- package/dist/clob/index.js +1 -1
- package/dist/clob/index.js.map +1 -1
- package/dist/combos/index.d.ts +1 -1
- package/dist/combos/index.js +1 -1
- package/dist/combos/index.js.map +1 -1
- package/dist/{comment-CKJIqOZS.d.ts → comment-tQ-L48Di.d.ts} +2 -2
- package/dist/data/index.d.ts +446 -10
- package/dist/data/index.js +1 -1
- package/dist/data/index.js.map +1 -1
- package/dist/gamma/index.d.ts +79 -4
- package/dist/gamma/index.js +1 -1
- package/dist/gamma/index.js.map +1 -1
- package/dist/index.d.ts +108 -213
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/{orders-BMW5PN-Q.d.ts → orders-SIFuRgWc.d.ts} +608 -35
- package/dist/perps/index.d.ts +995 -4
- package/dist/perps/index.js +1 -1
- package/dist/perps/index.js.map +1 -1
- package/dist/relayer/index.d.ts +1 -1
- package/dist/relayer/index.js +1 -1
- package/dist/shared-QrXQ5O6x.d.ts +223 -0
- package/dist/subscriptions/index.d.ts +668 -78
- package/dist/subscriptions/index.js +1 -1
- package/dist/subscriptions/index.js.map +1 -1
- package/package.json +2 -2
- package/dist/chunk-2FRDSBWY.js +0 -2
- package/dist/chunk-2FRDSBWY.js.map +0 -1
- package/dist/chunk-3IZ4N7C2.js +0 -2
- package/dist/chunk-3IZ4N7C2.js.map +0 -1
- package/dist/chunk-DAWT25YZ.js +0 -2
- package/dist/chunk-DAWT25YZ.js.map +0 -1
package/dist/perps/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as _polymarket_types from '@polymarket/types';
|
|
2
|
-
import { P as PerpsInstrumentId, a as PerpsEntityId, b as PerpsFundingPaymentId, c as PerpsDepositStatus, d as PerpsInternalTransferId, e as PerpsKnownInternalTransferType, f as PerpsInternalTransferDirection, g as PerpsWithdrawalId, h as PerpsKnownWithdrawalStatus, i as PerpsInstrumentType, j as PerpsInstrumentCategory, k as PerpsTradeId, l as PerpsSide } from '../orders-
|
|
3
|
-
export { F as FetchPerpsBuilderApprovalsResponseSchema,
|
|
4
|
-
import { DecimalString, EpochMilliseconds, BaseUnits } from '../
|
|
2
|
+
import { P as PerpsInstrumentId, a as PerpsEntityId, b as PerpsFundingPaymentId, c as PerpsDepositStatus, d as PerpsInternalTransferId, e as PerpsKnownInternalTransferType, f as PerpsInternalTransferDirection, g as PerpsWithdrawalId, h as PerpsKnownWithdrawalStatus, i as PerpsInstrumentType, j as PerpsInstrumentCategory, k as PerpsTradeId, l as PerpsSide, m as PerpsClientOrderId, n as PerpsOrderId } from '../orders-SIFuRgWc.js';
|
|
3
|
+
export { C as CreatePerpsChaseResponseSchema, F as FetchPerpsBuilderApprovalsResponseSchema, o as FetchPerpsChasesResponseSchema, p as FetchPerpsOpenOrdersResponseSchema, q as FetchPerpsOrdersResponseSchema, r as FetchPerpsUnreadNotificationsCountResponseSchema, L as ListPerpsBuilderEarningsResponseSchema, s as ListPerpsFillsResponseSchema, t as ListPerpsNotificationsResponseSchema, M as MarkPerpsNotificationsReadResponseSchema, u as PerpsAccountFill, v as PerpsAccountFillSchema, w as PerpsAccountFillUpdateSchema, x as PerpsAssetSchema, y as PerpsBuilderApproval, z as PerpsBuilderApprovalSchema, A as PerpsBuilderEarning, B as PerpsBuilderEarningId, D as PerpsBuilderEarningIdSchema, E as PerpsBuilderEarningSchema, G as PerpsBuilderEarningsAsset, H as PerpsBuilderEarningsAssetSchema, I as PerpsBuilderEarningsSnapshot, J as PerpsBuilderEarningsSnapshotSchema, K as PerpsBuilderEarningsSummary, N as PerpsBuilderEarningsSummarySchema, O as PerpsBuilderStatus, Q as PerpsBuilderStatusSchema, R as PerpsBuilderTerms, S as PerpsBuilderTermsSchema, T as PerpsCancelAllOrdersResponse, U as PerpsCancelAllOrdersResponseSchema, V as PerpsCancelOrderErrorCode, W as PerpsCancelOrderErrorCodeSchema, X as PerpsCancelOrderResult, Y as PerpsCancelOrderResultSchema, Z as PerpsChase, _ as PerpsChaseAccepted, $ as PerpsChaseAcceptedSchema, a0 as PerpsChaseId, a1 as PerpsChaseIdSchema, a2 as PerpsChaseSchema, a3 as PerpsClientOrderIdSchema, a4 as PerpsCommandAck, a5 as PerpsCommandAckSchema, a6 as PerpsCommandStatusSchema, a7 as PerpsCredentials, a8 as PerpsDataResponseSchema, a9 as PerpsDecimal, aa as PerpsDecimalInput, ab as PerpsDecimalInputSchema, ac as PerpsDepositAmount, ad as PerpsDepositStatusSchema, ae as PerpsEntityIdSchema, af as PerpsFundingInterval, ag as PerpsFundingIntervalSchema, ah as PerpsFundingPaymentIdSchema, ai as PerpsInstrumentCategorySchema, aj as PerpsInstrumentIdSchema, ak as PerpsInstrumentTypeSchema, al as PerpsInternalTransferDirectionSchema, am as PerpsInternalTransferIdSchema, an as PerpsInternalTransferType, ao as PerpsInternalTransferTypeSchema, ap as PerpsKlineInterval, aq as PerpsKlineIntervalSchema, ar as PerpsKnownCancelOrderErrorCode, as as PerpsLimitOrderCanceledNotification, at as PerpsLimitOrderCanceledNotificationSchema, au as PerpsLiquidationDetails, av as PerpsLiquidationDetailsSchema, aw as PerpsLiquidationMethod, ax as PerpsLiquidationWarningNotification, ay as PerpsLiquidationWarningNotificationSchema, az as PerpsLiquidityRole, aA as PerpsMarginType, aB as PerpsMarginTypeSchema, aC as PerpsNotification, aD as PerpsNotificationEntry, aE as PerpsNotificationEntrySchema, aF as PerpsNotificationId, aG as PerpsNotificationIdSchema, aH as PerpsNotificationOrderType, aI as PerpsNotificationOrderTypeSchema, aJ as PerpsNotificationSchema, aK as PerpsNotificationType, aL as PerpsNotificationTypeSchema, aM as PerpsOrder, aN as PerpsOrderIdSchema, aO as PerpsOrderSchema, aP as PerpsOrderStatus, aQ as PerpsOrderStatusSchema, aR as PerpsOrderUpdateSchema, aS as PerpsPnlInterval, aT as PerpsPnlIntervalSchema, aU as PerpsPositionChangeNotification, aV as PerpsPositionChangeNotificationSchema, aW as PerpsPositionClosedNotification, aX as PerpsPositionClosedNotificationSchema, aY as PerpsPositionDeleveragedNotification, aZ as PerpsPositionDeleveragedNotificationSchema, a_ as PerpsPositionLiquidatedNotification, a$ as PerpsPositionLiquidatedNotificationSchema, b0 as PerpsPostOrderAck, b1 as PerpsPostOrderAckSchema, b2 as PerpsSideSchema, b3 as PerpsSortDirection, b4 as PerpsSortDirectionSchema, b5 as PerpsTimeInForce, b6 as PerpsTimeInForceSchema, b7 as PerpsTpSlKind, b8 as PerpsTpSlKindSchema, b9 as PerpsTpSlOrderFields, ba as PerpsTpSlOrderFieldsSchema, bb as PerpsTpSlScope, bc as PerpsTpSlScopeSchema, bd as PerpsTradeIdSchema, be as PerpsTxHash, bf as PerpsTxHashSchema, bg as PerpsUpdateLeverageBatchResult, bh as PerpsUpdateLeverageBatchResultSchema, bi as PerpsUpdateLeverageRejection, bj as PerpsUpdateLeverageRejectionSchema, bk as PerpsUpdateLeverageResult, bl as PerpsUpdateLeverageResultSchema, bm as PerpsWithdrawalAmount, bn as PerpsWithdrawalIdSchema, bo as PerpsWithdrawalStatus, bp as PerpsWithdrawalStatusSchema, bq as decimalString, br as perpsBaseUnits, bs as perpsDecimal } from '../orders-SIFuRgWc.js';
|
|
4
|
+
import { y as DecimalString, H as EpochMilliseconds, B as BaseUnits, af as OrderSide } from '../shared-QrXQ5O6x.js';
|
|
5
5
|
import { z } from 'zod';
|
|
6
6
|
|
|
7
7
|
/**
|
|
@@ -101,6 +101,7 @@ declare const PerpsPortfolioPositionSchema: z.ZodPipe<z.ZodObject<{
|
|
|
101
101
|
unrealized_pnl: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
|
|
102
102
|
return_on_equity: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
|
|
103
103
|
cumulative_funding: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
|
|
104
|
+
adl_index: z.ZodUnion<readonly [z.ZodLiteral<0>, z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>]>;
|
|
104
105
|
}, z.core.$strip>, z.ZodTransform<{
|
|
105
106
|
instrumentId: PerpsInstrumentId;
|
|
106
107
|
symbol: string;
|
|
@@ -115,6 +116,8 @@ declare const PerpsPortfolioPositionSchema: z.ZodPipe<z.ZodObject<{
|
|
|
115
116
|
unrealizedPnl: DecimalString;
|
|
116
117
|
returnOnEquity: DecimalString;
|
|
117
118
|
cumulativeFunding: DecimalString;
|
|
119
|
+
/** Auto-deleveraging risk tier; higher values indicate higher risk. */
|
|
120
|
+
adlIndex: 0 | 1 | 2 | 3;
|
|
118
121
|
}, {
|
|
119
122
|
instrument_id: PerpsInstrumentId;
|
|
120
123
|
symbol: string;
|
|
@@ -129,6 +132,7 @@ declare const PerpsPortfolioPositionSchema: z.ZodPipe<z.ZodObject<{
|
|
|
129
132
|
unrealized_pnl: DecimalString;
|
|
130
133
|
return_on_equity: DecimalString;
|
|
131
134
|
cumulative_funding: DecimalString;
|
|
135
|
+
adl_index: 0 | 1 | 2 | 3;
|
|
132
136
|
}>>;
|
|
133
137
|
/**
|
|
134
138
|
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
@@ -139,6 +143,7 @@ type PerpsPortfolioPosition = z.infer<typeof PerpsPortfolioPositionSchema>;
|
|
|
139
143
|
*/
|
|
140
144
|
declare const PerpsMarginSummarySchema: z.ZodObject<{
|
|
141
145
|
totalAccountValue: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
|
|
146
|
+
availableOrderMargin: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
|
|
142
147
|
totalInitialMargin: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
|
|
143
148
|
totalMaintenanceMargin: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
|
|
144
149
|
totalPositionValue: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
|
|
@@ -165,6 +170,7 @@ declare const PerpsPortfolioSchema: z.ZodPipe<z.ZodObject<{
|
|
|
165
170
|
unrealized_pnl: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
|
|
166
171
|
return_on_equity: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
|
|
167
172
|
cumulative_funding: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
|
|
173
|
+
adl_index: z.ZodUnion<readonly [z.ZodLiteral<0>, z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>]>;
|
|
168
174
|
}, z.core.$strip>, z.ZodTransform<{
|
|
169
175
|
instrumentId: PerpsInstrumentId;
|
|
170
176
|
symbol: string;
|
|
@@ -179,6 +185,8 @@ declare const PerpsPortfolioSchema: z.ZodPipe<z.ZodObject<{
|
|
|
179
185
|
unrealizedPnl: DecimalString;
|
|
180
186
|
returnOnEquity: DecimalString;
|
|
181
187
|
cumulativeFunding: DecimalString;
|
|
188
|
+
/** Auto-deleveraging risk tier; higher values indicate higher risk. */
|
|
189
|
+
adlIndex: 0 | 1 | 2 | 3;
|
|
182
190
|
}, {
|
|
183
191
|
instrument_id: PerpsInstrumentId;
|
|
184
192
|
symbol: string;
|
|
@@ -193,25 +201,30 @@ declare const PerpsPortfolioSchema: z.ZodPipe<z.ZodObject<{
|
|
|
193
201
|
unrealized_pnl: DecimalString;
|
|
194
202
|
return_on_equity: DecimalString;
|
|
195
203
|
cumulative_funding: DecimalString;
|
|
204
|
+
adl_index: 0 | 1 | 2 | 3;
|
|
196
205
|
}>>>;
|
|
197
206
|
margin: z.ZodPipe<z.ZodObject<{
|
|
198
207
|
total_account_value: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
|
|
208
|
+
available_order_margin: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
|
|
199
209
|
total_initial_margin: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
|
|
200
210
|
total_maintenance_margin: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
|
|
201
211
|
total_position_value: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
|
|
202
212
|
}, z.core.$strip>, z.ZodTransform<{
|
|
203
213
|
totalAccountValue: DecimalString;
|
|
214
|
+
availableOrderMargin: DecimalString;
|
|
204
215
|
totalInitialMargin: DecimalString;
|
|
205
216
|
totalMaintenanceMargin: DecimalString;
|
|
206
217
|
totalPositionValue: DecimalString;
|
|
207
218
|
}, {
|
|
208
219
|
total_account_value: DecimalString;
|
|
220
|
+
available_order_margin: DecimalString;
|
|
209
221
|
total_initial_margin: DecimalString;
|
|
210
222
|
total_maintenance_margin: DecimalString;
|
|
211
223
|
total_position_value: DecimalString;
|
|
212
224
|
}>>;
|
|
213
225
|
withdrawable: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
|
|
214
226
|
in_liquidation: z.ZodBoolean;
|
|
227
|
+
fee_tier: z.ZodNumber;
|
|
215
228
|
timestamp: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
|
|
216
229
|
}, z.core.$strip>, z.ZodTransform<{
|
|
217
230
|
positions: {
|
|
@@ -228,15 +241,20 @@ declare const PerpsPortfolioSchema: z.ZodPipe<z.ZodObject<{
|
|
|
228
241
|
unrealizedPnl: DecimalString;
|
|
229
242
|
returnOnEquity: DecimalString;
|
|
230
243
|
cumulativeFunding: DecimalString;
|
|
244
|
+
/** Auto-deleveraging risk tier; higher values indicate higher risk. */
|
|
245
|
+
adlIndex: 0 | 1 | 2 | 3;
|
|
231
246
|
}[];
|
|
232
247
|
margin: {
|
|
233
248
|
totalAccountValue: DecimalString;
|
|
249
|
+
availableOrderMargin: DecimalString;
|
|
234
250
|
totalInitialMargin: DecimalString;
|
|
235
251
|
totalMaintenanceMargin: DecimalString;
|
|
236
252
|
totalPositionValue: DecimalString;
|
|
237
253
|
};
|
|
238
254
|
withdrawable: DecimalString;
|
|
239
255
|
inLiquidation: boolean;
|
|
256
|
+
/** Zero-based index into the perpetual fee schedule's tiers. */
|
|
257
|
+
feeTier: number;
|
|
240
258
|
timestamp: EpochMilliseconds;
|
|
241
259
|
}, {
|
|
242
260
|
positions: {
|
|
@@ -253,15 +271,19 @@ declare const PerpsPortfolioSchema: z.ZodPipe<z.ZodObject<{
|
|
|
253
271
|
unrealizedPnl: DecimalString;
|
|
254
272
|
returnOnEquity: DecimalString;
|
|
255
273
|
cumulativeFunding: DecimalString;
|
|
274
|
+
/** Auto-deleveraging risk tier; higher values indicate higher risk. */
|
|
275
|
+
adlIndex: 0 | 1 | 2 | 3;
|
|
256
276
|
}[];
|
|
257
277
|
margin: {
|
|
258
278
|
totalAccountValue: DecimalString;
|
|
279
|
+
availableOrderMargin: DecimalString;
|
|
259
280
|
totalInitialMargin: DecimalString;
|
|
260
281
|
totalMaintenanceMargin: DecimalString;
|
|
261
282
|
totalPositionValue: DecimalString;
|
|
262
283
|
};
|
|
263
284
|
withdrawable: DecimalString;
|
|
264
285
|
in_liquidation: boolean;
|
|
286
|
+
fee_tier: number;
|
|
265
287
|
timestamp: EpochMilliseconds;
|
|
266
288
|
}>>;
|
|
267
289
|
/**
|
|
@@ -286,6 +308,7 @@ declare const FetchPerpsPortfolioResponseSchema: z.ZodPipe<z.ZodObject<{
|
|
|
286
308
|
unrealized_pnl: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
|
|
287
309
|
return_on_equity: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
|
|
288
310
|
cumulative_funding: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
|
|
311
|
+
adl_index: z.ZodUnion<readonly [z.ZodLiteral<0>, z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>]>;
|
|
289
312
|
}, z.core.$strip>, z.ZodTransform<{
|
|
290
313
|
instrumentId: PerpsInstrumentId;
|
|
291
314
|
symbol: string;
|
|
@@ -300,6 +323,8 @@ declare const FetchPerpsPortfolioResponseSchema: z.ZodPipe<z.ZodObject<{
|
|
|
300
323
|
unrealizedPnl: DecimalString;
|
|
301
324
|
returnOnEquity: DecimalString;
|
|
302
325
|
cumulativeFunding: DecimalString;
|
|
326
|
+
/** Auto-deleveraging risk tier; higher values indicate higher risk. */
|
|
327
|
+
adlIndex: 0 | 1 | 2 | 3;
|
|
303
328
|
}, {
|
|
304
329
|
instrument_id: PerpsInstrumentId;
|
|
305
330
|
symbol: string;
|
|
@@ -314,25 +339,30 @@ declare const FetchPerpsPortfolioResponseSchema: z.ZodPipe<z.ZodObject<{
|
|
|
314
339
|
unrealized_pnl: DecimalString;
|
|
315
340
|
return_on_equity: DecimalString;
|
|
316
341
|
cumulative_funding: DecimalString;
|
|
342
|
+
adl_index: 0 | 1 | 2 | 3;
|
|
317
343
|
}>>>;
|
|
318
344
|
margin: z.ZodPipe<z.ZodObject<{
|
|
319
345
|
total_account_value: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
|
|
346
|
+
available_order_margin: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
|
|
320
347
|
total_initial_margin: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
|
|
321
348
|
total_maintenance_margin: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
|
|
322
349
|
total_position_value: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
|
|
323
350
|
}, z.core.$strip>, z.ZodTransform<{
|
|
324
351
|
totalAccountValue: DecimalString;
|
|
352
|
+
availableOrderMargin: DecimalString;
|
|
325
353
|
totalInitialMargin: DecimalString;
|
|
326
354
|
totalMaintenanceMargin: DecimalString;
|
|
327
355
|
totalPositionValue: DecimalString;
|
|
328
356
|
}, {
|
|
329
357
|
total_account_value: DecimalString;
|
|
358
|
+
available_order_margin: DecimalString;
|
|
330
359
|
total_initial_margin: DecimalString;
|
|
331
360
|
total_maintenance_margin: DecimalString;
|
|
332
361
|
total_position_value: DecimalString;
|
|
333
362
|
}>>;
|
|
334
363
|
withdrawable: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
|
|
335
364
|
in_liquidation: z.ZodBoolean;
|
|
365
|
+
fee_tier: z.ZodNumber;
|
|
336
366
|
timestamp: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
|
|
337
367
|
}, z.core.$strip>, z.ZodTransform<{
|
|
338
368
|
positions: {
|
|
@@ -349,15 +379,20 @@ declare const FetchPerpsPortfolioResponseSchema: z.ZodPipe<z.ZodObject<{
|
|
|
349
379
|
unrealizedPnl: DecimalString;
|
|
350
380
|
returnOnEquity: DecimalString;
|
|
351
381
|
cumulativeFunding: DecimalString;
|
|
382
|
+
/** Auto-deleveraging risk tier; higher values indicate higher risk. */
|
|
383
|
+
adlIndex: 0 | 1 | 2 | 3;
|
|
352
384
|
}[];
|
|
353
385
|
margin: {
|
|
354
386
|
totalAccountValue: DecimalString;
|
|
387
|
+
availableOrderMargin: DecimalString;
|
|
355
388
|
totalInitialMargin: DecimalString;
|
|
356
389
|
totalMaintenanceMargin: DecimalString;
|
|
357
390
|
totalPositionValue: DecimalString;
|
|
358
391
|
};
|
|
359
392
|
withdrawable: DecimalString;
|
|
360
393
|
inLiquidation: boolean;
|
|
394
|
+
/** Zero-based index into the perpetual fee schedule's tiers. */
|
|
395
|
+
feeTier: number;
|
|
361
396
|
timestamp: EpochMilliseconds;
|
|
362
397
|
}, {
|
|
363
398
|
positions: {
|
|
@@ -374,15 +409,19 @@ declare const FetchPerpsPortfolioResponseSchema: z.ZodPipe<z.ZodObject<{
|
|
|
374
409
|
unrealizedPnl: DecimalString;
|
|
375
410
|
returnOnEquity: DecimalString;
|
|
376
411
|
cumulativeFunding: DecimalString;
|
|
412
|
+
/** Auto-deleveraging risk tier; higher values indicate higher risk. */
|
|
413
|
+
adlIndex: 0 | 1 | 2 | 3;
|
|
377
414
|
}[];
|
|
378
415
|
margin: {
|
|
379
416
|
totalAccountValue: DecimalString;
|
|
417
|
+
availableOrderMargin: DecimalString;
|
|
380
418
|
totalInitialMargin: DecimalString;
|
|
381
419
|
totalMaintenanceMargin: DecimalString;
|
|
382
420
|
totalPositionValue: DecimalString;
|
|
383
421
|
};
|
|
384
422
|
withdrawable: DecimalString;
|
|
385
423
|
in_liquidation: boolean;
|
|
424
|
+
fee_tier: number;
|
|
386
425
|
timestamp: EpochMilliseconds;
|
|
387
426
|
}>>;
|
|
388
427
|
/**
|
|
@@ -1013,6 +1052,31 @@ declare const PerpsRiskTierSchema: z.ZodObject<{
|
|
|
1013
1052
|
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
1014
1053
|
*/
|
|
1015
1054
|
type PerpsRiskTier = z.infer<typeof PerpsRiskTierSchema>;
|
|
1055
|
+
/**
|
|
1056
|
+
* Permanent retirement record. Sequence is an exact nonnegative safe integer;
|
|
1057
|
+
* larger values are rejected. Timestamp is the cutoff for unapplied funding.
|
|
1058
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
1059
|
+
*/
|
|
1060
|
+
type PerpsInstrumentSettlement = {
|
|
1061
|
+
sequence: number;
|
|
1062
|
+
timestamp: EpochMilliseconds;
|
|
1063
|
+
price: DecimalString;
|
|
1064
|
+
insuranceDebit: DecimalString;
|
|
1065
|
+
};
|
|
1066
|
+
/**
|
|
1067
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
1068
|
+
*/
|
|
1069
|
+
declare const PerpsInstrumentSettlementSchema: z.ZodPipe<z.ZodObject<{
|
|
1070
|
+
sequence: z.ZodNumber;
|
|
1071
|
+
timestamp: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
|
|
1072
|
+
price: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
|
|
1073
|
+
insurance_debit: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
|
|
1074
|
+
}, z.core.$strip>, z.ZodTransform<PerpsInstrumentSettlement, {
|
|
1075
|
+
sequence: number;
|
|
1076
|
+
timestamp: EpochMilliseconds;
|
|
1077
|
+
price: DecimalString;
|
|
1078
|
+
insurance_debit: DecimalString;
|
|
1079
|
+
}>>;
|
|
1016
1080
|
/**
|
|
1017
1081
|
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
1018
1082
|
*/
|
|
@@ -1021,6 +1085,19 @@ declare const PerpsInstrumentSchema: z.ZodPipe<z.ZodObject<{
|
|
|
1021
1085
|
instrument_type: z.ZodEnum<typeof PerpsInstrumentType>;
|
|
1022
1086
|
category: z.ZodEnum<typeof PerpsInstrumentCategory>;
|
|
1023
1087
|
symbol: z.ZodString;
|
|
1088
|
+
display_symbol: z.ZodOptional<z.ZodString>;
|
|
1089
|
+
close_only: z.ZodDefault<z.ZodBoolean>;
|
|
1090
|
+
settlement: z.ZodOptional<z.ZodPipe<z.ZodObject<{
|
|
1091
|
+
sequence: z.ZodNumber;
|
|
1092
|
+
timestamp: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
|
|
1093
|
+
price: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
|
|
1094
|
+
insurance_debit: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
|
|
1095
|
+
}, z.core.$strip>, z.ZodTransform<PerpsInstrumentSettlement, {
|
|
1096
|
+
sequence: number;
|
|
1097
|
+
timestamp: EpochMilliseconds;
|
|
1098
|
+
price: DecimalString;
|
|
1099
|
+
insurance_debit: DecimalString;
|
|
1100
|
+
}>>>;
|
|
1024
1101
|
base_asset: z.ZodString;
|
|
1025
1102
|
quote_asset: z.ZodString;
|
|
1026
1103
|
funding_interval: z.ZodPipe<z.ZodString, z.ZodTransform<`${number}h`, string>>;
|
|
@@ -1044,10 +1121,21 @@ declare const PerpsInstrumentSchema: z.ZodPipe<z.ZodObject<{
|
|
|
1044
1121
|
lower_bound: DecimalString;
|
|
1045
1122
|
max_leverage: number;
|
|
1046
1123
|
}>>>;
|
|
1124
|
+
ui_live_time: z.ZodNullable<z.ZodPipe<z.ZodNumber, z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>>>;
|
|
1125
|
+
logo: z.ZodOptional<z.ZodObject<{
|
|
1126
|
+
light: z.ZodString;
|
|
1127
|
+
dark: z.ZodString;
|
|
1128
|
+
}, z.core.$strip>>;
|
|
1047
1129
|
}, z.core.$strip>, z.ZodTransform<{
|
|
1048
1130
|
id: PerpsInstrumentId;
|
|
1049
1131
|
category: PerpsInstrumentCategory;
|
|
1050
1132
|
symbol: string;
|
|
1133
|
+
/** Presentation label; canonical symbol and instrument ID remain unchanged. */
|
|
1134
|
+
displaySymbol: string | undefined;
|
|
1135
|
+
/** Whether new orders must reduce exposure; false for older responses. */
|
|
1136
|
+
closeOnly: boolean;
|
|
1137
|
+
/** Present after permanent retirement; trading cannot resume. */
|
|
1138
|
+
settlement: PerpsInstrumentSettlement | undefined;
|
|
1051
1139
|
baseAsset: string;
|
|
1052
1140
|
quoteAsset: string;
|
|
1053
1141
|
fundingInterval: `${number}h`;
|
|
@@ -1065,11 +1153,19 @@ declare const PerpsInstrumentSchema: z.ZodPipe<z.ZodObject<{
|
|
|
1065
1153
|
lowerBound: DecimalString;
|
|
1066
1154
|
maxLeverage: number;
|
|
1067
1155
|
}[];
|
|
1156
|
+
/** Advisory visibility time; null means hidden. Does not restrict trading. */
|
|
1157
|
+
uiLiveTime: EpochMilliseconds | null;
|
|
1158
|
+
/** Immutable logo URLs for light and dark themes; absent until uploaded. */
|
|
1159
|
+
logo: {
|
|
1160
|
+
light: string;
|
|
1161
|
+
dark: string;
|
|
1162
|
+
} | undefined;
|
|
1068
1163
|
}, {
|
|
1069
1164
|
instrument_id: PerpsInstrumentId;
|
|
1070
1165
|
instrument_type: PerpsInstrumentType.Perpetual;
|
|
1071
1166
|
category: PerpsInstrumentCategory;
|
|
1072
1167
|
symbol: string;
|
|
1168
|
+
close_only: boolean;
|
|
1073
1169
|
base_asset: string;
|
|
1074
1170
|
quote_asset: string;
|
|
1075
1171
|
funding_interval: `${number}h`;
|
|
@@ -1087,6 +1183,13 @@ declare const PerpsInstrumentSchema: z.ZodPipe<z.ZodObject<{
|
|
|
1087
1183
|
lowerBound: DecimalString;
|
|
1088
1184
|
maxLeverage: number;
|
|
1089
1185
|
}[];
|
|
1186
|
+
ui_live_time: EpochMilliseconds | null;
|
|
1187
|
+
display_symbol?: string | undefined;
|
|
1188
|
+
settlement?: PerpsInstrumentSettlement | undefined;
|
|
1189
|
+
logo?: {
|
|
1190
|
+
light: string;
|
|
1191
|
+
dark: string;
|
|
1192
|
+
} | undefined;
|
|
1090
1193
|
}>>;
|
|
1091
1194
|
/**
|
|
1092
1195
|
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
@@ -1100,6 +1203,19 @@ declare const FetchPerpsInstrumentsResponseSchema: z.ZodArray<z.ZodPipe<z.ZodObj
|
|
|
1100
1203
|
instrument_type: z.ZodEnum<typeof PerpsInstrumentType>;
|
|
1101
1204
|
category: z.ZodEnum<typeof PerpsInstrumentCategory>;
|
|
1102
1205
|
symbol: z.ZodString;
|
|
1206
|
+
display_symbol: z.ZodOptional<z.ZodString>;
|
|
1207
|
+
close_only: z.ZodDefault<z.ZodBoolean>;
|
|
1208
|
+
settlement: z.ZodOptional<z.ZodPipe<z.ZodObject<{
|
|
1209
|
+
sequence: z.ZodNumber;
|
|
1210
|
+
timestamp: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
|
|
1211
|
+
price: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
|
|
1212
|
+
insurance_debit: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
|
|
1213
|
+
}, z.core.$strip>, z.ZodTransform<PerpsInstrumentSettlement, {
|
|
1214
|
+
sequence: number;
|
|
1215
|
+
timestamp: EpochMilliseconds;
|
|
1216
|
+
price: DecimalString;
|
|
1217
|
+
insurance_debit: DecimalString;
|
|
1218
|
+
}>>>;
|
|
1103
1219
|
base_asset: z.ZodString;
|
|
1104
1220
|
quote_asset: z.ZodString;
|
|
1105
1221
|
funding_interval: z.ZodPipe<z.ZodString, z.ZodTransform<`${number}h`, string>>;
|
|
@@ -1123,10 +1239,21 @@ declare const FetchPerpsInstrumentsResponseSchema: z.ZodArray<z.ZodPipe<z.ZodObj
|
|
|
1123
1239
|
lower_bound: DecimalString;
|
|
1124
1240
|
max_leverage: number;
|
|
1125
1241
|
}>>>;
|
|
1242
|
+
ui_live_time: z.ZodNullable<z.ZodPipe<z.ZodNumber, z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>>>;
|
|
1243
|
+
logo: z.ZodOptional<z.ZodObject<{
|
|
1244
|
+
light: z.ZodString;
|
|
1245
|
+
dark: z.ZodString;
|
|
1246
|
+
}, z.core.$strip>>;
|
|
1126
1247
|
}, z.core.$strip>, z.ZodTransform<{
|
|
1127
1248
|
id: PerpsInstrumentId;
|
|
1128
1249
|
category: PerpsInstrumentCategory;
|
|
1129
1250
|
symbol: string;
|
|
1251
|
+
/** Presentation label; canonical symbol and instrument ID remain unchanged. */
|
|
1252
|
+
displaySymbol: string | undefined;
|
|
1253
|
+
/** Whether new orders must reduce exposure; false for older responses. */
|
|
1254
|
+
closeOnly: boolean;
|
|
1255
|
+
/** Present after permanent retirement; trading cannot resume. */
|
|
1256
|
+
settlement: PerpsInstrumentSettlement | undefined;
|
|
1130
1257
|
baseAsset: string;
|
|
1131
1258
|
quoteAsset: string;
|
|
1132
1259
|
fundingInterval: `${number}h`;
|
|
@@ -1144,11 +1271,19 @@ declare const FetchPerpsInstrumentsResponseSchema: z.ZodArray<z.ZodPipe<z.ZodObj
|
|
|
1144
1271
|
lowerBound: DecimalString;
|
|
1145
1272
|
maxLeverage: number;
|
|
1146
1273
|
}[];
|
|
1274
|
+
/** Advisory visibility time; null means hidden. Does not restrict trading. */
|
|
1275
|
+
uiLiveTime: EpochMilliseconds | null;
|
|
1276
|
+
/** Immutable logo URLs for light and dark themes; absent until uploaded. */
|
|
1277
|
+
logo: {
|
|
1278
|
+
light: string;
|
|
1279
|
+
dark: string;
|
|
1280
|
+
} | undefined;
|
|
1147
1281
|
}, {
|
|
1148
1282
|
instrument_id: PerpsInstrumentId;
|
|
1149
1283
|
instrument_type: PerpsInstrumentType.Perpetual;
|
|
1150
1284
|
category: PerpsInstrumentCategory;
|
|
1151
1285
|
symbol: string;
|
|
1286
|
+
close_only: boolean;
|
|
1152
1287
|
base_asset: string;
|
|
1153
1288
|
quote_asset: string;
|
|
1154
1289
|
funding_interval: `${number}h`;
|
|
@@ -1166,6 +1301,13 @@ declare const FetchPerpsInstrumentsResponseSchema: z.ZodArray<z.ZodPipe<z.ZodObj
|
|
|
1166
1301
|
lowerBound: DecimalString;
|
|
1167
1302
|
maxLeverage: number;
|
|
1168
1303
|
}[];
|
|
1304
|
+
ui_live_time: EpochMilliseconds | null;
|
|
1305
|
+
display_symbol?: string | undefined;
|
|
1306
|
+
settlement?: PerpsInstrumentSettlement | undefined;
|
|
1307
|
+
logo?: {
|
|
1308
|
+
light: string;
|
|
1309
|
+
dark: string;
|
|
1310
|
+
} | undefined;
|
|
1169
1311
|
}>>>;
|
|
1170
1312
|
/**
|
|
1171
1313
|
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
@@ -1564,6 +1706,7 @@ declare const PerpsPublicTradeSchema: z.ZodPipe<z.ZodObject<{
|
|
|
1564
1706
|
trade_id: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsTradeId, number>>;
|
|
1565
1707
|
instrument_id: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsInstrumentId, number>>;
|
|
1566
1708
|
side: z.ZodEnum<typeof PerpsSide>;
|
|
1709
|
+
settlement: z.ZodDefault<z.ZodBoolean>;
|
|
1567
1710
|
price: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
|
|
1568
1711
|
quantity: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
|
|
1569
1712
|
timestamp: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
|
|
@@ -1572,6 +1715,8 @@ declare const PerpsPublicTradeSchema: z.ZodPipe<z.ZodObject<{
|
|
|
1572
1715
|
tradeId: PerpsTradeId;
|
|
1573
1716
|
instrumentId: PerpsInstrumentId;
|
|
1574
1717
|
side: PerpsSide;
|
|
1718
|
+
/** True for a position close at instrument settlement; false on older responses. */
|
|
1719
|
+
settlement: boolean;
|
|
1575
1720
|
price: DecimalString;
|
|
1576
1721
|
quantity: DecimalString;
|
|
1577
1722
|
timestamp: EpochMilliseconds;
|
|
@@ -1580,6 +1725,7 @@ declare const PerpsPublicTradeSchema: z.ZodPipe<z.ZodObject<{
|
|
|
1580
1725
|
trade_id: PerpsTradeId;
|
|
1581
1726
|
instrument_id: PerpsInstrumentId;
|
|
1582
1727
|
side: PerpsSide;
|
|
1728
|
+
settlement: boolean;
|
|
1583
1729
|
price: DecimalString;
|
|
1584
1730
|
quantity: DecimalString;
|
|
1585
1731
|
timestamp: EpochMilliseconds;
|
|
@@ -1596,6 +1742,7 @@ declare const PerpsPublicTradeUpdateSchema: z.ZodPipe<z.ZodObject<{
|
|
|
1596
1742
|
tid: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsTradeId, number>>;
|
|
1597
1743
|
iid: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsInstrumentId, number>>;
|
|
1598
1744
|
side: z.ZodEnum<typeof PerpsSide>;
|
|
1745
|
+
settlement: z.ZodDefault<z.ZodBoolean>;
|
|
1599
1746
|
p: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
|
|
1600
1747
|
qty: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
|
|
1601
1748
|
ts: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
|
|
@@ -1604,6 +1751,8 @@ declare const PerpsPublicTradeUpdateSchema: z.ZodPipe<z.ZodObject<{
|
|
|
1604
1751
|
tradeId: PerpsTradeId;
|
|
1605
1752
|
instrumentId: PerpsInstrumentId;
|
|
1606
1753
|
side: PerpsSide;
|
|
1754
|
+
/** True for a position close at instrument settlement; false on older responses. */
|
|
1755
|
+
settlement: boolean;
|
|
1607
1756
|
price: DecimalString;
|
|
1608
1757
|
quantity: DecimalString;
|
|
1609
1758
|
timestamp: EpochMilliseconds;
|
|
@@ -1612,6 +1761,7 @@ declare const PerpsPublicTradeUpdateSchema: z.ZodPipe<z.ZodObject<{
|
|
|
1612
1761
|
tid: PerpsTradeId;
|
|
1613
1762
|
iid: PerpsInstrumentId;
|
|
1614
1763
|
side: PerpsSide;
|
|
1764
|
+
settlement: boolean;
|
|
1615
1765
|
p: DecimalString;
|
|
1616
1766
|
qty: DecimalString;
|
|
1617
1767
|
ts: EpochMilliseconds;
|
|
@@ -1625,6 +1775,7 @@ declare const FetchPerpsTradesResponseSchema: z.ZodObject<{
|
|
|
1625
1775
|
trade_id: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsTradeId, number>>;
|
|
1626
1776
|
instrument_id: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsInstrumentId, number>>;
|
|
1627
1777
|
side: z.ZodEnum<typeof PerpsSide>;
|
|
1778
|
+
settlement: z.ZodDefault<z.ZodBoolean>;
|
|
1628
1779
|
price: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
|
|
1629
1780
|
quantity: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
|
|
1630
1781
|
timestamp: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
|
|
@@ -1633,6 +1784,8 @@ declare const FetchPerpsTradesResponseSchema: z.ZodObject<{
|
|
|
1633
1784
|
tradeId: PerpsTradeId;
|
|
1634
1785
|
instrumentId: PerpsInstrumentId;
|
|
1635
1786
|
side: PerpsSide;
|
|
1787
|
+
/** True for a position close at instrument settlement; false on older responses. */
|
|
1788
|
+
settlement: boolean;
|
|
1636
1789
|
price: DecimalString;
|
|
1637
1790
|
quantity: DecimalString;
|
|
1638
1791
|
timestamp: EpochMilliseconds;
|
|
@@ -1641,6 +1794,7 @@ declare const FetchPerpsTradesResponseSchema: z.ZodObject<{
|
|
|
1641
1794
|
trade_id: PerpsTradeId;
|
|
1642
1795
|
instrument_id: PerpsInstrumentId;
|
|
1643
1796
|
side: PerpsSide;
|
|
1797
|
+
settlement: boolean;
|
|
1644
1798
|
price: DecimalString;
|
|
1645
1799
|
quantity: DecimalString;
|
|
1646
1800
|
timestamp: EpochMilliseconds;
|
|
@@ -1890,4 +2044,841 @@ declare const FetchPerpsCandlesResponseSchema: z.ZodObject<{
|
|
|
1890
2044
|
more: z.ZodBoolean;
|
|
1891
2045
|
}, z.core.$strip>;
|
|
1892
2046
|
|
|
1893
|
-
|
|
2047
|
+
/** @experimental This API may change in a breaking way in any release, including patch releases. */
|
|
2048
|
+
declare enum PerpsPositionSnapshotStatus {
|
|
2049
|
+
Ok = "ok",
|
|
2050
|
+
NotFound = "not_found",
|
|
2051
|
+
HistoryPending = "history_pending",
|
|
2052
|
+
HistoryLimit = "history_limit",
|
|
2053
|
+
ResourceLimit = "resource_limit",
|
|
2054
|
+
TemporarilyUnavailable = "temporarily_unavailable",
|
|
2055
|
+
Unavailable = "unavailable"
|
|
2056
|
+
}
|
|
2057
|
+
/** @experimental This API may change in a breaking way in any release, including patch releases. */
|
|
2058
|
+
declare enum PerpsPositionSnapshotMarkerKind {
|
|
2059
|
+
Increase = "increase",
|
|
2060
|
+
Decrease = "decrease"
|
|
2061
|
+
}
|
|
2062
|
+
/** @experimental This API may change in a breaking way in any release, including patch releases. */
|
|
2063
|
+
declare const PerpsPositionSnapshotCandleSchema: z.ZodObject<{
|
|
2064
|
+
position: z.ZodNumber;
|
|
2065
|
+
open: z.ZodNumber;
|
|
2066
|
+
high: z.ZodNumber;
|
|
2067
|
+
low: z.ZodNumber;
|
|
2068
|
+
close: z.ZodNumber;
|
|
2069
|
+
}, z.core.$strip>;
|
|
2070
|
+
/** @experimental This API may change in a breaking way in any release, including patch releases. */
|
|
2071
|
+
type PerpsPositionSnapshotCandle = z.infer<typeof PerpsPositionSnapshotCandleSchema>;
|
|
2072
|
+
/** @experimental This API may change in a breaking way in any release, including patch releases. */
|
|
2073
|
+
declare const PerpsPositionSnapshotMarkerSchema: z.ZodObject<{
|
|
2074
|
+
position: z.ZodNumber;
|
|
2075
|
+
kind: z.ZodEnum<typeof PerpsPositionSnapshotMarkerKind>;
|
|
2076
|
+
}, z.core.$strip>;
|
|
2077
|
+
/** @experimental This API may change in a breaking way in any release, including patch releases. */
|
|
2078
|
+
type PerpsPositionSnapshotMarker = z.infer<typeof PerpsPositionSnapshotMarkerSchema>;
|
|
2079
|
+
/** @experimental This API may change in a breaking way in any release, including patch releases. */
|
|
2080
|
+
declare const PerpsPositionSnapshotChartSchema: z.ZodObject<{
|
|
2081
|
+
candles: z.ZodArray<z.ZodObject<{
|
|
2082
|
+
position: z.ZodNumber;
|
|
2083
|
+
open: z.ZodNumber;
|
|
2084
|
+
high: z.ZodNumber;
|
|
2085
|
+
low: z.ZodNumber;
|
|
2086
|
+
close: z.ZodNumber;
|
|
2087
|
+
}, z.core.$strip>>;
|
|
2088
|
+
markers: z.ZodArray<z.ZodObject<{
|
|
2089
|
+
position: z.ZodNumber;
|
|
2090
|
+
kind: z.ZodEnum<typeof PerpsPositionSnapshotMarkerKind>;
|
|
2091
|
+
}, z.core.$strip>>;
|
|
2092
|
+
}, z.core.$strip>;
|
|
2093
|
+
/** @experimental This API may change in a breaking way in any release, including patch releases. */
|
|
2094
|
+
type PerpsPositionSnapshotChart = z.infer<typeof PerpsPositionSnapshotChartSchema>;
|
|
2095
|
+
/** @experimental This API may change in a breaking way in any release, including patch releases. */
|
|
2096
|
+
declare const PerpsPositionSnapshotSchema: z.ZodPipe<z.ZodObject<{
|
|
2097
|
+
position_cycle_id: z.ZodString;
|
|
2098
|
+
side: z.ZodEnum<typeof PerpsSide>;
|
|
2099
|
+
started_at: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
|
|
2100
|
+
as_of_at: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
|
|
2101
|
+
is_closed: z.ZodBoolean;
|
|
2102
|
+
size_after: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
|
|
2103
|
+
entry_price: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
|
|
2104
|
+
as_of_price: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
|
|
2105
|
+
pnl: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
|
|
2106
|
+
pnl_percent: z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
|
|
2107
|
+
leverage: z.ZodNullable<z.ZodNumber>;
|
|
2108
|
+
chart: z.ZodObject<{
|
|
2109
|
+
candles: z.ZodArray<z.ZodObject<{
|
|
2110
|
+
position: z.ZodNumber;
|
|
2111
|
+
open: z.ZodNumber;
|
|
2112
|
+
high: z.ZodNumber;
|
|
2113
|
+
low: z.ZodNumber;
|
|
2114
|
+
close: z.ZodNumber;
|
|
2115
|
+
}, z.core.$strip>>;
|
|
2116
|
+
markers: z.ZodArray<z.ZodObject<{
|
|
2117
|
+
position: z.ZodNumber;
|
|
2118
|
+
kind: z.ZodEnum<typeof PerpsPositionSnapshotMarkerKind>;
|
|
2119
|
+
}, z.core.$strip>>;
|
|
2120
|
+
}, z.core.$strip>;
|
|
2121
|
+
}, z.core.$strip>, z.ZodTransform<{
|
|
2122
|
+
positionCycleId: string;
|
|
2123
|
+
side: PerpsSide;
|
|
2124
|
+
startedAt: EpochMilliseconds;
|
|
2125
|
+
asOfAt: EpochMilliseconds;
|
|
2126
|
+
isClosed: boolean;
|
|
2127
|
+
sizeAfter: DecimalString;
|
|
2128
|
+
entryPrice: DecimalString;
|
|
2129
|
+
asOfPrice: DecimalString;
|
|
2130
|
+
pnl: DecimalString;
|
|
2131
|
+
pnlPercent: DecimalString | null;
|
|
2132
|
+
leverage: number | null;
|
|
2133
|
+
chart: {
|
|
2134
|
+
candles: {
|
|
2135
|
+
position: number;
|
|
2136
|
+
open: number;
|
|
2137
|
+
high: number;
|
|
2138
|
+
low: number;
|
|
2139
|
+
close: number;
|
|
2140
|
+
}[];
|
|
2141
|
+
markers: {
|
|
2142
|
+
position: number;
|
|
2143
|
+
kind: PerpsPositionSnapshotMarkerKind;
|
|
2144
|
+
}[];
|
|
2145
|
+
};
|
|
2146
|
+
}, {
|
|
2147
|
+
position_cycle_id: string;
|
|
2148
|
+
side: PerpsSide;
|
|
2149
|
+
started_at: EpochMilliseconds;
|
|
2150
|
+
as_of_at: EpochMilliseconds;
|
|
2151
|
+
is_closed: boolean;
|
|
2152
|
+
size_after: DecimalString;
|
|
2153
|
+
entry_price: DecimalString;
|
|
2154
|
+
as_of_price: DecimalString;
|
|
2155
|
+
pnl: DecimalString;
|
|
2156
|
+
pnl_percent: DecimalString | null;
|
|
2157
|
+
leverage: number | null;
|
|
2158
|
+
chart: {
|
|
2159
|
+
candles: {
|
|
2160
|
+
position: number;
|
|
2161
|
+
open: number;
|
|
2162
|
+
high: number;
|
|
2163
|
+
low: number;
|
|
2164
|
+
close: number;
|
|
2165
|
+
}[];
|
|
2166
|
+
markers: {
|
|
2167
|
+
position: number;
|
|
2168
|
+
kind: PerpsPositionSnapshotMarkerKind;
|
|
2169
|
+
}[];
|
|
2170
|
+
};
|
|
2171
|
+
}>>;
|
|
2172
|
+
/** A position cycle valued at captured state or immediately after a selected fill.
|
|
2173
|
+
* @experimental This API may change in a breaking way in any release, including patch releases. */
|
|
2174
|
+
type PerpsPositionSnapshot = z.infer<typeof PerpsPositionSnapshotSchema>;
|
|
2175
|
+
/** @experimental This API may change in a breaking way in any release, including patch releases. */
|
|
2176
|
+
type PerpsPositionSnapshotResult = {
|
|
2177
|
+
instrumentId: PerpsInstrumentId;
|
|
2178
|
+
tradeId?: string;
|
|
2179
|
+
status: PerpsPositionSnapshotStatus.Ok;
|
|
2180
|
+
snapshot: PerpsPositionSnapshot;
|
|
2181
|
+
} | {
|
|
2182
|
+
instrumentId: PerpsInstrumentId;
|
|
2183
|
+
tradeId?: string;
|
|
2184
|
+
status: Exclude<PerpsPositionSnapshotStatus, PerpsPositionSnapshotStatus.Ok>;
|
|
2185
|
+
};
|
|
2186
|
+
declare const HistoryResultSchema: z.ZodPipe<z.ZodPipe<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
2187
|
+
instrument_id: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsInstrumentId, number>>;
|
|
2188
|
+
trade_id: z.ZodOptional<z.ZodString>;
|
|
2189
|
+
status: z.ZodLiteral<PerpsPositionSnapshotStatus.Ok>;
|
|
2190
|
+
snapshot: z.ZodPipe<z.ZodObject<{
|
|
2191
|
+
position_cycle_id: z.ZodString;
|
|
2192
|
+
side: z.ZodEnum<typeof PerpsSide>;
|
|
2193
|
+
started_at: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
|
|
2194
|
+
as_of_at: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
|
|
2195
|
+
is_closed: z.ZodBoolean;
|
|
2196
|
+
size_after: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
|
|
2197
|
+
entry_price: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
|
|
2198
|
+
as_of_price: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
|
|
2199
|
+
pnl: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
|
|
2200
|
+
pnl_percent: z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
|
|
2201
|
+
leverage: z.ZodNullable<z.ZodNumber>;
|
|
2202
|
+
chart: z.ZodObject<{
|
|
2203
|
+
candles: z.ZodArray<z.ZodObject<{
|
|
2204
|
+
position: z.ZodNumber;
|
|
2205
|
+
open: z.ZodNumber;
|
|
2206
|
+
high: z.ZodNumber;
|
|
2207
|
+
low: z.ZodNumber;
|
|
2208
|
+
close: z.ZodNumber;
|
|
2209
|
+
}, z.core.$strip>>;
|
|
2210
|
+
markers: z.ZodArray<z.ZodObject<{
|
|
2211
|
+
position: z.ZodNumber;
|
|
2212
|
+
kind: z.ZodEnum<typeof PerpsPositionSnapshotMarkerKind>;
|
|
2213
|
+
}, z.core.$strip>>;
|
|
2214
|
+
}, z.core.$strip>;
|
|
2215
|
+
}, z.core.$strip>, z.ZodTransform<{
|
|
2216
|
+
positionCycleId: string;
|
|
2217
|
+
side: PerpsSide;
|
|
2218
|
+
startedAt: EpochMilliseconds;
|
|
2219
|
+
asOfAt: EpochMilliseconds;
|
|
2220
|
+
isClosed: boolean;
|
|
2221
|
+
sizeAfter: DecimalString;
|
|
2222
|
+
entryPrice: DecimalString;
|
|
2223
|
+
asOfPrice: DecimalString;
|
|
2224
|
+
pnl: DecimalString;
|
|
2225
|
+
pnlPercent: DecimalString | null;
|
|
2226
|
+
leverage: number | null;
|
|
2227
|
+
chart: {
|
|
2228
|
+
candles: {
|
|
2229
|
+
position: number;
|
|
2230
|
+
open: number;
|
|
2231
|
+
high: number;
|
|
2232
|
+
low: number;
|
|
2233
|
+
close: number;
|
|
2234
|
+
}[];
|
|
2235
|
+
markers: {
|
|
2236
|
+
position: number;
|
|
2237
|
+
kind: PerpsPositionSnapshotMarkerKind;
|
|
2238
|
+
}[];
|
|
2239
|
+
};
|
|
2240
|
+
}, {
|
|
2241
|
+
position_cycle_id: string;
|
|
2242
|
+
side: PerpsSide;
|
|
2243
|
+
started_at: EpochMilliseconds;
|
|
2244
|
+
as_of_at: EpochMilliseconds;
|
|
2245
|
+
is_closed: boolean;
|
|
2246
|
+
size_after: DecimalString;
|
|
2247
|
+
entry_price: DecimalString;
|
|
2248
|
+
as_of_price: DecimalString;
|
|
2249
|
+
pnl: DecimalString;
|
|
2250
|
+
pnl_percent: DecimalString | null;
|
|
2251
|
+
leverage: number | null;
|
|
2252
|
+
chart: {
|
|
2253
|
+
candles: {
|
|
2254
|
+
position: number;
|
|
2255
|
+
open: number;
|
|
2256
|
+
high: number;
|
|
2257
|
+
low: number;
|
|
2258
|
+
close: number;
|
|
2259
|
+
}[];
|
|
2260
|
+
markers: {
|
|
2261
|
+
position: number;
|
|
2262
|
+
kind: PerpsPositionSnapshotMarkerKind;
|
|
2263
|
+
}[];
|
|
2264
|
+
};
|
|
2265
|
+
}>>;
|
|
2266
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
2267
|
+
instrument_id: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsInstrumentId, number>>;
|
|
2268
|
+
trade_id: z.ZodOptional<z.ZodString>;
|
|
2269
|
+
status: z.ZodEnum<{
|
|
2270
|
+
readonly NotFound: PerpsPositionSnapshotStatus.NotFound;
|
|
2271
|
+
readonly HistoryPending: PerpsPositionSnapshotStatus.HistoryPending;
|
|
2272
|
+
readonly HistoryLimit: PerpsPositionSnapshotStatus.HistoryLimit;
|
|
2273
|
+
readonly ResourceLimit: PerpsPositionSnapshotStatus.ResourceLimit;
|
|
2274
|
+
readonly TemporarilyUnavailable: PerpsPositionSnapshotStatus.TemporarilyUnavailable;
|
|
2275
|
+
readonly Unavailable: PerpsPositionSnapshotStatus.Unavailable;
|
|
2276
|
+
}>;
|
|
2277
|
+
snapshot: z.ZodOptional<z.ZodNever>;
|
|
2278
|
+
}, z.core.$strip>], "status">, z.ZodTransform<{
|
|
2279
|
+
instrumentId: PerpsInstrumentId;
|
|
2280
|
+
tradeId?: string;
|
|
2281
|
+
status: PerpsPositionSnapshotStatus.Ok;
|
|
2282
|
+
snapshot: PerpsPositionSnapshot;
|
|
2283
|
+
} | {
|
|
2284
|
+
instrumentId: PerpsInstrumentId;
|
|
2285
|
+
tradeId?: string;
|
|
2286
|
+
status: Exclude<PerpsPositionSnapshotStatus, PerpsPositionSnapshotStatus.Ok>;
|
|
2287
|
+
}, {
|
|
2288
|
+
instrument_id: PerpsInstrumentId;
|
|
2289
|
+
status: PerpsPositionSnapshotStatus.Ok;
|
|
2290
|
+
snapshot: {
|
|
2291
|
+
positionCycleId: string;
|
|
2292
|
+
side: PerpsSide;
|
|
2293
|
+
startedAt: EpochMilliseconds;
|
|
2294
|
+
asOfAt: EpochMilliseconds;
|
|
2295
|
+
isClosed: boolean;
|
|
2296
|
+
sizeAfter: DecimalString;
|
|
2297
|
+
entryPrice: DecimalString;
|
|
2298
|
+
asOfPrice: DecimalString;
|
|
2299
|
+
pnl: DecimalString;
|
|
2300
|
+
pnlPercent: DecimalString | null;
|
|
2301
|
+
leverage: number | null;
|
|
2302
|
+
chart: {
|
|
2303
|
+
candles: {
|
|
2304
|
+
position: number;
|
|
2305
|
+
open: number;
|
|
2306
|
+
high: number;
|
|
2307
|
+
low: number;
|
|
2308
|
+
close: number;
|
|
2309
|
+
}[];
|
|
2310
|
+
markers: {
|
|
2311
|
+
position: number;
|
|
2312
|
+
kind: PerpsPositionSnapshotMarkerKind;
|
|
2313
|
+
}[];
|
|
2314
|
+
};
|
|
2315
|
+
};
|
|
2316
|
+
trade_id?: string | undefined;
|
|
2317
|
+
} | {
|
|
2318
|
+
instrument_id: PerpsInstrumentId;
|
|
2319
|
+
status: PerpsPositionSnapshotStatus.NotFound | PerpsPositionSnapshotStatus.HistoryPending | PerpsPositionSnapshotStatus.HistoryLimit | PerpsPositionSnapshotStatus.ResourceLimit | PerpsPositionSnapshotStatus.TemporarilyUnavailable | PerpsPositionSnapshotStatus.Unavailable;
|
|
2320
|
+
trade_id?: string | undefined;
|
|
2321
|
+
snapshot?: undefined;
|
|
2322
|
+
}>>, z.ZodTransform<{
|
|
2323
|
+
tradeId: string;
|
|
2324
|
+
instrumentId: PerpsInstrumentId;
|
|
2325
|
+
status: PerpsPositionSnapshotStatus.Ok;
|
|
2326
|
+
snapshot: PerpsPositionSnapshot;
|
|
2327
|
+
} | {
|
|
2328
|
+
tradeId: string;
|
|
2329
|
+
instrumentId: PerpsInstrumentId;
|
|
2330
|
+
status: Exclude<PerpsPositionSnapshotStatus, PerpsPositionSnapshotStatus.Ok>;
|
|
2331
|
+
}, {
|
|
2332
|
+
instrumentId: PerpsInstrumentId;
|
|
2333
|
+
tradeId?: string;
|
|
2334
|
+
status: PerpsPositionSnapshotStatus.Ok;
|
|
2335
|
+
snapshot: PerpsPositionSnapshot;
|
|
2336
|
+
} | {
|
|
2337
|
+
instrumentId: PerpsInstrumentId;
|
|
2338
|
+
tradeId?: string;
|
|
2339
|
+
status: Exclude<PerpsPositionSnapshotStatus, PerpsPositionSnapshotStatus.Ok>;
|
|
2340
|
+
}>>;
|
|
2341
|
+
/** @experimental This API may change in a breaking way in any release, including patch releases. */
|
|
2342
|
+
type PerpsHistoricalPositionSnapshotResult = z.infer<typeof HistoryResultSchema>;
|
|
2343
|
+
/** @experimental This API may change in a breaking way in any release, including patch releases. */
|
|
2344
|
+
declare const PerpsPositionSnapshotsSchema: z.ZodPipe<z.ZodObject<{
|
|
2345
|
+
history_as_of_at: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
|
|
2346
|
+
active: z.ZodArray<z.ZodPipe<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
2347
|
+
instrument_id: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsInstrumentId, number>>;
|
|
2348
|
+
trade_id: z.ZodOptional<z.ZodString>;
|
|
2349
|
+
status: z.ZodLiteral<PerpsPositionSnapshotStatus.Ok>;
|
|
2350
|
+
snapshot: z.ZodPipe<z.ZodObject<{
|
|
2351
|
+
position_cycle_id: z.ZodString;
|
|
2352
|
+
side: z.ZodEnum<typeof PerpsSide>;
|
|
2353
|
+
started_at: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
|
|
2354
|
+
as_of_at: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
|
|
2355
|
+
is_closed: z.ZodBoolean;
|
|
2356
|
+
size_after: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
|
|
2357
|
+
entry_price: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
|
|
2358
|
+
as_of_price: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
|
|
2359
|
+
pnl: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
|
|
2360
|
+
pnl_percent: z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
|
|
2361
|
+
leverage: z.ZodNullable<z.ZodNumber>;
|
|
2362
|
+
chart: z.ZodObject<{
|
|
2363
|
+
candles: z.ZodArray<z.ZodObject<{
|
|
2364
|
+
position: z.ZodNumber;
|
|
2365
|
+
open: z.ZodNumber;
|
|
2366
|
+
high: z.ZodNumber;
|
|
2367
|
+
low: z.ZodNumber;
|
|
2368
|
+
close: z.ZodNumber;
|
|
2369
|
+
}, z.core.$strip>>;
|
|
2370
|
+
markers: z.ZodArray<z.ZodObject<{
|
|
2371
|
+
position: z.ZodNumber;
|
|
2372
|
+
kind: z.ZodEnum<typeof PerpsPositionSnapshotMarkerKind>;
|
|
2373
|
+
}, z.core.$strip>>;
|
|
2374
|
+
}, z.core.$strip>;
|
|
2375
|
+
}, z.core.$strip>, z.ZodTransform<{
|
|
2376
|
+
positionCycleId: string;
|
|
2377
|
+
side: PerpsSide;
|
|
2378
|
+
startedAt: EpochMilliseconds;
|
|
2379
|
+
asOfAt: EpochMilliseconds;
|
|
2380
|
+
isClosed: boolean;
|
|
2381
|
+
sizeAfter: DecimalString;
|
|
2382
|
+
entryPrice: DecimalString;
|
|
2383
|
+
asOfPrice: DecimalString;
|
|
2384
|
+
pnl: DecimalString;
|
|
2385
|
+
pnlPercent: DecimalString | null;
|
|
2386
|
+
leverage: number | null;
|
|
2387
|
+
chart: {
|
|
2388
|
+
candles: {
|
|
2389
|
+
position: number;
|
|
2390
|
+
open: number;
|
|
2391
|
+
high: number;
|
|
2392
|
+
low: number;
|
|
2393
|
+
close: number;
|
|
2394
|
+
}[];
|
|
2395
|
+
markers: {
|
|
2396
|
+
position: number;
|
|
2397
|
+
kind: PerpsPositionSnapshotMarkerKind;
|
|
2398
|
+
}[];
|
|
2399
|
+
};
|
|
2400
|
+
}, {
|
|
2401
|
+
position_cycle_id: string;
|
|
2402
|
+
side: PerpsSide;
|
|
2403
|
+
started_at: EpochMilliseconds;
|
|
2404
|
+
as_of_at: EpochMilliseconds;
|
|
2405
|
+
is_closed: boolean;
|
|
2406
|
+
size_after: DecimalString;
|
|
2407
|
+
entry_price: DecimalString;
|
|
2408
|
+
as_of_price: DecimalString;
|
|
2409
|
+
pnl: DecimalString;
|
|
2410
|
+
pnl_percent: DecimalString | null;
|
|
2411
|
+
leverage: number | null;
|
|
2412
|
+
chart: {
|
|
2413
|
+
candles: {
|
|
2414
|
+
position: number;
|
|
2415
|
+
open: number;
|
|
2416
|
+
high: number;
|
|
2417
|
+
low: number;
|
|
2418
|
+
close: number;
|
|
2419
|
+
}[];
|
|
2420
|
+
markers: {
|
|
2421
|
+
position: number;
|
|
2422
|
+
kind: PerpsPositionSnapshotMarkerKind;
|
|
2423
|
+
}[];
|
|
2424
|
+
};
|
|
2425
|
+
}>>;
|
|
2426
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
2427
|
+
instrument_id: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsInstrumentId, number>>;
|
|
2428
|
+
trade_id: z.ZodOptional<z.ZodString>;
|
|
2429
|
+
status: z.ZodEnum<{
|
|
2430
|
+
readonly NotFound: PerpsPositionSnapshotStatus.NotFound;
|
|
2431
|
+
readonly HistoryPending: PerpsPositionSnapshotStatus.HistoryPending;
|
|
2432
|
+
readonly HistoryLimit: PerpsPositionSnapshotStatus.HistoryLimit;
|
|
2433
|
+
readonly ResourceLimit: PerpsPositionSnapshotStatus.ResourceLimit;
|
|
2434
|
+
readonly TemporarilyUnavailable: PerpsPositionSnapshotStatus.TemporarilyUnavailable;
|
|
2435
|
+
readonly Unavailable: PerpsPositionSnapshotStatus.Unavailable;
|
|
2436
|
+
}>;
|
|
2437
|
+
snapshot: z.ZodOptional<z.ZodNever>;
|
|
2438
|
+
}, z.core.$strip>], "status">, z.ZodTransform<{
|
|
2439
|
+
instrumentId: PerpsInstrumentId;
|
|
2440
|
+
tradeId?: string;
|
|
2441
|
+
status: PerpsPositionSnapshotStatus.Ok;
|
|
2442
|
+
snapshot: PerpsPositionSnapshot;
|
|
2443
|
+
} | {
|
|
2444
|
+
instrumentId: PerpsInstrumentId;
|
|
2445
|
+
tradeId?: string;
|
|
2446
|
+
status: Exclude<PerpsPositionSnapshotStatus, PerpsPositionSnapshotStatus.Ok>;
|
|
2447
|
+
}, {
|
|
2448
|
+
instrument_id: PerpsInstrumentId;
|
|
2449
|
+
status: PerpsPositionSnapshotStatus.Ok;
|
|
2450
|
+
snapshot: {
|
|
2451
|
+
positionCycleId: string;
|
|
2452
|
+
side: PerpsSide;
|
|
2453
|
+
startedAt: EpochMilliseconds;
|
|
2454
|
+
asOfAt: EpochMilliseconds;
|
|
2455
|
+
isClosed: boolean;
|
|
2456
|
+
sizeAfter: DecimalString;
|
|
2457
|
+
entryPrice: DecimalString;
|
|
2458
|
+
asOfPrice: DecimalString;
|
|
2459
|
+
pnl: DecimalString;
|
|
2460
|
+
pnlPercent: DecimalString | null;
|
|
2461
|
+
leverage: number | null;
|
|
2462
|
+
chart: {
|
|
2463
|
+
candles: {
|
|
2464
|
+
position: number;
|
|
2465
|
+
open: number;
|
|
2466
|
+
high: number;
|
|
2467
|
+
low: number;
|
|
2468
|
+
close: number;
|
|
2469
|
+
}[];
|
|
2470
|
+
markers: {
|
|
2471
|
+
position: number;
|
|
2472
|
+
kind: PerpsPositionSnapshotMarkerKind;
|
|
2473
|
+
}[];
|
|
2474
|
+
};
|
|
2475
|
+
};
|
|
2476
|
+
trade_id?: string | undefined;
|
|
2477
|
+
} | {
|
|
2478
|
+
instrument_id: PerpsInstrumentId;
|
|
2479
|
+
status: PerpsPositionSnapshotStatus.NotFound | PerpsPositionSnapshotStatus.HistoryPending | PerpsPositionSnapshotStatus.HistoryLimit | PerpsPositionSnapshotStatus.ResourceLimit | PerpsPositionSnapshotStatus.TemporarilyUnavailable | PerpsPositionSnapshotStatus.Unavailable;
|
|
2480
|
+
trade_id?: string | undefined;
|
|
2481
|
+
snapshot?: undefined;
|
|
2482
|
+
}>>>;
|
|
2483
|
+
history: z.ZodArray<z.ZodPipe<z.ZodPipe<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
2484
|
+
instrument_id: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsInstrumentId, number>>;
|
|
2485
|
+
trade_id: z.ZodOptional<z.ZodString>;
|
|
2486
|
+
status: z.ZodLiteral<PerpsPositionSnapshotStatus.Ok>;
|
|
2487
|
+
snapshot: z.ZodPipe<z.ZodObject<{
|
|
2488
|
+
position_cycle_id: z.ZodString;
|
|
2489
|
+
side: z.ZodEnum<typeof PerpsSide>;
|
|
2490
|
+
started_at: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
|
|
2491
|
+
as_of_at: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
|
|
2492
|
+
is_closed: z.ZodBoolean;
|
|
2493
|
+
size_after: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
|
|
2494
|
+
entry_price: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
|
|
2495
|
+
as_of_price: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
|
|
2496
|
+
pnl: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
|
|
2497
|
+
pnl_percent: z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
|
|
2498
|
+
leverage: z.ZodNullable<z.ZodNumber>;
|
|
2499
|
+
chart: z.ZodObject<{
|
|
2500
|
+
candles: z.ZodArray<z.ZodObject<{
|
|
2501
|
+
position: z.ZodNumber;
|
|
2502
|
+
open: z.ZodNumber;
|
|
2503
|
+
high: z.ZodNumber;
|
|
2504
|
+
low: z.ZodNumber;
|
|
2505
|
+
close: z.ZodNumber;
|
|
2506
|
+
}, z.core.$strip>>;
|
|
2507
|
+
markers: z.ZodArray<z.ZodObject<{
|
|
2508
|
+
position: z.ZodNumber;
|
|
2509
|
+
kind: z.ZodEnum<typeof PerpsPositionSnapshotMarkerKind>;
|
|
2510
|
+
}, z.core.$strip>>;
|
|
2511
|
+
}, z.core.$strip>;
|
|
2512
|
+
}, z.core.$strip>, z.ZodTransform<{
|
|
2513
|
+
positionCycleId: string;
|
|
2514
|
+
side: PerpsSide;
|
|
2515
|
+
startedAt: EpochMilliseconds;
|
|
2516
|
+
asOfAt: EpochMilliseconds;
|
|
2517
|
+
isClosed: boolean;
|
|
2518
|
+
sizeAfter: DecimalString;
|
|
2519
|
+
entryPrice: DecimalString;
|
|
2520
|
+
asOfPrice: DecimalString;
|
|
2521
|
+
pnl: DecimalString;
|
|
2522
|
+
pnlPercent: DecimalString | null;
|
|
2523
|
+
leverage: number | null;
|
|
2524
|
+
chart: {
|
|
2525
|
+
candles: {
|
|
2526
|
+
position: number;
|
|
2527
|
+
open: number;
|
|
2528
|
+
high: number;
|
|
2529
|
+
low: number;
|
|
2530
|
+
close: number;
|
|
2531
|
+
}[];
|
|
2532
|
+
markers: {
|
|
2533
|
+
position: number;
|
|
2534
|
+
kind: PerpsPositionSnapshotMarkerKind;
|
|
2535
|
+
}[];
|
|
2536
|
+
};
|
|
2537
|
+
}, {
|
|
2538
|
+
position_cycle_id: string;
|
|
2539
|
+
side: PerpsSide;
|
|
2540
|
+
started_at: EpochMilliseconds;
|
|
2541
|
+
as_of_at: EpochMilliseconds;
|
|
2542
|
+
is_closed: boolean;
|
|
2543
|
+
size_after: DecimalString;
|
|
2544
|
+
entry_price: DecimalString;
|
|
2545
|
+
as_of_price: DecimalString;
|
|
2546
|
+
pnl: DecimalString;
|
|
2547
|
+
pnl_percent: DecimalString | null;
|
|
2548
|
+
leverage: number | null;
|
|
2549
|
+
chart: {
|
|
2550
|
+
candles: {
|
|
2551
|
+
position: number;
|
|
2552
|
+
open: number;
|
|
2553
|
+
high: number;
|
|
2554
|
+
low: number;
|
|
2555
|
+
close: number;
|
|
2556
|
+
}[];
|
|
2557
|
+
markers: {
|
|
2558
|
+
position: number;
|
|
2559
|
+
kind: PerpsPositionSnapshotMarkerKind;
|
|
2560
|
+
}[];
|
|
2561
|
+
};
|
|
2562
|
+
}>>;
|
|
2563
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
2564
|
+
instrument_id: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsInstrumentId, number>>;
|
|
2565
|
+
trade_id: z.ZodOptional<z.ZodString>;
|
|
2566
|
+
status: z.ZodEnum<{
|
|
2567
|
+
readonly NotFound: PerpsPositionSnapshotStatus.NotFound;
|
|
2568
|
+
readonly HistoryPending: PerpsPositionSnapshotStatus.HistoryPending;
|
|
2569
|
+
readonly HistoryLimit: PerpsPositionSnapshotStatus.HistoryLimit;
|
|
2570
|
+
readonly ResourceLimit: PerpsPositionSnapshotStatus.ResourceLimit;
|
|
2571
|
+
readonly TemporarilyUnavailable: PerpsPositionSnapshotStatus.TemporarilyUnavailable;
|
|
2572
|
+
readonly Unavailable: PerpsPositionSnapshotStatus.Unavailable;
|
|
2573
|
+
}>;
|
|
2574
|
+
snapshot: z.ZodOptional<z.ZodNever>;
|
|
2575
|
+
}, z.core.$strip>], "status">, z.ZodTransform<{
|
|
2576
|
+
instrumentId: PerpsInstrumentId;
|
|
2577
|
+
tradeId?: string;
|
|
2578
|
+
status: PerpsPositionSnapshotStatus.Ok;
|
|
2579
|
+
snapshot: PerpsPositionSnapshot;
|
|
2580
|
+
} | {
|
|
2581
|
+
instrumentId: PerpsInstrumentId;
|
|
2582
|
+
tradeId?: string;
|
|
2583
|
+
status: Exclude<PerpsPositionSnapshotStatus, PerpsPositionSnapshotStatus.Ok>;
|
|
2584
|
+
}, {
|
|
2585
|
+
instrument_id: PerpsInstrumentId;
|
|
2586
|
+
status: PerpsPositionSnapshotStatus.Ok;
|
|
2587
|
+
snapshot: {
|
|
2588
|
+
positionCycleId: string;
|
|
2589
|
+
side: PerpsSide;
|
|
2590
|
+
startedAt: EpochMilliseconds;
|
|
2591
|
+
asOfAt: EpochMilliseconds;
|
|
2592
|
+
isClosed: boolean;
|
|
2593
|
+
sizeAfter: DecimalString;
|
|
2594
|
+
entryPrice: DecimalString;
|
|
2595
|
+
asOfPrice: DecimalString;
|
|
2596
|
+
pnl: DecimalString;
|
|
2597
|
+
pnlPercent: DecimalString | null;
|
|
2598
|
+
leverage: number | null;
|
|
2599
|
+
chart: {
|
|
2600
|
+
candles: {
|
|
2601
|
+
position: number;
|
|
2602
|
+
open: number;
|
|
2603
|
+
high: number;
|
|
2604
|
+
low: number;
|
|
2605
|
+
close: number;
|
|
2606
|
+
}[];
|
|
2607
|
+
markers: {
|
|
2608
|
+
position: number;
|
|
2609
|
+
kind: PerpsPositionSnapshotMarkerKind;
|
|
2610
|
+
}[];
|
|
2611
|
+
};
|
|
2612
|
+
};
|
|
2613
|
+
trade_id?: string | undefined;
|
|
2614
|
+
} | {
|
|
2615
|
+
instrument_id: PerpsInstrumentId;
|
|
2616
|
+
status: PerpsPositionSnapshotStatus.NotFound | PerpsPositionSnapshotStatus.HistoryPending | PerpsPositionSnapshotStatus.HistoryLimit | PerpsPositionSnapshotStatus.ResourceLimit | PerpsPositionSnapshotStatus.TemporarilyUnavailable | PerpsPositionSnapshotStatus.Unavailable;
|
|
2617
|
+
trade_id?: string | undefined;
|
|
2618
|
+
snapshot?: undefined;
|
|
2619
|
+
}>>, z.ZodTransform<{
|
|
2620
|
+
tradeId: string;
|
|
2621
|
+
instrumentId: PerpsInstrumentId;
|
|
2622
|
+
status: PerpsPositionSnapshotStatus.Ok;
|
|
2623
|
+
snapshot: PerpsPositionSnapshot;
|
|
2624
|
+
} | {
|
|
2625
|
+
tradeId: string;
|
|
2626
|
+
instrumentId: PerpsInstrumentId;
|
|
2627
|
+
status: Exclude<PerpsPositionSnapshotStatus, PerpsPositionSnapshotStatus.Ok>;
|
|
2628
|
+
}, {
|
|
2629
|
+
instrumentId: PerpsInstrumentId;
|
|
2630
|
+
tradeId?: string;
|
|
2631
|
+
status: PerpsPositionSnapshotStatus.Ok;
|
|
2632
|
+
snapshot: PerpsPositionSnapshot;
|
|
2633
|
+
} | {
|
|
2634
|
+
instrumentId: PerpsInstrumentId;
|
|
2635
|
+
tradeId?: string;
|
|
2636
|
+
status: Exclude<PerpsPositionSnapshotStatus, PerpsPositionSnapshotStatus.Ok>;
|
|
2637
|
+
}>>>;
|
|
2638
|
+
}, z.core.$strip>, z.ZodTransform<{
|
|
2639
|
+
historyAsOfAt: EpochMilliseconds;
|
|
2640
|
+
active: ({
|
|
2641
|
+
instrumentId: PerpsInstrumentId;
|
|
2642
|
+
tradeId?: string;
|
|
2643
|
+
status: PerpsPositionSnapshotStatus.Ok;
|
|
2644
|
+
snapshot: PerpsPositionSnapshot;
|
|
2645
|
+
} | {
|
|
2646
|
+
instrumentId: PerpsInstrumentId;
|
|
2647
|
+
tradeId?: string;
|
|
2648
|
+
status: Exclude<PerpsPositionSnapshotStatus, PerpsPositionSnapshotStatus.Ok>;
|
|
2649
|
+
})[];
|
|
2650
|
+
history: ({
|
|
2651
|
+
tradeId: string;
|
|
2652
|
+
instrumentId: PerpsInstrumentId;
|
|
2653
|
+
status: PerpsPositionSnapshotStatus.Ok;
|
|
2654
|
+
snapshot: PerpsPositionSnapshot;
|
|
2655
|
+
} | {
|
|
2656
|
+
tradeId: string;
|
|
2657
|
+
instrumentId: PerpsInstrumentId;
|
|
2658
|
+
status: Exclude<PerpsPositionSnapshotStatus, PerpsPositionSnapshotStatus.Ok>;
|
|
2659
|
+
})[];
|
|
2660
|
+
}, {
|
|
2661
|
+
history_as_of_at: EpochMilliseconds;
|
|
2662
|
+
active: ({
|
|
2663
|
+
instrumentId: PerpsInstrumentId;
|
|
2664
|
+
tradeId?: string;
|
|
2665
|
+
status: PerpsPositionSnapshotStatus.Ok;
|
|
2666
|
+
snapshot: PerpsPositionSnapshot;
|
|
2667
|
+
} | {
|
|
2668
|
+
instrumentId: PerpsInstrumentId;
|
|
2669
|
+
tradeId?: string;
|
|
2670
|
+
status: Exclude<PerpsPositionSnapshotStatus, PerpsPositionSnapshotStatus.Ok>;
|
|
2671
|
+
})[];
|
|
2672
|
+
history: ({
|
|
2673
|
+
tradeId: string;
|
|
2674
|
+
instrumentId: PerpsInstrumentId;
|
|
2675
|
+
status: PerpsPositionSnapshotStatus.Ok;
|
|
2676
|
+
snapshot: PerpsPositionSnapshot;
|
|
2677
|
+
} | {
|
|
2678
|
+
tradeId: string;
|
|
2679
|
+
instrumentId: PerpsInstrumentId;
|
|
2680
|
+
status: Exclude<PerpsPositionSnapshotStatus, PerpsPositionSnapshotStatus.Ok>;
|
|
2681
|
+
})[];
|
|
2682
|
+
}>>;
|
|
2683
|
+
/** Ordered selections and the completed-history horizon. No pagination.
|
|
2684
|
+
* @experimental This API may change in a breaking way in any release, including patch releases. */
|
|
2685
|
+
type PerpsPositionSnapshots = z.infer<typeof PerpsPositionSnapshotsSchema>;
|
|
2686
|
+
|
|
2687
|
+
/**
|
|
2688
|
+
* Parses whether an address has a Perps account.
|
|
2689
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
2690
|
+
*/
|
|
2691
|
+
declare const PerpsRegistrationResponseSchema: z.ZodPipe<z.ZodObject<{
|
|
2692
|
+
registered: z.ZodBoolean;
|
|
2693
|
+
}, z.core.$strip>, z.ZodTransform<boolean, {
|
|
2694
|
+
registered: boolean;
|
|
2695
|
+
}>>;
|
|
2696
|
+
|
|
2697
|
+
/** Opaque run identity.
|
|
2698
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
2699
|
+
*/
|
|
2700
|
+
type PerpsTwapId = number & {
|
|
2701
|
+
readonly __tag: 'PerpsTwapId';
|
|
2702
|
+
};
|
|
2703
|
+
/** @experimental This API may change in a breaking way in any release, including patch releases. */
|
|
2704
|
+
declare const PerpsTwapIdSchema: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsTwapId, number>>;
|
|
2705
|
+
/** Active runs only; ended runs are absent from the active collection.
|
|
2706
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
2707
|
+
*/
|
|
2708
|
+
declare enum PerpsTwapStatus {
|
|
2709
|
+
Running = "running",
|
|
2710
|
+
Paused = "paused"
|
|
2711
|
+
}
|
|
2712
|
+
/** @experimental This API may change in a breaking way in any release, including patch releases. */
|
|
2713
|
+
declare const PerpsTwapSchema: z.ZodPipe<z.ZodObject<{
|
|
2714
|
+
twid: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsTwapId, number>>;
|
|
2715
|
+
iid: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsInstrumentId, number>>;
|
|
2716
|
+
buy: z.ZodBoolean;
|
|
2717
|
+
qty: z.ZodPipe<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
|
|
2718
|
+
fill: z.ZodPipe<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
|
|
2719
|
+
dur: z.ZodNumber;
|
|
2720
|
+
ivl: z.ZodNumber;
|
|
2721
|
+
rnd: z.ZodBoolean;
|
|
2722
|
+
slip_bps: z.ZodNumber;
|
|
2723
|
+
min_px: z.ZodPipe<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
|
|
2724
|
+
max_px: z.ZodPipe<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
|
|
2725
|
+
ro: z.ZodBoolean;
|
|
2726
|
+
st: z.ZodEnum<typeof PerpsTwapStatus>;
|
|
2727
|
+
slices: z.ZodNumber;
|
|
2728
|
+
slice_count: z.ZodNumber;
|
|
2729
|
+
sts: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
|
|
2730
|
+
ets: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
|
|
2731
|
+
cts: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
|
|
2732
|
+
avg_px: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>>;
|
|
2733
|
+
coid: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<PerpsClientOrderId, string>>>;
|
|
2734
|
+
oid: z.ZodOptional<z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsOrderId, number>>>;
|
|
2735
|
+
}, z.core.$strip>, z.ZodTransform<{
|
|
2736
|
+
orderId?: PerpsOrderId | undefined;
|
|
2737
|
+
clientOrderId?: PerpsClientOrderId | undefined;
|
|
2738
|
+
averagePrice?: DecimalString | undefined;
|
|
2739
|
+
twapId: PerpsTwapId;
|
|
2740
|
+
instrumentId: PerpsInstrumentId;
|
|
2741
|
+
side: OrderSide;
|
|
2742
|
+
quantity: DecimalString;
|
|
2743
|
+
filledQuantity: DecimalString;
|
|
2744
|
+
durationMs: number;
|
|
2745
|
+
intervalMs: number;
|
|
2746
|
+
randomize: boolean;
|
|
2747
|
+
slippageBps: number;
|
|
2748
|
+
minPrice: DecimalString;
|
|
2749
|
+
maxPrice: DecimalString;
|
|
2750
|
+
reduceOnly: boolean;
|
|
2751
|
+
status: PerpsTwapStatus;
|
|
2752
|
+
slices: number;
|
|
2753
|
+
sliceCount: number;
|
|
2754
|
+
startedAt: EpochMilliseconds;
|
|
2755
|
+
endsAt: EpochMilliseconds;
|
|
2756
|
+
createdAt: EpochMilliseconds;
|
|
2757
|
+
}, {
|
|
2758
|
+
twid: PerpsTwapId;
|
|
2759
|
+
iid: PerpsInstrumentId;
|
|
2760
|
+
buy: boolean;
|
|
2761
|
+
qty: DecimalString;
|
|
2762
|
+
fill: DecimalString;
|
|
2763
|
+
dur: number;
|
|
2764
|
+
ivl: number;
|
|
2765
|
+
rnd: boolean;
|
|
2766
|
+
slip_bps: number;
|
|
2767
|
+
min_px: DecimalString;
|
|
2768
|
+
max_px: DecimalString;
|
|
2769
|
+
ro: boolean;
|
|
2770
|
+
st: PerpsTwapStatus;
|
|
2771
|
+
slices: number;
|
|
2772
|
+
slice_count: number;
|
|
2773
|
+
sts: EpochMilliseconds;
|
|
2774
|
+
ets: EpochMilliseconds;
|
|
2775
|
+
cts: EpochMilliseconds;
|
|
2776
|
+
avg_px?: DecimalString | undefined;
|
|
2777
|
+
coid?: PerpsClientOrderId | undefined;
|
|
2778
|
+
oid?: PerpsOrderId | undefined;
|
|
2779
|
+
}>>;
|
|
2780
|
+
/** @experimental This API may change in a breaking way in any release, including patch releases. */
|
|
2781
|
+
type PerpsTwap = z.infer<typeof PerpsTwapSchema>;
|
|
2782
|
+
/** @experimental This API may change in a breaking way in any release, including patch releases. */
|
|
2783
|
+
declare const PerpsTwapAcceptedSchema: z.ZodPipe<z.ZodObject<{
|
|
2784
|
+
status: z.ZodLiteral<"ok">;
|
|
2785
|
+
twid: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsTwapId, number>>;
|
|
2786
|
+
ts: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
|
|
2787
|
+
}, z.core.$strip>, z.ZodTransform<{
|
|
2788
|
+
twapId: PerpsTwapId;
|
|
2789
|
+
timestamp: EpochMilliseconds;
|
|
2790
|
+
}, {
|
|
2791
|
+
status: "ok";
|
|
2792
|
+
twid: PerpsTwapId;
|
|
2793
|
+
ts: EpochMilliseconds;
|
|
2794
|
+
}>>;
|
|
2795
|
+
/** Acceptance does not guarantee all scheduled quantity will fill.
|
|
2796
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
2797
|
+
*/
|
|
2798
|
+
type PerpsTwapAccepted = z.infer<typeof PerpsTwapAcceptedSchema>;
|
|
2799
|
+
/** @experimental This API may change in a breaking way in any release, including patch releases. */
|
|
2800
|
+
declare const FetchPerpsTwapsResponseSchema: z.ZodArray<z.ZodPipe<z.ZodObject<{
|
|
2801
|
+
twid: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsTwapId, number>>;
|
|
2802
|
+
iid: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsInstrumentId, number>>;
|
|
2803
|
+
buy: z.ZodBoolean;
|
|
2804
|
+
qty: z.ZodPipe<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
|
|
2805
|
+
fill: z.ZodPipe<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
|
|
2806
|
+
dur: z.ZodNumber;
|
|
2807
|
+
ivl: z.ZodNumber;
|
|
2808
|
+
rnd: z.ZodBoolean;
|
|
2809
|
+
slip_bps: z.ZodNumber;
|
|
2810
|
+
min_px: z.ZodPipe<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
|
|
2811
|
+
max_px: z.ZodPipe<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
|
|
2812
|
+
ro: z.ZodBoolean;
|
|
2813
|
+
st: z.ZodEnum<typeof PerpsTwapStatus>;
|
|
2814
|
+
slices: z.ZodNumber;
|
|
2815
|
+
slice_count: z.ZodNumber;
|
|
2816
|
+
sts: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
|
|
2817
|
+
ets: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
|
|
2818
|
+
cts: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
|
|
2819
|
+
avg_px: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>>;
|
|
2820
|
+
coid: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<PerpsClientOrderId, string>>>;
|
|
2821
|
+
oid: z.ZodOptional<z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsOrderId, number>>>;
|
|
2822
|
+
}, z.core.$strip>, z.ZodTransform<{
|
|
2823
|
+
orderId?: PerpsOrderId | undefined;
|
|
2824
|
+
clientOrderId?: PerpsClientOrderId | undefined;
|
|
2825
|
+
averagePrice?: DecimalString | undefined;
|
|
2826
|
+
twapId: PerpsTwapId;
|
|
2827
|
+
instrumentId: PerpsInstrumentId;
|
|
2828
|
+
side: OrderSide;
|
|
2829
|
+
quantity: DecimalString;
|
|
2830
|
+
filledQuantity: DecimalString;
|
|
2831
|
+
durationMs: number;
|
|
2832
|
+
intervalMs: number;
|
|
2833
|
+
randomize: boolean;
|
|
2834
|
+
slippageBps: number;
|
|
2835
|
+
minPrice: DecimalString;
|
|
2836
|
+
maxPrice: DecimalString;
|
|
2837
|
+
reduceOnly: boolean;
|
|
2838
|
+
status: PerpsTwapStatus;
|
|
2839
|
+
slices: number;
|
|
2840
|
+
sliceCount: number;
|
|
2841
|
+
startedAt: EpochMilliseconds;
|
|
2842
|
+
endsAt: EpochMilliseconds;
|
|
2843
|
+
createdAt: EpochMilliseconds;
|
|
2844
|
+
}, {
|
|
2845
|
+
twid: PerpsTwapId;
|
|
2846
|
+
iid: PerpsInstrumentId;
|
|
2847
|
+
buy: boolean;
|
|
2848
|
+
qty: DecimalString;
|
|
2849
|
+
fill: DecimalString;
|
|
2850
|
+
dur: number;
|
|
2851
|
+
ivl: number;
|
|
2852
|
+
rnd: boolean;
|
|
2853
|
+
slip_bps: number;
|
|
2854
|
+
min_px: DecimalString;
|
|
2855
|
+
max_px: DecimalString;
|
|
2856
|
+
ro: boolean;
|
|
2857
|
+
st: PerpsTwapStatus;
|
|
2858
|
+
slices: number;
|
|
2859
|
+
slice_count: number;
|
|
2860
|
+
sts: EpochMilliseconds;
|
|
2861
|
+
ets: EpochMilliseconds;
|
|
2862
|
+
cts: EpochMilliseconds;
|
|
2863
|
+
avg_px?: DecimalString | undefined;
|
|
2864
|
+
coid?: PerpsClientOrderId | undefined;
|
|
2865
|
+
oid?: PerpsOrderId | undefined;
|
|
2866
|
+
}>>>;
|
|
2867
|
+
/** @experimental This API may change in a breaking way in any release, including patch releases. */
|
|
2868
|
+
declare const CreatePerpsTwapResponseSchema: z.ZodUnion<readonly [z.ZodPipe<z.ZodObject<{
|
|
2869
|
+
status: z.ZodLiteral<"ok">;
|
|
2870
|
+
twid: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsTwapId, number>>;
|
|
2871
|
+
ts: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
|
|
2872
|
+
}, z.core.$strip>, z.ZodTransform<{
|
|
2873
|
+
twapId: PerpsTwapId;
|
|
2874
|
+
timestamp: EpochMilliseconds;
|
|
2875
|
+
}, {
|
|
2876
|
+
status: "ok";
|
|
2877
|
+
twid: PerpsTwapId;
|
|
2878
|
+
ts: EpochMilliseconds;
|
|
2879
|
+
}>>, z.ZodObject<{
|
|
2880
|
+
status: z.ZodLiteral<"err">;
|
|
2881
|
+
error: z.ZodString;
|
|
2882
|
+
}, z.core.$strip>]>;
|
|
2883
|
+
|
|
2884
|
+
export { CreatePerpsTwapResponseSchema, FetchPerpsAccountConfigResponseSchema, FetchPerpsAccountStatsResponseSchema, FetchPerpsAutoCancelStatusResponseSchema, FetchPerpsBalancesResponseSchema, FetchPerpsCandlesResponseSchema, FetchPerpsFeesResponseSchema, FetchPerpsFundingHistoryResponseSchema, FetchPerpsInstrumentsResponseSchema, FetchPerpsPortfolioResponseSchema, FetchPerpsStatisticsResponseSchema, FetchPerpsTickersResponseSchema, FetchPerpsTradesResponseSchema, FetchPerpsTwapsResponseSchema, ListPerpsDepositsResponseSchema, ListPerpsEquityHistoryResponseSchema, ListPerpsFundingPaymentsResponseSchema, ListPerpsInternalTransfersResponseSchema, ListPerpsPnlHistoryResponseSchema, ListPerpsWithdrawalsResponseSchema, type PerpsAccountConfig, PerpsAccountConfigSchema, type PerpsAccountFundingPayment, PerpsAccountFundingPaymentEntrySchema, PerpsAccountFundingPaymentSchema, type PerpsAccountStats, PerpsAccountStatsSchema, type PerpsAutoCancelResponse, PerpsAutoCancelResponseSchema, type PerpsAutoCancelStatus, PerpsAutoCancelStatusSchema, type PerpsBalance, PerpsBalanceSchema, type PerpsBbo, PerpsBboSchema, PerpsBboUpdateSchema, type PerpsBook, type PerpsBookLevel, PerpsBookLevelSchema, PerpsBookSchema, PerpsBookUpdateSchema, type PerpsCandle, PerpsCandleSchema, PerpsClientOrderId, PerpsCreateProxyResponseSchema, PerpsCredentialsResponseSchema, PerpsDeleteProxyResponseSchema, type PerpsDeposit, PerpsDepositSchema, PerpsDepositStatus, PerpsDepositUpdateSchema, PerpsEntityId, type PerpsEquityPoint, PerpsEquityPointSchema, type PerpsFeeScheduleEntry, PerpsFeeScheduleEntrySchema, type PerpsFeeTier, PerpsFeeTierSchema, type PerpsFeesInfo, PerpsFeesInfoSchema, PerpsFundingPaymentId, type PerpsFundingRate, PerpsFundingRateSchema, type PerpsHistoricalPositionSnapshotResult, type PerpsInstrument, PerpsInstrumentCategory, PerpsInstrumentId, PerpsInstrumentSchema, type PerpsInstrumentSettlement, PerpsInstrumentSettlementSchema, PerpsInstrumentType, type PerpsInternalTransfer, PerpsInternalTransferDirection, PerpsInternalTransferId, PerpsInternalTransferResponseSchema, PerpsInternalTransferSchema, PerpsKnownInternalTransferType, PerpsKnownWithdrawalStatus, type PerpsMarginSummary, PerpsMarginSummarySchema, PerpsOrderId, type PerpsPnlPoint, PerpsPnlPointSchema, type PerpsPortfolio, type PerpsPortfolioPosition, PerpsPortfolioPositionSchema, PerpsPortfolioSchema, type PerpsPositionSnapshot, type PerpsPositionSnapshotCandle, PerpsPositionSnapshotCandleSchema, type PerpsPositionSnapshotChart, PerpsPositionSnapshotChartSchema, type PerpsPositionSnapshotMarker, PerpsPositionSnapshotMarkerKind, PerpsPositionSnapshotMarkerSchema, type PerpsPositionSnapshotResult, PerpsPositionSnapshotSchema, PerpsPositionSnapshotStatus, type PerpsPositionSnapshots, PerpsPositionSnapshotsSchema, type PerpsProxyKey, PerpsProxyKeySchema, type PerpsPublicTrade, PerpsPublicTradeSchema, PerpsPublicTradeUpdateSchema, PerpsRegistrationResponseSchema, type PerpsRiskTier, PerpsRiskTierSchema, PerpsSide, type PerpsStatistic, PerpsStatisticSchema, PerpsStatisticUpdateSchema, type PerpsTicker, PerpsTickerEntrySchema, PerpsTickerSchema, PerpsTradeId, type PerpsTwap, type PerpsTwapAccepted, PerpsTwapAcceptedSchema, type PerpsTwapId, PerpsTwapIdSchema, PerpsTwapSchema, PerpsTwapStatus, PerpsWithdrawResponseSchema, type PerpsWithdrawal, PerpsWithdrawalId, PerpsWithdrawalSchema, PerpsWithdrawalUpdateSchema };
|