@pear-protocol/types 2.7.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.
Files changed (37) hide show
  1. package/dist/bundle.d.ts +1 -0
  2. package/dist/bundle.js +1 -0
  3. package/dist/common/address.d.ts +8 -2
  4. package/dist/common/trade-legs.d.ts +33 -0
  5. package/dist/common/trade-legs.js +12 -1
  6. package/dist/execution/entities.d.ts +107 -0
  7. package/dist/execution/entities.js +25 -2
  8. package/dist/execution/responses.d.ts +62 -0
  9. package/dist/ladder/entities.d.ts +10 -10
  10. package/dist/ladder/responses.d.ts +30 -30
  11. package/dist/position/responses.d.ts +3 -2
  12. package/dist/sync/payloads.d.ts +11 -0
  13. package/dist/sync/payloads.js +6 -2
  14. package/dist/sync/responses.d.ts +1 -0
  15. package/dist/sync/responses.js +8 -1
  16. package/dist/trade/payloads.d.ts +28 -74
  17. package/dist/trade/payloads.js +17 -21
  18. package/dist/trade/responses.d.ts +155 -9
  19. package/dist/trade/responses.js +1 -9
  20. package/dist/trade-accounts/payloads.d.ts +14 -13
  21. package/dist/trigger/common/index.d.ts +1 -1
  22. package/dist/trigger/entities/index.d.ts +32 -32
  23. package/dist/trigger/payloads/index.d.ts +6 -6
  24. package/dist/trigger/responses.d.ts +20 -20
  25. package/dist/users/entities.d.ts +5 -4
  26. package/dist/users/response.d.ts +2 -2
  27. package/dist/vaults/entities.d.ts +111 -0
  28. package/dist/vaults/entities.js +96 -0
  29. package/dist/vaults/index.d.ts +4 -0
  30. package/dist/vaults/index.js +4 -0
  31. package/dist/vaults/payloads.d.ts +140 -0
  32. package/dist/vaults/payloads.js +65 -0
  33. package/dist/vaults/queries.d.ts +96 -0
  34. package/dist/vaults/queries.js +66 -0
  35. package/dist/vaults/responses.d.ts +574 -0
  36. package/dist/vaults/responses.js +359 -0
  37. package/package.json +1 -1
@@ -0,0 +1,96 @@
1
+ import { z } from 'zod';
2
+ import { EthereumAddress } from '../common/address';
3
+
4
+ const VaultStatus = z.enum([
5
+ "active",
6
+ "inactive",
7
+ "pending_activation"
8
+ ]);
9
+ const Vault = z.object({
10
+ id: z.string().uuid(),
11
+ vaultAddress: EthereumAddress,
12
+ ownerAddress: EthereumAddress,
13
+ traderAddress: EthereumAddress.nullable(),
14
+ agentAddress: EthereumAddress,
15
+ status: VaultStatus,
16
+ isApproved: z.boolean(),
17
+ name: z.string().nullable(),
18
+ about: z.string().nullable(),
19
+ imageUrl: z.string().nullable(),
20
+ transactionHash: z.string().nullable(),
21
+ maxWithdrawalPeriodDays: z.number().int(),
22
+ createdAt: z.string().datetime(),
23
+ updatedAt: z.string().datetime()
24
+ });
25
+ const Activity = z.object({
26
+ id: z.string(),
27
+ // Absent columns drop off the wire entirely rather than shipping as present nulls.
28
+ vaultAddress: z.string().optional(),
29
+ // Mirrors the vault_activity_type Postgres enum; duplicated literally because the SDK cannot import the database package.
30
+ type: z.enum([
31
+ "vault.create",
32
+ "vault.set_trader",
33
+ "vault.update_metadata",
34
+ "bridge.withdraw_to_evm"
35
+ ]),
36
+ status: z.enum([
37
+ "pending",
38
+ "succeeded",
39
+ "failed"
40
+ ]),
41
+ txHash: z.string().optional(),
42
+ error: z.string().optional(),
43
+ createdAt: z.iso.datetime(),
44
+ updatedAt: z.iso.datetime()
45
+ });
46
+ const VaultEvent = z.object({
47
+ id: z.string(),
48
+ vaultAddress: EthereumAddress,
49
+ eventType: z.enum([
50
+ "DEPOSIT",
51
+ "WITHDRAWAL"
52
+ ]),
53
+ userAddress: EthereumAddress,
54
+ receiver: EthereumAddress,
55
+ assets: z.string(),
56
+ shares: z.string(),
57
+ fee: z.string(),
58
+ withdrawalId: z.string().nullable(),
59
+ txHash: z.string(),
60
+ blockNumber: z.string(),
61
+ logIndex: z.number().int(),
62
+ createdAt: z.string().datetime()
63
+ });
64
+ const NavSnapshot = z.object({
65
+ vaultAddress: EthereumAddress,
66
+ takenAt: z.string().datetime(),
67
+ totalAssets: z.string(),
68
+ totalSupply: z.string(),
69
+ sharePrice: z.string(),
70
+ blockNumber: z.string()
71
+ });
72
+ const NavBucketPoint = z.object({
73
+ bucket: z.iso.datetime(),
74
+ totalAssets: z.string(),
75
+ totalSupply: z.string(),
76
+ sharePrice: z.string(),
77
+ blockNumber: z.string()
78
+ });
79
+ const BulkSnapshotPoint = z.object({
80
+ timestamp: z.number(),
81
+ createdAt: z.string(),
82
+ tvl: z.string().optional(),
83
+ sharePrice: z.string().optional(),
84
+ accountValue: z.null().optional(),
85
+ unrealizedPnl: z.null().optional(),
86
+ cumulativeRealizedPnl: z.null().optional(),
87
+ leaderSharePct: z.null().optional()
88
+ });
89
+ const SparklinePoint = z.object({
90
+ timestamp: z.number(),
91
+ createdAt: z.string(),
92
+ tvl: z.string(),
93
+ sharePrice: z.string()
94
+ });
95
+
96
+ export { Activity, BulkSnapshotPoint, NavBucketPoint, NavSnapshot, SparklinePoint, Vault, VaultEvent, VaultStatus };
@@ -0,0 +1,4 @@
1
+ export * from './entities';
2
+ export * from './payloads';
3
+ export * from './queries';
4
+ export * from './responses';
@@ -0,0 +1,4 @@
1
+ export * from './entities';
2
+ export * from './payloads';
3
+ export * from './queries';
4
+ export * from './responses';
@@ -0,0 +1,140 @@
1
+ import { z } from 'zod';
2
+ import { EthereumAddress } from '../common/address';
3
+ /** Positive decimal amount string, e.g. an withdrawal or approval size. */
4
+ export declare const PositiveAmount: z.ZodString;
5
+ /**
6
+ * Plane-2 leader-signature envelope carried by every leader-signed POST. LeaderSignatureGuard reads
7
+ * these fields from the raw body to recover the signer; replay defense is Restate idempotency keyed
8
+ * on the signature, and the client-minted nonce keeps two legitimate identical actions apart. The envelope carries
9
+ * auth only; every action-specific parameter is declared on the action's own schema and signed as a
10
+ * readable field of that action's own EIP-712 struct — the primary-type name discriminates the action.
11
+ */
12
+ export declare const LeaderSignedAction: z.ZodObject<{
13
+ signature: z.ZodString;
14
+ nonce: z.ZodString;
15
+ deadline: z.ZodNumber;
16
+ }, z.core.$strip>;
17
+ /**
18
+ * Create is leader self-signed: the body extends the Plane-2 envelope so
19
+ * CreateSignatureGuard can recover the signer. Every create field is a readable
20
+ * field of the signed CreateVault struct.
21
+ */
22
+ export declare const CreateVault: z.ZodObject<{
23
+ signature: z.ZodString;
24
+ nonce: z.ZodString;
25
+ deadline: z.ZodNumber;
26
+ leader: z.ZodPipe<z.ZodString, z.ZodTransform<EthereumAddress, string>>;
27
+ name: z.ZodString;
28
+ description: z.ZodString;
29
+ imageUri: z.ZodOptional<z.ZodURL>;
30
+ configId: z.ZodNumber;
31
+ maxWithdrawalPeriodDays: z.ZodOptional<z.ZodNumber>;
32
+ }, z.core.$strict>;
33
+ export type CreateVaultInput = z.input<typeof CreateVault>;
34
+ export type CreateVault = z.infer<typeof CreateVault>;
35
+ /**
36
+ * Set-trader is leader-signed: the body extends the Plane-2 envelope so
37
+ * LeaderSignatureGuard can recover the signer and enforce the deadline.
38
+ * The `traderAddress` is a readable field of the signed SetTrader struct.
39
+ */
40
+ export declare const SetTrader: z.ZodObject<{
41
+ signature: z.ZodString;
42
+ nonce: z.ZodString;
43
+ deadline: z.ZodNumber;
44
+ traderAddress: z.ZodPipe<z.ZodString, z.ZodTransform<EthereumAddress, string>>;
45
+ }, z.core.$strict>;
46
+ export type SetTraderInput = z.input<typeof SetTrader>;
47
+ export type SetTrader = z.infer<typeof SetTrader>;
48
+ /**
49
+ * Update-metadata is leader-signed: the body extends the Plane-2 envelope so
50
+ * LeaderSignatureGuard can recover the signer and enforce the deadline. The
51
+ * contract is the full display set — every field is sent and signed as a
52
+ * readable field of the UpdateVaultMetadata struct, because EIP-712 cannot
53
+ * express an omitted field. An empty string clears the optional columns.
54
+ */
55
+ export declare const UpdateVaultMetadata: z.ZodObject<{
56
+ signature: z.ZodString;
57
+ nonce: z.ZodString;
58
+ deadline: z.ZodNumber;
59
+ name: z.ZodString;
60
+ about: z.ZodString;
61
+ imageUri: z.ZodUnion<readonly [z.ZodURL, z.ZodLiteral<"">]>;
62
+ }, z.core.$strict>;
63
+ export type UpdateVaultMetadataInput = z.input<typeof UpdateVaultMetadata>;
64
+ export type UpdateVaultMetadata = z.infer<typeof UpdateVaultMetadata>;
65
+ export declare const WithdrawToEvm: z.ZodObject<{
66
+ signature: z.ZodString;
67
+ nonce: z.ZodString;
68
+ deadline: z.ZodNumber;
69
+ amount: z.ZodString;
70
+ tokenId: z.ZodOptional<z.ZodString>;
71
+ }, z.core.$strict>;
72
+ export type WithdrawToEvmInput = z.input<typeof WithdrawToEvm>;
73
+ export type WithdrawToEvm = z.infer<typeof WithdrawToEvm>;
74
+ /**
75
+ * Agent-approve is leader-signed: the body carries only the Plane-2 envelope.
76
+ * The execution is fixed — maxUint256 on the vault's own asset — so there are no
77
+ * variable params to sign beyond the envelope; the primary-type name binds the action.
78
+ */
79
+ export declare const AgentApprove: z.ZodObject<{
80
+ signature: z.ZodString;
81
+ nonce: z.ZodString;
82
+ deadline: z.ZodNumber;
83
+ }, z.core.$strict>;
84
+ export type AgentApproveInput = z.input<typeof AgentApprove>;
85
+ export type AgentApprove = z.infer<typeof AgentApprove>;
86
+ /**
87
+ * Set-unified-account is leader-signed: the body carries only the Plane-2 envelope.
88
+ * The execution is fixed — the vault's own agent — so there are no variable
89
+ * params to sign beyond the envelope; the primary-type name binds the action.
90
+ */
91
+ export declare const SetUnifiedAccount: z.ZodObject<{
92
+ signature: z.ZodString;
93
+ nonce: z.ZodString;
94
+ deadline: z.ZodNumber;
95
+ }, z.core.$strict>;
96
+ export type SetUnifiedAccountInput = z.input<typeof SetUnifiedAccount>;
97
+ export type SetUnifiedAccount = z.infer<typeof SetUnifiedAccount>;
98
+ /** Builder-fee approval carried by the vault account provisioning workflow. */
99
+ export declare const BuilderFeeApproval: z.ZodObject<{
100
+ builderAddress: z.ZodPipe<z.ZodString, z.ZodTransform<EthereumAddress, string>>;
101
+ maxFeeRate: z.ZodCustom<`${string}%`, `${string}%`>;
102
+ }, z.core.$strip>;
103
+ export type BuilderFeeApproval = z.infer<typeof BuilderFeeApproval>;
104
+ export declare const SnapshotsBulk: z.ZodObject<{
105
+ vaultAddresses: z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<EthereumAddress, string>>>;
106
+ startDate: z.ZodString;
107
+ endDate: z.ZodString;
108
+ bucket: z.ZodEnum<{
109
+ "1d": "1d";
110
+ "1m": "1m";
111
+ "1h": "1h";
112
+ "5m": "5m";
113
+ "15m": "15m";
114
+ }>;
115
+ fields: z.ZodArray<z.ZodEnum<{
116
+ unrealizedPnl: "unrealizedPnl";
117
+ sharePrice: "sharePrice";
118
+ tvl: "tvl";
119
+ accountValue: "accountValue";
120
+ cumulativeRealizedPnl: "cumulativeRealizedPnl";
121
+ leaderSharePct: "leaderSharePct";
122
+ }>>;
123
+ }, z.core.$strict>;
124
+ export type SnapshotsBulkInput = z.input<typeof SnapshotsBulk>;
125
+ export type SnapshotsBulk = z.infer<typeof SnapshotsBulk>;
126
+ /**
127
+ * EIP-712 typed data envelope, in the shape the JSON-RPC `eth_signTypedData_v4`
128
+ * (and Privy's `signTypedData`) expects. Built inside the service from admitted
129
+ * actions; never accepted as a caller-supplied signing envelope.
130
+ */
131
+ export declare const TypedDataPayload: z.ZodObject<{
132
+ domain: z.ZodRecord<z.ZodString, z.ZodUnknown>;
133
+ types: z.ZodRecord<z.ZodString, z.ZodArray<z.ZodObject<{
134
+ name: z.ZodString;
135
+ type: z.ZodString;
136
+ }, z.core.$strip>>>;
137
+ primaryType: z.ZodString;
138
+ message: z.ZodRecord<z.ZodString, z.ZodUnknown>;
139
+ }, z.core.$strict>;
140
+ export type TypedDataPayload = z.infer<typeof TypedDataPayload>;
@@ -0,0 +1,65 @@
1
+ import { z } from 'zod';
2
+ import { EthereumAddress } from '../common/address';
3
+ import { NavBucket } from './queries';
4
+
5
+ const PositiveAmount = z.string().regex(/^\d+(\.\d+)?$/).refine((amount) => /[1-9]/.test(amount), "Amount must be positive");
6
+ const LeaderSignedAction = z.object({
7
+ signature: z.string().regex(/^0x[0-9a-fA-F]{130}$/),
8
+ nonce: z.string().min(1),
9
+ deadline: z.number().int().positive()
10
+ });
11
+ const CreateVault = LeaderSignedAction.extend({
12
+ leader: EthereumAddress,
13
+ name: z.string().min(1).max(255),
14
+ description: z.string(),
15
+ imageUri: z.url().optional(),
16
+ configId: z.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER),
17
+ maxWithdrawalPeriodDays: z.number().int().min(1).optional()
18
+ }).strict();
19
+ const SetTrader = LeaderSignedAction.extend({
20
+ traderAddress: EthereumAddress
21
+ }).strict();
22
+ const UpdateVaultMetadata = LeaderSignedAction.extend({
23
+ name: z.string().min(1).max(255),
24
+ about: z.string(),
25
+ imageUri: z.union([
26
+ z.url(),
27
+ z.literal("")
28
+ ])
29
+ }).strict();
30
+ const WithdrawToEvm = LeaderSignedAction.extend({
31
+ amount: PositiveAmount.refine((amount) => (amount.split(".")[1]?.length ?? 0) <= 6, "USDC supports six decimal places"),
32
+ tokenId: z.string().optional()
33
+ }).strict();
34
+ const AgentApprove = LeaderSignedAction.strict();
35
+ const SetUnifiedAccount = LeaderSignedAction.strict();
36
+ const BuilderFeeApproval = z.object({
37
+ builderAddress: EthereumAddress,
38
+ // Typed as the percent literal Hyperliquid's SDK demands; the predicate is the same rule the regex enforced.
39
+ maxFeeRate: z.custom((value) => typeof value === "string" && /^\d*\.?\d+%$/.test(value))
40
+ });
41
+ const SnapshotsBulk = z.object({
42
+ vaultAddresses: z.array(EthereumAddress).min(1).max(50),
43
+ startDate: z.string().regex(/^\d+$/).refine((value) => Number(value) <= 864e10),
44
+ endDate: z.string().regex(/^\d+$/).refine((value) => Number(value) <= 864e10),
45
+ bucket: NavBucket,
46
+ fields: z.array(z.enum([
47
+ "tvl",
48
+ "sharePrice",
49
+ "accountValue",
50
+ "unrealizedPnl",
51
+ "cumulativeRealizedPnl",
52
+ "leaderSharePct"
53
+ ])).min(1)
54
+ }).strict().refine((value) => Number(value.startDate) <= Number(value.endDate), "startDate must precede endDate");
55
+ const TypedDataPayload = z.object({
56
+ domain: z.record(z.string(), z.unknown()),
57
+ types: z.record(z.string(), z.array(z.object({
58
+ name: z.string(),
59
+ type: z.string()
60
+ }))),
61
+ primaryType: z.string().min(1),
62
+ message: z.record(z.string(), z.unknown())
63
+ }).strict();
64
+
65
+ export { AgentApprove, BuilderFeeApproval, CreateVault, LeaderSignedAction, PositiveAmount, SetTrader, SetUnifiedAccount, SnapshotsBulk, TypedDataPayload, UpdateVaultMetadata, WithdrawToEvm };
@@ -0,0 +1,96 @@
1
+ import { z } from 'zod';
2
+ import { EthereumAddress } from '../common/address';
3
+ export declare const VaultListParams: z.ZodObject<{
4
+ owner: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<EthereumAddress, string>>>;
5
+ trader: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<EthereumAddress, string>>>;
6
+ name: z.ZodOptional<z.ZodString>;
7
+ limit: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
8
+ cursor: z.ZodOptional<z.ZodUUID>;
9
+ }, z.core.$strict>;
10
+ export type VaultListParamsInput = z.input<typeof VaultListParams>;
11
+ export type VaultListParams = z.infer<typeof VaultListParams>;
12
+ export declare const NavBucket: z.ZodEnum<{
13
+ "1d": "1d";
14
+ "1m": "1m";
15
+ "1h": "1h";
16
+ "5m": "5m";
17
+ "15m": "15m";
18
+ }>;
19
+ export type NavBucket = z.infer<typeof NavBucket>;
20
+ export declare const SparklineRange: z.ZodEnum<{
21
+ "1h": "1h";
22
+ "24h": "24h";
23
+ "7d": "7d";
24
+ "30d": "30d";
25
+ }>;
26
+ export type SparklineRange = z.infer<typeof SparklineRange>;
27
+ export declare const VaultsOverviewQueryParams: z.ZodObject<{
28
+ page: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
29
+ pageSize: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
30
+ sparklineRange: z.ZodDefault<z.ZodEnum<{
31
+ "1h": "1h";
32
+ "24h": "24h";
33
+ "7d": "7d";
34
+ "30d": "30d";
35
+ }>>;
36
+ sparklineBucket: z.ZodDefault<z.ZodEnum<{
37
+ "1d": "1d";
38
+ "1m": "1m";
39
+ "1h": "1h";
40
+ "5m": "5m";
41
+ "15m": "15m";
42
+ }>>;
43
+ name: z.ZodOptional<z.ZodString>;
44
+ }, z.core.$strict>;
45
+ export type VaultsOverviewQueryParamsInput = z.input<typeof VaultsOverviewQueryParams>;
46
+ export type VaultsOverviewQueryParams = z.output<typeof VaultsOverviewQueryParams>;
47
+ export declare const VaultStatsQueryParams: z.ZodObject<{
48
+ address: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<EthereumAddress, string>>>;
49
+ }, z.core.$strict>;
50
+ export type VaultStatsQueryParamsInput = z.input<typeof VaultStatsQueryParams>;
51
+ export type VaultStatsQueryParams = z.output<typeof VaultStatsQueryParams>;
52
+ export declare const VaultInvestmentsQueryParams: z.ZodObject<{
53
+ address: z.ZodPipe<z.ZodString, z.ZodTransform<EthereumAddress, string>>;
54
+ }, z.core.$strict>;
55
+ export type VaultInvestmentsQueryParamsInput = z.input<typeof VaultInvestmentsQueryParams>;
56
+ export type VaultInvestmentsQueryParams = z.output<typeof VaultInvestmentsQueryParams>;
57
+ export declare const NavResolution: z.ZodEnum<{
58
+ "1d": "1d";
59
+ "1m": "1m";
60
+ "1h": "1h";
61
+ "5m": "5m";
62
+ }>;
63
+ export type NavResolution = z.infer<typeof NavResolution>;
64
+ export declare const NavStatsWindow: z.ZodEnum<{
65
+ "24h": "24h";
66
+ "7d": "7d";
67
+ "30d": "30d";
68
+ }>;
69
+ export type NavStatsWindow = z.infer<typeof NavStatsWindow>;
70
+ export declare const NavRangeQueryParams: z.ZodObject<{
71
+ from: z.ZodISODateTime;
72
+ to: z.ZodISODateTime;
73
+ resolution: z.ZodDefault<z.ZodEnum<{
74
+ "1d": "1d";
75
+ "1m": "1m";
76
+ "1h": "1h";
77
+ "5m": "5m";
78
+ }>>;
79
+ }, z.core.$strict>;
80
+ export type NavRangeQueryParamsInput = z.input<typeof NavRangeQueryParams>;
81
+ export type NavRangeQueryParams = z.output<typeof NavRangeQueryParams>;
82
+ export declare const NavStatsQueryParams: z.ZodObject<{
83
+ window: z.ZodEnum<{
84
+ "24h": "24h";
85
+ "7d": "7d";
86
+ "30d": "30d";
87
+ }>;
88
+ }, z.core.$strict>;
89
+ export type NavStatsQueryParams = z.infer<typeof NavStatsQueryParams>;
90
+ export declare const VaultEventListParams: z.ZodObject<{
91
+ userAddress: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<EthereumAddress, string>>>;
92
+ limit: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
93
+ offset: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
94
+ }, z.core.$strict>;
95
+ export type VaultEventListParamsInput = z.input<typeof VaultEventListParams>;
96
+ export type VaultEventListParams = z.infer<typeof VaultEventListParams>;
@@ -0,0 +1,66 @@
1
+ import { z } from 'zod';
2
+ import { EthereumAddress } from '../common/address';
3
+
4
+ const VaultListParams = z.object({
5
+ owner: EthereumAddress.optional(),
6
+ trader: EthereumAddress.optional(),
7
+ name: z.string().max(200).optional(),
8
+ limit: z.coerce.number().int().min(1).max(200).optional(),
9
+ cursor: z.uuid().optional()
10
+ }).strict();
11
+ const NavBucket = z.enum([
12
+ "1m",
13
+ "5m",
14
+ "15m",
15
+ "1h",
16
+ "1d"
17
+ ]);
18
+ const SparklineRange = z.enum([
19
+ "1h",
20
+ "24h",
21
+ "7d",
22
+ "30d"
23
+ ]);
24
+ const VaultsOverviewQueryParams = z.object({
25
+ page: z.coerce.number().int().min(1).default(1),
26
+ pageSize: z.coerce.number().int().min(1).max(100).default(100),
27
+ sparklineRange: SparklineRange.default("24h"),
28
+ sparklineBucket: NavBucket.default("1h"),
29
+ name: z.string().optional()
30
+ }).strict();
31
+ const VaultStatsQueryParams = z.object({
32
+ address: EthereumAddress.optional()
33
+ }).strict();
34
+ const VaultInvestmentsQueryParams = z.object({
35
+ address: EthereumAddress
36
+ }).strict();
37
+ const NavResolution = z.enum([
38
+ "1m",
39
+ "5m",
40
+ "1h",
41
+ "1d"
42
+ ]);
43
+ const NavStatsWindow = z.enum([
44
+ "24h",
45
+ "7d",
46
+ "30d"
47
+ ]);
48
+ const NavRangeQueryParams = z.object({
49
+ from: z.iso.datetime({
50
+ offset: true
51
+ }),
52
+ to: z.iso.datetime({
53
+ offset: true
54
+ }),
55
+ resolution: NavResolution.default("1m")
56
+ }).strict().refine((query) => new Date(query.from) <= new Date(query.to), "from must precede to");
57
+ const NavStatsQueryParams = z.object({
58
+ window: NavStatsWindow
59
+ }).strict();
60
+ const VaultEventListParams = z.object({
61
+ userAddress: EthereumAddress.optional(),
62
+ limit: z.coerce.number().int().min(1).max(1e3).optional(),
63
+ offset: z.coerce.number().int().min(0).optional()
64
+ }).strict();
65
+
66
+ export { NavBucket, NavRangeQueryParams, NavResolution, NavStatsQueryParams, NavStatsWindow, SparklineRange, VaultEventListParams, VaultInvestmentsQueryParams, VaultListParams, VaultStatsQueryParams, VaultsOverviewQueryParams };