@syldel/hl-shared-types 0.0.1 → 0.0.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/README.md +27 -22
- package/dist/index.d.ts +1 -6
- package/dist/index.js +1 -6
- package/dist/interfaces/actions/cancel.interfaces.d.ts +14 -0
- package/dist/interfaces/actions/index.d.ts +4 -0
- package/dist/interfaces/actions/index.js +20 -0
- package/dist/interfaces/actions/modify.interfaces.d.ts +26 -0
- package/dist/interfaces/actions/order.interfaces.d.ts +12 -0
- package/dist/interfaces/actions/transfer.interfaces.d.ts +94 -0
- package/dist/interfaces/actions/transfer.interfaces.js +10 -0
- package/dist/interfaces/common/common.interfaces.d.ts +4 -0
- package/dist/interfaces/common/index.d.ts +1 -0
- package/dist/interfaces/common/index.js +17 -0
- package/dist/interfaces/index.d.ts +8 -0
- package/dist/interfaces/index.js +24 -0
- package/dist/interfaces/orders/index.d.ts +4 -0
- package/dist/interfaces/orders/index.js +20 -0
- package/dist/interfaces/orders/open-order.interfaces.d.ts +20 -0
- package/dist/interfaces/orders/order-details.interfaces.d.ts +69 -0
- package/dist/interfaces/orders/order-status.interfaces.d.ts +34 -0
- package/dist/interfaces/orders/order-status.interfaces.js +2 -0
- package/dist/interfaces/orders/user-fills.interfaces.d.ts +19 -0
- package/dist/interfaces/orders/user-fills.interfaces.js +2 -0
- package/dist/interfaces/params/index.d.ts +1 -0
- package/dist/interfaces/params/index.js +17 -0
- package/dist/interfaces/params/params.d.ts +64 -0
- package/dist/interfaces/params/params.js +2 -0
- package/dist/interfaces/params/signature.interfaces.d.ts +13 -0
- package/dist/interfaces/params/signature.interfaces.js +2 -0
- package/dist/interfaces/perp/balance.interfaces.d.ts +42 -0
- package/dist/interfaces/perp/balance.interfaces.js +2 -0
- package/dist/interfaces/perp/index.d.ts +2 -0
- package/dist/interfaces/perp/index.js +18 -0
- package/dist/interfaces/perp/meta.interfaces.d.ts +50 -0
- package/dist/interfaces/perp/meta.interfaces.js +2 -0
- package/dist/interfaces/responses/cancel.interfaces.d.ts +9 -0
- package/dist/interfaces/responses/cancel.interfaces.js +2 -0
- package/dist/interfaces/responses/error.interfaces.d.ts +10 -0
- package/dist/interfaces/responses/error.interfaces.js +18 -0
- package/dist/interfaces/responses/index.d.ts +4 -0
- package/dist/interfaces/responses/index.js +20 -0
- package/dist/interfaces/responses/order.interfaces.d.ts +18 -0
- package/dist/interfaces/responses/order.interfaces.js +2 -0
- package/dist/interfaces/responses/success.interfaces.d.ts +4 -0
- package/dist/interfaces/responses/success.interfaces.js +2 -0
- package/dist/interfaces/smart/batch-protective-order.interfaces.d.ts +31 -0
- package/dist/interfaces/smart/batch-protective-order.interfaces.js +2 -0
- package/dist/interfaces/smart/index.d.ts +3 -0
- package/dist/interfaces/smart/index.js +19 -0
- package/dist/interfaces/smart/protective-order.interfaces.d.ts +11 -0
- package/dist/interfaces/smart/protective-order.interfaces.js +2 -0
- package/dist/interfaces/smart/smart-order.interfaces.d.ts +26 -0
- package/dist/interfaces/smart/smart-order.interfaces.js +2 -0
- package/dist/interfaces/spot/balance.interfaces.d.ts +11 -0
- package/dist/interfaces/spot/balance.interfaces.js +2 -0
- package/dist/interfaces/spot/index.d.ts +2 -0
- package/dist/interfaces/spot/index.js +18 -0
- package/dist/interfaces/{market.d.ts → spot/meta.interfaces.d.ts} +4 -5
- package/dist/interfaces/spot/meta.interfaces.js +2 -0
- package/package.json +30 -5
- package/dist/interfaces/account.d.ts +0 -23
- package/dist/interfaces/common.d.ts +0 -7
- package/dist/interfaces/dto.d.ts +0 -32
- package/dist/interfaces/orders.d.ts +0 -15
- package/dist/interfaces/responses.d.ts +0 -37
- /package/dist/interfaces/{account.js → actions/cancel.interfaces.js} +0 -0
- /package/dist/interfaces/{common.js → actions/modify.interfaces.js} +0 -0
- /package/dist/interfaces/{dto.js → actions/order.interfaces.js} +0 -0
- /package/dist/interfaces/{market.js → common/common.interfaces.js} +0 -0
- /package/dist/interfaces/{orders.js → orders/open-order.interfaces.js} +0 -0
- /package/dist/interfaces/{responses.js → orders/order-details.interfaces.js} +0 -0
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { DecimalString, Timestamp } from '../common';
|
|
2
|
+
export interface HLPerpLeverage {
|
|
3
|
+
rawUsd: DecimalString;
|
|
4
|
+
type: 'isolated' | 'cross';
|
|
5
|
+
value: number;
|
|
6
|
+
}
|
|
7
|
+
export interface HLPerpCumFunding {
|
|
8
|
+
allTime: DecimalString;
|
|
9
|
+
sinceChange: DecimalString;
|
|
10
|
+
sinceOpen: DecimalString;
|
|
11
|
+
}
|
|
12
|
+
export interface HLPerpPositionDetail {
|
|
13
|
+
coin: string;
|
|
14
|
+
cumFunding: HLPerpCumFunding;
|
|
15
|
+
entryPx: DecimalString;
|
|
16
|
+
leverage: HLPerpLeverage;
|
|
17
|
+
liquidationPx: DecimalString;
|
|
18
|
+
marginUsed: DecimalString;
|
|
19
|
+
maxLeverage: number;
|
|
20
|
+
positionValue: DecimalString;
|
|
21
|
+
returnOnEquity: DecimalString;
|
|
22
|
+
szi: DecimalString;
|
|
23
|
+
unrealizedPnl: DecimalString;
|
|
24
|
+
}
|
|
25
|
+
export interface HLPerpAssetPosition {
|
|
26
|
+
position: HLPerpPositionDetail | null;
|
|
27
|
+
type: 'oneWay' | 'hedged';
|
|
28
|
+
}
|
|
29
|
+
export interface HLPerpMarginSummary {
|
|
30
|
+
accountValue: DecimalString;
|
|
31
|
+
totalMarginUsed: DecimalString;
|
|
32
|
+
totalNtlPos: DecimalString;
|
|
33
|
+
totalRawUsd: DecimalString;
|
|
34
|
+
}
|
|
35
|
+
export interface HLClearinghouseState {
|
|
36
|
+
assetPositions: HLPerpAssetPosition[];
|
|
37
|
+
crossMaintenanceMarginUsed: DecimalString;
|
|
38
|
+
crossMarginSummary: HLPerpMarginSummary;
|
|
39
|
+
marginSummary: HLPerpMarginSummary;
|
|
40
|
+
time: Timestamp;
|
|
41
|
+
withdrawable: DecimalString;
|
|
42
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./balance.interfaces"), exports);
|
|
18
|
+
__exportStar(require("./meta.interfaces"), exports);
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { DecimalString } from '../common';
|
|
2
|
+
export interface HLPerpMarketInfo {
|
|
3
|
+
name: string;
|
|
4
|
+
szDecimals: number;
|
|
5
|
+
maxLeverage: number;
|
|
6
|
+
onlyIsolated?: boolean;
|
|
7
|
+
isDelisted?: boolean;
|
|
8
|
+
marginMode?: 'strictIsolated' | 'noCross';
|
|
9
|
+
}
|
|
10
|
+
export interface HLPerpMarginTier {
|
|
11
|
+
lowerBound: string;
|
|
12
|
+
maxLeverage: number;
|
|
13
|
+
}
|
|
14
|
+
export interface HLPerpMarginTable {
|
|
15
|
+
description: string;
|
|
16
|
+
marginTiers: HLPerpMarginTier[];
|
|
17
|
+
}
|
|
18
|
+
export type HLPerpMarginTableEntry = [number, HLPerpMarginTable];
|
|
19
|
+
export interface HLPerpMeta {
|
|
20
|
+
universe: HLPerpMarketInfo[];
|
|
21
|
+
marginTables: HLPerpMarginTableEntry[];
|
|
22
|
+
}
|
|
23
|
+
export interface HLPerpMarketUniverse extends HLPerpMarketInfo {
|
|
24
|
+
index: number;
|
|
25
|
+
}
|
|
26
|
+
export interface HLPerpAssetCtx {
|
|
27
|
+
dayNtlVlm: string;
|
|
28
|
+
funding: string;
|
|
29
|
+
impactPxs: string[];
|
|
30
|
+
markPx: string;
|
|
31
|
+
midPx: string;
|
|
32
|
+
openInterest: string;
|
|
33
|
+
oraclePx: string;
|
|
34
|
+
premium: string;
|
|
35
|
+
prevDayPx: string;
|
|
36
|
+
}
|
|
37
|
+
export type HLPerpMetaAndCtx = [{
|
|
38
|
+
universe: HLPerpMarketInfo[];
|
|
39
|
+
}, HLPerpAssetCtx[]];
|
|
40
|
+
export interface HLPerpMarket {
|
|
41
|
+
index: number;
|
|
42
|
+
name: string;
|
|
43
|
+
szDecimals: number;
|
|
44
|
+
maxLeverage: number;
|
|
45
|
+
marginTableId?: number;
|
|
46
|
+
markPrice?: DecimalString;
|
|
47
|
+
midPrice?: DecimalString;
|
|
48
|
+
funding?: DecimalString;
|
|
49
|
+
openInterest?: DecimalString;
|
|
50
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface HLErrorResponse {
|
|
2
|
+
status: 'error';
|
|
3
|
+
message: string;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Type guard pour vérifier si un objet est une HLErrorResponse.
|
|
7
|
+
* @param obj Objet à vérifier.
|
|
8
|
+
* @returns True si l'objet correspond à HLErrorResponse.
|
|
9
|
+
*/
|
|
10
|
+
export declare function isHLErrorResponse(obj: unknown): obj is HLErrorResponse;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isHLErrorResponse = isHLErrorResponse;
|
|
4
|
+
/**
|
|
5
|
+
* Type guard pour vérifier si un objet est une HLErrorResponse.
|
|
6
|
+
* @param obj Objet à vérifier.
|
|
7
|
+
* @returns True si l'objet correspond à HLErrorResponse.
|
|
8
|
+
*/
|
|
9
|
+
function isHLErrorResponse(obj) {
|
|
10
|
+
if (typeof obj !== 'object' || obj === null) {
|
|
11
|
+
return false;
|
|
12
|
+
}
|
|
13
|
+
const errorObj = obj;
|
|
14
|
+
return ('status' in errorObj &&
|
|
15
|
+
errorObj.status === 'error' &&
|
|
16
|
+
'message' in errorObj &&
|
|
17
|
+
typeof errorObj.message === 'string');
|
|
18
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./error.interfaces"), exports);
|
|
18
|
+
__exportStar(require("./success.interfaces"), exports);
|
|
19
|
+
__exportStar(require("./order.interfaces"), exports);
|
|
20
|
+
__exportStar(require("./cancel.interfaces"), exports);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { DecimalString, HLOid } from '../common';
|
|
2
|
+
export interface HLPlaceOrderStatus {
|
|
3
|
+
resting?: {
|
|
4
|
+
oid: HLOid;
|
|
5
|
+
};
|
|
6
|
+
filled?: {
|
|
7
|
+
oid: HLOid;
|
|
8
|
+
totalSz: DecimalString;
|
|
9
|
+
avgPx: DecimalString;
|
|
10
|
+
};
|
|
11
|
+
error?: string;
|
|
12
|
+
}
|
|
13
|
+
export interface HLPlaceOrderResponse {
|
|
14
|
+
type: 'order';
|
|
15
|
+
data: {
|
|
16
|
+
statuses: HLPlaceOrderStatus[];
|
|
17
|
+
};
|
|
18
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { DecimalString, HLOid } from '../common';
|
|
2
|
+
import { HLOrderDetails } from '../orders';
|
|
3
|
+
import { HLProtectiveKind } from './protective-order.interfaces';
|
|
4
|
+
export interface BatchProtectiveOrderItem {
|
|
5
|
+
sz: string;
|
|
6
|
+
price: string;
|
|
7
|
+
isMarket?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export interface BatchProtectiveOrders {
|
|
10
|
+
assetName: string;
|
|
11
|
+
isBuy: boolean;
|
|
12
|
+
tp?: BatchProtectiveOrderItem[];
|
|
13
|
+
sl?: BatchProtectiveOrderItem[];
|
|
14
|
+
}
|
|
15
|
+
export interface ExistingProtectiveOrder {
|
|
16
|
+
oid: HLOid;
|
|
17
|
+
kind: HLProtectiveKind;
|
|
18
|
+
price: DecimalString;
|
|
19
|
+
sz: DecimalString;
|
|
20
|
+
isMarket: boolean;
|
|
21
|
+
}
|
|
22
|
+
export interface NormalizedProtectiveOrder {
|
|
23
|
+
kind: HLProtectiveKind;
|
|
24
|
+
price: DecimalString;
|
|
25
|
+
sz: DecimalString;
|
|
26
|
+
isMarket?: boolean;
|
|
27
|
+
}
|
|
28
|
+
export interface HLModifyInput {
|
|
29
|
+
oid: HLOid;
|
|
30
|
+
order: HLOrderDetails;
|
|
31
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./smart-order.interfaces"), exports);
|
|
18
|
+
__exportStar(require("./protective-order.interfaces"), exports);
|
|
19
|
+
__exportStar(require("./batch-protective-order.interfaces"), exports);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { DecimalString } from '../common';
|
|
2
|
+
export type HLProtectiveKind = 'tp' | 'sl';
|
|
3
|
+
export interface ProtectiveOrderParams {
|
|
4
|
+
assetName: string;
|
|
5
|
+
kind: HLProtectiveKind;
|
|
6
|
+
isBuy: boolean;
|
|
7
|
+
sz: DecimalString;
|
|
8
|
+
price: DecimalString;
|
|
9
|
+
isMarket?: boolean;
|
|
10
|
+
isTestnet?: boolean;
|
|
11
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { DecimalString, HLOid } from '../common';
|
|
2
|
+
export type HLOrderSize = {
|
|
3
|
+
type: 'base';
|
|
4
|
+
sz: DecimalString;
|
|
5
|
+
} | {
|
|
6
|
+
type: 'quote';
|
|
7
|
+
usdc: DecimalString;
|
|
8
|
+
} | {
|
|
9
|
+
type: 'percent';
|
|
10
|
+
percent: DecimalString;
|
|
11
|
+
};
|
|
12
|
+
export interface InstantOrderParams {
|
|
13
|
+
assetName: string;
|
|
14
|
+
isBuy: boolean;
|
|
15
|
+
size: HLOrderSize;
|
|
16
|
+
reduceOnly?: boolean;
|
|
17
|
+
isTestnet?: boolean;
|
|
18
|
+
maxRetries?: number;
|
|
19
|
+
delayMs?: number;
|
|
20
|
+
}
|
|
21
|
+
export interface WaitOrderStatusOptions {
|
|
22
|
+
oid: HLOid;
|
|
23
|
+
timeoutMs?: number;
|
|
24
|
+
pollIntervalMs?: number;
|
|
25
|
+
isTestnet?: boolean;
|
|
26
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { DecimalString } from '../common';
|
|
2
|
+
export interface HLSpotBalance {
|
|
3
|
+
coin: string;
|
|
4
|
+
token: number;
|
|
5
|
+
hold: DecimalString;
|
|
6
|
+
total: DecimalString;
|
|
7
|
+
entryNtl: DecimalString;
|
|
8
|
+
}
|
|
9
|
+
export interface HLSpotClearinghouseState {
|
|
10
|
+
balances: HLSpotBalance[];
|
|
11
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./balance.interfaces"), exports);
|
|
18
|
+
__exportStar(require("./meta.interfaces"), exports);
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { DecimalString, HexString } from './common';
|
|
2
1
|
export interface HLSpotTokenMeta {
|
|
3
2
|
name: string;
|
|
4
3
|
szDecimals: number;
|
|
5
4
|
weiDecimals: number;
|
|
6
5
|
index: number;
|
|
7
|
-
tokenId:
|
|
6
|
+
tokenId: string;
|
|
8
7
|
isCanonical: boolean;
|
|
8
|
+
evmContract: string | null;
|
|
9
|
+
fullName: string | null;
|
|
9
10
|
}
|
|
10
11
|
export interface HLSpotMarketMeta {
|
|
11
12
|
name: string;
|
|
@@ -18,7 +19,5 @@ export interface HLSpotMeta {
|
|
|
18
19
|
universe: HLSpotMarketMeta[];
|
|
19
20
|
}
|
|
20
21
|
export interface HLSpotAssetSummary extends HLSpotMarketMeta {
|
|
21
|
-
szDecimals
|
|
22
|
-
markPrice: DecimalString;
|
|
23
|
-
midPrice: DecimalString;
|
|
22
|
+
szDecimals?: number;
|
|
24
23
|
}
|
package/package.json
CHANGED
|
@@ -1,23 +1,48 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@syldel/hl-shared-types",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"description": "Shared Hyperliquid
|
|
3
|
+
"version": "0.0.4",
|
|
4
|
+
"description": "Shared TypeScript interfaces and types for Hyperliquid integration.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/Syldel/hl-shared-types.git"
|
|
10
|
+
},
|
|
11
|
+
"bugs": {
|
|
12
|
+
"url": "https://github.com/Syldel/hl-shared-types/issues"
|
|
13
|
+
},
|
|
14
|
+
"homepage": "https://github.com/Syldel/hl-shared-types#readme",
|
|
7
15
|
"files": [
|
|
8
16
|
"dist"
|
|
9
17
|
],
|
|
10
18
|
"scripts": {
|
|
11
|
-
"
|
|
12
|
-
"
|
|
19
|
+
"lint": "eslint .",
|
|
20
|
+
"lint:fix": "eslint . --fix",
|
|
21
|
+
"clean": "rm -rf dist",
|
|
22
|
+
"build": "npm run lint && npm run clean && tsc",
|
|
23
|
+
"prepublishOnly": "npm run build",
|
|
24
|
+
"release": "npm run build && npm version patch && npm publish"
|
|
13
25
|
},
|
|
14
|
-
"
|
|
26
|
+
"publishConfig": {
|
|
27
|
+
"access": "public"
|
|
28
|
+
},
|
|
29
|
+
"keywords": [
|
|
30
|
+
"hyperliquid",
|
|
31
|
+
"trading",
|
|
32
|
+
"types",
|
|
33
|
+
"interfaces",
|
|
34
|
+
"crypto",
|
|
35
|
+
"exchange",
|
|
36
|
+
"defi"
|
|
37
|
+
],
|
|
15
38
|
"author": "Syl. D.",
|
|
16
39
|
"license": "ISC",
|
|
17
40
|
"devDependencies": {
|
|
18
41
|
"eslint": "^9.39.2",
|
|
19
42
|
"eslint-config-prettier": "^10.1.8",
|
|
43
|
+
"eslint-plugin-jsonc": "^2.21.0",
|
|
20
44
|
"eslint-plugin-prettier": "^5.5.5",
|
|
45
|
+
"jsonc-eslint-parser": "^2.4.2",
|
|
21
46
|
"prettier": "^3.8.0",
|
|
22
47
|
"typescript": "^5.3.3",
|
|
23
48
|
"typescript-eslint": "^8.53.0"
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { DecimalString } from './common';
|
|
2
|
-
export interface HLPerpPosition {
|
|
3
|
-
coin: string;
|
|
4
|
-
szi: DecimalString;
|
|
5
|
-
entryPx: DecimalString;
|
|
6
|
-
leverage: {
|
|
7
|
-
type: 'cross' | 'isolated';
|
|
8
|
-
value: number;
|
|
9
|
-
};
|
|
10
|
-
unrealizedPnl: DecimalString;
|
|
11
|
-
liquidationPx: DecimalString | null;
|
|
12
|
-
marginUsed: DecimalString;
|
|
13
|
-
}
|
|
14
|
-
export interface HLClearinghouseState {
|
|
15
|
-
marginSummary: {
|
|
16
|
-
accountValue: DecimalString;
|
|
17
|
-
totalMarginUsed: DecimalString;
|
|
18
|
-
withdrawable: DecimalString;
|
|
19
|
-
};
|
|
20
|
-
assetPositions: {
|
|
21
|
-
position: HLPerpPosition | null;
|
|
22
|
-
}[];
|
|
23
|
-
}
|
package/dist/interfaces/dto.d.ts
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { HLOrderDetailsDto } from './orders';
|
|
2
|
-
export interface InstantOrderDto {
|
|
3
|
-
assetName: string;
|
|
4
|
-
isBuy: boolean;
|
|
5
|
-
size: {
|
|
6
|
-
type: 'base' | 'quote' | 'percent';
|
|
7
|
-
sz?: string;
|
|
8
|
-
usdc?: string;
|
|
9
|
-
percent?: string;
|
|
10
|
-
};
|
|
11
|
-
isTestnet?: boolean;
|
|
12
|
-
}
|
|
13
|
-
export interface ProtectiveOrderDto {
|
|
14
|
-
assetName: string;
|
|
15
|
-
kind: 'tp' | 'sl';
|
|
16
|
-
isBuy: boolean;
|
|
17
|
-
sz: string;
|
|
18
|
-
price: string;
|
|
19
|
-
isTestnet?: boolean;
|
|
20
|
-
}
|
|
21
|
-
export interface CancelOrderParams {
|
|
22
|
-
cancels: Array<{
|
|
23
|
-
asset: number;
|
|
24
|
-
oid: number;
|
|
25
|
-
}>;
|
|
26
|
-
isTestnet?: boolean;
|
|
27
|
-
}
|
|
28
|
-
export interface ModifyOrderDto {
|
|
29
|
-
oid: number;
|
|
30
|
-
order: HLOrderDetailsDto;
|
|
31
|
-
isTestnet?: boolean;
|
|
32
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { DecimalString, HLOid } from './common';
|
|
2
|
-
export interface HLOrderDetailsDto {
|
|
3
|
-
assetName: string;
|
|
4
|
-
isBuy: boolean;
|
|
5
|
-
limitPx: DecimalString;
|
|
6
|
-
sz: DecimalString;
|
|
7
|
-
reduceOnly: boolean;
|
|
8
|
-
}
|
|
9
|
-
export interface HLOpenOrder {
|
|
10
|
-
coin: string;
|
|
11
|
-
limitPx: DecimalString;
|
|
12
|
-
oid: HLOid;
|
|
13
|
-
sz: DecimalString;
|
|
14
|
-
timestamp: number;
|
|
15
|
-
}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { HLOid, DecimalString } from './common';
|
|
2
|
-
export interface HLPlaceOrderResponse {
|
|
3
|
-
type: 'order';
|
|
4
|
-
data: {
|
|
5
|
-
statuses: Array<{
|
|
6
|
-
resting?: {
|
|
7
|
-
oid: HLOid;
|
|
8
|
-
};
|
|
9
|
-
filled?: {
|
|
10
|
-
oid: HLOid;
|
|
11
|
-
totalSz: DecimalString;
|
|
12
|
-
avgPx: DecimalString;
|
|
13
|
-
};
|
|
14
|
-
error?: string;
|
|
15
|
-
}>;
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
|
-
export interface HLSmartOrderResponse {
|
|
19
|
-
tp: {
|
|
20
|
-
cancelled: HLOid[];
|
|
21
|
-
created: HLOid[];
|
|
22
|
-
updated: HLOid[];
|
|
23
|
-
};
|
|
24
|
-
sl: {
|
|
25
|
-
cancelled: HLOid[];
|
|
26
|
-
created: HLOid[];
|
|
27
|
-
updated: HLOid[];
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
export interface HLCancelOrderResponse {
|
|
31
|
-
type: 'cancel';
|
|
32
|
-
data: {
|
|
33
|
-
statuses: ('success' | {
|
|
34
|
-
error: string;
|
|
35
|
-
})[];
|
|
36
|
-
};
|
|
37
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|