@coinbase/cdp-core 0.0.18 → 0.0.20
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 +13 -5
- package/dist/esm/index.js +24 -21
- package/dist/esm/index103.js +1 -1
- package/dist/esm/index13.js +9 -3
- package/dist/esm/index15.js +8 -8
- package/dist/esm/index16.js +2 -2
- package/dist/esm/index17.js +158 -39
- package/dist/esm/index18.js +47 -16
- package/dist/esm/index19.js +152 -4
- package/dist/esm/index2.js +138 -124
- package/dist/esm/index20.js +56 -5
- package/dist/esm/index21.js +39 -158
- package/dist/esm/index22.js +16 -47
- package/dist/esm/index23.js +4 -152
- package/dist/esm/index24.js +5 -56
- package/dist/esm/index25.js +12 -8
- package/dist/esm/index26.js +11 -17
- package/dist/esm/index27.js +8 -45
- package/dist/esm/index28.js +17 -13
- package/dist/esm/index29.js +40 -50
- package/dist/esm/index3.js +4 -4
- package/dist/esm/index30.js +13 -6
- package/dist/esm/index31.js +54 -20
- package/dist/esm/index32.js +6 -11
- package/dist/esm/index33.js +21 -3
- package/dist/esm/index34.js +3 -3
- package/dist/esm/index35.js +3 -34
- package/dist/esm/index36.js +32 -10
- package/dist/esm/index37.js +12 -4
- package/dist/esm/index38.js +4 -28
- package/dist/esm/index39.js +28 -6
- package/dist/esm/index40.js +6 -24
- package/dist/esm/index41.js +24 -16
- package/dist/esm/index42.js +16 -54
- package/dist/esm/index43.js +53 -22
- package/dist/esm/index44.js +23 -11
- package/dist/esm/index45.js +10 -26
- package/dist/esm/index46.js +26 -41
- package/dist/esm/index47.js +41 -54
- package/dist/esm/index48.js +54 -126
- package/dist/esm/index49.js +126 -11
- package/dist/esm/index50.js +9 -101
- package/dist/esm/index51.js +104 -6
- package/dist/esm/index52.js +7 -3
- package/dist/esm/index53.js +3 -15
- package/dist/esm/index54.js +14 -42
- package/dist/esm/index55.js +38 -74
- package/dist/esm/index56.js +79 -2
- package/dist/esm/index57.js +2 -2
- package/dist/esm/index58.js +2 -13
- package/dist/esm/index59.js +2 -2
- package/dist/esm/index6.js +4 -4
- package/dist/esm/index60.js +1 -1
- package/dist/esm/index61.js +1 -1
- package/dist/esm/index62.js +2 -2
- package/dist/esm/index63.js +2 -2
- package/dist/esm/index64.js +1 -1
- package/dist/esm/index65.js +1 -1
- package/dist/esm/index66.js +3 -3
- package/dist/esm/index70.js +1 -1
- package/dist/esm/index72.js +4 -4
- package/dist/esm/index73.js +104 -2
- package/dist/esm/index74.js +75 -17
- package/dist/esm/index75.js +80 -20
- package/dist/esm/index76.js +2 -80
- package/dist/esm/index77.js +17 -100
- package/dist/esm/index78.js +18 -31
- package/dist/esm/index79.js +32 -6
- package/dist/esm/index80.js +6 -78
- package/dist/esm/index81.js +10 -55
- package/dist/esm/index82.js +54 -10
- package/dist/esm/index83.js +11 -2
- package/dist/esm/index84.js +2 -45
- package/dist/esm/index85.js +44 -13
- package/dist/esm/index86.js +13 -9
- package/dist/esm/index88.js +12 -20
- package/dist/esm/index89.js +35 -9
- package/dist/esm/index90.js +41 -19
- package/dist/esm/index91.js +20 -93
- package/dist/esm/index92.js +9 -20
- package/dist/esm/index93.js +16 -114
- package/dist/esm/index94.js +92 -11
- package/dist/esm/index95.js +20 -35
- package/dist/esm/index96.js +117 -41
- package/dist/types/index.d.ts +32 -2
- package/package.json +3 -3
package/dist/esm/index53.js
CHANGED
|
@@ -1,17 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
if (e.type)
|
|
4
|
-
return e.type;
|
|
5
|
-
if (typeof e.authorizationList < "u")
|
|
6
|
-
return "eip7702";
|
|
7
|
-
if (typeof e.blobs < "u" || typeof e.blobVersionedHashes < "u" || typeof e.maxFeePerBlobGas < "u" || typeof e.sidecars < "u")
|
|
8
|
-
return "eip4844";
|
|
9
|
-
if (typeof e.maxFeePerGas < "u" || typeof e.maxPriorityFeePerGas < "u")
|
|
10
|
-
return "eip1559";
|
|
11
|
-
if (typeof e.gasPrice < "u")
|
|
12
|
-
return typeof e.accessList < "u" ? "eip2930" : "legacy";
|
|
13
|
-
throw new f({ transaction: e });
|
|
14
|
-
}
|
|
1
|
+
import { sha256 as s } from "./index73.js";
|
|
2
|
+
const o = s;
|
|
15
3
|
export {
|
|
16
|
-
|
|
4
|
+
o as sha256
|
|
17
5
|
};
|
package/dist/esm/index54.js
CHANGED
|
@@ -1,45 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
function
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}
|
|
14
|
-
class d extends t {
|
|
15
|
-
constructor({ transaction: r }) {
|
|
16
|
-
super("Cannot infer a transaction type from provided transaction.", {
|
|
17
|
-
metaMessages: [
|
|
18
|
-
"Provided Transaction:",
|
|
19
|
-
"{",
|
|
20
|
-
i(r),
|
|
21
|
-
"}",
|
|
22
|
-
"",
|
|
23
|
-
"To infer the type, either provide:",
|
|
24
|
-
"- a `type` to the Transaction, or",
|
|
25
|
-
"- an EIP-1559 Transaction with `maxFeePerGas`, or",
|
|
26
|
-
"- an EIP-2930 Transaction with `gasPrice` & `accessList`, or",
|
|
27
|
-
"- an EIP-4844 Transaction with `blobs`, `blobVersionedHashes`, `sidecars`, or",
|
|
28
|
-
"- an EIP-7702 Transaction with `authorizationList`, or",
|
|
29
|
-
"- a Legacy Transaction with `gasPrice`"
|
|
30
|
-
],
|
|
31
|
-
name: "InvalidSerializableTransactionError"
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
class l extends t {
|
|
36
|
-
constructor({ storageKey: r }) {
|
|
37
|
-
super(`Size for storage key "${r}" is invalid. Expected 32 bytes. Got ${Math.floor((r.length - 2) / 2)} bytes.`, { name: "InvalidStorageKeySizeError" });
|
|
38
|
-
}
|
|
1
|
+
import { InvalidSerializableTransactionError as f } from "./index55.js";
|
|
2
|
+
function d(e) {
|
|
3
|
+
if (e.type)
|
|
4
|
+
return e.type;
|
|
5
|
+
if (typeof e.authorizationList < "u")
|
|
6
|
+
return "eip7702";
|
|
7
|
+
if (typeof e.blobs < "u" || typeof e.blobVersionedHashes < "u" || typeof e.maxFeePerBlobGas < "u" || typeof e.sidecars < "u")
|
|
8
|
+
return "eip4844";
|
|
9
|
+
if (typeof e.maxFeePerGas < "u" || typeof e.maxPriorityFeePerGas < "u")
|
|
10
|
+
return "eip1559";
|
|
11
|
+
if (typeof e.gasPrice < "u")
|
|
12
|
+
return typeof e.accessList < "u" ? "eip2930" : "legacy";
|
|
13
|
+
throw new f({ transaction: e });
|
|
39
14
|
}
|
|
40
15
|
export {
|
|
41
|
-
|
|
42
|
-
d as InvalidSerializableTransactionError,
|
|
43
|
-
l as InvalidStorageKeySizeError,
|
|
44
|
-
i as prettyPrint
|
|
16
|
+
d as getTransactionType
|
|
45
17
|
};
|
package/dist/esm/index55.js
CHANGED
|
@@ -1,81 +1,45 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import { InvalidChainIdError as n } from "./index60.js";
|
|
7
|
-
import { FeeCapTooHighError as w, TipAboveFeeCapError as E } from "./index61.js";
|
|
8
|
-
import { isAddress as f } from "./index32.js";
|
|
9
|
-
import { size as F } from "./index37.js";
|
|
10
|
-
import { slice as I } from "./index38.js";
|
|
11
|
-
import { hexToNumber as G } from "./index43.js";
|
|
12
|
-
function C(t) {
|
|
13
|
-
const { authorizationList: e } = t;
|
|
14
|
-
if (e)
|
|
15
|
-
for (const o of e) {
|
|
16
|
-
const { chainId: r } = o, i = o.address;
|
|
17
|
-
if (!f(i))
|
|
18
|
-
throw new s({ address: i });
|
|
19
|
-
if (r < 0)
|
|
20
|
-
throw new n({ chainId: r });
|
|
21
|
-
}
|
|
22
|
-
d(t);
|
|
1
|
+
import { BaseError as t } from "./index48.js";
|
|
2
|
+
function i(n) {
|
|
3
|
+
const r = Object.entries(n).map(([a, e]) => e === void 0 || e === !1 ? null : [a, e]).filter(Boolean), o = r.reduce((a, [e]) => Math.max(a, e.length), 0);
|
|
4
|
+
return r.map(([a, e]) => ` ${`${a}:`.padEnd(o + 1)} ${e}`).join(`
|
|
5
|
+
`);
|
|
23
6
|
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
for (const o of e) {
|
|
30
|
-
const r = F(o), i = G(I(o, 0, 1));
|
|
31
|
-
if (r !== 32)
|
|
32
|
-
throw new p({ hash: o, size: r });
|
|
33
|
-
if (i !== c)
|
|
34
|
-
throw new x({
|
|
35
|
-
hash: o,
|
|
36
|
-
version: i
|
|
37
|
-
});
|
|
38
|
-
}
|
|
7
|
+
class c extends t {
|
|
8
|
+
constructor({ v: r }) {
|
|
9
|
+
super(`Invalid \`v\` value "${r}". Expected 27 or 28.`, {
|
|
10
|
+
name: "InvalidLegacyVError"
|
|
11
|
+
});
|
|
39
12
|
}
|
|
40
|
-
d(t);
|
|
41
13
|
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
throw new w({ maxFeePerGas: r });
|
|
14
|
+
class d extends t {
|
|
15
|
+
constructor({ transaction: r }) {
|
|
16
|
+
super("Cannot infer a transaction type from provided transaction.", {
|
|
17
|
+
metaMessages: [
|
|
18
|
+
"Provided Transaction:",
|
|
19
|
+
"{",
|
|
20
|
+
i(r),
|
|
21
|
+
"}",
|
|
22
|
+
"",
|
|
23
|
+
"To infer the type, either provide:",
|
|
24
|
+
"- a `type` to the Transaction, or",
|
|
25
|
+
"- an EIP-1559 Transaction with `maxFeePerGas`, or",
|
|
26
|
+
"- an EIP-2930 Transaction with `gasPrice` & `accessList`, or",
|
|
27
|
+
"- an EIP-4844 Transaction with `blobs`, `blobVersionedHashes`, `sidecars`, or",
|
|
28
|
+
"- an EIP-7702 Transaction with `authorizationList`, or",
|
|
29
|
+
"- a Legacy Transaction with `gasPrice`"
|
|
30
|
+
],
|
|
31
|
+
name: "InvalidSerializableTransactionError"
|
|
32
|
+
});
|
|
33
|
+
}
|
|
63
34
|
}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
if (typeof e < "u" && e <= 0)
|
|
69
|
-
throw new n({ chainId: e });
|
|
70
|
-
if (o || i)
|
|
71
|
-
throw new h("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid Legacy Transaction attribute.");
|
|
72
|
-
if (r && r > m)
|
|
73
|
-
throw new w({ maxFeePerGas: r });
|
|
35
|
+
class l extends t {
|
|
36
|
+
constructor({ storageKey: r }) {
|
|
37
|
+
super(`Size for storage key "${r}" is invalid. Expected 32 bytes. Got ${Math.floor((r.length - 2) / 2)} bytes.`, { name: "InvalidStorageKeySizeError" });
|
|
38
|
+
}
|
|
74
39
|
}
|
|
75
40
|
export {
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
K as assertTransactionLegacy
|
|
41
|
+
c as InvalidLegacyVError,
|
|
42
|
+
d as InvalidSerializableTransactionError,
|
|
43
|
+
l as InvalidStorageKeySizeError,
|
|
44
|
+
i as prettyPrint
|
|
81
45
|
};
|
package/dist/esm/index56.js
CHANGED
|
@@ -1,4 +1,81 @@
|
|
|
1
|
-
|
|
1
|
+
import { versionedHashVersionKzg as c } from "./index57.js";
|
|
2
|
+
import { maxUint256 as m } from "./index58.js";
|
|
3
|
+
import { InvalidAddressError as s } from "./index25.js";
|
|
4
|
+
import { BaseError as h } from "./index48.js";
|
|
5
|
+
import { EmptyBlobError as P, InvalidVersionedHashSizeError as p, InvalidVersionedHashVersionError as x } from "./index59.js";
|
|
6
|
+
import { InvalidChainIdError as n } from "./index60.js";
|
|
7
|
+
import { FeeCapTooHighError as w, TipAboveFeeCapError as E } from "./index61.js";
|
|
8
|
+
import { isAddress as f } from "./index26.js";
|
|
9
|
+
import { size as F } from "./index38.js";
|
|
10
|
+
import { slice as I } from "./index39.js";
|
|
11
|
+
import { hexToNumber as G } from "./index44.js";
|
|
12
|
+
function C(t) {
|
|
13
|
+
const { authorizationList: e } = t;
|
|
14
|
+
if (e)
|
|
15
|
+
for (const o of e) {
|
|
16
|
+
const { chainId: r } = o, i = o.address;
|
|
17
|
+
if (!f(i))
|
|
18
|
+
throw new s({ address: i });
|
|
19
|
+
if (r < 0)
|
|
20
|
+
throw new n({ chainId: r });
|
|
21
|
+
}
|
|
22
|
+
d(t);
|
|
23
|
+
}
|
|
24
|
+
function L(t) {
|
|
25
|
+
const { blobVersionedHashes: e } = t;
|
|
26
|
+
if (e) {
|
|
27
|
+
if (e.length === 0)
|
|
28
|
+
throw new P();
|
|
29
|
+
for (const o of e) {
|
|
30
|
+
const r = F(o), i = G(I(o, 0, 1));
|
|
31
|
+
if (r !== 32)
|
|
32
|
+
throw new p({ hash: o, size: r });
|
|
33
|
+
if (i !== c)
|
|
34
|
+
throw new x({
|
|
35
|
+
hash: o,
|
|
36
|
+
version: i
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
d(t);
|
|
41
|
+
}
|
|
42
|
+
function d(t) {
|
|
43
|
+
const { chainId: e, maxPriorityFeePerGas: o, maxFeePerGas: r, to: i } = t;
|
|
44
|
+
if (e <= 0)
|
|
45
|
+
throw new n({ chainId: e });
|
|
46
|
+
if (i && !f(i))
|
|
47
|
+
throw new s({ address: i });
|
|
48
|
+
if (r && r > m)
|
|
49
|
+
throw new w({ maxFeePerGas: r });
|
|
50
|
+
if (o && r && o > r)
|
|
51
|
+
throw new E({ maxFeePerGas: r, maxPriorityFeePerGas: o });
|
|
52
|
+
}
|
|
53
|
+
function B(t) {
|
|
54
|
+
const { chainId: e, maxPriorityFeePerGas: o, gasPrice: r, maxFeePerGas: i, to: a } = t;
|
|
55
|
+
if (e <= 0)
|
|
56
|
+
throw new n({ chainId: e });
|
|
57
|
+
if (a && !f(a))
|
|
58
|
+
throw new s({ address: a });
|
|
59
|
+
if (o || i)
|
|
60
|
+
throw new h("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid EIP-2930 Transaction attribute.");
|
|
61
|
+
if (r && r > m)
|
|
62
|
+
throw new w({ maxFeePerGas: r });
|
|
63
|
+
}
|
|
64
|
+
function K(t) {
|
|
65
|
+
const { chainId: e, maxPriorityFeePerGas: o, gasPrice: r, maxFeePerGas: i, to: a } = t;
|
|
66
|
+
if (a && !f(a))
|
|
67
|
+
throw new s({ address: a });
|
|
68
|
+
if (typeof e < "u" && e <= 0)
|
|
69
|
+
throw new n({ chainId: e });
|
|
70
|
+
if (o || i)
|
|
71
|
+
throw new h("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid Legacy Transaction attribute.");
|
|
72
|
+
if (r && r > m)
|
|
73
|
+
throw new w({ maxFeePerGas: r });
|
|
74
|
+
}
|
|
2
75
|
export {
|
|
3
|
-
|
|
76
|
+
d as assertTransactionEIP1559,
|
|
77
|
+
B as assertTransactionEIP2930,
|
|
78
|
+
L as assertTransactionEIP4844,
|
|
79
|
+
C as assertTransactionEIP7702,
|
|
80
|
+
K as assertTransactionLegacy
|
|
4
81
|
};
|
package/dist/esm/index57.js
CHANGED
package/dist/esm/index58.js
CHANGED
|
@@ -1,15 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
class d extends r {
|
|
3
|
-
constructor({ address: s }) {
|
|
4
|
-
super(`Address "${s}" is invalid.`, {
|
|
5
|
-
metaMessages: [
|
|
6
|
-
"- Address must be a hex value of 20 bytes (40 hex characters).",
|
|
7
|
-
"- Address must match its checksum counterpart."
|
|
8
|
-
],
|
|
9
|
-
name: "InvalidAddressError"
|
|
10
|
-
});
|
|
11
|
-
}
|
|
12
|
-
}
|
|
1
|
+
const n = 2n ** 256n - 1n;
|
|
13
2
|
export {
|
|
14
|
-
|
|
3
|
+
n as maxUint256
|
|
15
4
|
};
|
package/dist/esm/index59.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { versionedHashVersionKzg as a } from "./
|
|
2
|
-
import { BaseError as s } from "./
|
|
1
|
+
import { versionedHashVersionKzg as a } from "./index57.js";
|
|
2
|
+
import { BaseError as s } from "./index48.js";
|
|
3
3
|
class t extends s {
|
|
4
4
|
constructor({ maxSize: e, size: r }) {
|
|
5
5
|
super("Blob size is too large.", {
|
package/dist/esm/index6.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { logOutEndUser as h, refreshAccessToken as l, registerTemporaryWalletSecret as c } from "@coinbase/cdp-api-client";
|
|
2
|
-
import { SignJWT as o } from "./
|
|
2
|
+
import { SignJWT as o } from "./index21.js";
|
|
3
3
|
import "viem";
|
|
4
4
|
import { toAuthState as u } from "./index7.js";
|
|
5
|
-
import { createKeyPair as S } from "./
|
|
6
|
-
import { generateRandomId as i } from "./
|
|
7
|
-
import { hash as w } from "./
|
|
5
|
+
import { createKeyPair as S } from "./index22.js";
|
|
6
|
+
import { generateRandomId as i } from "./index23.js";
|
|
7
|
+
import { hash as w } from "./index24.js";
|
|
8
8
|
import { sortKeys as f } from "./index13.js";
|
|
9
9
|
const n = 60 * 1e3;
|
|
10
10
|
class C {
|
package/dist/esm/index60.js
CHANGED
package/dist/esm/index61.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { formatGwei as a } from "./index67.js";
|
|
2
|
-
import { BaseError as o } from "./
|
|
2
|
+
import { BaseError as o } from "./index48.js";
|
|
3
3
|
class n extends o {
|
|
4
4
|
constructor({ cause: r, maxFeePerGas: e } = {}) {
|
|
5
5
|
super(`The fee cap (\`maxFeePerGas\`${e ? ` = ${a(e)} gwei` : ""}) cannot be higher than the maximum allowed value (2^256-1).`, {
|
package/dist/esm/index62.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { hexToBytes as i } from "./
|
|
2
|
-
import { bytesToHex as f } from "./
|
|
1
|
+
import { hexToBytes as i } from "./index31.js";
|
|
2
|
+
import { bytesToHex as f } from "./index29.js";
|
|
3
3
|
function y(o) {
|
|
4
4
|
const { kzg: s } = o, n = o.to ?? (typeof o.blobs[0] == "string" ? "hex" : "bytes"), m = typeof o.blobs[0] == "string" ? o.blobs.map((t) => i(t)) : o.blobs, b = [];
|
|
5
5
|
for (const t of m)
|
package/dist/esm/index63.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { hexToBytes as b } from "./
|
|
2
|
-
import { bytesToHex as y } from "./
|
|
1
|
+
import { hexToBytes as b } from "./index31.js";
|
|
2
|
+
import { bytesToHex as y } from "./index29.js";
|
|
3
3
|
function h(t) {
|
|
4
4
|
const { kzg: m } = t, c = t.to ?? (typeof t.blobs[0] == "string" ? "hex" : "bytes"), s = typeof t.blobs[0] == "string" ? t.blobs.map((o) => b(o)) : t.blobs, i = typeof t.commitments[0] == "string" ? t.commitments.map((o) => b(o)) : t.commitments, n = [];
|
|
5
5
|
for (let o = 0; o < s.length; o++) {
|
package/dist/esm/index64.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { commitmentToVersionedHash as i } from "./
|
|
1
|
+
import { commitmentToVersionedHash as i } from "./index80.js";
|
|
2
2
|
function r(o) {
|
|
3
3
|
const { commitments: t, version: n } = o, e = o.to ?? (typeof t[0] == "string" ? "hex" : "bytes"), s = [];
|
|
4
4
|
for (const m of t)
|
package/dist/esm/index65.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { blobsToCommitments as f } from "./index62.js";
|
|
2
2
|
import { blobsToProofs as l } from "./index63.js";
|
|
3
|
-
import { toBlobs as p } from "./
|
|
3
|
+
import { toBlobs as p } from "./index79.js";
|
|
4
4
|
function k(t) {
|
|
5
5
|
const { data: i, kzg: n, to: m } = t, s = t.blobs ?? p({ data: i, to: m }), b = t.commitments ?? f({ blobs: s, kzg: n, to: m }), r = t.proofs ?? l({ blobs: s, commitments: b, kzg: n, to: m }), c = [];
|
|
6
6
|
for (let o = 0; o < s.length; o++)
|
package/dist/esm/index66.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { InvalidAddressError as s } from "./
|
|
2
|
-
import { InvalidStorageKeySizeError as l } from "./
|
|
3
|
-
import { isAddress as f } from "./
|
|
1
|
+
import { InvalidAddressError as s } from "./index25.js";
|
|
2
|
+
import { InvalidStorageKeySizeError as l } from "./index55.js";
|
|
3
|
+
import { isAddress as f } from "./index26.js";
|
|
4
4
|
function a(r) {
|
|
5
5
|
if (!r || r.length === 0)
|
|
6
6
|
return [];
|
package/dist/esm/index70.js
CHANGED
package/dist/esm/index72.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { encoder as n } from "./
|
|
2
|
-
import e from "./
|
|
3
|
-
import i from "./
|
|
4
|
-
import o from "./
|
|
1
|
+
import { encoder as n } from "./index83.js";
|
|
2
|
+
import e from "./index84.js";
|
|
3
|
+
import i from "./index85.js";
|
|
4
|
+
import o from "./index86.js";
|
|
5
5
|
function s(r, t) {
|
|
6
6
|
if (!Number.isFinite(t))
|
|
7
7
|
throw new TypeError(`Invalid ${r} input`);
|
package/dist/esm/index73.js
CHANGED
|
@@ -1,4 +1,106 @@
|
|
|
1
|
-
|
|
1
|
+
import { HashMD as D, SHA256_IV as b, Chi as g, Maj as p } from "./index74.js";
|
|
2
|
+
import { createHasher as u, clean as C, rotr as i } from "./index75.js";
|
|
3
|
+
const B = /* @__PURE__ */ Uint32Array.from([
|
|
4
|
+
1116352408,
|
|
5
|
+
1899447441,
|
|
6
|
+
3049323471,
|
|
7
|
+
3921009573,
|
|
8
|
+
961987163,
|
|
9
|
+
1508970993,
|
|
10
|
+
2453635748,
|
|
11
|
+
2870763221,
|
|
12
|
+
3624381080,
|
|
13
|
+
310598401,
|
|
14
|
+
607225278,
|
|
15
|
+
1426881987,
|
|
16
|
+
1925078388,
|
|
17
|
+
2162078206,
|
|
18
|
+
2614888103,
|
|
19
|
+
3248222580,
|
|
20
|
+
3835390401,
|
|
21
|
+
4022224774,
|
|
22
|
+
264347078,
|
|
23
|
+
604807628,
|
|
24
|
+
770255983,
|
|
25
|
+
1249150122,
|
|
26
|
+
1555081692,
|
|
27
|
+
1996064986,
|
|
28
|
+
2554220882,
|
|
29
|
+
2821834349,
|
|
30
|
+
2952996808,
|
|
31
|
+
3210313671,
|
|
32
|
+
3336571891,
|
|
33
|
+
3584528711,
|
|
34
|
+
113926993,
|
|
35
|
+
338241895,
|
|
36
|
+
666307205,
|
|
37
|
+
773529912,
|
|
38
|
+
1294757372,
|
|
39
|
+
1396182291,
|
|
40
|
+
1695183700,
|
|
41
|
+
1986661051,
|
|
42
|
+
2177026350,
|
|
43
|
+
2456956037,
|
|
44
|
+
2730485921,
|
|
45
|
+
2820302411,
|
|
46
|
+
3259730800,
|
|
47
|
+
3345764771,
|
|
48
|
+
3516065817,
|
|
49
|
+
3600352804,
|
|
50
|
+
4094571909,
|
|
51
|
+
275423344,
|
|
52
|
+
430227734,
|
|
53
|
+
506948616,
|
|
54
|
+
659060556,
|
|
55
|
+
883997877,
|
|
56
|
+
958139571,
|
|
57
|
+
1322822218,
|
|
58
|
+
1537002063,
|
|
59
|
+
1747873779,
|
|
60
|
+
1955562222,
|
|
61
|
+
2024104815,
|
|
62
|
+
2227730452,
|
|
63
|
+
2361852424,
|
|
64
|
+
2428436474,
|
|
65
|
+
2756734187,
|
|
66
|
+
3204031479,
|
|
67
|
+
3329325298
|
|
68
|
+
]), h = /* @__PURE__ */ new Uint32Array(64);
|
|
69
|
+
class E extends D {
|
|
70
|
+
constructor(o = 32) {
|
|
71
|
+
super(64, o, 8, !1), this.A = b[0] | 0, this.B = b[1] | 0, this.C = b[2] | 0, this.D = b[3] | 0, this.E = b[4] | 0, this.F = b[5] | 0, this.G = b[6] | 0, this.H = b[7] | 0;
|
|
72
|
+
}
|
|
73
|
+
get() {
|
|
74
|
+
const { A: o, B: r, C: t, D: s, E: a, F: f, G: c, H: e } = this;
|
|
75
|
+
return [o, r, t, s, a, f, c, e];
|
|
76
|
+
}
|
|
77
|
+
// prettier-ignore
|
|
78
|
+
set(o, r, t, s, a, f, c, e) {
|
|
79
|
+
this.A = o | 0, this.B = r | 0, this.C = t | 0, this.D = s | 0, this.E = a | 0, this.F = f | 0, this.G = c | 0, this.H = e | 0;
|
|
80
|
+
}
|
|
81
|
+
process(o, r) {
|
|
82
|
+
for (let x = 0; x < 16; x++, r += 4)
|
|
83
|
+
h[x] = o.getUint32(r, !1);
|
|
84
|
+
for (let x = 16; x < 64; x++) {
|
|
85
|
+
const H = h[x - 15], d = h[x - 2], m = i(H, 7) ^ i(H, 18) ^ H >>> 3, l = i(d, 17) ^ i(d, 19) ^ d >>> 10;
|
|
86
|
+
h[x] = l + h[x - 7] + m + h[x - 16] | 0;
|
|
87
|
+
}
|
|
88
|
+
let { A: t, B: s, C: a, D: f, E: c, F: e, G: n, H: A } = this;
|
|
89
|
+
for (let x = 0; x < 64; x++) {
|
|
90
|
+
const H = i(c, 6) ^ i(c, 11) ^ i(c, 25), d = A + H + g(c, e, n) + B[x] + h[x] | 0, l = (i(t, 2) ^ i(t, 13) ^ i(t, 22)) + p(t, s, a) | 0;
|
|
91
|
+
A = n, n = e, e = c, c = f + d | 0, f = a, a = s, s = t, t = d + l | 0;
|
|
92
|
+
}
|
|
93
|
+
t = t + this.A | 0, s = s + this.B | 0, a = a + this.C | 0, f = f + this.D | 0, c = c + this.E | 0, e = e + this.F | 0, n = n + this.G | 0, A = A + this.H | 0, this.set(t, s, a, f, c, e, n, A);
|
|
94
|
+
}
|
|
95
|
+
roundClean() {
|
|
96
|
+
C(h);
|
|
97
|
+
}
|
|
98
|
+
destroy() {
|
|
99
|
+
this.set(0, 0, 0, 0, 0, 0, 0, 0), C(this.buffer);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
const y = /* @__PURE__ */ u(() => new E());
|
|
2
103
|
export {
|
|
3
|
-
|
|
104
|
+
E as SHA256,
|
|
105
|
+
y as sha256
|
|
4
106
|
};
|
package/dist/esm/index74.js
CHANGED
|
@@ -1,23 +1,81 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
1
|
+
import { Hash as g, createView as l, aexists as b, toBytes as a, abytes as d, aoutput as x, clean as w } from "./index75.js";
|
|
2
|
+
function y(o, t, s, n) {
|
|
3
|
+
if (typeof o.setBigUint64 == "function")
|
|
4
|
+
return o.setBigUint64(t, s, n);
|
|
5
|
+
const i = BigInt(32), h = BigInt(4294967295), e = Number(s >> i & h), r = Number(s & h), c = n ? 4 : 0, u = n ? 0 : 4;
|
|
6
|
+
o.setUint32(t + c, e, n), o.setUint32(t + u, r, n);
|
|
8
7
|
}
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
super(`Position \`${r}\` is out of bounds (\`0 < position < ${e}\`).`, { name: "PositionOutOfBoundsError" });
|
|
12
|
-
}
|
|
8
|
+
function U(o, t, s) {
|
|
9
|
+
return o & t ^ ~o & s;
|
|
13
10
|
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
11
|
+
function _(o, t, s) {
|
|
12
|
+
return o & t ^ o & s ^ t & s;
|
|
13
|
+
}
|
|
14
|
+
class m extends g {
|
|
15
|
+
constructor(t, s, n, i) {
|
|
16
|
+
super(), this.finished = !1, this.length = 0, this.pos = 0, this.destroyed = !1, this.blockLen = t, this.outputLen = s, this.padOffset = n, this.isLE = i, this.buffer = new Uint8Array(t), this.view = l(this.buffer);
|
|
17
|
+
}
|
|
18
|
+
update(t) {
|
|
19
|
+
b(this), t = a(t), d(t);
|
|
20
|
+
const { view: s, buffer: n, blockLen: i } = this, h = t.length;
|
|
21
|
+
for (let e = 0; e < h; ) {
|
|
22
|
+
const r = Math.min(i - this.pos, h - e);
|
|
23
|
+
if (r === i) {
|
|
24
|
+
const c = l(t);
|
|
25
|
+
for (; i <= h - e; e += i)
|
|
26
|
+
this.process(c, e);
|
|
27
|
+
continue;
|
|
28
|
+
}
|
|
29
|
+
n.set(t.subarray(e, e + r), this.pos), this.pos += r, e += r, this.pos === i && (this.process(s, 0), this.pos = 0);
|
|
30
|
+
}
|
|
31
|
+
return this.length += t.length, this.roundClean(), this;
|
|
32
|
+
}
|
|
33
|
+
digestInto(t) {
|
|
34
|
+
b(this), x(t, this), this.finished = !0;
|
|
35
|
+
const { buffer: s, view: n, blockLen: i, isLE: h } = this;
|
|
36
|
+
let { pos: e } = this;
|
|
37
|
+
s[e++] = 128, w(this.buffer.subarray(e)), this.padOffset > i - e && (this.process(n, 0), e = 0);
|
|
38
|
+
for (let f = e; f < i; f++)
|
|
39
|
+
s[f] = 0;
|
|
40
|
+
y(n, i - 8, BigInt(this.length * 8), h), this.process(n, 0);
|
|
41
|
+
const r = l(t), c = this.outputLen;
|
|
42
|
+
if (c % 4)
|
|
43
|
+
throw new Error("_sha2: outputLen should be aligned to 32bit");
|
|
44
|
+
const u = c / 4, p = this.get();
|
|
45
|
+
if (u > p.length)
|
|
46
|
+
throw new Error("_sha2: outputLen bigger than state");
|
|
47
|
+
for (let f = 0; f < u; f++)
|
|
48
|
+
r.setUint32(4 * f, p[f], h);
|
|
49
|
+
}
|
|
50
|
+
digest() {
|
|
51
|
+
const { buffer: t, outputLen: s } = this;
|
|
52
|
+
this.digestInto(t);
|
|
53
|
+
const n = t.slice(0, s);
|
|
54
|
+
return this.destroy(), n;
|
|
55
|
+
}
|
|
56
|
+
_cloneInto(t) {
|
|
57
|
+
t || (t = new this.constructor()), t.set(...this.get());
|
|
58
|
+
const { blockLen: s, buffer: n, length: i, finished: h, destroyed: e, pos: r } = this;
|
|
59
|
+
return t.destroyed = e, t.finished = h, t.length = i, t.pos = r, i % s && t.buffer.set(n), t;
|
|
60
|
+
}
|
|
61
|
+
clone() {
|
|
62
|
+
return this._cloneInto();
|
|
17
63
|
}
|
|
18
64
|
}
|
|
65
|
+
const B = /* @__PURE__ */ Uint32Array.from([
|
|
66
|
+
1779033703,
|
|
67
|
+
3144134277,
|
|
68
|
+
1013904242,
|
|
69
|
+
2773480762,
|
|
70
|
+
1359893119,
|
|
71
|
+
2600822924,
|
|
72
|
+
528734635,
|
|
73
|
+
1541459225
|
|
74
|
+
]);
|
|
19
75
|
export {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
76
|
+
U as Chi,
|
|
77
|
+
m as HashMD,
|
|
78
|
+
_ as Maj,
|
|
79
|
+
B as SHA256_IV,
|
|
80
|
+
y as setBigUint64
|
|
23
81
|
};
|