@nktkas/hyperliquid 0.13.1 → 0.13.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/LICENSE +20 -20
- package/README.md +33 -17
- package/esm/deps/jsr.io/@std/bytes/1.0.5/_types.d.ts +9 -0
- package/esm/deps/jsr.io/@std/bytes/1.0.5/_types.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/bytes/1.0.5/_types.js +2 -0
- package/esm/deps/jsr.io/@std/bytes/{1.0.4 → 1.0.5}/concat.d.ts +3 -1
- package/esm/deps/jsr.io/@std/bytes/1.0.5/concat.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/bytes/{1.0.4 → 1.0.5}/concat.js +1 -1
- package/esm/deps/jsr.io/@std/encoding/1.0.7/_types.d.ts +9 -0
- package/esm/deps/jsr.io/@std/encoding/1.0.7/_types.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/encoding/1.0.7/_types.js +2 -0
- package/esm/deps/jsr.io/@std/encoding/{1.0.6 → 1.0.7}/_validate_binary_like.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/encoding/{1.0.6 → 1.0.7}/_validate_binary_like.js +1 -1
- package/{script/deps/jsr.io/@std/encoding/1.0.6 → esm/deps/jsr.io/@std/encoding/1.0.7}/hex.d.ts +3 -1
- package/esm/deps/jsr.io/@std/encoding/1.0.7/hex.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/encoding/{1.0.6 → 1.0.7}/hex.js +1 -1
- package/esm/deps/jsr.io/@std/msgpack/1.0.3/_types.d.ts +9 -0
- package/esm/deps/jsr.io/@std/msgpack/1.0.3/_types.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/msgpack/1.0.3/_types.js +2 -0
- package/esm/deps/jsr.io/@std/msgpack/{1.0.2 → 1.0.3}/encode.d.ts +3 -1
- package/esm/deps/jsr.io/@std/msgpack/1.0.3/encode.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/msgpack/{1.0.2 → 1.0.3}/encode.js +2 -2
- package/esm/mod.d.ts +1 -0
- package/esm/mod.d.ts.map +1 -1
- package/esm/src/clients/event.d.ts +57 -16
- package/esm/src/clients/event.d.ts.map +1 -1
- package/esm/src/clients/event.js +72 -16
- package/esm/src/clients/public.d.ts +241 -49
- package/esm/src/clients/public.d.ts.map +1 -1
- package/esm/src/clients/public.js +243 -47
- package/esm/src/clients/wallet.d.ts +120 -51
- package/esm/src/clients/wallet.d.ts.map +1 -1
- package/esm/src/clients/wallet.js +192 -58
- package/esm/src/transports/websocket/hyperliquid_event_target.d.ts +27 -21
- package/esm/src/transports/websocket/hyperliquid_event_target.d.ts.map +1 -1
- package/esm/src/transports/websocket/hyperliquid_event_target.js +37 -0
- package/esm/src/transports/websocket/websocket_request_dispatcher.js +3 -3
- package/esm/src/transports/websocket/websocket_transport.d.ts +7 -10
- package/esm/src/transports/websocket/websocket_transport.d.ts.map +1 -1
- package/esm/src/transports/websocket/websocket_transport.js +41 -35
- package/esm/src/types/exchange/common.d.ts +6 -6
- package/esm/src/types/exchange/common.d.ts.map +1 -1
- package/esm/src/types/exchange/requests.d.ts +131 -64
- package/esm/src/types/exchange/requests.d.ts.map +1 -1
- package/esm/src/types/exchange/responses.d.ts +7 -7
- package/esm/src/types/exchange/responses.d.ts.map +1 -1
- package/esm/src/types/explorer/common.d.ts +15 -15
- package/esm/src/types/explorer/common.d.ts.map +1 -1
- package/esm/src/types/explorer/requests.d.ts +19 -6
- package/esm/src/types/explorer/requests.d.ts.map +1 -1
- package/esm/src/types/explorer/responses.d.ts +9 -2
- package/esm/src/types/explorer/responses.d.ts.map +1 -1
- package/esm/src/types/info/accounts.d.ts +189 -124
- package/esm/src/types/info/accounts.d.ts.map +1 -1
- package/esm/src/types/info/assets.d.ts +82 -78
- package/esm/src/types/info/assets.d.ts.map +1 -1
- package/esm/src/types/info/delegations.d.ts +117 -0
- package/esm/src/types/info/delegations.d.ts.map +1 -0
- package/esm/src/types/info/delegations.js +1 -0
- package/esm/src/types/info/orders.d.ts +67 -67
- package/esm/src/types/info/orders.d.ts.map +1 -1
- package/esm/src/types/info/requests.d.ts +128 -63
- package/esm/src/types/info/requests.d.ts.map +1 -1
- package/esm/src/types/info/vaults.d.ts +41 -84
- package/esm/src/types/info/vaults.d.ts.map +1 -1
- package/esm/src/types/subscriptions/common.d.ts +3 -0
- package/esm/src/types/subscriptions/common.d.ts.map +1 -1
- package/esm/src/types/subscriptions/requests.d.ts +10 -0
- package/esm/src/types/subscriptions/requests.d.ts.map +1 -1
- package/esm/src/utils/key_sort.d.ts +2 -2
- package/esm/src/utils/key_sort.d.ts.map +1 -1
- package/esm/src/utils/signing.d.ts +1 -1
- package/esm/src/utils/signing.js +2 -2
- package/package.json +1 -1
- package/script/deps/jsr.io/@derzade/typescript-event-target/1.1.1/mod.js +13 -3
- package/script/deps/jsr.io/@derzade/typescript-event-target/1.1.1/src/TypedEventTarget.js +23 -13
- package/script/deps/jsr.io/@noble/hashes/1.7.1/src/_assert.js +55 -45
- package/script/deps/jsr.io/@noble/hashes/1.7.1/src/_u64.js +97 -87
- package/script/deps/jsr.io/@noble/hashes/1.7.1/src/crypto.js +14 -4
- package/script/deps/jsr.io/@noble/hashes/1.7.1/src/sha3.js +288 -278
- package/script/deps/jsr.io/@noble/hashes/1.7.1/src/utils.js +238 -228
- package/script/deps/jsr.io/@std/bytes/1.0.5/_types.d.ts +9 -0
- package/script/deps/jsr.io/@std/bytes/1.0.5/_types.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/bytes/1.0.5/_types.js +13 -0
- package/script/deps/jsr.io/@std/bytes/{1.0.4 → 1.0.5}/concat.d.ts +3 -1
- package/script/deps/jsr.io/@std/bytes/1.0.5/concat.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/bytes/1.0.5/concat.js +45 -0
- package/script/deps/jsr.io/@std/encoding/1.0.7/_types.d.ts +9 -0
- package/script/deps/jsr.io/@std/encoding/1.0.7/_types.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/encoding/1.0.7/_types.js +13 -0
- package/script/deps/jsr.io/@std/encoding/{1.0.6 → 1.0.7}/_validate_binary_like.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/encoding/1.0.7/_validate_binary_like.js +39 -0
- package/{esm/deps/jsr.io/@std/encoding/1.0.6 → script/deps/jsr.io/@std/encoding/1.0.7}/hex.d.ts +3 -1
- package/script/deps/jsr.io/@std/encoding/1.0.7/hex.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/encoding/1.0.7/hex.js +123 -0
- package/script/deps/jsr.io/@std/msgpack/1.0.3/_types.d.ts +9 -0
- package/script/deps/jsr.io/@std/msgpack/1.0.3/_types.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/msgpack/1.0.3/_types.js +13 -0
- package/script/deps/jsr.io/@std/msgpack/{1.0.2 → 1.0.3}/encode.d.ts +3 -1
- package/script/deps/jsr.io/@std/msgpack/1.0.3/encode.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/msgpack/1.0.3/encode.js +250 -0
- package/script/mod.d.ts +1 -0
- package/script/mod.d.ts.map +1 -1
- package/script/mod.js +23 -13
- package/script/src/clients/event.d.ts +57 -16
- package/script/src/clients/event.d.ts.map +1 -1
- package/script/src/clients/event.js +551 -485
- package/script/src/clients/public.d.ts +241 -49
- package/script/src/clients/public.d.ts.map +1 -1
- package/script/src/clients/public.js +914 -708
- package/script/src/clients/wallet.d.ts +120 -51
- package/script/src/clients/wallet.d.ts.map +1 -1
- package/script/src/clients/wallet.js +1121 -977
- package/script/src/transports/base.js +25 -15
- package/script/src/transports/http/http_transport.js +174 -164
- package/script/src/transports/websocket/hyperliquid_event_target.d.ts +27 -21
- package/script/src/transports/websocket/hyperliquid_event_target.d.ts.map +1 -1
- package/script/src/transports/websocket/hyperliquid_event_target.js +80 -33
- package/script/src/transports/websocket/reconnecting_websocket.js +364 -354
- package/script/src/transports/websocket/websocket_request_dispatcher.js +196 -186
- package/script/src/transports/websocket/websocket_transport.d.ts +7 -10
- package/script/src/transports/websocket/websocket_transport.d.ts.map +1 -1
- package/script/src/transports/websocket/websocket_transport.js +236 -220
- package/script/src/types/common.js +12 -2
- package/script/src/types/exchange/common.d.ts +6 -6
- package/script/src/types/exchange/common.d.ts.map +1 -1
- package/script/src/types/exchange/common.js +12 -2
- package/script/src/types/exchange/requests.d.ts +131 -64
- package/script/src/types/exchange/requests.d.ts.map +1 -1
- package/script/src/types/exchange/requests.js +12 -2
- package/script/src/types/exchange/responses.d.ts +7 -7
- package/script/src/types/exchange/responses.d.ts.map +1 -1
- package/script/src/types/exchange/responses.js +12 -2
- package/script/src/types/explorer/common.d.ts +15 -15
- package/script/src/types/explorer/common.d.ts.map +1 -1
- package/script/src/types/explorer/common.js +12 -2
- package/script/src/types/explorer/requests.d.ts +19 -6
- package/script/src/types/explorer/requests.d.ts.map +1 -1
- package/script/src/types/explorer/requests.js +12 -2
- package/script/src/types/explorer/responses.d.ts +9 -2
- package/script/src/types/explorer/responses.d.ts.map +1 -1
- package/script/src/types/explorer/responses.js +12 -2
- package/script/src/types/info/accounts.d.ts +189 -124
- package/script/src/types/info/accounts.d.ts.map +1 -1
- package/script/src/types/info/accounts.js +12 -2
- package/script/src/types/info/assets.d.ts +82 -78
- package/script/src/types/info/assets.d.ts.map +1 -1
- package/script/src/types/info/assets.js +12 -2
- package/script/src/types/info/delegations.d.ts +117 -0
- package/script/src/types/info/delegations.d.ts.map +1 -0
- package/script/src/types/info/delegations.js +12 -0
- package/script/src/types/info/orders.d.ts +67 -67
- package/script/src/types/info/orders.d.ts.map +1 -1
- package/script/src/types/info/orders.js +12 -2
- package/script/src/types/info/requests.d.ts +128 -63
- package/script/src/types/info/requests.d.ts.map +1 -1
- package/script/src/types/info/requests.js +12 -2
- package/script/src/types/info/vaults.d.ts +41 -84
- package/script/src/types/info/vaults.d.ts.map +1 -1
- package/script/src/types/info/vaults.js +12 -2
- package/script/src/types/subscriptions/common.d.ts +3 -0
- package/script/src/types/subscriptions/common.d.ts.map +1 -1
- package/script/src/types/subscriptions/common.js +12 -2
- package/script/src/types/subscriptions/requests.d.ts +10 -0
- package/script/src/types/subscriptions/requests.d.ts.map +1 -1
- package/script/src/types/subscriptions/requests.js +12 -2
- package/script/src/utils/key_sort.d.ts +2 -2
- package/script/src/utils/key_sort.d.ts.map +1 -1
- package/script/src/utils/key_sort.js +133 -123
- package/script/src/utils/signing.d.ts +1 -1
- package/script/src/utils/signing.js +172 -162
- package/esm/deps/jsr.io/@std/bytes/1.0.4/concat.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/encoding/1.0.6/hex.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/msgpack/1.0.2/encode.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/bytes/1.0.4/concat.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/bytes/1.0.4/concat.js +0 -35
- package/script/deps/jsr.io/@std/encoding/1.0.6/_validate_binary_like.js +0 -29
- package/script/deps/jsr.io/@std/encoding/1.0.6/hex.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/encoding/1.0.6/hex.js +0 -113
- package/script/deps/jsr.io/@std/msgpack/1.0.2/encode.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/msgpack/1.0.2/encode.js +0 -240
- /package/esm/deps/jsr.io/@std/encoding/{1.0.6 → 1.0.7}/_validate_binary_like.d.ts +0 -0
- /package/script/deps/jsr.io/@std/encoding/{1.0.6 → 1.0.7}/_validate_binary_like.d.ts +0 -0
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2024-2025 nktkas
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024-2025 nktkas
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
21
|
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
[](https://jsr.io/@nktkas/hyperliquid)
|
|
4
4
|
[](https://jsr.io/@nktkas/hyperliquid)
|
|
5
|
+
[](https://bundlephobia.com/package/@nktkas/hyperliquid)
|
|
5
6
|
|
|
6
7
|
Unofficial [Hyperliquid API](https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api) SDK for all major JS
|
|
7
8
|
runtimes, written in TypeScript and provided with tests.
|
|
@@ -22,16 +23,16 @@ runtimes, written in TypeScript and provided with tests.
|
|
|
22
23
|
|
|
23
24
|
```bash
|
|
24
25
|
# npm
|
|
25
|
-
|
|
26
|
+
npm i @nktkas/hyperliquid
|
|
26
27
|
|
|
27
28
|
# yarn
|
|
28
|
-
yarn
|
|
29
|
+
yarn add @nktkas/hyperliquid
|
|
29
30
|
|
|
30
31
|
# pnpm
|
|
31
|
-
pnpm
|
|
32
|
+
pnpm add @nktkas/hyperliquid
|
|
32
33
|
|
|
33
34
|
# bun
|
|
34
|
-
|
|
35
|
+
bun i @nktkas/hyperliquid
|
|
35
36
|
|
|
36
37
|
# deno
|
|
37
38
|
deno add jsr:@nktkas/hyperliquid
|
|
@@ -80,7 +81,6 @@ const client = new hl.PublicClient({ transport });
|
|
|
80
81
|
```typescript
|
|
81
82
|
import * as hl from "@nktkas/hyperliquid";
|
|
82
83
|
import { createWalletClient, custom } from "viem";
|
|
83
|
-
import { arbitrum } from "viem/chains";
|
|
84
84
|
import { privateKeyToAccount } from "viem/accounts";
|
|
85
85
|
import { ethers } from "ethers";
|
|
86
86
|
|
|
@@ -96,11 +96,7 @@ const ethersClient = new hl.WalletClient({ wallet: ethersWallet, transport });
|
|
|
96
96
|
|
|
97
97
|
// 3. Using external wallet (e.g. MetaMask) via Viem
|
|
98
98
|
const [account] = await window.ethereum.request({ method: "eth_requestAccounts" });
|
|
99
|
-
const externalWallet = createWalletClient({
|
|
100
|
-
account,
|
|
101
|
-
chain: arbitrum,
|
|
102
|
-
transport: custom(window.ethereum),
|
|
103
|
-
});
|
|
99
|
+
const externalWallet = createWalletClient({ account, transport: custom(window.ethereum) });
|
|
104
100
|
const metamaskClient = new hl.WalletClient({ wallet: externalWallet, transport });
|
|
105
101
|
```
|
|
106
102
|
|
|
@@ -144,6 +140,7 @@ class PublicClient<T extends IRESTTransport> {
|
|
|
144
140
|
l2Book(args: L2BookParameters): Promise<L2Book>;
|
|
145
141
|
meta(): Promise<Meta>;
|
|
146
142
|
metaAndAssetCtxs(): Promise<MetaAndAssetCtxs>;
|
|
143
|
+
perpsAtOpenInterestCap(): Promise<string[]>;
|
|
147
144
|
predictedFundings(): Promise<PredictedFunding[]>;
|
|
148
145
|
spotDeployState(args: SpotDeployStateParameters): Promise<SpotDeployState>;
|
|
149
146
|
spotMeta(): Promise<SpotMeta>;
|
|
@@ -154,6 +151,7 @@ class PublicClient<T extends IRESTTransport> {
|
|
|
154
151
|
clearinghouseState(args: ClearinghouseStateParameters): Promise<ClearinghouseState>;
|
|
155
152
|
extraAgents(args: ExtraAgentsParameters): Promise<ExtraAgent[]>;
|
|
156
153
|
maxBuilderFee(args: MaxBuilderFeeParameters): Promise<number>;
|
|
154
|
+
portfolio(args: PortfolioParameters): Promise<PortfolioPeriods>;
|
|
157
155
|
referral(args: ReferralParameters): Promise<Referral>;
|
|
158
156
|
spotClearinghouseState(args: SpotClearinghouseStateParameters): Promise<SpotClearinghouseState>;
|
|
159
157
|
subAccounts(args: SubAccountsParameters): Promise<SubAccount[]>;
|
|
@@ -161,6 +159,7 @@ class PublicClient<T extends IRESTTransport> {
|
|
|
161
159
|
userFunding(args: UserFundingParameters): Promise<UserFunding[]>;
|
|
162
160
|
userNonFundingLedgerUpdates(args: UserNonFundingLedgerUpdatesParameters): Promise<UserNonFundingLedgerUpdates[]>;
|
|
163
161
|
userRateLimit(args: UserRateLimitParameters): Promise<UserRateLimit>;
|
|
162
|
+
userRole(args: UserRoleParameters): Promise<UserRole>;
|
|
164
163
|
|
|
165
164
|
// Order
|
|
166
165
|
frontendOpenOrders(args: FrontendOpenOrdersParameters): Promise<FrontendOpenOrder[]>;
|
|
@@ -172,14 +171,22 @@ class PublicClient<T extends IRESTTransport> {
|
|
|
172
171
|
userFillsByTime(args: UserFillsByTimeParameters): Promise<UserFill[]>;
|
|
173
172
|
userTwapSliceFills(args: UserTwapSliceFillsParameters): Promise<UserTwapSliceFill[]>;
|
|
174
173
|
|
|
174
|
+
// Staking
|
|
175
|
+
delegations(args: DelegationsParameters): Promise<Delegation[]>;
|
|
176
|
+
delegatorHistory(args: DelegatorHistoryParameters): Promise<DelegatorUpdate[]>;
|
|
177
|
+
delegatorRewards(args: DelegatorRewardsParameters): Promise<DelegatorReward[]>;
|
|
178
|
+
delegatorSummary(args: DelegatorSummaryParameters): Promise<DelegatorSummary>;
|
|
179
|
+
validatorSummaries(): Promise<ValidatorSummary[]>;
|
|
180
|
+
|
|
175
181
|
// Vault
|
|
176
182
|
userVaultEquities(args: UserVaultEquitiesParameters): Promise<UserVaultEquity[]>;
|
|
177
183
|
vaultDetails(args: VaultDetailsParameters): Promise<VaultDetails | null>;
|
|
178
184
|
vaultSummaries(): Promise<VaultSummary[]>;
|
|
179
185
|
|
|
180
|
-
//
|
|
186
|
+
// Explorer
|
|
181
187
|
blockDetails(args: BlockDetailsParameters): Promise<BlockDetailsResponse>;
|
|
182
188
|
txDetails(args: TxDetailsParameters): Promise<TxDetailsResponse>;
|
|
189
|
+
userDetails(args: UserDetailsParameters): Promise<UserDetailsResponse>;
|
|
183
190
|
}
|
|
184
191
|
```
|
|
185
192
|
|
|
@@ -210,7 +217,7 @@ class WalletClient<
|
|
|
210
217
|
> {
|
|
211
218
|
constructor(args: WalletClientParameters<T, W>);
|
|
212
219
|
|
|
213
|
-
// Order
|
|
220
|
+
// Order
|
|
214
221
|
batchModify(args: BatchModifyParameters): Promise<OrderResponseSuccess>;
|
|
215
222
|
cancel(args: CancelParameters): Promise<CancelResponseSuccess>;
|
|
216
223
|
cancelByCloid(args: CancelByCloidParameters): Promise<CancelResponseSuccess>;
|
|
@@ -222,7 +229,7 @@ class WalletClient<
|
|
|
222
229
|
updateIsolatedMargin(args: UpdateIsolatedMarginParameters): Promise<SuccessResponse>;
|
|
223
230
|
updateLeverage(args: UpdateLeverageParameters): Promise<SuccessResponse>;
|
|
224
231
|
|
|
225
|
-
// Account
|
|
232
|
+
// Account
|
|
226
233
|
approveAgent(args: ApproveAgentParameters): Promise<SuccessResponse>;
|
|
227
234
|
approveBuilderFee(args: ApproveBuilderFeeParameters): Promise<SuccessResponse>;
|
|
228
235
|
createSubAccount(args: CreateSubAccountParameters): Promise<CreateSubAccountResponse>;
|
|
@@ -235,6 +242,11 @@ class WalletClient<
|
|
|
235
242
|
usdSend(args: UsdSendParameters): Promise<SuccessResponse>;
|
|
236
243
|
vaultTransfer(args: VaultTransferParameters): Promise<SuccessResponse>;
|
|
237
244
|
withdraw3(args: Withdraw3Parameters): Promise<SuccessResponse>;
|
|
245
|
+
|
|
246
|
+
// Staking
|
|
247
|
+
cDeposit(args: CDepositParameters): Promise<SuccessResponse>;
|
|
248
|
+
cWithdraw(args: CWithdrawParameters): Promise<SuccessResponse>;
|
|
249
|
+
tokenDelegate(args: TokenDelegateParameters): Promise<SuccessResponse>;
|
|
238
250
|
}
|
|
239
251
|
```
|
|
240
252
|
|
|
@@ -255,7 +267,7 @@ interface EventClientParameters<T extends ISubscriptionTransport> {
|
|
|
255
267
|
class EventClient<T extends ISubscriptionTransport> {
|
|
256
268
|
constructor(args: EventClientParameters<T>);
|
|
257
269
|
|
|
258
|
-
// Market
|
|
270
|
+
// Market
|
|
259
271
|
activeAssetCtx(args: EventActiveAssetCtxParameters, listener: (data: WsActiveAssetCtx | WsActiveSpotAssetCtx) => void): Promise<Subscription>;
|
|
260
272
|
activeAssetData(args: EventActiveAssetDataParameters, listener: (data: WsActiveAssetData) => void): Promise<Subscription>;
|
|
261
273
|
allMids(listener: (data: WsAllMids) => void): Promise<Subscription>;
|
|
@@ -263,18 +275,22 @@ class EventClient<T extends ISubscriptionTransport> {
|
|
|
263
275
|
l2Book(args: EventL2BookParameters, listener: (data: Book) => void): Promise<Subscription>;
|
|
264
276
|
trades(args: EventTradesParameters, listener: (data: WsTrade[]) => void): Promise<Subscription>;
|
|
265
277
|
|
|
266
|
-
// Account
|
|
278
|
+
// Account
|
|
267
279
|
notification(args: EventNotificationParameters, listener: (data: WsNotification) => void): Promise<Subscription>;
|
|
268
280
|
userEvents(args: EventUserEventsParameters, listener: (data: WsUserEvent) => void): Promise<Subscription>;
|
|
269
281
|
userFundings(args: EventUserFundingsParameters, listener: (data: WsUserFundings) => void): Promise<Subscription>;
|
|
270
282
|
userNonFundingLedgerUpdates(args: EventUserNonFundingLedgerUpdatesParameters, listener: (data: WsUserNonFundingLedgerUpdates) => void): Promise<Subscription>;
|
|
271
283
|
webData2(args: EventWebData2Parameters, listener: (data: WsWebData2) => void): Promise<Subscription>;
|
|
272
284
|
|
|
273
|
-
// Order
|
|
274
|
-
orderUpdates(args: EventOrderUpdatesParameters, listener: (data: OrderStatus) => void): Promise<Subscription>;
|
|
285
|
+
// Order
|
|
286
|
+
orderUpdates(args: EventOrderUpdatesParameters, listener: (data: OrderStatus<Order>[]) => void): Promise<Subscription>;
|
|
275
287
|
userFills(args: EventUserFillsParameters, listener: (data: WsUserFills) => void): Promise<Subscription>;
|
|
276
288
|
userTwapHistory(args: EventUserTwapHistory, listener: (data: WsUserTwapHistory) => void): Promise<Subscription>;
|
|
277
289
|
userTwapSliceFills(args: EventUserTwapSliceFills, listener: (data: WsUserTwapSliceFills) => void): Promise<Subscription>;
|
|
290
|
+
|
|
291
|
+
// Explorer
|
|
292
|
+
explorerBlock(listener: (data: WsBlockDetails[]) => void): Promise<Subscription>;
|
|
293
|
+
explorerTx(listener: (data: TxDetails[]) => void): Promise<Subscription>;
|
|
278
294
|
}
|
|
279
295
|
```
|
|
280
296
|
<!-- deno-fmt-ignore-end -->
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Proxy type of {@code Uint8Array<ArrayBuffer} or {@code Uint8Array} in TypeScript 5.7 or below respectively.
|
|
3
|
+
*
|
|
4
|
+
* This type is internal utility type and should not be used directly.
|
|
5
|
+
*
|
|
6
|
+
* @internal @private
|
|
7
|
+
*/
|
|
8
|
+
export type Uint8Array_ = ReturnType<Uint8Array["slice"]>;
|
|
9
|
+
//# sourceMappingURL=_types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_types.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/bytes/1.0.5/_types.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AAEH,MAAM,MAAM,WAAW,GAAG,UAAU,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { Uint8Array_ } from "./_types.js";
|
|
2
|
+
export type { Uint8Array_ };
|
|
1
3
|
/**
|
|
2
4
|
* Concatenate an array of byte slices into a single slice.
|
|
3
5
|
*
|
|
@@ -15,5 +17,5 @@
|
|
|
15
17
|
* assertEquals(concat([a, b]), new Uint8Array([0, 1, 2, 3, 4, 5]));
|
|
16
18
|
* ```
|
|
17
19
|
*/
|
|
18
|
-
export declare function concat(buffers: Uint8Array[]):
|
|
20
|
+
export declare function concat(buffers: Uint8Array[]): Uint8Array_;
|
|
19
21
|
//# sourceMappingURL=concat.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"concat.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/bytes/1.0.5/concat.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC/C,YAAY,EAAE,WAAW,EAAE,CAAC;AAE5B;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,MAAM,CAAC,OAAO,EAAE,UAAU,EAAE,GAAG,WAAW,CAazD"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Proxy type of {@code Uint8Array<ArrayBuffer} or {@code Uint8Array} in TypeScript 5.7 or below respectively.
|
|
3
|
+
*
|
|
4
|
+
* This type is internal utility type and should not be used directly.
|
|
5
|
+
*
|
|
6
|
+
* @internal @private
|
|
7
|
+
*/
|
|
8
|
+
export type Uint8Array_ = ReturnType<Uint8Array["slice"]>;
|
|
9
|
+
//# sourceMappingURL=_types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_types.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/encoding/1.0.7/_types.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AAEH,MAAM,MAAM,WAAW,GAAG,UAAU,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_validate_binary_like.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/encoding/1.0.
|
|
1
|
+
{"version":3,"file":"_validate_binary_like.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/encoding/1.0.7/_validate_binary_like.ts"],"names":[],"mappings":"AAeA,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,OAAO,GAAG,UAAU,CAa9D"}
|
package/{script/deps/jsr.io/@std/encoding/1.0.6 → esm/deps/jsr.io/@std/encoding/1.0.7}/hex.d.ts
RENAMED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { Uint8Array_ } from "./_types.js";
|
|
2
|
+
export type { Uint8Array_ };
|
|
1
3
|
/**
|
|
2
4
|
* Converts data into a hex-encoded string.
|
|
3
5
|
*
|
|
@@ -33,5 +35,5 @@ export declare function encodeHex(src: string | Uint8Array | ArrayBuffer): strin
|
|
|
33
35
|
* );
|
|
34
36
|
* ```
|
|
35
37
|
*/
|
|
36
|
-
export declare function decodeHex(src: string):
|
|
38
|
+
export declare function decodeHex(src: string): Uint8Array_;
|
|
37
39
|
//# sourceMappingURL=hex.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hex.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/encoding/1.0.7/hex.ts"],"names":[],"mappings":"AA6BA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC/C,YAAY,EAAE,WAAW,EAAE,CAAC;AA4B5B;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,GAAG,WAAW,GAAG,MAAM,CAUxE;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,WAAW,CAiBlD"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Copyright 2009 The Go Authors. All rights reserved.
|
|
2
2
|
// https://github.com/golang/go/blob/master/LICENSE
|
|
3
|
-
// Copyright 2018-
|
|
3
|
+
// Copyright 2018-2025 the Deno authors. MIT license.
|
|
4
4
|
// This module is browser compatible.
|
|
5
5
|
/**
|
|
6
6
|
* Port of the Go
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Proxy type of {@code Uint8Array<ArrayBuffer} or {@code Uint8Array} in TypeScript 5.7 or below respectively.
|
|
3
|
+
*
|
|
4
|
+
* This type is internal utility type and should not be used directly.
|
|
5
|
+
*
|
|
6
|
+
* @internal @private
|
|
7
|
+
*/
|
|
8
|
+
export type Uint8Array_ = ReturnType<Uint8Array["slice"]>;
|
|
9
|
+
//# sourceMappingURL=_types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_types.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/msgpack/1.0.3/_types.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AAEH,MAAM,MAAM,WAAW,GAAG,UAAU,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { Uint8Array_ } from "./_types.js";
|
|
2
|
+
export type { Uint8Array_ };
|
|
1
3
|
/**
|
|
2
4
|
* Value types that can be encoded to MessagePack.
|
|
3
5
|
*/
|
|
@@ -33,5 +35,5 @@ export interface ValueMap {
|
|
|
33
35
|
* @param object Value to encode to MessagePack binary format.
|
|
34
36
|
* @returns Encoded MessagePack binary data.
|
|
35
37
|
*/
|
|
36
|
-
export declare function encode(object: ValueType):
|
|
38
|
+
export declare function encode(object: ValueType): Uint8Array_;
|
|
37
39
|
//# sourceMappingURL=encode.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"encode.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/msgpack/1.0.3/encode.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC/C,YAAY,EAAE,WAAW,EAAE,CAAC;AAE5B;;GAEG;AACH,MAAM,MAAM,SAAS,GACjB,MAAM,GACN,MAAM,GACN,MAAM,GACN,OAAO,GACP,IAAI,GACJ,UAAU,GACV,SAAS,SAAS,EAAE,GACpB,QAAQ,CAAC;AAEb;;GAEG;AACH,MAAM,WAAW,QAAQ;IACvB,sBAAsB;IACtB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;CACrC;AAeD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,MAAM,CAAC,MAAM,EAAE,SAAS,GAAG,WAAW,CAIrD"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
// Copyright 2018-
|
|
1
|
+
// Copyright 2018-2025 the Deno authors. MIT license.
|
|
2
2
|
// This module is browser compatible.
|
|
3
|
-
import { concat } from "../../bytes/1.0.
|
|
3
|
+
import { concat } from "../../bytes/1.0.5/concat.js";
|
|
4
4
|
const FOUR_BITS = 16;
|
|
5
5
|
const FIVE_BITS = 32;
|
|
6
6
|
const SEVEN_BITS = 128;
|
package/esm/mod.d.ts
CHANGED
|
@@ -15,6 +15,7 @@ export type * from "./src/types/explorer/requests.js";
|
|
|
15
15
|
export type * from "./src/types/explorer/responses.js";
|
|
16
16
|
export type * from "./src/types/info/accounts.js";
|
|
17
17
|
export type * from "./src/types/info/assets.js";
|
|
18
|
+
export type * from "./src/types/info/delegations.js";
|
|
18
19
|
export type * from "./src/types/info/orders.js";
|
|
19
20
|
export type * from "./src/types/info/requests.js";
|
|
20
21
|
export type * from "./src/types/info/vaults.js";
|
package/esm/mod.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../src/mod.ts"],"names":[],"mappings":"AACA,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AAGxC,cAAc,0BAA0B,CAAC;AAEzC,cAAc,yCAAyC,CAAC;AAExD,cAAc,mDAAmD,CAAC;AAClE,YAAY,EACR,qBAAqB,EACrB,4BAA4B,GAC/B,MAAM,sDAAsD,CAAC;AAC9D,OAAO,EAAE,qBAAqB,EAAE,MAAM,4DAA4D,CAAC;AAGnG,mBAAmB,uBAAuB,CAAC;AAE3C,mBAAmB,gCAAgC,CAAC;AACpD,mBAAmB,kCAAkC,CAAC;AACtD,mBAAmB,mCAAmC,CAAC;AAEvD,mBAAmB,gCAAgC,CAAC;AACpD,mBAAmB,kCAAkC,CAAC;AACtD,mBAAmB,mCAAmC,CAAC;AAEvD,mBAAmB,8BAA8B,CAAC;AAClD,mBAAmB,4BAA4B,CAAC;AAChD,mBAAmB,4BAA4B,CAAC;AAChD,mBAAmB,8BAA8B,CAAC;AAClD,mBAAmB,4BAA4B,CAAC;AAEhD,mBAAmB,qCAAqC,CAAC;AACzD,mBAAmB,uCAAuC,CAAC;AAG3D,YAAY,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC"}
|
|
1
|
+
{"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../src/mod.ts"],"names":[],"mappings":"AACA,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AAGxC,cAAc,0BAA0B,CAAC;AAEzC,cAAc,yCAAyC,CAAC;AAExD,cAAc,mDAAmD,CAAC;AAClE,YAAY,EACR,qBAAqB,EACrB,4BAA4B,GAC/B,MAAM,sDAAsD,CAAC;AAC9D,OAAO,EAAE,qBAAqB,EAAE,MAAM,4DAA4D,CAAC;AAGnG,mBAAmB,uBAAuB,CAAC;AAE3C,mBAAmB,gCAAgC,CAAC;AACpD,mBAAmB,kCAAkC,CAAC;AACtD,mBAAmB,mCAAmC,CAAC;AAEvD,mBAAmB,gCAAgC,CAAC;AACpD,mBAAmB,kCAAkC,CAAC;AACtD,mBAAmB,mCAAmC,CAAC;AAEvD,mBAAmB,8BAA8B,CAAC;AAClD,mBAAmB,4BAA4B,CAAC;AAChD,mBAAmB,iCAAiC,CAAC;AACrD,mBAAmB,4BAA4B,CAAC;AAChD,mBAAmB,8BAA8B,CAAC;AAClD,mBAAmB,4BAA4B,CAAC;AAEhD,mBAAmB,qCAAqC,CAAC;AACzD,mBAAmB,uCAAuC,CAAC;AAG3D,YAAY,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import type { ISubscriptionTransport, Subscription } from "../transports/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, WsNotification, WsTrade, WsUserEvent, WsUserFills, WsUserFundings, WsUserNonFundingLedgerUpdates, WsUserTwapHistory, WsUserTwapSliceFills, WsWebData2 } from "../types/subscriptions/common.js";
|
|
3
|
+
import type { WsActiveAssetCtx, WsActiveAssetData, WsActiveSpotAssetCtx, WsAllMids, WsBlockDetails, WsNotification, WsTrade, WsUserEvent, WsUserFills, WsUserFundings, WsUserNonFundingLedgerUpdates, WsUserTwapHistory, WsUserTwapSliceFills, WsWebData2 } from "../types/subscriptions/common.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/common.js";
|
|
6
7
|
/** Parameters for the {@linkcode EventClient} constructor. */
|
|
7
8
|
export interface EventClientParameters<T extends ISubscriptionTransport = ISubscriptionTransport> {
|
|
8
9
|
/** The transport used to connect to the Hyperliquid API. */
|
|
@@ -63,7 +64,7 @@ export declare class EventClient<T extends ISubscriptionTransport = ISubscriptio
|
|
|
63
64
|
* @param signal - An optional abort signal for canceling the subscription request.
|
|
64
65
|
* @returns A promise that resolves with a {@link Subscription} object to manage the subscription lifecycle.
|
|
65
66
|
*
|
|
66
|
-
* @see
|
|
67
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/websocket/subscriptions
|
|
67
68
|
* @example
|
|
68
69
|
* ```ts
|
|
69
70
|
* import * as hl from "@nktkas/hyperliquid";
|
|
@@ -84,7 +85,7 @@ export declare class EventClient<T extends ISubscriptionTransport = ISubscriptio
|
|
|
84
85
|
* @param signal - An optional abort signal for canceling the subscription request.
|
|
85
86
|
* @returns A promise that resolves with a {@link Subscription} object to manage the subscription lifecycle.
|
|
86
87
|
*
|
|
87
|
-
* @see
|
|
88
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/websocket/subscriptions
|
|
88
89
|
* @example
|
|
89
90
|
* ```ts
|
|
90
91
|
* import * as hl from "@nktkas/hyperliquid";
|
|
@@ -104,7 +105,7 @@ export declare class EventClient<T extends ISubscriptionTransport = ISubscriptio
|
|
|
104
105
|
* @param signal - An optional abort signal for canceling the subscription request.
|
|
105
106
|
* @returns A promise that resolves with a {@link Subscription} object to manage the subscription lifecycle.
|
|
106
107
|
*
|
|
107
|
-
* @see
|
|
108
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/websocket/subscriptions
|
|
108
109
|
* @example
|
|
109
110
|
* ```ts
|
|
110
111
|
* import * as hl from "@nktkas/hyperliquid";
|
|
@@ -125,7 +126,7 @@ export declare class EventClient<T extends ISubscriptionTransport = ISubscriptio
|
|
|
125
126
|
* @param signal - An optional abort signal for canceling the subscription request.
|
|
126
127
|
* @returns A promise that resolves with a {@link Subscription} object to manage the subscription lifecycle.
|
|
127
128
|
*
|
|
128
|
-
* @see
|
|
129
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/websocket/subscriptions
|
|
129
130
|
* @example
|
|
130
131
|
* ```ts
|
|
131
132
|
* import * as hl from "@nktkas/hyperliquid";
|
|
@@ -139,6 +140,46 @@ export declare class EventClient<T extends ISubscriptionTransport = ISubscriptio
|
|
|
139
140
|
* ```
|
|
140
141
|
*/
|
|
141
142
|
candle(args: EventCandleParameters, listener: (data: Candle) => void, signal?: AbortSignal): Promise<Subscription>;
|
|
143
|
+
/**
|
|
144
|
+
* Subscribe to explorer block updates.
|
|
145
|
+
* @param listener - The callback function to be called when the event is received.
|
|
146
|
+
* @param signal - An optional abort signal for canceling the subscription request.
|
|
147
|
+
* @returns A promise that resolves with a {@link Subscription} object to manage the subscription lifecycle.
|
|
148
|
+
*
|
|
149
|
+
* @see null - no documentation
|
|
150
|
+
* @example
|
|
151
|
+
* ```ts
|
|
152
|
+
* import * as hl from "@nktkas/hyperliquid";
|
|
153
|
+
*
|
|
154
|
+
* const transport = new hl.WebSocketTransport();
|
|
155
|
+
* const client = new hl.EventClient({ transport });
|
|
156
|
+
*
|
|
157
|
+
* const sub = await client.explorerBlock((data) => {
|
|
158
|
+
* console.log(data);
|
|
159
|
+
* });
|
|
160
|
+
* ```
|
|
161
|
+
*/
|
|
162
|
+
explorerBlock(listener: (data: WsBlockDetails[]) => void, signal?: AbortSignal): Promise<Subscription>;
|
|
163
|
+
/**
|
|
164
|
+
* Subscribe to explorer transaction updates.
|
|
165
|
+
* @param listener - The callback function to be called when the event is received.
|
|
166
|
+
* @param signal - An optional abort signal for canceling the subscription request.
|
|
167
|
+
* @returns A promise that resolves with a {@link Subscription} object to manage the subscription lifecycle.
|
|
168
|
+
*
|
|
169
|
+
* @see null - no documentation
|
|
170
|
+
* @example
|
|
171
|
+
* ```ts
|
|
172
|
+
* import * as hl from "@nktkas/hyperliquid";
|
|
173
|
+
*
|
|
174
|
+
* const transport = new hl.WebSocketTransport();
|
|
175
|
+
* const client = new hl.EventClient({ transport });
|
|
176
|
+
*
|
|
177
|
+
* const sub = await client.explorerTxs((data) => {
|
|
178
|
+
* console.log(data);
|
|
179
|
+
* });
|
|
180
|
+
* ```
|
|
181
|
+
*/
|
|
182
|
+
explorerTxs(listener: (data: TxDetails[]) => void, signal?: AbortSignal): Promise<Subscription>;
|
|
142
183
|
/**
|
|
143
184
|
* Subscribe to L2 order book updates for a specific asset.
|
|
144
185
|
* @param args - The parameters for the subscription.
|
|
@@ -146,7 +187,7 @@ export declare class EventClient<T extends ISubscriptionTransport = ISubscriptio
|
|
|
146
187
|
* @param signal - An optional abort signal for canceling the subscription request.
|
|
147
188
|
* @returns A promise that resolves with a {@link Subscription} object to manage the subscription lifecycle.
|
|
148
189
|
*
|
|
149
|
-
* @see
|
|
190
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/websocket/subscriptions
|
|
150
191
|
* @example
|
|
151
192
|
* ```ts
|
|
152
193
|
* import * as hl from "@nktkas/hyperliquid";
|
|
@@ -167,7 +208,7 @@ export declare class EventClient<T extends ISubscriptionTransport = ISubscriptio
|
|
|
167
208
|
* @param signal - An optional abort signal for canceling the subscription request.
|
|
168
209
|
* @returns A promise that resolves with a {@link Subscription} object to manage the subscription lifecycle.
|
|
169
210
|
*
|
|
170
|
-
* @see
|
|
211
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/websocket/subscriptions
|
|
171
212
|
* @example
|
|
172
213
|
* ```ts
|
|
173
214
|
* import * as hl from "@nktkas/hyperliquid";
|
|
@@ -188,7 +229,7 @@ export declare class EventClient<T extends ISubscriptionTransport = ISubscriptio
|
|
|
188
229
|
* @param signal - An optional abort signal for canceling the subscription request.
|
|
189
230
|
* @returns A promise that resolves with a {@link Subscription} object to manage the subscription lifecycle.
|
|
190
231
|
*
|
|
191
|
-
* @see
|
|
232
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/websocket/subscriptions
|
|
192
233
|
* @example
|
|
193
234
|
* ```ts
|
|
194
235
|
* import * as hl from "@nktkas/hyperliquid";
|
|
@@ -209,7 +250,7 @@ export declare class EventClient<T extends ISubscriptionTransport = ISubscriptio
|
|
|
209
250
|
* @param signal - An optional abort signal for canceling the subscription request.
|
|
210
251
|
* @returns A promise that resolves with a {@link Subscription} object to manage the subscription lifecycle.
|
|
211
252
|
*
|
|
212
|
-
* @see
|
|
253
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/websocket/subscriptions
|
|
213
254
|
* @example
|
|
214
255
|
* ```ts
|
|
215
256
|
* import * as hl from "@nktkas/hyperliquid";
|
|
@@ -232,7 +273,7 @@ export declare class EventClient<T extends ISubscriptionTransport = ISubscriptio
|
|
|
232
273
|
*
|
|
233
274
|
* @note Different subscriptions cannot be distinguished from each other.
|
|
234
275
|
*
|
|
235
|
-
* @see
|
|
276
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/websocket/subscriptions
|
|
236
277
|
* @example
|
|
237
278
|
* ```ts
|
|
238
279
|
* import * as hl from "@nktkas/hyperliquid";
|
|
@@ -253,7 +294,7 @@ export declare class EventClient<T extends ISubscriptionTransport = ISubscriptio
|
|
|
253
294
|
* @param signal - An optional abort signal for canceling the subscription request.
|
|
254
295
|
* @returns A promise that resolves with a {@link Subscription} object to manage the subscription lifecycle.
|
|
255
296
|
*
|
|
256
|
-
* @see
|
|
297
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/websocket/subscriptions
|
|
257
298
|
* @example
|
|
258
299
|
* ```ts
|
|
259
300
|
* import * as hl from "@nktkas/hyperliquid";
|
|
@@ -274,7 +315,7 @@ export declare class EventClient<T extends ISubscriptionTransport = ISubscriptio
|
|
|
274
315
|
* @param signal - An optional abort signal for canceling the subscription request.
|
|
275
316
|
* @returns A promise that resolves with a {@link Subscription} object to manage the subscription lifecycle.
|
|
276
317
|
*
|
|
277
|
-
* @see
|
|
318
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/websocket/subscriptions
|
|
278
319
|
* @example
|
|
279
320
|
* ```ts
|
|
280
321
|
* import * as hl from "@nktkas/hyperliquid";
|
|
@@ -295,7 +336,7 @@ export declare class EventClient<T extends ISubscriptionTransport = ISubscriptio
|
|
|
295
336
|
* @param signal - An optional abort signal for canceling the subscription request.
|
|
296
337
|
* @returns A promise that resolves with a {@link Subscription} object to manage the subscription lifecycle.
|
|
297
338
|
*
|
|
298
|
-
* @see
|
|
339
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/websocket/subscriptions
|
|
299
340
|
* @example
|
|
300
341
|
* ```ts
|
|
301
342
|
* import * as hl from "@nktkas/hyperliquid";
|
|
@@ -316,7 +357,7 @@ export declare class EventClient<T extends ISubscriptionTransport = ISubscriptio
|
|
|
316
357
|
* @param signal - An optional abort signal for canceling the subscription request.
|
|
317
358
|
* @returns A promise that resolves with a {@link Subscription} object to manage the subscription lifecycle.
|
|
318
359
|
*
|
|
319
|
-
* @see
|
|
360
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/websocket/subscriptions
|
|
320
361
|
* @example
|
|
321
362
|
* ```ts
|
|
322
363
|
* import * as hl from "@nktkas/hyperliquid";
|
|
@@ -337,7 +378,7 @@ export declare class EventClient<T extends ISubscriptionTransport = ISubscriptio
|
|
|
337
378
|
* @param signal - An optional abort signal for canceling the subscription request.
|
|
338
379
|
* @returns A promise that resolves with a {@link Subscription} object to manage the subscription lifecycle.
|
|
339
380
|
*
|
|
340
|
-
* @see
|
|
381
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/websocket/subscriptions
|
|
341
382
|
* @example
|
|
342
383
|
* ```ts
|
|
343
384
|
* import * as hl from "@nktkas/hyperliquid";
|
|
@@ -358,7 +399,7 @@ export declare class EventClient<T extends ISubscriptionTransport = ISubscriptio
|
|
|
358
399
|
* @param signal - An optional abort signal for canceling the subscription request.
|
|
359
400
|
* @returns A promise that resolves with a {@link Subscription} object to manage the subscription lifecycle.
|
|
360
401
|
*
|
|
361
|
-
* @see
|
|
402
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/websocket/subscriptions
|
|
362
403
|
* @example
|
|
363
404
|
* ```ts
|
|
364
405
|
* import * as hl from "@nktkas/hyperliquid";
|
|
@@ -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,uBAAuB,CAAC;AAClF,OAAO,KAAK,EACR,uBAAuB,EACvB,wBAAwB,EAExB,eAAe,
|
|
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,uBAAuB,CAAC;AAClF,OAAO,KAAK,EACR,uBAAuB,EACvB,wBAAwB,EAExB,eAAe,EAGf,eAAe,EACf,qBAAqB,EACrB,qBAAqB,EACrB,eAAe,EACf,mBAAmB,EACnB,kBAAkB,EAClB,qBAAqB,EACrB,oCAAoC,EACpC,wBAAwB,EACxB,2BAA2B,EAC3B,iBAAiB,EACpB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,KAAK,EACR,gBAAgB,EAChB,iBAAiB,EACjB,oBAAoB,EACpB,SAAS,EACT,cAAc,EACd,cAAc,EACd,OAAO,EACP,WAAW,EACX,WAAW,EACX,cAAc,EACd,6BAA6B,EAC7B,iBAAiB,EACjB,oBAAoB,EACpB,UAAU,EACb,MAAM,kCAAkC,CAAC;AAC1C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACxE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAI7D,8DAA8D;AAC9D,MAAM,WAAW,qBAAqB,CAAC,CAAC,SAAS,sBAAsB,GAAG,sBAAsB;IAC5F,4DAA4D;IAC5D,SAAS,EAAE,CAAC,CAAC;CAChB;AAED,wEAAwE;AACxE,MAAM,MAAM,6BAA6B,GAAG,IAAI,CAAC,uBAAuB,EAAE,MAAM,CAAC,CAAC;AAElF,yEAAyE;AACzE,MAAM,MAAM,8BAA8B,GAAG,IAAI,CAAC,wBAAwB,EAAE,MAAM,CAAC,CAAC;AAEpF,gEAAgE;AAChE,MAAM,MAAM,qBAAq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