@pear-protocol/types 2.18.0 → 2.20.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/bundle.d.ts +1 -0
- package/dist/bundle.js +1 -0
- package/dist/common/refinement.d.ts +0 -1
- package/dist/common/refinement.js +1 -9
- package/dist/instrument/entities.d.ts +1 -0
- package/dist/instrument/responses.d.ts +1 -0
- package/dist/instrument-precision/index.d.ts +1 -0
- package/dist/instrument-precision/index.js +6 -1
- package/dist/realtime/channels.d.ts +19 -0
- package/dist/realtime/channels.js +16 -0
- package/dist/realtime/frames.d.ts +923 -0
- package/dist/realtime/frames.js +140 -0
- package/dist/realtime/index.d.ts +6 -0
- package/dist/realtime/index.js +6 -0
- package/dist/realtime/messages.d.ts +243 -0
- package/dist/realtime/messages.js +118 -0
- package/dist/realtime/public-events.d.ts +342 -0
- package/dist/realtime/public-events.js +92 -0
- package/dist/realtime/user-events.d.ts +32 -0
- package/dist/realtime/user-events.js +32 -0
- package/dist/realtime/vault-events.d.ts +71 -0
- package/dist/realtime/vault-events.js +42 -0
- package/dist/schedule/entities.d.ts +53 -163
- package/dist/schedule/entities.js +62 -3
- package/dist/schedule/queries.d.ts +7 -0
- package/dist/schedule/queries.js +15 -1
- package/dist/schedule/responses.d.ts +150 -115
- package/dist/schedule/responses.js +6 -2
- package/dist/sync/payloads.d.ts +0 -162
- package/dist/sync/payloads.js +1 -35
- package/dist/vaults/responses.d.ts +1 -9
- package/dist/vaults/responses.js +3 -10
- package/package.json +1 -1
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { CursorResponse } from '../common';
|
|
3
|
-
import { Schedule } from './entities';
|
|
3
|
+
import { Schedule, ScheduleSlice } from './entities';
|
|
4
4
|
|
|
5
5
|
const ScheduleListResponse = CursorResponse.extend({
|
|
6
6
|
schedules: z.array(Schedule)
|
|
7
7
|
});
|
|
8
|
+
const ScheduleDetailResponse = CursorResponse.extend({
|
|
9
|
+
schedule: Schedule,
|
|
10
|
+
slices: z.array(ScheduleSlice)
|
|
11
|
+
});
|
|
8
12
|
const CreateScheduleResponse = z.object({
|
|
9
13
|
schedule: Schedule
|
|
10
14
|
});
|
|
@@ -15,4 +19,4 @@ const CancelAllSchedulesResponse = z.object({
|
|
|
15
19
|
ids: z.array(z.uuid())
|
|
16
20
|
});
|
|
17
21
|
|
|
18
|
-
export { CancelAllSchedulesResponse, CancelScheduleResponse, CreateScheduleResponse, ScheduleListResponse };
|
|
22
|
+
export { CancelAllSchedulesResponse, CancelScheduleResponse, CreateScheduleResponse, ScheduleDetailResponse, ScheduleListResponse };
|
package/dist/sync/payloads.d.ts
CHANGED
|
@@ -25,177 +25,15 @@ export declare const UnknownExternalFill: z.ZodObject<{
|
|
|
25
25
|
mark: z.ZodString;
|
|
26
26
|
}, z.core.$strip>>;
|
|
27
27
|
}, z.core.$strip>;
|
|
28
|
-
export declare const ConfirmableExternalFill: z.ZodObject<{
|
|
29
|
-
type: z.ZodLiteral<"confirm">;
|
|
30
|
-
exchangeFillId: z.ZodString;
|
|
31
|
-
cloid: z.ZodString;
|
|
32
|
-
positionId: z.ZodUUID;
|
|
33
|
-
connector: z.ZodEnum<{
|
|
34
|
-
hyperliquid: "hyperliquid";
|
|
35
|
-
binance: "binance";
|
|
36
|
-
bybit: "bybit";
|
|
37
|
-
okx: "okx";
|
|
38
|
-
lighter: "lighter";
|
|
39
|
-
lighter_rhc: "lighter_rhc";
|
|
40
|
-
}>;
|
|
41
|
-
symbol: z.ZodString;
|
|
42
|
-
quantity: z.ZodString;
|
|
43
|
-
timestamp: z.ZodNumber;
|
|
44
|
-
tradeFee: z.ZodString;
|
|
45
|
-
builderFee: z.ZodString;
|
|
46
|
-
}, z.core.$strip>;
|
|
47
|
-
export declare const ReconcileReplacementExternalFill: z.ZodObject<{
|
|
48
|
-
exchangeFillId: z.ZodString;
|
|
49
|
-
cloid: z.ZodString;
|
|
50
|
-
connector: z.ZodEnum<{
|
|
51
|
-
hyperliquid: "hyperliquid";
|
|
52
|
-
binance: "binance";
|
|
53
|
-
bybit: "bybit";
|
|
54
|
-
okx: "okx";
|
|
55
|
-
lighter: "lighter";
|
|
56
|
-
lighter_rhc: "lighter_rhc";
|
|
57
|
-
}>;
|
|
58
|
-
symbol: z.ZodString;
|
|
59
|
-
price: z.ZodString;
|
|
60
|
-
quantity: z.ZodString;
|
|
61
|
-
side: z.ZodEnum<{
|
|
62
|
-
BUY: "BUY";
|
|
63
|
-
SELL: "SELL";
|
|
64
|
-
}>;
|
|
65
|
-
reduceOnly: z.ZodBoolean;
|
|
66
|
-
timestamp: z.ZodNumber;
|
|
67
|
-
tradeFee: z.ZodString;
|
|
68
|
-
builderFee: z.ZodString;
|
|
69
|
-
liquidation: z.ZodNullable<z.ZodObject<{
|
|
70
|
-
mark: z.ZodString;
|
|
71
|
-
}, z.core.$strip>>;
|
|
72
|
-
}, z.core.$strip>;
|
|
73
|
-
export declare const ConfirmFillsRequest: z.ZodRecord<z.ZodUUID, z.ZodTuple<[z.ZodObject<{
|
|
74
|
-
type: z.ZodLiteral<"confirm">;
|
|
75
|
-
exchangeFillId: z.ZodString;
|
|
76
|
-
cloid: z.ZodString;
|
|
77
|
-
positionId: z.ZodUUID;
|
|
78
|
-
connector: z.ZodEnum<{
|
|
79
|
-
hyperliquid: "hyperliquid";
|
|
80
|
-
binance: "binance";
|
|
81
|
-
bybit: "bybit";
|
|
82
|
-
okx: "okx";
|
|
83
|
-
lighter: "lighter";
|
|
84
|
-
lighter_rhc: "lighter_rhc";
|
|
85
|
-
}>;
|
|
86
|
-
symbol: z.ZodString;
|
|
87
|
-
quantity: z.ZodString;
|
|
88
|
-
timestamp: z.ZodNumber;
|
|
89
|
-
tradeFee: z.ZodString;
|
|
90
|
-
builderFee: z.ZodString;
|
|
91
|
-
}, z.core.$strip>], z.ZodObject<{
|
|
92
|
-
type: z.ZodLiteral<"confirm">;
|
|
93
|
-
exchangeFillId: z.ZodString;
|
|
94
|
-
cloid: z.ZodString;
|
|
95
|
-
positionId: z.ZodUUID;
|
|
96
|
-
connector: z.ZodEnum<{
|
|
97
|
-
hyperliquid: "hyperliquid";
|
|
98
|
-
binance: "binance";
|
|
99
|
-
bybit: "bybit";
|
|
100
|
-
okx: "okx";
|
|
101
|
-
lighter: "lighter";
|
|
102
|
-
lighter_rhc: "lighter_rhc";
|
|
103
|
-
}>;
|
|
104
|
-
symbol: z.ZodString;
|
|
105
|
-
quantity: z.ZodString;
|
|
106
|
-
timestamp: z.ZodNumber;
|
|
107
|
-
tradeFee: z.ZodString;
|
|
108
|
-
builderFee: z.ZodString;
|
|
109
|
-
}, z.core.$strip>>>;
|
|
110
|
-
export declare const ReconcileFillsRequest: z.ZodRecord<z.ZodString, z.ZodTuple<[z.ZodObject<{
|
|
111
|
-
exchangeFillId: z.ZodString;
|
|
112
|
-
cloid: z.ZodString;
|
|
113
|
-
connector: z.ZodEnum<{
|
|
114
|
-
hyperliquid: "hyperliquid";
|
|
115
|
-
binance: "binance";
|
|
116
|
-
bybit: "bybit";
|
|
117
|
-
okx: "okx";
|
|
118
|
-
lighter: "lighter";
|
|
119
|
-
lighter_rhc: "lighter_rhc";
|
|
120
|
-
}>;
|
|
121
|
-
symbol: z.ZodString;
|
|
122
|
-
price: z.ZodString;
|
|
123
|
-
quantity: z.ZodString;
|
|
124
|
-
side: z.ZodEnum<{
|
|
125
|
-
BUY: "BUY";
|
|
126
|
-
SELL: "SELL";
|
|
127
|
-
}>;
|
|
128
|
-
reduceOnly: z.ZodBoolean;
|
|
129
|
-
timestamp: z.ZodNumber;
|
|
130
|
-
tradeFee: z.ZodString;
|
|
131
|
-
builderFee: z.ZodString;
|
|
132
|
-
liquidation: z.ZodNullable<z.ZodObject<{
|
|
133
|
-
mark: z.ZodString;
|
|
134
|
-
}, z.core.$strip>>;
|
|
135
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
136
|
-
exchangeFillId: z.ZodString;
|
|
137
|
-
cloid: z.ZodString;
|
|
138
|
-
connector: z.ZodEnum<{
|
|
139
|
-
hyperliquid: "hyperliquid";
|
|
140
|
-
binance: "binance";
|
|
141
|
-
bybit: "bybit";
|
|
142
|
-
okx: "okx";
|
|
143
|
-
lighter: "lighter";
|
|
144
|
-
lighter_rhc: "lighter_rhc";
|
|
145
|
-
}>;
|
|
146
|
-
symbol: z.ZodString;
|
|
147
|
-
price: z.ZodString;
|
|
148
|
-
quantity: z.ZodString;
|
|
149
|
-
side: z.ZodEnum<{
|
|
150
|
-
BUY: "BUY";
|
|
151
|
-
SELL: "SELL";
|
|
152
|
-
}>;
|
|
153
|
-
reduceOnly: z.ZodBoolean;
|
|
154
|
-
timestamp: z.ZodNumber;
|
|
155
|
-
tradeFee: z.ZodString;
|
|
156
|
-
builderFee: z.ZodString;
|
|
157
|
-
liquidation: z.ZodNullable<z.ZodObject<{
|
|
158
|
-
mark: z.ZodString;
|
|
159
|
-
}, z.core.$strip>>;
|
|
160
|
-
}, z.core.$strip>], z.ZodObject<{
|
|
161
|
-
exchangeFillId: z.ZodString;
|
|
162
|
-
cloid: z.ZodString;
|
|
163
|
-
connector: z.ZodEnum<{
|
|
164
|
-
hyperliquid: "hyperliquid";
|
|
165
|
-
binance: "binance";
|
|
166
|
-
bybit: "bybit";
|
|
167
|
-
okx: "okx";
|
|
168
|
-
lighter: "lighter";
|
|
169
|
-
lighter_rhc: "lighter_rhc";
|
|
170
|
-
}>;
|
|
171
|
-
symbol: z.ZodString;
|
|
172
|
-
price: z.ZodString;
|
|
173
|
-
quantity: z.ZodString;
|
|
174
|
-
side: z.ZodEnum<{
|
|
175
|
-
BUY: "BUY";
|
|
176
|
-
SELL: "SELL";
|
|
177
|
-
}>;
|
|
178
|
-
reduceOnly: z.ZodBoolean;
|
|
179
|
-
timestamp: z.ZodNumber;
|
|
180
|
-
tradeFee: z.ZodString;
|
|
181
|
-
builderFee: z.ZodString;
|
|
182
|
-
liquidation: z.ZodNullable<z.ZodObject<{
|
|
183
|
-
mark: z.ZodString;
|
|
184
|
-
}, z.core.$strip>>;
|
|
185
|
-
}, z.core.$strip>>>;
|
|
186
28
|
export declare const SyncFillsSinceRequest: z.ZodObject<{
|
|
187
29
|
overlapMs: z.ZodNumber;
|
|
188
30
|
}, z.core.$strip>;
|
|
189
31
|
export declare const SyncFundingSinceRequest: z.ZodObject<{
|
|
190
32
|
overlapMs: z.ZodNumber;
|
|
191
33
|
}, z.core.$strip>;
|
|
192
|
-
export type ConfirmFillsRequest = z.output<typeof ConfirmFillsRequest>;
|
|
193
|
-
export type ReconcileFillsRequest = z.output<typeof ReconcileFillsRequest>;
|
|
194
34
|
export type SyncFillsSinceRequest = z.output<typeof SyncFillsSinceRequest>;
|
|
195
35
|
export type SyncFundingSinceRequest = z.output<typeof SyncFundingSinceRequest>;
|
|
196
36
|
export type UnknownExternalFill = z.output<typeof UnknownExternalFill>;
|
|
197
|
-
export type ReconcileReplacementExternalFill = z.output<typeof ReconcileReplacementExternalFill>;
|
|
198
|
-
export type ConfirmableExternalFill = z.output<typeof ConfirmableExternalFill>;
|
|
199
37
|
/**
|
|
200
38
|
* An exchange-reported open position snapshot. The exchange position API is the
|
|
201
39
|
* source of truth for current exposure; sizes are normalized to BASE units
|
package/dist/sync/payloads.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { RefineMinimumOneKeyValuePair } from '../common/refinement';
|
|
3
2
|
import { UnsignedDecimalString, DecimalString, Side, SignedDecimalString } from '../common/schema';
|
|
4
3
|
import { Connector } from '../connector';
|
|
5
4
|
import { InstrumentId } from '../instrument';
|
|
@@ -31,39 +30,6 @@ const UnknownExternalFill = z.object({
|
|
|
31
30
|
builderFee: UnsignedDecimalString,
|
|
32
31
|
liquidation: LiquidationMark
|
|
33
32
|
});
|
|
34
|
-
const ConfirmableExternalFill = z.object({
|
|
35
|
-
type: z.literal("confirm"),
|
|
36
|
-
exchangeFillId: ExchangeFillId,
|
|
37
|
-
cloid: z.string(),
|
|
38
|
-
positionId: z.uuid().describe("Position ID"),
|
|
39
|
-
connector: Connector,
|
|
40
|
-
symbol: InstrumentId,
|
|
41
|
-
quantity: UnsignedDecimalString,
|
|
42
|
-
timestamp: MsTimestamp,
|
|
43
|
-
tradeFee: TradeFee,
|
|
44
|
-
builderFee: UnsignedDecimalString
|
|
45
|
-
});
|
|
46
|
-
const ReconcileReplacementExternalFill = z.object({
|
|
47
|
-
exchangeFillId: ExchangeFillId,
|
|
48
|
-
cloid: z.string(),
|
|
49
|
-
connector: Connector,
|
|
50
|
-
symbol: InstrumentId,
|
|
51
|
-
price: UnsignedDecimalString,
|
|
52
|
-
quantity: UnsignedDecimalString,
|
|
53
|
-
side: Side,
|
|
54
|
-
reduceOnly: z.boolean(),
|
|
55
|
-
timestamp: MsTimestamp,
|
|
56
|
-
tradeFee: TradeFee,
|
|
57
|
-
builderFee: UnsignedDecimalString,
|
|
58
|
-
liquidation: LiquidationMark
|
|
59
|
-
});
|
|
60
|
-
const ConfirmFillsRequest = z.record(z.uuid().describe("Position ID"), z.tuple([
|
|
61
|
-
ConfirmableExternalFill
|
|
62
|
-
]).rest(ConfirmableExternalFill)).superRefine(RefineMinimumOneKeyValuePair);
|
|
63
|
-
const ReconcileFillsRequest = z.record(z.string().trim().min(1, "CLOID must be non-empty"), z.tuple([
|
|
64
|
-
ReconcileReplacementExternalFill,
|
|
65
|
-
ReconcileReplacementExternalFill
|
|
66
|
-
]).rest(ReconcileReplacementExternalFill)).superRefine(RefineMinimumOneKeyValuePair);
|
|
67
33
|
const SyncFillsSinceRequest = z.object({
|
|
68
34
|
overlapMs: z.number().int().positive()
|
|
69
35
|
});
|
|
@@ -167,4 +133,4 @@ function refineNewestFillTsPairsWithWatermark(meta, ctx) {
|
|
|
167
133
|
}
|
|
168
134
|
__name(refineNewestFillTsPairsWithWatermark, "refineNewestFillTsPairsWithWatermark");
|
|
169
135
|
|
|
170
|
-
export { ApplicableFill, ApplicableMetadata, ApplicablePosition,
|
|
136
|
+
export { ApplicableFill, ApplicableMetadata, ApplicablePosition, CreateApplicablesBulkFields, CreateApplicablesMeta, CreateApplicablesRequest, CreateFundingPaymentsRequest, ExternalPosition, FundingPaymentEntry, SyncFillsSinceRequest, SyncFundingSinceRequest, SyncMeta, UnknownExternalFill, WATERMARK_FUTURE_SKEW_MS };
|
|
@@ -251,6 +251,7 @@ export declare const VaultStatsResponse: z.ZodObject<{
|
|
|
251
251
|
depositAmount: z.ZodString;
|
|
252
252
|
shares: z.ZodString;
|
|
253
253
|
currentValue: z.ZodString;
|
|
254
|
+
unrealizedPnl: z.ZodNumber;
|
|
254
255
|
}, z.core.$strip>>;
|
|
255
256
|
}, z.core.$strip>;
|
|
256
257
|
export type VaultStatsResponse = z.infer<typeof VaultStatsResponse>;
|
|
@@ -354,15 +355,6 @@ export declare const ActivityItemResponse: z.ZodObject<{
|
|
|
354
355
|
}, z.core.$strip>;
|
|
355
356
|
}, z.core.$strip>;
|
|
356
357
|
export type ActivityItemResponse = z.output<typeof ActivityItemResponse>;
|
|
357
|
-
export declare const AgentBalancesResponse: z.ZodObject<{
|
|
358
|
-
agentAddress: z.ZodString;
|
|
359
|
-
spot: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
360
|
-
perp: z.ZodObject<{
|
|
361
|
-
accountValue: z.ZodString;
|
|
362
|
-
withdrawable: z.ZodString;
|
|
363
|
-
}, z.core.$strip>;
|
|
364
|
-
}, z.core.$strip>;
|
|
365
|
-
export type AgentBalancesResponse = z.infer<typeof AgentBalancesResponse>;
|
|
366
358
|
/** Bare agent-approve outcome: the service returns exactly this union. */
|
|
367
359
|
export declare const AgentApproveResult: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
368
360
|
success: z.ZodLiteral<true>;
|
package/dist/vaults/responses.js
CHANGED
|
@@ -71,7 +71,8 @@ const InvestorEntry = z.object({
|
|
|
71
71
|
address: z.string(),
|
|
72
72
|
depositAmount: z.string(),
|
|
73
73
|
shares: z.string(),
|
|
74
|
-
currentValue: z.string()
|
|
74
|
+
currentValue: z.string(),
|
|
75
|
+
unrealizedPnl: z.number()
|
|
75
76
|
});
|
|
76
77
|
const VaultStatsResponse = z.object({
|
|
77
78
|
tvl: z.string(),
|
|
@@ -158,14 +159,6 @@ const ActivityResponse = z.object({
|
|
|
158
159
|
const ActivityItemResponse = z.object({
|
|
159
160
|
activity: Activity
|
|
160
161
|
});
|
|
161
|
-
const AgentBalancesResponse = z.object({
|
|
162
|
-
agentAddress: z.string(),
|
|
163
|
-
spot: z.record(z.string(), z.string()),
|
|
164
|
-
perp: z.object({
|
|
165
|
-
accountValue: z.string(),
|
|
166
|
-
withdrawable: z.string()
|
|
167
|
-
})
|
|
168
|
-
});
|
|
169
162
|
const AgentApproveSent = z.object({
|
|
170
163
|
success: z.literal(true),
|
|
171
164
|
transactionHash: z.string(),
|
|
@@ -372,4 +365,4 @@ const VaultServiceError = z.discriminatedUnion("error", [
|
|
|
372
365
|
})
|
|
373
366
|
]);
|
|
374
367
|
|
|
375
|
-
export { ActivityItemResponse, ActivityResponse, AgentApproveResponse, AgentApproveResult,
|
|
368
|
+
export { ActivityItemResponse, ActivityResponse, AgentApproveResponse, AgentApproveResult, BulkSnapshotsResponse, CreatedVaultResponse, CreatedVaultResult, NavRangeResponse, NavSnapshotResponse, NavStatsResponse, SetTraderResponse, SetTraderResult, UnifiedAccountResponse, UpdateVaultMetadataResponse, UpdateVaultMetadataResult, VaultEventListResponse, VaultInvestmentsResponse, VaultListResponse, VaultOverviewResponse, VaultRequestIssue, VaultResponse, VaultServiceError, VaultStatsResponse, WithdrawToEvmResponse, WithdrawToEvmResult };
|