@pear-protocol/types 2.11.0 → 2.12.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.d.ts +3 -3
- package/dist/auth/payloads.js +1 -1
- package/dist/baskets/saved/entities.js +1 -1
- package/dist/bundle.d.ts +2 -0
- package/dist/bundle.js +2 -0
- package/dist/common/refinement.d.ts +3 -3
- package/dist/common/trade-legs.js +1 -1
- package/dist/copy/entities.d.ts +186 -0
- package/dist/copy/entities.js +113 -0
- package/dist/copy/index.d.ts +4 -0
- package/dist/copy/index.js +4 -0
- package/dist/copy/payloads.d.ts +14 -0
- package/dist/copy/payloads.js +8 -0
- package/dist/copy/queries.d.ts +13 -0
- package/dist/copy/queries.js +16 -0
- package/dist/copy/responses.d.ts +332 -0
- package/dist/copy/responses.js +91 -0
- package/dist/execution/entities.d.ts +71 -71
- package/dist/execution/entities.js +1 -1
- package/dist/execution/queries.d.ts +2 -2
- package/dist/execution/responses.d.ts +40 -40
- package/dist/ladder/entities.d.ts +22 -17
- package/dist/ladder/queries.d.ts +5 -0
- package/dist/ladder/queries.js +6 -2
- package/dist/ladder/responses.d.ts +63 -48
- package/dist/misc/payloads.d.ts +26 -0
- package/dist/misc/payloads.js +27 -1
- package/dist/misc/responses.d.ts +8 -0
- package/dist/misc/responses.js +7 -1
- package/dist/notification/entities.d.ts +120 -0
- package/dist/notification/entities.js +59 -3
- package/dist/notification/responses.d.ts +60 -0
- package/dist/order/entities.d.ts +3 -3
- package/dist/position/entities.d.ts +1 -1
- package/dist/position/responses.d.ts +3 -1
- package/dist/position/responses.js +2 -0
- package/dist/schedule/entities.d.ts +18 -12
- package/dist/schedule/entities.js +2 -1
- package/dist/schedule/queries.d.ts +2 -2
- package/dist/schedule/responses.d.ts +12 -8
- package/dist/schedule/twap-config.js +1 -1
- package/dist/statistics/entities.d.ts +10 -0
- package/dist/statistics/entities.js +4 -0
- package/dist/statistics/responses.d.ts +10 -0
- package/dist/sync/payloads.d.ts +12 -0
- package/dist/sync/payloads.js +31 -3
- package/dist/tca/responses.d.ts +12 -12
- package/dist/trade/responses.d.ts +100 -100
- package/dist/trade-accounts/entities.d.ts +136 -12
- package/dist/trade-accounts/entities.js +41 -9
- package/dist/trade-accounts/payloads.d.ts +12 -0
- package/dist/trade-accounts/payloads.js +7 -1
- package/dist/trade-accounts/response.d.ts +963 -223
- package/dist/traders/index.d.ts +1 -0
- package/dist/traders/index.js +1 -0
- package/dist/traders/public.d.ts +4967 -0
- package/dist/traders/public.js +128 -0
- package/dist/trigger/common/index.d.ts +3 -2
- package/dist/trigger/common/index.js +1 -0
- package/dist/trigger/entities/index.d.ts +64 -48
- package/dist/trigger/entities/index.js +3 -3
- package/dist/trigger/queries.d.ts +2 -2
- package/dist/trigger/responses.d.ts +40 -30
- package/dist/vaults/entities.d.ts +1 -1
- package/dist/vaults/responses.d.ts +2 -2
- package/package.json +2 -2
|
@@ -9,35 +9,159 @@ declare const HyperliquidMetadata: z.ZodObject<{
|
|
|
9
9
|
}, z.core.$strip>;
|
|
10
10
|
declare const LighterMetadata: z.ZodObject<{
|
|
11
11
|
l1_address: z.ZodString;
|
|
12
|
+
isSubaccount: z.ZodBoolean;
|
|
12
13
|
}, z.core.$strip>;
|
|
13
|
-
|
|
14
|
+
declare const HyperliquidTradeAccount: z.ZodObject<{
|
|
15
|
+
connector: z.ZodLiteral<"hyperliquid">;
|
|
16
|
+
metadata: z.ZodOptional<z.ZodObject<{
|
|
17
|
+
agentWalletAddress: z.ZodString;
|
|
18
|
+
isSubaccount: z.ZodBoolean;
|
|
19
|
+
mainAccountAddress: z.ZodString;
|
|
20
|
+
}, z.core.$strip>>;
|
|
14
21
|
id: z.ZodUUID;
|
|
15
22
|
alias: z.ZodString;
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
bybit: "bybit";
|
|
20
|
-
okx: "okx";
|
|
21
|
-
lighter: "lighter";
|
|
22
|
-
lighter_rhc: "lighter_rhc";
|
|
23
|
+
kind: z.ZodEnum<{
|
|
24
|
+
vault: "vault";
|
|
25
|
+
eoa: "eoa";
|
|
23
26
|
}>;
|
|
27
|
+
exchangeIdentifier: z.ZodString;
|
|
28
|
+
sharingEnabled: z.ZodBoolean;
|
|
29
|
+
copyingEnabled: z.ZodBoolean;
|
|
30
|
+
createdAt: z.ZodString;
|
|
31
|
+
updatedAt: z.ZodString;
|
|
32
|
+
deletedAt: z.ZodOptional<z.ZodString>;
|
|
33
|
+
}, z.core.$strip>;
|
|
34
|
+
declare const LighterTradeAccount: z.ZodObject<{
|
|
35
|
+
connector: z.ZodLiteral<"lighter">;
|
|
36
|
+
metadata: z.ZodOptional<z.ZodObject<{
|
|
37
|
+
l1_address: z.ZodString;
|
|
38
|
+
isSubaccount: z.ZodBoolean;
|
|
39
|
+
}, z.core.$strip>>;
|
|
40
|
+
id: z.ZodUUID;
|
|
41
|
+
alias: z.ZodString;
|
|
24
42
|
kind: z.ZodEnum<{
|
|
25
43
|
vault: "vault";
|
|
26
44
|
eoa: "eoa";
|
|
27
45
|
}>;
|
|
28
46
|
exchangeIdentifier: z.ZodString;
|
|
29
|
-
|
|
47
|
+
sharingEnabled: z.ZodBoolean;
|
|
48
|
+
copyingEnabled: z.ZodBoolean;
|
|
49
|
+
createdAt: z.ZodString;
|
|
50
|
+
updatedAt: z.ZodString;
|
|
51
|
+
deletedAt: z.ZodOptional<z.ZodString>;
|
|
52
|
+
}, z.core.$strip>;
|
|
53
|
+
/**
|
|
54
|
+
* A trade account, discriminated by the connector it belongs to.
|
|
55
|
+
*
|
|
56
|
+
* The connector is a column on the row, so it — not the shape of the metadata blob — decides which
|
|
57
|
+
* metadata contract applies. Narrowing on a metadata key instead was unstable: the two shapes keep
|
|
58
|
+
* gaining the same fields, and `isSubaccount` stopped discriminating once Lighter gained it too.
|
|
59
|
+
* Mirrors `CreateTradeAccount`/`UpdateTradeAccount`, which are already discriminated this way.
|
|
60
|
+
*/
|
|
61
|
+
export declare const TradeAccount: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
62
|
+
connector: z.ZodLiteral<"hyperliquid">;
|
|
63
|
+
metadata: z.ZodOptional<z.ZodObject<{
|
|
30
64
|
agentWalletAddress: z.ZodString;
|
|
31
65
|
isSubaccount: z.ZodBoolean;
|
|
32
66
|
mainAccountAddress: z.ZodString;
|
|
33
|
-
}, z.core.$strip
|
|
67
|
+
}, z.core.$strip>>;
|
|
68
|
+
id: z.ZodUUID;
|
|
69
|
+
alias: z.ZodString;
|
|
70
|
+
kind: z.ZodEnum<{
|
|
71
|
+
vault: "vault";
|
|
72
|
+
eoa: "eoa";
|
|
73
|
+
}>;
|
|
74
|
+
exchangeIdentifier: z.ZodString;
|
|
75
|
+
sharingEnabled: z.ZodBoolean;
|
|
76
|
+
copyingEnabled: z.ZodBoolean;
|
|
77
|
+
createdAt: z.ZodString;
|
|
78
|
+
updatedAt: z.ZodString;
|
|
79
|
+
deletedAt: z.ZodOptional<z.ZodString>;
|
|
80
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
81
|
+
connector: z.ZodLiteral<"lighter">;
|
|
82
|
+
metadata: z.ZodOptional<z.ZodObject<{
|
|
34
83
|
l1_address: z.ZodString;
|
|
35
|
-
|
|
84
|
+
isSubaccount: z.ZodBoolean;
|
|
85
|
+
}, z.core.$strip>>;
|
|
86
|
+
id: z.ZodUUID;
|
|
87
|
+
alias: z.ZodString;
|
|
88
|
+
kind: z.ZodEnum<{
|
|
89
|
+
vault: "vault";
|
|
90
|
+
eoa: "eoa";
|
|
91
|
+
}>;
|
|
92
|
+
exchangeIdentifier: z.ZodString;
|
|
93
|
+
sharingEnabled: z.ZodBoolean;
|
|
94
|
+
copyingEnabled: z.ZodBoolean;
|
|
36
95
|
createdAt: z.ZodString;
|
|
37
96
|
updatedAt: z.ZodString;
|
|
38
97
|
deletedAt: z.ZodOptional<z.ZodString>;
|
|
39
|
-
}, z.core.$strip
|
|
98
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
99
|
+
metadata: z.ZodOptional<z.ZodObject<{
|
|
100
|
+
l1_address: z.ZodString;
|
|
101
|
+
isSubaccount: z.ZodBoolean;
|
|
102
|
+
}, z.core.$strip>>;
|
|
103
|
+
id: z.ZodUUID;
|
|
104
|
+
alias: z.ZodString;
|
|
105
|
+
kind: z.ZodEnum<{
|
|
106
|
+
vault: "vault";
|
|
107
|
+
eoa: "eoa";
|
|
108
|
+
}>;
|
|
109
|
+
exchangeIdentifier: z.ZodString;
|
|
110
|
+
sharingEnabled: z.ZodBoolean;
|
|
111
|
+
copyingEnabled: z.ZodBoolean;
|
|
112
|
+
createdAt: z.ZodString;
|
|
113
|
+
updatedAt: z.ZodString;
|
|
114
|
+
deletedAt: z.ZodOptional<z.ZodString>;
|
|
115
|
+
connector: z.ZodLiteral<"lighter_rhc">;
|
|
116
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
117
|
+
connector: z.ZodLiteral<"binance">;
|
|
118
|
+
metadata: z.ZodOptional<z.ZodNever>;
|
|
119
|
+
id: z.ZodUUID;
|
|
120
|
+
alias: z.ZodString;
|
|
121
|
+
kind: z.ZodEnum<{
|
|
122
|
+
vault: "vault";
|
|
123
|
+
eoa: "eoa";
|
|
124
|
+
}>;
|
|
125
|
+
exchangeIdentifier: z.ZodString;
|
|
126
|
+
sharingEnabled: z.ZodBoolean;
|
|
127
|
+
copyingEnabled: z.ZodBoolean;
|
|
128
|
+
createdAt: z.ZodString;
|
|
129
|
+
updatedAt: z.ZodString;
|
|
130
|
+
deletedAt: z.ZodOptional<z.ZodString>;
|
|
131
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
132
|
+
connector: z.ZodLiteral<"bybit">;
|
|
133
|
+
metadata: z.ZodOptional<z.ZodNever>;
|
|
134
|
+
id: z.ZodUUID;
|
|
135
|
+
alias: z.ZodString;
|
|
136
|
+
kind: z.ZodEnum<{
|
|
137
|
+
vault: "vault";
|
|
138
|
+
eoa: "eoa";
|
|
139
|
+
}>;
|
|
140
|
+
exchangeIdentifier: z.ZodString;
|
|
141
|
+
sharingEnabled: z.ZodBoolean;
|
|
142
|
+
copyingEnabled: z.ZodBoolean;
|
|
143
|
+
createdAt: z.ZodString;
|
|
144
|
+
updatedAt: z.ZodString;
|
|
145
|
+
deletedAt: z.ZodOptional<z.ZodString>;
|
|
146
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
147
|
+
connector: z.ZodLiteral<"okx">;
|
|
148
|
+
metadata: z.ZodOptional<z.ZodNever>;
|
|
149
|
+
id: z.ZodUUID;
|
|
150
|
+
alias: z.ZodString;
|
|
151
|
+
kind: z.ZodEnum<{
|
|
152
|
+
vault: "vault";
|
|
153
|
+
eoa: "eoa";
|
|
154
|
+
}>;
|
|
155
|
+
exchangeIdentifier: z.ZodString;
|
|
156
|
+
sharingEnabled: z.ZodBoolean;
|
|
157
|
+
copyingEnabled: z.ZodBoolean;
|
|
158
|
+
createdAt: z.ZodString;
|
|
159
|
+
updatedAt: z.ZodString;
|
|
160
|
+
deletedAt: z.ZodOptional<z.ZodString>;
|
|
161
|
+
}, z.core.$strip>], "connector">;
|
|
40
162
|
export type TradeAccount = z.infer<typeof TradeAccount>;
|
|
163
|
+
export type HyperliquidTradeAccount = z.infer<typeof HyperliquidTradeAccount>;
|
|
164
|
+
export type LighterTradeAccount = z.infer<typeof LighterTradeAccount>;
|
|
41
165
|
export type HyperliquidMetadata = z.infer<typeof HyperliquidMetadata>;
|
|
42
166
|
export type LighterMetadata = z.infer<typeof LighterMetadata>;
|
|
43
167
|
export {};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { Connector } from '../connector';
|
|
3
2
|
|
|
4
3
|
const HyperliquidMetadata = z.object({
|
|
5
4
|
agentWalletAddress: z.string(),
|
|
@@ -7,25 +6,58 @@ const HyperliquidMetadata = z.object({
|
|
|
7
6
|
mainAccountAddress: z.string()
|
|
8
7
|
});
|
|
9
8
|
const LighterMetadata = z.object({
|
|
10
|
-
l1_address: z.string()
|
|
9
|
+
l1_address: z.string(),
|
|
10
|
+
isSubaccount: z.boolean()
|
|
11
11
|
});
|
|
12
|
-
const
|
|
13
|
-
HyperliquidMetadata,
|
|
14
|
-
LighterMetadata
|
|
15
|
-
]).optional();
|
|
16
|
-
const TradeAccount = z.object({
|
|
12
|
+
const commonFields = {
|
|
17
13
|
id: z.uuid().describe("Trade account UUID"),
|
|
18
14
|
alias: z.string().describe("User-defined trade account alias"),
|
|
19
|
-
connector: Connector.describe("Exchange connector type"),
|
|
20
15
|
kind: z.enum([
|
|
21
16
|
"eoa",
|
|
22
17
|
"vault"
|
|
23
18
|
]).describe("Whether the account trades an EOA or a Pear vault"),
|
|
24
19
|
exchangeIdentifier: z.string().describe("User identifier on the exchange"),
|
|
25
|
-
|
|
20
|
+
sharingEnabled: z.boolean().describe("Whether the owner allows public viewing"),
|
|
21
|
+
copyingEnabled: z.boolean().describe("Whether the owner allows copying while public sharing is enabled"),
|
|
26
22
|
createdAt: z.string().describe("Creation timestamp (ISO 8601)"),
|
|
27
23
|
updatedAt: z.string().describe("Last update timestamp (ISO 8601)"),
|
|
28
24
|
deletedAt: z.string().describe("Deletion timestamp (ISO 8601)").optional()
|
|
25
|
+
};
|
|
26
|
+
const NoConnectorMetadata = z.never().optional();
|
|
27
|
+
const HyperliquidTradeAccount = z.object({
|
|
28
|
+
...commonFields,
|
|
29
|
+
connector: z.literal("hyperliquid").describe("Exchange connector type"),
|
|
30
|
+
metadata: HyperliquidMetadata.optional().describe("Connector-specific metadata")
|
|
29
31
|
});
|
|
32
|
+
const LighterTradeAccount = z.object({
|
|
33
|
+
...commonFields,
|
|
34
|
+
connector: z.literal("lighter").describe("Exchange connector type"),
|
|
35
|
+
metadata: LighterMetadata.optional().describe("Connector-specific metadata")
|
|
36
|
+
});
|
|
37
|
+
const BinanceTradeAccount = z.object({
|
|
38
|
+
...commonFields,
|
|
39
|
+
connector: z.literal("binance").describe("Exchange connector type"),
|
|
40
|
+
metadata: NoConnectorMetadata.describe("Connector-specific metadata")
|
|
41
|
+
});
|
|
42
|
+
const BybitTradeAccount = z.object({
|
|
43
|
+
...commonFields,
|
|
44
|
+
connector: z.literal("bybit").describe("Exchange connector type"),
|
|
45
|
+
metadata: NoConnectorMetadata.describe("Connector-specific metadata")
|
|
46
|
+
});
|
|
47
|
+
const OkxTradeAccount = z.object({
|
|
48
|
+
...commonFields,
|
|
49
|
+
connector: z.literal("okx").describe("Exchange connector type"),
|
|
50
|
+
metadata: NoConnectorMetadata.describe("Connector-specific metadata")
|
|
51
|
+
});
|
|
52
|
+
const TradeAccount = z.discriminatedUnion("connector", [
|
|
53
|
+
HyperliquidTradeAccount,
|
|
54
|
+
LighterTradeAccount,
|
|
55
|
+
LighterTradeAccount.extend({
|
|
56
|
+
connector: z.literal("lighter_rhc")
|
|
57
|
+
}),
|
|
58
|
+
BinanceTradeAccount,
|
|
59
|
+
BybitTradeAccount,
|
|
60
|
+
OkxTradeAccount
|
|
61
|
+
]);
|
|
30
62
|
|
|
31
63
|
export { TradeAccount };
|
|
@@ -197,6 +197,10 @@ export declare const UpdateTradeAccount: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
197
197
|
}, z.core.$strip>>;
|
|
198
198
|
connector: z.ZodLiteral<"lighter_rhc">;
|
|
199
199
|
}, z.core.$strip>], "connector">;
|
|
200
|
+
/** Payload to set public viewing consent independently of account settings. */
|
|
201
|
+
export declare const UpdateTradeAccountSharing: z.ZodObject<{
|
|
202
|
+
sharingEnabled: z.ZodBoolean;
|
|
203
|
+
}, z.core.$strip>;
|
|
200
204
|
export type CreateHyperliquidCredentials = z.infer<typeof CreateHyperliquidCredentials>;
|
|
201
205
|
export type CreateHyperliquidMetadata = z.infer<typeof CreateHyperliquidMetadata>;
|
|
202
206
|
export type CreateBinanceCredentials = z.infer<typeof CreateBinanceCredentials>;
|
|
@@ -210,4 +214,12 @@ export type CreateVaultTradeAccountInput = z.input<typeof CreateVaultTradeAccoun
|
|
|
210
214
|
export type CreateVaultTradeAccount = z.output<typeof CreateVaultTradeAccount>;
|
|
211
215
|
export type UpdateTradeAccountInput = z.input<typeof UpdateTradeAccount>;
|
|
212
216
|
export type UpdateTradeAccount = z.output<typeof UpdateTradeAccount>;
|
|
217
|
+
export type UpdateTradeAccountSharingInput = z.input<typeof UpdateTradeAccountSharing>;
|
|
218
|
+
export type UpdateTradeAccountSharing = z.output<typeof UpdateTradeAccountSharing>;
|
|
219
|
+
/** Payload to set copying consent independently of public visibility. */
|
|
220
|
+
export declare const UpdateTradeAccountCopying: z.ZodObject<{
|
|
221
|
+
copyingEnabled: z.ZodBoolean;
|
|
222
|
+
}, z.core.$strip>;
|
|
223
|
+
export type UpdateTradeAccountCopyingInput = z.input<typeof UpdateTradeAccountCopying>;
|
|
224
|
+
export type UpdateTradeAccountCopying = z.output<typeof UpdateTradeAccountCopying>;
|
|
213
225
|
export {};
|
|
@@ -128,5 +128,11 @@ const UpdateTradeAccount = z.discriminatedUnion("connector", [
|
|
|
128
128
|
UpdateLighterAccount,
|
|
129
129
|
UpdateLighterRhcAccount
|
|
130
130
|
]);
|
|
131
|
+
const UpdateTradeAccountSharing = z.object({
|
|
132
|
+
sharingEnabled: z.boolean()
|
|
133
|
+
});
|
|
134
|
+
const UpdateTradeAccountCopying = z.object({
|
|
135
|
+
copyingEnabled: z.boolean()
|
|
136
|
+
});
|
|
131
137
|
|
|
132
|
-
export { CreateTradeAccount, CreateVaultTradeAccount, UpdateTradeAccount };
|
|
138
|
+
export { CreateTradeAccount, CreateVaultTradeAccount, UpdateTradeAccount, UpdateTradeAccountCopying, UpdateTradeAccountSharing };
|