@pear-protocol/types 0.0.20 → 0.0.21
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.
|
@@ -7,6 +7,23 @@ export declare const InstrumentType: z.ZodEnum<{
|
|
|
7
7
|
hip3: "hip3";
|
|
8
8
|
}>;
|
|
9
9
|
export type InstrumentType = z.infer<typeof InstrumentType>;
|
|
10
|
+
export declare const InstrumentTradeabilityStatus: z.ZodEnum<{
|
|
11
|
+
tradable: "tradable";
|
|
12
|
+
reduce_only: "reduce_only";
|
|
13
|
+
not_tradable: "not_tradable";
|
|
14
|
+
}>;
|
|
15
|
+
export type InstrumentTradeabilityStatus = z.infer<typeof InstrumentTradeabilityStatus>;
|
|
16
|
+
export declare const InstrumentTradeabilityReason: z.ZodNullable<z.ZodString>;
|
|
17
|
+
export type InstrumentTradeabilityReason = z.infer<typeof InstrumentTradeabilityReason>;
|
|
18
|
+
export declare const InstrumentTradeability: z.ZodObject<{
|
|
19
|
+
status: z.ZodEnum<{
|
|
20
|
+
tradable: "tradable";
|
|
21
|
+
reduce_only: "reduce_only";
|
|
22
|
+
not_tradable: "not_tradable";
|
|
23
|
+
}>;
|
|
24
|
+
reason: z.ZodNullable<z.ZodString>;
|
|
25
|
+
}, z.core.$strip>;
|
|
26
|
+
export type InstrumentTradeability = z.output<typeof InstrumentTradeability>;
|
|
10
27
|
export declare const Instrument: z.ZodObject<{
|
|
11
28
|
id: z.ZodString;
|
|
12
29
|
base: z.ZodString;
|
|
@@ -40,5 +57,13 @@ export declare const Instrument: z.ZodObject<{
|
|
|
40
57
|
max: z.ZodNullable<z.ZodOptional<z.ZodPipe<z.ZodNumber, z.ZodTransform<number | undefined, number>>>>;
|
|
41
58
|
}, z.core.$strip>>;
|
|
42
59
|
}, z.core.$strip>;
|
|
60
|
+
tradeability: z.ZodObject<{
|
|
61
|
+
status: z.ZodEnum<{
|
|
62
|
+
tradable: "tradable";
|
|
63
|
+
reduce_only: "reduce_only";
|
|
64
|
+
not_tradable: "not_tradable";
|
|
65
|
+
}>;
|
|
66
|
+
reason: z.ZodNullable<z.ZodString>;
|
|
67
|
+
}, z.core.$strip>;
|
|
43
68
|
}, z.core.$strip>;
|
|
44
69
|
export type Instrument = z.output<typeof Instrument>;
|
|
@@ -4,6 +4,12 @@ import { InstrumentPrecision } from '../instrument-precision';
|
|
|
4
4
|
|
|
5
5
|
const InstrumentId = z.string().trim().min(1, "Instrument ID is required").max(64, "Instrument ID must be at most 64 characters").regex(/^[^\s][^\s]*$/, "Instrument ID contains invalid characters");
|
|
6
6
|
const InstrumentType = z.enum(["spot", "perp", "hip3"]);
|
|
7
|
+
const InstrumentTradeabilityStatus = z.enum(["tradable", "reduce_only", "not_tradable"]);
|
|
8
|
+
const InstrumentTradeabilityReason = z.string().nullable();
|
|
9
|
+
const InstrumentTradeability = z.object({
|
|
10
|
+
status: InstrumentTradeabilityStatus,
|
|
11
|
+
reason: InstrumentTradeabilityReason
|
|
12
|
+
});
|
|
7
13
|
const Instrument = z.object({
|
|
8
14
|
/**
|
|
9
15
|
* Exchange specific instrument identifier
|
|
@@ -42,7 +48,11 @@ const Instrument = z.object({
|
|
|
42
48
|
/**
|
|
43
49
|
* The precision of the instrument.
|
|
44
50
|
*/
|
|
45
|
-
precision: InstrumentPrecision
|
|
51
|
+
precision: InstrumentPrecision,
|
|
52
|
+
/**
|
|
53
|
+
* Whether this instrument can be traded normally.
|
|
54
|
+
*/
|
|
55
|
+
tradeability: InstrumentTradeability
|
|
46
56
|
});
|
|
47
57
|
|
|
48
|
-
export { Instrument, InstrumentId, InstrumentType };
|
|
58
|
+
export { Instrument, InstrumentId, InstrumentTradeability, InstrumentTradeabilityReason, InstrumentTradeabilityStatus, InstrumentType };
|
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
export declare const InstrumentScope: z.ZodEnum<{
|
|
3
|
+
tradable: "tradable";
|
|
4
|
+
reduce_only: "reduce_only";
|
|
5
|
+
not_tradable: "not_tradable";
|
|
6
|
+
all: "all";
|
|
7
|
+
}>;
|
|
8
|
+
export type InstrumentScope = z.infer<typeof InstrumentScope>;
|
|
2
9
|
export declare const InstrumentListParams: z.ZodObject<{
|
|
3
10
|
connector: z.ZodEnum<{
|
|
4
11
|
hyperliquid: "hyperliquid";
|
|
@@ -7,5 +14,12 @@ export declare const InstrumentListParams: z.ZodObject<{
|
|
|
7
14
|
okx: "okx";
|
|
8
15
|
lighter: "lighter";
|
|
9
16
|
}>;
|
|
17
|
+
scope: z.ZodDefault<z.ZodEnum<{
|
|
18
|
+
tradable: "tradable";
|
|
19
|
+
reduce_only: "reduce_only";
|
|
20
|
+
not_tradable: "not_tradable";
|
|
21
|
+
all: "all";
|
|
22
|
+
}>>;
|
|
10
23
|
}, z.core.$strip>;
|
|
24
|
+
export type InstrumentListParamsInput = z.input<typeof InstrumentListParams>;
|
|
11
25
|
export type InstrumentListParams = z.output<typeof InstrumentListParams>;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { Connector } from '../connector';
|
|
3
3
|
|
|
4
|
+
const InstrumentScope = z.enum(["tradable", "reduce_only", "not_tradable", "all"]);
|
|
4
5
|
const InstrumentListParams = z.object({
|
|
5
|
-
connector: Connector
|
|
6
|
+
connector: Connector,
|
|
7
|
+
scope: InstrumentScope.default("all")
|
|
6
8
|
});
|
|
7
9
|
|
|
8
|
-
export { InstrumentListParams };
|
|
10
|
+
export { InstrumentListParams, InstrumentScope };
|
|
@@ -33,6 +33,14 @@ export declare const InstrumentListResponse: z.ZodObject<{
|
|
|
33
33
|
max: z.ZodNullable<z.ZodOptional<z.ZodPipe<z.ZodNumber, z.ZodTransform<number | undefined, number>>>>;
|
|
34
34
|
}, z.core.$strip>>;
|
|
35
35
|
}, z.core.$strip>;
|
|
36
|
+
tradeability: z.ZodObject<{
|
|
37
|
+
status: z.ZodEnum<{
|
|
38
|
+
tradable: "tradable";
|
|
39
|
+
reduce_only: "reduce_only";
|
|
40
|
+
not_tradable: "not_tradable";
|
|
41
|
+
}>;
|
|
42
|
+
reason: z.ZodNullable<z.ZodString>;
|
|
43
|
+
}, z.core.$strip>;
|
|
36
44
|
}, z.core.$strip>>;
|
|
37
45
|
}, z.core.$strip>;
|
|
38
46
|
export type InstrumentListResponse = z.output<typeof InstrumentListResponse>;
|