@pear-protocol/types 0.0.18 → 0.0.19
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/trade/payloads.d.ts +88 -48
- package/dist/trigger/common/index.d.ts +40 -0
- package/dist/trigger/common/index.js +11 -0
- package/dist/trigger/entities/conditions.d.ts +215 -155
- package/dist/trigger/entities/conditions.js +81 -185
- package/dist/trigger/entities/index.d.ts +401 -352
- package/dist/trigger/entities/index.js +22 -8
- package/dist/trigger/index.d.ts +2 -0
- package/dist/trigger/index.js +2 -0
- package/dist/trigger/payloads/conditions.d.ts +117 -176
- package/dist/trigger/payloads/conditions.js +110 -57
- package/dist/trigger/payloads/index.d.ts +440 -164
- package/dist/trigger/payloads/index.js +32 -51
- package/dist/trigger/refinement/index.d.ts +2 -0
- package/dist/trigger/refinement/index.js +2 -0
- package/dist/trigger/refinement/static.refinement.d.ts +18 -0
- package/dist/trigger/refinement/static.refinement.js +40 -0
- package/dist/trigger/refinement/trailing.refinement.d.ts +27 -0
- package/dist/trigger/refinement/trailing.refinement.js +81 -0
- package/dist/trigger/responses.d.ts +262 -218
- package/package.json +4 -2
package/dist/trade/payloads.d.ts
CHANGED
|
@@ -24,59 +24,79 @@ export declare const CreateMarketOpen: z.ZodObject<{
|
|
|
24
24
|
}>;
|
|
25
25
|
amount: z.ZodString;
|
|
26
26
|
}, z.core.$strip>>;
|
|
27
|
-
trigger: z.ZodOptional<z.ZodObject<{
|
|
27
|
+
trigger: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
|
|
28
28
|
intent: z.ZodLiteral<"CLOSE">;
|
|
29
29
|
type: z.ZodLiteral<"MARKET">;
|
|
30
|
+
bracketType: z.ZodEnum<{
|
|
31
|
+
STOP_LOSS: "STOP_LOSS";
|
|
32
|
+
TAKE_PROFIT: "TAKE_PROFIT";
|
|
33
|
+
NONE: "NONE";
|
|
34
|
+
}>;
|
|
30
35
|
condition: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
31
|
-
type: z.ZodLiteral<"
|
|
36
|
+
type: z.ZodLiteral<"notional">;
|
|
32
37
|
data: z.ZodObject<{
|
|
33
38
|
priceSource: z.ZodEnum<{
|
|
34
39
|
mid: "mid";
|
|
35
40
|
mark: "mark";
|
|
36
41
|
}>;
|
|
37
|
-
direction: z.ZodEnum<{
|
|
38
|
-
ABOVE: "ABOVE";
|
|
39
|
-
BELOW: "BELOW";
|
|
40
|
-
}>;
|
|
41
42
|
threshold: z.ZodNumber;
|
|
42
43
|
}, z.core.$strip>;
|
|
43
44
|
}, z.core.$strip>, z.ZodObject<{
|
|
44
|
-
type: z.ZodLiteral<"
|
|
45
|
+
type: z.ZodLiteral<"upnl">;
|
|
45
46
|
data: z.ZodObject<{
|
|
46
47
|
priceSource: z.ZodEnum<{
|
|
47
48
|
mid: "mid";
|
|
48
49
|
mark: "mark";
|
|
49
50
|
}>;
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
51
|
+
threshold: z.ZodNumber;
|
|
52
|
+
}, z.core.$strip>;
|
|
53
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
54
|
+
type: z.ZodLiteral<"upnl_bps">;
|
|
55
|
+
data: z.ZodObject<{
|
|
56
|
+
priceSource: z.ZodEnum<{
|
|
57
|
+
mid: "mid";
|
|
58
|
+
mark: "mark";
|
|
53
59
|
}>;
|
|
54
60
|
threshold: z.ZodNumber;
|
|
55
61
|
}, z.core.$strip>;
|
|
62
|
+
}, z.core.$strip>], "type">;
|
|
63
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
64
|
+
intent: z.ZodLiteral<"CLOSE">;
|
|
65
|
+
type: z.ZodLiteral<"MARKET">;
|
|
66
|
+
condition: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
67
|
+
type: z.ZodLiteral<"notional_trailing">;
|
|
68
|
+
data: z.ZodObject<{
|
|
69
|
+
priceSource: z.ZodEnum<{
|
|
70
|
+
mid: "mid";
|
|
71
|
+
mark: "mark";
|
|
72
|
+
}>;
|
|
73
|
+
}, z.core.$strip>;
|
|
56
74
|
}, z.core.$strip>, z.ZodObject<{
|
|
57
|
-
type: z.ZodLiteral<"
|
|
75
|
+
type: z.ZodLiteral<"upnl_trailing">;
|
|
58
76
|
data: z.ZodObject<{
|
|
59
77
|
priceSource: z.ZodEnum<{
|
|
60
78
|
mid: "mid";
|
|
61
79
|
mark: "mark";
|
|
62
80
|
}>;
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
81
|
+
}, z.core.$strip>;
|
|
82
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
83
|
+
type: z.ZodLiteral<"upnl_bps_trailing">;
|
|
84
|
+
data: z.ZodObject<{
|
|
85
|
+
priceSource: z.ZodEnum<{
|
|
86
|
+
mid: "mid";
|
|
87
|
+
mark: "mark";
|
|
66
88
|
}>;
|
|
67
|
-
threshold_bps: z.ZodNumber;
|
|
68
89
|
}, z.core.$strip>;
|
|
69
90
|
}, z.core.$strip>], "type">;
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
trailing: z.ZodOptional<z.ZodObject<{
|
|
91
|
+
trailing: z.ZodObject<{
|
|
92
|
+
mode: z.ZodEnum<{
|
|
93
|
+
RELATIVE_BPS: "RELATIVE_BPS";
|
|
94
|
+
ABSOLUTE_POINTS: "ABSOLUTE_POINTS";
|
|
95
|
+
}>;
|
|
76
96
|
deltaValue: z.ZodNumber;
|
|
77
|
-
activationValue: z.ZodNumber
|
|
78
|
-
}, z.core.$strip
|
|
79
|
-
}, z.core.$strip>>;
|
|
97
|
+
activationValue: z.ZodOptional<z.ZodNumber>;
|
|
98
|
+
}, z.core.$strip>;
|
|
99
|
+
}, z.core.$strip>]>>;
|
|
80
100
|
}, z.core.$strip>;
|
|
81
101
|
export declare const CreateMarketAdjust: z.ZodObject<{
|
|
82
102
|
type: z.ZodLiteral<"MARKET">;
|
|
@@ -137,59 +157,79 @@ export declare const CreateTradeOpen: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
137
157
|
}>;
|
|
138
158
|
amount: z.ZodString;
|
|
139
159
|
}, z.core.$strip>>;
|
|
140
|
-
trigger: z.ZodOptional<z.ZodObject<{
|
|
160
|
+
trigger: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
|
|
141
161
|
intent: z.ZodLiteral<"CLOSE">;
|
|
142
162
|
type: z.ZodLiteral<"MARKET">;
|
|
163
|
+
bracketType: z.ZodEnum<{
|
|
164
|
+
STOP_LOSS: "STOP_LOSS";
|
|
165
|
+
TAKE_PROFIT: "TAKE_PROFIT";
|
|
166
|
+
NONE: "NONE";
|
|
167
|
+
}>;
|
|
143
168
|
condition: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
144
|
-
type: z.ZodLiteral<"
|
|
169
|
+
type: z.ZodLiteral<"notional">;
|
|
145
170
|
data: z.ZodObject<{
|
|
146
171
|
priceSource: z.ZodEnum<{
|
|
147
172
|
mid: "mid";
|
|
148
173
|
mark: "mark";
|
|
149
174
|
}>;
|
|
150
|
-
direction: z.ZodEnum<{
|
|
151
|
-
ABOVE: "ABOVE";
|
|
152
|
-
BELOW: "BELOW";
|
|
153
|
-
}>;
|
|
154
175
|
threshold: z.ZodNumber;
|
|
155
176
|
}, z.core.$strip>;
|
|
156
177
|
}, z.core.$strip>, z.ZodObject<{
|
|
157
|
-
type: z.ZodLiteral<"
|
|
178
|
+
type: z.ZodLiteral<"upnl">;
|
|
158
179
|
data: z.ZodObject<{
|
|
159
180
|
priceSource: z.ZodEnum<{
|
|
160
181
|
mid: "mid";
|
|
161
182
|
mark: "mark";
|
|
162
183
|
}>;
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
184
|
+
threshold: z.ZodNumber;
|
|
185
|
+
}, z.core.$strip>;
|
|
186
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
187
|
+
type: z.ZodLiteral<"upnl_bps">;
|
|
188
|
+
data: z.ZodObject<{
|
|
189
|
+
priceSource: z.ZodEnum<{
|
|
190
|
+
mid: "mid";
|
|
191
|
+
mark: "mark";
|
|
166
192
|
}>;
|
|
167
193
|
threshold: z.ZodNumber;
|
|
168
194
|
}, z.core.$strip>;
|
|
195
|
+
}, z.core.$strip>], "type">;
|
|
196
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
197
|
+
intent: z.ZodLiteral<"CLOSE">;
|
|
198
|
+
type: z.ZodLiteral<"MARKET">;
|
|
199
|
+
condition: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
200
|
+
type: z.ZodLiteral<"notional_trailing">;
|
|
201
|
+
data: z.ZodObject<{
|
|
202
|
+
priceSource: z.ZodEnum<{
|
|
203
|
+
mid: "mid";
|
|
204
|
+
mark: "mark";
|
|
205
|
+
}>;
|
|
206
|
+
}, z.core.$strip>;
|
|
169
207
|
}, z.core.$strip>, z.ZodObject<{
|
|
170
|
-
type: z.ZodLiteral<"
|
|
208
|
+
type: z.ZodLiteral<"upnl_trailing">;
|
|
171
209
|
data: z.ZodObject<{
|
|
172
210
|
priceSource: z.ZodEnum<{
|
|
173
211
|
mid: "mid";
|
|
174
212
|
mark: "mark";
|
|
175
213
|
}>;
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
214
|
+
}, z.core.$strip>;
|
|
215
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
216
|
+
type: z.ZodLiteral<"upnl_bps_trailing">;
|
|
217
|
+
data: z.ZodObject<{
|
|
218
|
+
priceSource: z.ZodEnum<{
|
|
219
|
+
mid: "mid";
|
|
220
|
+
mark: "mark";
|
|
179
221
|
}>;
|
|
180
|
-
threshold_bps: z.ZodNumber;
|
|
181
222
|
}, z.core.$strip>;
|
|
182
223
|
}, z.core.$strip>], "type">;
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
trailing: z.ZodOptional<z.ZodObject<{
|
|
224
|
+
trailing: z.ZodObject<{
|
|
225
|
+
mode: z.ZodEnum<{
|
|
226
|
+
RELATIVE_BPS: "RELATIVE_BPS";
|
|
227
|
+
ABSOLUTE_POINTS: "ABSOLUTE_POINTS";
|
|
228
|
+
}>;
|
|
189
229
|
deltaValue: z.ZodNumber;
|
|
190
|
-
activationValue: z.ZodNumber
|
|
191
|
-
}, z.core.$strip
|
|
192
|
-
}, z.core.$strip>>;
|
|
230
|
+
activationValue: z.ZodOptional<z.ZodNumber>;
|
|
231
|
+
}, z.core.$strip>;
|
|
232
|
+
}, z.core.$strip>]>>;
|
|
193
233
|
}, z.core.$strip>], "type">;
|
|
194
234
|
export declare const CreateTradeAdjust: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
195
235
|
type: z.ZodLiteral<"MARKET">;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const TriggerIntent: z.ZodEnum<{
|
|
3
|
+
OPEN: "OPEN";
|
|
4
|
+
CLOSE: "CLOSE";
|
|
5
|
+
}>;
|
|
6
|
+
export type TriggerIntent = z.infer<typeof TriggerIntent>;
|
|
7
|
+
export declare const TriggerStatus: z.ZodEnum<{
|
|
8
|
+
CANCELLED: "CANCELLED";
|
|
9
|
+
ACTIVE: "ACTIVE";
|
|
10
|
+
TRIGGERED: "TRIGGERED";
|
|
11
|
+
}>;
|
|
12
|
+
export type TriggerStatus = z.infer<typeof TriggerStatus>;
|
|
13
|
+
export declare const TriggerCancelledReason: z.ZodEnum<{
|
|
14
|
+
USER: "USER";
|
|
15
|
+
POSITION_CLOSED: "POSITION_CLOSED";
|
|
16
|
+
SYSTEM: "SYSTEM";
|
|
17
|
+
POSITION_NETTED: "POSITION_NETTED";
|
|
18
|
+
}>;
|
|
19
|
+
export type TriggerCancelledReason = z.infer<typeof TriggerCancelledReason>;
|
|
20
|
+
export declare const BracketType: z.ZodEnum<{
|
|
21
|
+
STOP_LOSS: "STOP_LOSS";
|
|
22
|
+
TAKE_PROFIT: "TAKE_PROFIT";
|
|
23
|
+
NONE: "NONE";
|
|
24
|
+
}>;
|
|
25
|
+
export type BracketType = z.infer<typeof BracketType>;
|
|
26
|
+
export declare const MetricTrack: z.ZodEnum<{
|
|
27
|
+
PEAK: "PEAK";
|
|
28
|
+
TROUGH: "TROUGH";
|
|
29
|
+
}>;
|
|
30
|
+
export type MetricTrack = z.infer<typeof MetricTrack>;
|
|
31
|
+
export declare const TpSlBracketType: z.ZodEnum<{
|
|
32
|
+
STOP_LOSS: "STOP_LOSS";
|
|
33
|
+
TAKE_PROFIT: "TAKE_PROFIT";
|
|
34
|
+
}>;
|
|
35
|
+
export type TpSlBracketType = z.infer<typeof TpSlBracketType>;
|
|
36
|
+
export declare const TrailingMode: z.ZodEnum<{
|
|
37
|
+
RELATIVE_BPS: "RELATIVE_BPS";
|
|
38
|
+
ABSOLUTE_POINTS: "ABSOLUTE_POINTS";
|
|
39
|
+
}>;
|
|
40
|
+
export type TrailingMode = z.infer<typeof TrailingMode>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
const TriggerIntent = z.enum(["OPEN", "CLOSE"]);
|
|
4
|
+
const TriggerStatus = z.enum(["ACTIVE", "TRIGGERED", "CANCELLED"]);
|
|
5
|
+
const TriggerCancelledReason = z.enum(["POSITION_CLOSED", "USER", "SYSTEM", "POSITION_NETTED"]);
|
|
6
|
+
const BracketType = z.enum(["STOP_LOSS", "TAKE_PROFIT", "NONE"]);
|
|
7
|
+
const MetricTrack = z.enum(["PEAK", "TROUGH"]);
|
|
8
|
+
const TpSlBracketType = z.enum(["TAKE_PROFIT", "STOP_LOSS"]);
|
|
9
|
+
const TrailingMode = z.enum(["RELATIVE_BPS", "ABSOLUTE_POINTS"]);
|
|
10
|
+
|
|
11
|
+
export { BracketType, MetricTrack, TpSlBracketType, TrailingMode, TriggerCancelledReason, TriggerIntent, TriggerStatus };
|