@nktkas/hyperliquid 0.17.0 → 0.17.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/README.md +16 -14
- package/esm/deps/jsr.io/@std/encoding/1.0.8/_common16.d.ts +21 -0
- package/esm/deps/jsr.io/@std/encoding/1.0.8/_common16.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/encoding/1.0.8/_common16.js +45 -0
- package/esm/deps/jsr.io/@std/encoding/1.0.8/_common_detach.d.ts +4 -0
- package/esm/deps/jsr.io/@std/encoding/1.0.8/_common_detach.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/encoding/1.0.8/_common_detach.js +13 -0
- package/{script/deps/jsr.io/@std/encoding/1.0.7 → esm/deps/jsr.io/@std/encoding/1.0.8}/_types.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/encoding/1.0.8/hex.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/encoding/1.0.8/hex.js +87 -0
- package/esm/src/clients/event.d.ts +25 -2
- package/esm/src/clients/event.d.ts.map +1 -1
- package/esm/src/clients/event.js +31 -1
- package/esm/src/clients/public.d.ts +9 -9
- package/esm/src/clients/public.d.ts.map +1 -1
- package/esm/src/clients/public.js +9 -12
- package/esm/src/clients/wallet.d.ts +52 -59
- package/esm/src/clients/wallet.d.ts.map +1 -1
- package/esm/src/clients/wallet.js +69 -62
- package/esm/src/signing.d.ts +44 -0
- package/esm/src/signing.d.ts.map +1 -1
- package/esm/src/signing.js +45 -1
- package/esm/src/types/exchange/requests.d.ts +57 -43
- package/esm/src/types/exchange/requests.d.ts.map +1 -1
- package/esm/src/types/explorer/requests.d.ts +3 -3
- package/esm/src/types/info/accounts.d.ts +13 -1
- package/esm/src/types/info/accounts.d.ts.map +1 -1
- package/esm/src/types/info/assets.d.ts +2 -6
- package/esm/src/types/info/assets.d.ts.map +1 -1
- package/esm/src/types/info/orders.d.ts +3 -1
- package/esm/src/types/info/orders.d.ts.map +1 -1
- package/esm/src/types/info/requests.d.ts +10 -10
- package/esm/src/types/info/requests.d.ts.map +1 -1
- package/esm/src/types/info/vaults.d.ts +22 -17
- package/esm/src/types/info/vaults.d.ts.map +1 -1
- package/esm/src/types/mod.d.ts +0 -2
- package/esm/src/types/mod.d.ts.map +1 -1
- package/esm/src/types/mod.js +0 -2
- package/esm/src/types/subscriptions/requests.d.ts +34 -36
- package/esm/src/types/subscriptions/requests.d.ts.map +1 -1
- package/esm/src/types/subscriptions/responses.d.ts +48 -48
- package/esm/src/types/subscriptions/responses.d.ts.map +1 -1
- package/package.json +1 -1
- package/script/deps/jsr.io/@std/encoding/1.0.8/_common16.d.ts +21 -0
- package/script/deps/jsr.io/@std/encoding/1.0.8/_common16.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/encoding/1.0.8/_common16.js +60 -0
- package/script/deps/jsr.io/@std/encoding/1.0.8/_common_detach.d.ts +4 -0
- package/script/deps/jsr.io/@std/encoding/1.0.8/_common_detach.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/encoding/1.0.8/_common_detach.js +26 -0
- package/{esm/deps/jsr.io/@std/encoding/1.0.7 → script/deps/jsr.io/@std/encoding/1.0.8}/_types.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/encoding/1.0.8/hex.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/encoding/{1.0.7 → 1.0.8}/hex.js +23 -45
- package/script/src/clients/event.d.ts +25 -2
- package/script/src/clients/event.d.ts.map +1 -1
- package/script/src/clients/event.js +31 -1
- package/script/src/clients/public.d.ts +9 -9
- package/script/src/clients/public.d.ts.map +1 -1
- package/script/src/clients/public.js +9 -12
- package/script/src/clients/wallet.d.ts +52 -59
- package/script/src/clients/wallet.d.ts.map +1 -1
- package/script/src/clients/wallet.js +69 -62
- package/script/src/signing.d.ts +44 -0
- package/script/src/signing.d.ts.map +1 -1
- package/script/src/signing.js +46 -2
- package/script/src/types/exchange/requests.d.ts +57 -43
- package/script/src/types/exchange/requests.d.ts.map +1 -1
- package/script/src/types/explorer/requests.d.ts +3 -3
- package/script/src/types/info/accounts.d.ts +13 -1
- package/script/src/types/info/accounts.d.ts.map +1 -1
- package/script/src/types/info/assets.d.ts +2 -6
- package/script/src/types/info/assets.d.ts.map +1 -1
- package/script/src/types/info/orders.d.ts +3 -1
- package/script/src/types/info/orders.d.ts.map +1 -1
- package/script/src/types/info/requests.d.ts +10 -10
- package/script/src/types/info/requests.d.ts.map +1 -1
- package/script/src/types/info/vaults.d.ts +22 -17
- package/script/src/types/info/vaults.d.ts.map +1 -1
- package/script/src/types/mod.d.ts +0 -2
- package/script/src/types/mod.d.ts.map +1 -1
- package/script/src/types/mod.js +0 -2
- package/script/src/types/subscriptions/requests.d.ts +34 -36
- package/script/src/types/subscriptions/requests.d.ts.map +1 -1
- package/script/src/types/subscriptions/responses.d.ts +48 -48
- package/script/src/types/subscriptions/responses.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/encoding/1.0.7/_validate_binary_like.d.ts +0 -2
- package/esm/deps/jsr.io/@std/encoding/1.0.7/_validate_binary_like.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/encoding/1.0.7/_validate_binary_like.js +0 -26
- package/esm/deps/jsr.io/@std/encoding/1.0.7/hex.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/encoding/1.0.7/hex.js +0 -109
- package/script/deps/jsr.io/@std/encoding/1.0.7/_validate_binary_like.d.ts +0 -2
- package/script/deps/jsr.io/@std/encoding/1.0.7/_validate_binary_like.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/encoding/1.0.7/_validate_binary_like.js +0 -39
- package/script/deps/jsr.io/@std/encoding/1.0.7/hex.d.ts.map +0 -1
- /package/esm/deps/jsr.io/@std/encoding/{1.0.7 → 1.0.8}/_types.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/encoding/{1.0.7 → 1.0.8}/_types.js +0 -0
- /package/esm/deps/jsr.io/@std/encoding/{1.0.7 → 1.0.8}/hex.d.ts +0 -0
- /package/script/deps/jsr.io/@std/encoding/{1.0.7 → 1.0.8}/_types.d.ts +0 -0
- /package/script/deps/jsr.io/@std/encoding/{1.0.7 → 1.0.8}/_types.js +0 -0
- /package/script/deps/jsr.io/@std/encoding/{1.0.7 → 1.0.8}/hex.d.ts +0 -0
|
@@ -1 +0,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"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
// Copyright 2018-2025 the Deno authors. MIT license.
|
|
2
|
-
const encoder = new TextEncoder();
|
|
3
|
-
function getTypeName(value) {
|
|
4
|
-
const type = typeof value;
|
|
5
|
-
if (type !== "object") {
|
|
6
|
-
return type;
|
|
7
|
-
}
|
|
8
|
-
else if (value === null) {
|
|
9
|
-
return "null";
|
|
10
|
-
}
|
|
11
|
-
else {
|
|
12
|
-
return value?.constructor?.name ?? "object";
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
export function validateBinaryLike(source) {
|
|
16
|
-
if (typeof source === "string") {
|
|
17
|
-
return encoder.encode(source);
|
|
18
|
-
}
|
|
19
|
-
else if (source instanceof Uint8Array) {
|
|
20
|
-
return source;
|
|
21
|
-
}
|
|
22
|
-
else if (source instanceof ArrayBuffer) {
|
|
23
|
-
return new Uint8Array(source);
|
|
24
|
-
}
|
|
25
|
-
throw new TypeError(`Cannot validate the input as it must be a Uint8Array, a string, or an ArrayBuffer: received a value of the type ${getTypeName(source)}`);
|
|
26
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
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,109 +0,0 @@
|
|
|
1
|
-
// Copyright 2009 The Go Authors. All rights reserved.
|
|
2
|
-
// https://github.com/golang/go/blob/master/LICENSE
|
|
3
|
-
// Copyright 2018-2025 the Deno authors. MIT license.
|
|
4
|
-
// This module is browser compatible.
|
|
5
|
-
/**
|
|
6
|
-
* Port of the Go
|
|
7
|
-
* {@link https://github.com/golang/go/blob/go1.12.5/src/encoding/hex/hex.go | encoding/hex}
|
|
8
|
-
* library.
|
|
9
|
-
*
|
|
10
|
-
* ```ts
|
|
11
|
-
* import {
|
|
12
|
-
* decodeHex,
|
|
13
|
-
* encodeHex,
|
|
14
|
-
* } from "@std/encoding/hex";
|
|
15
|
-
* import { assertEquals } from "@std/assert";
|
|
16
|
-
*
|
|
17
|
-
* assertEquals(encodeHex("abc"), "616263");
|
|
18
|
-
*
|
|
19
|
-
* assertEquals(
|
|
20
|
-
* decodeHex("616263"),
|
|
21
|
-
* new TextEncoder().encode("abc"),
|
|
22
|
-
* );
|
|
23
|
-
* ```
|
|
24
|
-
*
|
|
25
|
-
* @module
|
|
26
|
-
*/
|
|
27
|
-
import { validateBinaryLike } from "./_validate_binary_like.js";
|
|
28
|
-
const hexTable = new TextEncoder().encode("0123456789abcdef");
|
|
29
|
-
const textEncoder = new TextEncoder();
|
|
30
|
-
const textDecoder = new TextDecoder();
|
|
31
|
-
function errInvalidByte(byte) {
|
|
32
|
-
return new TypeError(`Invalid byte '${String.fromCharCode(byte)}'`);
|
|
33
|
-
}
|
|
34
|
-
function errLength(len) {
|
|
35
|
-
return new RangeError(`Cannot decode the hex string as the input length should be even: length is ${len}`);
|
|
36
|
-
}
|
|
37
|
-
/** Converts a hex character into its value. */
|
|
38
|
-
function fromHexChar(byte) {
|
|
39
|
-
// '0' <= byte && byte <= '9'
|
|
40
|
-
if (48 <= byte && byte <= 57)
|
|
41
|
-
return byte - 48;
|
|
42
|
-
// 'a' <= byte && byte <= 'f'
|
|
43
|
-
if (97 <= byte && byte <= 102)
|
|
44
|
-
return byte - 97 + 10;
|
|
45
|
-
// 'A' <= byte && byte <= 'F'
|
|
46
|
-
if (65 <= byte && byte <= 70)
|
|
47
|
-
return byte - 65 + 10;
|
|
48
|
-
throw errInvalidByte(byte);
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
* Converts data into a hex-encoded string.
|
|
52
|
-
*
|
|
53
|
-
* @param src The data to encode.
|
|
54
|
-
*
|
|
55
|
-
* @returns The hex-encoded string.
|
|
56
|
-
*
|
|
57
|
-
* @example Usage
|
|
58
|
-
* ```ts
|
|
59
|
-
* import { encodeHex } from "@std/encoding/hex";
|
|
60
|
-
* import { assertEquals } from "@std/assert";
|
|
61
|
-
*
|
|
62
|
-
* assertEquals(encodeHex("abc"), "616263");
|
|
63
|
-
* ```
|
|
64
|
-
*/
|
|
65
|
-
export function encodeHex(src) {
|
|
66
|
-
const u8 = validateBinaryLike(src);
|
|
67
|
-
const dst = new Uint8Array(u8.length * 2);
|
|
68
|
-
for (let i = 0; i < u8.length; i++) {
|
|
69
|
-
const v = u8[i];
|
|
70
|
-
dst[i * 2] = hexTable[v >> 4];
|
|
71
|
-
dst[i * 2 + 1] = hexTable[v & 0x0f];
|
|
72
|
-
}
|
|
73
|
-
return textDecoder.decode(dst);
|
|
74
|
-
}
|
|
75
|
-
/**
|
|
76
|
-
* Decodes the given hex-encoded string. If the input is malformed, an error is
|
|
77
|
-
* thrown.
|
|
78
|
-
*
|
|
79
|
-
* @param src The hex-encoded string to decode.
|
|
80
|
-
*
|
|
81
|
-
* @returns The decoded data.
|
|
82
|
-
*
|
|
83
|
-
* @example Usage
|
|
84
|
-
* ```ts
|
|
85
|
-
* import { decodeHex } from "@std/encoding/hex";
|
|
86
|
-
* import { assertEquals } from "@std/assert";
|
|
87
|
-
*
|
|
88
|
-
* assertEquals(
|
|
89
|
-
* decodeHex("616263"),
|
|
90
|
-
* new TextEncoder().encode("abc"),
|
|
91
|
-
* );
|
|
92
|
-
* ```
|
|
93
|
-
*/
|
|
94
|
-
export function decodeHex(src) {
|
|
95
|
-
const u8 = textEncoder.encode(src);
|
|
96
|
-
const dst = new Uint8Array(u8.length / 2);
|
|
97
|
-
for (let i = 0; i < dst.length; i++) {
|
|
98
|
-
const a = fromHexChar(u8[i * 2]);
|
|
99
|
-
const b = fromHexChar(u8[i * 2 + 1]);
|
|
100
|
-
dst[i] = (a << 4) | b;
|
|
101
|
-
}
|
|
102
|
-
if (u8.length % 2 === 1) {
|
|
103
|
-
// Check for invalid char before reporting bad length,
|
|
104
|
-
// since the invalid char (if present) is an earlier problem.
|
|
105
|
-
fromHexChar(u8[dst.length * 2]);
|
|
106
|
-
throw errLength(u8.length);
|
|
107
|
-
}
|
|
108
|
-
return dst;
|
|
109
|
-
}
|
|
@@ -1 +0,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"}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
// Copyright 2018-2025 the Deno authors. MIT license.
|
|
2
|
-
(function (factory) {
|
|
3
|
-
if (typeof module === "object" && typeof module.exports === "object") {
|
|
4
|
-
var v = factory(require, exports);
|
|
5
|
-
if (v !== undefined) module.exports = v;
|
|
6
|
-
}
|
|
7
|
-
else if (typeof define === "function" && define.amd) {
|
|
8
|
-
define(["require", "exports"], factory);
|
|
9
|
-
}
|
|
10
|
-
})(function (require, exports) {
|
|
11
|
-
"use strict";
|
|
12
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
exports.validateBinaryLike = validateBinaryLike;
|
|
14
|
-
const encoder = new TextEncoder();
|
|
15
|
-
function getTypeName(value) {
|
|
16
|
-
const type = typeof value;
|
|
17
|
-
if (type !== "object") {
|
|
18
|
-
return type;
|
|
19
|
-
}
|
|
20
|
-
else if (value === null) {
|
|
21
|
-
return "null";
|
|
22
|
-
}
|
|
23
|
-
else {
|
|
24
|
-
return value?.constructor?.name ?? "object";
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
function validateBinaryLike(source) {
|
|
28
|
-
if (typeof source === "string") {
|
|
29
|
-
return encoder.encode(source);
|
|
30
|
-
}
|
|
31
|
-
else if (source instanceof Uint8Array) {
|
|
32
|
-
return source;
|
|
33
|
-
}
|
|
34
|
-
else if (source instanceof ArrayBuffer) {
|
|
35
|
-
return new Uint8Array(source);
|
|
36
|
-
}
|
|
37
|
-
throw new TypeError(`Cannot validate the input as it must be a Uint8Array, a string, or an ArrayBuffer: received a value of the type ${getTypeName(source)}`);
|
|
38
|
-
}
|
|
39
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|