@pear-protocol/types 2.9.0 → 2.10.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/address.d.ts +8 -2
- package/dist/position/responses.d.ts +3 -2
- package/dist/sync/payloads.d.ts +11 -0
- package/dist/sync/payloads.js +6 -2
- package/dist/sync/responses.d.ts +1 -0
- package/dist/sync/responses.js +8 -1
- package/dist/trade-accounts/payloads.d.ts +14 -13
- package/dist/users/entities.d.ts +5 -4
- package/dist/users/response.d.ts +2 -2
- package/dist/vaults/entities.d.ts +111 -0
- package/dist/vaults/entities.js +96 -0
- package/dist/vaults/index.d.ts +4 -0
- package/dist/vaults/index.js +4 -0
- package/dist/vaults/payloads.d.ts +140 -0
- package/dist/vaults/payloads.js +65 -0
- package/dist/vaults/queries.d.ts +96 -0
- package/dist/vaults/queries.js +66 -0
- package/dist/vaults/responses.d.ts +574 -0
- package/dist/vaults/responses.js +359 -0
- package/package.json +1 -1
|
@@ -0,0 +1,574 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { EthereumAddress } from '../common/address';
|
|
3
|
+
export declare const VaultResponse: z.ZodObject<{
|
|
4
|
+
vault: z.ZodObject<{
|
|
5
|
+
id: z.ZodString;
|
|
6
|
+
vaultAddress: z.ZodPipe<z.ZodString, z.ZodTransform<EthereumAddress, string>>;
|
|
7
|
+
ownerAddress: z.ZodPipe<z.ZodString, z.ZodTransform<EthereumAddress, string>>;
|
|
8
|
+
traderAddress: z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodTransform<EthereumAddress, string>>>;
|
|
9
|
+
agentAddress: z.ZodPipe<z.ZodString, z.ZodTransform<EthereumAddress, string>>;
|
|
10
|
+
status: z.ZodEnum<{
|
|
11
|
+
active: "active";
|
|
12
|
+
inactive: "inactive";
|
|
13
|
+
pending_activation: "pending_activation";
|
|
14
|
+
}>;
|
|
15
|
+
isApproved: z.ZodBoolean;
|
|
16
|
+
name: z.ZodNullable<z.ZodString>;
|
|
17
|
+
about: z.ZodNullable<z.ZodString>;
|
|
18
|
+
imageUrl: z.ZodNullable<z.ZodString>;
|
|
19
|
+
transactionHash: z.ZodNullable<z.ZodString>;
|
|
20
|
+
maxWithdrawalPeriodDays: z.ZodNumber;
|
|
21
|
+
createdAt: z.ZodString;
|
|
22
|
+
updatedAt: z.ZodString;
|
|
23
|
+
}, z.core.$strip>;
|
|
24
|
+
}, z.core.$strip>;
|
|
25
|
+
export type VaultResponse = z.infer<typeof VaultResponse>;
|
|
26
|
+
export declare const VaultListResponse: z.ZodObject<{
|
|
27
|
+
vaults: z.ZodArray<z.ZodObject<{
|
|
28
|
+
id: z.ZodString;
|
|
29
|
+
vaultAddress: z.ZodPipe<z.ZodString, z.ZodTransform<EthereumAddress, string>>;
|
|
30
|
+
ownerAddress: z.ZodPipe<z.ZodString, z.ZodTransform<EthereumAddress, string>>;
|
|
31
|
+
traderAddress: z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodTransform<EthereumAddress, string>>>;
|
|
32
|
+
agentAddress: z.ZodPipe<z.ZodString, z.ZodTransform<EthereumAddress, string>>;
|
|
33
|
+
status: z.ZodEnum<{
|
|
34
|
+
active: "active";
|
|
35
|
+
inactive: "inactive";
|
|
36
|
+
pending_activation: "pending_activation";
|
|
37
|
+
}>;
|
|
38
|
+
isApproved: z.ZodBoolean;
|
|
39
|
+
name: z.ZodNullable<z.ZodString>;
|
|
40
|
+
about: z.ZodNullable<z.ZodString>;
|
|
41
|
+
imageUrl: z.ZodNullable<z.ZodString>;
|
|
42
|
+
transactionHash: z.ZodNullable<z.ZodString>;
|
|
43
|
+
maxWithdrawalPeriodDays: z.ZodNumber;
|
|
44
|
+
createdAt: z.ZodString;
|
|
45
|
+
updatedAt: z.ZodString;
|
|
46
|
+
}, z.core.$strip>>;
|
|
47
|
+
}, z.core.$strip>;
|
|
48
|
+
export type VaultListResponse = z.infer<typeof VaultListResponse>;
|
|
49
|
+
/** Bare create outcome: the service persists and replays exactly this union. */
|
|
50
|
+
export declare const CreatedVaultResult: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
51
|
+
success: z.ZodLiteral<true>;
|
|
52
|
+
vaultAddress: z.ZodPipe<z.ZodString, z.ZodTransform<EthereumAddress, string>>;
|
|
53
|
+
agentAddress: z.ZodPipe<z.ZodString, z.ZodTransform<EthereumAddress, string>>;
|
|
54
|
+
ownerAddress: z.ZodPipe<z.ZodString, z.ZodTransform<EthereumAddress, string>>;
|
|
55
|
+
status: z.ZodEnum<{
|
|
56
|
+
active: "active";
|
|
57
|
+
inactive: "inactive";
|
|
58
|
+
pending_activation: "pending_activation";
|
|
59
|
+
}>;
|
|
60
|
+
maxWithdrawalPeriodDays: z.ZodNumber;
|
|
61
|
+
txHash: z.ZodString;
|
|
62
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
63
|
+
success: z.ZodLiteral<false>;
|
|
64
|
+
status: z.ZodLiteral<"in_progress">;
|
|
65
|
+
activityId: z.ZodString;
|
|
66
|
+
}, z.core.$strip>], "success">;
|
|
67
|
+
export type CreatedVaultResult = z.output<typeof CreatedVaultResult>;
|
|
68
|
+
/** Wire envelope: a DTO class cannot extend a union, so the union sits under `result`. */
|
|
69
|
+
export declare const CreatedVaultResponse: z.ZodObject<{
|
|
70
|
+
result: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
71
|
+
success: z.ZodLiteral<true>;
|
|
72
|
+
vaultAddress: z.ZodPipe<z.ZodString, z.ZodTransform<EthereumAddress, string>>;
|
|
73
|
+
agentAddress: z.ZodPipe<z.ZodString, z.ZodTransform<EthereumAddress, string>>;
|
|
74
|
+
ownerAddress: z.ZodPipe<z.ZodString, z.ZodTransform<EthereumAddress, string>>;
|
|
75
|
+
status: z.ZodEnum<{
|
|
76
|
+
active: "active";
|
|
77
|
+
inactive: "inactive";
|
|
78
|
+
pending_activation: "pending_activation";
|
|
79
|
+
}>;
|
|
80
|
+
maxWithdrawalPeriodDays: z.ZodNumber;
|
|
81
|
+
txHash: z.ZodString;
|
|
82
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
83
|
+
success: z.ZodLiteral<false>;
|
|
84
|
+
status: z.ZodLiteral<"in_progress">;
|
|
85
|
+
activityId: z.ZodString;
|
|
86
|
+
}, z.core.$strip>], "success">;
|
|
87
|
+
}, z.core.$strip>;
|
|
88
|
+
export type CreatedVaultResponse = z.output<typeof CreatedVaultResponse>;
|
|
89
|
+
/** Bare set-trader outcome: the service persists and replays exactly this union. */
|
|
90
|
+
export declare const SetTraderResult: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
91
|
+
success: z.ZodLiteral<true>;
|
|
92
|
+
vault: z.ZodObject<{
|
|
93
|
+
id: z.ZodString;
|
|
94
|
+
vaultAddress: z.ZodPipe<z.ZodString, z.ZodTransform<EthereumAddress, string>>;
|
|
95
|
+
ownerAddress: z.ZodPipe<z.ZodString, z.ZodTransform<EthereumAddress, string>>;
|
|
96
|
+
traderAddress: z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodTransform<EthereumAddress, string>>>;
|
|
97
|
+
agentAddress: z.ZodPipe<z.ZodString, z.ZodTransform<EthereumAddress, string>>;
|
|
98
|
+
status: z.ZodEnum<{
|
|
99
|
+
active: "active";
|
|
100
|
+
inactive: "inactive";
|
|
101
|
+
pending_activation: "pending_activation";
|
|
102
|
+
}>;
|
|
103
|
+
isApproved: z.ZodBoolean;
|
|
104
|
+
name: z.ZodNullable<z.ZodString>;
|
|
105
|
+
about: z.ZodNullable<z.ZodString>;
|
|
106
|
+
imageUrl: z.ZodNullable<z.ZodString>;
|
|
107
|
+
transactionHash: z.ZodNullable<z.ZodString>;
|
|
108
|
+
maxWithdrawalPeriodDays: z.ZodNumber;
|
|
109
|
+
createdAt: z.ZodString;
|
|
110
|
+
updatedAt: z.ZodString;
|
|
111
|
+
}, z.core.$strip>;
|
|
112
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
113
|
+
success: z.ZodLiteral<false>;
|
|
114
|
+
status: z.ZodLiteral<"in_progress">;
|
|
115
|
+
activityId: z.ZodString;
|
|
116
|
+
}, z.core.$strip>], "success">;
|
|
117
|
+
export type SetTraderResult = z.output<typeof SetTraderResult>;
|
|
118
|
+
/** Wire envelope: the union sits under `result` so the route can carry a DTO. */
|
|
119
|
+
export declare const SetTraderResponse: z.ZodObject<{
|
|
120
|
+
result: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
121
|
+
success: z.ZodLiteral<true>;
|
|
122
|
+
vault: z.ZodObject<{
|
|
123
|
+
id: z.ZodString;
|
|
124
|
+
vaultAddress: z.ZodPipe<z.ZodString, z.ZodTransform<EthereumAddress, string>>;
|
|
125
|
+
ownerAddress: z.ZodPipe<z.ZodString, z.ZodTransform<EthereumAddress, string>>;
|
|
126
|
+
traderAddress: z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodTransform<EthereumAddress, string>>>;
|
|
127
|
+
agentAddress: z.ZodPipe<z.ZodString, z.ZodTransform<EthereumAddress, string>>;
|
|
128
|
+
status: z.ZodEnum<{
|
|
129
|
+
active: "active";
|
|
130
|
+
inactive: "inactive";
|
|
131
|
+
pending_activation: "pending_activation";
|
|
132
|
+
}>;
|
|
133
|
+
isApproved: z.ZodBoolean;
|
|
134
|
+
name: z.ZodNullable<z.ZodString>;
|
|
135
|
+
about: z.ZodNullable<z.ZodString>;
|
|
136
|
+
imageUrl: z.ZodNullable<z.ZodString>;
|
|
137
|
+
transactionHash: z.ZodNullable<z.ZodString>;
|
|
138
|
+
maxWithdrawalPeriodDays: z.ZodNumber;
|
|
139
|
+
createdAt: z.ZodString;
|
|
140
|
+
updatedAt: z.ZodString;
|
|
141
|
+
}, z.core.$strip>;
|
|
142
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
143
|
+
success: z.ZodLiteral<false>;
|
|
144
|
+
status: z.ZodLiteral<"in_progress">;
|
|
145
|
+
activityId: z.ZodString;
|
|
146
|
+
}, z.core.$strip>], "success">;
|
|
147
|
+
}, z.core.$strip>;
|
|
148
|
+
export type SetTraderResponse = z.output<typeof SetTraderResponse>;
|
|
149
|
+
export declare const BulkSnapshotsResponse: z.ZodObject<{
|
|
150
|
+
snapshots: z.ZodRecord<z.ZodString, z.ZodArray<z.ZodObject<{
|
|
151
|
+
timestamp: z.ZodNumber;
|
|
152
|
+
createdAt: z.ZodString;
|
|
153
|
+
tvl: z.ZodOptional<z.ZodString>;
|
|
154
|
+
sharePrice: z.ZodOptional<z.ZodString>;
|
|
155
|
+
accountValue: z.ZodOptional<z.ZodNull>;
|
|
156
|
+
unrealizedPnl: z.ZodOptional<z.ZodNull>;
|
|
157
|
+
cumulativeRealizedPnl: z.ZodOptional<z.ZodNull>;
|
|
158
|
+
leaderSharePct: z.ZodOptional<z.ZodNull>;
|
|
159
|
+
}, z.core.$strip>>>;
|
|
160
|
+
}, z.core.$strip>;
|
|
161
|
+
export type BulkSnapshotsResponse = z.infer<typeof BulkSnapshotsResponse>;
|
|
162
|
+
export declare const VaultStatsResponse: z.ZodObject<{
|
|
163
|
+
tvl: z.ZodString;
|
|
164
|
+
totalSupply: z.ZodString;
|
|
165
|
+
sharePrice: z.ZodString;
|
|
166
|
+
withdrawalFeeBps: z.ZodNumber;
|
|
167
|
+
leaderInvestment: z.ZodObject<{
|
|
168
|
+
depositAmount: z.ZodString;
|
|
169
|
+
currentValue: z.ZodString;
|
|
170
|
+
shares: z.ZodString;
|
|
171
|
+
percentageOfTVL: z.ZodNumber;
|
|
172
|
+
}, z.core.$strip>;
|
|
173
|
+
totalPnl: z.ZodNumber;
|
|
174
|
+
totalPnlPercentage: z.ZodNullable<z.ZodNumber>;
|
|
175
|
+
thirtyDayPnl: z.ZodNumber;
|
|
176
|
+
apr: z.ZodNullable<z.ZodNumber>;
|
|
177
|
+
maxDrawdown: z.ZodNullable<z.ZodNumber>;
|
|
178
|
+
tradedVolume: z.ZodOptional<z.ZodNumber>;
|
|
179
|
+
winRate: z.ZodNullable<z.ZodNumber>;
|
|
180
|
+
profitFactor: z.ZodNullable<z.ZodNumber>;
|
|
181
|
+
unrealizedPnl: z.ZodNumber;
|
|
182
|
+
userStats: z.ZodOptional<z.ZodObject<{
|
|
183
|
+
allTimePnl: z.ZodNumber;
|
|
184
|
+
depositAmount: z.ZodString;
|
|
185
|
+
currentValue: z.ZodString;
|
|
186
|
+
shares: z.ZodString;
|
|
187
|
+
unrealizedPnl: z.ZodNumber;
|
|
188
|
+
}, z.core.$strip>>;
|
|
189
|
+
investors: z.ZodArray<z.ZodObject<{
|
|
190
|
+
address: z.ZodString;
|
|
191
|
+
depositAmount: z.ZodString;
|
|
192
|
+
shares: z.ZodString;
|
|
193
|
+
currentValue: z.ZodString;
|
|
194
|
+
}, z.core.$strip>>;
|
|
195
|
+
}, z.core.$strip>;
|
|
196
|
+
export type VaultStatsResponse = z.infer<typeof VaultStatsResponse>;
|
|
197
|
+
export declare const VaultOverviewResponse: z.ZodObject<{
|
|
198
|
+
items: z.ZodArray<z.ZodObject<{
|
|
199
|
+
vaultAddress: z.ZodPipe<z.ZodString, z.ZodTransform<EthereumAddress, string>>;
|
|
200
|
+
agentAddress: z.ZodPipe<z.ZodString, z.ZodTransform<EthereumAddress, string>>;
|
|
201
|
+
leaderAddress: z.ZodPipe<z.ZodString, z.ZodTransform<EthereumAddress, string>>;
|
|
202
|
+
name: z.ZodNullable<z.ZodString>;
|
|
203
|
+
imageUrl: z.ZodNullable<z.ZodString>;
|
|
204
|
+
latest: z.ZodNullable<z.ZodObject<{
|
|
205
|
+
tvl: z.ZodString;
|
|
206
|
+
sharePrice: z.ZodString;
|
|
207
|
+
accountValue: z.ZodNullable<z.ZodString>;
|
|
208
|
+
openInterest: z.ZodNullable<z.ZodString>;
|
|
209
|
+
unrealizedPnl: z.ZodNullable<z.ZodString>;
|
|
210
|
+
cumulativeRealizedPnl: z.ZodNullable<z.ZodString>;
|
|
211
|
+
investorCount: z.ZodNumber;
|
|
212
|
+
createdAt: z.ZodString;
|
|
213
|
+
}, z.core.$strip>>;
|
|
214
|
+
sparkline: z.ZodArray<z.ZodObject<{
|
|
215
|
+
timestamp: z.ZodNumber;
|
|
216
|
+
createdAt: z.ZodString;
|
|
217
|
+
tvl: z.ZodString;
|
|
218
|
+
sharePrice: z.ZodString;
|
|
219
|
+
}, z.core.$strip>>;
|
|
220
|
+
}, z.core.$strip>>;
|
|
221
|
+
page: z.ZodNumber;
|
|
222
|
+
pageSize: z.ZodNumber;
|
|
223
|
+
total: z.ZodNumber;
|
|
224
|
+
}, z.core.$strip>;
|
|
225
|
+
export type VaultOverviewResponse = z.infer<typeof VaultOverviewResponse>;
|
|
226
|
+
export declare const VaultInvestmentsResponse: z.ZodObject<{
|
|
227
|
+
totals: z.ZodObject<{
|
|
228
|
+
totalInvested: z.ZodNumber;
|
|
229
|
+
totalCurrentValue: z.ZodNumber;
|
|
230
|
+
totalPnl: z.ZodNumber;
|
|
231
|
+
totalUnrealizedPnl: z.ZodNumber;
|
|
232
|
+
}, z.core.$strip>;
|
|
233
|
+
investments: z.ZodArray<z.ZodObject<{
|
|
234
|
+
vaultAddress: z.ZodPipe<z.ZodString, z.ZodTransform<EthereumAddress, string>>;
|
|
235
|
+
name: z.ZodNullable<z.ZodString>;
|
|
236
|
+
imageUrl: z.ZodNullable<z.ZodString>;
|
|
237
|
+
isLeader: z.ZodBoolean;
|
|
238
|
+
depositAmount: z.ZodString;
|
|
239
|
+
currentValue: z.ZodString;
|
|
240
|
+
allTimePnl: z.ZodNumber;
|
|
241
|
+
unrealizedPnl: z.ZodNumber;
|
|
242
|
+
shares: z.ZodString;
|
|
243
|
+
}, z.core.$strip>>;
|
|
244
|
+
partial: z.ZodBoolean;
|
|
245
|
+
failedVaults: z.ZodArray<z.ZodObject<{
|
|
246
|
+
vaultAddress: z.ZodPipe<z.ZodString, z.ZodTransform<EthereumAddress, string>>;
|
|
247
|
+
name: z.ZodNullable<z.ZodString>;
|
|
248
|
+
reason: z.ZodString;
|
|
249
|
+
}, z.core.$strip>>;
|
|
250
|
+
}, z.core.$strip>;
|
|
251
|
+
export type VaultInvestmentsResponse = z.infer<typeof VaultInvestmentsResponse>;
|
|
252
|
+
export declare const ActivityResponse: z.ZodObject<{
|
|
253
|
+
vaultAddress: z.ZodString;
|
|
254
|
+
activity: z.ZodArray<z.ZodObject<{
|
|
255
|
+
id: z.ZodString;
|
|
256
|
+
vaultAddress: z.ZodOptional<z.ZodString>;
|
|
257
|
+
type: z.ZodEnum<{
|
|
258
|
+
"vault.create": "vault.create";
|
|
259
|
+
"vault.set_trader": "vault.set_trader";
|
|
260
|
+
"vault.update_metadata": "vault.update_metadata";
|
|
261
|
+
"bridge.withdraw_to_evm": "bridge.withdraw_to_evm";
|
|
262
|
+
}>;
|
|
263
|
+
status: z.ZodEnum<{
|
|
264
|
+
failed: "failed";
|
|
265
|
+
pending: "pending";
|
|
266
|
+
succeeded: "succeeded";
|
|
267
|
+
}>;
|
|
268
|
+
txHash: z.ZodOptional<z.ZodString>;
|
|
269
|
+
error: z.ZodOptional<z.ZodString>;
|
|
270
|
+
createdAt: z.ZodISODateTime;
|
|
271
|
+
updatedAt: z.ZodISODateTime;
|
|
272
|
+
}, z.core.$strip>>;
|
|
273
|
+
}, z.core.$strip>;
|
|
274
|
+
export type ActivityResponse = z.output<typeof ActivityResponse>;
|
|
275
|
+
export declare const ActivityItemResponse: z.ZodObject<{
|
|
276
|
+
activity: z.ZodObject<{
|
|
277
|
+
id: z.ZodString;
|
|
278
|
+
vaultAddress: z.ZodOptional<z.ZodString>;
|
|
279
|
+
type: z.ZodEnum<{
|
|
280
|
+
"vault.create": "vault.create";
|
|
281
|
+
"vault.set_trader": "vault.set_trader";
|
|
282
|
+
"vault.update_metadata": "vault.update_metadata";
|
|
283
|
+
"bridge.withdraw_to_evm": "bridge.withdraw_to_evm";
|
|
284
|
+
}>;
|
|
285
|
+
status: z.ZodEnum<{
|
|
286
|
+
failed: "failed";
|
|
287
|
+
pending: "pending";
|
|
288
|
+
succeeded: "succeeded";
|
|
289
|
+
}>;
|
|
290
|
+
txHash: z.ZodOptional<z.ZodString>;
|
|
291
|
+
error: z.ZodOptional<z.ZodString>;
|
|
292
|
+
createdAt: z.ZodISODateTime;
|
|
293
|
+
updatedAt: z.ZodISODateTime;
|
|
294
|
+
}, z.core.$strip>;
|
|
295
|
+
}, z.core.$strip>;
|
|
296
|
+
export type ActivityItemResponse = z.output<typeof ActivityItemResponse>;
|
|
297
|
+
export declare const AgentBalancesResponse: z.ZodObject<{
|
|
298
|
+
agentAddress: z.ZodString;
|
|
299
|
+
spot: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
300
|
+
perp: z.ZodObject<{
|
|
301
|
+
accountValue: z.ZodString;
|
|
302
|
+
withdrawable: z.ZodString;
|
|
303
|
+
}, z.core.$strip>;
|
|
304
|
+
}, z.core.$strip>;
|
|
305
|
+
export type AgentBalancesResponse = z.infer<typeof AgentBalancesResponse>;
|
|
306
|
+
/** Bare agent-approve outcome: the service returns exactly this union. */
|
|
307
|
+
export declare const AgentApproveResult: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
308
|
+
success: z.ZodLiteral<true>;
|
|
309
|
+
transactionHash: z.ZodString;
|
|
310
|
+
tokenAddress: z.ZodString;
|
|
311
|
+
spender: z.ZodString;
|
|
312
|
+
amount: z.ZodString;
|
|
313
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
314
|
+
success: z.ZodLiteral<false>;
|
|
315
|
+
status: z.ZodLiteral<"already_approved">;
|
|
316
|
+
tokenAddress: z.ZodString;
|
|
317
|
+
spender: z.ZodString;
|
|
318
|
+
allowance: z.ZodString;
|
|
319
|
+
}, z.core.$strip>], "success">;
|
|
320
|
+
export type AgentApproveResult = z.output<typeof AgentApproveResult>;
|
|
321
|
+
/** Wire envelope: the union sits under `result` so the route can carry a DTO. */
|
|
322
|
+
export declare const AgentApproveResponse: z.ZodObject<{
|
|
323
|
+
result: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
324
|
+
success: z.ZodLiteral<true>;
|
|
325
|
+
transactionHash: z.ZodString;
|
|
326
|
+
tokenAddress: z.ZodString;
|
|
327
|
+
spender: z.ZodString;
|
|
328
|
+
amount: z.ZodString;
|
|
329
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
330
|
+
success: z.ZodLiteral<false>;
|
|
331
|
+
status: z.ZodLiteral<"already_approved">;
|
|
332
|
+
tokenAddress: z.ZodString;
|
|
333
|
+
spender: z.ZodString;
|
|
334
|
+
allowance: z.ZodString;
|
|
335
|
+
}, z.core.$strip>], "success">;
|
|
336
|
+
}, z.core.$strip>;
|
|
337
|
+
export type AgentApproveResponse = z.output<typeof AgentApproveResponse>;
|
|
338
|
+
export declare const UnifiedAccountResponse: z.ZodObject<{
|
|
339
|
+
success: z.ZodBoolean;
|
|
340
|
+
agentAddress: z.ZodString;
|
|
341
|
+
}, z.core.$strip>;
|
|
342
|
+
export type UnifiedAccountResponse = z.infer<typeof UnifiedAccountResponse>;
|
|
343
|
+
export declare const NavRangeResponse: z.ZodObject<{
|
|
344
|
+
points: z.ZodArray<z.ZodObject<{
|
|
345
|
+
bucket: z.ZodISODateTime;
|
|
346
|
+
totalAssets: z.ZodString;
|
|
347
|
+
totalSupply: z.ZodString;
|
|
348
|
+
sharePrice: z.ZodString;
|
|
349
|
+
blockNumber: z.ZodString;
|
|
350
|
+
}, z.core.$strip>>;
|
|
351
|
+
}, z.core.$strip>;
|
|
352
|
+
export type NavRangeResponse = z.infer<typeof NavRangeResponse>;
|
|
353
|
+
export declare const NavStatsResponse: z.ZodObject<{
|
|
354
|
+
window: z.ZodEnum<{
|
|
355
|
+
"24h": "24h";
|
|
356
|
+
"7d": "7d";
|
|
357
|
+
"30d": "30d";
|
|
358
|
+
}>;
|
|
359
|
+
samples: z.ZodNumber;
|
|
360
|
+
returnPct: z.ZodNullable<z.ZodNumber>;
|
|
361
|
+
sharePriceMin: z.ZodNullable<z.ZodString>;
|
|
362
|
+
sharePriceMax: z.ZodNullable<z.ZodString>;
|
|
363
|
+
sharePriceFirst: z.ZodNullable<z.ZodString>;
|
|
364
|
+
sharePriceLast: z.ZodNullable<z.ZodString>;
|
|
365
|
+
}, z.core.$strip>;
|
|
366
|
+
export type NavStatsResponse = z.infer<typeof NavStatsResponse>;
|
|
367
|
+
export declare const NavSnapshotResponse: z.ZodObject<{
|
|
368
|
+
snapshot: z.ZodObject<{
|
|
369
|
+
vaultAddress: z.ZodPipe<z.ZodString, z.ZodTransform<EthereumAddress, string>>;
|
|
370
|
+
takenAt: z.ZodString;
|
|
371
|
+
totalAssets: z.ZodString;
|
|
372
|
+
totalSupply: z.ZodString;
|
|
373
|
+
sharePrice: z.ZodString;
|
|
374
|
+
blockNumber: z.ZodString;
|
|
375
|
+
}, z.core.$strip>;
|
|
376
|
+
}, z.core.$strip>;
|
|
377
|
+
export type NavSnapshotResponse = z.infer<typeof NavSnapshotResponse>;
|
|
378
|
+
/** Bare withdraw outcome: the service persists and replays exactly this union. */
|
|
379
|
+
export declare const WithdrawToEvmResult: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
380
|
+
success: z.ZodLiteral<true>;
|
|
381
|
+
amount: z.ZodString;
|
|
382
|
+
token: z.ZodString;
|
|
383
|
+
tokenId: z.ZodString;
|
|
384
|
+
destination: z.ZodString;
|
|
385
|
+
vaultAddress: z.ZodString;
|
|
386
|
+
activityId: z.ZodString;
|
|
387
|
+
bridgeStatus: z.ZodString;
|
|
388
|
+
bridgeSettleMs: z.ZodNumber;
|
|
389
|
+
transferTxHash: z.ZodString;
|
|
390
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
391
|
+
success: z.ZodLiteral<false>;
|
|
392
|
+
status: z.ZodLiteral<"in_progress">;
|
|
393
|
+
amount: z.ZodString;
|
|
394
|
+
token: z.ZodString;
|
|
395
|
+
tokenId: z.ZodString;
|
|
396
|
+
destination: z.ZodString;
|
|
397
|
+
vaultAddress: z.ZodString;
|
|
398
|
+
activityId: z.ZodString;
|
|
399
|
+
}, z.core.$strip>], "success">;
|
|
400
|
+
export type WithdrawToEvmResult = z.output<typeof WithdrawToEvmResult>;
|
|
401
|
+
/** Wire envelope: the union sits under `result` so the route can carry a DTO. */
|
|
402
|
+
export declare const WithdrawToEvmResponse: z.ZodObject<{
|
|
403
|
+
result: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
404
|
+
success: z.ZodLiteral<true>;
|
|
405
|
+
amount: z.ZodString;
|
|
406
|
+
token: z.ZodString;
|
|
407
|
+
tokenId: z.ZodString;
|
|
408
|
+
destination: z.ZodString;
|
|
409
|
+
vaultAddress: z.ZodString;
|
|
410
|
+
activityId: z.ZodString;
|
|
411
|
+
bridgeStatus: z.ZodString;
|
|
412
|
+
bridgeSettleMs: z.ZodNumber;
|
|
413
|
+
transferTxHash: z.ZodString;
|
|
414
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
415
|
+
success: z.ZodLiteral<false>;
|
|
416
|
+
status: z.ZodLiteral<"in_progress">;
|
|
417
|
+
amount: z.ZodString;
|
|
418
|
+
token: z.ZodString;
|
|
419
|
+
tokenId: z.ZodString;
|
|
420
|
+
destination: z.ZodString;
|
|
421
|
+
vaultAddress: z.ZodString;
|
|
422
|
+
activityId: z.ZodString;
|
|
423
|
+
}, z.core.$strip>], "success">;
|
|
424
|
+
}, z.core.$strip>;
|
|
425
|
+
export type WithdrawToEvmResponse = z.output<typeof WithdrawToEvmResponse>;
|
|
426
|
+
export declare const VaultEventListResponse: z.ZodObject<{
|
|
427
|
+
events: z.ZodArray<z.ZodObject<{
|
|
428
|
+
id: z.ZodString;
|
|
429
|
+
vaultAddress: z.ZodPipe<z.ZodString, z.ZodTransform<EthereumAddress, string>>;
|
|
430
|
+
eventType: z.ZodEnum<{
|
|
431
|
+
DEPOSIT: "DEPOSIT";
|
|
432
|
+
WITHDRAWAL: "WITHDRAWAL";
|
|
433
|
+
}>;
|
|
434
|
+
userAddress: z.ZodPipe<z.ZodString, z.ZodTransform<EthereumAddress, string>>;
|
|
435
|
+
receiver: z.ZodPipe<z.ZodString, z.ZodTransform<EthereumAddress, string>>;
|
|
436
|
+
assets: z.ZodString;
|
|
437
|
+
shares: z.ZodString;
|
|
438
|
+
fee: z.ZodString;
|
|
439
|
+
withdrawalId: z.ZodNullable<z.ZodString>;
|
|
440
|
+
txHash: z.ZodString;
|
|
441
|
+
blockNumber: z.ZodString;
|
|
442
|
+
logIndex: z.ZodNumber;
|
|
443
|
+
createdAt: z.ZodString;
|
|
444
|
+
}, z.core.$strip>>;
|
|
445
|
+
}, z.core.$strip>;
|
|
446
|
+
export type VaultEventListResponse = z.infer<typeof VaultEventListResponse>;
|
|
447
|
+
/** One flattened request-validation problem, mirroring the service's zod-issue formatter. */
|
|
448
|
+
export declare const VaultRequestIssue: z.ZodObject<{
|
|
449
|
+
path: z.ZodString;
|
|
450
|
+
message: z.ZodString;
|
|
451
|
+
code: z.ZodString;
|
|
452
|
+
}, z.core.$strip>;
|
|
453
|
+
export type VaultRequestIssue = z.infer<typeof VaultRequestIssue>;
|
|
454
|
+
/**
|
|
455
|
+
* Every error body the vault service emits, discriminated on `error`.
|
|
456
|
+
* A client switches exhaustively on the tag; the compiler knows the fields per branch.
|
|
457
|
+
* `activityId` (keccak of the caller's signature) appears only on ambiguous
|
|
458
|
+
* post-dispatch failures and the bridge family — pre-dispatch refusals omit it
|
|
459
|
+
* because the caller can derive it from its own signature.
|
|
460
|
+
*/
|
|
461
|
+
export declare const VaultServiceError: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
462
|
+
error: z.ZodLiteral<"UNAUTHORIZED">;
|
|
463
|
+
reason: z.ZodString;
|
|
464
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
465
|
+
error: z.ZodLiteral<"NOT_OWNER">;
|
|
466
|
+
vaultAddress: z.ZodString;
|
|
467
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
468
|
+
error: z.ZodLiteral<"INVALID_REQUEST">;
|
|
469
|
+
issues: z.ZodArray<z.ZodObject<{
|
|
470
|
+
path: z.ZodString;
|
|
471
|
+
message: z.ZodString;
|
|
472
|
+
code: z.ZodString;
|
|
473
|
+
}, z.core.$strip>>;
|
|
474
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
475
|
+
error: z.ZodLiteral<"VAULT_NOT_FOUND">;
|
|
476
|
+
vaultAddress: z.ZodString;
|
|
477
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
478
|
+
error: z.ZodLiteral<"VAULT_TRADE_ACCOUNT_UNAVAILABLE">;
|
|
479
|
+
vaultAddress: z.ZodString;
|
|
480
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
481
|
+
error: z.ZodLiteral<"ACTIVITY_NOT_FOUND">;
|
|
482
|
+
activityId: z.ZodString;
|
|
483
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
484
|
+
error: z.ZodLiteral<"NAV_UNAVAILABLE">;
|
|
485
|
+
vaultAddress: z.ZodString;
|
|
486
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
487
|
+
error: z.ZodLiteral<"RATE_LIMITED">;
|
|
488
|
+
reason: z.ZodString;
|
|
489
|
+
retryAfterSeconds: z.ZodNumber;
|
|
490
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
491
|
+
error: z.ZodLiteral<"VAULT_CREATE_CEILING">;
|
|
492
|
+
retryAfterSeconds: z.ZodNumber;
|
|
493
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
494
|
+
error: z.ZodLiteral<"HL_SET_ABSTRACTION_FAILED">;
|
|
495
|
+
incidentId: z.ZodString;
|
|
496
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
497
|
+
error: z.ZodLiteral<"EVM_OPERATION_FAILED">;
|
|
498
|
+
vaultAddress: z.ZodString;
|
|
499
|
+
reason: z.ZodString;
|
|
500
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
501
|
+
error: z.ZodLiteral<"HL_APPROVE_AGENT_FAILED">;
|
|
502
|
+
vaultAddress: z.ZodString;
|
|
503
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
504
|
+
error: z.ZodLiteral<"DEPLOYER_NOT_WHITELISTED">;
|
|
505
|
+
details: z.ZodOptional<z.ZodString>;
|
|
506
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
507
|
+
error: z.ZodLiteral<"INVALID_CONFIG">;
|
|
508
|
+
details: z.ZodOptional<z.ZodString>;
|
|
509
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
510
|
+
error: z.ZodLiteral<"CONFIG_DISABLED">;
|
|
511
|
+
details: z.ZodOptional<z.ZodString>;
|
|
512
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
513
|
+
error: z.ZodLiteral<"AGENT_ALREADY_ASSIGNED">;
|
|
514
|
+
details: z.ZodOptional<z.ZodString>;
|
|
515
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
516
|
+
error: z.ZodLiteral<"EMPTY_NAME">;
|
|
517
|
+
details: z.ZodOptional<z.ZodString>;
|
|
518
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
519
|
+
error: z.ZodLiteral<"INVALID_ADDRESS">;
|
|
520
|
+
details: z.ZodOptional<z.ZodString>;
|
|
521
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
522
|
+
error: z.ZodLiteral<"DEPLOY_REVERTED">;
|
|
523
|
+
details: z.ZodOptional<z.ZodString>;
|
|
524
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
525
|
+
error: z.ZodLiteral<"VAULT_EVENT_MISSING">;
|
|
526
|
+
details: z.ZodOptional<z.ZodString>;
|
|
527
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
528
|
+
error: z.ZodLiteral<"DEPLOYER_INSUFFICIENT_FUNDS">;
|
|
529
|
+
details: z.ZodOptional<z.ZodString>;
|
|
530
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
531
|
+
error: z.ZodLiteral<"CREATE_VAULT_OPERATION_FAILED">;
|
|
532
|
+
activityId: z.ZodString;
|
|
533
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
534
|
+
error: z.ZodLiteral<"SET_TRADER_OPERATION_FAILED">;
|
|
535
|
+
activityId: z.ZodString;
|
|
536
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
537
|
+
error: z.ZodLiteral<"UPDATE_METADATA_OPERATION_FAILED">;
|
|
538
|
+
activityId: z.ZodString;
|
|
539
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
540
|
+
error: z.ZodLiteral<"VAULT_NOT_FOUND_AFTER_SET_TRADER">;
|
|
541
|
+
activityId: z.ZodString;
|
|
542
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
543
|
+
error: z.ZodLiteral<"UNSUPPORTED_TOKEN">;
|
|
544
|
+
reason: z.ZodString;
|
|
545
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
546
|
+
error: z.ZodLiteral<"WITHDRAW_IN_PROGRESS">;
|
|
547
|
+
activityId: z.ZodString;
|
|
548
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
549
|
+
error: z.ZodLiteral<"BRIDGE_OPERATION_FAILED">;
|
|
550
|
+
activityId: z.ZodString;
|
|
551
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
552
|
+
error: z.ZodLiteral<"BRIDGE_SEND_REJECTED">;
|
|
553
|
+
activityId: z.ZodString;
|
|
554
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
555
|
+
error: z.ZodLiteral<"BRIDGE_VAULT_NOT_FOUND">;
|
|
556
|
+
activityId: z.ZodString;
|
|
557
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
558
|
+
error: z.ZodLiteral<"BRIDGE_INVALID_AMOUNT">;
|
|
559
|
+
activityId: z.ZodString;
|
|
560
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
561
|
+
error: z.ZodLiteral<"BRIDGE_NONCE_EXPIRED">;
|
|
562
|
+
activityId: z.ZodString;
|
|
563
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
564
|
+
error: z.ZodLiteral<"CUSTODY_REFUSED">;
|
|
565
|
+
details: z.ZodOptional<z.ZodString>;
|
|
566
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
567
|
+
error: z.ZodLiteral<"SET_TRADER_CUSTODY_REFUSED">;
|
|
568
|
+
vaultAddress: z.ZodString;
|
|
569
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
570
|
+
error: z.ZodLiteral<"BRIDGE_CUSTODY_REFUSED">;
|
|
571
|
+
activityId: z.ZodString;
|
|
572
|
+
}, z.core.$strip>], "error">;
|
|
573
|
+
export type VaultServiceError = z.infer<typeof VaultServiceError>;
|
|
574
|
+
export type VaultServiceErrorCode = VaultServiceError['error'];
|