@nktkas/hyperliquid 0.24.2 → 0.24.3
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 +105 -102
- package/esm/src/clients/info.d.ts +63 -57
- package/esm/src/clients/info.d.ts.map +1 -1
- package/esm/src/clients/info.js +60 -92
- package/esm/src/clients/subscription.d.ts +104 -31
- package/esm/src/clients/subscription.d.ts.map +1 -1
- package/esm/src/clients/subscription.js +92 -12
- package/esm/src/types/info/requests.d.ts +6 -0
- package/esm/src/types/info/requests.d.ts.map +1 -1
- package/esm/src/types/subscriptions/requests.d.ts +11 -0
- package/esm/src/types/subscriptions/requests.d.ts.map +1 -1
- package/esm/src/types/subscriptions/responses.d.ts +25 -0
- package/esm/src/types/subscriptions/responses.d.ts.map +1 -1
- package/package.json +1 -1
- package/script/src/clients/info.d.ts +63 -57
- package/script/src/clients/info.d.ts.map +1 -1
- package/script/src/clients/info.js +60 -92
- package/script/src/clients/subscription.d.ts +104 -31
- package/script/src/clients/subscription.d.ts.map +1 -1
- package/script/src/clients/subscription.js +92 -12
- package/script/src/types/info/requests.d.ts +6 -0
- package/script/src/types/info/requests.d.ts.map +1 -1
- package/script/src/types/subscriptions/requests.d.ts +11 -0
- package/script/src/types/subscriptions/requests.d.ts.map +1 -1
- package/script/src/types/subscriptions/responses.d.ts +25 -0
- package/script/src/types/subscriptions/responses.d.ts.map +1 -1
package/esm/src/clients/info.js
CHANGED
|
@@ -12,7 +12,7 @@ export class InfoClient {
|
|
|
12
12
|
* ```ts
|
|
13
13
|
* import * as hl from "@nktkas/hyperliquid";
|
|
14
14
|
*
|
|
15
|
-
* const transport = new hl.HttpTransport(); // or WebSocketTransport
|
|
15
|
+
* const transport = new hl.HttpTransport(); // or `WebSocketTransport`
|
|
16
16
|
* const infoClient = new hl.InfoClient({ transport });
|
|
17
17
|
* ```
|
|
18
18
|
*/
|
|
@@ -32,7 +32,7 @@ export class InfoClient {
|
|
|
32
32
|
* ```ts
|
|
33
33
|
* import * as hl from "@nktkas/hyperliquid";
|
|
34
34
|
*
|
|
35
|
-
* const transport = new hl.HttpTransport(); // or WebSocketTransport
|
|
35
|
+
* const transport = new hl.HttpTransport(); // or `WebSocketTransport`
|
|
36
36
|
* const infoClient = new hl.InfoClient({ transport });
|
|
37
37
|
*
|
|
38
38
|
* const data = await infoClient.activeAssetData({ user: "0x...", coin: "ETH" });
|
|
@@ -85,7 +85,7 @@ export class InfoClient {
|
|
|
85
85
|
* ```ts
|
|
86
86
|
* import * as hl from "@nktkas/hyperliquid";
|
|
87
87
|
*
|
|
88
|
-
* const transport = new hl.HttpTransport(); // or WebSocketTransport
|
|
88
|
+
* const transport = new hl.HttpTransport(); // or `WebSocketTransport`
|
|
89
89
|
* const infoClient = new hl.InfoClient({ transport });
|
|
90
90
|
*
|
|
91
91
|
* const data = await infoClient.candleSnapshot({
|
|
@@ -112,7 +112,7 @@ export class InfoClient {
|
|
|
112
112
|
* ```ts
|
|
113
113
|
* import * as hl from "@nktkas/hyperliquid";
|
|
114
114
|
*
|
|
115
|
-
* const transport = new hl.HttpTransport(); // or WebSocketTransport
|
|
115
|
+
* const transport = new hl.HttpTransport(); // or `WebSocketTransport`
|
|
116
116
|
* const infoClient = new hl.InfoClient({ transport });
|
|
117
117
|
*
|
|
118
118
|
* const data = await infoClient.clearinghouseState({ user: "0x..." });
|
|
@@ -135,7 +135,7 @@ export class InfoClient {
|
|
|
135
135
|
* ```ts
|
|
136
136
|
* import * as hl from "@nktkas/hyperliquid";
|
|
137
137
|
*
|
|
138
|
-
* const transport = new hl.HttpTransport(); // or WebSocketTransport
|
|
138
|
+
* const transport = new hl.HttpTransport(); // or `WebSocketTransport`
|
|
139
139
|
* const infoClient = new hl.InfoClient({ transport });
|
|
140
140
|
*
|
|
141
141
|
* const data = await infoClient.delegations({ user: "0x..." });
|
|
@@ -158,7 +158,7 @@ export class InfoClient {
|
|
|
158
158
|
* ```ts
|
|
159
159
|
* import * as hl from "@nktkas/hyperliquid";
|
|
160
160
|
*
|
|
161
|
-
* const transport = new hl.HttpTransport(); // or WebSocketTransport
|
|
161
|
+
* const transport = new hl.HttpTransport(); // or `WebSocketTransport`
|
|
162
162
|
* const infoClient = new hl.InfoClient({ transport });
|
|
163
163
|
*
|
|
164
164
|
* const data = await infoClient.delegatorHistory({ user: "0x..." });
|
|
@@ -181,7 +181,7 @@ export class InfoClient {
|
|
|
181
181
|
* ```ts
|
|
182
182
|
* import * as hl from "@nktkas/hyperliquid";
|
|
183
183
|
*
|
|
184
|
-
* const transport = new hl.HttpTransport(); // or WebSocketTransport
|
|
184
|
+
* const transport = new hl.HttpTransport(); // or `WebSocketTransport`
|
|
185
185
|
* const infoClient = new hl.InfoClient({ transport });
|
|
186
186
|
*
|
|
187
187
|
* const data = await infoClient.delegatorRewards({ user: "0x..." });
|
|
@@ -204,7 +204,7 @@ export class InfoClient {
|
|
|
204
204
|
* ```ts
|
|
205
205
|
* import * as hl from "@nktkas/hyperliquid";
|
|
206
206
|
*
|
|
207
|
-
* const transport = new hl.HttpTransport(); // or WebSocketTransport
|
|
207
|
+
* const transport = new hl.HttpTransport(); // or `WebSocketTransport`
|
|
208
208
|
* const infoClient = new hl.InfoClient({ transport });
|
|
209
209
|
*
|
|
210
210
|
* const data = await infoClient.delegatorSummary({ user: "0x..." });
|
|
@@ -226,7 +226,7 @@ export class InfoClient {
|
|
|
226
226
|
* ```ts
|
|
227
227
|
* import * as hl from "@nktkas/hyperliquid";
|
|
228
228
|
*
|
|
229
|
-
* const transport = new hl.HttpTransport(); // or WebSocketTransport
|
|
229
|
+
* const transport = new hl.HttpTransport(); // or `WebSocketTransport`
|
|
230
230
|
* const infoClient = new hl.InfoClient({ transport });
|
|
231
231
|
*
|
|
232
232
|
* const data = await infoClient.exchangeStatus();
|
|
@@ -249,7 +249,7 @@ export class InfoClient {
|
|
|
249
249
|
* ```ts
|
|
250
250
|
* import * as hl from "@nktkas/hyperliquid";
|
|
251
251
|
*
|
|
252
|
-
* const transport = new hl.HttpTransport(); // or WebSocketTransport
|
|
252
|
+
* const transport = new hl.HttpTransport(); // or `WebSocketTransport`
|
|
253
253
|
* const infoClient = new hl.InfoClient({ transport });
|
|
254
254
|
*
|
|
255
255
|
* const data = await infoClient.extraAgents({ user: "0x..." });
|
|
@@ -272,7 +272,7 @@ export class InfoClient {
|
|
|
272
272
|
* ```ts
|
|
273
273
|
* import * as hl from "@nktkas/hyperliquid";
|
|
274
274
|
*
|
|
275
|
-
* const transport = new hl.HttpTransport(); // or WebSocketTransport
|
|
275
|
+
* const transport = new hl.HttpTransport(); // or `WebSocketTransport`
|
|
276
276
|
* const infoClient = new hl.InfoClient({ transport });
|
|
277
277
|
*
|
|
278
278
|
* const data = await infoClient.frontendOpenOrders({ user: "0x..." });
|
|
@@ -295,7 +295,7 @@ export class InfoClient {
|
|
|
295
295
|
* ```ts
|
|
296
296
|
* import * as hl from "@nktkas/hyperliquid";
|
|
297
297
|
*
|
|
298
|
-
* const transport = new hl.HttpTransport(); // or WebSocketTransport
|
|
298
|
+
* const transport = new hl.HttpTransport(); // or `WebSocketTransport`
|
|
299
299
|
* const infoClient = new hl.InfoClient({ transport });
|
|
300
300
|
*
|
|
301
301
|
* const data = await infoClient.fundingHistory({
|
|
@@ -321,7 +321,7 @@ export class InfoClient {
|
|
|
321
321
|
* ```ts
|
|
322
322
|
* import * as hl from "@nktkas/hyperliquid";
|
|
323
323
|
*
|
|
324
|
-
* const transport = new hl.HttpTransport(); // or WebSocketTransport
|
|
324
|
+
* const transport = new hl.HttpTransport(); // or `WebSocketTransport`
|
|
325
325
|
* const infoClient = new hl.InfoClient({ transport });
|
|
326
326
|
*
|
|
327
327
|
* const data = await infoClient.historicalOrders({ user: "0x..." });
|
|
@@ -344,7 +344,7 @@ export class InfoClient {
|
|
|
344
344
|
* ```ts
|
|
345
345
|
* import * as hl from "@nktkas/hyperliquid";
|
|
346
346
|
*
|
|
347
|
-
* const transport = new hl.HttpTransport(); // or WebSocketTransport
|
|
347
|
+
* const transport = new hl.HttpTransport(); // or `WebSocketTransport`
|
|
348
348
|
* const infoClient = new hl.InfoClient({ transport });
|
|
349
349
|
*
|
|
350
350
|
* const data = await infoClient.isVip({ user: "0x..." });
|
|
@@ -367,7 +367,7 @@ export class InfoClient {
|
|
|
367
367
|
* ```ts
|
|
368
368
|
* import * as hl from "@nktkas/hyperliquid";
|
|
369
369
|
*
|
|
370
|
-
* const transport = new hl.HttpTransport(); // or WebSocketTransport
|
|
370
|
+
* const transport = new hl.HttpTransport(); // or `WebSocketTransport`
|
|
371
371
|
* const infoClient = new hl.InfoClient({ transport });
|
|
372
372
|
*
|
|
373
373
|
* const data = await infoClient.l2Book({ coin: "ETH", nSigFigs: 2 });
|
|
@@ -390,7 +390,7 @@ export class InfoClient {
|
|
|
390
390
|
* ```ts
|
|
391
391
|
* import * as hl from "@nktkas/hyperliquid";
|
|
392
392
|
*
|
|
393
|
-
* const transport = new hl.HttpTransport(); // or WebSocketTransport
|
|
393
|
+
* const transport = new hl.HttpTransport(); // or `WebSocketTransport`
|
|
394
394
|
* const infoClient = new hl.InfoClient({ transport });
|
|
395
395
|
*
|
|
396
396
|
* const data = await infoClient.leadingVaults({ user: "0x..." });
|
|
@@ -413,7 +413,7 @@ export class InfoClient {
|
|
|
413
413
|
* ```ts
|
|
414
414
|
* import * as hl from "@nktkas/hyperliquid";
|
|
415
415
|
*
|
|
416
|
-
* const transport = new hl.HttpTransport(); // or WebSocketTransport
|
|
416
|
+
* const transport = new hl.HttpTransport(); // or `WebSocketTransport`
|
|
417
417
|
* const infoClient = new hl.InfoClient({ transport });
|
|
418
418
|
*
|
|
419
419
|
* const data = await infoClient.legalCheck({ user: "0x..." });
|
|
@@ -435,7 +435,7 @@ export class InfoClient {
|
|
|
435
435
|
* ```ts
|
|
436
436
|
* import * as hl from "@nktkas/hyperliquid";
|
|
437
437
|
*
|
|
438
|
-
* const transport = new hl.HttpTransport(); // or WebSocketTransport
|
|
438
|
+
* const transport = new hl.HttpTransport(); // or `WebSocketTransport`
|
|
439
439
|
* const infoClient = new hl.InfoClient({ transport });
|
|
440
440
|
*
|
|
441
441
|
* const data = await infoClient.liquidatable();
|
|
@@ -458,7 +458,7 @@ export class InfoClient {
|
|
|
458
458
|
* ```ts
|
|
459
459
|
* import * as hl from "@nktkas/hyperliquid";
|
|
460
460
|
*
|
|
461
|
-
* const transport = new hl.HttpTransport(); // or WebSocketTransport
|
|
461
|
+
* const transport = new hl.HttpTransport(); // or `WebSocketTransport`
|
|
462
462
|
* const infoClient = new hl.InfoClient({ transport });
|
|
463
463
|
*
|
|
464
464
|
* const data = await infoClient.marginTable({ id: 1 });
|
|
@@ -481,7 +481,7 @@ export class InfoClient {
|
|
|
481
481
|
* ```ts
|
|
482
482
|
* import * as hl from "@nktkas/hyperliquid";
|
|
483
483
|
*
|
|
484
|
-
* const transport = new hl.HttpTransport(); // or WebSocketTransport
|
|
484
|
+
* const transport = new hl.HttpTransport(); // or `WebSocketTransport`
|
|
485
485
|
* const infoClient = new hl.InfoClient({ transport });
|
|
486
486
|
*
|
|
487
487
|
* const data = await infoClient.maxBuilderFee({ user: "0x...", builder: "0x..." });
|
|
@@ -503,7 +503,7 @@ export class InfoClient {
|
|
|
503
503
|
* ```ts
|
|
504
504
|
* import * as hl from "@nktkas/hyperliquid";
|
|
505
505
|
*
|
|
506
|
-
* const transport = new hl.HttpTransport(); // or WebSocketTransport
|
|
506
|
+
* const transport = new hl.HttpTransport(); // or `WebSocketTransport`
|
|
507
507
|
* const infoClient = new hl.InfoClient({ transport });
|
|
508
508
|
*
|
|
509
509
|
* const data = await infoClient.maxMarketOrderNtls();
|
|
@@ -519,26 +519,10 @@ export class InfoClient {
|
|
|
519
519
|
const request = { type: "meta", ...params };
|
|
520
520
|
return this.transport.request("info", request, signal);
|
|
521
521
|
}
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
*
|
|
527
|
-
* @throws {TransportError} When the transport layer throws an error.
|
|
528
|
-
*
|
|
529
|
-
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/perpetuals#retrieve-perpetuals-asset-contexts-includes-mark-price-current-funding-open-interest-etc
|
|
530
|
-
* @example
|
|
531
|
-
* ```ts
|
|
532
|
-
* import * as hl from "@nktkas/hyperliquid";
|
|
533
|
-
*
|
|
534
|
-
* const transport = new hl.HttpTransport(); // or WebSocketTransport
|
|
535
|
-
* const infoClient = new hl.InfoClient({ transport });
|
|
536
|
-
*
|
|
537
|
-
* const data = await infoClient.metaAndAssetCtxs();
|
|
538
|
-
* ```
|
|
539
|
-
*/
|
|
540
|
-
metaAndAssetCtxs(signal) {
|
|
541
|
-
const request = { type: "metaAndAssetCtxs" };
|
|
522
|
+
metaAndAssetCtxs(params_or_signal, maybeSignal) {
|
|
523
|
+
const params = params_or_signal instanceof AbortSignal ? {} : params_or_signal;
|
|
524
|
+
const signal = params_or_signal instanceof AbortSignal ? params_or_signal : maybeSignal;
|
|
525
|
+
const request = { type: "metaAndAssetCtxs", ...params };
|
|
542
526
|
return this.transport.request("info", request, signal);
|
|
543
527
|
}
|
|
544
528
|
/**
|
|
@@ -554,7 +538,7 @@ export class InfoClient {
|
|
|
554
538
|
* ```ts
|
|
555
539
|
* import * as hl from "@nktkas/hyperliquid";
|
|
556
540
|
*
|
|
557
|
-
* const transport = new hl.HttpTransport(); // or WebSocketTransport
|
|
541
|
+
* const transport = new hl.HttpTransport(); // or `WebSocketTransport`
|
|
558
542
|
* const infoClient = new hl.InfoClient({ transport });
|
|
559
543
|
*
|
|
560
544
|
* const data = await infoClient.openOrders({ user: "0x..." });
|
|
@@ -577,7 +561,7 @@ export class InfoClient {
|
|
|
577
561
|
* ```ts
|
|
578
562
|
* import * as hl from "@nktkas/hyperliquid";
|
|
579
563
|
*
|
|
580
|
-
* const transport = new hl.HttpTransport(); // or WebSocketTransport
|
|
564
|
+
* const transport = new hl.HttpTransport(); // or `WebSocketTransport`
|
|
581
565
|
* const infoClient = new hl.InfoClient({ transport });
|
|
582
566
|
*
|
|
583
567
|
* const data = await infoClient.orderStatus({ user: "0x...", oid: 12345 });
|
|
@@ -599,7 +583,7 @@ export class InfoClient {
|
|
|
599
583
|
* ```ts
|
|
600
584
|
* import * as hl from "@nktkas/hyperliquid";
|
|
601
585
|
*
|
|
602
|
-
* const transport = new hl.HttpTransport(); // or WebSocketTransport
|
|
586
|
+
* const transport = new hl.HttpTransport(); // or `WebSocketTransport`
|
|
603
587
|
* const infoClient = new hl.InfoClient({ transport });
|
|
604
588
|
*
|
|
605
589
|
* const data = await infoClient.perpDeployAuctionStatus();
|
|
@@ -621,7 +605,7 @@ export class InfoClient {
|
|
|
621
605
|
* ```ts
|
|
622
606
|
* import * as hl from "@nktkas/hyperliquid";
|
|
623
607
|
*
|
|
624
|
-
* const transport = new hl.HttpTransport(); // or WebSocketTransport
|
|
608
|
+
* const transport = new hl.HttpTransport(); // or `WebSocketTransport`
|
|
625
609
|
* const infoClient = new hl.InfoClient({ transport });
|
|
626
610
|
*
|
|
627
611
|
* const data = await infoClient.perpDexs();
|
|
@@ -631,26 +615,10 @@ export class InfoClient {
|
|
|
631
615
|
const request = { type: "perpDexs" };
|
|
632
616
|
return this.transport.request("info", request, signal);
|
|
633
617
|
}
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
*
|
|
639
|
-
* @throws {TransportError} When the transport layer throws an error.
|
|
640
|
-
*
|
|
641
|
-
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/perpetuals#query-perps-at-open-interest-caps
|
|
642
|
-
* @example
|
|
643
|
-
* ```ts
|
|
644
|
-
* import * as hl from "@nktkas/hyperliquid";
|
|
645
|
-
*
|
|
646
|
-
* const transport = new hl.HttpTransport(); // or WebSocketTransport
|
|
647
|
-
* const infoClient = new hl.InfoClient({ transport });
|
|
648
|
-
*
|
|
649
|
-
* const data = await infoClient.perpsAtOpenInterestCap();
|
|
650
|
-
* ```
|
|
651
|
-
*/
|
|
652
|
-
perpsAtOpenInterestCap(signal) {
|
|
653
|
-
const request = { type: "perpsAtOpenInterestCap" };
|
|
618
|
+
perpsAtOpenInterestCap(params_or_signal, maybeSignal) {
|
|
619
|
+
const params = params_or_signal instanceof AbortSignal ? {} : params_or_signal;
|
|
620
|
+
const signal = params_or_signal instanceof AbortSignal ? params_or_signal : maybeSignal;
|
|
621
|
+
const request = { type: "perpsAtOpenInterestCap", ...params };
|
|
654
622
|
return this.transport.request("info", request, signal);
|
|
655
623
|
}
|
|
656
624
|
/**
|
|
@@ -666,7 +634,7 @@ export class InfoClient {
|
|
|
666
634
|
* ```ts
|
|
667
635
|
* import * as hl from "@nktkas/hyperliquid";
|
|
668
636
|
*
|
|
669
|
-
* const transport = new hl.HttpTransport(); // or WebSocketTransport
|
|
637
|
+
* const transport = new hl.HttpTransport(); // or `WebSocketTransport`
|
|
670
638
|
* const infoClient = new hl.InfoClient({ transport });
|
|
671
639
|
*
|
|
672
640
|
* const data = await infoClient.portfolio({ user: "0x..." });
|
|
@@ -688,7 +656,7 @@ export class InfoClient {
|
|
|
688
656
|
* ```ts
|
|
689
657
|
* import * as hl from "@nktkas/hyperliquid";
|
|
690
658
|
*
|
|
691
|
-
* const transport = new hl.HttpTransport(); // or WebSocketTransport
|
|
659
|
+
* const transport = new hl.HttpTransport(); // or `WebSocketTransport`
|
|
692
660
|
* const infoClient = new hl.InfoClient({ transport });
|
|
693
661
|
*
|
|
694
662
|
* const data = await infoClient.predictedFundings();
|
|
@@ -711,7 +679,7 @@ export class InfoClient {
|
|
|
711
679
|
* ```ts
|
|
712
680
|
* import * as hl from "@nktkas/hyperliquid";
|
|
713
681
|
*
|
|
714
|
-
* const transport = new hl.HttpTransport(); // or WebSocketTransport
|
|
682
|
+
* const transport = new hl.HttpTransport(); // or `WebSocketTransport`
|
|
715
683
|
* const infoClient = new hl.InfoClient({ transport });
|
|
716
684
|
*
|
|
717
685
|
* const data = await infoClient.preTransferCheck({ user: "0x...", source: "0x..." });
|
|
@@ -734,7 +702,7 @@ export class InfoClient {
|
|
|
734
702
|
* ```ts
|
|
735
703
|
* import * as hl from "@nktkas/hyperliquid";
|
|
736
704
|
*
|
|
737
|
-
* const transport = new hl.HttpTransport(); // or WebSocketTransport
|
|
705
|
+
* const transport = new hl.HttpTransport(); // or `WebSocketTransport`
|
|
738
706
|
* const infoClient = new hl.InfoClient({ transport });
|
|
739
707
|
*
|
|
740
708
|
* const data = await infoClient.referral({ user: "0x..." });
|
|
@@ -757,7 +725,7 @@ export class InfoClient {
|
|
|
757
725
|
* ```ts
|
|
758
726
|
* import * as hl from "@nktkas/hyperliquid";
|
|
759
727
|
*
|
|
760
|
-
* const transport = new hl.HttpTransport(); // or WebSocketTransport
|
|
728
|
+
* const transport = new hl.HttpTransport(); // or `WebSocketTransport`
|
|
761
729
|
* const infoClient = new hl.InfoClient({ transport });
|
|
762
730
|
*
|
|
763
731
|
* const data = await infoClient.spotClearinghouseState({ user: "0x..." });
|
|
@@ -780,7 +748,7 @@ export class InfoClient {
|
|
|
780
748
|
* ```ts
|
|
781
749
|
* import * as hl from "@nktkas/hyperliquid";
|
|
782
750
|
*
|
|
783
|
-
* const transport = new hl.HttpTransport(); // or WebSocketTransport
|
|
751
|
+
* const transport = new hl.HttpTransport(); // or `WebSocketTransport`
|
|
784
752
|
* const infoClient = new hl.InfoClient({ transport });
|
|
785
753
|
*
|
|
786
754
|
* const data = await infoClient.spotDeployState({ user: "0x..." });
|
|
@@ -802,7 +770,7 @@ export class InfoClient {
|
|
|
802
770
|
* ```ts
|
|
803
771
|
* import * as hl from "@nktkas/hyperliquid";
|
|
804
772
|
*
|
|
805
|
-
* const transport = new hl.HttpTransport(); // or WebSocketTransport
|
|
773
|
+
* const transport = new hl.HttpTransport(); // or `WebSocketTransport`
|
|
806
774
|
* const infoClient = new hl.InfoClient({ transport });
|
|
807
775
|
*
|
|
808
776
|
* const data = await infoClient.spotPairDeployAuctionStatus();
|
|
@@ -824,7 +792,7 @@ export class InfoClient {
|
|
|
824
792
|
* ```ts
|
|
825
793
|
* import * as hl from "@nktkas/hyperliquid";
|
|
826
794
|
*
|
|
827
|
-
* const transport = new hl.HttpTransport(); // or WebSocketTransport
|
|
795
|
+
* const transport = new hl.HttpTransport(); // or `WebSocketTransport`
|
|
828
796
|
* const infoClient = new hl.InfoClient({ transport });
|
|
829
797
|
*
|
|
830
798
|
* const data = await infoClient.spotMeta();
|
|
@@ -846,7 +814,7 @@ export class InfoClient {
|
|
|
846
814
|
* ```ts
|
|
847
815
|
* import * as hl from "@nktkas/hyperliquid";
|
|
848
816
|
*
|
|
849
|
-
* const transport = new hl.HttpTransport(); // or WebSocketTransport
|
|
817
|
+
* const transport = new hl.HttpTransport(); // or `WebSocketTransport`
|
|
850
818
|
* const infoClient = new hl.InfoClient({ transport });
|
|
851
819
|
*
|
|
852
820
|
* const data = await infoClient.spotMetaAndAssetCtxs();
|
|
@@ -869,7 +837,7 @@ export class InfoClient {
|
|
|
869
837
|
* ```ts
|
|
870
838
|
* import * as hl from "@nktkas/hyperliquid";
|
|
871
839
|
*
|
|
872
|
-
* const transport = new hl.HttpTransport(); // or WebSocketTransport
|
|
840
|
+
* const transport = new hl.HttpTransport(); // or `WebSocketTransport`
|
|
873
841
|
* const infoClient = new hl.InfoClient({ transport });
|
|
874
842
|
*
|
|
875
843
|
* const data = await infoClient.subAccounts({ user: "0x..." });
|
|
@@ -892,7 +860,7 @@ export class InfoClient {
|
|
|
892
860
|
* ```ts
|
|
893
861
|
* import * as hl from "@nktkas/hyperliquid";
|
|
894
862
|
*
|
|
895
|
-
* const transport = new hl.HttpTransport(); // or WebSocketTransport
|
|
863
|
+
* const transport = new hl.HttpTransport(); // or `WebSocketTransport`
|
|
896
864
|
* const infoClient = new hl.InfoClient({ transport });
|
|
897
865
|
*
|
|
898
866
|
* const data = await infoClient.tokenDetails({ tokenId: "0x..." });
|
|
@@ -915,7 +883,7 @@ export class InfoClient {
|
|
|
915
883
|
* ```ts
|
|
916
884
|
* import * as hl from "@nktkas/hyperliquid";
|
|
917
885
|
*
|
|
918
|
-
* const transport = new hl.HttpTransport(); // or WebSocketTransport
|
|
886
|
+
* const transport = new hl.HttpTransport(); // or `WebSocketTransport`
|
|
919
887
|
* const infoClient = new hl.InfoClient({ transport });
|
|
920
888
|
*
|
|
921
889
|
* const data = await infoClient.twapHistory({ user: "0x..." });
|
|
@@ -986,7 +954,7 @@ export class InfoClient {
|
|
|
986
954
|
* ```ts
|
|
987
955
|
* import * as hl from "@nktkas/hyperliquid";
|
|
988
956
|
*
|
|
989
|
-
* const transport = new hl.HttpTransport(); // or WebSocketTransport
|
|
957
|
+
* const transport = new hl.HttpTransport(); // or `WebSocketTransport`
|
|
990
958
|
* const infoClient = new hl.InfoClient({ transport });
|
|
991
959
|
*
|
|
992
960
|
* const data = await infoClient.userFees({ user: "0x..." });
|
|
@@ -1009,7 +977,7 @@ export class InfoClient {
|
|
|
1009
977
|
* ```ts
|
|
1010
978
|
* import * as hl from "@nktkas/hyperliquid";
|
|
1011
979
|
*
|
|
1012
|
-
* const transport = new hl.HttpTransport(); // or WebSocketTransport
|
|
980
|
+
* const transport = new hl.HttpTransport(); // or `WebSocketTransport`
|
|
1013
981
|
* const infoClient = new hl.InfoClient({ transport });
|
|
1014
982
|
*
|
|
1015
983
|
* const data = await infoClient.userFills({ user: "0x..." });
|
|
@@ -1032,7 +1000,7 @@ export class InfoClient {
|
|
|
1032
1000
|
* ```ts
|
|
1033
1001
|
* import * as hl from "@nktkas/hyperliquid";
|
|
1034
1002
|
*
|
|
1035
|
-
* const transport = new hl.HttpTransport(); // or WebSocketTransport
|
|
1003
|
+
* const transport = new hl.HttpTransport(); // or `WebSocketTransport`
|
|
1036
1004
|
* const infoClient = new hl.InfoClient({ transport });
|
|
1037
1005
|
*
|
|
1038
1006
|
* const data = await infoClient.userFillsByTime({
|
|
@@ -1058,7 +1026,7 @@ export class InfoClient {
|
|
|
1058
1026
|
* ```ts
|
|
1059
1027
|
* import * as hl from "@nktkas/hyperliquid";
|
|
1060
1028
|
*
|
|
1061
|
-
* const transport = new hl.HttpTransport(); // or WebSocketTransport
|
|
1029
|
+
* const transport = new hl.HttpTransport(); // or `WebSocketTransport`
|
|
1062
1030
|
* const infoClient = new hl.InfoClient({ transport });
|
|
1063
1031
|
*
|
|
1064
1032
|
* const data = await infoClient.userFunding({
|
|
@@ -1084,7 +1052,7 @@ export class InfoClient {
|
|
|
1084
1052
|
* ```ts
|
|
1085
1053
|
* import * as hl from "@nktkas/hyperliquid";
|
|
1086
1054
|
*
|
|
1087
|
-
* const transport = new hl.HttpTransport(); // or WebSocketTransport
|
|
1055
|
+
* const transport = new hl.HttpTransport(); // or `WebSocketTransport`
|
|
1088
1056
|
* const infoClient = new hl.InfoClient({ transport });
|
|
1089
1057
|
*
|
|
1090
1058
|
* const data = await infoClient.userNonFundingLedgerUpdates({
|
|
@@ -1110,7 +1078,7 @@ export class InfoClient {
|
|
|
1110
1078
|
* ```ts
|
|
1111
1079
|
* import * as hl from "@nktkas/hyperliquid";
|
|
1112
1080
|
*
|
|
1113
|
-
* const transport = new hl.HttpTransport(); // or WebSocketTransport
|
|
1081
|
+
* const transport = new hl.HttpTransport(); // or `WebSocketTransport`
|
|
1114
1082
|
* const infoClient = new hl.InfoClient({ transport });
|
|
1115
1083
|
*
|
|
1116
1084
|
* const data = await infoClient.userRateLimit({ user: "0x..." });
|
|
@@ -1133,7 +1101,7 @@ export class InfoClient {
|
|
|
1133
1101
|
* ```ts
|
|
1134
1102
|
* import * as hl from "@nktkas/hyperliquid";
|
|
1135
1103
|
*
|
|
1136
|
-
* const transport = new hl.HttpTransport(); // or WebSocketTransport
|
|
1104
|
+
* const transport = new hl.HttpTransport(); // or `WebSocketTransport`
|
|
1137
1105
|
* const infoClient = new hl.InfoClient({ transport });
|
|
1138
1106
|
*
|
|
1139
1107
|
* const data = await infoClient.userRole({ user: "0x..." });
|
|
@@ -1156,7 +1124,7 @@ export class InfoClient {
|
|
|
1156
1124
|
* ```ts
|
|
1157
1125
|
* import * as hl from "@nktkas/hyperliquid";
|
|
1158
1126
|
*
|
|
1159
|
-
* const transport = new hl.HttpTransport(); // or WebSocketTransport
|
|
1127
|
+
* const transport = new hl.HttpTransport(); // or `WebSocketTransport`
|
|
1160
1128
|
* const infoClient = new hl.InfoClient({ transport });
|
|
1161
1129
|
*
|
|
1162
1130
|
* const data = await infoClient.userToMultiSigSigners({ user: "0x..." });
|
|
@@ -1179,7 +1147,7 @@ export class InfoClient {
|
|
|
1179
1147
|
* ```ts
|
|
1180
1148
|
* import * as hl from "@nktkas/hyperliquid";
|
|
1181
1149
|
*
|
|
1182
|
-
* const transport = new hl.HttpTransport(); // or WebSocketTransport
|
|
1150
|
+
* const transport = new hl.HttpTransport(); // or `WebSocketTransport`
|
|
1183
1151
|
* const infoClient = new hl.InfoClient({ transport });
|
|
1184
1152
|
*
|
|
1185
1153
|
* const data = await infoClient.userTwapSliceFills({ user: "0x..." });
|
|
@@ -1202,7 +1170,7 @@ export class InfoClient {
|
|
|
1202
1170
|
* ```ts
|
|
1203
1171
|
* import * as hl from "@nktkas/hyperliquid";
|
|
1204
1172
|
*
|
|
1205
|
-
* const transport = new hl.HttpTransport(); // or WebSocketTransport
|
|
1173
|
+
* const transport = new hl.HttpTransport(); // or `WebSocketTransport`
|
|
1206
1174
|
* const infoClient = new hl.InfoClient({ transport });
|
|
1207
1175
|
*
|
|
1208
1176
|
* const data = await infoClient.userTwapSliceFillsByTime({
|
|
@@ -1228,7 +1196,7 @@ export class InfoClient {
|
|
|
1228
1196
|
* ```ts
|
|
1229
1197
|
* import * as hl from "@nktkas/hyperliquid";
|
|
1230
1198
|
*
|
|
1231
|
-
* const transport = new hl.HttpTransport(); // or WebSocketTransport
|
|
1199
|
+
* const transport = new hl.HttpTransport(); // or `WebSocketTransport`
|
|
1232
1200
|
* const infoClient = new hl.InfoClient({ transport });
|
|
1233
1201
|
*
|
|
1234
1202
|
* const data = await infoClient.userVaultEquities({ user: "0x..." });
|
|
@@ -1250,7 +1218,7 @@ export class InfoClient {
|
|
|
1250
1218
|
* ```ts
|
|
1251
1219
|
* import * as hl from "@nktkas/hyperliquid";
|
|
1252
1220
|
*
|
|
1253
|
-
* const transport = new hl.HttpTransport(); // or WebSocketTransport
|
|
1221
|
+
* const transport = new hl.HttpTransport(); // or `WebSocketTransport`
|
|
1254
1222
|
* const infoClient = new hl.InfoClient({ transport });
|
|
1255
1223
|
*
|
|
1256
1224
|
* const data = await infoClient.validatorL1Votes();
|
|
@@ -1272,7 +1240,7 @@ export class InfoClient {
|
|
|
1272
1240
|
* ```ts
|
|
1273
1241
|
* import * as hl from "@nktkas/hyperliquid";
|
|
1274
1242
|
*
|
|
1275
|
-
* const transport = new hl.HttpTransport(); // or WebSocketTransport
|
|
1243
|
+
* const transport = new hl.HttpTransport(); // or `WebSocketTransport`
|
|
1276
1244
|
* const infoClient = new hl.InfoClient({ transport });
|
|
1277
1245
|
*
|
|
1278
1246
|
* const data = await infoClient.validatorSummaries();
|
|
@@ -1295,7 +1263,7 @@ export class InfoClient {
|
|
|
1295
1263
|
* ```ts
|
|
1296
1264
|
* import * as hl from "@nktkas/hyperliquid";
|
|
1297
1265
|
*
|
|
1298
|
-
* const transport = new hl.HttpTransport(); // or WebSocketTransport
|
|
1266
|
+
* const transport = new hl.HttpTransport(); // or `WebSocketTransport`
|
|
1299
1267
|
* const infoClient = new hl.InfoClient({ transport });
|
|
1300
1268
|
*
|
|
1301
1269
|
* const data = await infoClient.vaultDetails({ vaultAddress: "0x..." });
|
|
@@ -1317,7 +1285,7 @@ export class InfoClient {
|
|
|
1317
1285
|
* ```ts
|
|
1318
1286
|
* import * as hl from "@nktkas/hyperliquid";
|
|
1319
1287
|
*
|
|
1320
|
-
* const transport = new hl.HttpTransport(); // or WebSocketTransport
|
|
1288
|
+
* const transport = new hl.HttpTransport(); // or `WebSocketTransport`
|
|
1321
1289
|
* const infoClient = new hl.InfoClient({ transport });
|
|
1322
1290
|
*
|
|
1323
1291
|
* const data = await infoClient.vaultSummaries();
|