@nktkas/hyperliquid 0.22.2 → 0.23.0
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 +47 -49
- package/esm/src/base.d.ts +4 -1
- package/esm/src/base.d.ts.map +1 -1
- package/esm/src/base.js +2 -2
- package/esm/src/clients/exchange.d.ts +289 -207
- package/esm/src/clients/exchange.d.ts.map +1 -1
- package/esm/src/clients/exchange.js +605 -410
- package/esm/src/clients/info.d.ts +137 -41
- package/esm/src/clients/info.d.ts.map +1 -1
- package/esm/src/clients/info.js +124 -28
- package/esm/src/clients/multiSign.d.ts +285 -204
- package/esm/src/clients/multiSign.d.ts.map +1 -1
- package/esm/src/clients/multiSign.js +521 -493
- package/esm/src/clients/subscription.d.ts +38 -3
- package/esm/src/clients/subscription.d.ts.map +1 -1
- package/esm/src/clients/subscription.js +36 -3
- package/esm/src/signing/{_ethers.d.ts → _signTypedData/ethers.d.ts} +1 -1
- package/esm/src/signing/_signTypedData/ethers.d.ts.map +1 -0
- package/esm/src/signing/_signTypedData/mod.d.ts +35 -0
- package/esm/src/signing/_signTypedData/mod.d.ts.map +1 -0
- package/esm/src/signing/_signTypedData/mod.js +59 -0
- package/esm/src/signing/_signTypedData/private_key.d.ts +26 -0
- package/esm/src/signing/_signTypedData/private_key.d.ts.map +1 -0
- package/esm/src/signing/_signTypedData/private_key.js +144 -0
- package/esm/src/signing/{_viem.d.ts → _signTypedData/viem.d.ts} +2 -2
- package/esm/src/signing/_signTypedData/viem.d.ts.map +1 -0
- package/{script/src/signing/_window.d.ts → esm/src/signing/_signTypedData/window.d.ts} +18 -12
- package/esm/src/signing/_signTypedData/window.d.ts.map +1 -0
- package/esm/src/signing/{_window.js → _signTypedData/window.js} +3 -2
- package/esm/src/signing/_sorter.d.ts +56 -82
- package/esm/src/signing/_sorter.d.ts.map +1 -1
- package/esm/src/signing/_sorter.js +36 -49
- package/esm/src/signing/mod.d.ts +151 -130
- package/esm/src/signing/mod.d.ts.map +1 -1
- package/esm/src/signing/mod.js +182 -228
- package/esm/src/transports/base.d.ts +1 -1
- package/esm/src/transports/base.d.ts.map +1 -1
- package/esm/src/transports/base.js +2 -2
- package/esm/src/transports/http/http_transport.d.ts +9 -15
- package/esm/src/transports/http/http_transport.d.ts.map +1 -1
- package/esm/src/transports/http/http_transport.js +64 -59
- package/esm/src/transports/websocket/_hyperliquid_event_target.d.ts +1 -1
- package/esm/src/transports/websocket/_hyperliquid_event_target.d.ts.map +1 -1
- package/esm/src/transports/websocket/_hyperliquid_event_target.js +1 -1
- package/esm/src/transports/websocket/_reconnecting_websocket.d.ts.map +1 -1
- package/esm/src/transports/websocket/_reconnecting_websocket.js +17 -4
- package/esm/src/transports/websocket/_websocket_async_request.d.ts +0 -9
- package/esm/src/transports/websocket/_websocket_async_request.d.ts.map +1 -1
- package/esm/src/transports/websocket/_websocket_async_request.js +14 -20
- package/esm/src/transports/websocket/websocket_transport.d.ts +8 -4
- package/esm/src/transports/websocket/websocket_transport.d.ts.map +1 -1
- package/esm/src/transports/websocket/websocket_transport.js +83 -54
- package/esm/src/types/exchange/requests.d.ts +27 -51
- package/esm/src/types/exchange/requests.d.ts.map +1 -1
- package/esm/src/types/explorer/requests.d.ts +5 -8
- package/esm/src/types/explorer/requests.d.ts.map +1 -1
- package/esm/src/types/info/accounts.d.ts +5 -5
- package/esm/src/types/info/accounts.d.ts.map +1 -1
- package/esm/src/types/info/delegations.d.ts +1 -1
- package/esm/src/types/info/delegations.d.ts.map +1 -1
- package/esm/src/types/info/orders.d.ts +1 -1
- package/esm/src/types/info/orders.d.ts.map +1 -1
- package/esm/src/types/info/requests.d.ts +49 -96
- package/esm/src/types/info/requests.d.ts.map +1 -1
- package/esm/src/types/subscriptions/requests.d.ts +72 -18
- package/esm/src/types/subscriptions/requests.d.ts.map +1 -1
- package/esm/src/types/subscriptions/responses.d.ts +2 -0
- package/esm/src/types/subscriptions/responses.d.ts.map +1 -1
- package/package.json +8 -5
- package/script/mod.js +13 -23
- package/script/src/base.d.ts +4 -1
- package/script/src/base.d.ts.map +1 -1
- package/script/src/base.js +10 -20
- package/script/src/clients/exchange.d.ts +289 -207
- package/script/src/clients/exchange.d.ts.map +1 -1
- package/script/src/clients/exchange.js +2000 -1815
- package/script/src/clients/info.d.ts +137 -41
- package/script/src/clients/info.d.ts.map +1 -1
- package/script/src/clients/info.js +1296 -1210
- package/script/src/clients/multiSign.d.ts +285 -204
- package/script/src/clients/multiSign.d.ts.map +1 -1
- package/script/src/clients/multiSign.js +2043 -2025
- package/script/src/clients/subscription.d.ts +38 -3
- package/script/src/clients/subscription.d.ts.map +1 -1
- package/script/src/clients/subscription.js +568 -545
- package/script/src/signing/{_ethers.d.ts → _signTypedData/ethers.d.ts} +1 -1
- package/script/src/signing/_signTypedData/ethers.d.ts.map +1 -0
- package/script/src/signing/_signTypedData/ethers.js +16 -0
- package/script/src/signing/_signTypedData/mod.d.ts +35 -0
- package/script/src/signing/_signTypedData/mod.d.ts.map +1 -0
- package/script/src/signing/_signTypedData/mod.js +67 -0
- package/script/src/signing/_signTypedData/private_key.d.ts +26 -0
- package/script/src/signing/_signTypedData/private_key.d.ts.map +1 -0
- package/script/src/signing/_signTypedData/private_key.js +148 -0
- package/script/src/signing/{_viem.d.ts → _signTypedData/viem.d.ts} +2 -2
- package/script/src/signing/_signTypedData/viem.d.ts.map +1 -0
- package/script/src/signing/_signTypedData/viem.js +9 -0
- package/{esm/src/signing/_window.d.ts → script/src/signing/_signTypedData/window.d.ts} +18 -12
- package/script/src/signing/_signTypedData/window.d.ts.map +1 -0
- package/script/src/signing/_signTypedData/window.js +34 -0
- package/script/src/signing/_sorter.d.ts +56 -82
- package/script/src/signing/_sorter.d.ts.map +1 -1
- package/script/src/signing/_sorter.js +655 -678
- package/script/src/signing/mod.d.ts +151 -130
- package/script/src/signing/mod.d.ts.map +1 -1
- package/script/src/signing/mod.js +286 -342
- package/script/src/transports/base.d.ts +1 -1
- package/script/src/transports/base.d.ts.map +1 -1
- package/script/src/transports/base.js +11 -21
- package/script/src/transports/http/http_transport.d.ts +9 -15
- package/script/src/transports/http/http_transport.d.ts.map +1 -1
- package/script/src/transports/http/http_transport.js +97 -102
- package/script/src/transports/websocket/_hyperliquid_event_target.d.ts +1 -1
- package/script/src/transports/websocket/_hyperliquid_event_target.d.ts.map +1 -1
- package/script/src/transports/websocket/_hyperliquid_event_target.js +51 -61
- package/script/src/transports/websocket/_reconnecting_websocket.d.ts.map +1 -1
- package/script/src/transports/websocket/_reconnecting_websocket.js +271 -268
- package/script/src/transports/websocket/_websocket_async_request.d.ts +0 -9
- package/script/src/transports/websocket/_websocket_async_request.d.ts.map +1 -1
- package/script/src/transports/websocket/_websocket_async_request.js +157 -174
- package/script/src/transports/websocket/websocket_transport.d.ts +8 -4
- package/script/src/transports/websocket/websocket_transport.d.ts.map +1 -1
- package/script/src/transports/websocket/websocket_transport.js +209 -189
- package/script/src/types/exchange/requests.d.ts +27 -51
- package/script/src/types/exchange/requests.d.ts.map +1 -1
- package/script/src/types/exchange/requests.js +2 -12
- package/script/src/types/exchange/responses.js +2 -12
- package/script/src/types/explorer/requests.d.ts +5 -8
- package/script/src/types/explorer/requests.d.ts.map +1 -1
- package/script/src/types/explorer/requests.js +2 -12
- package/script/src/types/explorer/responses.js +2 -12
- package/script/src/types/info/accounts.d.ts +5 -5
- package/script/src/types/info/accounts.d.ts.map +1 -1
- package/script/src/types/info/accounts.js +2 -12
- package/script/src/types/info/assets.js +2 -12
- package/script/src/types/info/delegations.d.ts +1 -1
- package/script/src/types/info/delegations.d.ts.map +1 -1
- package/script/src/types/info/delegations.js +2 -12
- package/script/src/types/info/markets.js +2 -12
- package/script/src/types/info/orders.d.ts +1 -1
- package/script/src/types/info/orders.d.ts.map +1 -1
- package/script/src/types/info/orders.js +2 -12
- package/script/src/types/info/requests.d.ts +49 -96
- package/script/src/types/info/requests.d.ts.map +1 -1
- package/script/src/types/info/requests.js +2 -12
- package/script/src/types/info/vaults.js +2 -12
- package/script/src/types/mod.js +2 -12
- package/script/src/types/subscriptions/requests.d.ts +72 -18
- package/script/src/types/subscriptions/requests.d.ts.map +1 -1
- package/script/src/types/subscriptions/requests.js +2 -12
- package/script/src/types/subscriptions/responses.d.ts +2 -0
- package/script/src/types/subscriptions/responses.d.ts.map +1 -1
- package/script/src/types/subscriptions/responses.js +2 -12
- package/esm/deps/jsr.io/@derzade/typescript-event-target/1.1.1/mod.d.ts +0 -2
- package/esm/deps/jsr.io/@derzade/typescript-event-target/1.1.1/mod.d.ts.map +0 -1
- package/esm/deps/jsr.io/@derzade/typescript-event-target/1.1.1/mod.js +0 -1
- package/esm/deps/jsr.io/@derzade/typescript-event-target/1.1.1/src/TypedEventTarget.d.ts +0 -95
- package/esm/deps/jsr.io/@derzade/typescript-event-target/1.1.1/src/TypedEventTarget.d.ts.map +0 -1
- package/esm/deps/jsr.io/@derzade/typescript-event-target/1.1.1/src/TypedEventTarget.js +0 -10
- package/esm/deps/jsr.io/@std/async/1.0.13/delay.d.ts +0 -43
- package/esm/deps/jsr.io/@std/async/1.0.13/delay.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/async/1.0.13/delay.js +0 -63
- package/esm/deps/jsr.io/@std/bytes/1.0.6/_types.d.ts +0 -9
- package/esm/deps/jsr.io/@std/bytes/1.0.6/_types.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/bytes/1.0.6/_types.js +0 -2
- package/esm/deps/jsr.io/@std/bytes/1.0.6/concat.d.ts +0 -21
- package/esm/deps/jsr.io/@std/bytes/1.0.6/concat.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/bytes/1.0.6/concat.js +0 -32
- package/esm/deps/jsr.io/@std/encoding/1.0.10/_common16.d.ts +0 -23
- package/esm/deps/jsr.io/@std/encoding/1.0.10/_common16.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/encoding/1.0.10/_common16.js +0 -51
- package/esm/deps/jsr.io/@std/encoding/1.0.10/_common_detach.d.ts +0 -4
- package/esm/deps/jsr.io/@std/encoding/1.0.10/_common_detach.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/encoding/1.0.10/_common_detach.js +0 -13
- package/esm/deps/jsr.io/@std/encoding/1.0.10/_types.d.ts +0 -9
- package/esm/deps/jsr.io/@std/encoding/1.0.10/_types.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/encoding/1.0.10/_types.js +0 -2
- package/esm/deps/jsr.io/@std/encoding/1.0.10/hex.d.ts +0 -39
- package/esm/deps/jsr.io/@std/encoding/1.0.10/hex.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/encoding/1.0.10/hex.js +0 -87
- package/esm/deps/jsr.io/@std/msgpack/1.0.3/_types.d.ts +0 -9
- package/esm/deps/jsr.io/@std/msgpack/1.0.3/_types.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/msgpack/1.0.3/_types.js +0 -2
- package/esm/deps/jsr.io/@std/msgpack/1.0.3/encode.d.ts +0 -39
- package/esm/deps/jsr.io/@std/msgpack/1.0.3/encode.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/msgpack/1.0.3/encode.js +0 -237
- package/esm/src/signing/_ethers.d.ts.map +0 -1
- package/esm/src/signing/_private_key.d.ts +0 -22
- package/esm/src/signing/_private_key.d.ts.map +0 -1
- package/esm/src/signing/_private_key.js +0 -124
- package/esm/src/signing/_viem.d.ts.map +0 -1
- package/esm/src/signing/_window.d.ts.map +0 -1
- package/script/deps/jsr.io/@derzade/typescript-event-target/1.1.1/mod.d.ts +0 -2
- package/script/deps/jsr.io/@derzade/typescript-event-target/1.1.1/mod.d.ts.map +0 -1
- package/script/deps/jsr.io/@derzade/typescript-event-target/1.1.1/mod.js +0 -27
- package/script/deps/jsr.io/@derzade/typescript-event-target/1.1.1/src/TypedEventTarget.d.ts +0 -95
- package/script/deps/jsr.io/@derzade/typescript-event-target/1.1.1/src/TypedEventTarget.d.ts.map +0 -1
- package/script/deps/jsr.io/@derzade/typescript-event-target/1.1.1/src/TypedEventTarget.js +0 -24
- package/script/deps/jsr.io/@std/async/1.0.13/delay.d.ts +0 -43
- package/script/deps/jsr.io/@std/async/1.0.13/delay.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/async/1.0.13/delay.js +0 -76
- package/script/deps/jsr.io/@std/bytes/1.0.6/_types.d.ts +0 -9
- package/script/deps/jsr.io/@std/bytes/1.0.6/_types.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/bytes/1.0.6/_types.js +0 -13
- package/script/deps/jsr.io/@std/bytes/1.0.6/concat.d.ts +0 -21
- package/script/deps/jsr.io/@std/bytes/1.0.6/concat.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/bytes/1.0.6/concat.js +0 -45
- package/script/deps/jsr.io/@std/encoding/1.0.10/_common16.d.ts +0 -23
- package/script/deps/jsr.io/@std/encoding/1.0.10/_common16.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/encoding/1.0.10/_common16.js +0 -67
- package/script/deps/jsr.io/@std/encoding/1.0.10/_common_detach.d.ts +0 -4
- package/script/deps/jsr.io/@std/encoding/1.0.10/_common_detach.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/encoding/1.0.10/_common_detach.js +0 -26
- package/script/deps/jsr.io/@std/encoding/1.0.10/_types.d.ts +0 -9
- package/script/deps/jsr.io/@std/encoding/1.0.10/_types.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/encoding/1.0.10/_types.js +0 -13
- package/script/deps/jsr.io/@std/encoding/1.0.10/hex.d.ts +0 -39
- package/script/deps/jsr.io/@std/encoding/1.0.10/hex.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/encoding/1.0.10/hex.js +0 -101
- package/script/deps/jsr.io/@std/msgpack/1.0.3/_types.d.ts +0 -9
- package/script/deps/jsr.io/@std/msgpack/1.0.3/_types.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/msgpack/1.0.3/_types.js +0 -13
- package/script/deps/jsr.io/@std/msgpack/1.0.3/encode.d.ts +0 -39
- package/script/deps/jsr.io/@std/msgpack/1.0.3/encode.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/msgpack/1.0.3/encode.js +0 -250
- package/script/src/signing/_ethers.d.ts.map +0 -1
- package/script/src/signing/_ethers.js +0 -26
- package/script/src/signing/_private_key.d.ts +0 -22
- package/script/src/signing/_private_key.d.ts.map +0 -1
- package/script/src/signing/_private_key.js +0 -138
- package/script/src/signing/_viem.d.ts.map +0 -1
- package/script/src/signing/_viem.js +0 -19
- package/script/src/signing/_window.d.ts.map +0 -1
- package/script/src/signing/_window.js +0 -43
- /package/esm/src/signing/{_ethers.js → _signTypedData/ethers.js} +0 -0
- /package/esm/src/signing/{_viem.js → _signTypedData/viem.js} +0 -0
|
@@ -1,9 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"_types.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/encoding/1.0.10/_types.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AAEH,MAAM,MAAM,WAAW,GAAG,UAAU,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC"}
|
|
@@ -1,13 +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
|
-
});
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import type { Uint8Array_ } from "./_types.js";
|
|
2
|
-
export type { Uint8Array_ };
|
|
3
|
-
/**
|
|
4
|
-
* Converts data into a hex-encoded string.
|
|
5
|
-
*
|
|
6
|
-
* @param src The data to encode.
|
|
7
|
-
*
|
|
8
|
-
* @returns The hex-encoded string.
|
|
9
|
-
*
|
|
10
|
-
* @example Usage
|
|
11
|
-
* ```ts
|
|
12
|
-
* import { encodeHex } from "@std/encoding/hex";
|
|
13
|
-
* import { assertEquals } from "@std/assert";
|
|
14
|
-
*
|
|
15
|
-
* assertEquals(encodeHex("abc"), "616263");
|
|
16
|
-
* ```
|
|
17
|
-
*/
|
|
18
|
-
export declare function encodeHex(src: string | Uint8Array | ArrayBuffer): string;
|
|
19
|
-
/**
|
|
20
|
-
* Decodes the given hex-encoded string. If the input is malformed, an error is
|
|
21
|
-
* thrown.
|
|
22
|
-
*
|
|
23
|
-
* @param src The hex-encoded string to decode.
|
|
24
|
-
*
|
|
25
|
-
* @returns The decoded data.
|
|
26
|
-
*
|
|
27
|
-
* @example Usage
|
|
28
|
-
* ```ts
|
|
29
|
-
* import { decodeHex } from "@std/encoding/hex";
|
|
30
|
-
* import { assertEquals } from "@std/assert";
|
|
31
|
-
*
|
|
32
|
-
* assertEquals(
|
|
33
|
-
* decodeHex("616263"),
|
|
34
|
-
* new TextEncoder().encode("abc"),
|
|
35
|
-
* );
|
|
36
|
-
* ```
|
|
37
|
-
*/
|
|
38
|
-
export declare function decodeHex(src: string): Uint8Array_;
|
|
39
|
-
//# sourceMappingURL=hex.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hex.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/encoding/1.0.10/hex.ts"],"names":[],"mappings":"AA8BA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC/C,YAAY,EAAE,WAAW,EAAE,CAAC;AAU5B;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,GAAG,WAAW,GAAG,MAAM,CAWxE;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,WAAW,CAKlD"}
|
|
@@ -1,101 +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
|
-
(function (factory) {
|
|
6
|
-
if (typeof module === "object" && typeof module.exports === "object") {
|
|
7
|
-
var v = factory(require, exports);
|
|
8
|
-
if (v !== undefined) module.exports = v;
|
|
9
|
-
}
|
|
10
|
-
else if (typeof define === "function" && define.amd) {
|
|
11
|
-
define(["require", "exports", "./_common16.js", "./_common_detach.js"], factory);
|
|
12
|
-
}
|
|
13
|
-
})(function (require, exports) {
|
|
14
|
-
"use strict";
|
|
15
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
-
exports.encodeHex = encodeHex;
|
|
17
|
-
exports.decodeHex = decodeHex;
|
|
18
|
-
/**
|
|
19
|
-
* Port of the Go
|
|
20
|
-
* {@link https://github.com/golang/go/blob/go1.12.5/src/encoding/hex/hex.go | encoding/hex}
|
|
21
|
-
* library.
|
|
22
|
-
*
|
|
23
|
-
* ```ts
|
|
24
|
-
* import {
|
|
25
|
-
* decodeHex,
|
|
26
|
-
* encodeHex,
|
|
27
|
-
* } from "@std/encoding/hex";
|
|
28
|
-
* import { assertEquals } from "@std/assert";
|
|
29
|
-
*
|
|
30
|
-
* assertEquals(encodeHex("abc"), "616263");
|
|
31
|
-
*
|
|
32
|
-
* assertEquals(
|
|
33
|
-
* decodeHex("616263"),
|
|
34
|
-
* new TextEncoder().encode("abc"),
|
|
35
|
-
* );
|
|
36
|
-
* ```
|
|
37
|
-
*
|
|
38
|
-
* @module
|
|
39
|
-
*/
|
|
40
|
-
const _common16_js_1 = require("./_common16.js");
|
|
41
|
-
const _common_detach_js_1 = require("./_common_detach.js");
|
|
42
|
-
const alphabet = new TextEncoder()
|
|
43
|
-
.encode("0123456789abcdef");
|
|
44
|
-
const rAlphabet = new Uint8Array(128).fill(16); // alphabet.length
|
|
45
|
-
alphabet.forEach((byte, i) => rAlphabet[byte] = i);
|
|
46
|
-
new TextEncoder()
|
|
47
|
-
.encode("ABCDEF")
|
|
48
|
-
.forEach((byte, i) => rAlphabet[byte] = i + 10);
|
|
49
|
-
/**
|
|
50
|
-
* Converts data into a hex-encoded string.
|
|
51
|
-
*
|
|
52
|
-
* @param src The data to encode.
|
|
53
|
-
*
|
|
54
|
-
* @returns The hex-encoded string.
|
|
55
|
-
*
|
|
56
|
-
* @example Usage
|
|
57
|
-
* ```ts
|
|
58
|
-
* import { encodeHex } from "@std/encoding/hex";
|
|
59
|
-
* import { assertEquals } from "@std/assert";
|
|
60
|
-
*
|
|
61
|
-
* assertEquals(encodeHex("abc"), "616263");
|
|
62
|
-
* ```
|
|
63
|
-
*/
|
|
64
|
-
function encodeHex(src) {
|
|
65
|
-
if (typeof src === "string") {
|
|
66
|
-
src = new TextEncoder().encode(src);
|
|
67
|
-
}
|
|
68
|
-
else if (src instanceof ArrayBuffer)
|
|
69
|
-
src = new Uint8Array(src).slice();
|
|
70
|
-
else
|
|
71
|
-
src = src.slice();
|
|
72
|
-
const [output, i] = (0, _common_detach_js_1.detach)(src, (0, _common16_js_1.calcSizeHex)(src.length));
|
|
73
|
-
(0, _common16_js_1.encode)(output, i, 0, alphabet);
|
|
74
|
-
return new TextDecoder().decode(output);
|
|
75
|
-
}
|
|
76
|
-
/**
|
|
77
|
-
* Decodes the given hex-encoded string. If the input is malformed, an error is
|
|
78
|
-
* thrown.
|
|
79
|
-
*
|
|
80
|
-
* @param src The hex-encoded string to decode.
|
|
81
|
-
*
|
|
82
|
-
* @returns The decoded data.
|
|
83
|
-
*
|
|
84
|
-
* @example Usage
|
|
85
|
-
* ```ts
|
|
86
|
-
* import { decodeHex } from "@std/encoding/hex";
|
|
87
|
-
* import { assertEquals } from "@std/assert";
|
|
88
|
-
*
|
|
89
|
-
* assertEquals(
|
|
90
|
-
* decodeHex("616263"),
|
|
91
|
-
* new TextEncoder().encode("abc"),
|
|
92
|
-
* );
|
|
93
|
-
* ```
|
|
94
|
-
*/
|
|
95
|
-
function decodeHex(src) {
|
|
96
|
-
const output = new TextEncoder().encode(src);
|
|
97
|
-
// deno-lint-ignore no-explicit-any
|
|
98
|
-
return new Uint8Array(output.buffer
|
|
99
|
-
.transfer((0, _common16_js_1.decode)(output, 0, 0, rAlphabet)));
|
|
100
|
-
}
|
|
101
|
-
});
|
|
@@ -1,9 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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,13 +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
|
-
});
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import type { Uint8Array_ } from "./_types.js";
|
|
2
|
-
export type { Uint8Array_ };
|
|
3
|
-
/**
|
|
4
|
-
* Value types that can be encoded to MessagePack.
|
|
5
|
-
*/
|
|
6
|
-
export type ValueType = number | bigint | string | boolean | null | Uint8Array | readonly ValueType[] | ValueMap;
|
|
7
|
-
/**
|
|
8
|
-
* Value map that can be encoded to MessagePack.
|
|
9
|
-
*/
|
|
10
|
-
export interface ValueMap {
|
|
11
|
-
/** Value map entry */
|
|
12
|
-
[index: string | number]: ValueType;
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* Encode a value to {@link https://msgpack.org/ | MessagePack} binary format.
|
|
16
|
-
*
|
|
17
|
-
* @example Usage
|
|
18
|
-
* ```ts
|
|
19
|
-
* import { encode } from "@std/msgpack/encode";
|
|
20
|
-
* import { assertEquals } from "@std/assert";
|
|
21
|
-
*
|
|
22
|
-
* const obj = {
|
|
23
|
-
* str: "deno",
|
|
24
|
-
* arr: [1, 2, 3],
|
|
25
|
-
* map: {
|
|
26
|
-
* foo: "bar"
|
|
27
|
-
* }
|
|
28
|
-
* }
|
|
29
|
-
*
|
|
30
|
-
* const encoded = encode(obj);
|
|
31
|
-
*
|
|
32
|
-
* assertEquals(encoded.length, 31);
|
|
33
|
-
* ```
|
|
34
|
-
*
|
|
35
|
-
* @param object Value to encode to MessagePack binary format.
|
|
36
|
-
* @returns Encoded MessagePack binary data.
|
|
37
|
-
*/
|
|
38
|
-
export declare function encode(object: ValueType): Uint8Array_;
|
|
39
|
-
//# sourceMappingURL=encode.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
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,250 +0,0 @@
|
|
|
1
|
-
// Copyright 2018-2025 the Deno authors. MIT license.
|
|
2
|
-
// This module is browser compatible.
|
|
3
|
-
(function (factory) {
|
|
4
|
-
if (typeof module === "object" && typeof module.exports === "object") {
|
|
5
|
-
var v = factory(require, exports);
|
|
6
|
-
if (v !== undefined) module.exports = v;
|
|
7
|
-
}
|
|
8
|
-
else if (typeof define === "function" && define.amd) {
|
|
9
|
-
define(["require", "exports", "../../bytes/1.0.6/concat.js"], factory);
|
|
10
|
-
}
|
|
11
|
-
})(function (require, exports) {
|
|
12
|
-
"use strict";
|
|
13
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
-
exports.encode = encode;
|
|
15
|
-
const concat_js_1 = require("../../bytes/1.0.6/concat.js");
|
|
16
|
-
const FOUR_BITS = 16;
|
|
17
|
-
const FIVE_BITS = 32;
|
|
18
|
-
const SEVEN_BITS = 128;
|
|
19
|
-
const EIGHT_BITS = 256;
|
|
20
|
-
const FIFTEEN_BITS = 32768;
|
|
21
|
-
const SIXTEEN_BITS = 65536;
|
|
22
|
-
const THIRTY_ONE_BITS = 2147483648;
|
|
23
|
-
const THIRTY_TWO_BITS = 4294967296;
|
|
24
|
-
const SIXTY_THREE_BITS = 9223372036854775808n;
|
|
25
|
-
const SIXTY_FOUR_BITS = 18446744073709551616n;
|
|
26
|
-
const encoder = new TextEncoder();
|
|
27
|
-
/**
|
|
28
|
-
* Encode a value to {@link https://msgpack.org/ | MessagePack} binary format.
|
|
29
|
-
*
|
|
30
|
-
* @example Usage
|
|
31
|
-
* ```ts
|
|
32
|
-
* import { encode } from "@std/msgpack/encode";
|
|
33
|
-
* import { assertEquals } from "@std/assert";
|
|
34
|
-
*
|
|
35
|
-
* const obj = {
|
|
36
|
-
* str: "deno",
|
|
37
|
-
* arr: [1, 2, 3],
|
|
38
|
-
* map: {
|
|
39
|
-
* foo: "bar"
|
|
40
|
-
* }
|
|
41
|
-
* }
|
|
42
|
-
*
|
|
43
|
-
* const encoded = encode(obj);
|
|
44
|
-
*
|
|
45
|
-
* assertEquals(encoded.length, 31);
|
|
46
|
-
* ```
|
|
47
|
-
*
|
|
48
|
-
* @param object Value to encode to MessagePack binary format.
|
|
49
|
-
* @returns Encoded MessagePack binary data.
|
|
50
|
-
*/
|
|
51
|
-
function encode(object) {
|
|
52
|
-
const byteParts = [];
|
|
53
|
-
encodeSlice(object, byteParts);
|
|
54
|
-
return (0, concat_js_1.concat)(byteParts);
|
|
55
|
-
}
|
|
56
|
-
function encodeFloat64(num) {
|
|
57
|
-
const dataView = new DataView(new ArrayBuffer(9));
|
|
58
|
-
dataView.setFloat64(1, num);
|
|
59
|
-
dataView.setUint8(0, 0xcb);
|
|
60
|
-
return new Uint8Array(dataView.buffer);
|
|
61
|
-
}
|
|
62
|
-
function encodeNumber(num) {
|
|
63
|
-
if (!Number.isInteger(num)) { // float 64
|
|
64
|
-
return encodeFloat64(num);
|
|
65
|
-
}
|
|
66
|
-
if (num < 0) {
|
|
67
|
-
if (num >= -FIVE_BITS) { // negative fixint
|
|
68
|
-
return new Uint8Array([num]);
|
|
69
|
-
}
|
|
70
|
-
if (num >= -SEVEN_BITS) { // int 8
|
|
71
|
-
return new Uint8Array([0xd0, num]);
|
|
72
|
-
}
|
|
73
|
-
if (num >= -FIFTEEN_BITS) { // int 16
|
|
74
|
-
const dataView = new DataView(new ArrayBuffer(3));
|
|
75
|
-
dataView.setInt16(1, num);
|
|
76
|
-
dataView.setUint8(0, 0xd1);
|
|
77
|
-
return new Uint8Array(dataView.buffer);
|
|
78
|
-
}
|
|
79
|
-
if (num >= -THIRTY_ONE_BITS) { // int 32
|
|
80
|
-
const dataView = new DataView(new ArrayBuffer(5));
|
|
81
|
-
dataView.setInt32(1, num);
|
|
82
|
-
dataView.setUint8(0, 0xd2);
|
|
83
|
-
return new Uint8Array(dataView.buffer);
|
|
84
|
-
}
|
|
85
|
-
// float 64
|
|
86
|
-
return encodeFloat64(num);
|
|
87
|
-
}
|
|
88
|
-
// if the number fits within a positive fixint, use it
|
|
89
|
-
if (num <= 0x7f) {
|
|
90
|
-
return new Uint8Array([num]);
|
|
91
|
-
}
|
|
92
|
-
if (num < EIGHT_BITS) { // uint8
|
|
93
|
-
return new Uint8Array([0xcc, num]);
|
|
94
|
-
}
|
|
95
|
-
if (num < SIXTEEN_BITS) { // uint16
|
|
96
|
-
const dataView = new DataView(new ArrayBuffer(3));
|
|
97
|
-
dataView.setUint16(1, num);
|
|
98
|
-
dataView.setUint8(0, 0xcd);
|
|
99
|
-
return new Uint8Array(dataView.buffer);
|
|
100
|
-
}
|
|
101
|
-
if (num < THIRTY_TWO_BITS) { // uint32
|
|
102
|
-
const dataView = new DataView(new ArrayBuffer(5));
|
|
103
|
-
dataView.setUint32(1, num);
|
|
104
|
-
dataView.setUint8(0, 0xce);
|
|
105
|
-
return new Uint8Array(dataView.buffer);
|
|
106
|
-
}
|
|
107
|
-
// float 64
|
|
108
|
-
return encodeFloat64(num);
|
|
109
|
-
}
|
|
110
|
-
function encodeSlice(object, byteParts) {
|
|
111
|
-
if (object === null) {
|
|
112
|
-
byteParts.push(new Uint8Array([0xc0]));
|
|
113
|
-
return;
|
|
114
|
-
}
|
|
115
|
-
if (object === false) {
|
|
116
|
-
byteParts.push(new Uint8Array([0xc2]));
|
|
117
|
-
return;
|
|
118
|
-
}
|
|
119
|
-
if (object === true) {
|
|
120
|
-
byteParts.push(new Uint8Array([0xc3]));
|
|
121
|
-
return;
|
|
122
|
-
}
|
|
123
|
-
if (typeof object === "number") {
|
|
124
|
-
byteParts.push(encodeNumber(object));
|
|
125
|
-
return;
|
|
126
|
-
}
|
|
127
|
-
if (typeof object === "bigint") {
|
|
128
|
-
if (object < 0) {
|
|
129
|
-
if (object < -SIXTY_THREE_BITS) {
|
|
130
|
-
throw new Error("Cannot safely encode bigint larger than 64 bits");
|
|
131
|
-
}
|
|
132
|
-
const dataView = new DataView(new ArrayBuffer(9));
|
|
133
|
-
dataView.setBigInt64(1, object);
|
|
134
|
-
dataView.setUint8(0, 0xd3);
|
|
135
|
-
byteParts.push(new Uint8Array(dataView.buffer));
|
|
136
|
-
return;
|
|
137
|
-
}
|
|
138
|
-
if (object >= SIXTY_FOUR_BITS) {
|
|
139
|
-
throw new Error("Cannot safely encode bigint larger than 64 bits");
|
|
140
|
-
}
|
|
141
|
-
const dataView = new DataView(new ArrayBuffer(9));
|
|
142
|
-
dataView.setBigUint64(1, object);
|
|
143
|
-
dataView.setUint8(0, 0xcf);
|
|
144
|
-
byteParts.push(new Uint8Array(dataView.buffer));
|
|
145
|
-
return;
|
|
146
|
-
}
|
|
147
|
-
if (typeof object === "string") {
|
|
148
|
-
const encoded = encoder.encode(object);
|
|
149
|
-
const len = encoded.length;
|
|
150
|
-
if (len < FIVE_BITS) { // fixstr
|
|
151
|
-
byteParts.push(new Uint8Array([0xa0 | len]));
|
|
152
|
-
}
|
|
153
|
-
else if (len < EIGHT_BITS) { // str 8
|
|
154
|
-
byteParts.push(new Uint8Array([0xd9, len]));
|
|
155
|
-
}
|
|
156
|
-
else if (len < SIXTEEN_BITS) { // str 16
|
|
157
|
-
const dataView = new DataView(new ArrayBuffer(3));
|
|
158
|
-
dataView.setUint16(1, len);
|
|
159
|
-
dataView.setUint8(0, 0xda);
|
|
160
|
-
byteParts.push(new Uint8Array(dataView.buffer));
|
|
161
|
-
}
|
|
162
|
-
else if (len < THIRTY_TWO_BITS) { // str 32
|
|
163
|
-
const dataView = new DataView(new ArrayBuffer(5));
|
|
164
|
-
dataView.setUint32(1, len);
|
|
165
|
-
dataView.setUint8(0, 0xdb);
|
|
166
|
-
byteParts.push(new Uint8Array(dataView.buffer));
|
|
167
|
-
}
|
|
168
|
-
else {
|
|
169
|
-
throw new Error("Cannot safely encode string with size larger than 32 bits");
|
|
170
|
-
}
|
|
171
|
-
byteParts.push(encoded);
|
|
172
|
-
return;
|
|
173
|
-
}
|
|
174
|
-
if (object instanceof Uint8Array) {
|
|
175
|
-
if (object.length < EIGHT_BITS) { // bin 8
|
|
176
|
-
byteParts.push(new Uint8Array([0xc4, object.length]));
|
|
177
|
-
}
|
|
178
|
-
else if (object.length < SIXTEEN_BITS) { // bin 16
|
|
179
|
-
const dataView = new DataView(new ArrayBuffer(3));
|
|
180
|
-
dataView.setUint16(1, object.length);
|
|
181
|
-
dataView.setUint8(0, 0xc5);
|
|
182
|
-
byteParts.push(new Uint8Array(dataView.buffer));
|
|
183
|
-
}
|
|
184
|
-
else if (object.length < THIRTY_TWO_BITS) { // bin 32
|
|
185
|
-
const dataView = new DataView(new ArrayBuffer(5));
|
|
186
|
-
dataView.setUint32(1, object.length);
|
|
187
|
-
dataView.setUint8(0, 0xc6);
|
|
188
|
-
byteParts.push(new Uint8Array(dataView.buffer));
|
|
189
|
-
}
|
|
190
|
-
else {
|
|
191
|
-
throw new Error("Cannot safely encode Uint8Array with size larger than 32 bits");
|
|
192
|
-
}
|
|
193
|
-
byteParts.push(object);
|
|
194
|
-
return;
|
|
195
|
-
}
|
|
196
|
-
if (Array.isArray(object)) {
|
|
197
|
-
if (object.length < FOUR_BITS) { // fixarray
|
|
198
|
-
byteParts.push(new Uint8Array([0x90 | object.length]));
|
|
199
|
-
}
|
|
200
|
-
else if (object.length < SIXTEEN_BITS) { // array 16
|
|
201
|
-
const dataView = new DataView(new ArrayBuffer(3));
|
|
202
|
-
dataView.setUint16(1, object.length);
|
|
203
|
-
dataView.setUint8(0, 0xdc);
|
|
204
|
-
byteParts.push(new Uint8Array(dataView.buffer));
|
|
205
|
-
}
|
|
206
|
-
else if (object.length < THIRTY_TWO_BITS) { // array 32
|
|
207
|
-
const dataView = new DataView(new ArrayBuffer(5));
|
|
208
|
-
dataView.setUint32(1, object.length);
|
|
209
|
-
dataView.setUint8(0, 0xdd);
|
|
210
|
-
byteParts.push(new Uint8Array(dataView.buffer));
|
|
211
|
-
}
|
|
212
|
-
else {
|
|
213
|
-
throw new Error("Cannot safely encode array with size larger than 32 bits");
|
|
214
|
-
}
|
|
215
|
-
for (const obj of object) {
|
|
216
|
-
encodeSlice(obj, byteParts);
|
|
217
|
-
}
|
|
218
|
-
return;
|
|
219
|
-
}
|
|
220
|
-
// If object is a plain object
|
|
221
|
-
const prototype = Object.getPrototypeOf(object);
|
|
222
|
-
if (prototype === null || prototype === Object.prototype) {
|
|
223
|
-
const numKeys = Object.keys(object).length;
|
|
224
|
-
if (numKeys < FOUR_BITS) { // fixarray
|
|
225
|
-
byteParts.push(new Uint8Array([0x80 | numKeys]));
|
|
226
|
-
}
|
|
227
|
-
else if (numKeys < SIXTEEN_BITS) { // map 16
|
|
228
|
-
const dataView = new DataView(new ArrayBuffer(3));
|
|
229
|
-
dataView.setUint16(1, numKeys);
|
|
230
|
-
dataView.setUint8(0, 0xde);
|
|
231
|
-
byteParts.push(new Uint8Array(dataView.buffer));
|
|
232
|
-
}
|
|
233
|
-
else if (numKeys < THIRTY_TWO_BITS) { // map 32
|
|
234
|
-
const dataView = new DataView(new ArrayBuffer(5));
|
|
235
|
-
dataView.setUint32(1, numKeys);
|
|
236
|
-
dataView.setUint8(0, 0xdf);
|
|
237
|
-
byteParts.push(new Uint8Array(dataView.buffer));
|
|
238
|
-
}
|
|
239
|
-
else {
|
|
240
|
-
throw new Error("Cannot safely encode map with size larger than 32 bits");
|
|
241
|
-
}
|
|
242
|
-
for (const [key, value] of Object.entries(object)) {
|
|
243
|
-
encodeSlice(key, byteParts);
|
|
244
|
-
encodeSlice(value, byteParts);
|
|
245
|
-
}
|
|
246
|
-
return;
|
|
247
|
-
}
|
|
248
|
-
throw new Error("Cannot safely encode value into messagepack");
|
|
249
|
-
}
|
|
250
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"_ethers.d.ts","sourceRoot":"","sources":["../../../src/src/signing/_ethers.ts"],"names":[],"mappings":"AAAA,sGAAsG;AACtG,MAAM,WAAW,oBAAoB;IACjC,aAAa,CACT,MAAM,EAAE;QACJ,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,EAAE,MAAM,CAAC;QAChB,OAAO,EAAE,MAAM,CAAC;QAChB,iBAAiB,EAAE,MAAM,CAAC;KAC7B,EACD,KAAK,EAAE;QACH,CAAC,GAAG,EAAE,MAAM,GAAG;YACX,IAAI,EAAE,MAAM,CAAC;YACb,IAAI,EAAE,MAAM,CAAC;SAChB,EAAE,CAAC;KACP,EACD,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC/B,OAAO,CAAC,MAAM,CAAC,CAAC;CACtB;AAED,+FAA+F;AAC/F,MAAM,WAAW,sBAAsB;IACnC,cAAc,CACV,MAAM,EAAE;QACJ,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,EAAE,MAAM,CAAC;QAChB,OAAO,EAAE,MAAM,CAAC;QAChB,iBAAiB,EAAE,MAAM,CAAC;KAC7B,EACD,KAAK,EAAE;QACH,CAAC,GAAG,EAAE,MAAM,GAAG;YACX,IAAI,EAAE,MAAM,CAAC;YACb,IAAI,EAAE,MAAM,CAAC;SAChB,EAAE,CAAC;KACP,EACD,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC/B,OAAO,CAAC,MAAM,CAAC,CAAC;CACtB;AAED,8DAA8D;AAC9D,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,IAAI,oBAAoB,CAItF;AAED,iEAAiE;AACjE,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,IAAI,sBAAsB,CAI1F"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
(function (factory) {
|
|
2
|
-
if (typeof module === "object" && typeof module.exports === "object") {
|
|
3
|
-
var v = factory(require, exports);
|
|
4
|
-
if (v !== undefined) module.exports = v;
|
|
5
|
-
}
|
|
6
|
-
else if (typeof define === "function" && define.amd) {
|
|
7
|
-
define(["require", "exports"], factory);
|
|
8
|
-
}
|
|
9
|
-
})(function (require, exports) {
|
|
10
|
-
"use strict";
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.isAbstractEthersSigner = isAbstractEthersSigner;
|
|
13
|
-
exports.isAbstractEthersV5Signer = isAbstractEthersV5Signer;
|
|
14
|
-
/** Checks if the given value is an abstract ethers signer. */
|
|
15
|
-
function isAbstractEthersSigner(client) {
|
|
16
|
-
return typeof client === "object" && client !== null &&
|
|
17
|
-
"signTypedData" in client && typeof client.signTypedData === "function" &&
|
|
18
|
-
client.signTypedData.length === 3;
|
|
19
|
-
}
|
|
20
|
-
/** Checks if the given value is an abstract ethers v5 signer. */
|
|
21
|
-
function isAbstractEthersV5Signer(client) {
|
|
22
|
-
return typeof client === "object" && client !== null &&
|
|
23
|
-
"_signTypedData" in client && typeof client._signTypedData === "function" &&
|
|
24
|
-
client._signTypedData.length === 3;
|
|
25
|
-
}
|
|
26
|
-
});
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import type { Hex } from "../base.js";
|
|
2
|
-
/** Signs typed data (EIP-712) with a private key. */
|
|
3
|
-
export declare function signTypedDataWithPrivateKey(args: {
|
|
4
|
-
privateKey: string;
|
|
5
|
-
domain: {
|
|
6
|
-
name: string;
|
|
7
|
-
version: string;
|
|
8
|
-
chainId: number;
|
|
9
|
-
verifyingContract: Hex;
|
|
10
|
-
};
|
|
11
|
-
types: {
|
|
12
|
-
[key: string]: {
|
|
13
|
-
name: string;
|
|
14
|
-
type: string;
|
|
15
|
-
}[];
|
|
16
|
-
};
|
|
17
|
-
primaryType: string;
|
|
18
|
-
message: Record<string, unknown>;
|
|
19
|
-
}): Promise<Hex>;
|
|
20
|
-
/** Validates if a string is a valid secp256k1 private key. */
|
|
21
|
-
export declare function isValidPrivateKey(privateKey: unknown): privateKey is string;
|
|
22
|
-
//# sourceMappingURL=_private_key.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"_private_key.d.ts","sourceRoot":"","sources":["../../../src/src/signing/_private_key.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAEtC,qDAAqD;AACrD,wBAAsB,2BAA2B,CAAC,IAAI,EAAE;IACpD,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE;QACJ,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,EAAE,MAAM,CAAC;QAChB,OAAO,EAAE,MAAM,CAAC;QAChB,iBAAiB,EAAE,GAAG,CAAC;KAC1B,CAAC;IACF,KAAK,EAAE;QACH,CAAC,GAAG,EAAE,MAAM,GAAG;YACX,IAAI,EAAE,MAAM,CAAC;YACb,IAAI,EAAE,MAAM,CAAC;SAChB,EAAE,CAAC;KACP,CAAC;IACF,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACpC,GAAG,OAAO,CAAC,GAAG,CAAC,CAiCf;AA8GD,8DAA8D;AAC9D,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,OAAO,GAAG,UAAU,IAAI,MAAM,CAQ3E"}
|