@nktkas/hyperliquid 0.20.0 → 0.21.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +40 -50
- package/esm/mod.d.ts +3 -4
- package/esm/mod.d.ts.map +1 -1
- package/esm/mod.js +3 -4
- package/{script/src/clients/wallet.d.ts → esm/src/clients/exchange.d.ts} +100 -100
- package/esm/src/clients/exchange.d.ts.map +1 -0
- package/esm/src/clients/{wallet.js → exchange.js} +41 -41
- package/esm/src/clients/{public.d.ts → info.d.ts} +100 -100
- package/esm/src/clients/info.d.ts.map +1 -0
- package/esm/src/clients/{public.js → info.js} +51 -51
- package/{script/src/clients/event.d.ts → esm/src/clients/subscription.d.ts} +60 -78
- package/esm/src/clients/subscription.d.ts.map +1 -0
- package/esm/src/clients/{event.js → subscription.js} +57 -79
- package/esm/src/signing.d.ts +0 -1
- package/esm/src/signing.d.ts.map +1 -1
- package/esm/src/signing.js +0 -1
- package/esm/src/transports/base.d.ts +5 -7
- package/esm/src/transports/base.d.ts.map +1 -1
- package/esm/src/transports/websocket/_reconnecting_websocket.d.ts +3 -2
- package/esm/src/transports/websocket/_reconnecting_websocket.d.ts.map +1 -1
- package/esm/src/transports/websocket/_reconnecting_websocket.js +11 -5
- package/esm/src/transports/websocket/_websocket_async_request.d.ts +6 -4
- package/esm/src/transports/websocket/_websocket_async_request.d.ts.map +1 -1
- package/esm/src/transports/websocket/_websocket_async_request.js +47 -28
- package/esm/src/transports/websocket/websocket_transport.d.ts +24 -21
- package/esm/src/transports/websocket/websocket_transport.d.ts.map +1 -1
- package/esm/src/transports/websocket/websocket_transport.js +60 -57
- package/esm/src/types/info/accounts.d.ts +12 -0
- package/esm/src/types/info/accounts.d.ts.map +1 -1
- package/esm/src/types/mod.d.ts +0 -1
- package/esm/src/types/mod.d.ts.map +1 -1
- package/esm/src/types/mod.js +1 -1
- package/package.json +1 -1
- package/script/mod.d.ts +3 -4
- package/script/mod.d.ts.map +1 -1
- package/script/mod.js +4 -5
- package/{esm/src/clients/wallet.d.ts → script/src/clients/exchange.d.ts} +100 -100
- package/script/src/clients/exchange.d.ts.map +1 -0
- package/script/src/clients/{wallet.js → exchange.js} +43 -43
- package/script/src/clients/{public.d.ts → info.d.ts} +100 -100
- package/script/src/clients/info.d.ts.map +1 -0
- package/script/src/clients/{public.js → info.js} +53 -53
- package/{esm/src/clients/event.d.ts → script/src/clients/subscription.d.ts} +60 -78
- package/script/src/clients/subscription.d.ts.map +1 -0
- package/script/src/clients/{event.js → subscription.js} +59 -81
- package/script/src/signing.d.ts +0 -1
- package/script/src/signing.d.ts.map +1 -1
- package/script/src/signing.js +52 -53
- package/script/src/transports/base.d.ts +5 -7
- package/script/src/transports/base.d.ts.map +1 -1
- package/script/src/transports/websocket/_reconnecting_websocket.d.ts +3 -2
- package/script/src/transports/websocket/_reconnecting_websocket.d.ts.map +1 -1
- package/script/src/transports/websocket/_reconnecting_websocket.js +11 -5
- package/script/src/transports/websocket/_websocket_async_request.d.ts +6 -4
- package/script/src/transports/websocket/_websocket_async_request.d.ts.map +1 -1
- package/script/src/transports/websocket/_websocket_async_request.js +47 -28
- package/script/src/transports/websocket/websocket_transport.d.ts +24 -21
- package/script/src/transports/websocket/websocket_transport.d.ts.map +1 -1
- package/script/src/transports/websocket/websocket_transport.js +60 -57
- package/script/src/types/info/accounts.d.ts +12 -0
- package/script/src/types/info/accounts.d.ts.map +1 -1
- package/script/src/types/mod.d.ts +0 -1
- package/script/src/types/mod.d.ts.map +1 -1
- package/script/src/types/mod.js +24 -25
- package/esm/_dnt.polyfills.d.ts +0 -20
- package/esm/_dnt.polyfills.d.ts.map +0 -1
- package/esm/_dnt.polyfills.js +0 -12
- package/esm/src/clients/event.d.ts.map +0 -1
- package/esm/src/clients/public.d.ts.map +0 -1
- package/esm/src/clients/wallet.d.ts.map +0 -1
- package/script/_dnt.polyfills.d.ts +0 -20
- package/script/_dnt.polyfills.d.ts.map +0 -1
- package/script/_dnt.polyfills.js +0 -23
- package/script/src/clients/event.d.ts.map +0 -1
- package/script/src/clients/public.d.ts.map +0 -1
- package/script/src/clients/wallet.d.ts.map +0 -1
package/script/src/signing.js
CHANGED
|
@@ -1,10 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This module contains functions for generating Hyperliquid transaction signatures
|
|
3
|
+
* and interfaces to various wallet implementations.
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* ```ts
|
|
7
|
+
* import { signL1Action } from "@nktkas/hyperliquid/signing";
|
|
8
|
+
*
|
|
9
|
+
* const action = {
|
|
10
|
+
* type: "cancel",
|
|
11
|
+
* cancels: [{ a: 0, o: 12345 }],
|
|
12
|
+
* };
|
|
13
|
+
* const nonce = Date.now();
|
|
14
|
+
*
|
|
15
|
+
* const signature = await signL1Action({
|
|
16
|
+
* wallet,
|
|
17
|
+
* action,
|
|
18
|
+
* nonce,
|
|
19
|
+
* isTestnet: true, // Change to false for mainnet
|
|
20
|
+
* });
|
|
21
|
+
* ```
|
|
22
|
+
* @example
|
|
23
|
+
* ```ts
|
|
24
|
+
* import { signUserSignedAction } from "@nktkas/hyperliquid/signing";
|
|
25
|
+
*
|
|
26
|
+
* const action = {
|
|
27
|
+
* type: "approveAgent",
|
|
28
|
+
* hyperliquidChain: "Testnet", // "Mainnet" or "Testnet"
|
|
29
|
+
* signatureChainId: "0x66eee",
|
|
30
|
+
* nonce: Date.now(),
|
|
31
|
+
* agentAddress: "0x...",
|
|
32
|
+
* agentName: "Agent",
|
|
33
|
+
* };
|
|
34
|
+
*
|
|
35
|
+
* const signature = await signUserSignedAction({
|
|
36
|
+
* wallet,
|
|
37
|
+
* action,
|
|
38
|
+
* types: {
|
|
39
|
+
* "HyperliquidTransaction:ApproveAgent": [
|
|
40
|
+
* { name: "hyperliquidChain", type: "string" },
|
|
41
|
+
* { name: "agentAddress", type: "address" },
|
|
42
|
+
* { name: "agentName", type: "string" },
|
|
43
|
+
* { name: "nonce", type: "uint64" },
|
|
44
|
+
* ],
|
|
45
|
+
* },
|
|
46
|
+
* chainId: parseInt(action.signatureChainId, 16),
|
|
47
|
+
* });
|
|
48
|
+
* ```
|
|
49
|
+
*
|
|
50
|
+
* @module
|
|
51
|
+
*/
|
|
1
52
|
(function (factory) {
|
|
2
53
|
if (typeof module === "object" && typeof module.exports === "object") {
|
|
3
54
|
var v = factory(require, exports);
|
|
4
55
|
if (v !== undefined) module.exports = v;
|
|
5
56
|
}
|
|
6
57
|
else if (typeof define === "function" && define.amd) {
|
|
7
|
-
define(["require", "exports", "
|
|
58
|
+
define(["require", "exports", "@noble/hashes/sha3", "../deps/jsr.io/@std/msgpack/1.0.3/encode.js", "../deps/jsr.io/@std/encoding/1.0.10/hex.js", "../deps/jsr.io/@std/bytes/1.0.6/concat.js"], factory);
|
|
8
59
|
}
|
|
9
60
|
})(function (require, exports) {
|
|
10
61
|
"use strict";
|
|
@@ -18,58 +69,6 @@
|
|
|
18
69
|
exports.isAbstractEthersV5Signer = isAbstractEthersV5Signer;
|
|
19
70
|
exports.isAbstractExtendedViemWalletClient = isAbstractExtendedViemWalletClient;
|
|
20
71
|
exports.isAbstractWindowEthereum = isAbstractWindowEthereum;
|
|
21
|
-
/**
|
|
22
|
-
* This module contains functions for generating Hyperliquid transaction signatures
|
|
23
|
-
* and interfaces to various wallet implementations.
|
|
24
|
-
*
|
|
25
|
-
* @example
|
|
26
|
-
* ```ts
|
|
27
|
-
* import { signL1Action } from "@nktkas/hyperliquid/signing";
|
|
28
|
-
*
|
|
29
|
-
* const action = {
|
|
30
|
-
* type: "cancel",
|
|
31
|
-
* cancels: [{ a: 0, o: 12345 }],
|
|
32
|
-
* };
|
|
33
|
-
* const nonce = Date.now();
|
|
34
|
-
*
|
|
35
|
-
* const signature = await signL1Action({
|
|
36
|
-
* wallet,
|
|
37
|
-
* action,
|
|
38
|
-
* nonce,
|
|
39
|
-
* isTestnet: true, // Change to false for mainnet
|
|
40
|
-
* });
|
|
41
|
-
* ```
|
|
42
|
-
* @example
|
|
43
|
-
* ```ts
|
|
44
|
-
* import { signUserSignedAction } from "@nktkas/hyperliquid/signing";
|
|
45
|
-
*
|
|
46
|
-
* const action = {
|
|
47
|
-
* type: "approveAgent",
|
|
48
|
-
* hyperliquidChain: "Testnet", // "Mainnet" or "Testnet"
|
|
49
|
-
* signatureChainId: "0x66eee",
|
|
50
|
-
* nonce: Date.now(),
|
|
51
|
-
* agentAddress: "0x...",
|
|
52
|
-
* agentName: "Agent",
|
|
53
|
-
* };
|
|
54
|
-
*
|
|
55
|
-
* const signature = await signUserSignedAction({
|
|
56
|
-
* wallet,
|
|
57
|
-
* action,
|
|
58
|
-
* types: {
|
|
59
|
-
* "HyperliquidTransaction:ApproveAgent": [
|
|
60
|
-
* { name: "hyperliquidChain", type: "string" },
|
|
61
|
-
* { name: "agentAddress", type: "address" },
|
|
62
|
-
* { name: "agentName", type: "string" },
|
|
63
|
-
* { name: "nonce", type: "uint64" },
|
|
64
|
-
* ],
|
|
65
|
-
* },
|
|
66
|
-
* chainId: parseInt(action.signatureChainId, 16),
|
|
67
|
-
* });
|
|
68
|
-
* ```
|
|
69
|
-
*
|
|
70
|
-
* @module
|
|
71
|
-
*/
|
|
72
|
-
require("../_dnt.polyfills.js");
|
|
73
72
|
const sha3_1 = require("@noble/hashes/sha3");
|
|
74
73
|
const encode_js_1 = require("../deps/jsr.io/@std/msgpack/1.0.3/encode.js");
|
|
75
74
|
const hex_js_1 = require("../deps/jsr.io/@std/encoding/1.0.10/hex.js");
|
|
@@ -29,18 +29,16 @@ export interface ISubscriptionTransport extends Partial<AsyncDisposable> {
|
|
|
29
29
|
* @param channel - The event channel to listen to.
|
|
30
30
|
* @param payload - The payload to send with the subscription request.
|
|
31
31
|
* @param listener - The function to call when the event is dispatched.
|
|
32
|
-
* @param signal - An optional abort signal for canceling the subscription request.
|
|
33
32
|
* @returns A promise that resolves with a {@link Subscription} object to manage the subscription lifecycle.
|
|
34
33
|
*/
|
|
35
|
-
subscribe<T>(channel: string, payload: unknown, listener: (data: CustomEvent<T>) => void
|
|
34
|
+
subscribe<T>(channel: string, payload: unknown, listener: (data: CustomEvent<T>) => void): Promise<Subscription>;
|
|
36
35
|
}
|
|
37
36
|
/** Controls event subscription lifecycle. */
|
|
38
37
|
export interface Subscription {
|
|
39
|
-
/**
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
unsubscribe(signal?: AbortSignal): Promise<void>;
|
|
38
|
+
/** Unsubscribes from the event and sends an unsubscribe request to the server. */
|
|
39
|
+
unsubscribe(): Promise<void>;
|
|
40
|
+
/** Signal that aborts when resubscription fails during reconnection. */
|
|
41
|
+
resubscribeSignal?: AbortSignal;
|
|
44
42
|
}
|
|
45
43
|
/** Base class for all transport-related errors. */
|
|
46
44
|
export declare class TransportError extends HyperliquidError {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../../src/src/transports/base.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAE9C;;;;;;;;GAQG;AACH,MAAM,WAAW,iBAAkB,SAAQ,OAAO,CAAC,eAAe,CAAC;IAC/D;;;;;;OAMG;IACH,OAAO,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,GAAG,UAAU,GAAG,UAAU,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;CAC9G;AAED;;;;GAIG;AACH,MAAM,WAAW,sBAAuB,SAAQ,OAAO,CAAC,eAAe,CAAC;IACpE
|
|
1
|
+
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../../src/src/transports/base.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAE9C;;;;;;;;GAQG;AACH,MAAM,WAAW,iBAAkB,SAAQ,OAAO,CAAC,eAAe,CAAC;IAC/D;;;;;;OAMG;IACH,OAAO,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,GAAG,UAAU,GAAG,UAAU,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;CAC9G;AAED;;;;GAIG;AACH,MAAM,WAAW,sBAAuB,SAAQ,OAAO,CAAC,eAAe,CAAC;IACpE;;;;;;OAMG;IACH,SAAS,CAAC,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC,CAAC,KAAK,IAAI,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;CACpH;AAED,6CAA6C;AAC7C,MAAM,WAAW,YAAY;IACzB,kFAAkF;IAClF,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAC7B,wEAAwE;IACxE,iBAAiB,CAAC,EAAE,WAAW,CAAC;CACnC;AAED,mDAAmD;AACnD,qBAAa,cAAe,SAAQ,gBAAgB;gBACpC,OAAO,CAAC,EAAE,MAAM;CAI/B"}
|
|
@@ -35,7 +35,7 @@ export interface ReconnectingWebSocketOptions {
|
|
|
35
35
|
}
|
|
36
36
|
/** Message buffer strategy interface. */
|
|
37
37
|
export interface MessageBufferStrategy {
|
|
38
|
-
push(data: string | ArrayBufferLike | Blob | ArrayBufferView): void;
|
|
38
|
+
push(data: string | ArrayBufferLike | Blob | ArrayBufferView, signal?: AbortSignal): void;
|
|
39
39
|
[Symbol.iterator](): Iterator<string | ArrayBufferLike | Blob | ArrayBufferView>;
|
|
40
40
|
}
|
|
41
41
|
/** Error thrown when reconnection problems occur. */
|
|
@@ -95,9 +95,10 @@ export declare class ReconnectingWebSocket implements WebSocket {
|
|
|
95
95
|
*/
|
|
96
96
|
close(code?: number, reason?: string, permanently?: boolean): void;
|
|
97
97
|
/**
|
|
98
|
+
* @param signal - `AbortSignal` to cancel sending a message if it was in the buffer.
|
|
98
99
|
* @note If the connection is not open, the data will be buffered and sent when the connection is established.
|
|
99
100
|
*/
|
|
100
|
-
send(data: string | ArrayBufferLike | Blob | ArrayBufferView): void;
|
|
101
|
+
send(data: string | ArrayBufferLike | Blob | ArrayBufferView, signal?: AbortSignal): void;
|
|
101
102
|
addEventListener<K extends keyof WebSocketEventMap>(type: K, listener: ((this: ReconnectingWebSocket, ev: WebSocketEventMap[K]) => any) | {
|
|
102
103
|
handleEvent: (event: WebSocketEventMap[K]) => any;
|
|
103
104
|
}, options?: boolean | AddEventListenerOptions): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_reconnecting_websocket.d.ts","sourceRoot":"","sources":["../../../../src/src/transports/websocket/_reconnecting_websocket.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE5C,6DAA6D;AAC7D,MAAM,WAAW,4BAA4B;IACzC;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAElC;;;;;OAKG;IACH,eAAe,CAAC,EAAE,MAAM,GAAG,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,KAAK,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC;IAE5F;;;;;OAKG;IACH,eAAe,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,WAAW,KAAK,YAAY,CAAC,OAAO,CAAC,CAAC;IAEpF;;;OAGG;IACH,aAAa,CAAC,EAAE,qBAAqB,CAAC;CACzC;AAED,yCAAyC;AACzC,MAAM,WAAW,qBAAqB;IAClC,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,eAAe,GAAG,IAAI,GAAG,eAAe,GAAG,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"_recon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EAAE,EAAE,KAAK,KAAK,GAAG,CAAC,GAAG,IAAI,EAE7D;IAED;;OAEG;IACH,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,WAAW,GAAE,OAAc,GAAG,IAAI;IAKxE;;;OAGG;IACH,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,eAAe,GAAG,IAAI,GAAG,eAAe,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,IAAI;IASzF,gBAAgB,CAAC,CAAC,SAAS,MAAM,iBAAiB,EAC9C,IAAI,EAAE,CAAC,EACP,QAAQ,EACF,CAAC,CAAC,IAAI,EAAE,qBAAqB,EAAE,EAAE,EAAE,iBAAiB,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,GAChE;QAAE,WAAW,EAAE,CAAC,KAAK,EAAE,iBAAiB,CAAC,CAAC,CAAC,KAAK,GAAG,CAAA;KAAE,EAC3D,OAAO,CAAC,EAAE,OAAO,GAAG,uBAAuB,GAC5C,IAAI;IA8CP,mBAAmB,CAAC,CAAC,SAAS,MAAM,iBAAiB,EACjD,IAAI,EAAE,CAAC,EACP,QAAQ,EACF,CAAC,CAAC,IAAI,EAAE,qBAAqB,EAAE,EAAE,EAAE,iBAAiB,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,GAChE;QAAE,WAAW,EAAE,CAAC,KAAK,EAAE,iBAAiB,CAAC,CAAC,CAAC,KAAK,GAAG,CAAA;KAAE,EAC3D,OAAO,CAAC,EAAE,OAAO,GAAG,oBAAoB,GACzC,IAAI;IAkBP,aAAa,CAAC,KAAK,EAAE,KAAK,GAAG,OAAO;CAGvC"}
|
|
@@ -16,12 +16,15 @@
|
|
|
16
16
|
/** Simple FIFO (First In, First Out) buffer implementation. */
|
|
17
17
|
class FIFOMessageBuffer {
|
|
18
18
|
queue = [];
|
|
19
|
-
push(data) {
|
|
20
|
-
this.queue.push(data);
|
|
19
|
+
push(data, signal) {
|
|
20
|
+
this.queue.push({ data, signal });
|
|
21
21
|
}
|
|
22
22
|
*[Symbol.iterator]() {
|
|
23
23
|
while (this.queue.length > 0) {
|
|
24
|
-
|
|
24
|
+
const { data, signal } = this.queue.shift();
|
|
25
|
+
if (signal?.aborted)
|
|
26
|
+
continue;
|
|
27
|
+
yield data;
|
|
25
28
|
}
|
|
26
29
|
}
|
|
27
30
|
}
|
|
@@ -207,11 +210,14 @@
|
|
|
207
210
|
this._cleanup("USER_INITIATED_CLOSE");
|
|
208
211
|
}
|
|
209
212
|
/**
|
|
213
|
+
* @param signal - `AbortSignal` to cancel sending a message if it was in the buffer.
|
|
210
214
|
* @note If the connection is not open, the data will be buffered and sent when the connection is established.
|
|
211
215
|
*/
|
|
212
|
-
send(data) {
|
|
216
|
+
send(data, signal) {
|
|
217
|
+
if (signal?.aborted)
|
|
218
|
+
return;
|
|
213
219
|
if (this._socket.readyState !== ReconnectingWebSocket.OPEN && !this.reconnectAbortController.signal.aborted) {
|
|
214
|
-
this.reconnectOptions.messageBuffer.push(data);
|
|
220
|
+
this.reconnectOptions.messageBuffer.push(data, signal);
|
|
215
221
|
}
|
|
216
222
|
else {
|
|
217
223
|
this._socket.send(data);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { TransportError } from "../base.js";
|
|
2
|
+
import type { ReconnectingWebSocket } from "./_reconnecting_websocket.js";
|
|
2
3
|
import type { HyperliquidEventTarget } from "./_hyperliquid_event_target.js";
|
|
3
4
|
/**
|
|
4
5
|
* Error thrown when a WebSocket request fails:
|
|
@@ -13,19 +14,20 @@ export declare class WebSocketRequestError extends TransportError {
|
|
|
13
14
|
* Handles request creation, sending, and mapping responses to their corresponding requests.
|
|
14
15
|
*/
|
|
15
16
|
export declare class WebSocketAsyncRequest {
|
|
16
|
-
protected socket:
|
|
17
|
+
protected socket: ReconnectingWebSocket;
|
|
17
18
|
protected lastId: number;
|
|
18
|
-
protected queue:
|
|
19
|
+
protected queue: {
|
|
20
|
+
id: number | string;
|
|
19
21
|
resolve: (value?: any) => void;
|
|
20
22
|
reject: (reason?: any) => void;
|
|
21
|
-
}
|
|
23
|
+
}[];
|
|
22
24
|
lastRequestTime: number;
|
|
23
25
|
/**
|
|
24
26
|
* Creates a new WebSocket async request handler.
|
|
25
27
|
* @param socket - WebSocket connection instance for sending requests to the Hyperliquid WebSocket API
|
|
26
28
|
* @param hlEvents - Used to recognize Hyperliquid responses and match them with sent requests
|
|
27
29
|
*/
|
|
28
|
-
constructor(socket:
|
|
30
|
+
constructor(socket: ReconnectingWebSocket, hlEvents: HyperliquidEventTarget);
|
|
29
31
|
/**
|
|
30
32
|
* Sends a request to the Hyperliquid API.
|
|
31
33
|
* @returns A promise that resolves with the parsed JSON response body.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_websocket_async_request.d.ts","sourceRoot":"","sources":["../../../../src/src/transports/websocket/_websocket_async_request.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AAiB7E;;;;GAIG;AACH,qBAAa,qBAAsB,SAAQ,cAAc;gBACzC,OAAO,EAAE,MAAM;CAI9B;AAED;;;GAGG;AACH,qBAAa,qBAAqB;
|
|
1
|
+
{"version":3,"file":"_websocket_async_request.d.ts","sourceRoot":"","sources":["../../../../src/src/transports/websocket/_websocket_async_request.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AAC1E,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AAiB7E;;;;GAIG;AACH,qBAAa,qBAAsB,SAAQ,cAAc;gBACzC,OAAO,EAAE,MAAM;CAI9B;AAED;;;GAGG;AACH,qBAAa,qBAAqB;IAgBlB,SAAS,CAAC,MAAM,EAAE,qBAAqB;IAfnD,SAAS,CAAC,MAAM,EAAE,MAAM,CAAK;IAC7B,SAAS,CAAC,KAAK,EAAE;QACb,EAAE,EAAE,MAAM,GAAG,MAAM,CAAC;QAEpB,OAAO,EAAE,CAAC,KAAK,CAAC,EAAE,GAAG,KAAK,IAAI,CAAC;QAE/B,MAAM,EAAE,CAAC,MAAM,CAAC,EAAE,GAAG,KAAK,IAAI,CAAC;KAClC,EAAE,CAAM;IACT,eAAe,EAAE,MAAM,CAAK;IAE5B;;;;OAIG;gBACmB,MAAM,EAAE,qBAAqB,EAAE,QAAQ,EAAE,sBAAsB;IAsFrF;;;OAGG;IACG,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IAC5D,OAAO,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,GAAG,WAAW,GAAG,aAAa,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,CAAC,CAAC;IA6ClH,6DAA6D;IAC7D,MAAM,CAAC,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM;CAK7C"}
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
class WebSocketAsyncRequest {
|
|
31
31
|
socket;
|
|
32
32
|
lastId = 0;
|
|
33
|
-
queue =
|
|
33
|
+
queue = [];
|
|
34
34
|
lastRequestTime = 0;
|
|
35
35
|
/**
|
|
36
36
|
* Creates a new WebSocket async request handler.
|
|
@@ -42,41 +42,58 @@
|
|
|
42
42
|
// Monitor responses and match the pending request
|
|
43
43
|
hlEvents.addEventListener("subscriptionResponse", (event) => {
|
|
44
44
|
// Use a stringified request as an id
|
|
45
|
-
const id = WebSocketAsyncRequest.requestToId(event.detail
|
|
46
|
-
this.queue.
|
|
45
|
+
const id = WebSocketAsyncRequest.requestToId(event.detail);
|
|
46
|
+
this.queue.findLast((item) => item.id === id)?.resolve(event.detail);
|
|
47
47
|
});
|
|
48
48
|
hlEvents.addEventListener("post", (event) => {
|
|
49
49
|
const data = event.detail.response.type === "info"
|
|
50
50
|
? event.detail.response.payload.data
|
|
51
51
|
: event.detail.response.payload;
|
|
52
|
-
this.queue.
|
|
52
|
+
this.queue.findLast((item) => item.id === event.detail.id)?.resolve(data);
|
|
53
53
|
});
|
|
54
54
|
hlEvents.addEventListener("pong", () => {
|
|
55
|
-
this.queue.
|
|
55
|
+
this.queue.findLast((item) => item.id === "ping")?.resolve();
|
|
56
56
|
});
|
|
57
57
|
hlEvents.addEventListener("error", (event) => {
|
|
58
58
|
try {
|
|
59
59
|
// Error event doesn't have an id, use original request to match
|
|
60
60
|
const request = event.detail.match(/{.*}/)?.[0];
|
|
61
|
-
if (request)
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
typeof parsedRequest.subscription === "object" &&
|
|
69
|
-
parsedRequest.subscription !== null) {
|
|
70
|
-
// If a subscription/unsubscribe request was sent, use the request as an id
|
|
71
|
-
const id = WebSocketAsyncRequest.requestToId(parsedRequest.subscription);
|
|
72
|
-
this.queue.get(id)?.reject(new WebSocketRequestError(`Cannot complete WebSocket request: ${event.detail}`));
|
|
73
|
-
}
|
|
74
|
-
else {
|
|
75
|
-
// If the request is not recognized, use the parsed request as an id
|
|
76
|
-
const id = WebSocketAsyncRequest.requestToId(parsedRequest);
|
|
77
|
-
this.queue.get(id)?.reject(new WebSocketRequestError(`Cannot complete WebSocket request: ${event.detail}`));
|
|
78
|
-
}
|
|
61
|
+
if (!request)
|
|
62
|
+
return;
|
|
63
|
+
const parsedRequest = JSON.parse(request);
|
|
64
|
+
// For `post` requests
|
|
65
|
+
if ("id" in parsedRequest && typeof parsedRequest.id === "number") {
|
|
66
|
+
this.queue.findLast((item) => item.id === parsedRequest.id)?.reject(new WebSocketRequestError(`Cannot complete WebSocket request: ${event.detail}`));
|
|
67
|
+
return;
|
|
79
68
|
}
|
|
69
|
+
// For `subscribe` and `unsubscribe` requests
|
|
70
|
+
if ("subscription" in parsedRequest &&
|
|
71
|
+
typeof parsedRequest.subscription === "object" && parsedRequest.subscription !== null) {
|
|
72
|
+
const id = WebSocketAsyncRequest.requestToId(parsedRequest);
|
|
73
|
+
this.queue.findLast((item) => item.id === id)?.reject(new WebSocketRequestError(`Cannot complete WebSocket request: ${event.detail}`));
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
// For already/invalid subscribed requests
|
|
77
|
+
if (event.detail.startsWith("Already subscribed") || event.detail.startsWith("Invalid subscription")) {
|
|
78
|
+
const id = WebSocketAsyncRequest.requestToId({
|
|
79
|
+
method: "subscribe",
|
|
80
|
+
subscription: parsedRequest,
|
|
81
|
+
});
|
|
82
|
+
this.queue.findLast((item) => item.id === id)?.reject(new WebSocketRequestError(`Cannot complete WebSocket request: ${event.detail}`));
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
// For already unsubscribed requests
|
|
86
|
+
if (event.detail.startsWith("Already unsubscribed")) {
|
|
87
|
+
const id = WebSocketAsyncRequest.requestToId({
|
|
88
|
+
method: "unsubscribe",
|
|
89
|
+
subscription: parsedRequest,
|
|
90
|
+
});
|
|
91
|
+
this.queue.findLast((item) => item.id === id)?.reject(new WebSocketRequestError(`Cannot complete WebSocket request: ${event.detail}`));
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
// For unknown requests
|
|
95
|
+
const id = WebSocketAsyncRequest.requestToId(parsedRequest);
|
|
96
|
+
this.queue.findLast((item) => item.id === id)?.reject(new WebSocketRequestError(`Cannot complete WebSocket request: ${event.detail}`));
|
|
80
97
|
}
|
|
81
98
|
catch {
|
|
82
99
|
// Ignore JSON parsing errors
|
|
@@ -87,7 +104,7 @@
|
|
|
87
104
|
this.queue.forEach(({ reject }) => {
|
|
88
105
|
reject(new WebSocketRequestError("Cannot complete WebSocket request: connection is closed"));
|
|
89
106
|
});
|
|
90
|
-
this.queue
|
|
107
|
+
this.queue = [];
|
|
91
108
|
});
|
|
92
109
|
}
|
|
93
110
|
async request(method, payload_or_signal, maybeSignal) {
|
|
@@ -108,19 +125,21 @@
|
|
|
108
125
|
request = { method };
|
|
109
126
|
}
|
|
110
127
|
else {
|
|
111
|
-
id = WebSocketAsyncRequest.requestToId(payload);
|
|
112
128
|
request = { method, subscription: payload };
|
|
129
|
+
id = WebSocketAsyncRequest.requestToId(request);
|
|
113
130
|
}
|
|
114
131
|
// Send the request
|
|
115
|
-
this.socket.send(JSON.stringify(request));
|
|
132
|
+
this.socket.send(JSON.stringify(request), signal);
|
|
116
133
|
this.lastRequestTime = Date.now();
|
|
117
134
|
// Wait for a response
|
|
118
135
|
const { promise, resolve, reject } = Promise.withResolvers();
|
|
119
|
-
this.queue.
|
|
136
|
+
this.queue.push({ id, resolve, reject });
|
|
120
137
|
const onAbort = () => reject(signal?.reason);
|
|
121
138
|
signal?.addEventListener("abort", onAbort, { once: true });
|
|
122
139
|
return await promise.finally(() => {
|
|
123
|
-
this.queue.
|
|
140
|
+
const index = this.queue.findLastIndex((item) => item.id === id);
|
|
141
|
+
if (index !== -1)
|
|
142
|
+
this.queue.splice(index, 1);
|
|
124
143
|
signal?.removeEventListener("abort", onAbort);
|
|
125
144
|
});
|
|
126
145
|
}
|
|
@@ -34,46 +34,51 @@ export interface WebSocketTransportOptions {
|
|
|
34
34
|
/**
|
|
35
35
|
* Timeout for the ping request in ms.
|
|
36
36
|
* Set to `null` to disable.
|
|
37
|
-
* same as {@link timeout} for requests.
|
|
37
|
+
* @defaultValue same as {@link timeout} for requests.
|
|
38
38
|
*/
|
|
39
39
|
timeout?: number | null;
|
|
40
40
|
};
|
|
41
41
|
/** Reconnection policy configuration for closed connections. */
|
|
42
42
|
reconnect?: ReconnectingWebSocketOptions;
|
|
43
|
+
/**
|
|
44
|
+
* Enable automatic event resubscription after reconnection.
|
|
45
|
+
* @defaultValue `true`
|
|
46
|
+
*/
|
|
47
|
+
autoResubscribe?: boolean;
|
|
43
48
|
}
|
|
44
49
|
/** WebSocket implementation of the REST and Subscription transport interfaces. */
|
|
45
50
|
export declare class WebSocketTransport implements IRequestTransport, ISubscriptionTransport, AsyncDisposable {
|
|
46
51
|
protected _wsRequester: WebSocketAsyncRequest;
|
|
47
52
|
protected _hlEvents: HyperliquidEventTarget;
|
|
48
53
|
protected _keepAliveTimeout: ReturnType<typeof setTimeout> | null;
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
protected _subscriptions: Map<string, {
|
|
56
|
-
listeners: Map<(data: CustomEvent) => void, (signal?: AbortSignal) => Promise<void>>;
|
|
57
|
-
requestPromise: Promise<unknown>;
|
|
54
|
+
protected _subscriptions: Map<string, // Unique identifier based on the payload
|
|
55
|
+
{
|
|
56
|
+
listeners: Map<(data: CustomEvent) => void, // Event listener function
|
|
57
|
+
() => Promise<void>>;
|
|
58
|
+
promise: Promise<unknown>;
|
|
59
|
+
resubscribeAbortController?: AbortController;
|
|
58
60
|
}>;
|
|
61
|
+
protected _isReconnecting: boolean;
|
|
59
62
|
/**
|
|
60
63
|
* Request timeout in ms.
|
|
61
64
|
* Set to `null` to disable.
|
|
62
65
|
*/
|
|
63
66
|
timeout: number | null;
|
|
64
67
|
/** Keep-alive configuration. */
|
|
65
|
-
|
|
68
|
+
keepAlive: {
|
|
66
69
|
/**
|
|
67
70
|
* Interval between sending ping messages in ms.
|
|
68
71
|
* Set to `null` to disable.
|
|
69
72
|
*/
|
|
70
|
-
|
|
73
|
+
interval: number | null;
|
|
71
74
|
/**
|
|
72
75
|
* Timeout for the ping request in ms.
|
|
73
76
|
* Set to `null` to disable.
|
|
74
77
|
*/
|
|
75
78
|
timeout?: number | null;
|
|
76
79
|
};
|
|
80
|
+
/** Enable automatic resubscription after reconnection. */
|
|
81
|
+
autoResubscribe: boolean;
|
|
77
82
|
/** The WebSocket that is used for communication. */
|
|
78
83
|
readonly socket: ReconnectingWebSocket;
|
|
79
84
|
/**
|
|
@@ -101,11 +106,10 @@ export declare class WebSocketTransport implements IRequestTransport, ISubscript
|
|
|
101
106
|
* @param channel - The event channel to listen to.
|
|
102
107
|
* @param payload - A payload to send with the subscription request.
|
|
103
108
|
* @param listener - A function to call when the event is dispatched.
|
|
104
|
-
* @param signal - An optional abort signal for canceling the subscription request.
|
|
105
109
|
* @returns A promise that resolves with a {@link Subscription} object to manage the subscription lifecycle.
|
|
106
110
|
* @throws {WebSocketRequestError} - An error that occurs when a WebSocket request fails.
|
|
107
111
|
*/
|
|
108
|
-
subscribe<T>(channel: string, payload: unknown, listener: (data: CustomEvent<T>) => void
|
|
112
|
+
subscribe<T>(channel: string, payload: unknown, listener: (data: CustomEvent<T>) => void): Promise<Subscription>;
|
|
109
113
|
/**
|
|
110
114
|
* Waits until the WebSocket connection is ready.
|
|
111
115
|
* @param signal - An optional abort signal.
|
|
@@ -118,13 +122,12 @@ export declare class WebSocketTransport implements IRequestTransport, ISubscript
|
|
|
118
122
|
* @returns A promise that resolves when the connection is fully closed.
|
|
119
123
|
*/
|
|
120
124
|
close(signal?: AbortSignal): Promise<void>;
|
|
121
|
-
/**
|
|
122
|
-
protected
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
protected _keepAlive(): void;
|
|
125
|
+
/** Keep the connection alive. Sends ping only when necessary. */
|
|
126
|
+
protected _keepAliveStart(): void;
|
|
127
|
+
protected _keepAliveStop(): void;
|
|
128
|
+
/** Resubscribe to all existing subscriptions if auto-resubscribe is enabled. */
|
|
129
|
+
protected _resubscribeStart(): void;
|
|
130
|
+
protected _resubscribeStop(): void;
|
|
128
131
|
[Symbol.asyncDispose](): Promise<void>;
|
|
129
132
|
}
|
|
130
133
|
//# sourceMappingURL=websocket_transport.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"websocket_transport.d.ts","sourceRoot":"","sources":["../../../../src/src/transports/websocket/websocket_transport.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,KAAK,qBAAqB,EAC1B,qBAAqB,EACrB,0BAA0B,EAC1B,KAAK,4BAA4B,EACpC,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AACxE,OAAO,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AAC7F,OAAO,KAAK,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE1F,OAAO,EAAE,qBAAqB,EAAE,CAAC;AACjC,OAAO,EAAE,KAAK,qBAAqB,EAAE,0BAA0B,EAAE,KAAK,4BAA4B,EAAE,CAAC;AAErG,+DAA+D;AAC/D,MAAM,WAAW,yBAAyB;IACtC;;;;;;;;;OASG;IACH,GAAG,CAAC,EAAE,MAAM,GAAG,GAAG,CAAC;IAEnB;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAExB,gCAAgC;IAChC,SAAS,CAAC,EAAE;QACR;;;;WAIG;QACH,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;QAEzB;;;;WAIG;QACH,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;KAC3B,CAAC;IAEF,gEAAgE;IAChE,SAAS,CAAC,EAAE,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"websocket_transport.d.ts","sourceRoot":"","sources":["../../../../src/src/transports/websocket/websocket_transport.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,KAAK,qBAAqB,EAC1B,qBAAqB,EACrB,0BAA0B,EAC1B,KAAK,4BAA4B,EACpC,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AACxE,OAAO,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AAC7F,OAAO,KAAK,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,YAAY,EAAE,M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