@lifi/perps-types 0.1.1-alpha.3 → 0.1.1-alpha.4
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/package.json +8 -2
- package/src/_cjs/providers/hyperliquid/types.js +0 -178
- package/src/_cjs/providers/hyperliquid/types.js.map +1 -1
- package/src/_esm/providers/hyperliquid/types.js +2 -200
- package/src/_esm/providers/hyperliquid/types.js.map +1 -1
- package/src/_types/providers/hyperliquid/types.d.ts +175 -338
- package/src/_types/providers/hyperliquid/types.d.ts.map +1 -1
- package/src/providers/hyperliquid/types.ts +175 -244
package/package.json
CHANGED
|
@@ -3,10 +3,9 @@
|
|
|
3
3
|
"description": "Shared types for the LI.FI perps stack",
|
|
4
4
|
"dependencies": {
|
|
5
5
|
"@lifi/types": "^17.57.0",
|
|
6
|
-
"@sinclair/typebox": "^0.34.48",
|
|
7
6
|
"viem": "^2.33.2"
|
|
8
7
|
},
|
|
9
|
-
"version": "0.1.1-alpha.
|
|
8
|
+
"version": "0.1.1-alpha.4",
|
|
10
9
|
"files": [
|
|
11
10
|
"src",
|
|
12
11
|
"!src/**/*.tsbuildinfo",
|
|
@@ -29,6 +28,13 @@
|
|
|
29
28
|
"module": "./src/_esm/index.js",
|
|
30
29
|
"types": "./src/_types/index.d.ts",
|
|
31
30
|
"typings": "./src/_types/index.d.ts",
|
|
31
|
+
"typesVersions": {
|
|
32
|
+
"*": {
|
|
33
|
+
"providers/hyperliquid": [
|
|
34
|
+
"./src/_types/providers/hyperliquid/index.d.ts"
|
|
35
|
+
]
|
|
36
|
+
}
|
|
37
|
+
},
|
|
32
38
|
"sideEffects": false,
|
|
33
39
|
"license": "Apache-2.0",
|
|
34
40
|
"repository": {
|
|
@@ -1,181 +1,3 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.HlExchangeResponseSchema = exports.HlExchangeRequestSchema = exports.HlPerpDexsSchema = exports.HlOrderStatusResponseSchema = exports.HlOrderStatusFoundSchema = exports.HlOrderDetailSchema = exports.HlUserFillsByTimeSchema = exports.HlUserFillsSchema = exports.HlUserFillSchema = exports.HlExtraAgentsSchema = exports.HlFrontendOpenOrdersSchema = exports.HlFrontendOpenOrderSchema = exports.HlUserFeesSchema = exports.HlSpotClearinghouseStateSchema = exports.HlSpotBalanceSchema = exports.HlClearinghouseStateSchema = exports.HlAssetPositionSchema = exports.HlPositionSchema = exports.HlL2BookSchema = exports.HlLevelSchema = exports.HlCandleSnapshotSchema = exports.HlCandleSchema = exports.HlAllMidsSchema = exports.HlMetaAndAssetCtxsSchema = exports.HlAssetCtxSchema = exports.HlMetaSchema = exports.HlUniverseItemSchema = void 0;
|
|
4
|
-
const typebox_1 = require("@sinclair/typebox");
|
|
5
|
-
exports.HlUniverseItemSchema = typebox_1.Type.Object({
|
|
6
|
-
name: typebox_1.Type.String(),
|
|
7
|
-
szDecimals: typebox_1.Type.Number(),
|
|
8
|
-
maxLeverage: typebox_1.Type.Number(),
|
|
9
|
-
onlyIsolated: typebox_1.Type.Boolean(),
|
|
10
|
-
isDelisted: typebox_1.Type.Boolean(),
|
|
11
|
-
});
|
|
12
|
-
exports.HlMetaSchema = typebox_1.Type.Object({
|
|
13
|
-
universe: typebox_1.Type.Array(exports.HlUniverseItemSchema),
|
|
14
|
-
});
|
|
15
|
-
exports.HlAssetCtxSchema = typebox_1.Type.Object({
|
|
16
|
-
funding: typebox_1.Type.String(),
|
|
17
|
-
openInterest: typebox_1.Type.String(),
|
|
18
|
-
dayNtlVlm: typebox_1.Type.String(),
|
|
19
|
-
markPx: typebox_1.Type.String(),
|
|
20
|
-
});
|
|
21
|
-
exports.HlMetaAndAssetCtxsSchema = typebox_1.Type.Tuple([
|
|
22
|
-
exports.HlMetaSchema,
|
|
23
|
-
typebox_1.Type.Array(exports.HlAssetCtxSchema),
|
|
24
|
-
]);
|
|
25
|
-
exports.HlAllMidsSchema = typebox_1.Type.Record(typebox_1.Type.String(), typebox_1.Type.String());
|
|
26
|
-
exports.HlCandleSchema = typebox_1.Type.Object({
|
|
27
|
-
t: typebox_1.Type.Number(),
|
|
28
|
-
o: typebox_1.Type.String(),
|
|
29
|
-
h: typebox_1.Type.String(),
|
|
30
|
-
l: typebox_1.Type.String(),
|
|
31
|
-
c: typebox_1.Type.String(),
|
|
32
|
-
v: typebox_1.Type.String(),
|
|
33
|
-
});
|
|
34
|
-
exports.HlCandleSnapshotSchema = typebox_1.Type.Array(exports.HlCandleSchema);
|
|
35
|
-
exports.HlLevelSchema = typebox_1.Type.Object({
|
|
36
|
-
px: typebox_1.Type.String(),
|
|
37
|
-
sz: typebox_1.Type.String(),
|
|
38
|
-
n: typebox_1.Type.Number(),
|
|
39
|
-
});
|
|
40
|
-
exports.HlL2BookSchema = typebox_1.Type.Object({
|
|
41
|
-
levels: typebox_1.Type.Tuple([typebox_1.Type.Array(exports.HlLevelSchema), typebox_1.Type.Array(exports.HlLevelSchema)]),
|
|
42
|
-
time: typebox_1.Type.Number(),
|
|
43
|
-
});
|
|
44
|
-
exports.HlPositionSchema = typebox_1.Type.Object({
|
|
45
|
-
coin: typebox_1.Type.String(),
|
|
46
|
-
szi: typebox_1.Type.String(),
|
|
47
|
-
entryPx: typebox_1.Type.String(),
|
|
48
|
-
positionValue: typebox_1.Type.String(),
|
|
49
|
-
liquidationPx: typebox_1.Type.String(),
|
|
50
|
-
unrealizedPnl: typebox_1.Type.String(),
|
|
51
|
-
marginUsed: typebox_1.Type.String(),
|
|
52
|
-
leverage: typebox_1.Type.Object({
|
|
53
|
-
type: typebox_1.Type.String(),
|
|
54
|
-
value: typebox_1.Type.Number(),
|
|
55
|
-
}),
|
|
56
|
-
});
|
|
57
|
-
exports.HlAssetPositionSchema = typebox_1.Type.Object({
|
|
58
|
-
position: exports.HlPositionSchema,
|
|
59
|
-
});
|
|
60
|
-
exports.HlClearinghouseStateSchema = typebox_1.Type.Object({
|
|
61
|
-
assetPositions: typebox_1.Type.Array(exports.HlAssetPositionSchema),
|
|
62
|
-
marginSummary: typebox_1.Type.Object({
|
|
63
|
-
accountValue: typebox_1.Type.String(),
|
|
64
|
-
totalMarginUsed: typebox_1.Type.String(),
|
|
65
|
-
}),
|
|
66
|
-
crossMarginSummary: typebox_1.Type.Object({
|
|
67
|
-
accountValue: typebox_1.Type.String(),
|
|
68
|
-
totalMarginUsed: typebox_1.Type.String(),
|
|
69
|
-
}),
|
|
70
|
-
});
|
|
71
|
-
exports.HlSpotBalanceSchema = typebox_1.Type.Object({
|
|
72
|
-
coin: typebox_1.Type.String(),
|
|
73
|
-
token: typebox_1.Type.Number(),
|
|
74
|
-
total: typebox_1.Type.String(),
|
|
75
|
-
hold: typebox_1.Type.String(),
|
|
76
|
-
entryNtl: typebox_1.Type.String(),
|
|
77
|
-
});
|
|
78
|
-
exports.HlSpotClearinghouseStateSchema = typebox_1.Type.Object({
|
|
79
|
-
balances: typebox_1.Type.Array(exports.HlSpotBalanceSchema),
|
|
80
|
-
});
|
|
81
|
-
exports.HlUserFeesSchema = typebox_1.Type.Object({
|
|
82
|
-
userAddRate: typebox_1.Type.String(),
|
|
83
|
-
userCrossRate: typebox_1.Type.String(),
|
|
84
|
-
activeReferralDiscount: typebox_1.Type.String(),
|
|
85
|
-
});
|
|
86
|
-
exports.HlFrontendOpenOrderSchema = typebox_1.Type.Object({
|
|
87
|
-
oid: typebox_1.Type.Number(),
|
|
88
|
-
coin: typebox_1.Type.String(),
|
|
89
|
-
side: typebox_1.Type.String(),
|
|
90
|
-
sz: typebox_1.Type.String(),
|
|
91
|
-
limitPx: typebox_1.Type.String(),
|
|
92
|
-
orderType: typebox_1.Type.String(),
|
|
93
|
-
origSz: typebox_1.Type.String(),
|
|
94
|
-
reduceOnly: typebox_1.Type.Boolean(),
|
|
95
|
-
timestamp: typebox_1.Type.Number(),
|
|
96
|
-
});
|
|
97
|
-
exports.HlFrontendOpenOrdersSchema = typebox_1.Type.Array(exports.HlFrontendOpenOrderSchema);
|
|
98
|
-
exports.HlExtraAgentsSchema = typebox_1.Type.Array(typebox_1.Type.Record(typebox_1.Type.String(), typebox_1.Type.Unknown()));
|
|
99
|
-
exports.HlUserFillSchema = typebox_1.Type.Object({
|
|
100
|
-
tid: typebox_1.Type.Number(),
|
|
101
|
-
coin: typebox_1.Type.String(),
|
|
102
|
-
side: typebox_1.Type.String(),
|
|
103
|
-
sz: typebox_1.Type.String(),
|
|
104
|
-
px: typebox_1.Type.String(),
|
|
105
|
-
dir: typebox_1.Type.String(),
|
|
106
|
-
fee: typebox_1.Type.String(),
|
|
107
|
-
closedPnl: typebox_1.Type.String(),
|
|
108
|
-
time: typebox_1.Type.Number(),
|
|
109
|
-
});
|
|
110
|
-
exports.HlUserFillsSchema = typebox_1.Type.Array(exports.HlUserFillSchema);
|
|
111
|
-
exports.HlUserFillsByTimeSchema = typebox_1.Type.Array(exports.HlUserFillSchema);
|
|
112
|
-
exports.HlOrderDetailSchema = typebox_1.Type.Object({
|
|
113
|
-
order: typebox_1.Type.Object({
|
|
114
|
-
oid: typebox_1.Type.Number(),
|
|
115
|
-
coin: typebox_1.Type.String(),
|
|
116
|
-
side: typebox_1.Type.String(),
|
|
117
|
-
sz: typebox_1.Type.String(),
|
|
118
|
-
limitPx: typebox_1.Type.String(),
|
|
119
|
-
orderType: typebox_1.Type.String(),
|
|
120
|
-
origSz: typebox_1.Type.String(),
|
|
121
|
-
reduceOnly: typebox_1.Type.Boolean(),
|
|
122
|
-
timestamp: typebox_1.Type.Number(),
|
|
123
|
-
tif: typebox_1.Type.Union([typebox_1.Type.String(), typebox_1.Type.Null()]),
|
|
124
|
-
cloid: typebox_1.Type.Union([typebox_1.Type.String(), typebox_1.Type.Null()]),
|
|
125
|
-
triggerCondition: typebox_1.Type.String(),
|
|
126
|
-
triggerPx: typebox_1.Type.Union([typebox_1.Type.String(), typebox_1.Type.Null()]),
|
|
127
|
-
}),
|
|
128
|
-
status: typebox_1.Type.String(),
|
|
129
|
-
statusTimestamp: typebox_1.Type.Number(),
|
|
130
|
-
});
|
|
131
|
-
exports.HlOrderStatusFoundSchema = typebox_1.Type.Object({
|
|
132
|
-
status: typebox_1.Type.Literal('order'),
|
|
133
|
-
order: exports.HlOrderDetailSchema,
|
|
134
|
-
});
|
|
135
|
-
exports.HlOrderStatusResponseSchema = typebox_1.Type.Union([
|
|
136
|
-
exports.HlOrderStatusFoundSchema,
|
|
137
|
-
typebox_1.Type.Object({ status: typebox_1.Type.Literal('unknownOid') }),
|
|
138
|
-
]);
|
|
139
|
-
exports.HlPerpDexsSchema = typebox_1.Type.Array(typebox_1.Type.Union([typebox_1.Type.Null(), typebox_1.Type.Object({ name: typebox_1.Type.String() })]));
|
|
140
|
-
exports.HlExchangeRequestSchema = typebox_1.Type.Object({
|
|
141
|
-
action: typebox_1.Type.Record(typebox_1.Type.String(), typebox_1.Type.Unknown()),
|
|
142
|
-
signature: typebox_1.Type.Object({
|
|
143
|
-
r: typebox_1.Type.String(),
|
|
144
|
-
s: typebox_1.Type.String(),
|
|
145
|
-
v: typebox_1.Type.Number(),
|
|
146
|
-
}),
|
|
147
|
-
nonce: typebox_1.Type.Number(),
|
|
148
|
-
vaultAddress: typebox_1.Type.Optional(typebox_1.Type.Union([typebox_1.Type.String(), typebox_1.Type.Null()])),
|
|
149
|
-
});
|
|
150
|
-
exports.HlExchangeResponseSchema = typebox_1.Type.Object({
|
|
151
|
-
status: typebox_1.Type.String(),
|
|
152
|
-
response: typebox_1.Type.Optional(typebox_1.Type.Union([
|
|
153
|
-
typebox_1.Type.String(),
|
|
154
|
-
typebox_1.Type.Object({
|
|
155
|
-
type: typebox_1.Type.String(),
|
|
156
|
-
data: typebox_1.Type.Optional(typebox_1.Type.Object({
|
|
157
|
-
statuses: typebox_1.Type.Optional(typebox_1.Type.Array(typebox_1.Type.Union([
|
|
158
|
-
typebox_1.Type.String(),
|
|
159
|
-
typebox_1.Type.Object({
|
|
160
|
-
filled: typebox_1.Type.Object({
|
|
161
|
-
totalSz: typebox_1.Type.String(),
|
|
162
|
-
avgPx: typebox_1.Type.String(),
|
|
163
|
-
oid: typebox_1.Type.Number(),
|
|
164
|
-
}),
|
|
165
|
-
}),
|
|
166
|
-
typebox_1.Type.Object({ resting: typebox_1.Type.Object({ oid: typebox_1.Type.Number() }) }),
|
|
167
|
-
typebox_1.Type.Object({
|
|
168
|
-
waitingForFill: typebox_1.Type.Object({ oid: typebox_1.Type.Number() }),
|
|
169
|
-
}),
|
|
170
|
-
typebox_1.Type.Object({
|
|
171
|
-
waitingForTrigger: typebox_1.Type.Object({ oid: typebox_1.Type.Number() }),
|
|
172
|
-
}),
|
|
173
|
-
typebox_1.Type.Object({ success: typebox_1.Type.Literal(true) }),
|
|
174
|
-
typebox_1.Type.Object({ error: typebox_1.Type.String() }),
|
|
175
|
-
]))),
|
|
176
|
-
status: typebox_1.Type.Optional(typebox_1.Type.Unknown()),
|
|
177
|
-
})),
|
|
178
|
-
}),
|
|
179
|
-
])),
|
|
180
|
-
});
|
|
181
3
|
//# sourceMappingURL=types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../providers/hyperliquid/types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../providers/hyperliquid/types.ts"],"names":[],"mappings":""}
|
|
@@ -1,203 +1,5 @@
|
|
|
1
|
-
import { Type } from '@sinclair/typebox';
|
|
2
1
|
// ---------------------------------------------------------------------------
|
|
3
|
-
// Hyperliquid /info response
|
|
4
|
-
//
|
|
5
|
-
// Each schema produces both a JSON Schema object (for AJV validation) and a
|
|
6
|
-
// TypeScript type via Static<>. The derived types are structurally identical
|
|
7
|
-
// to the hand-written ones they replace.
|
|
8
|
-
//
|
|
9
|
-
// All schemas use additionalProperties: true (TypeBox default) so that new
|
|
10
|
-
// fields added by Hyperliquid pass through without breaking validation.
|
|
2
|
+
// Hyperliquid /info response types
|
|
11
3
|
// ---------------------------------------------------------------------------
|
|
12
|
-
|
|
13
|
-
export const HlUniverseItemSchema = Type.Object({
|
|
14
|
-
name: Type.String(),
|
|
15
|
-
szDecimals: Type.Number(),
|
|
16
|
-
maxLeverage: Type.Number(),
|
|
17
|
-
onlyIsolated: Type.Boolean(),
|
|
18
|
-
isDelisted: Type.Boolean(),
|
|
19
|
-
});
|
|
20
|
-
export const HlMetaSchema = Type.Object({
|
|
21
|
-
universe: Type.Array(HlUniverseItemSchema),
|
|
22
|
-
});
|
|
23
|
-
export const HlAssetCtxSchema = Type.Object({
|
|
24
|
-
funding: Type.String(),
|
|
25
|
-
openInterest: Type.String(),
|
|
26
|
-
dayNtlVlm: Type.String(),
|
|
27
|
-
markPx: Type.String(),
|
|
28
|
-
});
|
|
29
|
-
export const HlMetaAndAssetCtxsSchema = Type.Tuple([
|
|
30
|
-
HlMetaSchema,
|
|
31
|
-
Type.Array(HlAssetCtxSchema),
|
|
32
|
-
]);
|
|
33
|
-
// -- allMids ----------------------------------------------------------------
|
|
34
|
-
export const HlAllMidsSchema = Type.Record(Type.String(), Type.String());
|
|
35
|
-
// -- candleSnapshot ---------------------------------------------------------
|
|
36
|
-
export const HlCandleSchema = Type.Object({
|
|
37
|
-
t: Type.Number(),
|
|
38
|
-
o: Type.String(),
|
|
39
|
-
h: Type.String(),
|
|
40
|
-
l: Type.String(),
|
|
41
|
-
c: Type.String(),
|
|
42
|
-
v: Type.String(),
|
|
43
|
-
});
|
|
44
|
-
export const HlCandleSnapshotSchema = Type.Array(HlCandleSchema);
|
|
45
|
-
// -- l2Book -----------------------------------------------------------------
|
|
46
|
-
export const HlLevelSchema = Type.Object({
|
|
47
|
-
px: Type.String(),
|
|
48
|
-
sz: Type.String(),
|
|
49
|
-
n: Type.Number(),
|
|
50
|
-
});
|
|
51
|
-
export const HlL2BookSchema = Type.Object({
|
|
52
|
-
levels: Type.Tuple([Type.Array(HlLevelSchema), Type.Array(HlLevelSchema)]),
|
|
53
|
-
time: Type.Number(),
|
|
54
|
-
});
|
|
55
|
-
// -- clearinghouseState -----------------------------------------------------
|
|
56
|
-
export const HlPositionSchema = Type.Object({
|
|
57
|
-
coin: Type.String(),
|
|
58
|
-
szi: Type.String(),
|
|
59
|
-
entryPx: Type.String(),
|
|
60
|
-
positionValue: Type.String(),
|
|
61
|
-
liquidationPx: Type.String(),
|
|
62
|
-
unrealizedPnl: Type.String(),
|
|
63
|
-
marginUsed: Type.String(),
|
|
64
|
-
leverage: Type.Object({
|
|
65
|
-
type: Type.String(),
|
|
66
|
-
value: Type.Number(),
|
|
67
|
-
}),
|
|
68
|
-
});
|
|
69
|
-
export const HlAssetPositionSchema = Type.Object({
|
|
70
|
-
position: HlPositionSchema,
|
|
71
|
-
});
|
|
72
|
-
export const HlClearinghouseStateSchema = Type.Object({
|
|
73
|
-
assetPositions: Type.Array(HlAssetPositionSchema),
|
|
74
|
-
marginSummary: Type.Object({
|
|
75
|
-
accountValue: Type.String(),
|
|
76
|
-
totalMarginUsed: Type.String(),
|
|
77
|
-
}),
|
|
78
|
-
crossMarginSummary: Type.Object({
|
|
79
|
-
accountValue: Type.String(),
|
|
80
|
-
totalMarginUsed: Type.String(),
|
|
81
|
-
}),
|
|
82
|
-
});
|
|
83
|
-
// -- spotClearinghouseState -------------------------------------------------
|
|
84
|
-
export const HlSpotBalanceSchema = Type.Object({
|
|
85
|
-
coin: Type.String(),
|
|
86
|
-
token: Type.Number(),
|
|
87
|
-
total: Type.String(),
|
|
88
|
-
hold: Type.String(),
|
|
89
|
-
entryNtl: Type.String(),
|
|
90
|
-
});
|
|
91
|
-
export const HlSpotClearinghouseStateSchema = Type.Object({
|
|
92
|
-
balances: Type.Array(HlSpotBalanceSchema),
|
|
93
|
-
});
|
|
94
|
-
// -- userFees ---------------------------------------------------------------
|
|
95
|
-
export const HlUserFeesSchema = Type.Object({
|
|
96
|
-
userAddRate: Type.String(),
|
|
97
|
-
userCrossRate: Type.String(),
|
|
98
|
-
activeReferralDiscount: Type.String(),
|
|
99
|
-
});
|
|
100
|
-
// -- frontendOpenOrders -----------------------------------------------------
|
|
101
|
-
export const HlFrontendOpenOrderSchema = Type.Object({
|
|
102
|
-
oid: Type.Number(),
|
|
103
|
-
coin: Type.String(),
|
|
104
|
-
side: Type.String(),
|
|
105
|
-
sz: Type.String(),
|
|
106
|
-
limitPx: Type.String(),
|
|
107
|
-
orderType: Type.String(),
|
|
108
|
-
origSz: Type.String(),
|
|
109
|
-
reduceOnly: Type.Boolean(),
|
|
110
|
-
timestamp: Type.Number(),
|
|
111
|
-
});
|
|
112
|
-
export const HlFrontendOpenOrdersSchema = Type.Array(HlFrontendOpenOrderSchema);
|
|
113
|
-
// -- extraAgents ------------------------------------------------------------
|
|
114
|
-
export const HlExtraAgentsSchema = Type.Array(Type.Record(Type.String(), Type.Unknown()));
|
|
115
|
-
// -- userFills / userFillsByTime --------------------------------------------
|
|
116
|
-
export const HlUserFillSchema = Type.Object({
|
|
117
|
-
tid: Type.Number(),
|
|
118
|
-
coin: Type.String(),
|
|
119
|
-
side: Type.String(),
|
|
120
|
-
sz: Type.String(),
|
|
121
|
-
px: Type.String(),
|
|
122
|
-
dir: Type.String(),
|
|
123
|
-
fee: Type.String(),
|
|
124
|
-
closedPnl: Type.String(),
|
|
125
|
-
time: Type.Number(),
|
|
126
|
-
});
|
|
127
|
-
export const HlUserFillsSchema = Type.Array(HlUserFillSchema);
|
|
128
|
-
export const HlUserFillsByTimeSchema = Type.Array(HlUserFillSchema);
|
|
129
|
-
// -- orderStatus ------------------------------------------------------------
|
|
130
|
-
export const HlOrderDetailSchema = Type.Object({
|
|
131
|
-
order: Type.Object({
|
|
132
|
-
oid: Type.Number(),
|
|
133
|
-
coin: Type.String(),
|
|
134
|
-
side: Type.String(),
|
|
135
|
-
sz: Type.String(),
|
|
136
|
-
limitPx: Type.String(),
|
|
137
|
-
orderType: Type.String(),
|
|
138
|
-
origSz: Type.String(),
|
|
139
|
-
reduceOnly: Type.Boolean(),
|
|
140
|
-
timestamp: Type.Number(),
|
|
141
|
-
tif: Type.Union([Type.String(), Type.Null()]),
|
|
142
|
-
cloid: Type.Union([Type.String(), Type.Null()]),
|
|
143
|
-
triggerCondition: Type.String(),
|
|
144
|
-
triggerPx: Type.Union([Type.String(), Type.Null()]),
|
|
145
|
-
}),
|
|
146
|
-
status: Type.String(),
|
|
147
|
-
statusTimestamp: Type.Number(),
|
|
148
|
-
});
|
|
149
|
-
export const HlOrderStatusFoundSchema = Type.Object({
|
|
150
|
-
status: Type.Literal('order'),
|
|
151
|
-
order: HlOrderDetailSchema,
|
|
152
|
-
});
|
|
153
|
-
export const HlOrderStatusResponseSchema = Type.Union([
|
|
154
|
-
HlOrderStatusFoundSchema,
|
|
155
|
-
Type.Object({ status: Type.Literal('unknownOid') }),
|
|
156
|
-
]);
|
|
157
|
-
// -- perpDexs ---------------------------------------------------------------
|
|
158
|
-
export const HlPerpDexsSchema = Type.Array(Type.Union([Type.Null(), Type.Object({ name: Type.String() })]));
|
|
159
|
-
// ---------------------------------------------------------------------------
|
|
160
|
-
// Exchange request / response schemas
|
|
161
|
-
// ---------------------------------------------------------------------------
|
|
162
|
-
export const HlExchangeRequestSchema = Type.Object({
|
|
163
|
-
action: Type.Record(Type.String(), Type.Unknown()),
|
|
164
|
-
signature: Type.Object({
|
|
165
|
-
r: Type.String(),
|
|
166
|
-
s: Type.String(),
|
|
167
|
-
v: Type.Number(),
|
|
168
|
-
}),
|
|
169
|
-
nonce: Type.Number(),
|
|
170
|
-
vaultAddress: Type.Optional(Type.Union([Type.String(), Type.Null()])),
|
|
171
|
-
});
|
|
172
|
-
export const HlExchangeResponseSchema = Type.Object({
|
|
173
|
-
status: Type.String(),
|
|
174
|
-
response: Type.Optional(Type.Union([
|
|
175
|
-
Type.String(),
|
|
176
|
-
Type.Object({
|
|
177
|
-
type: Type.String(),
|
|
178
|
-
data: Type.Optional(Type.Object({
|
|
179
|
-
statuses: Type.Optional(Type.Array(Type.Union([
|
|
180
|
-
Type.String(),
|
|
181
|
-
Type.Object({
|
|
182
|
-
filled: Type.Object({
|
|
183
|
-
totalSz: Type.String(),
|
|
184
|
-
avgPx: Type.String(),
|
|
185
|
-
oid: Type.Number(),
|
|
186
|
-
}),
|
|
187
|
-
}),
|
|
188
|
-
Type.Object({ resting: Type.Object({ oid: Type.Number() }) }),
|
|
189
|
-
Type.Object({
|
|
190
|
-
waitingForFill: Type.Object({ oid: Type.Number() }),
|
|
191
|
-
}),
|
|
192
|
-
Type.Object({
|
|
193
|
-
waitingForTrigger: Type.Object({ oid: Type.Number() }),
|
|
194
|
-
}),
|
|
195
|
-
Type.Object({ success: Type.Literal(true) }),
|
|
196
|
-
Type.Object({ error: Type.String() }),
|
|
197
|
-
]))),
|
|
198
|
-
status: Type.Optional(Type.Unknown()),
|
|
199
|
-
})),
|
|
200
|
-
}),
|
|
201
|
-
])),
|
|
202
|
-
});
|
|
4
|
+
export {};
|
|
203
5
|
//# sourceMappingURL=types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../providers/hyperliquid/types.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../providers/hyperliquid/types.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,mCAAmC;AACnC,8EAA8E"}
|