@pear-protocol/types 1.7.0 → 1.8.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/position/queries.d.ts +2 -0
- package/dist/position/queries.js +2 -2
- package/dist/position/responses.d.ts +2 -0
- package/dist/position/responses.js +2 -1
- package/dist/statistics/entities.d.ts +7 -0
- package/dist/statistics/entities.js +7 -1
- package/dist/statistics/queries.d.ts +11 -0
- package/dist/statistics/queries.js +4 -1
- package/dist/statistics/responses.d.ts +9 -0
- package/dist/statistics/responses.js +5 -2
- package/package.json +1 -1
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
export declare const PositionListParams: z.ZodObject<{
|
|
3
|
+
limit: z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<number>>>;
|
|
4
|
+
cursor: z.ZodOptional<z.ZodString>;
|
|
3
5
|
connector: z.ZodOptional<z.ZodEnum<{
|
|
4
6
|
hyperliquid: "hyperliquid";
|
|
5
7
|
binance: "binance";
|
package/dist/position/queries.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { normalizeArray } from '../common';
|
|
2
|
+
import { normalizeArray, CursorFindParams } from '../common';
|
|
3
3
|
import { Connector } from '../connector';
|
|
4
4
|
|
|
5
5
|
const OrderBy = z.union([
|
|
@@ -10,7 +10,7 @@ const OrderBy = z.union([
|
|
|
10
10
|
]);
|
|
11
11
|
const StatusEnum = z.enum(["OPEN", "CLOSED"]);
|
|
12
12
|
const StatusArray = z.preprocess((arg) => normalizeArray(arg), z.array(StatusEnum));
|
|
13
|
-
const PositionListParams =
|
|
13
|
+
const PositionListParams = CursorFindParams.extend({
|
|
14
14
|
/**
|
|
15
15
|
* Connector filter
|
|
16
16
|
*/
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import { CursorResponse } from '../common';
|
|
2
3
|
import { SignedDecimalString } from '../common/schema';
|
|
3
4
|
import { Connector } from '../connector';
|
|
4
5
|
import { InstrumentId } from '../instrument';
|
|
5
6
|
import { Position, PositionOrigin } from './entities';
|
|
6
7
|
|
|
7
|
-
const PositionListResponse =
|
|
8
|
+
const PositionListResponse = CursorResponse.extend({
|
|
8
9
|
positions: z.array(Position)
|
|
9
10
|
});
|
|
10
11
|
const OpenPositionLite = z.object({
|
|
@@ -14,3 +14,10 @@ export declare const OiStatistics: z.ZodObject<{
|
|
|
14
14
|
openPositions: z.ZodNumber;
|
|
15
15
|
}, z.core.$strip>;
|
|
16
16
|
export type OiStatistics = z.output<typeof OiStatistics>;
|
|
17
|
+
export declare const StatisticsTotals: z.ZodObject<{
|
|
18
|
+
totalVolume: z.ZodNumber;
|
|
19
|
+
totalFees: z.ZodNumber;
|
|
20
|
+
totalTrades: z.ZodNumber;
|
|
21
|
+
totalUsers: z.ZodNumber;
|
|
22
|
+
}, z.core.$strip>;
|
|
23
|
+
export type StatisticsTotals = z.output<typeof StatisticsTotals>;
|
|
@@ -13,5 +13,11 @@ const OiStatistics = z.object({
|
|
|
13
13
|
openInterest: z.number(),
|
|
14
14
|
openPositions: z.number()
|
|
15
15
|
});
|
|
16
|
+
const StatisticsTotals = z.object({
|
|
17
|
+
totalVolume: z.number(),
|
|
18
|
+
totalFees: z.number(),
|
|
19
|
+
totalTrades: z.number(),
|
|
20
|
+
totalUsers: z.number()
|
|
21
|
+
});
|
|
16
22
|
|
|
17
|
-
export { OiStatistics, VolumeStatistics };
|
|
23
|
+
export { OiStatistics, StatisticsTotals, VolumeStatistics };
|
|
@@ -35,3 +35,14 @@ export declare const OiStatisticsQueryParams: z.ZodObject<{
|
|
|
35
35
|
}, z.core.$strip>;
|
|
36
36
|
export type OiStatisticsQueryParamsInput = z.input<typeof OiStatisticsQueryParams>;
|
|
37
37
|
export type OiStatisticsQueryParams = z.output<typeof OiStatisticsQueryParams>;
|
|
38
|
+
export declare const StatisticsTotalsQueryParams: z.ZodObject<{
|
|
39
|
+
connector: z.ZodEnum<{
|
|
40
|
+
hyperliquid: "hyperliquid";
|
|
41
|
+
binance: "binance";
|
|
42
|
+
bybit: "bybit";
|
|
43
|
+
okx: "okx";
|
|
44
|
+
lighter: "lighter";
|
|
45
|
+
}>;
|
|
46
|
+
}, z.core.$strip>;
|
|
47
|
+
export type StatisticsTotalsQueryParamsInput = z.input<typeof StatisticsTotalsQueryParams>;
|
|
48
|
+
export type StatisticsTotalsQueryParams = z.output<typeof StatisticsTotalsQueryParams>;
|
|
@@ -17,5 +17,8 @@ const OiStatisticsQueryParams = z.object({
|
|
|
17
17
|
}).refine((data) => !data.startDate || data.startDate < data.endDate, {
|
|
18
18
|
message: "startDate must be before endDate"
|
|
19
19
|
});
|
|
20
|
+
const StatisticsTotalsQueryParams = z.object({
|
|
21
|
+
connector: Connector
|
|
22
|
+
});
|
|
20
23
|
|
|
21
|
-
export { OiStatisticsQueryParams, VolumeStatisticsQueryParams };
|
|
24
|
+
export { OiStatisticsQueryParams, StatisticsTotalsQueryParams, VolumeStatisticsQueryParams };
|
|
@@ -18,3 +18,12 @@ export declare const OiStatisticsResponse: z.ZodObject<{
|
|
|
18
18
|
}, z.core.$strip>>;
|
|
19
19
|
}, z.core.$strip>;
|
|
20
20
|
export type OiStatisticsResponse = z.output<typeof OiStatisticsResponse>;
|
|
21
|
+
export declare const StatisticsTotalsResponse: z.ZodObject<{
|
|
22
|
+
data: z.ZodObject<{
|
|
23
|
+
totalVolume: z.ZodNumber;
|
|
24
|
+
totalFees: z.ZodNumber;
|
|
25
|
+
totalTrades: z.ZodNumber;
|
|
26
|
+
totalUsers: z.ZodNumber;
|
|
27
|
+
}, z.core.$strip>;
|
|
28
|
+
}, z.core.$strip>;
|
|
29
|
+
export type StatisticsTotalsResponse = z.output<typeof StatisticsTotalsResponse>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { VolumeStatistics, OiStatistics } from './entities';
|
|
2
|
+
import { VolumeStatistics, OiStatistics, StatisticsTotals } from './entities';
|
|
3
3
|
|
|
4
4
|
const VolumeStatisticsResponse = z.object({
|
|
5
5
|
data: z.array(VolumeStatistics)
|
|
@@ -7,5 +7,8 @@ const VolumeStatisticsResponse = z.object({
|
|
|
7
7
|
const OiStatisticsResponse = z.object({
|
|
8
8
|
data: z.array(OiStatistics)
|
|
9
9
|
});
|
|
10
|
+
const StatisticsTotalsResponse = z.object({
|
|
11
|
+
data: StatisticsTotals
|
|
12
|
+
});
|
|
10
13
|
|
|
11
|
-
export { OiStatisticsResponse, VolumeStatisticsResponse };
|
|
14
|
+
export { OiStatisticsResponse, StatisticsTotalsResponse, VolumeStatisticsResponse };
|