@lifi/perps-sdk-provider-hyperliquid 6.0.0 → 6.0.2
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/cjs/HyperliquidProvider.d.ts.map +1 -1
- package/dist/cjs/HyperliquidProvider.js.map +1 -1
- package/dist/cjs/services/getActivity.d.ts.map +1 -1
- package/dist/cjs/services/getActivity.js.map +1 -1
- package/dist/cjs/services/getFills.d.ts.map +1 -1
- package/dist/cjs/services/getFills.js.map +1 -1
- package/dist/cjs/services/getOrders.d.ts.map +1 -1
- package/dist/cjs/services/getOrders.js.map +1 -1
- package/dist/cjs/signers/HyperliquidAgentStore.d.ts.map +1 -1
- package/dist/cjs/signers/HyperliquidAgentStore.js.map +1 -1
- package/dist/cjs/signers/signActions.d.ts.map +1 -1
- package/dist/cjs/signers/signActions.js.map +1 -1
- package/dist/cjs/types/account.d.ts.map +1 -1
- package/dist/cjs/types/account.js.map +1 -1
- package/dist/cjs/types/action.d.ts.map +1 -1
- package/dist/cjs/types/action.js.map +1 -1
- package/dist/cjs/types/asset.d.ts.map +1 -1
- package/dist/cjs/types/fill.d.ts.map +1 -1
- package/dist/cjs/types/ledger.d.ts.map +1 -1
- package/dist/cjs/types/ledger.js.map +1 -1
- package/dist/cjs/types/order.d.ts.map +1 -1
- package/dist/cjs/types/ws.d.ts.map +1 -1
- package/dist/cjs/utils/assetId.d.ts.map +1 -1
- package/dist/cjs/utils/assetId.js.map +1 -1
- package/dist/cjs/utils/assetLogo.d.ts.map +1 -1
- package/dist/cjs/utils/assetLogo.js.map +1 -1
- package/dist/cjs/utils/decodeFastAssetCtxs.d.ts.map +1 -1
- package/dist/cjs/utils/decodeFastAssetCtxs.js.map +1 -1
- package/dist/cjs/utils/infoClient.d.ts.map +1 -1
- package/dist/cjs/utils/infoClient.js.map +1 -1
- package/dist/cjs/utils/mapActivity.d.ts.map +1 -1
- package/dist/cjs/utils/mapActivity.js +13 -10
- package/dist/cjs/utils/mapActivity.js.map +1 -1
- package/dist/cjs/utils/mapFill.d.ts.map +1 -1
- package/dist/cjs/utils/mapFill.js.map +1 -1
- package/dist/cjs/utils/mapOrder.d.ts.map +1 -1
- package/dist/cjs/utils/mapOrder.js.map +1 -1
- package/dist/cjs/utils/mapPosition.d.ts.map +1 -1
- package/dist/cjs/utils/mapPosition.js.map +1 -1
- package/dist/cjs/utils/spotBalance.d.ts.map +1 -1
- package/dist/cjs/utils/spotBalance.js.map +1 -1
- package/dist/cjs/utils/spotCollateral.d.ts.map +1 -1
- package/dist/cjs/utils/spotCollateral.js.map +1 -1
- package/dist/cjs/utils/transferMargin.d.ts.map +1 -1
- package/dist/cjs/utils/transferMargin.js +1 -2
- package/dist/cjs/utils/transferMargin.js.map +1 -1
- package/dist/esm/HyperliquidProvider.d.ts +14 -4
- package/dist/esm/HyperliquidProvider.d.ts.map +1 -1
- package/dist/esm/HyperliquidProvider.js.map +1 -1
- package/dist/esm/services/getActivity.d.ts +5 -1
- package/dist/esm/services/getActivity.d.ts.map +1 -1
- package/dist/esm/services/getActivity.js.map +1 -1
- package/dist/esm/services/getFills.d.ts +4 -3
- package/dist/esm/services/getFills.d.ts.map +1 -1
- package/dist/esm/services/getFills.js.map +1 -1
- package/dist/esm/services/getOrders.d.ts +2 -1
- package/dist/esm/services/getOrders.d.ts.map +1 -1
- package/dist/esm/services/getOrders.js.map +1 -1
- package/dist/esm/services/getPositions.d.ts +2 -2
- package/dist/esm/services/getPositions.d.ts.map +1 -1
- package/dist/esm/signers/HyperliquidAgentStore.d.ts +3 -3
- package/dist/esm/signers/HyperliquidAgentStore.d.ts.map +1 -1
- package/dist/esm/signers/HyperliquidAgentStore.js +1 -0
- package/dist/esm/signers/HyperliquidAgentStore.js.map +1 -1
- package/dist/esm/signers/signActions.d.ts +8 -6
- package/dist/esm/signers/signActions.d.ts.map +1 -1
- package/dist/esm/signers/signActions.js +8 -6
- package/dist/esm/signers/signActions.js.map +1 -1
- package/dist/esm/types/account.d.ts +51 -8
- package/dist/esm/types/account.d.ts.map +1 -1
- package/dist/esm/types/account.js.map +1 -1
- package/dist/esm/types/action.d.ts +28 -10
- package/dist/esm/types/action.d.ts.map +1 -1
- package/dist/esm/types/action.js +7 -7
- package/dist/esm/types/action.js.map +1 -1
- package/dist/esm/types/asset.d.ts +60 -15
- package/dist/esm/types/asset.d.ts.map +1 -1
- package/dist/esm/types/fill.d.ts +9 -3
- package/dist/esm/types/fill.d.ts.map +1 -1
- package/dist/esm/types/ledger.d.ts +24 -6
- package/dist/esm/types/ledger.d.ts.map +1 -1
- package/dist/esm/types/ledger.js.map +1 -1
- package/dist/esm/types/order.d.ts +19 -5
- package/dist/esm/types/order.d.ts.map +1 -1
- package/dist/esm/types/ws.d.ts +43 -14
- package/dist/esm/types/ws.d.ts.map +1 -1
- package/dist/esm/utils/assetId.d.ts +7 -7
- package/dist/esm/utils/assetId.d.ts.map +1 -1
- package/dist/esm/utils/assetId.js +7 -7
- package/dist/esm/utils/assetId.js.map +1 -1
- package/dist/esm/utils/assetLogo.d.ts +15 -13
- package/dist/esm/utils/assetLogo.d.ts.map +1 -1
- package/dist/esm/utils/assetLogo.js +15 -13
- package/dist/esm/utils/assetLogo.js.map +1 -1
- package/dist/esm/utils/decodeFastAssetCtxs.d.ts +7 -1
- package/dist/esm/utils/decodeFastAssetCtxs.d.ts.map +1 -1
- package/dist/esm/utils/decodeFastAssetCtxs.js +7 -1
- package/dist/esm/utils/decodeFastAssetCtxs.js.map +1 -1
- package/dist/esm/utils/infoClient.d.ts +6 -1
- package/dist/esm/utils/infoClient.d.ts.map +1 -1
- package/dist/esm/utils/infoClient.js.map +1 -1
- package/dist/esm/utils/mapActivity.d.ts +10 -1
- package/dist/esm/utils/mapActivity.d.ts.map +1 -1
- package/dist/esm/utils/mapActivity.js +23 -11
- package/dist/esm/utils/mapActivity.js.map +1 -1
- package/dist/esm/utils/mapFill.d.ts +1 -0
- package/dist/esm/utils/mapFill.d.ts.map +1 -1
- package/dist/esm/utils/mapFill.js +1 -0
- package/dist/esm/utils/mapFill.js.map +1 -1
- package/dist/esm/utils/mapOrder.d.ts +15 -4
- package/dist/esm/utils/mapOrder.d.ts.map +1 -1
- package/dist/esm/utils/mapOrder.js +15 -4
- package/dist/esm/utils/mapOrder.js.map +1 -1
- package/dist/esm/utils/mapPosition.d.ts +6 -1
- package/dist/esm/utils/mapPosition.d.ts.map +1 -1
- package/dist/esm/utils/mapPosition.js +6 -1
- package/dist/esm/utils/mapPosition.js.map +1 -1
- package/dist/esm/utils/spotBalance.d.ts +9 -10
- package/dist/esm/utils/spotBalance.d.ts.map +1 -1
- package/dist/esm/utils/spotBalance.js +9 -10
- package/dist/esm/utils/spotBalance.js.map +1 -1
- package/dist/esm/utils/spotCollateral.d.ts +9 -5
- package/dist/esm/utils/spotCollateral.d.ts.map +1 -1
- package/dist/esm/utils/spotCollateral.js +4 -4
- package/dist/esm/utils/spotCollateral.js.map +1 -1
- package/dist/esm/utils/transferMargin.d.ts.map +1 -1
- package/dist/esm/utils/transferMargin.js +2 -3
- package/dist/esm/utils/transferMargin.js.map +1 -1
- package/dist/types/HyperliquidProvider.d.ts +14 -4
- package/dist/types/HyperliquidProvider.d.ts.map +1 -1
- package/dist/types/services/getActivity.d.ts +5 -1
- package/dist/types/services/getActivity.d.ts.map +1 -1
- package/dist/types/services/getFills.d.ts +4 -3
- package/dist/types/services/getFills.d.ts.map +1 -1
- package/dist/types/services/getOrders.d.ts +2 -1
- package/dist/types/services/getOrders.d.ts.map +1 -1
- package/dist/types/services/getPositions.d.ts +2 -2
- package/dist/types/services/getPositions.d.ts.map +1 -1
- package/dist/types/signers/HyperliquidAgentStore.d.ts +3 -3
- package/dist/types/signers/HyperliquidAgentStore.d.ts.map +1 -1
- package/dist/types/signers/signActions.d.ts +8 -6
- package/dist/types/signers/signActions.d.ts.map +1 -1
- package/dist/types/types/account.d.ts +51 -8
- package/dist/types/types/account.d.ts.map +1 -1
- package/dist/types/types/action.d.ts +28 -10
- package/dist/types/types/action.d.ts.map +1 -1
- package/dist/types/types/asset.d.ts +60 -15
- package/dist/types/types/asset.d.ts.map +1 -1
- package/dist/types/types/fill.d.ts +9 -3
- package/dist/types/types/fill.d.ts.map +1 -1
- package/dist/types/types/ledger.d.ts +24 -6
- package/dist/types/types/ledger.d.ts.map +1 -1
- package/dist/types/types/order.d.ts +19 -5
- package/dist/types/types/order.d.ts.map +1 -1
- package/dist/types/types/ws.d.ts +43 -14
- package/dist/types/types/ws.d.ts.map +1 -1
- package/dist/types/utils/assetId.d.ts +7 -7
- package/dist/types/utils/assetId.d.ts.map +1 -1
- package/dist/types/utils/assetLogo.d.ts +15 -13
- package/dist/types/utils/assetLogo.d.ts.map +1 -1
- package/dist/types/utils/decodeFastAssetCtxs.d.ts +7 -1
- package/dist/types/utils/decodeFastAssetCtxs.d.ts.map +1 -1
- package/dist/types/utils/infoClient.d.ts +6 -1
- package/dist/types/utils/infoClient.d.ts.map +1 -1
- package/dist/types/utils/mapActivity.d.ts +10 -1
- package/dist/types/utils/mapActivity.d.ts.map +1 -1
- package/dist/types/utils/mapFill.d.ts +1 -0
- package/dist/types/utils/mapFill.d.ts.map +1 -1
- package/dist/types/utils/mapOrder.d.ts +15 -4
- package/dist/types/utils/mapOrder.d.ts.map +1 -1
- package/dist/types/utils/mapPosition.d.ts +6 -1
- package/dist/types/utils/mapPosition.d.ts.map +1 -1
- package/dist/types/utils/spotBalance.d.ts +9 -10
- package/dist/types/utils/spotBalance.d.ts.map +1 -1
- package/dist/types/utils/spotCollateral.d.ts +9 -5
- package/dist/types/utils/spotCollateral.d.ts.map +1 -1
- package/dist/types/utils/transferMargin.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/HyperliquidProvider.ts +14 -4
- package/src/services/getActivity.ts +5 -1
- package/src/services/getFills.ts +4 -3
- package/src/services/getOrders.ts +2 -1
- package/src/services/getPositions.ts +2 -2
- package/src/signers/HyperliquidAgentStore.ts +3 -3
- package/src/signers/signActions.ts +8 -6
- package/src/types/account.ts +51 -8
- package/src/types/action.ts +28 -10
- package/src/types/asset.ts +60 -15
- package/src/types/fill.ts +9 -3
- package/src/types/ledger.ts +24 -6
- package/src/types/order.ts +19 -5
- package/src/types/ws.ts +43 -14
- package/src/utils/assetId.ts +7 -7
- package/src/utils/assetLogo.ts +15 -13
- package/src/utils/decodeFastAssetCtxs.ts +7 -1
- package/src/utils/infoClient.ts +6 -1
- package/src/utils/mapActivity.ts +23 -11
- package/src/utils/mapFill.ts +1 -0
- package/src/utils/mapOrder.ts +15 -4
- package/src/utils/mapPosition.ts +6 -1
- package/src/utils/spotBalance.ts +9 -10
- package/src/utils/spotCollateral.ts +9 -5
- package/src/utils/transferMargin.ts +2 -6
|
@@ -10,11 +10,15 @@ import type { HyperliquidContext } from '../context.js';
|
|
|
10
10
|
*/
|
|
11
11
|
export interface GetActivityParams {
|
|
12
12
|
address: Address;
|
|
13
|
+
/** Maximum items returned; defaults to 50 and is capped at 200. */
|
|
13
14
|
limit?: number;
|
|
14
|
-
/**
|
|
15
|
+
/** Millisecond timestamp cursor; rows strictly older than it are returned. */
|
|
15
16
|
cursor?: string;
|
|
17
|
+
/** Inclusive lower bound in milliseconds since epoch; defaults to 90 days ago. */
|
|
16
18
|
startTime?: number;
|
|
19
|
+
/** Inclusive upper bound in milliseconds since epoch. */
|
|
17
20
|
endTime?: number;
|
|
21
|
+
/** Optional normalized activity-type filter applied after mapping. */
|
|
18
22
|
type?: ActivityType[];
|
|
19
23
|
}
|
|
20
24
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getActivity.d.ts","sourceRoot":"","sources":["../../../src/services/getActivity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,KAAK,iBAAiB,EAAE,MAAM,iBAAiB,CAAA;AAC3E,OAAO,KAAK,EACV,kBAAkB,EAGnB,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAChD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAA;AAOnC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAA;AAYvD;;;;GAIG;AACH,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,OAAO,CAAA;IAChB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd
|
|
1
|
+
{"version":3,"file":"getActivity.d.ts","sourceRoot":"","sources":["../../../src/services/getActivity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,KAAK,iBAAiB,EAAE,MAAM,iBAAiB,CAAA;AAC3E,OAAO,KAAK,EACV,kBAAkB,EAGnB,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAChD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAA;AAOnC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAA;AAYvD;;;;GAIG;AACH,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,OAAO,CAAA;IAChB,mEAAmE;IACnE,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,8EAA8E;IAC9E,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,kFAAkF;IAClF,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,yDAAyD;IACzD,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,sEAAsE;IACtE,IAAI,CAAC,EAAE,YAAY,EAAE,CAAA;CACtB;AAmDD;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,WAAW,GACtB,oBAAoB,kBAAkB,EACtC,QAAQ,iBAAiB,EACzB,UAAU,iBAAiB,KAC1B,OAAO,CAAC,kBAAkB,CAuD5B,CAAA"}
|
|
@@ -9,12 +9,13 @@ import type { HyperliquidContext } from '../context.js';
|
|
|
9
9
|
*/
|
|
10
10
|
export interface GetFillsParams {
|
|
11
11
|
address: Address;
|
|
12
|
+
/** Maximum items returned; defaults to 50 and is capped at 200. */
|
|
12
13
|
limit?: number;
|
|
13
|
-
/** Opaque
|
|
14
|
+
/** Opaque cursor returned in the previous page's `pagination.cursor`. */
|
|
14
15
|
cursor?: string;
|
|
15
|
-
/** Inclusive lower bound in
|
|
16
|
+
/** Inclusive lower bound in milliseconds; selects `userFillsByTime`. */
|
|
16
17
|
startTime?: number;
|
|
17
|
-
/** Inclusive upper bound in
|
|
18
|
+
/** Inclusive upper bound in milliseconds; selects `userFillsByTime`. */
|
|
18
19
|
endTime?: number;
|
|
19
20
|
}
|
|
20
21
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getFills.d.ts","sourceRoot":"","sources":["../../../src/services/getFills.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,KAAK,iBAAiB,EAAE,MAAM,iBAAiB,CAAA;AAC3E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AACtD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAA;AAMnC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAA;AASvD;;;;GAIG;AACH,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,OAAO,CAAA;IAChB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,
|
|
1
|
+
{"version":3,"file":"getFills.d.ts","sourceRoot":"","sources":["../../../src/services/getFills.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,KAAK,iBAAiB,EAAE,MAAM,iBAAiB,CAAA;AAC3E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AACtD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAA;AAMnC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAA;AASvD;;;;GAIG;AACH,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,OAAO,CAAA;IAChB,mEAAmE;IACnE,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,yEAAyE;IACzE,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,wEAAwE;IACxE,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,wEAAwE;IACxE,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAoBD;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,QAAQ,GACnB,oBAAoB,kBAAkB,EACtC,QAAQ,cAAc,EACtB,UAAU,iBAAiB,KAC1B,OAAO,CAAC,aAAa,CAqDvB,CAAA"}
|
|
@@ -9,8 +9,9 @@ import type { HyperliquidContext } from '../context.js';
|
|
|
9
9
|
*/
|
|
10
10
|
export interface GetOrdersParams {
|
|
11
11
|
address: Address;
|
|
12
|
-
/** Optional filter
|
|
12
|
+
/** Optional filter using the normalized opaque `Market.id`. */
|
|
13
13
|
marketId?: string;
|
|
14
|
+
/** Page-size hint; Hyperliquid returns all open orders in one response. */
|
|
14
15
|
limit?: number;
|
|
15
16
|
}
|
|
16
17
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getOrders.d.ts","sourceRoot":"","sources":["../../../src/services/getOrders.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,KAAK,iBAAiB,EAAE,MAAM,iBAAiB,CAAA;AAC3E,OAAO,KAAK,EAAa,cAAc,EAAgB,MAAM,mBAAmB,CAAA;AAChF,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAA;AAEnC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAA;AAavD;;;;GAIG;AACH,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,OAAO,CAAA;IAChB
|
|
1
|
+
{"version":3,"file":"getOrders.d.ts","sourceRoot":"","sources":["../../../src/services/getOrders.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,KAAK,iBAAiB,EAAE,MAAM,iBAAiB,CAAA;AAC3E,OAAO,KAAK,EAAa,cAAc,EAAgB,MAAM,mBAAmB,CAAA;AAChF,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAA;AAEnC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAA;AAavD;;;;GAIG;AACH,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,OAAO,CAAA;IAChB,+DAA+D;IAC/D,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,2EAA2E;IAC3E,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,SAAS,GACpB,oBAAoB,kBAAkB,EACtC,QAAQ,eAAe,EACvB,UAAU,iBAAiB,KAC1B,OAAO,CAAC,cAAc,CAyDxB,CAAA"}
|
|
@@ -9,9 +9,9 @@ import type { HyperliquidContext } from '../context.js';
|
|
|
9
9
|
*/
|
|
10
10
|
export interface GetPositionsParams {
|
|
11
11
|
address: Address;
|
|
12
|
-
/**
|
|
12
|
+
/** Optional filter using the normalized opaque `Market.id`. */
|
|
13
13
|
marketId?: string;
|
|
14
|
-
/** Page
|
|
14
|
+
/** Page-size hint; Hyperliquid returns all open positions in one response. */
|
|
15
15
|
limit?: number;
|
|
16
16
|
}
|
|
17
17
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getPositions.d.ts","sourceRoot":"","sources":["../../../src/services/getPositions.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,iBAAiB,EAEvB,MAAM,iBAAiB,CAAA;AACxB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;AAC1D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAA;AAEnC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAA;AASvD;;;;GAIG;AACH,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,OAAO,CAAA;IAChB
|
|
1
|
+
{"version":3,"file":"getPositions.d.ts","sourceRoot":"","sources":["../../../src/services/getPositions.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,iBAAiB,EAEvB,MAAM,iBAAiB,CAAA;AACxB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;AAC1D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAA;AAEnC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAA;AASvD;;;;GAIG;AACH,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,OAAO,CAAA;IAChB,+DAA+D;IAC/D,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,8EAA8E;IAC9E,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,YAAY,GACvB,oBAAoB,kBAAkB,EACtC,QAAQ,kBAAkB,EAC1B,UAAU,iBAAiB,KAC1B,OAAO,CAAC,iBAAiB,CA0C3B,CAAA"}
|
|
@@ -3,12 +3,11 @@ import { type Address, type Hex } from 'viem';
|
|
|
3
3
|
/**
|
|
4
4
|
* Hyperliquid agent keypair — an EVM keypair the user approves (via
|
|
5
5
|
* `APPROVE_AGENT`) to sign trading actions on their behalf, so each order
|
|
6
|
-
* does not require a wallet prompt.
|
|
6
|
+
* does not require a wallet prompt. `privateKey` is a 32-byte EVM hex key.
|
|
7
|
+
* @public
|
|
7
8
|
*/
|
|
8
9
|
export interface HyperliquidAgent {
|
|
9
|
-
/** Agent wallet address. */
|
|
10
10
|
address: Address;
|
|
11
|
-
/** Agent private key. */
|
|
12
11
|
privateKey: Hex;
|
|
13
12
|
}
|
|
14
13
|
/**
|
|
@@ -23,6 +22,7 @@ export interface HyperliquidAgent {
|
|
|
23
22
|
* fully compromised page — a same-origin script can still drive this store to
|
|
24
23
|
* decrypt. Blast radius is limited to agent trading: fund withdrawal still
|
|
25
24
|
* requires L1 `APPROVE_AGENT` consent that the agent key alone cannot grant.
|
|
25
|
+
* @public
|
|
26
26
|
*/
|
|
27
27
|
export declare class HyperliquidAgentStore {
|
|
28
28
|
private storage;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HyperliquidAgentStore.d.ts","sourceRoot":"","sources":["../../../src/signers/HyperliquidAgentStore.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,cAAc,EACpB,MAAM,iBAAiB,CAAA;AAExB,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,GAAG,EAAoB,MAAM,MAAM,CAAA;AAM/D
|
|
1
|
+
{"version":3,"file":"HyperliquidAgentStore.d.ts","sourceRoot":"","sources":["../../../src/signers/HyperliquidAgentStore.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,cAAc,EACpB,MAAM,iBAAiB,CAAA;AAExB,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,GAAG,EAAoB,MAAM,MAAM,CAAA;AAM/D;;;;;GAKG;AACH,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,OAAO,CAAA;IAChB,UAAU,EAAE,GAAG,CAAA;CAChB;AA0BD;;;;;;;;;;;;;GAaG;AACH,qBAAa,qBAAqB;IAChC,OAAO,CAAC,OAAO,CAAgB;IAC/B,OAAO,CAAC,KAAK,CAA2C;gBAE5C,OAAO,CAAC,EAAE,cAAc;IAIpC,OAAO,CAAC,UAAU;IAIlB;;;;;;;OAOG;IACG,GAAG,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,gBAAgB,CAAC;IA0BtD;;;;OAIG;IACG,WAAW,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,gBAAgB,CAAC;IA0B9D,oDAAoD;IAC9C,GAAG,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;IAS7C;;;OAGG;IACG,MAAM,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAM7C;;;OAGG;IACG,MAAM,CAAC,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,GAAG,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAe1E,mEAAmE;IACnE,UAAU,IAAI,IAAI;CAGnB"}
|
|
@@ -4,12 +4,14 @@ import { SigningMethod } from '@lifi/perps-types';
|
|
|
4
4
|
import type { Address } from 'viem';
|
|
5
5
|
import type { HyperliquidAgentStore } from './HyperliquidAgentStore.js';
|
|
6
6
|
/**
|
|
7
|
-
* Sign a batch of EIP-712 action steps.
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
7
|
+
* Sign a batch of Hyperliquid EIP-712 action steps. `AGENT` descriptors use
|
|
8
|
+
* the persisted per-user agent keypair; `USER` descriptors use
|
|
9
|
+
* `ctx.userWallet`. Other signing methods are rejected because Hyperliquid
|
|
10
|
+
* declares no WASM_BLOB or EVM_TX action schemes.
|
|
11
|
+
*
|
|
12
|
+
* @throws {PerpsError} When the method is unsupported, the required agent is
|
|
13
|
+
* missing, or a user-signed action has no wallet.
|
|
14
|
+
* @public
|
|
13
15
|
*/
|
|
14
16
|
export declare function hyperliquidSignActions(agentStore: HyperliquidAgentStore, method: SigningMethod, steps: ActionStep[], address: Address, ctx: SignActionsContext | undefined): Promise<SignedActionStep[]>;
|
|
15
17
|
//# sourceMappingURL=signActions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"signActions.d.ts","sourceRoot":"","sources":["../../../src/signers/signActions.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,kBAAkB,EAGxB,MAAM,iBAAiB,CAAA;AACxB,OAAO,KAAK,EACV,UAAU,EAGV,gBAAgB,EACjB,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EAA+B,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAC9E,OAAO,KAAK,EAAE,OAAO,EAAO,MAAM,MAAM,CAAA;AACxC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAA;AAEvE
|
|
1
|
+
{"version":3,"file":"signActions.d.ts","sourceRoot":"","sources":["../../../src/signers/signActions.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,kBAAkB,EAGxB,MAAM,iBAAiB,CAAA;AACxB,OAAO,KAAK,EACV,UAAU,EAGV,gBAAgB,EACjB,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EAA+B,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAC9E,OAAO,KAAK,EAAE,OAAO,EAAO,MAAM,MAAM,CAAA;AACxC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAA;AAEvE;;;;;;;;;GASG;AACH,wBAAsB,sBAAsB,CAC1C,UAAU,EAAE,qBAAqB,EACjC,MAAM,EAAE,aAAa,EACrB,KAAK,EAAE,UAAU,EAAE,EACnB,OAAO,EAAE,OAAO,EAChB,GAAG,EAAE,kBAAkB,GAAG,SAAS,GAClC,OAAO,CAAC,gBAAgB,EAAE,CAAC,CAsB7B"}
|
|
@@ -1,22 +1,48 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/**
|
|
2
|
+
* Perpetual position payload from Hyperliquid `clearinghouseState`.
|
|
3
|
+
*
|
|
4
|
+
* Numeric values are decimal strings in quote-asset units except `szi`,
|
|
5
|
+
* which is signed size: positive for long and negative for short. `coin` is
|
|
6
|
+
* the Hyperliquid wire market identifier; `leverage.type` is typically
|
|
7
|
+
* `'cross'` or `'isolated'`.
|
|
8
|
+
* @public
|
|
9
|
+
*/
|
|
2
10
|
export type HlPosition = {
|
|
11
|
+
/** Hyperliquid wire market identifier. */
|
|
3
12
|
coin: string;
|
|
13
|
+
/** Signed position size; positive is long and negative is short. */
|
|
4
14
|
szi: string;
|
|
15
|
+
/** Average entry price as a decimal string. */
|
|
5
16
|
entryPx: string;
|
|
17
|
+
/** Position notional value as a decimal string. */
|
|
6
18
|
positionValue: string;
|
|
19
|
+
/** Estimated liquidation price; may be an empty string when unavailable. */
|
|
7
20
|
liquidationPx: string;
|
|
21
|
+
/** Unrealized PnL in quote-asset units. */
|
|
8
22
|
unrealizedPnl: string;
|
|
23
|
+
/** Margin currently assigned to this position. */
|
|
9
24
|
marginUsed: string;
|
|
25
|
+
/** Leverage mode and numeric leverage multiplier. */
|
|
10
26
|
leverage: {
|
|
11
27
|
type: string;
|
|
12
28
|
value: number;
|
|
13
29
|
};
|
|
14
30
|
};
|
|
15
|
-
/**
|
|
31
|
+
/**
|
|
32
|
+
* Wrapper for a position in the `assetPositions` array of a clearinghouse
|
|
33
|
+
* state response.
|
|
34
|
+
* @public
|
|
35
|
+
*/
|
|
16
36
|
export type HlAssetPosition = {
|
|
17
37
|
position: HlPosition;
|
|
18
38
|
};
|
|
19
|
-
/**
|
|
39
|
+
/**
|
|
40
|
+
* Perpetual clearinghouse account state returned by Hyperliquid `/info`.
|
|
41
|
+
* `assetPositions` includes zero-size rows that callers may discard. Monetary
|
|
42
|
+
* fields are decimal strings in the account's quote asset; `marginSummary`
|
|
43
|
+
* covers all positions while `crossMarginSummary` covers cross margin only.
|
|
44
|
+
* @public
|
|
45
|
+
*/
|
|
20
46
|
export type HlClearinghouseState = {
|
|
21
47
|
assetPositions: HlAssetPosition[];
|
|
22
48
|
marginSummary: {
|
|
@@ -28,7 +54,12 @@ export type HlClearinghouseState = {
|
|
|
28
54
|
totalMarginUsed: string;
|
|
29
55
|
};
|
|
30
56
|
};
|
|
31
|
-
/**
|
|
57
|
+
/**
|
|
58
|
+
* One spot balance from Hyperliquid `spotClearinghouseState`.
|
|
59
|
+
* `token` is the numeric spot token index, and amounts are decimal strings in
|
|
60
|
+
* the token's native units.
|
|
61
|
+
* @public
|
|
62
|
+
*/
|
|
32
63
|
export type HlSpotBalance = {
|
|
33
64
|
coin: string;
|
|
34
65
|
token: number;
|
|
@@ -36,17 +67,29 @@ export type HlSpotBalance = {
|
|
|
36
67
|
hold: string;
|
|
37
68
|
entryNtl: string;
|
|
38
69
|
};
|
|
39
|
-
/**
|
|
70
|
+
/**
|
|
71
|
+
* Spot clearinghouse state returned by Hyperliquid `/info`.
|
|
72
|
+
* @public
|
|
73
|
+
*/
|
|
40
74
|
export type HlSpotClearinghouseState = {
|
|
41
75
|
balances: HlSpotBalance[];
|
|
42
76
|
};
|
|
43
|
-
/**
|
|
77
|
+
/**
|
|
78
|
+
* User fee rates returned by Hyperliquid `userFees`.
|
|
79
|
+
* Rates are decimal fractions represented as strings, not percentage values
|
|
80
|
+
* (for example, `'0.00045'` is 0.045%).
|
|
81
|
+
* @public
|
|
82
|
+
*/
|
|
44
83
|
export type HlUserFees = {
|
|
45
84
|
userAddRate: string;
|
|
46
85
|
userCrossRate: string;
|
|
47
86
|
activeReferralDiscount: string;
|
|
48
87
|
};
|
|
49
|
-
/**
|
|
88
|
+
/**
|
|
89
|
+
* Entries returned by Hyperliquid `extraAgents`. The endpoint may add fields
|
|
90
|
+
* over time, so the provider retains each entry as an open record.
|
|
91
|
+
* @public
|
|
92
|
+
*/
|
|
50
93
|
export type HlExtraAgents = Record<string, unknown>[];
|
|
51
94
|
/**
|
|
52
95
|
* Response of the `preTransferCheck` info query. `userExists` is `false` until
|
|
@@ -87,6 +130,6 @@ export declare const HlAbstractionMode: {
|
|
|
87
130
|
readonly PORTFOLIO_MARGIN: "portfolioMargin";
|
|
88
131
|
readonly DEX_ABSTRACTION: "dexAbstraction";
|
|
89
132
|
};
|
|
90
|
-
/** @public */
|
|
133
|
+
/** Union of the exact `userAbstraction` wire values accepted by Hyperliquid. @public */
|
|
91
134
|
export type HlAbstractionMode = (typeof HlAbstractionMode)[keyof typeof HlAbstractionMode];
|
|
92
135
|
//# sourceMappingURL=account.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"account.d.ts","sourceRoot":"","sources":["../../../src/types/account.ts"],"names":[],"mappings":"AAEA
|
|
1
|
+
{"version":3,"file":"account.d.ts","sourceRoot":"","sources":["../../../src/types/account.ts"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AACH,MAAM,MAAM,UAAU,GAAG;IACvB,0CAA0C;IAC1C,IAAI,EAAE,MAAM,CAAA;IACZ,oE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,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAA;AAErD;;;;;GAKG;AACH,MAAM,MAAM,kBAAkB,GAAG;IAC/B,UAAU,EAAE,OAAO,CAAA;CACpB,CAAA;AAED;;;;;GAKG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC9B,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE;QAAE,IAAI,EAAE,OAAO,GAAG,UAAU,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAA;IACvD,WAAW,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC7B,gBAAgB,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAClC,MAAM,EAAE,MAAM,CAAA;CACf,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB;;;;;;CAMpB,CAAA;AAEV,wFAAwF;AACxF,MAAM,MAAM,iBAAiB,GAC3B,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,OAAO,iBAAiB,CAAC,CAAA"}
|
|
@@ -1,4 +1,11 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/**
|
|
2
|
+
* EIP-712 `/exchange` request sent to Hyperliquid.
|
|
3
|
+
*
|
|
4
|
+
* `action` is the provider-specific action object; signature fields are the
|
|
5
|
+
* hex `r`/`s` values and recovery byte `v`; `nonce` is milliseconds since the
|
|
6
|
+
* Unix epoch. `vaultAddress` is included only when submitting for a vault.
|
|
7
|
+
* @public
|
|
8
|
+
*/
|
|
2
9
|
export type HlExchangeRequest = {
|
|
3
10
|
action: Record<string, unknown>;
|
|
4
11
|
signature: {
|
|
@@ -9,7 +16,14 @@ export type HlExchangeRequest = {
|
|
|
9
16
|
nonce: number;
|
|
10
17
|
vaultAddress?: string | null;
|
|
11
18
|
};
|
|
12
|
-
/**
|
|
19
|
+
/**
|
|
20
|
+
* Response envelope returned by Hyperliquid `/exchange`.
|
|
21
|
+
*
|
|
22
|
+
* A successful response may contain per-order statuses such as `filled`,
|
|
23
|
+
* `resting`, or `error`; the provider keeps the upstream status strings and
|
|
24
|
+
* numeric order IDs unchanged.
|
|
25
|
+
* @public
|
|
26
|
+
*/
|
|
13
27
|
export type HlExchangeResponse = {
|
|
14
28
|
status: string;
|
|
15
29
|
response?: string | {
|
|
@@ -42,20 +56,24 @@ export type HlExchangeResponse = {
|
|
|
42
56
|
};
|
|
43
57
|
};
|
|
44
58
|
};
|
|
45
|
-
/** @public */
|
|
59
|
+
/** EIP-712 primary type for user approval of a Hyperliquid agent wallet. @public */
|
|
46
60
|
export declare const HL_PRIMARY_TYPE_APPROVE_AGENT: "HyperliquidTransaction:ApproveAgent";
|
|
47
|
-
/** @public */
|
|
61
|
+
/** EIP-712 primary type for user approval of an integrator builder fee. @public */
|
|
48
62
|
export declare const HL_PRIMARY_TYPE_APPROVE_BUILDER_FEE: "HyperliquidTransaction:ApproveBuilderFee";
|
|
49
|
-
/** @public */
|
|
63
|
+
/** EIP-712 primary type for changing the user's account abstraction mode. @public */
|
|
50
64
|
export declare const HL_PRIMARY_TYPE_USER_SET_ABSTRACTION: "HyperliquidTransaction:UserSetAbstraction";
|
|
51
|
-
/** @public */
|
|
65
|
+
/** EIP-712 primary type for an agent wallet changing abstraction mode. @public */
|
|
52
66
|
export declare const HL_PRIMARY_TYPE_AGENT_SET_ABSTRACTION: "HyperliquidTransaction:AgentSetAbstraction";
|
|
53
|
-
/** @public */
|
|
67
|
+
/** EIP-712 primary type for withdrawing assets from Hyperliquid. @public */
|
|
54
68
|
export declare const HL_PRIMARY_TYPE_WITHDRAW: "HyperliquidTransaction:Withdraw";
|
|
55
|
-
/** @public */
|
|
69
|
+
/** EIP-712 primary type for sending assets between Hyperliquid accounts or DEXes. @public */
|
|
56
70
|
export declare const HL_PRIMARY_TYPE_SEND_ASSET: "HyperliquidTransaction:SendAsset";
|
|
57
|
-
/** @public */
|
|
71
|
+
/** EIP-712 primary type used by the agent wallet authorization payload. @public */
|
|
58
72
|
export declare const HL_PRIMARY_TYPE_AGENT: "Agent";
|
|
59
|
-
/**
|
|
73
|
+
/**
|
|
74
|
+
* Union of EIP-712 primary type names supported by Hyperliquid signing actions.
|
|
75
|
+
* Values are the exact strings required in the typed-data domain.
|
|
76
|
+
* @public
|
|
77
|
+
*/
|
|
60
78
|
export type HlPrimaryType = typeof HL_PRIMARY_TYPE_APPROVE_AGENT | typeof HL_PRIMARY_TYPE_APPROVE_BUILDER_FEE | typeof HL_PRIMARY_TYPE_USER_SET_ABSTRACTION | typeof HL_PRIMARY_TYPE_AGENT_SET_ABSTRACTION | typeof HL_PRIMARY_TYPE_WITHDRAW | typeof HL_PRIMARY_TYPE_SEND_ASSET | typeof HL_PRIMARY_TYPE_AGENT;
|
|
61
79
|
//# sourceMappingURL=action.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"action.d.ts","sourceRoot":"","sources":["../../../src/types/action.ts"],"names":[],"mappings":"AAEA
|
|
1
|
+
{"version":3,"file":"action.d.ts","sourceRoot":"","sources":["../../../src/types/action.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC9B,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC/B,SAAS,EAAE;QACT,CAAC,EAAE,MAAM,CAAA;QACT,CAAC,EAAE,MAAM,CAAA;QACT,CAAC,EAAE,MAAM,CAAA;KACV,CAAA;IACD,KAAK,EAAE,MAAM,CAAA;IACb,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAC7B,CAAA;AAED;;;;;;;GAOG;AACH,MAAM,MAAM,kBAAkB,GAAG;IAC/B,MAAM,EAAE,MAAM,CAAA;IACd,QAAQ,CAAC,EACL,MAAM,GACN;QACE,IAAI,EAAE,MAAM,CAAA;QACZ,IAAI,CAAC,EAAE;YACL,QAAQ,CAAC,EAAE,CACP,MAAM,GACN;gBAAE,M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petual market metadata from Hyperliquid `meta.universe`.
|
|
3
|
+
* `szDecimals` is the lot-size precision; `maxLeverage` is the venue cap.
|
|
4
|
+
* @public
|
|
5
|
+
*/
|
|
2
6
|
export type HlUniverseItem = {
|
|
3
7
|
name: string;
|
|
4
8
|
szDecimals: number;
|
|
@@ -8,11 +12,19 @@ export type HlUniverseItem = {
|
|
|
8
12
|
marginMode?: 'strictIsolated' | 'noCross';
|
|
9
13
|
isDelisted?: boolean;
|
|
10
14
|
};
|
|
11
|
-
/**
|
|
15
|
+
/**
|
|
16
|
+
* Perpetual metadata envelope returned by the Hyperliquid `meta` info query.
|
|
17
|
+
* @public
|
|
18
|
+
*/
|
|
12
19
|
export type HlMeta = {
|
|
13
20
|
universe: HlUniverseItem[];
|
|
14
21
|
};
|
|
15
|
-
/**
|
|
22
|
+
/**
|
|
23
|
+
* Live perpetual market context from Hyperliquid `metaAndAssetCtxs`.
|
|
24
|
+
* Prices, funding, open interest, and volume are decimal strings; `funding`
|
|
25
|
+
* is a rate and `dayNtlVlm` is 24-hour notional volume.
|
|
26
|
+
* @public
|
|
27
|
+
*/
|
|
16
28
|
export type HlAssetCtx = {
|
|
17
29
|
funding: string;
|
|
18
30
|
openInterest: string;
|
|
@@ -20,11 +32,19 @@ export type HlAssetCtx = {
|
|
|
20
32
|
prevDayPx: string;
|
|
21
33
|
markPx: string;
|
|
22
34
|
};
|
|
23
|
-
/**
|
|
35
|
+
/**
|
|
36
|
+
* Tuple returned by `metaAndAssetCtxs`: static universe metadata followed by
|
|
37
|
+
* one live context per universe entry.
|
|
38
|
+
* @public
|
|
39
|
+
*/
|
|
24
40
|
export type HlMetaAndAssetCtxs = [HlMeta, HlAssetCtx[]];
|
|
25
|
-
/** @public */
|
|
41
|
+
/** Alias for the perpetual universe array in {@link HlMeta}. @public */
|
|
26
42
|
export type HlUniverse = HlMeta['universe'];
|
|
27
|
-
/**
|
|
43
|
+
/**
|
|
44
|
+
* OHLCV candle from Hyperliquid's candle feed. `t` is the opening timestamp
|
|
45
|
+
* in milliseconds; prices and volume are decimal strings.
|
|
46
|
+
* @public
|
|
47
|
+
*/
|
|
28
48
|
export type HlCandle = {
|
|
29
49
|
t: number;
|
|
30
50
|
o: string;
|
|
@@ -33,43 +53,68 @@ export type HlCandle = {
|
|
|
33
53
|
c: string;
|
|
34
54
|
v: string;
|
|
35
55
|
};
|
|
36
|
-
/** @public */
|
|
56
|
+
/** Snapshot array of {@link HlCandle} values, ordered by the upstream feed. @public */
|
|
37
57
|
export type HlCandleSnapshot = HlCandle[];
|
|
38
|
-
/**
|
|
58
|
+
/**
|
|
59
|
+
* One L2 order-book level. `px` is price, `sz` is aggregate size, and `n` is
|
|
60
|
+
* the number of orders at that price; numeric values are wire strings except
|
|
61
|
+
* for the order count.
|
|
62
|
+
* @public
|
|
63
|
+
*/
|
|
39
64
|
export type HlLevel = {
|
|
40
65
|
px: string;
|
|
41
66
|
sz: string;
|
|
42
67
|
n: number;
|
|
43
68
|
};
|
|
44
|
-
/**
|
|
69
|
+
/**
|
|
70
|
+
* L2 order-book snapshot with bid levels at index 0 and ask levels at index 1.
|
|
71
|
+
* `time` is the snapshot timestamp in milliseconds.
|
|
72
|
+
* @public
|
|
73
|
+
*/
|
|
45
74
|
export type HlL2Book = {
|
|
46
75
|
levels: [HlLevel[], HlLevel[]];
|
|
47
76
|
time: number;
|
|
48
77
|
};
|
|
49
|
-
/**
|
|
78
|
+
/**
|
|
79
|
+
* Perpetual DEX descriptors from Hyperliquid `perpDexs`; `null` represents the
|
|
80
|
+
* main DEX and named entries represent HIP-3 sub-DEXes.
|
|
81
|
+
* @public
|
|
82
|
+
*/
|
|
50
83
|
export type HlPerpDexs = (null | {
|
|
51
84
|
name: string;
|
|
52
85
|
})[];
|
|
53
|
-
/**
|
|
86
|
+
/**
|
|
87
|
+
* Spot token metadata. `index` is the numeric token index used by spot
|
|
88
|
+
* clearinghouse balances; `tokenId` is the venue's wire identifier.
|
|
89
|
+
* @public
|
|
90
|
+
*/
|
|
54
91
|
export type HlSpotToken = {
|
|
55
92
|
name: string;
|
|
56
93
|
index: number;
|
|
57
94
|
tokenId: string;
|
|
58
95
|
szDecimals: number;
|
|
59
96
|
};
|
|
60
|
-
/**
|
|
97
|
+
/**
|
|
98
|
+
* Spot universe entry describing a trading pair. `tokens` contains the two
|
|
99
|
+
* numeric token indexes used by the pair.
|
|
100
|
+
* @public
|
|
101
|
+
*/
|
|
61
102
|
export type HlSpotUniverseEntry = {
|
|
62
103
|
name: string;
|
|
63
104
|
tokens: [number, number];
|
|
64
105
|
index: number;
|
|
65
106
|
isCanonical: boolean;
|
|
66
107
|
};
|
|
67
|
-
/** @public */
|
|
108
|
+
/** Spot metadata envelope containing token definitions and trading pairs. @public */
|
|
68
109
|
export type HlSpotMeta = {
|
|
69
110
|
tokens: HlSpotToken[];
|
|
70
111
|
universe: HlSpotUniverseEntry[];
|
|
71
112
|
};
|
|
72
|
-
/**
|
|
113
|
+
/**
|
|
114
|
+
* Live spot token context. Prices and 24-hour volume are decimal strings;
|
|
115
|
+
* `midPx` is `null` when the venue has no midpoint for the pair.
|
|
116
|
+
* @public
|
|
117
|
+
*/
|
|
73
118
|
export type HlSpotAssetCtx = {
|
|
74
119
|
coin: string;
|
|
75
120
|
prevDayPx: string;
|
|
@@ -77,6 +122,6 @@ export type HlSpotAssetCtx = {
|
|
|
77
122
|
markPx: string;
|
|
78
123
|
midPx: string | null;
|
|
79
124
|
};
|
|
80
|
-
/** @public */
|
|
125
|
+
/** Tuple returned by the spot metadata/context info query. @public */
|
|
81
126
|
export type HlSpotMetaAndAssetCtxs = [HlSpotMeta, HlSpotAssetCtx[]];
|
|
82
127
|
//# sourceMappingURL=asset.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"asset.d.ts","sourceRoot":"","sources":["../../../src/types/asset.ts"],"names":[],"mappings":"AAEA
|
|
1
|
+
{"version":3,"file":"asset.d.ts","sourceRoot":"","sources":["../../../src/types/asset.ts"],"names":[],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,GAAG;IACrB,MAAM,EAAE,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,CAAC,CAAA;IAC9B,IAAI,EAAE,MAAM,CAAA;CACb,CAAA;AAED;;;;GAIG;AACH,MAAM,MAAM,UAAU,GAAG,CAAC,IAAI,GAAG;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,EAAE,CAAA;AAEpD;;;;GAIG;AACH,MAAM,MAAM,WAAW,GAAG;IACxB,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,EAAE,MAAM,CAAA;IACf,UAAU,EAAE,MAAM,CAAA;CACnB,CAAA;AAED;;;;GAIG;AACH,MAAM,MAAM,mBAAmB,GAAG;IAChC,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACxB,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,EAAE,OAAO,CAAA;CACrB,CAAA;AAED,qFAAqF;AACrF,MAAM,MAAM,UAAU,GAAG;IACvB,MAAM,EAAE,WAAW,EAAE,CAAA;IACrB,QAAQ,EAAE,mBAAmB,EAAE,CAAA;CAChC,CAAA;AAED;;;;GAIG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B,IAAI,EAAE,MAAM,CAAA;IACZ,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;IACjB,MAAM,EAAE,MAAM,CAAA;IACd,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;CACrB,CAAA;AAED,sEAAsE;AACtE,MAAM,MAAM,sBAAsB,GAAG,CAAC,UAAU,EAAE,cAAc,EAAE,CAAC,CAAA"}
|
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/**
|
|
2
|
+
* One user trade fill returned by Hyperliquid `userFills` or
|
|
3
|
+
* `userFillsByTime`. Prices, size, fee, PnL, and starting position are decimal
|
|
4
|
+
* strings; `time` is milliseconds since the Unix epoch and `tid`/`oid` are
|
|
5
|
+
* numeric trade and order IDs.
|
|
6
|
+
* @public
|
|
7
|
+
*/
|
|
2
8
|
export type HlUserFill = {
|
|
3
9
|
tid: number;
|
|
4
10
|
oid: number;
|
|
@@ -14,8 +20,8 @@ export type HlUserFill = {
|
|
|
14
20
|
time: number;
|
|
15
21
|
startPosition: string;
|
|
16
22
|
};
|
|
17
|
-
/** @public */
|
|
23
|
+
/** All fills returned by the unbounded `userFills` query. @public */
|
|
18
24
|
export type HlUserFills = HlUserFill[];
|
|
19
|
-
/** @public */
|
|
25
|
+
/** Fills returned by the time-bounded `userFillsByTime` query. @public */
|
|
20
26
|
export type HlUserFillsByTime = HlUserFill[];
|
|
21
27
|
//# sourceMappingURL=fill.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fill.d.ts","sourceRoot":"","sources":["../../../src/types/fill.ts"],"names":[],"mappings":"AAEA
|
|
1
|
+
{"version":3,"file":"fill.d.ts","sourceRoot":"","sources":["../../../src/types/fill.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,MAAM,MAAM,UAAU,GAAG;IACvB,GAAG,EAAE,MAAM,CAAA;IACX,GAAG,EAAE,MAAM,CAAA;IACX,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,EAAE,EAAE,MAAM,CAAA;IACV,EAAE,EAAE,MAAM,CAAA;IACV,GAAG,EAAE,MAAM,CAAA;IACX,GAAG,EAAE,MAAM,CAAA;IACX,SAAS,EAAE,MAAM,CAAA;IACjB,OAAO,EAAE,OAAO,CAAA;IAChB,IAAI,EAAE,MAAM,CAAA;IACZ,aAAa,EAAE,MAAM,CAAA;CACtB,CAAA;AAED,qEAAqE;AACrE,MAAM,MAAM,WAAW,GAAG,UAAU,EAAE,CAAA;AAEtC,0EAA0E;AAC1E,MAAM,MAAM,iBAAiB,GAAG,UAAU,EAAE,CAAA"}
|
|
@@ -45,7 +45,11 @@ export type HlSendAssetDelta = {
|
|
|
45
45
|
nonce: number;
|
|
46
46
|
feeToken: string;
|
|
47
47
|
};
|
|
48
|
-
/**
|
|
48
|
+
/**
|
|
49
|
+
* Union of known Hyperliquid non-funding ledger deltas plus an open fallback
|
|
50
|
+
* for endpoint variants the provider does not map.
|
|
51
|
+
* @public
|
|
52
|
+
*/
|
|
49
53
|
export type HlLedgerDelta = HlSpotTransferDelta | HlSendAssetDelta | {
|
|
50
54
|
type: string;
|
|
51
55
|
usdc?: string;
|
|
@@ -66,15 +70,24 @@ export declare const isSpotTransferDelta: (delta: HlLedgerDelta) => delta is HlS
|
|
|
66
70
|
* @public
|
|
67
71
|
*/
|
|
68
72
|
export declare const isSendAssetDelta: (delta: HlLedgerDelta) => delta is HlSendAssetDelta;
|
|
69
|
-
/**
|
|
73
|
+
/**
|
|
74
|
+
* One timestamped non-funding ledger update. `time` is milliseconds since
|
|
75
|
+
* epoch and `hash` is the upstream transaction identifier.
|
|
76
|
+
* @public
|
|
77
|
+
*/
|
|
70
78
|
export type HlLedgerUpdate = {
|
|
71
79
|
time: number;
|
|
72
80
|
hash: string;
|
|
73
81
|
delta: HlLedgerDelta;
|
|
74
82
|
};
|
|
75
|
-
/** @public */
|
|
83
|
+
/** Array returned by `userNonFundingLedgerUpdates`. @public */
|
|
76
84
|
export type HlUserNonFundingLedgerUpdates = HlLedgerUpdate[];
|
|
77
|
-
/**
|
|
85
|
+
/**
|
|
86
|
+
* Funding ledger delta returned by Hyperliquid `userFunding`. `usdc` is the
|
|
87
|
+
* funding payment, `szi` is signed position size, and `fundingRate` is a
|
|
88
|
+
* decimal fraction; all are decimal strings.
|
|
89
|
+
* @public
|
|
90
|
+
*/
|
|
78
91
|
export type HlFundingDelta = {
|
|
79
92
|
type: 'funding';
|
|
80
93
|
coin: string;
|
|
@@ -82,12 +95,17 @@ export type HlFundingDelta = {
|
|
|
82
95
|
szi: string;
|
|
83
96
|
fundingRate: string;
|
|
84
97
|
};
|
|
85
|
-
/**
|
|
98
|
+
/**
|
|
99
|
+
* Timestamped funding update. `time` is milliseconds since epoch; `hash` is
|
|
100
|
+
* always the zero hash — funding is a system ledger event with no venue
|
|
101
|
+
* transaction behind it.
|
|
102
|
+
* @public
|
|
103
|
+
*/
|
|
86
104
|
export type HlFundingUpdate = {
|
|
87
105
|
time: number;
|
|
88
106
|
hash: string;
|
|
89
107
|
delta: HlFundingDelta;
|
|
90
108
|
};
|
|
91
|
-
/** @public */
|
|
109
|
+
/** Array returned by the `userFunding` info query. @public */
|
|
92
110
|
export type HlUserFunding = HlFundingUpdate[];
|
|
93
111
|
//# sourceMappingURL=ledger.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ledger.d.ts","sourceRoot":"","sources":["../../../src/types/ledger.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAA;AAInC;;;;;;GAMG;AACH,MAAM,MAAM,mBAAmB,GAAG;IAChC,IAAI,EAAE,cAAc,CAAA;IACpB,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,MAAM,CAAA;IACd,SAAS,EAAE,MAAM,CAAA;IACjB,IAAI,EAAE,OAAO,CAAA;IACb,WAAW,EAAE,OAAO,CAAA;IACpB,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAA;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,OAAO,CAAA;IACb,WAAW,EAAE,OAAO,CAAA;IACpB,SAAS,EAAE,MAAM,CAAA;IACjB,cAAc,EAAE,MAAM,CAAA;IACtB,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,MAAM,CAAA;IACd,SAAS,EAAE,MAAM,CAAA;IACj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AA;AAEL;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,GAC9B,OAAO,aAAa,KACnB,KAAK,IAAI,mBAAoD,CAAA;AAEhE;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,GAC3B,OAAO,aAAa,KACnB,KAAK,IAAI,gBAAyC,CAAA;AAErD;;;;GAIG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,aAAa,CAAA;CACrB,CAAA;AAED,+DAA+D;AAC/D,MAAM,MAAM,6BAA6B,GAAG,cAAc,EAAE,CAAA;AAE5D;;;;;GAKG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B,IAAI,EAAE,SAAS,CAAA;IACf,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,GAAG,EAAE,MAAM,CAAA;IACX,WAAW,EAAE,MAAM,CAAA;CACpB,CAAA;AAED;;;;;GAKG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,cAAc,CAAA;CACtB,CAAA;AAED,8DAA8D;AAC9D,MAAM,MAAM,aAAa,GAAG,eAAe,EAAE,CAAA"}
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/**
|
|
2
|
+
* Open order payload returned by Hyperliquid `frontendOpenOrders`.
|
|
3
|
+
* Sizes/prices are decimal strings; timestamps are milliseconds. Trigger
|
|
4
|
+
* flags and optional `children` describe attached TP/SL orders.
|
|
5
|
+
* @public
|
|
6
|
+
*/
|
|
2
7
|
export type HlFrontendOpenOrder = {
|
|
3
8
|
oid: number;
|
|
4
9
|
coin: string;
|
|
@@ -17,9 +22,14 @@ export type HlFrontendOpenOrder = {
|
|
|
17
22
|
tif: string | null;
|
|
18
23
|
cloid: string | null;
|
|
19
24
|
};
|
|
20
|
-
/** @public */
|
|
25
|
+
/** Array returned by the `frontendOpenOrders` info query. @public */
|
|
21
26
|
export type HlFrontendOpenOrders = HlFrontendOpenOrder[];
|
|
22
|
-
/**
|
|
27
|
+
/**
|
|
28
|
+
* Order detail nested in an `orderStatus` response. `statusTimestamp` is the
|
|
29
|
+
* last status-change time in milliseconds; `triggerPx` is nullable for orders
|
|
30
|
+
* without a trigger.
|
|
31
|
+
* @public
|
|
32
|
+
*/
|
|
23
33
|
export type HlOrderDetail = {
|
|
24
34
|
order: {
|
|
25
35
|
oid: number;
|
|
@@ -39,12 +49,16 @@ export type HlOrderDetail = {
|
|
|
39
49
|
status: string;
|
|
40
50
|
statusTimestamp: number;
|
|
41
51
|
};
|
|
42
|
-
/** @public */
|
|
52
|
+
/** Successful `orderStatus` response containing the requested order. @public */
|
|
43
53
|
export type HlOrderStatusFound = {
|
|
44
54
|
status: 'order';
|
|
45
55
|
order: HlOrderDetail;
|
|
46
56
|
};
|
|
47
|
-
/**
|
|
57
|
+
/**
|
|
58
|
+
* Result of `orderStatus`: either a found order or the exact `'unknownOid'`
|
|
59
|
+
* sentinel when Hyperliquid has no record for the numeric order ID.
|
|
60
|
+
* @public
|
|
61
|
+
*/
|
|
48
62
|
export type HlOrderStatusResponse = HlOrderStatusFound | {
|
|
49
63
|
status: 'unknownOid';
|
|
50
64
|
};
|