@nktkas/hyperliquid 0.24.2 → 0.25.0-beta.1
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/README.md +197 -117
- package/esm/mod.d.ts +11 -11
- package/esm/mod.d.ts.map +1 -1
- package/esm/mod.js +1 -1
- package/esm/src/clients/exchange.d.ts +29 -18
- package/esm/src/clients/exchange.d.ts.map +1 -1
- package/esm/src/clients/exchange.js +50 -48
- package/esm/src/clients/info.d.ts +79 -75
- package/esm/src/clients/info.d.ts.map +1 -1
- package/esm/src/clients/info.js +294 -163
- package/esm/src/clients/multiSign.d.ts +11 -7
- package/esm/src/clients/multiSign.d.ts.map +1 -1
- package/esm/src/clients/subscription.d.ts +105 -32
- package/esm/src/clients/subscription.d.ts.map +1 -1
- package/esm/src/clients/subscription.js +114 -33
- package/esm/src/{base.d.ts → errors.d.ts} +1 -1
- package/esm/src/errors.d.ts.map +1 -0
- package/esm/src/schemas/_base.d.ts +10 -0
- package/esm/src/schemas/_base.d.ts.map +1 -0
- package/esm/src/schemas/_base.js +12 -0
- package/esm/src/schemas/exchange/requests.d.ts +8953 -0
- package/esm/src/schemas/exchange/requests.d.ts.map +1 -0
- package/esm/src/schemas/exchange/requests.js +1413 -0
- package/esm/src/schemas/exchange/responses.d.ts +567 -0
- package/esm/src/schemas/exchange/responses.d.ts.map +1 -0
- package/esm/src/schemas/exchange/responses.js +243 -0
- package/esm/src/schemas/explorer/requests.d.ts +44 -0
- package/esm/src/schemas/explorer/requests.d.ts.map +1 -0
- package/esm/src/schemas/explorer/requests.js +32 -0
- package/esm/src/schemas/explorer/responses.d.ts +360 -0
- package/esm/src/schemas/explorer/responses.d.ts.map +1 -0
- package/esm/src/schemas/explorer/responses.js +56 -0
- package/esm/src/schemas/info/accounts.d.ts +2159 -0
- package/esm/src/schemas/info/accounts.d.ts.map +1 -0
- package/esm/src/schemas/info/accounts.js +622 -0
- package/esm/src/schemas/info/assets.d.ts +945 -0
- package/esm/src/schemas/info/assets.d.ts.map +1 -0
- package/esm/src/schemas/info/assets.js +265 -0
- package/esm/src/schemas/info/markets.d.ts +138 -0
- package/esm/src/schemas/info/markets.d.ts.map +1 -0
- package/esm/src/schemas/info/markets.js +58 -0
- package/esm/src/schemas/info/orders.d.ts +957 -0
- package/esm/src/schemas/info/orders.d.ts.map +1 -0
- package/esm/src/schemas/info/orders.js +297 -0
- package/esm/src/schemas/info/requests.d.ts +882 -0
- package/esm/src/schemas/info/requests.d.ts.map +1 -0
- package/esm/src/schemas/info/requests.js +655 -0
- package/esm/src/schemas/info/validators.d.ts +305 -0
- package/esm/src/schemas/info/validators.d.ts.map +1 -0
- package/esm/src/schemas/info/validators.js +112 -0
- package/esm/src/schemas/info/vaults.d.ts +447 -0
- package/esm/src/schemas/info/vaults.d.ts.map +1 -0
- package/esm/src/schemas/info/vaults.js +110 -0
- package/esm/src/schemas/mod.d.ts +100 -0
- package/esm/src/schemas/mod.d.ts.map +1 -0
- package/esm/src/schemas/mod.js +113 -0
- package/esm/src/schemas/subscriptions/requests.d.ts +332 -0
- package/esm/src/schemas/subscriptions/requests.d.ts.map +1 -0
- package/esm/src/schemas/subscriptions/requests.js +258 -0
- package/esm/src/schemas/subscriptions/responses.d.ts +3643 -0
- package/esm/src/schemas/subscriptions/responses.d.ts.map +1 -0
- package/esm/src/schemas/subscriptions/responses.js +233 -0
- package/esm/src/signing/mod.d.ts +109 -29
- package/esm/src/signing/mod.d.ts.map +1 -1
- package/esm/src/signing/mod.js +135 -29
- package/esm/src/transports/base.d.ts +2 -2
- package/esm/src/transports/base.d.ts.map +1 -1
- package/esm/src/transports/base.js +2 -2
- package/esm/src/transports/http/http_transport.d.ts +2 -1
- package/esm/src/transports/http/http_transport.d.ts.map +1 -1
- package/esm/src/transports/websocket/_hyperliquid_event_target.d.ts +1 -1
- package/esm/src/transports/websocket/_hyperliquid_event_target.d.ts.map +1 -1
- package/esm/src/transports/websocket/websocket_transport.d.ts +2 -1
- package/esm/src/transports/websocket/websocket_transport.d.ts.map +1 -1
- package/package.json +6 -5
- package/script/mod.d.ts +11 -11
- package/script/mod.d.ts.map +1 -1
- package/script/mod.js +1 -1
- package/script/src/clients/exchange.d.ts +29 -18
- package/script/src/clients/exchange.d.ts.map +1 -1
- package/script/src/clients/exchange.js +56 -54
- package/script/src/clients/info.d.ts +79 -75
- package/script/src/clients/info.d.ts.map +1 -1
- package/script/src/clients/info.js +294 -163
- package/script/src/clients/multiSign.d.ts +11 -7
- package/script/src/clients/multiSign.d.ts.map +1 -1
- package/script/src/clients/subscription.d.ts +105 -32
- package/script/src/clients/subscription.d.ts.map +1 -1
- package/script/src/clients/subscription.js +114 -33
- package/script/src/{base.d.ts → errors.d.ts} +1 -1
- package/script/src/errors.d.ts.map +1 -0
- package/script/src/schemas/_base.d.ts +10 -0
- package/script/src/schemas/_base.d.ts.map +1 -0
- package/script/src/schemas/_base.js +48 -0
- package/script/src/schemas/exchange/requests.d.ts +8953 -0
- package/script/src/schemas/exchange/requests.d.ts.map +1 -0
- package/script/src/schemas/exchange/requests.js +1449 -0
- package/script/src/schemas/exchange/responses.d.ts +567 -0
- package/script/src/schemas/exchange/responses.d.ts.map +1 -0
- package/script/src/schemas/exchange/responses.js +279 -0
- package/script/src/schemas/explorer/requests.d.ts +44 -0
- package/script/src/schemas/explorer/requests.d.ts.map +1 -0
- package/script/src/schemas/explorer/requests.js +68 -0
- package/script/src/schemas/explorer/responses.d.ts +360 -0
- package/script/src/schemas/explorer/responses.d.ts.map +1 -0
- package/script/src/schemas/explorer/responses.js +92 -0
- package/script/src/schemas/info/accounts.d.ts +2159 -0
- package/script/src/schemas/info/accounts.d.ts.map +1 -0
- package/script/src/schemas/info/accounts.js +658 -0
- package/script/src/schemas/info/assets.d.ts +945 -0
- package/script/src/schemas/info/assets.d.ts.map +1 -0
- package/script/src/schemas/info/assets.js +301 -0
- package/script/src/schemas/info/markets.d.ts +138 -0
- package/script/src/schemas/info/markets.d.ts.map +1 -0
- package/script/src/schemas/info/markets.js +94 -0
- package/script/src/schemas/info/orders.d.ts +957 -0
- package/script/src/schemas/info/orders.d.ts.map +1 -0
- package/script/src/schemas/info/orders.js +333 -0
- package/script/src/schemas/info/requests.d.ts +882 -0
- package/script/src/schemas/info/requests.d.ts.map +1 -0
- package/script/src/schemas/info/requests.js +692 -0
- package/script/src/schemas/info/validators.d.ts +305 -0
- package/script/src/schemas/info/validators.d.ts.map +1 -0
- package/script/src/schemas/info/validators.js +148 -0
- package/script/src/schemas/info/vaults.d.ts +447 -0
- package/script/src/schemas/info/vaults.d.ts.map +1 -0
- package/script/src/schemas/info/vaults.js +146 -0
- package/script/src/schemas/mod.d.ts +100 -0
- package/script/src/schemas/mod.d.ts.map +1 -0
- package/script/src/schemas/mod.js +154 -0
- package/script/src/schemas/subscriptions/requests.d.ts +332 -0
- package/script/src/schemas/subscriptions/requests.d.ts.map +1 -0
- package/script/src/schemas/subscriptions/requests.js +294 -0
- package/script/src/schemas/subscriptions/responses.d.ts +3643 -0
- package/script/src/schemas/subscriptions/responses.d.ts.map +1 -0
- package/script/src/schemas/subscriptions/responses.js +269 -0
- package/script/src/signing/mod.d.ts +109 -29
- package/script/src/signing/mod.d.ts.map +1 -1
- package/script/src/signing/mod.js +137 -33
- package/script/src/transports/base.d.ts +2 -2
- package/script/src/transports/base.d.ts.map +1 -1
- package/script/src/transports/base.js +3 -3
- package/script/src/transports/http/http_transport.d.ts +2 -1
- package/script/src/transports/http/http_transport.d.ts.map +1 -1
- package/script/src/transports/websocket/_hyperliquid_event_target.d.ts +1 -1
- package/script/src/transports/websocket/_hyperliquid_event_target.d.ts.map +1 -1
- package/script/src/transports/websocket/websocket_transport.d.ts +2 -1
- package/script/src/transports/websocket/websocket_transport.d.ts.map +1 -1
- package/esm/src/base.d.ts.map +0 -1
- package/esm/src/signing/_sorter.d.ts +0 -127
- package/esm/src/signing/_sorter.d.ts.map +0 -1
- package/esm/src/signing/_sorter.js +0 -693
- package/esm/src/types/exchange/requests.d.ts +0 -1345
- package/esm/src/types/exchange/requests.d.ts.map +0 -1
- package/esm/src/types/exchange/requests.js +0 -1
- package/esm/src/types/exchange/responses.d.ts +0 -233
- package/esm/src/types/exchange/responses.d.ts.map +0 -1
- package/esm/src/types/exchange/responses.js +0 -1
- package/esm/src/types/explorer/requests.d.ts +0 -32
- package/esm/src/types/explorer/requests.d.ts.map +0 -1
- package/esm/src/types/explorer/requests.js +0 -1
- package/esm/src/types/explorer/responses.d.ts +0 -58
- package/esm/src/types/explorer/responses.d.ts.map +0 -1
- package/esm/src/types/explorer/responses.js +0 -1
- package/esm/src/types/info/accounts.d.ts +0 -864
- package/esm/src/types/info/accounts.d.ts.map +0 -1
- package/esm/src/types/info/accounts.js +0 -1
- package/esm/src/types/info/assets.d.ts +0 -354
- package/esm/src/types/info/assets.d.ts.map +0 -1
- package/esm/src/types/info/assets.js +0 -1
- package/esm/src/types/info/markets.d.ts +0 -79
- package/esm/src/types/info/markets.d.ts.map +0 -1
- package/esm/src/types/info/markets.js +0 -1
- package/esm/src/types/info/orders.d.ts +0 -266
- package/esm/src/types/info/orders.d.ts.map +0 -1
- package/esm/src/types/info/orders.js +0 -1
- package/esm/src/types/info/requests.d.ts +0 -634
- package/esm/src/types/info/requests.d.ts.map +0 -1
- package/esm/src/types/info/requests.js +0 -1
- package/esm/src/types/info/validators.d.ts +0 -147
- package/esm/src/types/info/validators.d.ts.map +0 -1
- package/esm/src/types/info/validators.js +0 -1
- package/esm/src/types/info/vaults.d.ts +0 -119
- package/esm/src/types/info/vaults.d.ts.map +0 -1
- package/esm/src/types/info/vaults.js +0 -1
- package/esm/src/types/mod.d.ts +0 -38
- package/esm/src/types/mod.d.ts.map +0 -1
- package/esm/src/types/mod.js +0 -24
- package/esm/src/types/subscriptions/requests.d.ts +0 -143
- package/esm/src/types/subscriptions/requests.d.ts.map +0 -1
- package/esm/src/types/subscriptions/requests.js +0 -1
- package/esm/src/types/subscriptions/responses.d.ts +0 -213
- package/esm/src/types/subscriptions/responses.d.ts.map +0 -1
- package/esm/src/types/subscriptions/responses.js +0 -1
- package/script/src/base.d.ts.map +0 -1
- package/script/src/signing/_sorter.d.ts +0 -127
- package/script/src/signing/_sorter.d.ts.map +0 -1
- package/script/src/signing/_sorter.js +0 -696
- package/script/src/types/exchange/requests.d.ts +0 -1345
- package/script/src/types/exchange/requests.d.ts.map +0 -1
- package/script/src/types/exchange/requests.js +0 -2
- package/script/src/types/exchange/responses.d.ts +0 -233
- package/script/src/types/exchange/responses.d.ts.map +0 -1
- package/script/src/types/exchange/responses.js +0 -2
- package/script/src/types/explorer/requests.d.ts +0 -32
- package/script/src/types/explorer/requests.d.ts.map +0 -1
- package/script/src/types/explorer/requests.js +0 -2
- package/script/src/types/explorer/responses.d.ts +0 -58
- package/script/src/types/explorer/responses.d.ts.map +0 -1
- package/script/src/types/explorer/responses.js +0 -2
- package/script/src/types/info/accounts.d.ts +0 -864
- package/script/src/types/info/accounts.d.ts.map +0 -1
- package/script/src/types/info/accounts.js +0 -2
- package/script/src/types/info/assets.d.ts +0 -354
- package/script/src/types/info/assets.d.ts.map +0 -1
- package/script/src/types/info/assets.js +0 -2
- package/script/src/types/info/markets.d.ts +0 -79
- package/script/src/types/info/markets.d.ts.map +0 -1
- package/script/src/types/info/markets.js +0 -2
- package/script/src/types/info/orders.d.ts +0 -266
- package/script/src/types/info/orders.d.ts.map +0 -1
- package/script/src/types/info/orders.js +0 -2
- package/script/src/types/info/requests.d.ts +0 -634
- package/script/src/types/info/requests.d.ts.map +0 -1
- package/script/src/types/info/requests.js +0 -2
- package/script/src/types/info/validators.d.ts +0 -147
- package/script/src/types/info/validators.d.ts.map +0 -1
- package/script/src/types/info/validators.js +0 -2
- package/script/src/types/info/vaults.d.ts +0 -119
- package/script/src/types/info/vaults.d.ts.map +0 -1
- package/script/src/types/info/vaults.js +0 -2
- package/script/src/types/mod.d.ts +0 -38
- package/script/src/types/mod.d.ts.map +0 -1
- package/script/src/types/mod.js +0 -25
- package/script/src/types/subscriptions/requests.d.ts +0 -143
- package/script/src/types/subscriptions/requests.d.ts.map +0 -1
- package/script/src/types/subscriptions/requests.js +0 -2
- package/script/src/types/subscriptions/responses.d.ts +0 -213
- package/script/src/types/subscriptions/responses.d.ts.map +0 -1
- package/script/src/types/subscriptions/responses.js +0 -2
- /package/esm/src/{base.js → errors.js} +0 -0
- /package/script/src/{base.js → errors.js} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"orders.d.ts","sourceRoot":"","sources":["../../../../src/src/schemas/info/orders.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAC;AAG7B,wBAAwB;AACxB,eAAO,MAAM,SAAS;IAEd,aAAa;;IAKb,kBAAkB;;IAKlB,mCAAmC;;;;;;yBAO1C,CAAC;AACF,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,SAAS,CAAC,CAAC;AAExD,8BAA8B;AAC9B,eAAO,MAAM,IAAI;IAET,oBAAoB;;IAKpB,qDAAqD;;IAKrD,2DAA2D;;QAjC3D,aAAa;;QAKb,kBAAkB;;QAKlB,mCAAmC;;;;;;;QAVnC,aAAa;;QAKb,kBAAkB;;QAKlB,mCAAmC;;;;;;;;;;;;;;;;;;;;;;;;;;;+BA8B1C,CAAC;AACF,MAAM,MAAM,IAAI,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,IAAI,CAAC,CAAC;AAE9C,4CAA4C;AAC5C,eAAO,MAAM,eAAe;IAEpB,sCAAsC;;IAKtC,6CAA6C;;IAK7C,0BAA0B;;;;;;6CAOjC,CAAC;AACF,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,eAAe,CAAC,CAAC;AAEpE,yBAAyB;AACzB,eAAO,MAAM,IAAI;IAET,oBAAoB;;IAKpB,aAAa;;IAKb,YAAY;;IAKZ,kDAAkD;;IAKlD,6DAA6D;;IAK7D,2BAA2B;;IAK3B,gDAAgD;;I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AAM,aAAa;IAElB,uCAAuC;;QA5fvC,oBAAoB;;QAKpB,aAAa;;QAKb,YAAY;;QAKZ,kDAAkD;;QAKlD,6DAA6D;;QAK7D,2BAA2B;;QAK3B,gDAAgD;;QAKhD,oBAAoB;;QAKpB,2BAA2B;;QAK3B,gBAAgB;;QAKhB,+CAA+C;;QAK/C,kEAAkE;;QAKlE,oEAAoE;;QAKpE,uBAAuB;;QAKvB,2BAA2B;;YA7F3B,sCAAsC;;YAKtC,6CAA6C;;YAK7C,0BAA0B;;;;;;;;;;;QAwF1B,4DAA4D;;QAK5D,sBAAsB;;;;YAhFtB,oBAAoB;;YAKpB,aAAa;;YAKb,YAAY;;YAKZ,kDAAkD;;YAKlD,6DAA6D;;YAK7D,2BAA2B;;YAK3B,gDAAgD;;YAKhD,oBAAoB;;YAKpB,2BAA2B;;YAK3B,gBAAgB;;YAKhB,+CAA+C;;YAK/C,kEAAkE;;YAKlE,oEAAoE;;YAKpE,uBAAuB;;YAKvB,2BAA2B;;gBA7F3B,sCAAsC;;gBAKtC,6CAA6C;;gBAK7C,0BAA0B;;;;;;;;;;;YAwF1B,4DAA4D;;YAK5D,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAibtB,sBAAsB;;;;;;;;;;;;;;;;;;;;;gCAO7B,CAAC;AACF,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,aAAa,CAAC,CAAC"}
|
|
@@ -0,0 +1,333 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.TwapSliceFill = exports.TwapHistory = exports.TwapStatus = exports.TwapState = exports.OrderLookup = exports.FrontendOrderStatus = exports.OrderStatus = exports.OrderProcessingStatus = exports.FrontendOrder = exports.TIF = exports.OrderType = exports.Order = exports.Fill = exports.FillLiquidation = exports.Book = exports.BookLevel = void 0;
|
|
37
|
+
const v = __importStar(require("valibot"));
|
|
38
|
+
const _base_js_1 = require("../_base.js");
|
|
39
|
+
/** Order book level. */
|
|
40
|
+
exports.BookLevel = v.pipe(v.strictObject({
|
|
41
|
+
/** Price. */
|
|
42
|
+
px: v.pipe(_base_js_1.UnsignedDecimal, v.description("Price.")),
|
|
43
|
+
/** Total size. */
|
|
44
|
+
sz: v.pipe(_base_js_1.UnsignedDecimal, v.description("Total size.")),
|
|
45
|
+
/** Number of individual orders. */
|
|
46
|
+
n: v.pipe(v.pipe(v.number(), v.safeInteger(), v.minValue(0)), v.description("Number of individual orders.")),
|
|
47
|
+
}), v.description("Order book level."));
|
|
48
|
+
/** L2 order book snapshot. */
|
|
49
|
+
exports.Book = v.pipe(v.strictObject({
|
|
50
|
+
/** Asset symbol. */
|
|
51
|
+
coin: v.pipe(v.string(), v.description("Asset symbol.")),
|
|
52
|
+
/** Timestamp of the snapshot (in ms since epoch). */
|
|
53
|
+
time: v.pipe(v.pipe(v.number(), v.safeInteger(), v.minValue(0)), v.description("Timestamp of the snapshot (in ms since epoch).")),
|
|
54
|
+
/** Bid and ask levels (index 0 = bids, index 1 = asks). */
|
|
55
|
+
levels: v.pipe(v.strictTuple([v.array(exports.BookLevel), v.array(exports.BookLevel)]), v.description("Bid and ask levels (index 0 = bids, index 1 = asks).")),
|
|
56
|
+
}), v.description("L2 order book snapshot."));
|
|
57
|
+
/** Liquidation details for a trade fill. */
|
|
58
|
+
exports.FillLiquidation = v.pipe(v.strictObject({
|
|
59
|
+
/** Address of the liquidated user. */
|
|
60
|
+
liquidatedUser: v.pipe(v.pipe(_base_js_1.Hex, v.length(42)), v.description("Address of the liquidated user.")),
|
|
61
|
+
/** Mark price at the time of liquidation. */
|
|
62
|
+
markPx: v.pipe(_base_js_1.UnsignedDecimal, v.description("Mark price at the time of liquidation.")),
|
|
63
|
+
/** Liquidation method. */
|
|
64
|
+
method: v.pipe(v.union([v.literal("market"), v.literal("backstop")]), v.description("Liquidation method.")),
|
|
65
|
+
}), v.description("Liquidation details for a trade fill."));
|
|
66
|
+
/** Trade fill record. */
|
|
67
|
+
exports.Fill = v.pipe(v.strictObject({
|
|
68
|
+
/** Asset symbol. */
|
|
69
|
+
coin: v.pipe(v.string(), v.description("Asset symbol.")),
|
|
70
|
+
/** Price. */
|
|
71
|
+
px: v.pipe(_base_js_1.UnsignedDecimal, v.description("Price.")),
|
|
72
|
+
/** Size. */
|
|
73
|
+
sz: v.pipe(_base_js_1.UnsignedDecimal, v.description("Size.")),
|
|
74
|
+
/** Order side ("B" = Bid/Buy, "A" = Ask/Sell). */
|
|
75
|
+
side: v.pipe(v.union([v.literal("B"), v.literal("A")]), v.description('Order side ("B" = Bid/Buy, "A" = Ask/Sell).')),
|
|
76
|
+
/** Timestamp when the trade occurred (in ms since epoch). */
|
|
77
|
+
time: v.pipe(v.pipe(v.number(), v.safeInteger(), v.minValue(0)), v.description("Timestamp when the trade occurred (in ms since epoch).")),
|
|
78
|
+
/** Start position size. */
|
|
79
|
+
startPosition: v.pipe(_base_js_1.SignedDecimal, v.description("Start position size.")),
|
|
80
|
+
/** Direction indicator for frontend display. */
|
|
81
|
+
dir: v.pipe(v.string(), v.description("Direction indicator for frontend display.")),
|
|
82
|
+
/** Realized PnL. */
|
|
83
|
+
closedPnl: v.pipe(_base_js_1.SignedDecimal, v.description("Realized PnL.")),
|
|
84
|
+
/** L1 transaction hash. */
|
|
85
|
+
hash: v.pipe(v.pipe(_base_js_1.Hex, v.length(66)), v.description("L1 transaction hash.")),
|
|
86
|
+
/** Order ID. */
|
|
87
|
+
oid: v.pipe(v.pipe(v.number(), v.safeInteger(), v.minValue(0)), v.description("Order ID.")),
|
|
88
|
+
/** Indicates if the fill was a taker order. */
|
|
89
|
+
crossed: v.pipe(v.boolean(), v.description("Indicates if the fill was a taker order.")),
|
|
90
|
+
/** Fee charged or rebate received (negative indicates rebate). */
|
|
91
|
+
fee: v.pipe(_base_js_1.SignedDecimal, v.description("Fee charged or rebate received (negative indicates rebate).")),
|
|
92
|
+
/** Unique transaction identifier for a partial fill of an order. */
|
|
93
|
+
tid: v.pipe(v.pipe(v.number(), v.safeInteger(), v.minValue(0)), v.description("Unique transaction identifier for a partial fill of an order.")),
|
|
94
|
+
/** Client Order ID. */
|
|
95
|
+
cloid: v.pipe(v.optional(v.pipe(_base_js_1.Hex, v.length(34))), v.description("Client Order ID.")),
|
|
96
|
+
/** Liquidation details. */
|
|
97
|
+
liquidation: v.pipe(v.optional(exports.FillLiquidation), v.description("Liquidation details.")),
|
|
98
|
+
/** Token in which the fee is denominated (e.g., "USDC"). */
|
|
99
|
+
feeToken: v.pipe(v.string(), v.description('Token in which the fee is denominated (e.g., "USDC").')),
|
|
100
|
+
/** ID of the TWAP. */
|
|
101
|
+
twapId: v.pipe(v.union([v.pipe(v.number(), v.safeInteger(), v.minValue(0)), v.null()]), v.description("ID of the TWAP.")),
|
|
102
|
+
}), v.description("Trade fill record."));
|
|
103
|
+
/** Open order details. */
|
|
104
|
+
exports.Order = v.pipe(v.strictObject({
|
|
105
|
+
/** Asset symbol. */
|
|
106
|
+
coin: v.pipe(v.string(), v.description("Asset symbol.")),
|
|
107
|
+
/** Order side ("B" = Bid/Buy, "A" = Ask/Sell). */
|
|
108
|
+
side: v.pipe(v.union([v.literal("B"), v.literal("A")]), v.description('Order side ("B" = Bid/Buy, "A" = Ask/Sell).')),
|
|
109
|
+
/** Limit price. */
|
|
110
|
+
limitPx: v.pipe(_base_js_1.UnsignedDecimal, v.description("Limit price.")),
|
|
111
|
+
/** Size. */
|
|
112
|
+
sz: v.pipe(_base_js_1.UnsignedDecimal, v.description("Size.")),
|
|
113
|
+
/** Order ID. */
|
|
114
|
+
oid: v.pipe(v.pipe(v.number(), v.safeInteger(), v.minValue(0)), v.description("Order ID.")),
|
|
115
|
+
/** Timestamp when the order was placed (in ms since epoch). */
|
|
116
|
+
timestamp: v.pipe(v.pipe(v.number(), v.safeInteger(), v.minValue(0)), v.description("Timestamp when the order was placed (in ms since epoch).")),
|
|
117
|
+
/** Original size at order placement. */
|
|
118
|
+
origSz: v.pipe(_base_js_1.UnsignedDecimal, v.description("Original size at order placement.")),
|
|
119
|
+
/** Client Order ID. */
|
|
120
|
+
cloid: v.pipe(v.optional(v.pipe(_base_js_1.Hex, v.length(34))), v.description("Client Order ID.")),
|
|
121
|
+
/** Indicates if the order is reduce-only. */
|
|
122
|
+
reduceOnly: v.pipe(v.optional(v.literal(true)), v.description("Indicates if the order is reduce-only.")),
|
|
123
|
+
}), v.description("Open order details."));
|
|
124
|
+
/**
|
|
125
|
+
* Order types for market execution.
|
|
126
|
+
* - `Market`: Executes immediately at the market price.
|
|
127
|
+
* - `Limit`: Executes at the specified limit price or better.
|
|
128
|
+
* - `Stop Market`: Activates as a market order when a stop price is reached.
|
|
129
|
+
* - `Stop Limit`: Activates as a limit order when a stop price is reached.
|
|
130
|
+
* - `Take Profit Market`: Executes as a market order when a take profit price is reached.
|
|
131
|
+
* - `Take Profit Limit`: Executes as a limit order when a take profit price is reached.
|
|
132
|
+
*
|
|
133
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/trading/order-types
|
|
134
|
+
*/
|
|
135
|
+
exports.OrderType = v.pipe(v.union([
|
|
136
|
+
v.literal("Market"),
|
|
137
|
+
v.literal("Limit"),
|
|
138
|
+
v.literal("Stop Market"),
|
|
139
|
+
v.literal("Stop Limit"),
|
|
140
|
+
v.literal("Take Profit Market"),
|
|
141
|
+
v.literal("Take Profit Limit"),
|
|
142
|
+
]), v.description("Order types for market execution." +
|
|
143
|
+
"\n- `Market`: Executes immediately at the market price. " +
|
|
144
|
+
"\n- `Limit`: Executes at the specified limit price or better. " +
|
|
145
|
+
"\n- `Stop Market`: Activates as a market order when a stop price is reached. " +
|
|
146
|
+
"\n- `Stop Limit`: Activates as a limit order when a stop price is reached. " +
|
|
147
|
+
"\n- `Take Profit Market`: Executes as a market order when a take profit price is reached. " +
|
|
148
|
+
"\n- `Take Profit Limit`: Executes as a limit order when a take profit price is reached. "));
|
|
149
|
+
/**
|
|
150
|
+
* Time-in-force options.
|
|
151
|
+
* - `Gtc`: Remains active until filled or canceled.
|
|
152
|
+
* - `Ioc`: Fills immediately or cancels any unfilled portion.
|
|
153
|
+
* - `Alo`: Adds liquidity only.
|
|
154
|
+
* - `FrontendMarket`: Similar to Ioc, used in Hyperliquid UI.
|
|
155
|
+
* - `LiquidationMarket`: Similar to Ioc, used in Hyperliquid UI.
|
|
156
|
+
*/
|
|
157
|
+
exports.TIF = v.pipe(v.union([
|
|
158
|
+
v.literal("Gtc"),
|
|
159
|
+
v.literal("Ioc"),
|
|
160
|
+
v.literal("Alo"),
|
|
161
|
+
v.literal("FrontendMarket"),
|
|
162
|
+
v.literal("LiquidationMarket"),
|
|
163
|
+
]), v.description("Time-in-force options." +
|
|
164
|
+
"\n- `Gtc`: Remains active until filled or canceled. " +
|
|
165
|
+
"\n- `Ioc`: Fills immediately or cancels any unfilled portion. " +
|
|
166
|
+
"\n- `Alo`: Adds liquidity only. " +
|
|
167
|
+
"\n- `FrontendMarket`: Similar to Ioc, used in Hyperliquid UI. " +
|
|
168
|
+
"\n- `LiquidationMarket`: Similar to Ioc, used in Hyperliquid UI."));
|
|
169
|
+
/** Open order with additional display information. */
|
|
170
|
+
exports.FrontendOrder = v.pipe(v.strictObject({
|
|
171
|
+
...v.omit(v.strictObject(exports.Order.entries), ["reduceOnly", "cloid"]).entries,
|
|
172
|
+
/** Condition for triggering the order. */
|
|
173
|
+
triggerCondition: v.pipe(v.string(), v.description("Condition for triggering the order.")),
|
|
174
|
+
/** Indicates if the order is a trigger order. */
|
|
175
|
+
isTrigger: v.pipe(v.boolean(), v.description("Indicates if the order is a trigger order.")),
|
|
176
|
+
/** Trigger price. */
|
|
177
|
+
triggerPx: v.pipe(_base_js_1.UnsignedDecimal, v.description("Trigger price.")),
|
|
178
|
+
/** Child orders associated with this order. */
|
|
179
|
+
children: v.pipe(
|
|
180
|
+
// deno-lint-ignore no-explicit-any
|
|
181
|
+
v.array(v.lazy(() => exports.FrontendOrder)), v.description("Child orders associated with this order.")),
|
|
182
|
+
/** Indicates if the order is a position TP/SL order. */
|
|
183
|
+
isPositionTpsl: v.pipe(v.boolean(), v.description("Indicates if the order is a position TP/SL order.")),
|
|
184
|
+
/** Indicates whether the order is reduce-only. */
|
|
185
|
+
reduceOnly: v.pipe(v.boolean(), v.description("Indicates whether the order is reduce-only.")),
|
|
186
|
+
/** Order type. */
|
|
187
|
+
orderType: v.pipe(exports.OrderType, v.description("Order type.")),
|
|
188
|
+
/** Time-in-force option. */
|
|
189
|
+
tif: v.pipe(v.union([exports.TIF, v.null()]), v.description("Time-in-force option.")),
|
|
190
|
+
/** Client Order ID. */
|
|
191
|
+
cloid: v.pipe(v.union([v.pipe(_base_js_1.Hex, v.length(34)), v.null()]), v.description("Client Order ID.")),
|
|
192
|
+
}), v.description("Open order with additional display information."));
|
|
193
|
+
/**
|
|
194
|
+
* Order processing status.
|
|
195
|
+
* - `open`: Order active and waiting to be filled.
|
|
196
|
+
* - `filled`: Order fully executed.
|
|
197
|
+
* - `canceled`: Order canceled by the user.
|
|
198
|
+
* - `triggered`: Order triggered and awaiting execution.
|
|
199
|
+
* - `rejected`: Order rejected by the system.
|
|
200
|
+
* - `marginCanceled`: Order canceled due to insufficient margin.
|
|
201
|
+
* - `vaultWithdrawalCanceled`: Canceled due to a user withdrawal from vault.
|
|
202
|
+
* - `openInterestCapCanceled`: Canceled due to order being too aggressive when open interest was at cap.
|
|
203
|
+
* - `selfTradeCanceled`: Canceled due to self-trade prevention.
|
|
204
|
+
* - `reduceOnlyCanceled`: Canceled reduced-only order that does not reduce position.
|
|
205
|
+
* - `siblingFilledCanceled`: Canceled due to sibling ordering being filled.
|
|
206
|
+
* - `delistedCanceled`: Canceled due to asset delisting.
|
|
207
|
+
* - `liquidatedCanceled`: Canceled due to liquidation.
|
|
208
|
+
* - `scheduledCancel`: Canceled due to exceeding scheduled cancel deadline (dead man's switch).
|
|
209
|
+
*/
|
|
210
|
+
exports.OrderProcessingStatus = v.pipe(v.union([
|
|
211
|
+
v.literal("open"),
|
|
212
|
+
v.literal("filled"),
|
|
213
|
+
v.literal("canceled"),
|
|
214
|
+
v.literal("triggered"),
|
|
215
|
+
v.literal("rejected"),
|
|
216
|
+
v.literal("marginCanceled"),
|
|
217
|
+
v.literal("vaultWithdrawalCanceled"),
|
|
218
|
+
v.literal("openInterestCapCanceled"),
|
|
219
|
+
v.literal("selfTradeCanceled"),
|
|
220
|
+
v.literal("reduceOnlyCanceled"),
|
|
221
|
+
v.literal("siblingFilledCanceled"),
|
|
222
|
+
v.literal("delistedCanceled"),
|
|
223
|
+
v.literal("liquidatedCanceled"),
|
|
224
|
+
v.literal("scheduledCancel"),
|
|
225
|
+
v.literal("reduceOnlyRejected"),
|
|
226
|
+
]), v.description("Order processing status." +
|
|
227
|
+
"\n- `open`: Order active and waiting to be filled. " +
|
|
228
|
+
"\n- `filled`: Order fully executed. " +
|
|
229
|
+
"\n- `canceled`: Order canceled by the user. " +
|
|
230
|
+
"\n- `triggered`: Order triggered and awaiting execution. " +
|
|
231
|
+
"\n- `rejected`: Order rejected by the system. " +
|
|
232
|
+
"\n- `marginCanceled`: Order canceled due to insufficient margin. " +
|
|
233
|
+
"\n- `vaultWithdrawalCanceled`: Canceled due to a user withdrawal from vault. " +
|
|
234
|
+
"\n- `openInterestCapCanceled`: Canceled due to order being too aggressive when open interest was at cap. " +
|
|
235
|
+
"\n- `selfTradeCanceled`: Canceled due to self-trade prevention. " +
|
|
236
|
+
"\n- `reduceOnlyCanceled`: Canceled reduced-only order that does not reduce position. " +
|
|
237
|
+
"\n- `siblingFilledCanceled`: Canceled due to sibling ordering being filled. " +
|
|
238
|
+
"\n- `delistedCanceled`: Canceled due to asset delisting. " +
|
|
239
|
+
"\n- `liquidatedCanceled`: Canceled due to liquidation. " +
|
|
240
|
+
"\n- `scheduledCancel`: Canceled due to exceeding scheduled cancel deadline (dead man's switch)."));
|
|
241
|
+
/** Order with current processing status. */
|
|
242
|
+
exports.OrderStatus = v.pipe(v.strictObject({
|
|
243
|
+
/** Order details. */
|
|
244
|
+
order: v.pipe(exports.Order, v.description("Order details.")),
|
|
245
|
+
/** Order processing status. */
|
|
246
|
+
status: v.pipe(exports.OrderProcessingStatus, v.description("Order processing status.")),
|
|
247
|
+
/** Timestamp when the status was last updated (in ms since epoch). */
|
|
248
|
+
statusTimestamp: v.pipe(v.pipe(v.number(), v.safeInteger(), v.minValue(0)), v.description("Timestamp when the status was last updated (in ms since epoch).")),
|
|
249
|
+
}), v.description("Order with current processing status."));
|
|
250
|
+
/** Frontend order with current processing status. */
|
|
251
|
+
exports.FrontendOrderStatus = v.pipe(v.strictObject({
|
|
252
|
+
/** Order details. */
|
|
253
|
+
order: v.pipe(exports.FrontendOrder, v.description("Order details.")),
|
|
254
|
+
/** Order processing status. */
|
|
255
|
+
status: v.pipe(exports.OrderProcessingStatus, v.description("Order processing status.")),
|
|
256
|
+
/** Timestamp when the status was last updated (in ms since epoch). */
|
|
257
|
+
statusTimestamp: v.pipe(v.pipe(v.number(), v.safeInteger(), v.minValue(0)), v.description("Timestamp when the status was last updated (in ms since epoch).")),
|
|
258
|
+
}), v.description("Frontend order with current processing status."));
|
|
259
|
+
/** Result of an order status lookup. */
|
|
260
|
+
exports.OrderLookup = v.pipe(v.union([
|
|
261
|
+
v.strictObject({
|
|
262
|
+
/** Indicates that the order was found. */
|
|
263
|
+
status: v.pipe(v.literal("order"), v.description("Indicates that the order was found.")),
|
|
264
|
+
/** Order details. */
|
|
265
|
+
order: v.pipe(exports.FrontendOrderStatus, v.description("Order details.")),
|
|
266
|
+
}),
|
|
267
|
+
v.strictObject({
|
|
268
|
+
/** Indicates that the order was not found. */
|
|
269
|
+
status: v.pipe(v.literal("unknownOid"), v.description("Indicates that the order was not found.")),
|
|
270
|
+
}),
|
|
271
|
+
]), v.description("Result of an order status lookup."));
|
|
272
|
+
/** Current state of a TWAP order. */
|
|
273
|
+
exports.TwapState = v.pipe(v.strictObject({
|
|
274
|
+
/** Asset symbol. */
|
|
275
|
+
coin: v.pipe(v.string(), v.description("Asset symbol.")),
|
|
276
|
+
/** Executed notional value. */
|
|
277
|
+
executedNtl: v.pipe(_base_js_1.UnsignedDecimal, v.description("Executed notional value.")),
|
|
278
|
+
/** Executed size. */
|
|
279
|
+
executedSz: v.pipe(_base_js_1.UnsignedDecimal, v.description("Executed size.")),
|
|
280
|
+
/** Duration in minutes. */
|
|
281
|
+
minutes: v.pipe(v.pipe(v.number(), v.safeInteger(), v.minValue(0)), v.description("Duration in minutes.")),
|
|
282
|
+
/** Indicates if the TWAP randomizes execution. */
|
|
283
|
+
randomize: v.pipe(v.boolean(), v.description("Indicates if the TWAP randomizes execution.")),
|
|
284
|
+
/** Indicates if the order is reduce-only. */
|
|
285
|
+
reduceOnly: v.pipe(v.boolean(), v.description("Indicates if the order is reduce-only.")),
|
|
286
|
+
/** Order side ("B" = Bid/Buy, "A" = Ask/Sell). */
|
|
287
|
+
side: v.pipe(v.union([v.literal("B"), v.literal("A")]), v.description('Order side ("B" = Bid/Buy, "A" = Ask/Sell).')),
|
|
288
|
+
/** Order size. */
|
|
289
|
+
sz: v.pipe(_base_js_1.UnsignedDecimal, v.description("Order size.")),
|
|
290
|
+
/** Start time of the TWAP order (in ms since epoch). */
|
|
291
|
+
timestamp: v.pipe(v.pipe(v.number(), v.safeInteger(), v.minValue(0)), v.description("Start time of the TWAP order (in ms since epoch).")),
|
|
292
|
+
/** User address. */
|
|
293
|
+
user: v.pipe(v.pipe(_base_js_1.Hex, v.length(42)), v.description("User address.")),
|
|
294
|
+
}), v.description("Current state of a TWAP order."));
|
|
295
|
+
/**
|
|
296
|
+
* TWAP order status.
|
|
297
|
+
* - `finished`: Fully executed.
|
|
298
|
+
* - `activated`: Active and executing.
|
|
299
|
+
* - `terminated`: Terminated.
|
|
300
|
+
* - `error`: An error occurred.
|
|
301
|
+
*/
|
|
302
|
+
exports.TwapStatus = v.pipe(v.union([
|
|
303
|
+
v.strictObject({
|
|
304
|
+
/** Status of the TWAP order. */
|
|
305
|
+
status: v.pipe(v.union([v.literal("finished"), v.literal("activated"), v.literal("terminated")]), v.description("Status of the TWAP order.")),
|
|
306
|
+
}),
|
|
307
|
+
v.strictObject({
|
|
308
|
+
/** Status of the TWAP order. */
|
|
309
|
+
status: v.pipe(v.literal("error"), v.description("Status of the TWAP order.")),
|
|
310
|
+
/** Error message. */
|
|
311
|
+
description: v.pipe(v.string(), v.description("Error message.")),
|
|
312
|
+
}),
|
|
313
|
+
]), v.description("TWAP order status. " +
|
|
314
|
+
"\n- `finished`: Fully executed. " +
|
|
315
|
+
"\n- `activated`: Active and executing. " +
|
|
316
|
+
"\n- `terminated`: Terminated. " +
|
|
317
|
+
"\n- `error`: An error occurred."));
|
|
318
|
+
/** TWAP history record for a user. */
|
|
319
|
+
exports.TwapHistory = v.pipe(v.strictObject({
|
|
320
|
+
/** Creation time of the history record (in seconds since epoch). */
|
|
321
|
+
time: v.pipe(v.pipe(v.number(), v.safeInteger(), v.minValue(0)), v.description("Creation time of the history record (in seconds since epoch).")),
|
|
322
|
+
/** State of the TWAP order. */
|
|
323
|
+
state: v.pipe(exports.TwapState, v.description("State of the TWAP order.")),
|
|
324
|
+
/** Current status of the TWAP order. */
|
|
325
|
+
status: v.pipe(exports.TwapStatus, v.description("Current status of the TWAP order.")),
|
|
326
|
+
}), v.description("TWAP history record for a user."));
|
|
327
|
+
/** TWAP slice fill details. */
|
|
328
|
+
exports.TwapSliceFill = v.pipe(v.strictObject({
|
|
329
|
+
/** Fill details for the TWAP slice. */
|
|
330
|
+
fill: v.pipe(v.omit(v.strictObject(exports.Fill.entries), ["cloid", "liquidation"]), v.description("Fill details for the TWAP slice.")),
|
|
331
|
+
/** ID of the TWAP. */
|
|
332
|
+
twapId: v.pipe(v.pipe(v.number(), v.safeInteger(), v.minValue(0)), v.description("ID of the TWAP.")),
|
|
333
|
+
}), v.description("TWAP slice fill details."));
|