@pear-protocol/types 2.12.1 → 2.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/auth/payloads.js +2 -2
- package/dist/auth/response.js +2 -2
- package/dist/copy/entities.d.ts +108 -0
- package/dist/copy/entities.js +23 -2
- package/dist/copy/queries.d.ts +8 -0
- package/dist/copy/queries.js +5 -1
- package/dist/copy/responses.d.ts +35 -5
- package/dist/copy/responses.js +3 -5
- package/dist/position/entities.d.ts +5 -4
- package/dist/position/entities.js +4 -0
- package/dist/position/responses.d.ts +2 -0
- package/dist/statistics/entities.d.ts +1 -0
- package/dist/statistics/entities.js +4 -0
- package/dist/statistics/responses.d.ts +1 -0
- package/dist/traders/public.d.ts +5 -1
- package/dist/traders/public.js +6 -1
- package/dist/users/entities.js +1 -1
- package/package.json +1 -1
package/dist/auth/payloads.js
CHANGED
|
@@ -25,8 +25,8 @@ const StartXLinkRequest = z.object({
|
|
|
25
25
|
returnTo: z.string().optional().describe("Page to send the browser back to once the link finishes, normally the page the user is on. Must be on the calling origin; defaults to that origin.")
|
|
26
26
|
}).describe("Start of the X account link flow");
|
|
27
27
|
const SetXVisibilityRequest = z.object({
|
|
28
|
-
xHidden: z.boolean().describe("True to withhold the linked X account from the leaderboard, false to publish it. The wanted state rather than a flip, so a retry lands on the same result and two tabs cannot disagree. Named to match `xHidden` on the user profile - one name for one value.")
|
|
29
|
-
}).describe("
|
|
28
|
+
xHidden: z.boolean().describe("True to withhold the linked X account from the leaderboard and public trader profiles, false to publish it. The wanted state rather than a flip, so a retry lands on the same result and two tabs cannot disagree. Named to match `xHidden` on the user profile - one name for one value.")
|
|
29
|
+
}).describe("Visibility of the X account on the leaderboard and public trader profiles");
|
|
30
30
|
const PkceValue = z.string().regex(/^[A-Za-z0-9_-]{43}$/, "Must be 43 base64url characters");
|
|
31
31
|
const StartXLoginRequest = z.object({
|
|
32
32
|
returnTo: z.string().optional().describe("Page to send the browser back to once the sign-in finishes, normally the page the user is on. Must be on the calling origin; defaults to that origin. Any fragment is dropped - the flow returns its ticket there."),
|
package/dist/auth/response.js
CHANGED
|
@@ -38,8 +38,8 @@ const StartXLinkResponse = z.object({
|
|
|
38
38
|
authorizeUrl: z.string().describe("X authorization URL to send the browser to. Expires with the flow's state.")
|
|
39
39
|
}).describe("Start of the X account link flow");
|
|
40
40
|
const SetXVisibilityResponse = z.object({
|
|
41
|
-
xHidden: z.boolean().describe("The stored state, read back from the write: true when the leaderboard
|
|
42
|
-
}).describe("
|
|
41
|
+
xHidden: z.boolean().describe("The stored state, read back from the write: true when the leaderboard and public trader profiles withhold the X account. A confirmation of what was asked for, not a value the caller could not otherwise know.")
|
|
42
|
+
}).describe("Visibility of the X account on the leaderboard and public trader profiles after the write");
|
|
43
43
|
const DisconnectXResponse = z.void().describe("Successful X account disconnect response");
|
|
44
44
|
const StartXLoginResponse = z.object({
|
|
45
45
|
authorizeUrl: z.string().describe("X authorization URL to send the browser to. Expires with the flow's state.")
|
package/dist/copy/entities.d.ts
CHANGED
|
@@ -37,6 +37,114 @@ export declare const CopySubscription: z.ZodObject<{
|
|
|
37
37
|
endedAt: z.ZodOptional<z.ZodString>;
|
|
38
38
|
}, z.core.$strip>;
|
|
39
39
|
export type CopySubscription = z.infer<typeof CopySubscription>;
|
|
40
|
+
/** Active position-lifetime USD totals; mark, basis, or exposure gaps can leave measured PnL partial. */
|
|
41
|
+
export declare const CopySubscriptionMetrics: z.ZodObject<{
|
|
42
|
+
volume: z.ZodString;
|
|
43
|
+
grossRealizedPnl: z.ZodPipe<z.ZodString, z.ZodTransform<`-${string}` | `+${string}`, string>>;
|
|
44
|
+
grossUpnl: z.ZodPipe<z.ZodString, z.ZodTransform<`-${string}` | `+${string}`, string>>;
|
|
45
|
+
fundingPayment: z.ZodPipe<z.ZodString, z.ZodTransform<`-${string}` | `+${string}`, string>>;
|
|
46
|
+
tradeFee: z.ZodPipe<z.ZodString, z.ZodTransform<`-${string}` | `+${string}`, string>>;
|
|
47
|
+
pearFee: z.ZodPipe<z.ZodString, z.ZodTransform<`-${string}` | `+${string}`, string>>;
|
|
48
|
+
totalNetPnl: z.ZodPipe<z.ZodString, z.ZodTransform<`-${string}` | `+${string}`, string>>;
|
|
49
|
+
}, z.core.$strip>;
|
|
50
|
+
export type CopySubscriptionMetrics = z.output<typeof CopySubscriptionMetrics>;
|
|
51
|
+
/** Current subscription with volume, gross PnL, attributed funding, signed fees, and net PnL. */
|
|
52
|
+
export declare const CopySubscriptionWithMetrics: z.ZodObject<{
|
|
53
|
+
id: z.ZodUUID;
|
|
54
|
+
leaderTradeAccountId: z.ZodUUID;
|
|
55
|
+
followerTradeAccountId: z.ZodUUID;
|
|
56
|
+
connector: z.ZodEnum<{
|
|
57
|
+
hyperliquid: "hyperliquid";
|
|
58
|
+
binance: "binance";
|
|
59
|
+
bybit: "bybit";
|
|
60
|
+
okx: "okx";
|
|
61
|
+
lighter: "lighter";
|
|
62
|
+
lighter_rhc: "lighter_rhc";
|
|
63
|
+
}>;
|
|
64
|
+
sizing: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
65
|
+
mode: z.ZodLiteral<"LEADER_EQUITY_FRACTION">;
|
|
66
|
+
}, z.core.$strip>], "mode">;
|
|
67
|
+
createdAt: z.ZodString;
|
|
68
|
+
endedAt: z.ZodOptional<z.ZodString>;
|
|
69
|
+
status: z.ZodLiteral<"ACTIVE">;
|
|
70
|
+
volume: z.ZodString;
|
|
71
|
+
grossRealizedPnl: z.ZodPipe<z.ZodString, z.ZodTransform<`-${string}` | `+${string}`, string>>;
|
|
72
|
+
grossUpnl: z.ZodPipe<z.ZodString, z.ZodTransform<`-${string}` | `+${string}`, string>>;
|
|
73
|
+
fundingPayment: z.ZodPipe<z.ZodString, z.ZodTransform<`-${string}` | `+${string}`, string>>;
|
|
74
|
+
tradeFee: z.ZodPipe<z.ZodString, z.ZodTransform<`-${string}` | `+${string}`, string>>;
|
|
75
|
+
pearFee: z.ZodPipe<z.ZodString, z.ZodTransform<`-${string}` | `+${string}`, string>>;
|
|
76
|
+
totalNetPnl: z.ZodPipe<z.ZodString, z.ZodTransform<`-${string}` | `+${string}`, string>>;
|
|
77
|
+
}, z.core.$strip>;
|
|
78
|
+
export type CopySubscriptionWithMetrics = z.output<typeof CopySubscriptionWithMetrics>;
|
|
79
|
+
/** Ended subscription with lifetime turnover only. */
|
|
80
|
+
export declare const CopyEndedSubscriptionWithVolume: z.ZodObject<{
|
|
81
|
+
id: z.ZodUUID;
|
|
82
|
+
leaderTradeAccountId: z.ZodUUID;
|
|
83
|
+
followerTradeAccountId: z.ZodUUID;
|
|
84
|
+
connector: z.ZodEnum<{
|
|
85
|
+
hyperliquid: "hyperliquid";
|
|
86
|
+
binance: "binance";
|
|
87
|
+
bybit: "bybit";
|
|
88
|
+
okx: "okx";
|
|
89
|
+
lighter: "lighter";
|
|
90
|
+
lighter_rhc: "lighter_rhc";
|
|
91
|
+
}>;
|
|
92
|
+
sizing: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
93
|
+
mode: z.ZodLiteral<"LEADER_EQUITY_FRACTION">;
|
|
94
|
+
}, z.core.$strip>], "mode">;
|
|
95
|
+
createdAt: z.ZodString;
|
|
96
|
+
endedAt: z.ZodOptional<z.ZodString>;
|
|
97
|
+
status: z.ZodLiteral<"ENDED">;
|
|
98
|
+
volume: z.ZodString;
|
|
99
|
+
}, z.core.$strip>;
|
|
100
|
+
export type CopyEndedSubscriptionWithVolume = z.output<typeof CopyEndedSubscriptionWithVolume>;
|
|
101
|
+
/** Read shape selected by subscription status. */
|
|
102
|
+
export declare const CopySubscriptionRead: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
103
|
+
id: z.ZodUUID;
|
|
104
|
+
leaderTradeAccountId: z.ZodUUID;
|
|
105
|
+
followerTradeAccountId: z.ZodUUID;
|
|
106
|
+
connector: z.ZodEnum<{
|
|
107
|
+
hyperliquid: "hyperliquid";
|
|
108
|
+
binance: "binance";
|
|
109
|
+
bybit: "bybit";
|
|
110
|
+
okx: "okx";
|
|
111
|
+
lighter: "lighter";
|
|
112
|
+
lighter_rhc: "lighter_rhc";
|
|
113
|
+
}>;
|
|
114
|
+
sizing: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
115
|
+
mode: z.ZodLiteral<"LEADER_EQUITY_FRACTION">;
|
|
116
|
+
}, z.core.$strip>], "mode">;
|
|
117
|
+
createdAt: z.ZodString;
|
|
118
|
+
endedAt: z.ZodOptional<z.ZodString>;
|
|
119
|
+
status: z.ZodLiteral<"ACTIVE">;
|
|
120
|
+
volume: z.ZodString;
|
|
121
|
+
grossRealizedPnl: z.ZodPipe<z.ZodString, z.ZodTransform<`-${string}` | `+${string}`, string>>;
|
|
122
|
+
grossUpnl: z.ZodPipe<z.ZodString, z.ZodTransform<`-${string}` | `+${string}`, string>>;
|
|
123
|
+
fundingPayment: z.ZodPipe<z.ZodString, z.ZodTransform<`-${string}` | `+${string}`, string>>;
|
|
124
|
+
tradeFee: z.ZodPipe<z.ZodString, z.ZodTransform<`-${string}` | `+${string}`, string>>;
|
|
125
|
+
pearFee: z.ZodPipe<z.ZodString, z.ZodTransform<`-${string}` | `+${string}`, string>>;
|
|
126
|
+
totalNetPnl: z.ZodPipe<z.ZodString, z.ZodTransform<`-${string}` | `+${string}`, string>>;
|
|
127
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
128
|
+
id: z.ZodUUID;
|
|
129
|
+
leaderTradeAccountId: z.ZodUUID;
|
|
130
|
+
followerTradeAccountId: z.ZodUUID;
|
|
131
|
+
connector: z.ZodEnum<{
|
|
132
|
+
hyperliquid: "hyperliquid";
|
|
133
|
+
binance: "binance";
|
|
134
|
+
bybit: "bybit";
|
|
135
|
+
okx: "okx";
|
|
136
|
+
lighter: "lighter";
|
|
137
|
+
lighter_rhc: "lighter_rhc";
|
|
138
|
+
}>;
|
|
139
|
+
sizing: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
140
|
+
mode: z.ZodLiteral<"LEADER_EQUITY_FRACTION">;
|
|
141
|
+
}, z.core.$strip>], "mode">;
|
|
142
|
+
createdAt: z.ZodString;
|
|
143
|
+
endedAt: z.ZodOptional<z.ZodString>;
|
|
144
|
+
status: z.ZodLiteral<"ENDED">;
|
|
145
|
+
volume: z.ZodString;
|
|
146
|
+
}, z.core.$strip>], "status">;
|
|
147
|
+
export type CopySubscriptionRead = z.output<typeof CopySubscriptionRead>;
|
|
40
148
|
export declare const CopyActivityOutcome: z.ZodEnum<{
|
|
41
149
|
COPIED: "COPIED";
|
|
42
150
|
PARTIAL: "PARTIAL";
|
package/dist/copy/entities.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { SignedDecimalString } from '../common/schema';
|
|
2
|
+
import { SignedDecimalString, UnsignedDecimalString } from '../common/schema';
|
|
3
3
|
import { Connector } from '../connector';
|
|
4
4
|
import { InstrumentId } from '../instrument';
|
|
5
5
|
|
|
@@ -26,6 +26,27 @@ const CopySubscription = z.object({
|
|
|
26
26
|
createdAt: z.string().describe("ISO 8601"),
|
|
27
27
|
endedAt: z.string().optional().describe("ISO 8601; set once the follower unsubscribed")
|
|
28
28
|
});
|
|
29
|
+
const CopySubscriptionMetrics = z.object({
|
|
30
|
+
volume: UnsignedDecimalString.describe("Lifetime executed USD turnover across opens and closes; excludes fees and funding"),
|
|
31
|
+
grossRealizedPnl: SignedDecimalString.describe("Gross realized USD PnL over attributed positions, including partial reductions; excludes fees and funding"),
|
|
32
|
+
grossUpnl: SignedDecimalString.describe("Gross unrealized USD PnL on OPEN attributed positions at current marks; missing marks or entry basis can make this total partial; excludes fees and funding"),
|
|
33
|
+
fundingPayment: SignedDecimalString.describe("Signed USD funding attributed from historical exposure snapshots and per-unit payments; absent snapshots contribute no measured funding"),
|
|
34
|
+
tradeFee: SignedDecimalString.describe("Signed USD trade fees on attributed position fills; negative values are rebates"),
|
|
35
|
+
pearFee: SignedDecimalString.describe("Signed USD Pear fees on attributed position fills; negative values are rebates"),
|
|
36
|
+
totalNetPnl: SignedDecimalString.describe("Gross realized plus gross unrealized plus fundingPayment minus tradeFee and pearFee in USD; mark, basis, or exposure gaps can make the measured total partial")
|
|
37
|
+
});
|
|
38
|
+
const CopySubscriptionWithMetrics = CopySubscription.extend({
|
|
39
|
+
...CopySubscriptionMetrics.shape,
|
|
40
|
+
status: z.literal("ACTIVE")
|
|
41
|
+
});
|
|
42
|
+
const CopyEndedSubscriptionWithVolume = CopySubscription.extend({
|
|
43
|
+
status: z.literal("ENDED"),
|
|
44
|
+
volume: CopySubscriptionMetrics.shape.volume
|
|
45
|
+
});
|
|
46
|
+
const CopySubscriptionRead = z.discriminatedUnion("status", [
|
|
47
|
+
CopySubscriptionWithMetrics,
|
|
48
|
+
CopyEndedSubscriptionWithVolume
|
|
49
|
+
]);
|
|
29
50
|
const CopyActivityOutcome = z.enum([
|
|
30
51
|
"COPIED",
|
|
31
52
|
"PARTIAL",
|
|
@@ -110,4 +131,4 @@ const CopyFollower = z.object({
|
|
|
110
131
|
xAvatarUrl: z.string().optional()
|
|
111
132
|
});
|
|
112
133
|
|
|
113
|
-
export { CopyActivity, CopyActivityLeg, CopyActivityOutcome, CopyActivityState, CopyExecutionSource, CopyFollower, CopyLeaderAction, CopySizing, CopySkipReason, CopySubscription, CopySubscriptionStatus };
|
|
134
|
+
export { CopyActivity, CopyActivityLeg, CopyActivityOutcome, CopyActivityState, CopyEndedSubscriptionWithVolume, CopyExecutionSource, CopyFollower, CopyLeaderAction, CopySizing, CopySkipReason, CopySubscription, CopySubscriptionMetrics, CopySubscriptionRead, CopySubscriptionStatus, CopySubscriptionWithMetrics };
|
package/dist/copy/queries.d.ts
CHANGED
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
export declare const CopySubscriptionListQuery: z.ZodObject<{
|
|
3
|
+
status: z.ZodOptional<z.ZodEnum<{
|
|
4
|
+
ACTIVE: "ACTIVE";
|
|
5
|
+
ENDED: "ENDED";
|
|
6
|
+
}>>;
|
|
7
|
+
}, z.core.$strip>;
|
|
8
|
+
export type CopySubscriptionListQueryInput = z.input<typeof CopySubscriptionListQuery>;
|
|
9
|
+
export type CopySubscriptionListQuery = z.output<typeof CopySubscriptionListQuery>;
|
|
2
10
|
export declare const CopyActivityListParams: z.ZodObject<{
|
|
3
11
|
limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
4
12
|
}, z.core.$strip>;
|
package/dist/copy/queries.js
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import { CopySubscriptionStatus } from './entities';
|
|
2
3
|
|
|
4
|
+
const CopySubscriptionListQuery = z.object({
|
|
5
|
+
status: CopySubscriptionStatus.optional()
|
|
6
|
+
});
|
|
3
7
|
const CopyActivityListParams = z.object({
|
|
4
8
|
limit: z.coerce.number().int().min(1).max(200).default(50)
|
|
5
9
|
});
|
|
@@ -13,4 +17,4 @@ const CopyStatsParams = z.object({
|
|
|
13
17
|
]
|
|
14
18
|
});
|
|
15
19
|
|
|
16
|
-
export { CopyActivityListParams, CopyStatsParams };
|
|
20
|
+
export { CopyActivityListParams, CopyStatsParams, CopySubscriptionListQuery };
|
package/dist/copy/responses.d.ts
CHANGED
|
@@ -22,6 +22,13 @@ export declare const CopyStateResponse: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
22
22
|
createdAt: z.ZodString;
|
|
23
23
|
endedAt: z.ZodOptional<z.ZodString>;
|
|
24
24
|
status: z.ZodLiteral<"ACTIVE">;
|
|
25
|
+
volume: z.ZodString;
|
|
26
|
+
grossRealizedPnl: z.ZodPipe<z.ZodString, z.ZodTransform<`-${string}` | `+${string}`, string>>;
|
|
27
|
+
grossUpnl: z.ZodPipe<z.ZodString, z.ZodTransform<`-${string}` | `+${string}`, string>>;
|
|
28
|
+
fundingPayment: z.ZodPipe<z.ZodString, z.ZodTransform<`-${string}` | `+${string}`, string>>;
|
|
29
|
+
tradeFee: z.ZodPipe<z.ZodString, z.ZodTransform<`-${string}` | `+${string}`, string>>;
|
|
30
|
+
pearFee: z.ZodPipe<z.ZodString, z.ZodTransform<`-${string}` | `+${string}`, string>>;
|
|
31
|
+
totalNetPnl: z.ZodPipe<z.ZodString, z.ZodTransform<`-${string}` | `+${string}`, string>>;
|
|
25
32
|
}, z.core.$strip>;
|
|
26
33
|
}, z.core.$strip>], "state">;
|
|
27
34
|
export type CopyStateResponse = z.output<typeof CopyStateResponse>;
|
|
@@ -190,7 +197,7 @@ export declare const CreateCopySubscriptionResponse: z.ZodObject<{
|
|
|
190
197
|
}, z.core.$strip>;
|
|
191
198
|
export type CreateCopySubscriptionResponse = z.output<typeof CreateCopySubscriptionResponse>;
|
|
192
199
|
export declare const CopySubscriptionListResponse: z.ZodObject<{
|
|
193
|
-
subscriptions: z.ZodArray<z.ZodObject<{
|
|
200
|
+
subscriptions: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
194
201
|
id: z.ZodUUID;
|
|
195
202
|
leaderTradeAccountId: z.ZodUUID;
|
|
196
203
|
followerTradeAccountId: z.ZodUUID;
|
|
@@ -202,16 +209,39 @@ export declare const CopySubscriptionListResponse: z.ZodObject<{
|
|
|
202
209
|
lighter: "lighter";
|
|
203
210
|
lighter_rhc: "lighter_rhc";
|
|
204
211
|
}>;
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
212
|
+
sizing: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
213
|
+
mode: z.ZodLiteral<"LEADER_EQUITY_FRACTION">;
|
|
214
|
+
}, z.core.$strip>], "mode">;
|
|
215
|
+
createdAt: z.ZodString;
|
|
216
|
+
endedAt: z.ZodOptional<z.ZodString>;
|
|
217
|
+
status: z.ZodLiteral<"ACTIVE">;
|
|
218
|
+
volume: z.ZodString;
|
|
219
|
+
grossRealizedPnl: z.ZodPipe<z.ZodString, z.ZodTransform<`-${string}` | `+${string}`, string>>;
|
|
220
|
+
grossUpnl: z.ZodPipe<z.ZodString, z.ZodTransform<`-${string}` | `+${string}`, string>>;
|
|
221
|
+
fundingPayment: z.ZodPipe<z.ZodString, z.ZodTransform<`-${string}` | `+${string}`, string>>;
|
|
222
|
+
tradeFee: z.ZodPipe<z.ZodString, z.ZodTransform<`-${string}` | `+${string}`, string>>;
|
|
223
|
+
pearFee: z.ZodPipe<z.ZodString, z.ZodTransform<`-${string}` | `+${string}`, string>>;
|
|
224
|
+
totalNetPnl: z.ZodPipe<z.ZodString, z.ZodTransform<`-${string}` | `+${string}`, string>>;
|
|
225
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
226
|
+
id: z.ZodUUID;
|
|
227
|
+
leaderTradeAccountId: z.ZodUUID;
|
|
228
|
+
followerTradeAccountId: z.ZodUUID;
|
|
229
|
+
connector: z.ZodEnum<{
|
|
230
|
+
hyperliquid: "hyperliquid";
|
|
231
|
+
binance: "binance";
|
|
232
|
+
bybit: "bybit";
|
|
233
|
+
okx: "okx";
|
|
234
|
+
lighter: "lighter";
|
|
235
|
+
lighter_rhc: "lighter_rhc";
|
|
208
236
|
}>;
|
|
209
237
|
sizing: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
210
238
|
mode: z.ZodLiteral<"LEADER_EQUITY_FRACTION">;
|
|
211
239
|
}, z.core.$strip>], "mode">;
|
|
212
240
|
createdAt: z.ZodString;
|
|
213
241
|
endedAt: z.ZodOptional<z.ZodString>;
|
|
214
|
-
|
|
242
|
+
status: z.ZodLiteral<"ENDED">;
|
|
243
|
+
volume: z.ZodString;
|
|
244
|
+
}, z.core.$strip>], "status">>;
|
|
215
245
|
}, z.core.$strip>;
|
|
216
246
|
export type CopySubscriptionListResponse = z.output<typeof CopySubscriptionListResponse>;
|
|
217
247
|
export declare const CopyActivityListResponse: z.ZodObject<{
|
package/dist/copy/responses.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { UnsignedDecimalString } from '../common/schema';
|
|
3
|
-
import {
|
|
3
|
+
import { CopySubscriptionWithMetrics, CopyFollower, CopySubscription, CopySkipReason, CopySubscriptionRead, CopyActivity, CopySubscriptionStatus } from './entities';
|
|
4
4
|
|
|
5
5
|
const CopyStateResponse = z.discriminatedUnion("state", [
|
|
6
6
|
z.object({
|
|
@@ -8,9 +8,7 @@ const CopyStateResponse = z.discriminatedUnion("state", [
|
|
|
8
8
|
}),
|
|
9
9
|
z.object({
|
|
10
10
|
state: z.literal("ACTIVE"),
|
|
11
|
-
subscription:
|
|
12
|
-
status: z.literal("ACTIVE")
|
|
13
|
-
})
|
|
11
|
+
subscription: CopySubscriptionWithMetrics
|
|
14
12
|
})
|
|
15
13
|
]);
|
|
16
14
|
const CopyFollowersResponse = z.object({
|
|
@@ -52,7 +50,7 @@ const CreateCopySubscriptionResponse = CopySubscriptionResponse.extend({
|
|
|
52
50
|
joinResults: z.array(CopyJoinResult)
|
|
53
51
|
});
|
|
54
52
|
const CopySubscriptionListResponse = z.object({
|
|
55
|
-
subscriptions: z.array(
|
|
53
|
+
subscriptions: z.array(CopySubscriptionRead)
|
|
56
54
|
});
|
|
57
55
|
const CopyActivityListResponse = z.object({
|
|
58
56
|
activities: z.array(CopyActivity)
|
|
@@ -359,11 +359,10 @@ export declare const OpenPositionLeg: z.ZodObject<{
|
|
|
359
359
|
}, z.core.$strip>;
|
|
360
360
|
export type OpenPositionLeg = z.output<typeof OpenPositionLeg>;
|
|
361
361
|
/**
|
|
362
|
-
* The
|
|
363
|
-
* composed server-side from
|
|
362
|
+
* The lifetime economics of one open position, including booked realized PnL and
|
|
363
|
+
* gross unrealized PnL at live marks, composed server-side from shared position math.
|
|
364
364
|
*
|
|
365
|
-
*
|
|
366
|
-
* /positions and /portfolio's openSnapshot already carry.
|
|
365
|
+
* Its gross unrealized PnL uses current marks where a priced entry basis is known.
|
|
367
366
|
*/
|
|
368
367
|
export declare const OpenPosition: z.ZodObject<{
|
|
369
368
|
positionId: z.ZodUUID;
|
|
@@ -384,6 +383,8 @@ export declare const OpenPosition: z.ZodObject<{
|
|
|
384
383
|
EXTERNAL: "EXTERNAL";
|
|
385
384
|
}>;
|
|
386
385
|
realizedGrossPnl: z.ZodPipe<z.ZodString, z.ZodTransform<`-${string}` | `+${string}`, string>>;
|
|
386
|
+
volume: z.ZodString;
|
|
387
|
+
grossUpnl: z.ZodPipe<z.ZodString, z.ZodTransform<`-${string}` | `+${string}`, string>>;
|
|
387
388
|
netCashflow: z.ZodPipe<z.ZodString, z.ZodTransform<`-${string}` | `+${string}`, string>>;
|
|
388
389
|
totalFees: z.ZodPipe<z.ZodString, z.ZodTransform<`-${string}` | `+${string}`, string>>;
|
|
389
390
|
tradeFees: z.ZodPipe<z.ZodString, z.ZodTransform<`-${string}` | `+${string}`, string>>;
|
|
@@ -313,6 +313,10 @@ const OpenPosition = z.object({
|
|
|
313
313
|
* live, and revisable while it is — see netCashflow on reconciliation.
|
|
314
314
|
*/
|
|
315
315
|
realizedGrossPnl: SignedDecimalString,
|
|
316
|
+
/** Lifetime executed USD turnover, including opening and closing fills. */
|
|
317
|
+
volume: UnsignedDecimalString.describe("Lifetime executed USD turnover across opening and closing fills"),
|
|
318
|
+
/** Gross unrealized PnL at current marks; missing marks or entry basis can make this total partial. */
|
|
319
|
+
grossUpnl: SignedDecimalString.describe("Gross unrealized USD PnL at current marks; missing marks or entry basis can make this total partial; excludes fees and funding"),
|
|
316
320
|
/**
|
|
317
321
|
* Cash booked so far: realized gross PnL minus every fee charged to date. Not a
|
|
318
322
|
* settled return on closed quantity — it books every fee charged so far, including
|
|
@@ -224,6 +224,8 @@ export declare const OpenPositionListResponse: z.ZodObject<{
|
|
|
224
224
|
EXTERNAL: "EXTERNAL";
|
|
225
225
|
}>;
|
|
226
226
|
realizedGrossPnl: z.ZodPipe<z.ZodString, z.ZodTransform<`-${string}` | `+${string}`, string>>;
|
|
227
|
+
volume: z.ZodString;
|
|
228
|
+
grossUpnl: z.ZodPipe<z.ZodString, z.ZodTransform<`-${string}` | `+${string}`, string>>;
|
|
227
229
|
netCashflow: z.ZodPipe<z.ZodString, z.ZodTransform<`-${string}` | `+${string}`, string>>;
|
|
228
230
|
totalFees: z.ZodPipe<z.ZodString, z.ZodTransform<`-${string}` | `+${string}`, string>>;
|
|
229
231
|
tradeFees: z.ZodPipe<z.ZodString, z.ZodTransform<`-${string}` | `+${string}`, string>>;
|
|
@@ -10,8 +10,12 @@ const LeaderboardRow = z.object({
|
|
|
10
10
|
// address beside a real name and a PnL deanonymizes a trader for good, and an address is
|
|
11
11
|
// not reversible once scraped. Neither id here is a credential — every route that takes
|
|
12
12
|
// one checks ownership or role, never knowledge of the id.
|
|
13
|
+
// This guarantee applies to private routes. Shared public profiles are addressable by
|
|
14
|
+
// tradeAccountId and omit the exchange identifier, including when the owner shows X identity.
|
|
13
15
|
userId: z.string(),
|
|
14
16
|
connector: Connector,
|
|
17
|
+
// Current owner consent; venue support and admission availability also apply.
|
|
18
|
+
copyingEnabled: z.boolean().describe("Whether the owner allows new copy subscriptions; venue support and admission availability also apply"),
|
|
15
19
|
// Followers when this board was cached, independent of the performance date range.
|
|
16
20
|
followers: z.array(CopyFollower),
|
|
17
21
|
followerCount: z.number().int().nonnegative(),
|
package/dist/traders/public.d.ts
CHANGED
|
@@ -2571,7 +2571,11 @@ export declare const PublicTraderResponse: z.ZodObject<{
|
|
|
2571
2571
|
lighter: "lighter";
|
|
2572
2572
|
lighter_rhc: "lighter_rhc";
|
|
2573
2573
|
}>;
|
|
2574
|
-
|
|
2574
|
+
copyingEnabled: z.ZodBoolean;
|
|
2575
|
+
xHandle: z.ZodOptional<z.ZodString>;
|
|
2576
|
+
xName: z.ZodOptional<z.ZodString>;
|
|
2577
|
+
xAvatarUrl: z.ZodOptional<z.ZodString>;
|
|
2578
|
+
xUserId: z.ZodOptional<z.ZodString>;
|
|
2575
2579
|
followers: z.ZodArray<z.ZodObject<{
|
|
2576
2580
|
tradeAccountId: z.ZodUUID;
|
|
2577
2581
|
status: z.ZodLiteral<"ACTIVE">;
|
package/dist/traders/public.js
CHANGED
|
@@ -148,7 +148,12 @@ const PublicLadder = Ladder.pick({
|
|
|
148
148
|
});
|
|
149
149
|
const PublicTraderResponse = z.object({
|
|
150
150
|
connector: Connector.describe("Exchange connector type"),
|
|
151
|
-
|
|
151
|
+
copyingEnabled: z.boolean().describe("Whether the owner allows new copy subscriptions; venue support and admission availability also apply"),
|
|
152
|
+
// Omit X identity when the owner hides it or has not linked an account.
|
|
153
|
+
xHandle: z.string().optional().describe("Public X handle at the last authorization; absent when hidden or unlinked"),
|
|
154
|
+
xName: z.string().optional().describe("Public X display name; absent when hidden or unlinked"),
|
|
155
|
+
xAvatarUrl: z.string().optional().describe("Public X avatar URL; absent when hidden or unlinked"),
|
|
156
|
+
xUserId: z.string().optional().describe("Immutable X numeric user ID; absent when hidden or unlinked"),
|
|
152
157
|
// Followers are complete; the latest-20 limit applies only to trading records.
|
|
153
158
|
followers: z.array(CopyFollower),
|
|
154
159
|
followerCount: z.number().int().nonnegative(),
|
package/dist/users/entities.js
CHANGED
|
@@ -24,7 +24,7 @@ const UserProfile = z.object({
|
|
|
24
24
|
// A plain boolean rather than nullable, matching `emailVerified` above: this is the
|
|
25
25
|
// owner's own setting, which is known whether or not an X account is linked. With none
|
|
26
26
|
// linked it describes what would happen once one is.
|
|
27
|
-
xHidden: z.boolean().describe("Whether the leaderboard
|
|
27
|
+
xHidden: z.boolean().describe("Whether the leaderboard and public trader profiles withhold the linked X account")
|
|
28
28
|
}).describe("User profile of the authenticated user");
|
|
29
29
|
const BoundReferralReferee = z.object({
|
|
30
30
|
status: z.literal("BOUND").describe("The referee resolves to a V3 user with a permanent binding"),
|