@nktkas/hyperliquid 0.13.2 → 0.14.0
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 +302 -91
- package/esm/mod.d.ts +3 -12
- package/esm/mod.d.ts.map +1 -1
- package/esm/mod.js +2 -2
- package/esm/src/{transports/base.d.ts → base.d.ts} +10 -13
- package/esm/src/base.d.ts.map +1 -0
- package/esm/src/base.js +14 -0
- package/esm/src/clients/event.d.ts +4 -4
- package/esm/src/clients/event.d.ts.map +1 -1
- package/esm/src/clients/event.js +2 -2
- package/esm/src/clients/public.d.ts +109 -6
- package/esm/src/clients/public.d.ts.map +1 -1
- package/esm/src/clients/public.js +106 -3
- package/esm/src/clients/wallet.d.ts +232 -29
- package/esm/src/clients/wallet.d.ts.map +1 -1
- package/esm/src/clients/wallet.js +836 -220
- package/esm/src/signing.d.ts +135 -0
- package/esm/src/signing.d.ts.map +1 -0
- package/esm/src/signing.js +188 -0
- package/esm/src/transports/http/http_transport.d.ts +1 -1
- package/esm/src/transports/http/http_transport.d.ts.map +1 -1
- package/esm/src/transports/http/http_transport.js +1 -1
- package/{script/src/transports/websocket/hyperliquid_event_target.d.ts → esm/src/transports/websocket/_hyperliquid_event_target.d.ts} +7 -15
- package/esm/src/transports/websocket/_hyperliquid_event_target.d.ts.map +1 -0
- package/esm/src/transports/websocket/{hyperliquid_event_target.js → _hyperliquid_event_target.js} +4 -22
- package/esm/src/transports/websocket/{reconnecting_websocket.d.ts → _reconnecting_websocket.d.ts} +26 -26
- package/esm/src/transports/websocket/_reconnecting_websocket.d.ts.map +1 -0
- package/esm/src/transports/websocket/{reconnecting_websocket.js → _reconnecting_websocket.js} +91 -76
- package/esm/src/transports/websocket/{websocket_request_dispatcher.d.ts → _websocket_request_dispatcher.d.ts} +3 -7
- package/esm/src/transports/websocket/_websocket_request_dispatcher.d.ts.map +1 -0
- package/esm/src/transports/websocket/{websocket_request_dispatcher.js → _websocket_request_dispatcher.js} +3 -7
- package/esm/src/transports/websocket/websocket_transport.d.ts +12 -15
- package/esm/src/transports/websocket/websocket_transport.d.ts.map +1 -1
- package/esm/src/transports/websocket/websocket_transport.js +45 -48
- package/esm/src/types/exchange/requests.d.ts +172 -20
- package/esm/src/types/exchange/requests.d.ts.map +1 -1
- package/esm/src/types/exchange/responses.d.ts +32 -32
- package/esm/src/types/exchange/responses.d.ts.map +1 -1
- package/esm/src/types/explorer/requests.d.ts +12 -12
- package/esm/src/types/explorer/requests.d.ts.map +1 -1
- package/esm/src/types/explorer/responses.d.ts +36 -1
- package/esm/src/types/explorer/responses.d.ts.map +1 -1
- package/esm/src/types/info/accounts.d.ts +130 -105
- package/esm/src/types/info/accounts.d.ts.map +1 -1
- package/esm/src/types/info/assets.d.ts +154 -152
- package/esm/src/types/info/assets.d.ts.map +1 -1
- package/esm/src/types/info/delegations.d.ts +20 -20
- package/esm/src/types/info/delegations.d.ts.map +1 -1
- package/esm/src/types/info/orders.d.ts +55 -55
- package/esm/src/types/info/orders.d.ts.map +1 -1
- package/esm/src/types/info/requests.d.ts +73 -10
- package/esm/src/types/info/requests.d.ts.map +1 -1
- package/esm/src/types/info/vaults.d.ts +1 -1
- package/esm/src/types/info/vaults.d.ts.map +1 -1
- package/esm/src/types/mod.d.ts +14 -0
- package/esm/src/types/mod.d.ts.map +1 -0
- package/esm/src/types/subscriptions/requests.d.ts +1 -1
- package/esm/src/types/subscriptions/requests.d.ts.map +1 -1
- package/{script/src/types/subscriptions/common.d.ts → esm/src/types/subscriptions/responses.d.ts} +16 -4
- package/esm/src/types/subscriptions/responses.d.ts.map +1 -0
- package/package.json +20 -4
- package/script/mod.d.ts +3 -12
- package/script/mod.d.ts.map +1 -1
- package/script/mod.js +3 -5
- package/script/src/{transports/base.d.ts → base.d.ts} +10 -13
- package/script/src/base.d.ts.map +1 -0
- package/script/src/{transports/base.js → base.js} +13 -12
- package/script/src/clients/event.d.ts +4 -4
- package/script/src/clients/event.d.ts.map +1 -1
- package/script/src/clients/event.js +2 -2
- package/script/src/clients/public.d.ts +109 -6
- package/script/src/clients/public.d.ts.map +1 -1
- package/script/src/clients/public.js +106 -3
- package/script/src/clients/wallet.d.ts +232 -29
- package/script/src/clients/wallet.d.ts.map +1 -1
- package/script/src/clients/wallet.js +837 -221
- package/script/src/signing.d.ts +135 -0
- package/script/src/signing.d.ts.map +1 -0
- package/script/src/signing.js +203 -0
- package/script/src/transports/http/http_transport.d.ts +1 -1
- package/script/src/transports/http/http_transport.d.ts.map +1 -1
- package/script/src/transports/http/http_transport.js +2 -2
- package/{esm/src/transports/websocket/hyperliquid_event_target.d.ts → script/src/transports/websocket/_hyperliquid_event_target.d.ts} +7 -15
- package/script/src/transports/websocket/_hyperliquid_event_target.d.ts.map +1 -0
- package/script/src/transports/websocket/{hyperliquid_event_target.js → _hyperliquid_event_target.js} +4 -22
- package/script/src/transports/websocket/{reconnecting_websocket.d.ts → _reconnecting_websocket.d.ts} +26 -26
- package/script/src/transports/websocket/_reconnecting_websocket.d.ts.map +1 -0
- package/script/src/transports/websocket/{reconnecting_websocket.js → _reconnecting_websocket.js} +94 -78
- package/script/src/transports/websocket/{websocket_request_dispatcher.d.ts → _websocket_request_dispatcher.d.ts} +3 -7
- package/script/src/transports/websocket/_websocket_request_dispatcher.d.ts.map +1 -0
- package/script/src/transports/websocket/{websocket_request_dispatcher.js → _websocket_request_dispatcher.js} +4 -8
- package/script/src/transports/websocket/websocket_transport.d.ts +12 -15
- package/script/src/transports/websocket/websocket_transport.d.ts.map +1 -1
- package/script/src/transports/websocket/websocket_transport.js +51 -54
- package/script/src/types/exchange/requests.d.ts +172 -20
- package/script/src/types/exchange/requests.d.ts.map +1 -1
- package/script/src/types/exchange/responses.d.ts +32 -32
- package/script/src/types/exchange/responses.d.ts.map +1 -1
- package/script/src/types/explorer/requests.d.ts +12 -12
- package/script/src/types/explorer/requests.d.ts.map +1 -1
- package/script/src/types/explorer/responses.d.ts +36 -1
- package/script/src/types/explorer/responses.d.ts.map +1 -1
- package/script/src/types/info/accounts.d.ts +130 -105
- package/script/src/types/info/accounts.d.ts.map +1 -1
- package/script/src/types/info/assets.d.ts +154 -152
- package/script/src/types/info/assets.d.ts.map +1 -1
- package/script/src/types/info/delegations.d.ts +20 -20
- package/script/src/types/info/delegations.d.ts.map +1 -1
- package/script/src/types/info/orders.d.ts +55 -55
- package/script/src/types/info/orders.d.ts.map +1 -1
- package/script/src/types/info/requests.d.ts +73 -10
- package/script/src/types/info/requests.d.ts.map +1 -1
- package/script/src/types/info/vaults.d.ts +1 -1
- package/script/src/types/info/vaults.d.ts.map +1 -1
- package/script/src/types/mod.d.ts +14 -0
- package/script/src/types/mod.d.ts.map +1 -0
- package/script/src/types/subscriptions/requests.d.ts +1 -1
- package/script/src/types/subscriptions/requests.d.ts.map +1 -1
- package/{esm/src/types/subscriptions/common.d.ts → script/src/types/subscriptions/responses.d.ts} +16 -4
- package/script/src/types/subscriptions/responses.d.ts.map +1 -0
- package/esm/src/transports/base.d.ts.map +0 -1
- package/esm/src/transports/base.js +0 -14
- package/esm/src/transports/websocket/hyperliquid_event_target.d.ts.map +0 -1
- package/esm/src/transports/websocket/reconnecting_websocket.d.ts.map +0 -1
- package/esm/src/transports/websocket/websocket_request_dispatcher.d.ts.map +0 -1
- package/esm/src/types/common.d.ts +0 -3
- package/esm/src/types/common.d.ts.map +0 -1
- package/esm/src/types/exchange/common.d.ts +0 -36
- package/esm/src/types/exchange/common.d.ts.map +0 -1
- package/esm/src/types/explorer/common.d.ts +0 -37
- package/esm/src/types/explorer/common.d.ts.map +0 -1
- package/esm/src/types/explorer/common.js +0 -1
- package/esm/src/types/subscriptions/common.d.ts.map +0 -1
- package/esm/src/types/subscriptions/common.js +0 -1
- package/esm/src/utils/key_sort.d.ts +0 -21
- package/esm/src/utils/key_sort.d.ts.map +0 -1
- package/esm/src/utils/key_sort.js +0 -124
- package/esm/src/utils/signing.d.ts +0 -109
- package/esm/src/utils/signing.d.ts.map +0 -1
- package/esm/src/utils/signing.js +0 -164
- package/script/src/transports/base.d.ts.map +0 -1
- package/script/src/transports/websocket/hyperliquid_event_target.d.ts.map +0 -1
- package/script/src/transports/websocket/reconnecting_websocket.d.ts.map +0 -1
- package/script/src/transports/websocket/websocket_request_dispatcher.d.ts.map +0 -1
- package/script/src/types/common.d.ts +0 -3
- package/script/src/types/common.d.ts.map +0 -1
- package/script/src/types/exchange/common.d.ts +0 -36
- package/script/src/types/exchange/common.d.ts.map +0 -1
- package/script/src/types/explorer/common.d.ts +0 -37
- package/script/src/types/explorer/common.d.ts.map +0 -1
- package/script/src/types/explorer/common.js +0 -12
- package/script/src/types/subscriptions/common.d.ts.map +0 -1
- package/script/src/types/subscriptions/common.js +0 -12
- package/script/src/utils/key_sort.d.ts +0 -21
- package/script/src/utils/key_sort.d.ts.map +0 -1
- package/script/src/utils/key_sort.js +0 -137
- package/script/src/utils/signing.d.ts +0 -109
- package/script/src/utils/signing.d.ts.map +0 -1
- package/script/src/utils/signing.js +0 -182
- /package/esm/src/types/{common.js → mod.js} +0 -0
- /package/esm/src/types/{exchange/common.js → subscriptions/responses.js} +0 -0
- /package/script/src/types/{common.js → mod.js} +0 -0
- /package/script/src/types/{exchange/common.js → subscriptions/responses.js} +0 -0
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type { ISubscriptionTransport, Subscription } from "../
|
|
1
|
+
import type { ISubscriptionTransport, Subscription } from "../base.js";
|
|
2
2
|
import type { WsActiveAssetCtxRequest, WsActiveAssetDataRequest, WsCandleRequest, WsL2BookRequest, WsNotificationRequest, WsOrderUpdatesRequest, WsTradesRequest, WsUserEventsRequest, WsUserFillsRequest, WsUserFundingsRequest, WsUserNonFundingLedgerUpdatesRequest, WsUserTwapHistoryRequest, WsUserTwapSliceFillsRequest, WsWebData2Request } from "../types/subscriptions/requests.js";
|
|
3
|
-
import type { WsActiveAssetCtx, WsActiveAssetData, WsActiveSpotAssetCtx, WsAllMids, WsBlockDetails, WsNotification, WsTrade, WsUserEvent, WsUserFills, WsUserFundings, WsUserNonFundingLedgerUpdates, WsUserTwapHistory, WsUserTwapSliceFills, WsWebData2 } from "../types/subscriptions/
|
|
3
|
+
import type { WsActiveAssetCtx, WsActiveAssetData, WsActiveSpotAssetCtx, WsAllMids, WsBlockDetails, WsNotification, WsTrade, WsUserEvent, WsUserFills, WsUserFundings, WsUserNonFundingLedgerUpdates, WsUserTwapHistory, WsUserTwapSliceFills, WsWebData2 } from "../types/subscriptions/responses.js";
|
|
4
4
|
import type { Candle } from "../types/info/assets.js";
|
|
5
5
|
import type { Book, Order, OrderStatus } from "../types/info/orders.js";
|
|
6
|
-
import type { TxDetails } from "../types/explorer/
|
|
6
|
+
import type { TxDetails } from "../types/explorer/responses.js";
|
|
7
7
|
/** Parameters for the {@linkcode EventClient} constructor. */
|
|
8
8
|
export interface EventClientParameters<T extends ISubscriptionTransport = ISubscriptionTransport> {
|
|
9
9
|
/** The transport used to connect to the Hyperliquid API. */
|
|
@@ -39,7 +39,7 @@ export type EventUserTwapSliceFills = Omit<WsUserTwapSliceFillsRequest, "type">;
|
|
|
39
39
|
export type EventWebData2Parameters = Omit<WsWebData2Request, "type">;
|
|
40
40
|
/**
|
|
41
41
|
* Event client for subscribing to various Hyperliquid events.
|
|
42
|
-
* @typeParam T
|
|
42
|
+
* @typeParam T The type of transport used to connect to the Hyperliquid Websocket API.
|
|
43
43
|
*/
|
|
44
44
|
export declare class EventClient<T extends ISubscriptionTransport = ISubscriptionTransport> {
|
|
45
45
|
/** The transport used to connect to the Hyperliquid API. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"event.d.ts","sourceRoot":"","sources":["../../../src/src/clients/event.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,YAAY,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"event.d.ts","sourceRoot":"","sources":["../../../src/src/clients/event.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,YAAY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;;;;;;;;;;;;;;OAmBG;IACH,eAAe,CACX,IAAI,EAAE,oBAAoB,EAC1B,QAAQ,EAAE,CAAC,IAAI,EAAE,iBAAiB,KAAK,IAAI,EAC3C,MAAM,CAAC,EAAE,WAAW,GACrB,OAAO,CAAC,YAAY,CAAC;IAiBxB;;;;;;;;;;;;;;;;;;;OAmBG;IACH,kBAAkB,CACd,IAAI,EAAE,uBAAuB,EAC7B,QAAQ,EAAE,CAAC,IAAI,EAAE,oBAAoB,KAAK,IAAI,EAC9C,MAAM,CAAC,EAAE,WAAW,GACrB,OAAO,CAAC,YAAY,CAAC;IAiBxB;;;;;;;;;;;;;;;;;;;OAmBG;IACH,QAAQ,CACJ,IAAI,EAAE,uBAAuB,EAC7B,QAAQ,EAAE,CAAC,IAAI,EAAE,UAAU,KAAK,IAAI,EACpC,MAAM,CAAC,EAAE,WAAW,GACrB,OAAO,CAAC,YAAY,CAAC;CAgB3B"}
|
package/esm/src/clients/event.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// ——————————————— Client ———————————————
|
|
2
2
|
/**
|
|
3
3
|
* Event client for subscribing to various Hyperliquid events.
|
|
4
|
-
* @typeParam T
|
|
4
|
+
* @typeParam T The type of transport used to connect to the Hyperliquid Websocket API.
|
|
5
5
|
*/
|
|
6
6
|
export class EventClient {
|
|
7
7
|
/**
|
|
@@ -354,7 +354,7 @@ export class EventClient {
|
|
|
354
354
|
type: "userEvents",
|
|
355
355
|
user: args.user,
|
|
356
356
|
};
|
|
357
|
-
return this.transport.subscribe(
|
|
357
|
+
return this.transport.subscribe("user", payload, (event) => {
|
|
358
358
|
listener(event.detail);
|
|
359
359
|
}, signal);
|
|
360
360
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type { IRequestTransport } from "../
|
|
1
|
+
import type { IRequestTransport } from "../base.js";
|
|
2
2
|
import type { BlockDetailsRequest, TxDetailsRequest, UserDetailsRequest } from "../types/explorer/requests.js";
|
|
3
3
|
import type { BlockDetailsResponse, TxDetailsResponse, UserDetailsResponse } from "../types/explorer/responses.js";
|
|
4
|
-
import type { ExtraAgent, PerpsClearinghouseState, PortfolioPeriods, Referral, SpotClearinghouseState, SubAccount, UserFees, UserFundingUpdate, UserNonFundingLedgerUpdate, UserRateLimit, UserRole } from "../types/info/accounts.js";
|
|
4
|
+
import type { ExtraAgent, LegalCheck, MultiSigSigners, PerpsClearinghouseState, PortfolioPeriods, PreTransferCheck, Referral, SpotClearinghouseState, SubAccount, UserFees, UserFundingUpdate, UserNonFundingLedgerUpdate, UserRateLimit, UserRole } from "../types/info/accounts.js";
|
|
5
5
|
import type { AllMids, Candle, FundingHistory, PerpsMeta, PerpsMetaAndAssetCtxs, PredictedFunding, SpotDeployState, SpotMeta, SpotMetaAndAssetCtxs, TokenDetails } from "../types/info/assets.js";
|
|
6
6
|
import type { Delegation, DelegatorReward, DelegatorSummary, DelegatorUpdate, ValidatorSummary } from "../types/info/delegations.js";
|
|
7
7
|
import type { Book, Fill, FrontendOrder, Order, OrderLookup, OrderStatus, TwapHistory, TwapSliceFill } from "../types/info/orders.js";
|
|
8
|
-
import type { CandleSnapshotRequest, ClearinghouseStateRequest, DelegationsRequest, DelegatorHistoryRequest, DelegatorRewardsRequest, DelegatorSummaryRequest, ExtraAgentsRequest, FrontendOpenOrdersRequest, FundingHistoryRequest, HistoricalOrdersRequest, L2BookRequest, MaxBuilderFeeRequest, OpenOrdersRequest, OrderStatusRequest, PortfolioRequest, ReferralRequest, SpotClearinghouseStateRequest, SpotDeployStateRequest, SubAccountsRequest, TokenDetailsRequest, TwapHistoryRequest, UserFeesRequest, UserFillsByTimeRequest, UserFillsRequest, UserFundingRequest, UserNonFundingLedgerUpdatesRequest, UserRateLimitRequest, UserRoleRequest, UserTwapSliceFillsRequest, UserVaultEquitiesRequest, VaultDetailsRequest } from "../types/info/requests.js";
|
|
8
|
+
import type { CandleSnapshotRequest, ClearinghouseStateRequest, DelegationsRequest, DelegatorHistoryRequest, DelegatorRewardsRequest, DelegatorSummaryRequest, ExtraAgentsRequest, FrontendOpenOrdersRequest, FundingHistoryRequest, HistoricalOrdersRequest, IsVipRequest, L2BookRequest, LegalCheckRequest, MaxBuilderFeeRequest, OpenOrdersRequest, OrderStatusRequest, PortfolioRequest, PreTransferCheckRequest, ReferralRequest, SpotClearinghouseStateRequest, SpotDeployStateRequest, SubAccountsRequest, TokenDetailsRequest, TwapHistoryRequest, UserFeesRequest, UserFillsByTimeRequest, UserFillsRequest, UserFundingRequest, UserNonFundingLedgerUpdatesRequest, UserRateLimitRequest, UserRoleRequest, UserToMultiSigSignersRequest, UserTwapSliceFillsByTimeRequest, UserTwapSliceFillsRequest, UserVaultEquitiesRequest, VaultDetailsRequest } from "../types/info/requests.js";
|
|
9
9
|
import type { VaultDetails, VaultEquity, VaultSummary } from "../types/info/vaults.js";
|
|
10
10
|
/** Parameters for the {@linkcode PublicClient} constructor. */
|
|
11
11
|
export interface PublicClientParameters<T extends IRequestTransport = IRequestTransport> {
|
|
@@ -32,8 +32,12 @@ export type FrontendOpenOrdersParameters = Omit<FrontendOpenOrdersRequest, "type
|
|
|
32
32
|
export type FundingHistoryParameters = Omit<FundingHistoryRequest, "type">;
|
|
33
33
|
/** Parameters for the {@linkcode PublicClient.historicalOrders} method. */
|
|
34
34
|
export type HistoricalOrdersParameters = Omit<HistoricalOrdersRequest, "type">;
|
|
35
|
+
/** Parameters for the {@linkcode PublicClient.isVip} method. */
|
|
36
|
+
export type IsVipParameters = Omit<IsVipRequest, "type">;
|
|
35
37
|
/** Parameters for the {@linkcode PublicClient.l2Book} method. */
|
|
36
38
|
export type L2BookParameters = Omit<L2BookRequest, "type">;
|
|
39
|
+
/** Parameters for the {@linkcode PublicClient.legalCheck} method. */
|
|
40
|
+
export type LegalCheckParameters = Omit<LegalCheckRequest, "type">;
|
|
37
41
|
/** Parameters for the {@linkcode PublicClient.maxBuilderFee} method. */
|
|
38
42
|
export type MaxBuilderFeeParameters = Omit<MaxBuilderFeeRequest, "type">;
|
|
39
43
|
/** Parameters for the {@linkcode PublicClient.openOrders} method. */
|
|
@@ -42,6 +46,8 @@ export type OpenOrdersParameters = Omit<OpenOrdersRequest, "type">;
|
|
|
42
46
|
export type OrderStatusParameters = Omit<OrderStatusRequest, "type">;
|
|
43
47
|
/** Parameters for the {@linkcode PublicClient.portfolio} method. */
|
|
44
48
|
export type PortfolioParameters = Omit<PortfolioRequest, "type">;
|
|
49
|
+
/** Parameters for the {@linkcode PublicClient.preTransferCheck} method. */
|
|
50
|
+
export type PreTransferCheckParameters = Omit<PreTransferCheckRequest, "type">;
|
|
45
51
|
/** Parameters for the {@linkcode PublicClient.referral} method. */
|
|
46
52
|
export type ReferralParameters = Omit<ReferralRequest, "type">;
|
|
47
53
|
/** Parameters for the {@linkcode PublicClient.spotClearinghouseState} method. */
|
|
@@ -68,8 +74,12 @@ export type UserNonFundingLedgerUpdatesParameters = Omit<UserNonFundingLedgerUpd
|
|
|
68
74
|
export type UserRateLimitParameters = Omit<UserRateLimitRequest, "type">;
|
|
69
75
|
/** Parameters for the {@linkcode PublicClient.userRole} method. */
|
|
70
76
|
export type UserRoleParameters = Omit<UserRoleRequest, "type">;
|
|
77
|
+
/** Parameters for the {@linkcode PublicClient.userToMultiSigSigners} method. */
|
|
78
|
+
export type UserToMultiSigSignersParameters = Omit<UserToMultiSigSignersRequest, "type">;
|
|
71
79
|
/** Parameters for the {@linkcode PublicClient.userTwapSliceFills} method. */
|
|
72
80
|
export type UserTwapSliceFillsParameters = Omit<UserTwapSliceFillsRequest, "type">;
|
|
81
|
+
/** Parameters for the {@linkcode PublicClient.userTwapSliceFillsByTime} method. */
|
|
82
|
+
export type UserTwapSliceFillsByTimeParameters = Omit<UserTwapSliceFillsByTimeRequest, "type">;
|
|
73
83
|
/** Parameters for the {@linkcode PublicClient.userVaultEquities} method. */
|
|
74
84
|
export type UserVaultEquitiesParameters = Omit<UserVaultEquitiesRequest, "type">;
|
|
75
85
|
/** Parameters for the {@linkcode PublicClient.vaultDetails} method. */
|
|
@@ -82,7 +92,7 @@ export type TxDetailsParameters = Omit<TxDetailsRequest, "type">;
|
|
|
82
92
|
export type UserDetailsParameters = Omit<UserDetailsRequest, "type">;
|
|
83
93
|
/**
|
|
84
94
|
* Public client for interacting with the Hyperliquid API.
|
|
85
|
-
* @typeParam T
|
|
95
|
+
* @typeParam T The type of transport used to connect to the Hyperliquid API.
|
|
86
96
|
*/
|
|
87
97
|
export declare class PublicClient<T extends IRequestTransport = IRequestTransport> {
|
|
88
98
|
/** The transport used to connect to the Hyperliquid API. */
|
|
@@ -286,6 +296,24 @@ export declare class PublicClient<T extends IRequestTransport = IRequestTranspor
|
|
|
286
296
|
* ```
|
|
287
297
|
*/
|
|
288
298
|
fundingHistory(args: FundingHistoryParameters, signal?: AbortSignal): Promise<FundingHistory[]>;
|
|
299
|
+
/**
|
|
300
|
+
* Request to check if a user is a VIP.
|
|
301
|
+
* @param args - The parameters for the request.
|
|
302
|
+
* @param signal - An optional abort signal.
|
|
303
|
+
* @returns Boolean indicating user's VIP status.
|
|
304
|
+
*
|
|
305
|
+
* @see null - no documentation
|
|
306
|
+
* @example
|
|
307
|
+
* ```ts
|
|
308
|
+
* import * as hl from "@nktkas/hyperliquid";
|
|
309
|
+
*
|
|
310
|
+
* const transport = new hl.HttpTransport(); // or WebSocketTransport
|
|
311
|
+
* const client = new hl.PublicClient({ transport });
|
|
312
|
+
*
|
|
313
|
+
* const isVip = await client.isVip({ user: "0x..." });
|
|
314
|
+
* ```
|
|
315
|
+
*/
|
|
316
|
+
isVip(args: IsVipParameters, signal?: AbortSignal): Promise<boolean>;
|
|
289
317
|
/**
|
|
290
318
|
* Request user's historical orders.
|
|
291
319
|
* @param args - The parameters for the request.
|
|
@@ -322,6 +350,24 @@ export declare class PublicClient<T extends IRequestTransport = IRequestTranspor
|
|
|
322
350
|
* ```
|
|
323
351
|
*/
|
|
324
352
|
l2Book(args: L2BookParameters, signal?: AbortSignal): Promise<Book>;
|
|
353
|
+
/**
|
|
354
|
+
* Request legal verification status of a user.
|
|
355
|
+
* @param args - The parameters for the request.
|
|
356
|
+
* @param signal - An optional abort signal.
|
|
357
|
+
* @returns Legal verification status for a user.
|
|
358
|
+
*
|
|
359
|
+
* @see null - no documentation
|
|
360
|
+
* @example
|
|
361
|
+
* ```ts
|
|
362
|
+
* import * as hl from "@nktkas/hyperliquid";
|
|
363
|
+
*
|
|
364
|
+
* const transport = new hl.HttpTransport(); // or WebSocketTransport
|
|
365
|
+
* const client = new hl.PublicClient({ transport });
|
|
366
|
+
*
|
|
367
|
+
* const legalCheck = await client.legalCheck({ user: "0x..." });
|
|
368
|
+
* ```
|
|
369
|
+
*/
|
|
370
|
+
legalCheck(args: LegalCheckParameters, signal?: AbortSignal): Promise<LegalCheck>;
|
|
325
371
|
/**
|
|
326
372
|
* Request builder fee approval.
|
|
327
373
|
* @param args - The parameters for the request.
|
|
@@ -428,6 +474,24 @@ export declare class PublicClient<T extends IRequestTransport = IRequestTranspor
|
|
|
428
474
|
* ```
|
|
429
475
|
*/
|
|
430
476
|
portfolio(args: PortfolioParameters, signal?: AbortSignal): Promise<PortfolioPeriods>;
|
|
477
|
+
/**
|
|
478
|
+
* Request user's existence check before transfer.
|
|
479
|
+
* @param args - The parameters for the request.
|
|
480
|
+
* @param signal - An optional abort signal.
|
|
481
|
+
* @returns Pre-transfer user existence check result.
|
|
482
|
+
*
|
|
483
|
+
* @see null - no documentation
|
|
484
|
+
* @example
|
|
485
|
+
* ```ts
|
|
486
|
+
* import * as hl from "@nktkas/hyperliquid";
|
|
487
|
+
*
|
|
488
|
+
* const transport = new hl.HttpTransport(); // or WebSocketTransport
|
|
489
|
+
* const client = new hl.PublicClient({ transport });
|
|
490
|
+
*
|
|
491
|
+
* const preTransferCheck = await client.preTransferCheck({ user: "0x...", source: "0x..." });
|
|
492
|
+
* ```
|
|
493
|
+
*/
|
|
494
|
+
preTransferCheck(args: PreTransferCheckParameters, signal?: AbortSignal): Promise<PreTransferCheck>;
|
|
431
495
|
/**
|
|
432
496
|
* Request perpetuals at open interest cap.
|
|
433
497
|
* @param args - The parameters for the request.
|
|
@@ -555,7 +619,7 @@ export declare class PublicClient<T extends IRequestTransport = IRequestTranspor
|
|
|
555
619
|
* Request user sub-accounts.
|
|
556
620
|
* @param args - The parameters for the request.
|
|
557
621
|
* @param signal - An optional abort signal.
|
|
558
|
-
* @returns Array of user sub-account.
|
|
622
|
+
* @returns Array of user sub-account or null if the user does not have any sub-accounts.
|
|
559
623
|
*
|
|
560
624
|
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#retrieve-a-users-subaccounts
|
|
561
625
|
* @example
|
|
@@ -740,6 +804,24 @@ export declare class PublicClient<T extends IRequestTransport = IRequestTranspor
|
|
|
740
804
|
* ```
|
|
741
805
|
*/
|
|
742
806
|
userRole(args: UserRoleParameters, signal?: AbortSignal): Promise<UserRole>;
|
|
807
|
+
/**
|
|
808
|
+
* Request multi-sig signers for a user.
|
|
809
|
+
* @param args - The parameters for the request.
|
|
810
|
+
* @param signal - An optional abort signal.
|
|
811
|
+
* @returns Multi-sig signers for a user or null if the user does not have any multi-sig signers.
|
|
812
|
+
*
|
|
813
|
+
* @see null - no documentation
|
|
814
|
+
* @example
|
|
815
|
+
* ```ts
|
|
816
|
+
* import * as hl from "@nktkas/hyperliquid";
|
|
817
|
+
*
|
|
818
|
+
* const transport = new hl.HttpTransport(); // or WebSocketTransport
|
|
819
|
+
* const client = new hl.PublicClient({ transport });
|
|
820
|
+
*
|
|
821
|
+
* const multiSigSigners = await client.userToMultiSigSigners({ user: "0x..." });
|
|
822
|
+
* ```
|
|
823
|
+
*/
|
|
824
|
+
userToMultiSigSigners(args: UserToMultiSigSignersParameters, signal?: AbortSignal): Promise<MultiSigSigners | null>;
|
|
743
825
|
/**
|
|
744
826
|
* Request user twap slice fills.
|
|
745
827
|
* @param args - The parameters for the request.
|
|
@@ -758,6 +840,27 @@ export declare class PublicClient<T extends IRequestTransport = IRequestTranspor
|
|
|
758
840
|
* ```
|
|
759
841
|
*/
|
|
760
842
|
userTwapSliceFills(args: UserTwapSliceFillsParameters, signal?: AbortSignal): Promise<TwapSliceFill[]>;
|
|
843
|
+
/**
|
|
844
|
+
* Request user twap slice fills by time.
|
|
845
|
+
* @param args - The parameters for the request.
|
|
846
|
+
* @param signal - An optional abort signal.
|
|
847
|
+
* @returns Array of user's twap slice fill.
|
|
848
|
+
*
|
|
849
|
+
* @see null - no documentation
|
|
850
|
+
* @example
|
|
851
|
+
* ```ts
|
|
852
|
+
* import * as hl from "@nktkas/hyperliquid";
|
|
853
|
+
*
|
|
854
|
+
* const transport = new hl.HttpTransport(); // or WebSocketTransport
|
|
855
|
+
* const client = new hl.PublicClient({ transport });
|
|
856
|
+
*
|
|
857
|
+
* const twapSliceFillsByTime = await client.userTwapSliceFillsByTime({
|
|
858
|
+
* user: "0x...",
|
|
859
|
+
* startTime: Date.now() - 1000 * 60 * 60 * 24
|
|
860
|
+
* });
|
|
861
|
+
* ```
|
|
862
|
+
*/
|
|
863
|
+
userTwapSliceFillsByTime(args: UserTwapSliceFillsByTimeParameters, signal?: AbortSignal): Promise<TwapSliceFill[]>;
|
|
761
864
|
/**
|
|
762
865
|
* Request user vault deposits.
|
|
763
866
|
* @param args - The parameters for the request.
|
|
@@ -797,7 +900,7 @@ export declare class PublicClient<T extends IRequestTransport = IRequestTranspor
|
|
|
797
900
|
* Request details of a vault.
|
|
798
901
|
* @param args - The parameters for the request.
|
|
799
902
|
* @param signal - An optional abort signal.
|
|
800
|
-
* @returns Details of a vault.
|
|
903
|
+
* @returns Details of a vault or null if the vault does not exist.
|
|
801
904
|
*
|
|
802
905
|
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#retrieve-details-for-a-vault
|
|
803
906
|
* @example
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"public.d.ts","sourceRoot":"","sources":["../../../src/src/clients/public.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"public.d.ts","sourceRoot":"","sources":["../../../src/src/clients/public.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AACpD,OAAO,KAAK,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AAC/G,OAAO,KAAK,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AACnH,OAAO,KAAK,EACR,UAAU,EACV,UAAU,EACV,eAAe,EACf,uBAAuB,EACvB,gBAAgB,EAChB,gBAAgB,EAChB,QAAQ,EACR,sBAAsB,EACtB,UAAU,EACV,QAAQ,EACR,iBAAiB,EACjB,0BAA0B,EAC1B,aAAa,EACb,QAAQ,EACX,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,EACR,OAAO,EACP,MAAM,EACN,cAAc,EACd,SAAS,EACT,qBAAqB,EACrB,gBAAgB,EAChB,eAAe,EACf,QAAQ,EACR,oBAAoB,EACpB,YAAY,EACf,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,EACR,UAAU,EACV,eAAe,EACf,gBAAgB,EAChB,eAAe,EACf,gBAAgB,EACnB,MAAM,8BAA8B,CAAC;AACtC,OAAO,KAAK,EACR,IAAI,EACJ,IAAI,EACJ,aAAa,EACb,KAAK,EACL,WAAW,EACX,WAAW,EACX,WAAW,EACX,aAAa,EAChB,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,EACR,qBAAqB,EACrB,yBAAyB,EACzB,kBAAkB,EAClB,uBAAuB,EACvB,uBAAuB,EACvB,uBAAuB,EACvB,kBAAkB,EAClB,yBAAyB,EACzB,qBAAqB,EACrB,uBAAuB,EACvB,YAAY,EACZ,aAAa,EACb,iBAAiB,EACjB,oBAAoB,EACpB,iBAAiB,EACjB,kBAAkB,EAClB,gBAA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ACH,kBAAkB,CAAC,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,gBAAgB,EAAE,CAAC;IAQrE;;;;;;;;;;;;;;;;OAgBG;IACH,YAAY,CAAC,IAAI,EAAE,sBAAsB,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC;IAQ9F;;;;;;;;;;;;;;;;OAgBG;IACH,cAAc,CAAC,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC;IAU7D;;;;;;;;;;;;;;;;OAgBG;IACH,YAAY,CAAC,IAAI,EAAE,sBAAsB,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAQ/F;;;;;;;;;;;;;;;;OAgBG;IACH,SAAS,CAAC,IAAI,EAAE,mBAAmB,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAQtF;;;;;;;;;;;;;;;;OAgBG;IACH,WAAW,CAAC,IAAI,EAAE,qBAAqB,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,mBAAmB,CAAC;CAO/F"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// ——————————————— Client ———————————————
|
|
2
2
|
/**
|
|
3
3
|
* Public client for interacting with the Hyperliquid API.
|
|
4
|
-
* @typeParam T
|
|
4
|
+
* @typeParam T The type of transport used to connect to the Hyperliquid API.
|
|
5
5
|
*/
|
|
6
6
|
export class PublicClient {
|
|
7
7
|
/**
|
|
@@ -233,6 +233,26 @@ export class PublicClient {
|
|
|
233
233
|
fundingHistory(args, signal) {
|
|
234
234
|
return this.transport.request("info", { type: "fundingHistory", ...args }, signal);
|
|
235
235
|
}
|
|
236
|
+
/**
|
|
237
|
+
* Request to check if a user is a VIP.
|
|
238
|
+
* @param args - The parameters for the request.
|
|
239
|
+
* @param signal - An optional abort signal.
|
|
240
|
+
* @returns Boolean indicating user's VIP status.
|
|
241
|
+
*
|
|
242
|
+
* @see null - no documentation
|
|
243
|
+
* @example
|
|
244
|
+
* ```ts
|
|
245
|
+
* import * as hl from "@nktkas/hyperliquid";
|
|
246
|
+
*
|
|
247
|
+
* const transport = new hl.HttpTransport(); // or WebSocketTransport
|
|
248
|
+
* const client = new hl.PublicClient({ transport });
|
|
249
|
+
*
|
|
250
|
+
* const isVip = await client.isVip({ user: "0x..." });
|
|
251
|
+
* ```
|
|
252
|
+
*/
|
|
253
|
+
isVip(args, signal) {
|
|
254
|
+
return this.transport.request("info", { type: "isVip", ...args }, signal);
|
|
255
|
+
}
|
|
236
256
|
/**
|
|
237
257
|
* Request user's historical orders.
|
|
238
258
|
* @param args - The parameters for the request.
|
|
@@ -273,6 +293,26 @@ export class PublicClient {
|
|
|
273
293
|
l2Book(args, signal) {
|
|
274
294
|
return this.transport.request("info", { type: "l2Book", ...args }, signal);
|
|
275
295
|
}
|
|
296
|
+
/**
|
|
297
|
+
* Request legal verification status of a user.
|
|
298
|
+
* @param args - The parameters for the request.
|
|
299
|
+
* @param signal - An optional abort signal.
|
|
300
|
+
* @returns Legal verification status for a user.
|
|
301
|
+
*
|
|
302
|
+
* @see null - no documentation
|
|
303
|
+
* @example
|
|
304
|
+
* ```ts
|
|
305
|
+
* import * as hl from "@nktkas/hyperliquid";
|
|
306
|
+
*
|
|
307
|
+
* const transport = new hl.HttpTransport(); // or WebSocketTransport
|
|
308
|
+
* const client = new hl.PublicClient({ transport });
|
|
309
|
+
*
|
|
310
|
+
* const legalCheck = await client.legalCheck({ user: "0x..." });
|
|
311
|
+
* ```
|
|
312
|
+
*/
|
|
313
|
+
legalCheck(args, signal) {
|
|
314
|
+
return this.transport.request("info", { type: "legalCheck", ...args }, signal);
|
|
315
|
+
}
|
|
276
316
|
/**
|
|
277
317
|
* Request builder fee approval.
|
|
278
318
|
* @param args - The parameters for the request.
|
|
@@ -391,6 +431,26 @@ export class PublicClient {
|
|
|
391
431
|
portfolio(args, signal) {
|
|
392
432
|
return this.transport.request("info", { type: "portfolio", ...args }, signal);
|
|
393
433
|
}
|
|
434
|
+
/**
|
|
435
|
+
* Request user's existence check before transfer.
|
|
436
|
+
* @param args - The parameters for the request.
|
|
437
|
+
* @param signal - An optional abort signal.
|
|
438
|
+
* @returns Pre-transfer user existence check result.
|
|
439
|
+
*
|
|
440
|
+
* @see null - no documentation
|
|
441
|
+
* @example
|
|
442
|
+
* ```ts
|
|
443
|
+
* import * as hl from "@nktkas/hyperliquid";
|
|
444
|
+
*
|
|
445
|
+
* const transport = new hl.HttpTransport(); // or WebSocketTransport
|
|
446
|
+
* const client = new hl.PublicClient({ transport });
|
|
447
|
+
*
|
|
448
|
+
* const preTransferCheck = await client.preTransferCheck({ user: "0x...", source: "0x..." });
|
|
449
|
+
* ```
|
|
450
|
+
*/
|
|
451
|
+
preTransferCheck(args, signal) {
|
|
452
|
+
return this.transport.request("info", { type: "preTransferCheck", ...args }, signal);
|
|
453
|
+
}
|
|
394
454
|
/**
|
|
395
455
|
* Request perpetuals at open interest cap.
|
|
396
456
|
* @param args - The parameters for the request.
|
|
@@ -532,7 +592,7 @@ export class PublicClient {
|
|
|
532
592
|
* Request user sub-accounts.
|
|
533
593
|
* @param args - The parameters for the request.
|
|
534
594
|
* @param signal - An optional abort signal.
|
|
535
|
-
* @returns Array of user sub-account.
|
|
595
|
+
* @returns Array of user sub-account or null if the user does not have any sub-accounts.
|
|
536
596
|
*
|
|
537
597
|
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#retrieve-a-users-subaccounts
|
|
538
598
|
* @example
|
|
@@ -737,6 +797,26 @@ export class PublicClient {
|
|
|
737
797
|
userRole(args, signal) {
|
|
738
798
|
return this.transport.request("info", { type: "userRole", ...args }, signal);
|
|
739
799
|
}
|
|
800
|
+
/**
|
|
801
|
+
* Request multi-sig signers for a user.
|
|
802
|
+
* @param args - The parameters for the request.
|
|
803
|
+
* @param signal - An optional abort signal.
|
|
804
|
+
* @returns Multi-sig signers for a user or null if the user does not have any multi-sig signers.
|
|
805
|
+
*
|
|
806
|
+
* @see null - no documentation
|
|
807
|
+
* @example
|
|
808
|
+
* ```ts
|
|
809
|
+
* import * as hl from "@nktkas/hyperliquid";
|
|
810
|
+
*
|
|
811
|
+
* const transport = new hl.HttpTransport(); // or WebSocketTransport
|
|
812
|
+
* const client = new hl.PublicClient({ transport });
|
|
813
|
+
*
|
|
814
|
+
* const multiSigSigners = await client.userToMultiSigSigners({ user: "0x..." });
|
|
815
|
+
* ```
|
|
816
|
+
*/
|
|
817
|
+
userToMultiSigSigners(args, signal) {
|
|
818
|
+
return this.transport.request("info", { type: "userToMultiSigSigners", ...args }, signal);
|
|
819
|
+
}
|
|
740
820
|
/**
|
|
741
821
|
* Request user twap slice fills.
|
|
742
822
|
* @param args - The parameters for the request.
|
|
@@ -757,6 +837,29 @@ export class PublicClient {
|
|
|
757
837
|
userTwapSliceFills(args, signal) {
|
|
758
838
|
return this.transport.request("info", { type: "userTwapSliceFills", ...args }, signal);
|
|
759
839
|
}
|
|
840
|
+
/**
|
|
841
|
+
* Request user twap slice fills by time.
|
|
842
|
+
* @param args - The parameters for the request.
|
|
843
|
+
* @param signal - An optional abort signal.
|
|
844
|
+
* @returns Array of user's twap slice fill.
|
|
845
|
+
*
|
|
846
|
+
* @see null - no documentation
|
|
847
|
+
* @example
|
|
848
|
+
* ```ts
|
|
849
|
+
* import * as hl from "@nktkas/hyperliquid";
|
|
850
|
+
*
|
|
851
|
+
* const transport = new hl.HttpTransport(); // or WebSocketTransport
|
|
852
|
+
* const client = new hl.PublicClient({ transport });
|
|
853
|
+
*
|
|
854
|
+
* const twapSliceFillsByTime = await client.userTwapSliceFillsByTime({
|
|
855
|
+
* user: "0x...",
|
|
856
|
+
* startTime: Date.now() - 1000 * 60 * 60 * 24
|
|
857
|
+
* });
|
|
858
|
+
* ```
|
|
859
|
+
*/
|
|
860
|
+
userTwapSliceFillsByTime(args, signal) {
|
|
861
|
+
return this.transport.request("info", { type: "userTwapSliceFillsByTime", ...args }, signal);
|
|
862
|
+
}
|
|
760
863
|
/**
|
|
761
864
|
* Request user vault deposits.
|
|
762
865
|
* @param args - The parameters for the request.
|
|
@@ -800,7 +903,7 @@ export class PublicClient {
|
|
|
800
903
|
* Request details of a vault.
|
|
801
904
|
* @param args - The parameters for the request.
|
|
802
905
|
* @param signal - An optional abort signal.
|
|
803
|
-
* @returns Details of a vault.
|
|
906
|
+
* @returns Details of a vault or null if the vault does not exist.
|
|
804
907
|
*
|
|
805
908
|
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#retrieve-details-for-a-vault
|
|
806
909
|
* @example
|