@nktkas/hyperliquid 0.13.0 → 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 +42 -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 +15 -14
- package/esm/mod.d.ts.map +1 -1
- package/esm/src/clients/event.d.ts +64 -21
- package/esm/src/clients/event.d.ts.map +1 -1
- package/esm/src/clients/event.js +76 -18
- package/esm/src/clients/public.d.ts +244 -52
- 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 +122 -53
- package/esm/src/clients/wallet.d.ts.map +1 -1
- package/esm/src/clients/wallet.js +201 -65
- package/esm/src/transports/http/http_transport.d.ts.map +1 -1
- package/esm/src/transports/http/http_transport.js +4 -1
- 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.d.ts.map +1 -1
- package/esm/src/transports/websocket/websocket_request_dispatcher.js +4 -4
- 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/common.d.ts +3 -0
- package/esm/src/types/common.d.ts.map +1 -0
- package/esm/src/types/common.js +1 -0
- package/esm/src/types/exchange/common.d.ts +36 -0
- package/esm/src/types/exchange/common.d.ts.map +1 -0
- package/esm/src/types/exchange/common.js +1 -0
- package/esm/src/types/exchange/requests.d.ts +502 -0
- package/esm/src/types/exchange/requests.d.ts.map +1 -0
- package/esm/src/types/exchange/requests.js +1 -0
- package/esm/src/types/exchange/responses.d.ts +141 -0
- package/esm/src/types/exchange/responses.d.ts.map +1 -0
- package/esm/src/types/exchange/responses.js +1 -0
- package/esm/src/types/explorer/common.d.ts +37 -0
- package/esm/src/types/explorer/common.d.ts.map +1 -0
- package/esm/src/types/explorer/common.js +1 -0
- package/esm/src/types/explorer/requests.d.ts +35 -0
- package/esm/src/types/explorer/requests.d.ts.map +1 -0
- package/esm/src/types/explorer/requests.js +1 -0
- package/esm/src/types/explorer/responses.d.ts +23 -0
- package/esm/src/types/explorer/responses.d.ts.map +1 -0
- package/esm/src/types/explorer/responses.js +1 -0
- package/esm/src/types/info/accounts.d.ts +489 -0
- package/esm/src/types/info/accounts.d.ts.map +1 -0
- package/esm/src/types/info/accounts.js +1 -0
- package/esm/src/types/info/assets.d.ts +275 -0
- package/esm/src/types/info/assets.d.ts.map +1 -0
- package/esm/src/types/info/assets.js +1 -0
- 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 +209 -0
- package/esm/src/types/info/orders.d.ts.map +1 -0
- package/esm/src/types/info/orders.js +1 -0
- package/esm/src/types/info/requests.d.ts +445 -0
- package/esm/src/types/info/requests.d.ts.map +1 -0
- package/esm/src/types/info/requests.js +1 -0
- package/esm/src/types/info/vaults.d.ts +90 -0
- package/esm/src/types/info/vaults.d.ts.map +1 -0
- package/esm/src/types/info/vaults.js +1 -0
- package/esm/src/types/subscriptions/common.d.ts +208 -0
- package/esm/src/types/subscriptions/common.d.ts.map +1 -0
- package/esm/src/types/subscriptions/common.js +1 -0
- package/esm/src/types/subscriptions/requests.d.ts +134 -0
- package/esm/src/types/subscriptions/requests.d.ts.map +1 -0
- package/esm/src/types/subscriptions/requests.js +1 -0
- package/esm/src/utils/key_sort.d.ts +3 -3
- 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 +2 -2
- 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 +15 -14
- package/script/mod.d.ts.map +1 -1
- package/script/mod.js +23 -13
- package/script/src/clients/event.d.ts +64 -21
- package/script/src/clients/event.d.ts.map +1 -1
- package/script/src/clients/event.js +551 -483
- package/script/src/clients/public.d.ts +244 -52
- 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 +122 -53
- package/script/src/clients/wallet.d.ts.map +1 -1
- package/script/src/clients/wallet.js +1121 -975
- package/script/src/transports/base.js +25 -15
- package/script/src/transports/http/http_transport.d.ts.map +1 -1
- package/script/src/transports/http/http_transport.js +174 -161
- 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.d.ts.map +1 -1
- 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.d.ts +3 -0
- package/script/src/types/common.d.ts.map +1 -0
- package/script/src/types/common.js +12 -0
- package/script/src/types/exchange/common.d.ts +36 -0
- package/script/src/types/exchange/common.d.ts.map +1 -0
- package/script/src/types/exchange/common.js +12 -0
- package/script/src/types/exchange/requests.d.ts +502 -0
- package/script/src/types/exchange/requests.d.ts.map +1 -0
- package/script/src/types/exchange/requests.js +12 -0
- package/script/src/types/exchange/responses.d.ts +141 -0
- package/script/src/types/exchange/responses.d.ts.map +1 -0
- package/script/src/types/exchange/responses.js +12 -0
- package/script/src/types/explorer/common.d.ts +37 -0
- package/script/src/types/explorer/common.d.ts.map +1 -0
- package/script/src/types/explorer/common.js +12 -0
- package/script/src/types/explorer/requests.d.ts +35 -0
- package/script/src/types/explorer/requests.d.ts.map +1 -0
- package/script/src/types/explorer/requests.js +12 -0
- package/script/src/types/explorer/responses.d.ts +23 -0
- package/script/src/types/explorer/responses.d.ts.map +1 -0
- package/script/src/types/explorer/responses.js +12 -0
- package/script/src/types/info/accounts.d.ts +489 -0
- package/script/src/types/info/accounts.d.ts.map +1 -0
- package/script/src/types/info/accounts.js +12 -0
- package/script/src/types/info/assets.d.ts +275 -0
- package/script/src/types/info/assets.d.ts.map +1 -0
- package/script/src/types/info/assets.js +12 -0
- 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 +209 -0
- package/script/src/types/info/orders.d.ts.map +1 -0
- package/script/src/types/info/orders.js +12 -0
- package/script/src/types/info/requests.d.ts +445 -0
- package/script/src/types/info/requests.d.ts.map +1 -0
- package/script/src/types/info/requests.js +12 -0
- package/script/src/types/info/vaults.d.ts +90 -0
- package/script/src/types/info/vaults.d.ts.map +1 -0
- package/script/src/types/info/vaults.js +12 -0
- package/script/src/types/subscriptions/common.d.ts +208 -0
- package/script/src/types/subscriptions/common.d.ts.map +1 -0
- package/script/src/types/subscriptions/common.js +12 -0
- package/script/src/types/subscriptions/requests.d.ts +134 -0
- package/script/src/types/subscriptions/requests.d.ts.map +1 -0
- package/script/src/types/subscriptions/requests.js +12 -0
- package/script/src/utils/key_sort.d.ts +3 -3
- 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,14 +96,19 @@ 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
|
|
|
103
|
+
#### Create EventClient
|
|
104
|
+
|
|
105
|
+
```typescript
|
|
106
|
+
import * as hl from "@nktkas/hyperliquid";
|
|
107
|
+
|
|
108
|
+
const transport = new hl.WebSocketTransport();
|
|
109
|
+
const client = new hl.EventClient({ transport });
|
|
110
|
+
```
|
|
111
|
+
|
|
107
112
|
## API Reference
|
|
108
113
|
|
|
109
114
|
### Clients
|
|
@@ -135,6 +140,7 @@ class PublicClient<T extends IRESTTransport> {
|
|
|
135
140
|
l2Book(args: L2BookParameters): Promise<L2Book>;
|
|
136
141
|
meta(): Promise<Meta>;
|
|
137
142
|
metaAndAssetCtxs(): Promise<MetaAndAssetCtxs>;
|
|
143
|
+
perpsAtOpenInterestCap(): Promise<string[]>;
|
|
138
144
|
predictedFundings(): Promise<PredictedFunding[]>;
|
|
139
145
|
spotDeployState(args: SpotDeployStateParameters): Promise<SpotDeployState>;
|
|
140
146
|
spotMeta(): Promise<SpotMeta>;
|
|
@@ -145,6 +151,7 @@ class PublicClient<T extends IRESTTransport> {
|
|
|
145
151
|
clearinghouseState(args: ClearinghouseStateParameters): Promise<ClearinghouseState>;
|
|
146
152
|
extraAgents(args: ExtraAgentsParameters): Promise<ExtraAgent[]>;
|
|
147
153
|
maxBuilderFee(args: MaxBuilderFeeParameters): Promise<number>;
|
|
154
|
+
portfolio(args: PortfolioParameters): Promise<PortfolioPeriods>;
|
|
148
155
|
referral(args: ReferralParameters): Promise<Referral>;
|
|
149
156
|
spotClearinghouseState(args: SpotClearinghouseStateParameters): Promise<SpotClearinghouseState>;
|
|
150
157
|
subAccounts(args: SubAccountsParameters): Promise<SubAccount[]>;
|
|
@@ -152,6 +159,7 @@ class PublicClient<T extends IRESTTransport> {
|
|
|
152
159
|
userFunding(args: UserFundingParameters): Promise<UserFunding[]>;
|
|
153
160
|
userNonFundingLedgerUpdates(args: UserNonFundingLedgerUpdatesParameters): Promise<UserNonFundingLedgerUpdates[]>;
|
|
154
161
|
userRateLimit(args: UserRateLimitParameters): Promise<UserRateLimit>;
|
|
162
|
+
userRole(args: UserRoleParameters): Promise<UserRole>;
|
|
155
163
|
|
|
156
164
|
// Order
|
|
157
165
|
frontendOpenOrders(args: FrontendOpenOrdersParameters): Promise<FrontendOpenOrder[]>;
|
|
@@ -163,14 +171,22 @@ class PublicClient<T extends IRESTTransport> {
|
|
|
163
171
|
userFillsByTime(args: UserFillsByTimeParameters): Promise<UserFill[]>;
|
|
164
172
|
userTwapSliceFills(args: UserTwapSliceFillsParameters): Promise<UserTwapSliceFill[]>;
|
|
165
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
|
+
|
|
166
181
|
// Vault
|
|
167
182
|
userVaultEquities(args: UserVaultEquitiesParameters): Promise<UserVaultEquity[]>;
|
|
168
183
|
vaultDetails(args: VaultDetailsParameters): Promise<VaultDetails | null>;
|
|
169
184
|
vaultSummaries(): Promise<VaultSummary[]>;
|
|
170
185
|
|
|
171
|
-
//
|
|
186
|
+
// Explorer
|
|
172
187
|
blockDetails(args: BlockDetailsParameters): Promise<BlockDetailsResponse>;
|
|
173
188
|
txDetails(args: TxDetailsParameters): Promise<TxDetailsResponse>;
|
|
189
|
+
userDetails(args: UserDetailsParameters): Promise<UserDetailsResponse>;
|
|
174
190
|
}
|
|
175
191
|
```
|
|
176
192
|
|
|
@@ -201,7 +217,7 @@ class WalletClient<
|
|
|
201
217
|
> {
|
|
202
218
|
constructor(args: WalletClientParameters<T, W>);
|
|
203
219
|
|
|
204
|
-
// Order
|
|
220
|
+
// Order
|
|
205
221
|
batchModify(args: BatchModifyParameters): Promise<OrderResponseSuccess>;
|
|
206
222
|
cancel(args: CancelParameters): Promise<CancelResponseSuccess>;
|
|
207
223
|
cancelByCloid(args: CancelByCloidParameters): Promise<CancelResponseSuccess>;
|
|
@@ -213,7 +229,7 @@ class WalletClient<
|
|
|
213
229
|
updateIsolatedMargin(args: UpdateIsolatedMarginParameters): Promise<SuccessResponse>;
|
|
214
230
|
updateLeverage(args: UpdateLeverageParameters): Promise<SuccessResponse>;
|
|
215
231
|
|
|
216
|
-
// Account
|
|
232
|
+
// Account
|
|
217
233
|
approveAgent(args: ApproveAgentParameters): Promise<SuccessResponse>;
|
|
218
234
|
approveBuilderFee(args: ApproveBuilderFeeParameters): Promise<SuccessResponse>;
|
|
219
235
|
createSubAccount(args: CreateSubAccountParameters): Promise<CreateSubAccountResponse>;
|
|
@@ -226,6 +242,11 @@ class WalletClient<
|
|
|
226
242
|
usdSend(args: UsdSendParameters): Promise<SuccessResponse>;
|
|
227
243
|
vaultTransfer(args: VaultTransferParameters): Promise<SuccessResponse>;
|
|
228
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>;
|
|
229
250
|
}
|
|
230
251
|
```
|
|
231
252
|
|
|
@@ -246,7 +267,7 @@ interface EventClientParameters<T extends ISubscriptionTransport> {
|
|
|
246
267
|
class EventClient<T extends ISubscriptionTransport> {
|
|
247
268
|
constructor(args: EventClientParameters<T>);
|
|
248
269
|
|
|
249
|
-
// Market
|
|
270
|
+
// Market
|
|
250
271
|
activeAssetCtx(args: EventActiveAssetCtxParameters, listener: (data: WsActiveAssetCtx | WsActiveSpotAssetCtx) => void): Promise<Subscription>;
|
|
251
272
|
activeAssetData(args: EventActiveAssetDataParameters, listener: (data: WsActiveAssetData) => void): Promise<Subscription>;
|
|
252
273
|
allMids(listener: (data: WsAllMids) => void): Promise<Subscription>;
|
|
@@ -254,18 +275,22 @@ class EventClient<T extends ISubscriptionTransport> {
|
|
|
254
275
|
l2Book(args: EventL2BookParameters, listener: (data: Book) => void): Promise<Subscription>;
|
|
255
276
|
trades(args: EventTradesParameters, listener: (data: WsTrade[]) => void): Promise<Subscription>;
|
|
256
277
|
|
|
257
|
-
// Account
|
|
278
|
+
// Account
|
|
258
279
|
notification(args: EventNotificationParameters, listener: (data: WsNotification) => void): Promise<Subscription>;
|
|
259
280
|
userEvents(args: EventUserEventsParameters, listener: (data: WsUserEvent) => void): Promise<Subscription>;
|
|
260
281
|
userFundings(args: EventUserFundingsParameters, listener: (data: WsUserFundings) => void): Promise<Subscription>;
|
|
261
282
|
userNonFundingLedgerUpdates(args: EventUserNonFundingLedgerUpdatesParameters, listener: (data: WsUserNonFundingLedgerUpdates) => void): Promise<Subscription>;
|
|
262
283
|
webData2(args: EventWebData2Parameters, listener: (data: WsWebData2) => void): Promise<Subscription>;
|
|
263
284
|
|
|
264
|
-
// Order
|
|
265
|
-
orderUpdates(args: EventOrderUpdatesParameters, listener: (data: OrderStatus) => void): Promise<Subscription>;
|
|
285
|
+
// Order
|
|
286
|
+
orderUpdates(args: EventOrderUpdatesParameters, listener: (data: OrderStatus<Order>[]) => void): Promise<Subscription>;
|
|
266
287
|
userFills(args: EventUserFillsParameters, listener: (data: WsUserFills) => void): Promise<Subscription>;
|
|
267
288
|
userTwapHistory(args: EventUserTwapHistory, listener: (data: WsUserTwapHistory) => void): Promise<Subscription>;
|
|
268
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>;
|
|
269
294
|
}
|
|
270
295
|
```
|
|
271
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
|
@@ -6,19 +6,20 @@ export * from "./src/transports/http/http_transport.js";
|
|
|
6
6
|
export * from "./src/transports/websocket/websocket_transport.js";
|
|
7
7
|
export type { MessageBufferStrategy, ReconnectingWebSocketOptions, } from "./src/transports/websocket/reconnecting_websocket.js";
|
|
8
8
|
export { WebSocketRequestError } from "./src/transports/websocket/websocket_request_dispatcher.js";
|
|
9
|
-
export type * from "./src/types/common";
|
|
10
|
-
export type * from "./src/types/exchange/common";
|
|
11
|
-
export type * from "./src/types/exchange/requests";
|
|
12
|
-
export type * from "./src/types/exchange/responses";
|
|
13
|
-
export type * from "./src/types/explorer/common";
|
|
14
|
-
export type * from "./src/types/explorer/requests";
|
|
15
|
-
export type * from "./src/types/explorer/responses";
|
|
16
|
-
export type * from "./src/types/info/accounts";
|
|
17
|
-
export type * from "./src/types/info/assets";
|
|
18
|
-
export type * from "./src/types/info/
|
|
19
|
-
export type * from "./src/types/info/
|
|
20
|
-
export type * from "./src/types/info/
|
|
21
|
-
export type * from "./src/types/
|
|
22
|
-
export type * from "./src/types/subscriptions/
|
|
9
|
+
export type * from "./src/types/common.js";
|
|
10
|
+
export type * from "./src/types/exchange/common.js";
|
|
11
|
+
export type * from "./src/types/exchange/requests.js";
|
|
12
|
+
export type * from "./src/types/exchange/responses.js";
|
|
13
|
+
export type * from "./src/types/explorer/common.js";
|
|
14
|
+
export type * from "./src/types/explorer/requests.js";
|
|
15
|
+
export type * from "./src/types/explorer/responses.js";
|
|
16
|
+
export type * from "./src/types/info/accounts.js";
|
|
17
|
+
export type * from "./src/types/info/assets.js";
|
|
18
|
+
export type * from "./src/types/info/delegations.js";
|
|
19
|
+
export type * from "./src/types/info/orders.js";
|
|
20
|
+
export type * from "./src/types/info/requests.js";
|
|
21
|
+
export type * from "./src/types/info/vaults.js";
|
|
22
|
+
export type * from "./src/types/subscriptions/common.js";
|
|
23
|
+
export type * from "./src/types/subscriptions/requests.js";
|
|
23
24
|
export type { AbstractEthersSigner, AbstractEthersV5Signer, AbstractViemWalletClient } from "./src/utils/signing.js";
|
|
24
25
|
//# sourceMappingURL=mod.d.ts.map
|
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,
|
|
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
|
-
import type { WsActiveAssetCtxRequest, WsActiveAssetDataRequest, WsCandleRequest, WsL2BookRequest, WsNotificationRequest, WsOrderUpdatesRequest, WsTradesRequest, WsUserEventsRequest, WsUserFillsRequest, WsUserFundingsRequest, WsUserNonFundingLedgerUpdatesRequest, WsUserTwapHistoryRequest, WsUserTwapSliceFillsRequest, WsWebData2Request } from "../types/subscriptions/requests";
|
|
3
|
-
import type { WsActiveAssetCtx, WsActiveAssetData, WsActiveSpotAssetCtx, WsAllMids, WsNotification, WsTrade, WsUserEvent, WsUserFills, WsUserFundings, WsUserNonFundingLedgerUpdates, WsUserTwapHistory, WsUserTwapSliceFills, WsWebData2 } from "../types/subscriptions/common";
|
|
4
|
-
import type { Candle } from "../types/info/assets";
|
|
5
|
-
import type { Book, Order, OrderStatus } from "../types/info/orders";
|
|
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/common.js";
|
|
4
|
+
import type { Candle } from "../types/info/assets.js";
|
|
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";
|
|
@@ -161,13 +202,13 @@ export declare class EventClient<T extends ISubscriptionTransport = ISubscriptio
|
|
|
161
202
|
*/
|
|
162
203
|
l2Book(args: EventL2BookParameters, listener: (data: Book) => void, signal?: AbortSignal): Promise<Subscription>;
|
|
163
204
|
/**
|
|
164
|
-
* Subscribe to user
|
|
205
|
+
* Subscribe to notification updates for a specific user.
|
|
165
206
|
* @param args - The parameters for the subscription.
|
|
166
207
|
* @param listener - The callback function to be called when the event is received.
|
|
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";
|
|
@@ -224,13 +265,15 @@ export declare class EventClient<T extends ISubscriptionTransport = ISubscriptio
|
|
|
224
265
|
*/
|
|
225
266
|
trades(args: EventTradesParameters, listener: (data: WsTrade[]) => void, signal?: AbortSignal): Promise<Subscription>;
|
|
226
267
|
/**
|
|
227
|
-
* Subscribe to
|
|
268
|
+
* Subscribe to non-order events for a specific user.
|
|
228
269
|
* @param args - The parameters for the subscription.
|
|
229
270
|
* @param listener - The callback function to be called when the event is received.
|
|
230
271
|
* @param signal - An optional abort signal for canceling the subscription request.
|
|
231
272
|
* @returns A promise that resolves with a {@link Subscription} object to manage the subscription lifecycle.
|
|
232
273
|
*
|
|
233
|
-
* @
|
|
274
|
+
* @note Different subscriptions cannot be distinguished from each other.
|
|
275
|
+
*
|
|
276
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/websocket/subscriptions
|
|
234
277
|
* @example
|
|
235
278
|
* ```ts
|
|
236
279
|
* import * as hl from "@nktkas/hyperliquid";
|
|
@@ -251,7 +294,7 @@ export declare class EventClient<T extends ISubscriptionTransport = ISubscriptio
|
|
|
251
294
|
* @param signal - An optional abort signal for canceling the subscription request.
|
|
252
295
|
* @returns A promise that resolves with a {@link Subscription} object to manage the subscription lifecycle.
|
|
253
296
|
*
|
|
254
|
-
* @see
|
|
297
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/websocket/subscriptions
|
|
255
298
|
* @example
|
|
256
299
|
* ```ts
|
|
257
300
|
* import * as hl from "@nktkas/hyperliquid";
|
|
@@ -272,7 +315,7 @@ export declare class EventClient<T extends ISubscriptionTransport = ISubscriptio
|
|
|
272
315
|
* @param signal - An optional abort signal for canceling the subscription request.
|
|
273
316
|
* @returns A promise that resolves with a {@link Subscription} object to manage the subscription lifecycle.
|
|
274
317
|
*
|
|
275
|
-
* @see
|
|
318
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/websocket/subscriptions
|
|
276
319
|
* @example
|
|
277
320
|
* ```ts
|
|
278
321
|
* import * as hl from "@nktkas/hyperliquid";
|
|
@@ -293,7 +336,7 @@ export declare class EventClient<T extends ISubscriptionTransport = ISubscriptio
|
|
|
293
336
|
* @param signal - An optional abort signal for canceling the subscription request.
|
|
294
337
|
* @returns A promise that resolves with a {@link Subscription} object to manage the subscription lifecycle.
|
|
295
338
|
*
|
|
296
|
-
* @see
|
|
339
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/websocket/subscriptions
|
|
297
340
|
* @example
|
|
298
341
|
* ```ts
|
|
299
342
|
* import * as hl from "@nktkas/hyperliquid";
|
|
@@ -314,7 +357,7 @@ export declare class EventClient<T extends ISubscriptionTransport = ISubscriptio
|
|
|
314
357
|
* @param signal - An optional abort signal for canceling the subscription request.
|
|
315
358
|
* @returns A promise that resolves with a {@link Subscription} object to manage the subscription lifecycle.
|
|
316
359
|
*
|
|
317
|
-
* @see
|
|
360
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/websocket/subscriptions
|
|
318
361
|
* @example
|
|
319
362
|
* ```ts
|
|
320
363
|
* import * as hl from "@nktkas/hyperliquid";
|
|
@@ -335,7 +378,7 @@ export declare class EventClient<T extends ISubscriptionTransport = ISubscriptio
|
|
|
335
378
|
* @param signal - An optional abort signal for canceling the subscription request.
|
|
336
379
|
* @returns A promise that resolves with a {@link Subscription} object to manage the subscription lifecycle.
|
|
337
380
|
*
|
|
338
|
-
* @see
|
|
381
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/websocket/subscriptions
|
|
339
382
|
* @example
|
|
340
383
|
* ```ts
|
|
341
384
|
* import * as hl from "@nktkas/hyperliquid";
|
|
@@ -356,7 +399,7 @@ export declare class EventClient<T extends ISubscriptionTransport = ISubscriptio
|
|
|
356
399
|
* @param signal - An optional abort signal for canceling the subscription request.
|
|
357
400
|
* @returns A promise that resolves with a {@link Subscription} object to manage the subscription lifecycle.
|
|
358
401
|
*
|
|
359
|
-
* @see
|
|
402
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/websocket/subscriptions
|
|
360
403
|
* @example
|
|
361
404
|
* ```ts
|
|
362
405
|
* import * as hl from "@nktkas/hyperliquid";
|