@polymarket/bindings 0.11.0 → 0.13.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-2FRDSBWY.js +2 -0
- package/dist/chunk-2FRDSBWY.js.map +1 -0
- package/dist/{chunk-RGWF46B7.js → chunk-3IZ4N7C2.js} +2 -2
- package/dist/{chunk-RGWF46B7.js.map → chunk-3IZ4N7C2.js.map} +1 -1
- package/dist/chunk-Z6SGQXSJ.js +2 -0
- package/dist/chunk-Z6SGQXSJ.js.map +1 -0
- package/dist/clob/index.d.ts +15 -10
- package/dist/clob/index.js +1 -1
- package/dist/clob/index.js.map +1 -1
- package/dist/combos/index.js +1 -1
- package/dist/{comment-C-jBbhp7.d.ts → comment-CKJIqOZS.d.ts} +372 -2
- package/dist/data/index.d.ts +211 -12
- package/dist/data/index.js +1 -1
- package/dist/data/index.js.map +1 -1
- package/dist/gamma/index.d.ts +16 -1
- package/dist/gamma/index.js +1 -1
- package/dist/gamma/index.js.map +1 -1
- package/dist/index.d.ts +7 -1
- package/dist/index.js +1 -1
- package/dist/{orders-CAELACaR.d.ts → orders-BV68_6ST.d.ts} +1150 -72
- package/dist/perps/index.d.ts +993 -9
- package/dist/perps/index.js +1 -1
- package/dist/perps/index.js.map +1 -1
- package/dist/relayer/index.js +1 -1
- package/dist/subscriptions/index.d.ts +748 -98
- package/dist/subscriptions/index.js +1 -1
- package/dist/subscriptions/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-NILFT6EF.js +0 -2
- package/dist/chunk-NILFT6EF.js.map +0 -1
- package/dist/chunk-V3FFOW6W.js +0 -2
- package/dist/chunk-V3FFOW6W.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,
|
|
3
|
-
export { F as FetchPerpsOpenOrdersResponseSchema,
|
|
4
|
-
import { DecimalString, EpochMilliseconds, BaseUnits } from '../index.js';
|
|
2
|
+
import { P as PerpsInstrumentId, u as PerpsEntityId, i as PerpsFundingPaymentId, g as PerpsDepositStatus, v as PerpsInternalTransferId, w as PerpsKnownInternalTransferType, x as PerpsInternalTransferDirection, s as PerpsWithdrawalId, t as PerpsKnownWithdrawalStatus, y as PerpsInstrumentType, z as PerpsInstrumentCategory, b as PerpsTradeId, h as PerpsSide, d as PerpsClientOrderId, c as PerpsOrderId } from '../orders-BV68_6ST.js';
|
|
3
|
+
export { C as CreatePerpsChaseResponseSchema, F as FetchPerpsBuilderApprovalsResponseSchema, A as FetchPerpsChasesResponseSchema, B as FetchPerpsOpenOrdersResponseSchema, D as FetchPerpsOrdersResponseSchema, E as FetchPerpsUnreadNotificationsCountResponseSchema, L as ListPerpsBuilderEarningsResponseSchema, G as ListPerpsFillsResponseSchema, H as ListPerpsNotificationsResponseSchema, M as MarkPerpsNotificationsReadResponseSchema, I as PerpsAccountFill, J as PerpsAccountFillSchema, K as PerpsAccountFillUpdateSchema, N as PerpsAssetSchema, O as PerpsBuilderApproval, Q as PerpsBuilderApprovalSchema, R as PerpsBuilderEarning, a as PerpsBuilderEarningId, S as PerpsBuilderEarningIdSchema, T as PerpsBuilderEarningSchema, U as PerpsBuilderEarningsAsset, V as PerpsBuilderEarningsAssetSchema, W as PerpsBuilderEarningsSnapshot, X as PerpsBuilderEarningsSnapshotSchema, Y as PerpsBuilderEarningsSummary, Z as PerpsBuilderEarningsSummarySchema, _ as PerpsBuilderStatus, $ as PerpsBuilderStatusSchema, a0 as PerpsBuilderTerms, a1 as PerpsBuilderTermsSchema, a2 as PerpsCancelAllOrdersResponse, a3 as PerpsCancelAllOrdersResponseSchema, a4 as PerpsCancelOrderErrorCode, a5 as PerpsCancelOrderErrorCodeSchema, a6 as PerpsCancelOrderResult, a7 as PerpsCancelOrderResultSchema, a8 as PerpsChase, a9 as PerpsChaseAccepted, aa as PerpsChaseAcceptedSchema, p as PerpsChaseId, ab as PerpsChaseIdSchema, ac as PerpsChaseSchema, ad as PerpsClientOrderIdSchema, ae as PerpsCommandAck, af as PerpsCommandAckSchema, ag as PerpsCommandStatusSchema, ah as PerpsCredentials, ai as PerpsDataResponseSchema, aj as PerpsDecimal, ak as PerpsDecimalInput, al as PerpsDecimalInputSchema, am as PerpsDepositAmount, an as PerpsDepositStatusSchema, ao as PerpsEntityIdSchema, ap as PerpsFundingInterval, aq as PerpsFundingIntervalSchema, ar as PerpsFundingPaymentIdSchema, as as PerpsInstrumentCategorySchema, at as PerpsInstrumentIdSchema, au as PerpsInstrumentTypeSchema, av as PerpsInternalTransferDirectionSchema, aw as PerpsInternalTransferIdSchema, ax as PerpsInternalTransferType, ay as PerpsInternalTransferTypeSchema, f as PerpsKlineInterval, az as PerpsKlineIntervalSchema, aA as PerpsKnownCancelOrderErrorCode, aB as PerpsLimitOrderCanceledNotification, aC as PerpsLimitOrderCanceledNotificationSchema, aD as PerpsLiquidationWarningNotification, aE as PerpsLiquidationWarningNotificationSchema, e as PerpsLiquidityRole, m as PerpsMarginType, aF as PerpsMarginTypeSchema, aG as PerpsNotification, aH as PerpsNotificationEntry, aI as PerpsNotificationEntrySchema, j as PerpsNotificationId, aJ as PerpsNotificationIdSchema, l as PerpsNotificationOrderType, aK as PerpsNotificationOrderTypeSchema, aL as PerpsNotificationSchema, k as PerpsNotificationType, aM as PerpsNotificationTypeSchema, aN as PerpsOrder, aO as PerpsOrderIdSchema, aP as PerpsOrderSchema, o 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, n as PerpsTimeInForce, b5 as PerpsTimeInForceSchema, q as PerpsTpSlKind, b6 as PerpsTpSlKindSchema, b7 as PerpsTpSlOrderFields, b8 as PerpsTpSlOrderFieldsSchema, r as PerpsTpSlScope, b9 as PerpsTpSlScopeSchema, ba as PerpsTradeIdSchema, bb as PerpsTxHash, bc as PerpsTxHashSchema, bd as PerpsUpdateLeverageBatchResult, be as PerpsUpdateLeverageBatchResultSchema, bf as PerpsUpdateLeverageRejection, bg as PerpsUpdateLeverageRejectionSchema, bh as PerpsUpdateLeverageResult, bi as PerpsUpdateLeverageResultSchema, bj as PerpsWithdrawalAmount, bk as PerpsWithdrawalIdSchema, bl as PerpsWithdrawalStatus, bm as PerpsWithdrawalStatusSchema, bn as decimalString, bo as perpsBaseUnits, bp as perpsDecimal } from '../orders-BV68_6ST.js';
|
|
4
|
+
import { DecimalString, EpochMilliseconds, BaseUnits, OrderSide } from '../index.js';
|
|
5
5
|
import { z } from 'zod';
|
|
6
6
|
|
|
7
7
|
/**
|
|
@@ -922,19 +922,85 @@ declare const PerpsWithdrawalUpdateSchema: z.ZodPipe<z.ZodObject<{
|
|
|
922
922
|
/**
|
|
923
923
|
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
924
924
|
*/
|
|
925
|
-
declare const PerpsInternalTransferSchema: z.ZodObject<{
|
|
926
|
-
|
|
925
|
+
declare const PerpsInternalTransferSchema: z.ZodPipe<z.ZodObject<{
|
|
926
|
+
transfer_id: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsInternalTransferId, number>>;
|
|
927
|
+
type: z.ZodPipe<z.ZodString, z.ZodTransform<(string & {}) | PerpsKnownInternalTransferType, string>>;
|
|
927
928
|
asset: z.ZodString;
|
|
928
|
-
amount: z.ZodPipe<z.ZodString, z.ZodTransform<
|
|
929
|
+
amount: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
|
|
929
930
|
direction: z.ZodEnum<typeof PerpsInternalTransferDirection>;
|
|
930
931
|
counterparty: z.ZodPipe<z.ZodString, z.ZodTransform<_polymarket_types.EvmAddress, string>>;
|
|
931
932
|
label: z.ZodOptional<z.ZodString>;
|
|
932
|
-
|
|
933
|
-
}, z.core.$strip
|
|
933
|
+
created_timestamp: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
|
|
934
|
+
}, z.core.$strip>, z.ZodTransform<{
|
|
935
|
+
transferId: PerpsInternalTransferId;
|
|
936
|
+
type: (string & {}) | PerpsKnownInternalTransferType;
|
|
937
|
+
asset: string;
|
|
938
|
+
amount: DecimalString;
|
|
939
|
+
direction: PerpsInternalTransferDirection;
|
|
940
|
+
counterparty: _polymarket_types.EvmAddress;
|
|
941
|
+
label: string | undefined;
|
|
942
|
+
createdTimestamp: EpochMilliseconds;
|
|
943
|
+
}, {
|
|
944
|
+
transfer_id: PerpsInternalTransferId;
|
|
945
|
+
type: (string & {}) | PerpsKnownInternalTransferType;
|
|
946
|
+
asset: string;
|
|
947
|
+
amount: DecimalString;
|
|
948
|
+
direction: PerpsInternalTransferDirection;
|
|
949
|
+
counterparty: _polymarket_types.EvmAddress;
|
|
950
|
+
created_timestamp: EpochMilliseconds;
|
|
951
|
+
label?: string | undefined;
|
|
952
|
+
}>>;
|
|
934
953
|
/**
|
|
935
954
|
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
936
955
|
*/
|
|
937
956
|
type PerpsInternalTransfer = z.infer<typeof PerpsInternalTransferSchema>;
|
|
957
|
+
/**
|
|
958
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
959
|
+
*/
|
|
960
|
+
declare const ListPerpsInternalTransfersResponseSchema: z.ZodObject<{
|
|
961
|
+
data: z.ZodArray<z.ZodPipe<z.ZodObject<{
|
|
962
|
+
transfer_id: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsInternalTransferId, number>>;
|
|
963
|
+
type: z.ZodPipe<z.ZodString, z.ZodTransform<(string & {}) | PerpsKnownInternalTransferType, string>>;
|
|
964
|
+
asset: z.ZodString;
|
|
965
|
+
amount: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
|
|
966
|
+
direction: z.ZodEnum<typeof PerpsInternalTransferDirection>;
|
|
967
|
+
counterparty: z.ZodPipe<z.ZodString, z.ZodTransform<_polymarket_types.EvmAddress, string>>;
|
|
968
|
+
label: z.ZodOptional<z.ZodString>;
|
|
969
|
+
created_timestamp: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
|
|
970
|
+
}, z.core.$strip>, z.ZodTransform<{
|
|
971
|
+
transferId: PerpsInternalTransferId;
|
|
972
|
+
type: (string & {}) | PerpsKnownInternalTransferType;
|
|
973
|
+
asset: string;
|
|
974
|
+
amount: DecimalString;
|
|
975
|
+
direction: PerpsInternalTransferDirection;
|
|
976
|
+
counterparty: _polymarket_types.EvmAddress;
|
|
977
|
+
label: string | undefined;
|
|
978
|
+
createdTimestamp: EpochMilliseconds;
|
|
979
|
+
}, {
|
|
980
|
+
transfer_id: PerpsInternalTransferId;
|
|
981
|
+
type: (string & {}) | PerpsKnownInternalTransferType;
|
|
982
|
+
asset: string;
|
|
983
|
+
amount: DecimalString;
|
|
984
|
+
direction: PerpsInternalTransferDirection;
|
|
985
|
+
counterparty: _polymarket_types.EvmAddress;
|
|
986
|
+
created_timestamp: EpochMilliseconds;
|
|
987
|
+
label?: string | undefined;
|
|
988
|
+
}>>>;
|
|
989
|
+
more: z.ZodBoolean;
|
|
990
|
+
}, z.core.$strip>;
|
|
991
|
+
/**
|
|
992
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
993
|
+
*/
|
|
994
|
+
declare const PerpsInternalTransferResponseSchema: z.ZodPipe<z.ZodObject<{
|
|
995
|
+
status: z.ZodLiteral<"ok">;
|
|
996
|
+
transfer_id: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsInternalTransferId, number>>;
|
|
997
|
+
}, z.core.$strict>, z.ZodTransform<{
|
|
998
|
+
status: "ok";
|
|
999
|
+
transferId: PerpsInternalTransferId;
|
|
1000
|
+
}, {
|
|
1001
|
+
status: "ok";
|
|
1002
|
+
transfer_id: PerpsInternalTransferId;
|
|
1003
|
+
}>>;
|
|
938
1004
|
|
|
939
1005
|
/**
|
|
940
1006
|
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
@@ -947,6 +1013,31 @@ declare const PerpsRiskTierSchema: z.ZodObject<{
|
|
|
947
1013
|
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
948
1014
|
*/
|
|
949
1015
|
type PerpsRiskTier = z.infer<typeof PerpsRiskTierSchema>;
|
|
1016
|
+
/**
|
|
1017
|
+
* Permanent retirement record. Sequence is an exact nonnegative safe integer;
|
|
1018
|
+
* larger values are rejected. Timestamp is the cutoff for unapplied funding.
|
|
1019
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
1020
|
+
*/
|
|
1021
|
+
type PerpsInstrumentSettlement = {
|
|
1022
|
+
sequence: number;
|
|
1023
|
+
timestamp: EpochMilliseconds;
|
|
1024
|
+
price: DecimalString;
|
|
1025
|
+
insuranceDebit: DecimalString;
|
|
1026
|
+
};
|
|
1027
|
+
/**
|
|
1028
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
1029
|
+
*/
|
|
1030
|
+
declare const PerpsInstrumentSettlementSchema: z.ZodPipe<z.ZodObject<{
|
|
1031
|
+
sequence: z.ZodNumber;
|
|
1032
|
+
timestamp: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
|
|
1033
|
+
price: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
|
|
1034
|
+
insurance_debit: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
|
|
1035
|
+
}, z.core.$strip>, z.ZodTransform<PerpsInstrumentSettlement, {
|
|
1036
|
+
sequence: number;
|
|
1037
|
+
timestamp: EpochMilliseconds;
|
|
1038
|
+
price: DecimalString;
|
|
1039
|
+
insurance_debit: DecimalString;
|
|
1040
|
+
}>>;
|
|
950
1041
|
/**
|
|
951
1042
|
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
952
1043
|
*/
|
|
@@ -955,6 +1046,19 @@ declare const PerpsInstrumentSchema: z.ZodPipe<z.ZodObject<{
|
|
|
955
1046
|
instrument_type: z.ZodEnum<typeof PerpsInstrumentType>;
|
|
956
1047
|
category: z.ZodEnum<typeof PerpsInstrumentCategory>;
|
|
957
1048
|
symbol: z.ZodString;
|
|
1049
|
+
display_symbol: z.ZodOptional<z.ZodString>;
|
|
1050
|
+
close_only: z.ZodDefault<z.ZodBoolean>;
|
|
1051
|
+
settlement: z.ZodOptional<z.ZodPipe<z.ZodObject<{
|
|
1052
|
+
sequence: z.ZodNumber;
|
|
1053
|
+
timestamp: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
|
|
1054
|
+
price: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
|
|
1055
|
+
insurance_debit: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
|
|
1056
|
+
}, z.core.$strip>, z.ZodTransform<PerpsInstrumentSettlement, {
|
|
1057
|
+
sequence: number;
|
|
1058
|
+
timestamp: EpochMilliseconds;
|
|
1059
|
+
price: DecimalString;
|
|
1060
|
+
insurance_debit: DecimalString;
|
|
1061
|
+
}>>>;
|
|
958
1062
|
base_asset: z.ZodString;
|
|
959
1063
|
quote_asset: z.ZodString;
|
|
960
1064
|
funding_interval: z.ZodPipe<z.ZodString, z.ZodTransform<`${number}h`, string>>;
|
|
@@ -982,6 +1086,12 @@ declare const PerpsInstrumentSchema: z.ZodPipe<z.ZodObject<{
|
|
|
982
1086
|
id: PerpsInstrumentId;
|
|
983
1087
|
category: PerpsInstrumentCategory;
|
|
984
1088
|
symbol: string;
|
|
1089
|
+
/** Presentation label; canonical symbol and instrument ID remain unchanged. */
|
|
1090
|
+
displaySymbol: string | undefined;
|
|
1091
|
+
/** Whether new orders must reduce exposure; false for older responses. */
|
|
1092
|
+
closeOnly: boolean;
|
|
1093
|
+
/** Present after permanent retirement; trading cannot resume. */
|
|
1094
|
+
settlement: PerpsInstrumentSettlement | undefined;
|
|
985
1095
|
baseAsset: string;
|
|
986
1096
|
quoteAsset: string;
|
|
987
1097
|
fundingInterval: `${number}h`;
|
|
@@ -1004,6 +1114,7 @@ declare const PerpsInstrumentSchema: z.ZodPipe<z.ZodObject<{
|
|
|
1004
1114
|
instrument_type: PerpsInstrumentType.Perpetual;
|
|
1005
1115
|
category: PerpsInstrumentCategory;
|
|
1006
1116
|
symbol: string;
|
|
1117
|
+
close_only: boolean;
|
|
1007
1118
|
base_asset: string;
|
|
1008
1119
|
quote_asset: string;
|
|
1009
1120
|
funding_interval: `${number}h`;
|
|
@@ -1021,6 +1132,8 @@ declare const PerpsInstrumentSchema: z.ZodPipe<z.ZodObject<{
|
|
|
1021
1132
|
lowerBound: DecimalString;
|
|
1022
1133
|
maxLeverage: number;
|
|
1023
1134
|
}[];
|
|
1135
|
+
display_symbol?: string | undefined;
|
|
1136
|
+
settlement?: PerpsInstrumentSettlement | undefined;
|
|
1024
1137
|
}>>;
|
|
1025
1138
|
/**
|
|
1026
1139
|
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
@@ -1034,6 +1147,19 @@ declare const FetchPerpsInstrumentsResponseSchema: z.ZodArray<z.ZodPipe<z.ZodObj
|
|
|
1034
1147
|
instrument_type: z.ZodEnum<typeof PerpsInstrumentType>;
|
|
1035
1148
|
category: z.ZodEnum<typeof PerpsInstrumentCategory>;
|
|
1036
1149
|
symbol: z.ZodString;
|
|
1150
|
+
display_symbol: z.ZodOptional<z.ZodString>;
|
|
1151
|
+
close_only: z.ZodDefault<z.ZodBoolean>;
|
|
1152
|
+
settlement: z.ZodOptional<z.ZodPipe<z.ZodObject<{
|
|
1153
|
+
sequence: z.ZodNumber;
|
|
1154
|
+
timestamp: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
|
|
1155
|
+
price: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
|
|
1156
|
+
insurance_debit: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
|
|
1157
|
+
}, z.core.$strip>, z.ZodTransform<PerpsInstrumentSettlement, {
|
|
1158
|
+
sequence: number;
|
|
1159
|
+
timestamp: EpochMilliseconds;
|
|
1160
|
+
price: DecimalString;
|
|
1161
|
+
insurance_debit: DecimalString;
|
|
1162
|
+
}>>>;
|
|
1037
1163
|
base_asset: z.ZodString;
|
|
1038
1164
|
quote_asset: z.ZodString;
|
|
1039
1165
|
funding_interval: z.ZodPipe<z.ZodString, z.ZodTransform<`${number}h`, string>>;
|
|
@@ -1061,6 +1187,12 @@ declare const FetchPerpsInstrumentsResponseSchema: z.ZodArray<z.ZodPipe<z.ZodObj
|
|
|
1061
1187
|
id: PerpsInstrumentId;
|
|
1062
1188
|
category: PerpsInstrumentCategory;
|
|
1063
1189
|
symbol: string;
|
|
1190
|
+
/** Presentation label; canonical symbol and instrument ID remain unchanged. */
|
|
1191
|
+
displaySymbol: string | undefined;
|
|
1192
|
+
/** Whether new orders must reduce exposure; false for older responses. */
|
|
1193
|
+
closeOnly: boolean;
|
|
1194
|
+
/** Present after permanent retirement; trading cannot resume. */
|
|
1195
|
+
settlement: PerpsInstrumentSettlement | undefined;
|
|
1064
1196
|
baseAsset: string;
|
|
1065
1197
|
quoteAsset: string;
|
|
1066
1198
|
fundingInterval: `${number}h`;
|
|
@@ -1083,6 +1215,7 @@ declare const FetchPerpsInstrumentsResponseSchema: z.ZodArray<z.ZodPipe<z.ZodObj
|
|
|
1083
1215
|
instrument_type: PerpsInstrumentType.Perpetual;
|
|
1084
1216
|
category: PerpsInstrumentCategory;
|
|
1085
1217
|
symbol: string;
|
|
1218
|
+
close_only: boolean;
|
|
1086
1219
|
base_asset: string;
|
|
1087
1220
|
quote_asset: string;
|
|
1088
1221
|
funding_interval: `${number}h`;
|
|
@@ -1100,6 +1233,8 @@ declare const FetchPerpsInstrumentsResponseSchema: z.ZodArray<z.ZodPipe<z.ZodObj
|
|
|
1100
1233
|
lowerBound: DecimalString;
|
|
1101
1234
|
maxLeverage: number;
|
|
1102
1235
|
}[];
|
|
1236
|
+
display_symbol?: string | undefined;
|
|
1237
|
+
settlement?: PerpsInstrumentSettlement | undefined;
|
|
1103
1238
|
}>>>;
|
|
1104
1239
|
/**
|
|
1105
1240
|
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
@@ -1498,6 +1633,7 @@ declare const PerpsPublicTradeSchema: z.ZodPipe<z.ZodObject<{
|
|
|
1498
1633
|
trade_id: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsTradeId, number>>;
|
|
1499
1634
|
instrument_id: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsInstrumentId, number>>;
|
|
1500
1635
|
side: z.ZodEnum<typeof PerpsSide>;
|
|
1636
|
+
settlement: z.ZodDefault<z.ZodBoolean>;
|
|
1501
1637
|
price: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
|
|
1502
1638
|
quantity: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
|
|
1503
1639
|
timestamp: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
|
|
@@ -1506,6 +1642,8 @@ declare const PerpsPublicTradeSchema: z.ZodPipe<z.ZodObject<{
|
|
|
1506
1642
|
tradeId: PerpsTradeId;
|
|
1507
1643
|
instrumentId: PerpsInstrumentId;
|
|
1508
1644
|
side: PerpsSide;
|
|
1645
|
+
/** True for a position close at instrument settlement; false on older responses. */
|
|
1646
|
+
settlement: boolean;
|
|
1509
1647
|
price: DecimalString;
|
|
1510
1648
|
quantity: DecimalString;
|
|
1511
1649
|
timestamp: EpochMilliseconds;
|
|
@@ -1514,6 +1652,7 @@ declare const PerpsPublicTradeSchema: z.ZodPipe<z.ZodObject<{
|
|
|
1514
1652
|
trade_id: PerpsTradeId;
|
|
1515
1653
|
instrument_id: PerpsInstrumentId;
|
|
1516
1654
|
side: PerpsSide;
|
|
1655
|
+
settlement: boolean;
|
|
1517
1656
|
price: DecimalString;
|
|
1518
1657
|
quantity: DecimalString;
|
|
1519
1658
|
timestamp: EpochMilliseconds;
|
|
@@ -1530,6 +1669,7 @@ declare const PerpsPublicTradeUpdateSchema: z.ZodPipe<z.ZodObject<{
|
|
|
1530
1669
|
tid: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsTradeId, number>>;
|
|
1531
1670
|
iid: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsInstrumentId, number>>;
|
|
1532
1671
|
side: z.ZodEnum<typeof PerpsSide>;
|
|
1672
|
+
settlement: z.ZodDefault<z.ZodBoolean>;
|
|
1533
1673
|
p: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
|
|
1534
1674
|
qty: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
|
|
1535
1675
|
ts: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
|
|
@@ -1538,6 +1678,8 @@ declare const PerpsPublicTradeUpdateSchema: z.ZodPipe<z.ZodObject<{
|
|
|
1538
1678
|
tradeId: PerpsTradeId;
|
|
1539
1679
|
instrumentId: PerpsInstrumentId;
|
|
1540
1680
|
side: PerpsSide;
|
|
1681
|
+
/** True for a position close at instrument settlement; false on older responses. */
|
|
1682
|
+
settlement: boolean;
|
|
1541
1683
|
price: DecimalString;
|
|
1542
1684
|
quantity: DecimalString;
|
|
1543
1685
|
timestamp: EpochMilliseconds;
|
|
@@ -1546,6 +1688,7 @@ declare const PerpsPublicTradeUpdateSchema: z.ZodPipe<z.ZodObject<{
|
|
|
1546
1688
|
tid: PerpsTradeId;
|
|
1547
1689
|
iid: PerpsInstrumentId;
|
|
1548
1690
|
side: PerpsSide;
|
|
1691
|
+
settlement: boolean;
|
|
1549
1692
|
p: DecimalString;
|
|
1550
1693
|
qty: DecimalString;
|
|
1551
1694
|
ts: EpochMilliseconds;
|
|
@@ -1559,6 +1702,7 @@ declare const FetchPerpsTradesResponseSchema: z.ZodObject<{
|
|
|
1559
1702
|
trade_id: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsTradeId, number>>;
|
|
1560
1703
|
instrument_id: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsInstrumentId, number>>;
|
|
1561
1704
|
side: z.ZodEnum<typeof PerpsSide>;
|
|
1705
|
+
settlement: z.ZodDefault<z.ZodBoolean>;
|
|
1562
1706
|
price: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
|
|
1563
1707
|
quantity: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
|
|
1564
1708
|
timestamp: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
|
|
@@ -1567,6 +1711,8 @@ declare const FetchPerpsTradesResponseSchema: z.ZodObject<{
|
|
|
1567
1711
|
tradeId: PerpsTradeId;
|
|
1568
1712
|
instrumentId: PerpsInstrumentId;
|
|
1569
1713
|
side: PerpsSide;
|
|
1714
|
+
/** True for a position close at instrument settlement; false on older responses. */
|
|
1715
|
+
settlement: boolean;
|
|
1570
1716
|
price: DecimalString;
|
|
1571
1717
|
quantity: DecimalString;
|
|
1572
1718
|
timestamp: EpochMilliseconds;
|
|
@@ -1575,6 +1721,7 @@ declare const FetchPerpsTradesResponseSchema: z.ZodObject<{
|
|
|
1575
1721
|
trade_id: PerpsTradeId;
|
|
1576
1722
|
instrument_id: PerpsInstrumentId;
|
|
1577
1723
|
side: PerpsSide;
|
|
1724
|
+
settlement: boolean;
|
|
1578
1725
|
price: DecimalString;
|
|
1579
1726
|
quantity: DecimalString;
|
|
1580
1727
|
timestamp: EpochMilliseconds;
|
|
@@ -1824,4 +1971,841 @@ declare const FetchPerpsCandlesResponseSchema: z.ZodObject<{
|
|
|
1824
1971
|
more: z.ZodBoolean;
|
|
1825
1972
|
}, z.core.$strip>;
|
|
1826
1973
|
|
|
1827
|
-
|
|
1974
|
+
/** @experimental This API may change in a breaking way in any release, including patch releases. */
|
|
1975
|
+
declare enum PerpsPositionSnapshotStatus {
|
|
1976
|
+
Ok = "ok",
|
|
1977
|
+
NotFound = "not_found",
|
|
1978
|
+
HistoryPending = "history_pending",
|
|
1979
|
+
HistoryLimit = "history_limit",
|
|
1980
|
+
ResourceLimit = "resource_limit",
|
|
1981
|
+
TemporarilyUnavailable = "temporarily_unavailable",
|
|
1982
|
+
Unavailable = "unavailable"
|
|
1983
|
+
}
|
|
1984
|
+
/** @experimental This API may change in a breaking way in any release, including patch releases. */
|
|
1985
|
+
declare enum PerpsPositionSnapshotMarkerKind {
|
|
1986
|
+
Increase = "increase",
|
|
1987
|
+
Decrease = "decrease"
|
|
1988
|
+
}
|
|
1989
|
+
/** @experimental This API may change in a breaking way in any release, including patch releases. */
|
|
1990
|
+
declare const PerpsPositionSnapshotCandleSchema: z.ZodObject<{
|
|
1991
|
+
position: z.ZodNumber;
|
|
1992
|
+
open: z.ZodNumber;
|
|
1993
|
+
high: z.ZodNumber;
|
|
1994
|
+
low: z.ZodNumber;
|
|
1995
|
+
close: z.ZodNumber;
|
|
1996
|
+
}, z.core.$strip>;
|
|
1997
|
+
/** @experimental This API may change in a breaking way in any release, including patch releases. */
|
|
1998
|
+
type PerpsPositionSnapshotCandle = z.infer<typeof PerpsPositionSnapshotCandleSchema>;
|
|
1999
|
+
/** @experimental This API may change in a breaking way in any release, including patch releases. */
|
|
2000
|
+
declare const PerpsPositionSnapshotMarkerSchema: z.ZodObject<{
|
|
2001
|
+
position: z.ZodNumber;
|
|
2002
|
+
kind: z.ZodEnum<typeof PerpsPositionSnapshotMarkerKind>;
|
|
2003
|
+
}, z.core.$strip>;
|
|
2004
|
+
/** @experimental This API may change in a breaking way in any release, including patch releases. */
|
|
2005
|
+
type PerpsPositionSnapshotMarker = z.infer<typeof PerpsPositionSnapshotMarkerSchema>;
|
|
2006
|
+
/** @experimental This API may change in a breaking way in any release, including patch releases. */
|
|
2007
|
+
declare const PerpsPositionSnapshotChartSchema: z.ZodObject<{
|
|
2008
|
+
candles: z.ZodArray<z.ZodObject<{
|
|
2009
|
+
position: z.ZodNumber;
|
|
2010
|
+
open: z.ZodNumber;
|
|
2011
|
+
high: z.ZodNumber;
|
|
2012
|
+
low: z.ZodNumber;
|
|
2013
|
+
close: z.ZodNumber;
|
|
2014
|
+
}, z.core.$strip>>;
|
|
2015
|
+
markers: z.ZodArray<z.ZodObject<{
|
|
2016
|
+
position: z.ZodNumber;
|
|
2017
|
+
kind: z.ZodEnum<typeof PerpsPositionSnapshotMarkerKind>;
|
|
2018
|
+
}, z.core.$strip>>;
|
|
2019
|
+
}, z.core.$strip>;
|
|
2020
|
+
/** @experimental This API may change in a breaking way in any release, including patch releases. */
|
|
2021
|
+
type PerpsPositionSnapshotChart = z.infer<typeof PerpsPositionSnapshotChartSchema>;
|
|
2022
|
+
/** @experimental This API may change in a breaking way in any release, including patch releases. */
|
|
2023
|
+
declare const PerpsPositionSnapshotSchema: z.ZodPipe<z.ZodObject<{
|
|
2024
|
+
position_cycle_id: z.ZodString;
|
|
2025
|
+
side: z.ZodEnum<typeof PerpsSide>;
|
|
2026
|
+
started_at: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
|
|
2027
|
+
as_of_at: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
|
|
2028
|
+
is_closed: z.ZodBoolean;
|
|
2029
|
+
size_after: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
|
|
2030
|
+
entry_price: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
|
|
2031
|
+
as_of_price: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
|
|
2032
|
+
pnl: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
|
|
2033
|
+
pnl_percent: z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
|
|
2034
|
+
leverage: z.ZodNullable<z.ZodNumber>;
|
|
2035
|
+
chart: z.ZodObject<{
|
|
2036
|
+
candles: z.ZodArray<z.ZodObject<{
|
|
2037
|
+
position: z.ZodNumber;
|
|
2038
|
+
open: z.ZodNumber;
|
|
2039
|
+
high: z.ZodNumber;
|
|
2040
|
+
low: z.ZodNumber;
|
|
2041
|
+
close: z.ZodNumber;
|
|
2042
|
+
}, z.core.$strip>>;
|
|
2043
|
+
markers: z.ZodArray<z.ZodObject<{
|
|
2044
|
+
position: z.ZodNumber;
|
|
2045
|
+
kind: z.ZodEnum<typeof PerpsPositionSnapshotMarkerKind>;
|
|
2046
|
+
}, z.core.$strip>>;
|
|
2047
|
+
}, z.core.$strip>;
|
|
2048
|
+
}, z.core.$strip>, z.ZodTransform<{
|
|
2049
|
+
positionCycleId: string;
|
|
2050
|
+
side: PerpsSide;
|
|
2051
|
+
startedAt: EpochMilliseconds;
|
|
2052
|
+
asOfAt: EpochMilliseconds;
|
|
2053
|
+
isClosed: boolean;
|
|
2054
|
+
sizeAfter: DecimalString;
|
|
2055
|
+
entryPrice: DecimalString;
|
|
2056
|
+
asOfPrice: DecimalString;
|
|
2057
|
+
pnl: DecimalString;
|
|
2058
|
+
pnlPercent: DecimalString | null;
|
|
2059
|
+
leverage: number | null;
|
|
2060
|
+
chart: {
|
|
2061
|
+
candles: {
|
|
2062
|
+
position: number;
|
|
2063
|
+
open: number;
|
|
2064
|
+
high: number;
|
|
2065
|
+
low: number;
|
|
2066
|
+
close: number;
|
|
2067
|
+
}[];
|
|
2068
|
+
markers: {
|
|
2069
|
+
position: number;
|
|
2070
|
+
kind: PerpsPositionSnapshotMarkerKind;
|
|
2071
|
+
}[];
|
|
2072
|
+
};
|
|
2073
|
+
}, {
|
|
2074
|
+
position_cycle_id: string;
|
|
2075
|
+
side: PerpsSide;
|
|
2076
|
+
started_at: EpochMilliseconds;
|
|
2077
|
+
as_of_at: EpochMilliseconds;
|
|
2078
|
+
is_closed: boolean;
|
|
2079
|
+
size_after: DecimalString;
|
|
2080
|
+
entry_price: DecimalString;
|
|
2081
|
+
as_of_price: DecimalString;
|
|
2082
|
+
pnl: DecimalString;
|
|
2083
|
+
pnl_percent: DecimalString | null;
|
|
2084
|
+
leverage: number | null;
|
|
2085
|
+
chart: {
|
|
2086
|
+
candles: {
|
|
2087
|
+
position: number;
|
|
2088
|
+
open: number;
|
|
2089
|
+
high: number;
|
|
2090
|
+
low: number;
|
|
2091
|
+
close: number;
|
|
2092
|
+
}[];
|
|
2093
|
+
markers: {
|
|
2094
|
+
position: number;
|
|
2095
|
+
kind: PerpsPositionSnapshotMarkerKind;
|
|
2096
|
+
}[];
|
|
2097
|
+
};
|
|
2098
|
+
}>>;
|
|
2099
|
+
/** A position cycle valued at captured state or immediately after a selected fill.
|
|
2100
|
+
* @experimental This API may change in a breaking way in any release, including patch releases. */
|
|
2101
|
+
type PerpsPositionSnapshot = z.infer<typeof PerpsPositionSnapshotSchema>;
|
|
2102
|
+
/** @experimental This API may change in a breaking way in any release, including patch releases. */
|
|
2103
|
+
type PerpsPositionSnapshotResult = {
|
|
2104
|
+
instrumentId: PerpsInstrumentId;
|
|
2105
|
+
tradeId?: string;
|
|
2106
|
+
status: PerpsPositionSnapshotStatus.Ok;
|
|
2107
|
+
snapshot: PerpsPositionSnapshot;
|
|
2108
|
+
} | {
|
|
2109
|
+
instrumentId: PerpsInstrumentId;
|
|
2110
|
+
tradeId?: string;
|
|
2111
|
+
status: Exclude<PerpsPositionSnapshotStatus, PerpsPositionSnapshotStatus.Ok>;
|
|
2112
|
+
};
|
|
2113
|
+
declare const HistoryResultSchema: z.ZodPipe<z.ZodPipe<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
2114
|
+
instrument_id: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsInstrumentId, number>>;
|
|
2115
|
+
trade_id: z.ZodOptional<z.ZodString>;
|
|
2116
|
+
status: z.ZodLiteral<PerpsPositionSnapshotStatus.Ok>;
|
|
2117
|
+
snapshot: z.ZodPipe<z.ZodObject<{
|
|
2118
|
+
position_cycle_id: z.ZodString;
|
|
2119
|
+
side: z.ZodEnum<typeof PerpsSide>;
|
|
2120
|
+
started_at: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
|
|
2121
|
+
as_of_at: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
|
|
2122
|
+
is_closed: z.ZodBoolean;
|
|
2123
|
+
size_after: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
|
|
2124
|
+
entry_price: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
|
|
2125
|
+
as_of_price: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
|
|
2126
|
+
pnl: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
|
|
2127
|
+
pnl_percent: z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
|
|
2128
|
+
leverage: z.ZodNullable<z.ZodNumber>;
|
|
2129
|
+
chart: z.ZodObject<{
|
|
2130
|
+
candles: z.ZodArray<z.ZodObject<{
|
|
2131
|
+
position: z.ZodNumber;
|
|
2132
|
+
open: z.ZodNumber;
|
|
2133
|
+
high: z.ZodNumber;
|
|
2134
|
+
low: z.ZodNumber;
|
|
2135
|
+
close: z.ZodNumber;
|
|
2136
|
+
}, z.core.$strip>>;
|
|
2137
|
+
markers: z.ZodArray<z.ZodObject<{
|
|
2138
|
+
position: z.ZodNumber;
|
|
2139
|
+
kind: z.ZodEnum<typeof PerpsPositionSnapshotMarkerKind>;
|
|
2140
|
+
}, z.core.$strip>>;
|
|
2141
|
+
}, z.core.$strip>;
|
|
2142
|
+
}, z.core.$strip>, z.ZodTransform<{
|
|
2143
|
+
positionCycleId: string;
|
|
2144
|
+
side: PerpsSide;
|
|
2145
|
+
startedAt: EpochMilliseconds;
|
|
2146
|
+
asOfAt: EpochMilliseconds;
|
|
2147
|
+
isClosed: boolean;
|
|
2148
|
+
sizeAfter: DecimalString;
|
|
2149
|
+
entryPrice: DecimalString;
|
|
2150
|
+
asOfPrice: DecimalString;
|
|
2151
|
+
pnl: DecimalString;
|
|
2152
|
+
pnlPercent: DecimalString | null;
|
|
2153
|
+
leverage: number | null;
|
|
2154
|
+
chart: {
|
|
2155
|
+
candles: {
|
|
2156
|
+
position: number;
|
|
2157
|
+
open: number;
|
|
2158
|
+
high: number;
|
|
2159
|
+
low: number;
|
|
2160
|
+
close: number;
|
|
2161
|
+
}[];
|
|
2162
|
+
markers: {
|
|
2163
|
+
position: number;
|
|
2164
|
+
kind: PerpsPositionSnapshotMarkerKind;
|
|
2165
|
+
}[];
|
|
2166
|
+
};
|
|
2167
|
+
}, {
|
|
2168
|
+
position_cycle_id: string;
|
|
2169
|
+
side: PerpsSide;
|
|
2170
|
+
started_at: EpochMilliseconds;
|
|
2171
|
+
as_of_at: EpochMilliseconds;
|
|
2172
|
+
is_closed: boolean;
|
|
2173
|
+
size_after: DecimalString;
|
|
2174
|
+
entry_price: DecimalString;
|
|
2175
|
+
as_of_price: DecimalString;
|
|
2176
|
+
pnl: DecimalString;
|
|
2177
|
+
pnl_percent: DecimalString | null;
|
|
2178
|
+
leverage: number | null;
|
|
2179
|
+
chart: {
|
|
2180
|
+
candles: {
|
|
2181
|
+
position: number;
|
|
2182
|
+
open: number;
|
|
2183
|
+
high: number;
|
|
2184
|
+
low: number;
|
|
2185
|
+
close: number;
|
|
2186
|
+
}[];
|
|
2187
|
+
markers: {
|
|
2188
|
+
position: number;
|
|
2189
|
+
kind: PerpsPositionSnapshotMarkerKind;
|
|
2190
|
+
}[];
|
|
2191
|
+
};
|
|
2192
|
+
}>>;
|
|
2193
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
2194
|
+
instrument_id: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsInstrumentId, number>>;
|
|
2195
|
+
trade_id: z.ZodOptional<z.ZodString>;
|
|
2196
|
+
status: z.ZodEnum<{
|
|
2197
|
+
readonly NotFound: PerpsPositionSnapshotStatus.NotFound;
|
|
2198
|
+
readonly HistoryPending: PerpsPositionSnapshotStatus.HistoryPending;
|
|
2199
|
+
readonly HistoryLimit: PerpsPositionSnapshotStatus.HistoryLimit;
|
|
2200
|
+
readonly ResourceLimit: PerpsPositionSnapshotStatus.ResourceLimit;
|
|
2201
|
+
readonly TemporarilyUnavailable: PerpsPositionSnapshotStatus.TemporarilyUnavailable;
|
|
2202
|
+
readonly Unavailable: PerpsPositionSnapshotStatus.Unavailable;
|
|
2203
|
+
}>;
|
|
2204
|
+
snapshot: z.ZodOptional<z.ZodNever>;
|
|
2205
|
+
}, z.core.$strip>], "status">, z.ZodTransform<{
|
|
2206
|
+
instrumentId: PerpsInstrumentId;
|
|
2207
|
+
tradeId?: string;
|
|
2208
|
+
status: PerpsPositionSnapshotStatus.Ok;
|
|
2209
|
+
snapshot: PerpsPositionSnapshot;
|
|
2210
|
+
} | {
|
|
2211
|
+
instrumentId: PerpsInstrumentId;
|
|
2212
|
+
tradeId?: string;
|
|
2213
|
+
status: Exclude<PerpsPositionSnapshotStatus, PerpsPositionSnapshotStatus.Ok>;
|
|
2214
|
+
}, {
|
|
2215
|
+
instrument_id: PerpsInstrumentId;
|
|
2216
|
+
status: PerpsPositionSnapshotStatus.Ok;
|
|
2217
|
+
snapshot: {
|
|
2218
|
+
positionCycleId: string;
|
|
2219
|
+
side: PerpsSide;
|
|
2220
|
+
startedAt: EpochMilliseconds;
|
|
2221
|
+
asOfAt: EpochMilliseconds;
|
|
2222
|
+
isClosed: boolean;
|
|
2223
|
+
sizeAfter: DecimalString;
|
|
2224
|
+
entryPrice: DecimalString;
|
|
2225
|
+
asOfPrice: DecimalString;
|
|
2226
|
+
pnl: DecimalString;
|
|
2227
|
+
pnlPercent: DecimalString | null;
|
|
2228
|
+
leverage: number | null;
|
|
2229
|
+
chart: {
|
|
2230
|
+
candles: {
|
|
2231
|
+
position: number;
|
|
2232
|
+
open: number;
|
|
2233
|
+
high: number;
|
|
2234
|
+
low: number;
|
|
2235
|
+
close: number;
|
|
2236
|
+
}[];
|
|
2237
|
+
markers: {
|
|
2238
|
+
position: number;
|
|
2239
|
+
kind: PerpsPositionSnapshotMarkerKind;
|
|
2240
|
+
}[];
|
|
2241
|
+
};
|
|
2242
|
+
};
|
|
2243
|
+
trade_id?: string | undefined;
|
|
2244
|
+
} | {
|
|
2245
|
+
instrument_id: PerpsInstrumentId;
|
|
2246
|
+
status: PerpsPositionSnapshotStatus.NotFound | PerpsPositionSnapshotStatus.HistoryPending | PerpsPositionSnapshotStatus.HistoryLimit | PerpsPositionSnapshotStatus.ResourceLimit | PerpsPositionSnapshotStatus.TemporarilyUnavailable | PerpsPositionSnapshotStatus.Unavailable;
|
|
2247
|
+
trade_id?: string | undefined;
|
|
2248
|
+
snapshot?: undefined;
|
|
2249
|
+
}>>, z.ZodTransform<{
|
|
2250
|
+
tradeId: string;
|
|
2251
|
+
instrumentId: PerpsInstrumentId;
|
|
2252
|
+
status: PerpsPositionSnapshotStatus.Ok;
|
|
2253
|
+
snapshot: PerpsPositionSnapshot;
|
|
2254
|
+
} | {
|
|
2255
|
+
tradeId: string;
|
|
2256
|
+
instrumentId: PerpsInstrumentId;
|
|
2257
|
+
status: Exclude<PerpsPositionSnapshotStatus, PerpsPositionSnapshotStatus.Ok>;
|
|
2258
|
+
}, {
|
|
2259
|
+
instrumentId: PerpsInstrumentId;
|
|
2260
|
+
tradeId?: string;
|
|
2261
|
+
status: PerpsPositionSnapshotStatus.Ok;
|
|
2262
|
+
snapshot: PerpsPositionSnapshot;
|
|
2263
|
+
} | {
|
|
2264
|
+
instrumentId: PerpsInstrumentId;
|
|
2265
|
+
tradeId?: string;
|
|
2266
|
+
status: Exclude<PerpsPositionSnapshotStatus, PerpsPositionSnapshotStatus.Ok>;
|
|
2267
|
+
}>>;
|
|
2268
|
+
/** @experimental This API may change in a breaking way in any release, including patch releases. */
|
|
2269
|
+
type PerpsHistoricalPositionSnapshotResult = z.infer<typeof HistoryResultSchema>;
|
|
2270
|
+
/** @experimental This API may change in a breaking way in any release, including patch releases. */
|
|
2271
|
+
declare const PerpsPositionSnapshotsSchema: z.ZodPipe<z.ZodObject<{
|
|
2272
|
+
history_as_of_at: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
|
|
2273
|
+
active: z.ZodArray<z.ZodPipe<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
2274
|
+
instrument_id: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsInstrumentId, number>>;
|
|
2275
|
+
trade_id: z.ZodOptional<z.ZodString>;
|
|
2276
|
+
status: z.ZodLiteral<PerpsPositionSnapshotStatus.Ok>;
|
|
2277
|
+
snapshot: z.ZodPipe<z.ZodObject<{
|
|
2278
|
+
position_cycle_id: z.ZodString;
|
|
2279
|
+
side: z.ZodEnum<typeof PerpsSide>;
|
|
2280
|
+
started_at: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
|
|
2281
|
+
as_of_at: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
|
|
2282
|
+
is_closed: z.ZodBoolean;
|
|
2283
|
+
size_after: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
|
|
2284
|
+
entry_price: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
|
|
2285
|
+
as_of_price: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
|
|
2286
|
+
pnl: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
|
|
2287
|
+
pnl_percent: z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
|
|
2288
|
+
leverage: z.ZodNullable<z.ZodNumber>;
|
|
2289
|
+
chart: z.ZodObject<{
|
|
2290
|
+
candles: z.ZodArray<z.ZodObject<{
|
|
2291
|
+
position: z.ZodNumber;
|
|
2292
|
+
open: z.ZodNumber;
|
|
2293
|
+
high: z.ZodNumber;
|
|
2294
|
+
low: z.ZodNumber;
|
|
2295
|
+
close: z.ZodNumber;
|
|
2296
|
+
}, z.core.$strip>>;
|
|
2297
|
+
markers: z.ZodArray<z.ZodObject<{
|
|
2298
|
+
position: z.ZodNumber;
|
|
2299
|
+
kind: z.ZodEnum<typeof PerpsPositionSnapshotMarkerKind>;
|
|
2300
|
+
}, z.core.$strip>>;
|
|
2301
|
+
}, z.core.$strip>;
|
|
2302
|
+
}, z.core.$strip>, z.ZodTransform<{
|
|
2303
|
+
positionCycleId: string;
|
|
2304
|
+
side: PerpsSide;
|
|
2305
|
+
startedAt: EpochMilliseconds;
|
|
2306
|
+
asOfAt: EpochMilliseconds;
|
|
2307
|
+
isClosed: boolean;
|
|
2308
|
+
sizeAfter: DecimalString;
|
|
2309
|
+
entryPrice: DecimalString;
|
|
2310
|
+
asOfPrice: DecimalString;
|
|
2311
|
+
pnl: DecimalString;
|
|
2312
|
+
pnlPercent: DecimalString | null;
|
|
2313
|
+
leverage: number | null;
|
|
2314
|
+
chart: {
|
|
2315
|
+
candles: {
|
|
2316
|
+
position: number;
|
|
2317
|
+
open: number;
|
|
2318
|
+
high: number;
|
|
2319
|
+
low: number;
|
|
2320
|
+
close: number;
|
|
2321
|
+
}[];
|
|
2322
|
+
markers: {
|
|
2323
|
+
position: number;
|
|
2324
|
+
kind: PerpsPositionSnapshotMarkerKind;
|
|
2325
|
+
}[];
|
|
2326
|
+
};
|
|
2327
|
+
}, {
|
|
2328
|
+
position_cycle_id: string;
|
|
2329
|
+
side: PerpsSide;
|
|
2330
|
+
started_at: EpochMilliseconds;
|
|
2331
|
+
as_of_at: EpochMilliseconds;
|
|
2332
|
+
is_closed: boolean;
|
|
2333
|
+
size_after: DecimalString;
|
|
2334
|
+
entry_price: DecimalString;
|
|
2335
|
+
as_of_price: DecimalString;
|
|
2336
|
+
pnl: DecimalString;
|
|
2337
|
+
pnl_percent: DecimalString | null;
|
|
2338
|
+
leverage: number | null;
|
|
2339
|
+
chart: {
|
|
2340
|
+
candles: {
|
|
2341
|
+
position: number;
|
|
2342
|
+
open: number;
|
|
2343
|
+
high: number;
|
|
2344
|
+
low: number;
|
|
2345
|
+
close: number;
|
|
2346
|
+
}[];
|
|
2347
|
+
markers: {
|
|
2348
|
+
position: number;
|
|
2349
|
+
kind: PerpsPositionSnapshotMarkerKind;
|
|
2350
|
+
}[];
|
|
2351
|
+
};
|
|
2352
|
+
}>>;
|
|
2353
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
2354
|
+
instrument_id: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsInstrumentId, number>>;
|
|
2355
|
+
trade_id: z.ZodOptional<z.ZodString>;
|
|
2356
|
+
status: z.ZodEnum<{
|
|
2357
|
+
readonly NotFound: PerpsPositionSnapshotStatus.NotFound;
|
|
2358
|
+
readonly HistoryPending: PerpsPositionSnapshotStatus.HistoryPending;
|
|
2359
|
+
readonly HistoryLimit: PerpsPositionSnapshotStatus.HistoryLimit;
|
|
2360
|
+
readonly ResourceLimit: PerpsPositionSnapshotStatus.ResourceLimit;
|
|
2361
|
+
readonly TemporarilyUnavailable: PerpsPositionSnapshotStatus.TemporarilyUnavailable;
|
|
2362
|
+
readonly Unavailable: PerpsPositionSnapshotStatus.Unavailable;
|
|
2363
|
+
}>;
|
|
2364
|
+
snapshot: z.ZodOptional<z.ZodNever>;
|
|
2365
|
+
}, z.core.$strip>], "status">, z.ZodTransform<{
|
|
2366
|
+
instrumentId: PerpsInstrumentId;
|
|
2367
|
+
tradeId?: string;
|
|
2368
|
+
status: PerpsPositionSnapshotStatus.Ok;
|
|
2369
|
+
snapshot: PerpsPositionSnapshot;
|
|
2370
|
+
} | {
|
|
2371
|
+
instrumentId: PerpsInstrumentId;
|
|
2372
|
+
tradeId?: string;
|
|
2373
|
+
status: Exclude<PerpsPositionSnapshotStatus, PerpsPositionSnapshotStatus.Ok>;
|
|
2374
|
+
}, {
|
|
2375
|
+
instrument_id: PerpsInstrumentId;
|
|
2376
|
+
status: PerpsPositionSnapshotStatus.Ok;
|
|
2377
|
+
snapshot: {
|
|
2378
|
+
positionCycleId: string;
|
|
2379
|
+
side: PerpsSide;
|
|
2380
|
+
startedAt: EpochMilliseconds;
|
|
2381
|
+
asOfAt: EpochMilliseconds;
|
|
2382
|
+
isClosed: boolean;
|
|
2383
|
+
sizeAfter: DecimalString;
|
|
2384
|
+
entryPrice: DecimalString;
|
|
2385
|
+
asOfPrice: DecimalString;
|
|
2386
|
+
pnl: DecimalString;
|
|
2387
|
+
pnlPercent: DecimalString | null;
|
|
2388
|
+
leverage: number | null;
|
|
2389
|
+
chart: {
|
|
2390
|
+
candles: {
|
|
2391
|
+
position: number;
|
|
2392
|
+
open: number;
|
|
2393
|
+
high: number;
|
|
2394
|
+
low: number;
|
|
2395
|
+
close: number;
|
|
2396
|
+
}[];
|
|
2397
|
+
markers: {
|
|
2398
|
+
position: number;
|
|
2399
|
+
kind: PerpsPositionSnapshotMarkerKind;
|
|
2400
|
+
}[];
|
|
2401
|
+
};
|
|
2402
|
+
};
|
|
2403
|
+
trade_id?: string | undefined;
|
|
2404
|
+
} | {
|
|
2405
|
+
instrument_id: PerpsInstrumentId;
|
|
2406
|
+
status: PerpsPositionSnapshotStatus.NotFound | PerpsPositionSnapshotStatus.HistoryPending | PerpsPositionSnapshotStatus.HistoryLimit | PerpsPositionSnapshotStatus.ResourceLimit | PerpsPositionSnapshotStatus.TemporarilyUnavailable | PerpsPositionSnapshotStatus.Unavailable;
|
|
2407
|
+
trade_id?: string | undefined;
|
|
2408
|
+
snapshot?: undefined;
|
|
2409
|
+
}>>>;
|
|
2410
|
+
history: z.ZodArray<z.ZodPipe<z.ZodPipe<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
2411
|
+
instrument_id: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsInstrumentId, number>>;
|
|
2412
|
+
trade_id: z.ZodOptional<z.ZodString>;
|
|
2413
|
+
status: z.ZodLiteral<PerpsPositionSnapshotStatus.Ok>;
|
|
2414
|
+
snapshot: z.ZodPipe<z.ZodObject<{
|
|
2415
|
+
position_cycle_id: z.ZodString;
|
|
2416
|
+
side: z.ZodEnum<typeof PerpsSide>;
|
|
2417
|
+
started_at: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
|
|
2418
|
+
as_of_at: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
|
|
2419
|
+
is_closed: z.ZodBoolean;
|
|
2420
|
+
size_after: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
|
|
2421
|
+
entry_price: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
|
|
2422
|
+
as_of_price: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
|
|
2423
|
+
pnl: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
|
|
2424
|
+
pnl_percent: z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
|
|
2425
|
+
leverage: z.ZodNullable<z.ZodNumber>;
|
|
2426
|
+
chart: z.ZodObject<{
|
|
2427
|
+
candles: z.ZodArray<z.ZodObject<{
|
|
2428
|
+
position: z.ZodNumber;
|
|
2429
|
+
open: z.ZodNumber;
|
|
2430
|
+
high: z.ZodNumber;
|
|
2431
|
+
low: z.ZodNumber;
|
|
2432
|
+
close: z.ZodNumber;
|
|
2433
|
+
}, z.core.$strip>>;
|
|
2434
|
+
markers: z.ZodArray<z.ZodObject<{
|
|
2435
|
+
position: z.ZodNumber;
|
|
2436
|
+
kind: z.ZodEnum<typeof PerpsPositionSnapshotMarkerKind>;
|
|
2437
|
+
}, z.core.$strip>>;
|
|
2438
|
+
}, z.core.$strip>;
|
|
2439
|
+
}, z.core.$strip>, z.ZodTransform<{
|
|
2440
|
+
positionCycleId: string;
|
|
2441
|
+
side: PerpsSide;
|
|
2442
|
+
startedAt: EpochMilliseconds;
|
|
2443
|
+
asOfAt: EpochMilliseconds;
|
|
2444
|
+
isClosed: boolean;
|
|
2445
|
+
sizeAfter: DecimalString;
|
|
2446
|
+
entryPrice: DecimalString;
|
|
2447
|
+
asOfPrice: DecimalString;
|
|
2448
|
+
pnl: DecimalString;
|
|
2449
|
+
pnlPercent: DecimalString | null;
|
|
2450
|
+
leverage: number | null;
|
|
2451
|
+
chart: {
|
|
2452
|
+
candles: {
|
|
2453
|
+
position: number;
|
|
2454
|
+
open: number;
|
|
2455
|
+
high: number;
|
|
2456
|
+
low: number;
|
|
2457
|
+
close: number;
|
|
2458
|
+
}[];
|
|
2459
|
+
markers: {
|
|
2460
|
+
position: number;
|
|
2461
|
+
kind: PerpsPositionSnapshotMarkerKind;
|
|
2462
|
+
}[];
|
|
2463
|
+
};
|
|
2464
|
+
}, {
|
|
2465
|
+
position_cycle_id: string;
|
|
2466
|
+
side: PerpsSide;
|
|
2467
|
+
started_at: EpochMilliseconds;
|
|
2468
|
+
as_of_at: EpochMilliseconds;
|
|
2469
|
+
is_closed: boolean;
|
|
2470
|
+
size_after: DecimalString;
|
|
2471
|
+
entry_price: DecimalString;
|
|
2472
|
+
as_of_price: DecimalString;
|
|
2473
|
+
pnl: DecimalString;
|
|
2474
|
+
pnl_percent: DecimalString | null;
|
|
2475
|
+
leverage: number | null;
|
|
2476
|
+
chart: {
|
|
2477
|
+
candles: {
|
|
2478
|
+
position: number;
|
|
2479
|
+
open: number;
|
|
2480
|
+
high: number;
|
|
2481
|
+
low: number;
|
|
2482
|
+
close: number;
|
|
2483
|
+
}[];
|
|
2484
|
+
markers: {
|
|
2485
|
+
position: number;
|
|
2486
|
+
kind: PerpsPositionSnapshotMarkerKind;
|
|
2487
|
+
}[];
|
|
2488
|
+
};
|
|
2489
|
+
}>>;
|
|
2490
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
2491
|
+
instrument_id: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsInstrumentId, number>>;
|
|
2492
|
+
trade_id: z.ZodOptional<z.ZodString>;
|
|
2493
|
+
status: z.ZodEnum<{
|
|
2494
|
+
readonly NotFound: PerpsPositionSnapshotStatus.NotFound;
|
|
2495
|
+
readonly HistoryPending: PerpsPositionSnapshotStatus.HistoryPending;
|
|
2496
|
+
readonly HistoryLimit: PerpsPositionSnapshotStatus.HistoryLimit;
|
|
2497
|
+
readonly ResourceLimit: PerpsPositionSnapshotStatus.ResourceLimit;
|
|
2498
|
+
readonly TemporarilyUnavailable: PerpsPositionSnapshotStatus.TemporarilyUnavailable;
|
|
2499
|
+
readonly Unavailable: PerpsPositionSnapshotStatus.Unavailable;
|
|
2500
|
+
}>;
|
|
2501
|
+
snapshot: z.ZodOptional<z.ZodNever>;
|
|
2502
|
+
}, z.core.$strip>], "status">, z.ZodTransform<{
|
|
2503
|
+
instrumentId: PerpsInstrumentId;
|
|
2504
|
+
tradeId?: string;
|
|
2505
|
+
status: PerpsPositionSnapshotStatus.Ok;
|
|
2506
|
+
snapshot: PerpsPositionSnapshot;
|
|
2507
|
+
} | {
|
|
2508
|
+
instrumentId: PerpsInstrumentId;
|
|
2509
|
+
tradeId?: string;
|
|
2510
|
+
status: Exclude<PerpsPositionSnapshotStatus, PerpsPositionSnapshotStatus.Ok>;
|
|
2511
|
+
}, {
|
|
2512
|
+
instrument_id: PerpsInstrumentId;
|
|
2513
|
+
status: PerpsPositionSnapshotStatus.Ok;
|
|
2514
|
+
snapshot: {
|
|
2515
|
+
positionCycleId: string;
|
|
2516
|
+
side: PerpsSide;
|
|
2517
|
+
startedAt: EpochMilliseconds;
|
|
2518
|
+
asOfAt: EpochMilliseconds;
|
|
2519
|
+
isClosed: boolean;
|
|
2520
|
+
sizeAfter: DecimalString;
|
|
2521
|
+
entryPrice: DecimalString;
|
|
2522
|
+
asOfPrice: DecimalString;
|
|
2523
|
+
pnl: DecimalString;
|
|
2524
|
+
pnlPercent: DecimalString | null;
|
|
2525
|
+
leverage: number | null;
|
|
2526
|
+
chart: {
|
|
2527
|
+
candles: {
|
|
2528
|
+
position: number;
|
|
2529
|
+
open: number;
|
|
2530
|
+
high: number;
|
|
2531
|
+
low: number;
|
|
2532
|
+
close: number;
|
|
2533
|
+
}[];
|
|
2534
|
+
markers: {
|
|
2535
|
+
position: number;
|
|
2536
|
+
kind: PerpsPositionSnapshotMarkerKind;
|
|
2537
|
+
}[];
|
|
2538
|
+
};
|
|
2539
|
+
};
|
|
2540
|
+
trade_id?: string | undefined;
|
|
2541
|
+
} | {
|
|
2542
|
+
instrument_id: PerpsInstrumentId;
|
|
2543
|
+
status: PerpsPositionSnapshotStatus.NotFound | PerpsPositionSnapshotStatus.HistoryPending | PerpsPositionSnapshotStatus.HistoryLimit | PerpsPositionSnapshotStatus.ResourceLimit | PerpsPositionSnapshotStatus.TemporarilyUnavailable | PerpsPositionSnapshotStatus.Unavailable;
|
|
2544
|
+
trade_id?: string | undefined;
|
|
2545
|
+
snapshot?: undefined;
|
|
2546
|
+
}>>, z.ZodTransform<{
|
|
2547
|
+
tradeId: string;
|
|
2548
|
+
instrumentId: PerpsInstrumentId;
|
|
2549
|
+
status: PerpsPositionSnapshotStatus.Ok;
|
|
2550
|
+
snapshot: PerpsPositionSnapshot;
|
|
2551
|
+
} | {
|
|
2552
|
+
tradeId: string;
|
|
2553
|
+
instrumentId: PerpsInstrumentId;
|
|
2554
|
+
status: Exclude<PerpsPositionSnapshotStatus, PerpsPositionSnapshotStatus.Ok>;
|
|
2555
|
+
}, {
|
|
2556
|
+
instrumentId: PerpsInstrumentId;
|
|
2557
|
+
tradeId?: string;
|
|
2558
|
+
status: PerpsPositionSnapshotStatus.Ok;
|
|
2559
|
+
snapshot: PerpsPositionSnapshot;
|
|
2560
|
+
} | {
|
|
2561
|
+
instrumentId: PerpsInstrumentId;
|
|
2562
|
+
tradeId?: string;
|
|
2563
|
+
status: Exclude<PerpsPositionSnapshotStatus, PerpsPositionSnapshotStatus.Ok>;
|
|
2564
|
+
}>>>;
|
|
2565
|
+
}, z.core.$strip>, z.ZodTransform<{
|
|
2566
|
+
historyAsOfAt: EpochMilliseconds;
|
|
2567
|
+
active: ({
|
|
2568
|
+
instrumentId: PerpsInstrumentId;
|
|
2569
|
+
tradeId?: string;
|
|
2570
|
+
status: PerpsPositionSnapshotStatus.Ok;
|
|
2571
|
+
snapshot: PerpsPositionSnapshot;
|
|
2572
|
+
} | {
|
|
2573
|
+
instrumentId: PerpsInstrumentId;
|
|
2574
|
+
tradeId?: string;
|
|
2575
|
+
status: Exclude<PerpsPositionSnapshotStatus, PerpsPositionSnapshotStatus.Ok>;
|
|
2576
|
+
})[];
|
|
2577
|
+
history: ({
|
|
2578
|
+
tradeId: string;
|
|
2579
|
+
instrumentId: PerpsInstrumentId;
|
|
2580
|
+
status: PerpsPositionSnapshotStatus.Ok;
|
|
2581
|
+
snapshot: PerpsPositionSnapshot;
|
|
2582
|
+
} | {
|
|
2583
|
+
tradeId: string;
|
|
2584
|
+
instrumentId: PerpsInstrumentId;
|
|
2585
|
+
status: Exclude<PerpsPositionSnapshotStatus, PerpsPositionSnapshotStatus.Ok>;
|
|
2586
|
+
})[];
|
|
2587
|
+
}, {
|
|
2588
|
+
history_as_of_at: EpochMilliseconds;
|
|
2589
|
+
active: ({
|
|
2590
|
+
instrumentId: PerpsInstrumentId;
|
|
2591
|
+
tradeId?: string;
|
|
2592
|
+
status: PerpsPositionSnapshotStatus.Ok;
|
|
2593
|
+
snapshot: PerpsPositionSnapshot;
|
|
2594
|
+
} | {
|
|
2595
|
+
instrumentId: PerpsInstrumentId;
|
|
2596
|
+
tradeId?: string;
|
|
2597
|
+
status: Exclude<PerpsPositionSnapshotStatus, PerpsPositionSnapshotStatus.Ok>;
|
|
2598
|
+
})[];
|
|
2599
|
+
history: ({
|
|
2600
|
+
tradeId: string;
|
|
2601
|
+
instrumentId: PerpsInstrumentId;
|
|
2602
|
+
status: PerpsPositionSnapshotStatus.Ok;
|
|
2603
|
+
snapshot: PerpsPositionSnapshot;
|
|
2604
|
+
} | {
|
|
2605
|
+
tradeId: string;
|
|
2606
|
+
instrumentId: PerpsInstrumentId;
|
|
2607
|
+
status: Exclude<PerpsPositionSnapshotStatus, PerpsPositionSnapshotStatus.Ok>;
|
|
2608
|
+
})[];
|
|
2609
|
+
}>>;
|
|
2610
|
+
/** Ordered selections and the completed-history horizon. No pagination.
|
|
2611
|
+
* @experimental This API may change in a breaking way in any release, including patch releases. */
|
|
2612
|
+
type PerpsPositionSnapshots = z.infer<typeof PerpsPositionSnapshotsSchema>;
|
|
2613
|
+
|
|
2614
|
+
/**
|
|
2615
|
+
* Parses whether an address has a Perps account.
|
|
2616
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
2617
|
+
*/
|
|
2618
|
+
declare const PerpsRegistrationResponseSchema: z.ZodPipe<z.ZodObject<{
|
|
2619
|
+
registered: z.ZodBoolean;
|
|
2620
|
+
}, z.core.$strip>, z.ZodTransform<boolean, {
|
|
2621
|
+
registered: boolean;
|
|
2622
|
+
}>>;
|
|
2623
|
+
|
|
2624
|
+
/** Opaque run identity.
|
|
2625
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
2626
|
+
*/
|
|
2627
|
+
type PerpsTwapId = number & {
|
|
2628
|
+
readonly __tag: 'PerpsTwapId';
|
|
2629
|
+
};
|
|
2630
|
+
/** @experimental This API may change in a breaking way in any release, including patch releases. */
|
|
2631
|
+
declare const PerpsTwapIdSchema: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsTwapId, number>>;
|
|
2632
|
+
/** Active runs only; ended runs are absent from the active collection.
|
|
2633
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
2634
|
+
*/
|
|
2635
|
+
declare enum PerpsTwapStatus {
|
|
2636
|
+
Running = "running",
|
|
2637
|
+
Paused = "paused"
|
|
2638
|
+
}
|
|
2639
|
+
/** @experimental This API may change in a breaking way in any release, including patch releases. */
|
|
2640
|
+
declare const PerpsTwapSchema: z.ZodPipe<z.ZodObject<{
|
|
2641
|
+
twid: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsTwapId, number>>;
|
|
2642
|
+
iid: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsInstrumentId, number>>;
|
|
2643
|
+
buy: z.ZodBoolean;
|
|
2644
|
+
qty: z.ZodPipe<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
|
|
2645
|
+
fill: z.ZodPipe<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
|
|
2646
|
+
dur: z.ZodNumber;
|
|
2647
|
+
ivl: z.ZodNumber;
|
|
2648
|
+
rnd: z.ZodBoolean;
|
|
2649
|
+
slip_bps: z.ZodNumber;
|
|
2650
|
+
min_px: z.ZodPipe<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
|
|
2651
|
+
max_px: z.ZodPipe<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
|
|
2652
|
+
ro: z.ZodBoolean;
|
|
2653
|
+
st: z.ZodEnum<typeof PerpsTwapStatus>;
|
|
2654
|
+
slices: z.ZodNumber;
|
|
2655
|
+
slice_count: z.ZodNumber;
|
|
2656
|
+
sts: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
|
|
2657
|
+
ets: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
|
|
2658
|
+
cts: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
|
|
2659
|
+
avg_px: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>>;
|
|
2660
|
+
coid: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<PerpsClientOrderId, string>>>;
|
|
2661
|
+
oid: z.ZodOptional<z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsOrderId, number>>>;
|
|
2662
|
+
}, z.core.$strip>, z.ZodTransform<{
|
|
2663
|
+
orderId?: PerpsOrderId | undefined;
|
|
2664
|
+
clientOrderId?: PerpsClientOrderId | undefined;
|
|
2665
|
+
averagePrice?: DecimalString | undefined;
|
|
2666
|
+
twapId: PerpsTwapId;
|
|
2667
|
+
instrumentId: PerpsInstrumentId;
|
|
2668
|
+
side: OrderSide;
|
|
2669
|
+
quantity: DecimalString;
|
|
2670
|
+
filledQuantity: DecimalString;
|
|
2671
|
+
durationMs: number;
|
|
2672
|
+
intervalMs: number;
|
|
2673
|
+
randomize: boolean;
|
|
2674
|
+
slippageBps: number;
|
|
2675
|
+
minPrice: DecimalString;
|
|
2676
|
+
maxPrice: DecimalString;
|
|
2677
|
+
reduceOnly: boolean;
|
|
2678
|
+
status: PerpsTwapStatus;
|
|
2679
|
+
slices: number;
|
|
2680
|
+
sliceCount: number;
|
|
2681
|
+
startedAt: EpochMilliseconds;
|
|
2682
|
+
endsAt: EpochMilliseconds;
|
|
2683
|
+
createdAt: EpochMilliseconds;
|
|
2684
|
+
}, {
|
|
2685
|
+
twid: PerpsTwapId;
|
|
2686
|
+
iid: PerpsInstrumentId;
|
|
2687
|
+
buy: boolean;
|
|
2688
|
+
qty: DecimalString;
|
|
2689
|
+
fill: DecimalString;
|
|
2690
|
+
dur: number;
|
|
2691
|
+
ivl: number;
|
|
2692
|
+
rnd: boolean;
|
|
2693
|
+
slip_bps: number;
|
|
2694
|
+
min_px: DecimalString;
|
|
2695
|
+
max_px: DecimalString;
|
|
2696
|
+
ro: boolean;
|
|
2697
|
+
st: PerpsTwapStatus;
|
|
2698
|
+
slices: number;
|
|
2699
|
+
slice_count: number;
|
|
2700
|
+
sts: EpochMilliseconds;
|
|
2701
|
+
ets: EpochMilliseconds;
|
|
2702
|
+
cts: EpochMilliseconds;
|
|
2703
|
+
avg_px?: DecimalString | undefined;
|
|
2704
|
+
coid?: PerpsClientOrderId | undefined;
|
|
2705
|
+
oid?: PerpsOrderId | undefined;
|
|
2706
|
+
}>>;
|
|
2707
|
+
/** @experimental This API may change in a breaking way in any release, including patch releases. */
|
|
2708
|
+
type PerpsTwap = z.infer<typeof PerpsTwapSchema>;
|
|
2709
|
+
/** @experimental This API may change in a breaking way in any release, including patch releases. */
|
|
2710
|
+
declare const PerpsTwapAcceptedSchema: z.ZodPipe<z.ZodObject<{
|
|
2711
|
+
status: z.ZodLiteral<"ok">;
|
|
2712
|
+
twid: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsTwapId, number>>;
|
|
2713
|
+
ts: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
|
|
2714
|
+
}, z.core.$strip>, z.ZodTransform<{
|
|
2715
|
+
twapId: PerpsTwapId;
|
|
2716
|
+
timestamp: EpochMilliseconds;
|
|
2717
|
+
}, {
|
|
2718
|
+
status: "ok";
|
|
2719
|
+
twid: PerpsTwapId;
|
|
2720
|
+
ts: EpochMilliseconds;
|
|
2721
|
+
}>>;
|
|
2722
|
+
/** Acceptance does not guarantee all scheduled quantity will fill.
|
|
2723
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
2724
|
+
*/
|
|
2725
|
+
type PerpsTwapAccepted = z.infer<typeof PerpsTwapAcceptedSchema>;
|
|
2726
|
+
/** @experimental This API may change in a breaking way in any release, including patch releases. */
|
|
2727
|
+
declare const FetchPerpsTwapsResponseSchema: z.ZodArray<z.ZodPipe<z.ZodObject<{
|
|
2728
|
+
twid: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsTwapId, number>>;
|
|
2729
|
+
iid: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsInstrumentId, number>>;
|
|
2730
|
+
buy: z.ZodBoolean;
|
|
2731
|
+
qty: z.ZodPipe<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
|
|
2732
|
+
fill: z.ZodPipe<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
|
|
2733
|
+
dur: z.ZodNumber;
|
|
2734
|
+
ivl: z.ZodNumber;
|
|
2735
|
+
rnd: z.ZodBoolean;
|
|
2736
|
+
slip_bps: z.ZodNumber;
|
|
2737
|
+
min_px: z.ZodPipe<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
|
|
2738
|
+
max_px: z.ZodPipe<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
|
|
2739
|
+
ro: z.ZodBoolean;
|
|
2740
|
+
st: z.ZodEnum<typeof PerpsTwapStatus>;
|
|
2741
|
+
slices: z.ZodNumber;
|
|
2742
|
+
slice_count: z.ZodNumber;
|
|
2743
|
+
sts: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
|
|
2744
|
+
ets: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
|
|
2745
|
+
cts: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
|
|
2746
|
+
avg_px: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>>;
|
|
2747
|
+
coid: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<PerpsClientOrderId, string>>>;
|
|
2748
|
+
oid: z.ZodOptional<z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsOrderId, number>>>;
|
|
2749
|
+
}, z.core.$strip>, z.ZodTransform<{
|
|
2750
|
+
orderId?: PerpsOrderId | undefined;
|
|
2751
|
+
clientOrderId?: PerpsClientOrderId | undefined;
|
|
2752
|
+
averagePrice?: DecimalString | undefined;
|
|
2753
|
+
twapId: PerpsTwapId;
|
|
2754
|
+
instrumentId: PerpsInstrumentId;
|
|
2755
|
+
side: OrderSide;
|
|
2756
|
+
quantity: DecimalString;
|
|
2757
|
+
filledQuantity: DecimalString;
|
|
2758
|
+
durationMs: number;
|
|
2759
|
+
intervalMs: number;
|
|
2760
|
+
randomize: boolean;
|
|
2761
|
+
slippageBps: number;
|
|
2762
|
+
minPrice: DecimalString;
|
|
2763
|
+
maxPrice: DecimalString;
|
|
2764
|
+
reduceOnly: boolean;
|
|
2765
|
+
status: PerpsTwapStatus;
|
|
2766
|
+
slices: number;
|
|
2767
|
+
sliceCount: number;
|
|
2768
|
+
startedAt: EpochMilliseconds;
|
|
2769
|
+
endsAt: EpochMilliseconds;
|
|
2770
|
+
createdAt: EpochMilliseconds;
|
|
2771
|
+
}, {
|
|
2772
|
+
twid: PerpsTwapId;
|
|
2773
|
+
iid: PerpsInstrumentId;
|
|
2774
|
+
buy: boolean;
|
|
2775
|
+
qty: DecimalString;
|
|
2776
|
+
fill: DecimalString;
|
|
2777
|
+
dur: number;
|
|
2778
|
+
ivl: number;
|
|
2779
|
+
rnd: boolean;
|
|
2780
|
+
slip_bps: number;
|
|
2781
|
+
min_px: DecimalString;
|
|
2782
|
+
max_px: DecimalString;
|
|
2783
|
+
ro: boolean;
|
|
2784
|
+
st: PerpsTwapStatus;
|
|
2785
|
+
slices: number;
|
|
2786
|
+
slice_count: number;
|
|
2787
|
+
sts: EpochMilliseconds;
|
|
2788
|
+
ets: EpochMilliseconds;
|
|
2789
|
+
cts: EpochMilliseconds;
|
|
2790
|
+
avg_px?: DecimalString | undefined;
|
|
2791
|
+
coid?: PerpsClientOrderId | undefined;
|
|
2792
|
+
oid?: PerpsOrderId | undefined;
|
|
2793
|
+
}>>>;
|
|
2794
|
+
/** @experimental This API may change in a breaking way in any release, including patch releases. */
|
|
2795
|
+
declare const CreatePerpsTwapResponseSchema: z.ZodUnion<readonly [z.ZodPipe<z.ZodObject<{
|
|
2796
|
+
status: z.ZodLiteral<"ok">;
|
|
2797
|
+
twid: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsTwapId, number>>;
|
|
2798
|
+
ts: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
|
|
2799
|
+
}, z.core.$strip>, z.ZodTransform<{
|
|
2800
|
+
twapId: PerpsTwapId;
|
|
2801
|
+
timestamp: EpochMilliseconds;
|
|
2802
|
+
}, {
|
|
2803
|
+
status: "ok";
|
|
2804
|
+
twid: PerpsTwapId;
|
|
2805
|
+
ts: EpochMilliseconds;
|
|
2806
|
+
}>>, z.ZodObject<{
|
|
2807
|
+
status: z.ZodLiteral<"err">;
|
|
2808
|
+
error: z.ZodString;
|
|
2809
|
+
}, z.core.$strip>]>;
|
|
2810
|
+
|
|
2811
|
+
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 };
|