@gardenfi/utils 2.1.0 → 2.1.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/dist/index100.cjs +1 -1
- package/dist/index100.js +3 -79
- package/dist/index101.cjs +1 -1
- package/dist/index101.js +10 -17
- package/dist/index102.cjs +1 -1
- package/dist/index102.js +19 -11
- package/dist/index103.cjs +1 -1
- package/dist/index103.js +8 -19
- package/dist/index104.cjs +1 -1
- package/dist/index104.js +16 -10
- package/dist/index105.cjs +1 -1
- package/dist/index105.js +638 -33
- package/dist/index106.cjs +1 -1
- package/dist/index106.js +173 -5
- package/dist/index107.cjs +1 -1
- package/dist/index107.js +12 -10
- package/dist/index108.cjs +1 -1
- package/dist/index108.js +128 -2
- package/dist/index109.cjs +2 -1
- package/dist/index109.js +3 -21
- package/dist/index110.cjs +1 -1
- package/dist/index110.js +2 -128
- package/dist/index111.cjs +1 -1
- package/dist/index111.js +2 -7
- package/dist/index112.cjs +1 -1
- package/dist/index112.js +38 -2
- package/dist/index113.cjs +1 -1
- package/dist/index113.js +34 -33
- package/dist/index114.cjs +1 -1
- package/dist/index114.js +5 -5
- package/dist/index115.cjs +1 -2
- package/dist/index115.js +11 -3
- package/dist/index116.cjs +1 -1
- package/dist/index116.js +6 -18
- package/dist/index117.cjs +1 -1
- package/dist/index117.js +15 -638
- package/dist/index118.cjs +1 -1
- package/dist/index118.js +5 -173
- package/dist/index15.cjs +1 -1
- package/dist/index15.js +2 -2
- package/dist/index18.cjs +1 -1
- package/dist/index18.js +11 -11
- package/dist/index19.cjs +1 -1
- package/dist/index19.js +9 -9
- package/dist/index20.cjs +1 -1
- package/dist/index20.js +18 -17
- package/dist/index21.cjs +16 -1
- package/dist/index21.js +112 -30
- package/dist/index22.cjs +1 -16
- package/dist/index22.js +30 -113
- package/dist/index23.cjs +1 -1
- package/dist/index23.js +41 -17
- package/dist/index24.cjs +1 -1
- package/dist/index24.js +44 -6
- package/dist/index25.cjs +1 -1
- package/dist/index25.js +24 -44
- package/dist/index26.cjs +1 -1
- package/dist/index26.js +6 -21
- package/dist/index27.cjs +1 -1
- package/dist/index27.js +13 -8
- package/dist/index28.cjs +1 -1
- package/dist/index28.js +15 -31
- package/dist/index29.cjs +1 -1
- package/dist/index29.js +5 -26
- package/dist/index30.cjs +1 -2
- package/dist/index30.js +13 -65
- package/dist/index31.cjs +1 -1
- package/dist/index31.js +10 -51
- package/dist/index32.cjs +1 -1
- package/dist/index32.js +12 -12
- package/dist/index33.cjs +1 -1
- package/dist/index33.js +11 -24
- package/dist/index34.cjs +1 -1
- package/dist/index34.js +13 -75
- package/dist/index35.cjs +1 -1
- package/dist/index35.js +2 -2
- package/dist/index36.cjs +1 -1
- package/dist/index36.js +55 -7
- package/dist/index37.cjs +1 -1
- package/dist/index37.js +16 -32
- package/dist/index38.cjs +1 -1
- package/dist/index38.js +5 -15
- package/dist/index39.cjs +1 -1
- package/dist/index39.js +9 -2
- package/dist/index40.cjs +1 -1
- package/dist/index40.js +171 -8
- package/dist/index41.cjs +1 -1
- package/dist/index41.js +102 -19
- package/dist/index42.cjs +1 -1
- package/dist/index42.js +21 -41
- package/dist/index43.cjs +1 -1
- package/dist/index43.js +17 -25
- package/dist/index44.cjs +1 -1
- package/dist/index44.js +7 -6
- package/dist/index45.cjs +1 -1
- package/dist/index45.js +20 -12
- package/dist/index46.cjs +1 -1
- package/dist/index46.js +8 -15
- package/dist/index47.cjs +1 -1
- package/dist/index47.js +31 -5
- package/dist/index48.cjs +1 -1
- package/dist/index48.js +26 -13
- package/dist/index49.cjs +2 -1
- package/dist/index49.js +65 -10
- package/dist/index50.cjs +1 -1
- package/dist/index50.js +51 -12
- package/dist/index51.cjs +1 -1
- package/dist/index51.js +12 -11
- package/dist/index52.cjs +1 -1
- package/dist/index52.js +24 -13
- package/dist/index53.cjs +1 -1
- package/dist/index53.js +75 -55
- package/dist/index54.cjs +1 -1
- package/dist/index54.js +7 -16
- package/dist/index55.cjs +1 -1
- package/dist/index55.js +32 -5
- package/dist/index56.cjs +1 -1
- package/dist/index56.js +15 -8
- package/dist/index57.cjs +1 -1
- package/dist/index57.js +2 -172
- package/dist/index58.cjs +1 -1
- package/dist/index58.js +7 -102
- package/dist/index59.cjs +1 -1
- package/dist/index59.js +20 -21
- package/dist/index60.cjs +1 -1
- package/dist/index60.js +38 -10
- package/dist/index61.cjs +1 -1
- package/dist/index61.js +32 -32
- package/dist/index62.cjs +1 -1
- package/dist/index62.js +69 -8
- package/dist/index63.cjs +1 -2
- package/dist/index63.js +110 -57
- package/dist/index64.cjs +1 -1
- package/dist/index64.js +68 -2
- package/dist/index65.cjs +1 -1
- package/dist/index65.js +2 -7
- package/dist/index66.cjs +1 -1
- package/dist/index66.js +16 -6
- package/dist/index67.cjs +1 -1
- package/dist/index67.js +223 -4
- package/dist/index68.cjs +1 -1
- package/dist/index68.js +230 -10
- package/dist/index69.cjs +1 -1
- package/dist/index69.js +12 -3
- package/dist/index70.cjs +1 -5
- package/dist/index70.js +29 -51
- package/dist/index71.cjs +2 -2
- package/dist/index71.js +57 -32
- package/dist/index72.cjs +1 -1
- package/dist/index72.js +21 -5
- package/dist/index73.cjs +1 -1
- package/dist/index73.js +18 -21
- package/dist/index74.cjs +1 -1
- package/dist/index74.js +42 -8
- package/dist/index75.cjs +1 -1
- package/dist/index75.js +8 -10
- package/dist/index76.cjs +1 -1
- package/dist/index76.js +104 -11
- package/dist/index77.cjs +1 -1
- package/dist/index77.js +3 -6
- package/dist/index78.cjs +1 -1
- package/dist/index78.js +17 -13
- package/dist/index79.cjs +1 -1
- package/dist/index79.js +8 -32
- package/dist/index80.cjs +1 -1
- package/dist/index80.js +10 -14
- package/dist/index81.cjs +1 -1
- package/dist/index81.js +11 -64
- package/dist/index82.cjs +1 -1
- package/dist/index82.js +12 -26
- package/dist/index83.cjs +1 -1
- package/dist/index83.js +7 -3
- package/dist/index84.cjs +1 -1
- package/dist/index84.js +78 -3
- package/dist/index85.cjs +1 -1
- package/dist/index85.js +14 -8
- package/dist/index86.cjs +1 -1
- package/dist/index86.js +16 -189
- package/dist/index87.cjs +1 -1
- package/dist/index87.js +191 -18
- package/dist/index88.cjs +1 -1
- package/dist/index88.js +63 -39
- package/dist/index89.cjs +1 -1
- package/dist/index89.js +4 -34
- package/dist/index9.cjs +1 -1
- package/dist/index9.js +51 -43
- package/dist/index90.cjs +1 -1
- package/dist/index90.js +2 -70
- package/dist/index91.cjs +1 -1
- package/dist/index91.js +5 -111
- package/dist/index92.cjs +1 -1
- package/dist/index92.js +11 -67
- package/dist/index93.cjs +5 -1
- package/dist/index93.js +57 -2
- package/dist/index94.cjs +2 -1
- package/dist/index94.js +33 -15
- package/dist/index95.cjs +1 -1
- package/dist/index95.js +5 -223
- package/dist/index96.cjs +1 -1
- package/dist/index96.js +3 -231
- package/dist/index97.cjs +1 -1
- package/dist/index97.js +6 -42
- package/dist/index98.cjs +1 -1
- package/dist/index98.js +30 -102
- package/dist/index99.cjs +1 -1
- package/dist/index99.js +26 -16
- package/package.json +1 -1
package/dist/index57.js
CHANGED
|
@@ -1,174 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
import { serializeAuthorizationList as g } from "./index99.js";
|
|
3
|
-
import { blobsToCommitments as B } from "./index74.js";
|
|
4
|
-
import { blobsToProofs as V } from "./index75.js";
|
|
5
|
-
import { commitmentsToVersionedHashes as C } from "./index76.js";
|
|
6
|
-
import { toBlobSidecars as k } from "./index78.js";
|
|
7
|
-
import { concatHex as h } from "./index87.js";
|
|
8
|
-
import { trim as T } from "./index66.js";
|
|
9
|
-
import { toHex as o, bytesToHex as w } from "./index25.js";
|
|
10
|
-
import { toRlp as y } from "./index97.js";
|
|
11
|
-
import { assertTransactionEIP1559 as S, assertTransactionEIP2930 as _, assertTransactionEIP4844 as R, assertTransactionEIP7702 as Y, assertTransactionLegacy as j } from "./index100.js";
|
|
12
|
-
import { getTransactionType as q } from "./index80.js";
|
|
13
|
-
import { serializeAccessList as v } from "./index101.js";
|
|
14
|
-
function te(e, r) {
|
|
15
|
-
const i = q(e);
|
|
16
|
-
return i === "eip1559" ? K(e, r) : i === "eip2930" ? M(e, r) : i === "eip4844" ? J(e, r) : i === "eip7702" ? D(e, r) : N(e, r);
|
|
17
|
-
}
|
|
18
|
-
function D(e, r) {
|
|
19
|
-
const { authorizationList: i, chainId: s, gas: n, nonce: c, to: f, value: a, maxFeePerGas: x, maxPriorityFeePerGas: t, accessList: p, data: l } = e;
|
|
20
|
-
Y(e);
|
|
21
|
-
const d = v(p), m = g(i);
|
|
22
|
-
return h([
|
|
23
|
-
"0x04",
|
|
24
|
-
y([
|
|
25
|
-
o(s),
|
|
26
|
-
c ? o(c) : "0x",
|
|
27
|
-
t ? o(t) : "0x",
|
|
28
|
-
x ? o(x) : "0x",
|
|
29
|
-
n ? o(n) : "0x",
|
|
30
|
-
f ?? "0x",
|
|
31
|
-
a ? o(a) : "0x",
|
|
32
|
-
l ?? "0x",
|
|
33
|
-
d,
|
|
34
|
-
m,
|
|
35
|
-
...I(e, r)
|
|
36
|
-
])
|
|
37
|
-
]);
|
|
38
|
-
}
|
|
39
|
-
function J(e, r) {
|
|
40
|
-
const { chainId: i, gas: s, nonce: n, to: c, value: f, maxFeePerBlobGas: a, maxFeePerGas: x, maxPriorityFeePerGas: t, accessList: p, data: l } = e;
|
|
41
|
-
R(e);
|
|
42
|
-
let d = e.blobVersionedHashes, m = e.sidecars;
|
|
43
|
-
if (e.blobs && (typeof d > "u" || typeof m > "u")) {
|
|
44
|
-
const u = typeof e.blobs[0] == "string" ? e.blobs : e.blobs.map((P) => w(P)), z = e.kzg, b = B({
|
|
45
|
-
blobs: u,
|
|
46
|
-
kzg: z
|
|
47
|
-
});
|
|
48
|
-
if (typeof d > "u" && (d = C({
|
|
49
|
-
commitments: b
|
|
50
|
-
})), typeof m > "u") {
|
|
51
|
-
const P = V({ blobs: u, commitments: b, kzg: z });
|
|
52
|
-
m = k({ blobs: u, commitments: b, proofs: P });
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
const L = v(p), E = [
|
|
56
|
-
o(i),
|
|
57
|
-
n ? o(n) : "0x",
|
|
58
|
-
t ? o(t) : "0x",
|
|
59
|
-
x ? o(x) : "0x",
|
|
60
|
-
s ? o(s) : "0x",
|
|
61
|
-
c ?? "0x",
|
|
62
|
-
f ? o(f) : "0x",
|
|
63
|
-
l ?? "0x",
|
|
64
|
-
L,
|
|
65
|
-
a ? o(a) : "0x",
|
|
66
|
-
d ?? [],
|
|
67
|
-
...I(e, r)
|
|
68
|
-
], A = [], F = [], G = [];
|
|
69
|
-
if (m)
|
|
70
|
-
for (let u = 0; u < m.length; u++) {
|
|
71
|
-
const { blob: z, commitment: b, proof: P } = m[u];
|
|
72
|
-
A.push(z), F.push(b), G.push(P);
|
|
73
|
-
}
|
|
74
|
-
return h([
|
|
75
|
-
"0x03",
|
|
76
|
-
m ? (
|
|
77
|
-
// If sidecars are enabled, envelope turns into a "wrapper":
|
|
78
|
-
y([E, A, F, G])
|
|
79
|
-
) : (
|
|
80
|
-
// If sidecars are disabled, standard envelope is used:
|
|
81
|
-
y(E)
|
|
82
|
-
)
|
|
83
|
-
]);
|
|
84
|
-
}
|
|
85
|
-
function K(e, r) {
|
|
86
|
-
const { chainId: i, gas: s, nonce: n, to: c, value: f, maxFeePerGas: a, maxPriorityFeePerGas: x, accessList: t, data: p } = e;
|
|
87
|
-
S(e);
|
|
88
|
-
const l = v(t), d = [
|
|
89
|
-
o(i),
|
|
90
|
-
n ? o(n) : "0x",
|
|
91
|
-
x ? o(x) : "0x",
|
|
92
|
-
a ? o(a) : "0x",
|
|
93
|
-
s ? o(s) : "0x",
|
|
94
|
-
c ?? "0x",
|
|
95
|
-
f ? o(f) : "0x",
|
|
96
|
-
p ?? "0x",
|
|
97
|
-
l,
|
|
98
|
-
...I(e, r)
|
|
99
|
-
];
|
|
100
|
-
return h([
|
|
101
|
-
"0x02",
|
|
102
|
-
y(d)
|
|
103
|
-
]);
|
|
104
|
-
}
|
|
105
|
-
function M(e, r) {
|
|
106
|
-
const { chainId: i, gas: s, data: n, nonce: c, to: f, value: a, accessList: x, gasPrice: t } = e;
|
|
107
|
-
_(e);
|
|
108
|
-
const p = v(x), l = [
|
|
109
|
-
o(i),
|
|
110
|
-
c ? o(c) : "0x",
|
|
111
|
-
t ? o(t) : "0x",
|
|
112
|
-
s ? o(s) : "0x",
|
|
113
|
-
f ?? "0x",
|
|
114
|
-
a ? o(a) : "0x",
|
|
115
|
-
n ?? "0x",
|
|
116
|
-
p,
|
|
117
|
-
...I(e, r)
|
|
118
|
-
];
|
|
119
|
-
return h([
|
|
120
|
-
"0x01",
|
|
121
|
-
y(l)
|
|
122
|
-
]);
|
|
123
|
-
}
|
|
124
|
-
function N(e, r) {
|
|
125
|
-
const { chainId: i = 0, gas: s, data: n, nonce: c, to: f, value: a, gasPrice: x } = e;
|
|
126
|
-
j(e);
|
|
127
|
-
let t = [
|
|
128
|
-
c ? o(c) : "0x",
|
|
129
|
-
x ? o(x) : "0x",
|
|
130
|
-
s ? o(s) : "0x",
|
|
131
|
-
f ?? "0x",
|
|
132
|
-
a ? o(a) : "0x",
|
|
133
|
-
n ?? "0x"
|
|
134
|
-
];
|
|
135
|
-
if (r) {
|
|
136
|
-
const p = (() => {
|
|
137
|
-
if (r.v >= 35n)
|
|
138
|
-
return (r.v - 35n) / 2n > 0 ? r.v : 27n + (r.v === 35n ? 0n : 1n);
|
|
139
|
-
if (i > 0)
|
|
140
|
-
return BigInt(i * 2) + BigInt(35n + r.v - 27n);
|
|
141
|
-
const m = 27n + (r.v === 27n ? 0n : 1n);
|
|
142
|
-
if (r.v !== m)
|
|
143
|
-
throw new H({ v: r.v });
|
|
144
|
-
return m;
|
|
145
|
-
})(), l = T(r.r), d = T(r.s);
|
|
146
|
-
t = [
|
|
147
|
-
...t,
|
|
148
|
-
o(p),
|
|
149
|
-
l === "0x00" ? "0x" : l,
|
|
150
|
-
d === "0x00" ? "0x" : d
|
|
151
|
-
];
|
|
152
|
-
} else i > 0 && (t = [
|
|
153
|
-
...t,
|
|
154
|
-
o(i),
|
|
155
|
-
"0x",
|
|
156
|
-
"0x"
|
|
157
|
-
]);
|
|
158
|
-
return y(t);
|
|
159
|
-
}
|
|
160
|
-
function I(e, r) {
|
|
161
|
-
const i = r ?? e, { v: s, yParity: n } = i;
|
|
162
|
-
if (typeof i.r > "u")
|
|
163
|
-
return [];
|
|
164
|
-
if (typeof i.s > "u")
|
|
165
|
-
return [];
|
|
166
|
-
if (typeof s > "u" && typeof n > "u")
|
|
167
|
-
return [];
|
|
168
|
-
const c = T(i.r), f = T(i.s);
|
|
169
|
-
return [typeof n == "number" ? n ? o(1) : "0x" : s === 0n ? "0x" : s === 1n ? o(1) : s === 27n ? "0x" : o(1), c === "0x00" ? "0x" : c, f === "0x00" ? "0x" : f];
|
|
170
|
-
}
|
|
1
|
+
const g = (r, n, i) => JSON.stringify(r, (e, t) => typeof t == "bigint" ? t.toString() : t, i);
|
|
171
2
|
export {
|
|
172
|
-
|
|
173
|
-
I as toYParitySignatureArray
|
|
3
|
+
g as stringify
|
|
174
4
|
};
|
package/dist/index58.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function i(){let e=()=>{},t=()=>{};return{promise:new Promise((r,o)=>{e=r,t=o}),resolve:e,reject:t}}exports.withResolvers=i;
|
package/dist/index58.js
CHANGED
|
@@ -1,106 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import { keccak256 as c } from "./index56.js";
|
|
5
|
-
import { getTypesForEIP712Domain as T, validateTypedData as D } from "./index81.js";
|
|
6
|
-
function k(o) {
|
|
7
|
-
const { domain: t = {}, message: e, primaryType: n } = o, r = {
|
|
8
|
-
EIP712Domain: T({ domain: t }),
|
|
9
|
-
...o.types
|
|
1
|
+
function i() {
|
|
2
|
+
let e = () => {
|
|
3
|
+
}, n = () => {
|
|
10
4
|
};
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
primaryType: n,
|
|
15
|
-
types: r
|
|
16
|
-
});
|
|
17
|
-
const a = ["0x1901"];
|
|
18
|
-
return t && a.push(b({
|
|
19
|
-
domain: t,
|
|
20
|
-
types: r
|
|
21
|
-
})), n !== "EIP712Domain" && a.push(f({
|
|
22
|
-
data: e,
|
|
23
|
-
primaryType: n,
|
|
24
|
-
types: r
|
|
25
|
-
})), c(h(a));
|
|
26
|
-
}
|
|
27
|
-
function b({ domain: o, types: t }) {
|
|
28
|
-
return f({
|
|
29
|
-
data: o,
|
|
30
|
-
primaryType: "EIP712Domain",
|
|
31
|
-
types: t
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
function f({ data: o, primaryType: t, types: e }) {
|
|
35
|
-
const n = m({
|
|
36
|
-
data: o,
|
|
37
|
-
primaryType: t,
|
|
38
|
-
types: e
|
|
39
|
-
});
|
|
40
|
-
return c(n);
|
|
41
|
-
}
|
|
42
|
-
function m({ data: o, primaryType: t, types: e }) {
|
|
43
|
-
const n = [{ type: "bytes32" }], r = [l({ primaryType: t, types: e })];
|
|
44
|
-
for (const a of e[t]) {
|
|
45
|
-
const [i, s] = y({
|
|
46
|
-
types: e,
|
|
47
|
-
name: a.name,
|
|
48
|
-
type: a.type,
|
|
49
|
-
value: o[a.name]
|
|
50
|
-
});
|
|
51
|
-
n.push(i), r.push(s);
|
|
52
|
-
}
|
|
53
|
-
return p(n, r);
|
|
54
|
-
}
|
|
55
|
-
function l({ primaryType: o, types: t }) {
|
|
56
|
-
const e = d(x({ primaryType: o, types: t }));
|
|
57
|
-
return c(e);
|
|
58
|
-
}
|
|
59
|
-
function x({ primaryType: o, types: t }) {
|
|
60
|
-
let e = "";
|
|
61
|
-
const n = u({ primaryType: o, types: t });
|
|
62
|
-
n.delete(o);
|
|
63
|
-
const r = [o, ...Array.from(n).sort()];
|
|
64
|
-
for (const a of r)
|
|
65
|
-
e += `${a}(${t[a].map(({ name: i, type: s }) => `${s} ${i}`).join(",")})`;
|
|
66
|
-
return e;
|
|
67
|
-
}
|
|
68
|
-
function u({ primaryType: o, types: t }, e = /* @__PURE__ */ new Set()) {
|
|
69
|
-
const n = o.match(/^\w*/u), r = n == null ? void 0 : n[0];
|
|
70
|
-
if (e.has(r) || t[r] === void 0)
|
|
71
|
-
return e;
|
|
72
|
-
e.add(r);
|
|
73
|
-
for (const a of t[r])
|
|
74
|
-
u({ primaryType: a.type, types: t }, e);
|
|
75
|
-
return e;
|
|
76
|
-
}
|
|
77
|
-
function y({ types: o, name: t, type: e, value: n }) {
|
|
78
|
-
if (o[e] !== void 0)
|
|
79
|
-
return [
|
|
80
|
-
{ type: "bytes32" },
|
|
81
|
-
c(m({ data: n, primaryType: e, types: o }))
|
|
82
|
-
];
|
|
83
|
-
if (e === "bytes")
|
|
84
|
-
return n = `0x${(n.length % 2 ? "0" : "") + n.slice(2)}`, [{ type: "bytes32" }, c(n)];
|
|
85
|
-
if (e === "string")
|
|
86
|
-
return [{ type: "bytes32" }, c(d(n))];
|
|
87
|
-
if (e.lastIndexOf("]") === e.length - 1) {
|
|
88
|
-
const r = e.slice(0, e.lastIndexOf("[")), a = n.map((i) => y({
|
|
89
|
-
name: t,
|
|
90
|
-
type: r,
|
|
91
|
-
types: o,
|
|
92
|
-
value: i
|
|
93
|
-
}));
|
|
94
|
-
return [
|
|
95
|
-
{ type: "bytes32" },
|
|
96
|
-
c(p(a.map(([i]) => i), a.map(([, i]) => i)))
|
|
97
|
-
];
|
|
98
|
-
}
|
|
99
|
-
return [{ type: e }, n];
|
|
5
|
+
return { promise: new Promise((r, o) => {
|
|
6
|
+
e = r, n = o;
|
|
7
|
+
}), resolve: e, reject: n };
|
|
100
8
|
}
|
|
101
9
|
export {
|
|
102
|
-
|
|
103
|
-
b as hashDomain,
|
|
104
|
-
f as hashStruct,
|
|
105
|
-
k as hashTypedData
|
|
10
|
+
i as withResolvers
|
|
106
11
|
};
|
package/dist/index59.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./index96.cjs");function f(n,{delay:e=100,retryCount:o=2,shouldRetry:c=()=>!0}={}){return new Promise((s,y)=>{const a=async({count:r=0}={})=>{const w=async({error:t})=>{const i=typeof e=="function"?e({count:r,error:t}):e;i&&await u.wait(i),a({count:r+1})};try{const t=await n();s(t)}catch(t){if(r<o&&await c({count:r,error:t}))return w({error:t});y(t)}};a()})}exports.withRetry=f;
|
package/dist/index59.js
CHANGED
|
@@ -1,24 +1,23 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
1
|
+
import { wait as w } from "./index96.js";
|
|
2
|
+
function p(n, { delay: e = 100, retryCount: o = 2, shouldRetry: c = () => !0 } = {}) {
|
|
3
|
+
return new Promise((s, y) => {
|
|
4
|
+
const a = async ({ count: r = 0 } = {}) => {
|
|
5
|
+
const f = async ({ error: t }) => {
|
|
6
|
+
const i = typeof e == "function" ? e({ count: r, error: t }) : e;
|
|
7
|
+
i && await w(i), a({ count: r + 1 });
|
|
8
|
+
};
|
|
9
|
+
try {
|
|
10
|
+
const t = await n();
|
|
11
|
+
s(t);
|
|
12
|
+
} catch (t) {
|
|
13
|
+
if (r < o && await c({ count: r, error: t }))
|
|
14
|
+
return f({ error: t });
|
|
15
|
+
y(t);
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
a();
|
|
19
|
+
});
|
|
20
20
|
}
|
|
21
21
|
export {
|
|
22
|
-
|
|
23
|
-
w as getAddress
|
|
22
|
+
p as withRetry
|
|
24
23
|
};
|
package/dist/index60.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./index61.cjs"),c=require("./index62.cjs");class r extends c.Hash{constructor(t,i){super(),this.finished=!1,this.destroyed=!1,o.ahash(t);const h=c.toBytes(i);if(this.iHash=t.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const a=this.blockLen,e=new Uint8Array(a);e.set(h.length>a?t.create().update(h).digest():h);for(let s=0;s<e.length;s++)e[s]^=54;this.iHash.update(e),this.oHash=t.create();for(let s=0;s<e.length;s++)e[s]^=106;this.oHash.update(e),e.fill(0)}update(t){return o.aexists(this),this.iHash.update(t),this}digestInto(t){o.aexists(this),o.abytes(t,this.outputLen),this.finished=!0,this.iHash.digestInto(t),this.oHash.update(t),this.oHash.digestInto(t),this.destroy()}digest(){const t=new Uint8Array(this.oHash.outputLen);return this.digestInto(t),t}_cloneInto(t){t||(t=Object.create(Object.getPrototypeOf(this),{}));const{oHash:i,iHash:h,finished:a,destroyed:e,blockLen:s,outputLen:u}=this;return t=t,t.finished=a,t.destroyed=e,t.blockLen=s,t.outputLen=u,t.oHash=i._cloneInto(t.oHash),t.iHash=h._cloneInto(t.iHash),t}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const d=(n,t,i)=>new r(n,t).update(i).digest();d.create=(n,t)=>new r(n,t);exports.HMAC=r;exports.hmac=d;
|
package/dist/index60.js
CHANGED
|
@@ -1,15 +1,43 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { ahash as c, aexists as a, abytes as u } from "./index61.js";
|
|
2
|
+
import { Hash as H, toBytes as p } from "./index62.js";
|
|
3
|
+
class r extends H {
|
|
4
|
+
constructor(t, i) {
|
|
5
|
+
super(), this.finished = !1, this.destroyed = !1, c(t);
|
|
6
|
+
const h = p(i);
|
|
7
|
+
if (this.iHash = t.create(), typeof this.iHash.update != "function")
|
|
8
|
+
throw new Error("Expected instance of class which extends utils.Hash");
|
|
9
|
+
this.blockLen = this.iHash.blockLen, this.outputLen = this.iHash.outputLen;
|
|
10
|
+
const o = this.blockLen, e = new Uint8Array(o);
|
|
11
|
+
e.set(h.length > o ? t.create().update(h).digest() : h);
|
|
12
|
+
for (let s = 0; s < e.length; s++)
|
|
13
|
+
e[s] ^= 54;
|
|
14
|
+
this.iHash.update(e), this.oHash = t.create();
|
|
15
|
+
for (let s = 0; s < e.length; s++)
|
|
16
|
+
e[s] ^= 106;
|
|
17
|
+
this.oHash.update(e), e.fill(0);
|
|
5
18
|
}
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
19
|
+
update(t) {
|
|
20
|
+
return a(this), this.iHash.update(t), this;
|
|
21
|
+
}
|
|
22
|
+
digestInto(t) {
|
|
23
|
+
a(this), u(t, this.outputLen), this.finished = !0, this.iHash.digestInto(t), this.oHash.update(t), this.oHash.digestInto(t), this.destroy();
|
|
24
|
+
}
|
|
25
|
+
digest() {
|
|
26
|
+
const t = new Uint8Array(this.oHash.outputLen);
|
|
27
|
+
return this.digestInto(t), t;
|
|
28
|
+
}
|
|
29
|
+
_cloneInto(t) {
|
|
30
|
+
t || (t = Object.create(Object.getPrototypeOf(this), {}));
|
|
31
|
+
const { oHash: i, iHash: h, finished: o, destroyed: e, blockLen: s, outputLen: d } = this;
|
|
32
|
+
return t = t, t.finished = o, t.destroyed = e, t.blockLen = s, t.outputLen = d, t.oHash = i._cloneInto(t.oHash), t.iHash = h._cloneInto(t.iHash), t;
|
|
33
|
+
}
|
|
34
|
+
destroy() {
|
|
35
|
+
this.destroyed = !0, this.oHash.destroy(), this.iHash.destroy();
|
|
10
36
|
}
|
|
11
37
|
}
|
|
38
|
+
const l = (n, t, i) => new r(n, t).update(i).digest();
|
|
39
|
+
l.create = (n, t) => new r(n, t);
|
|
12
40
|
export {
|
|
13
|
-
|
|
14
|
-
|
|
41
|
+
r as HMAC,
|
|
42
|
+
l as hmac
|
|
15
43
|
};
|
package/dist/index61.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function r(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function i(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function o(e,...t){if(!i(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}function a(e){if(typeof e!="function"||typeof e.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");r(e.outputLen),r(e.blockLen)}function s(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function u(e,t){o(e);const n=t.outputLen;if(e.length<n)throw new Error("digestInto() expects output buffer of length at least "+n)}exports.abytes=o;exports.aexists=s;exports.ahash=a;exports.anumber=r;exports.aoutput=u;
|
package/dist/index61.js
CHANGED
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
function n(e) {
|
|
2
|
+
if (!Number.isSafeInteger(e) || e < 0)
|
|
3
|
+
throw new Error("positive integer expected, got " + e);
|
|
4
4
|
}
|
|
5
|
-
function
|
|
6
|
-
|
|
7
|
-
return n;
|
|
8
|
-
const e = n.replace("0x", "");
|
|
9
|
-
if (e.length > t * 2)
|
|
10
|
-
throw new d({
|
|
11
|
-
size: Math.ceil(e.length / 2),
|
|
12
|
-
targetSize: t,
|
|
13
|
-
type: "hex"
|
|
14
|
-
});
|
|
15
|
-
return `0x${e[r === "right" ? "padEnd" : "padStart"](t * 2, "0")}`;
|
|
5
|
+
function o(e) {
|
|
6
|
+
return e instanceof Uint8Array || ArrayBuffer.isView(e) && e.constructor.name === "Uint8Array";
|
|
16
7
|
}
|
|
17
|
-
function i(
|
|
18
|
-
if (
|
|
19
|
-
|
|
20
|
-
if (
|
|
21
|
-
throw new
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
8
|
+
function i(e, ...t) {
|
|
9
|
+
if (!o(e))
|
|
10
|
+
throw new Error("Uint8Array expected");
|
|
11
|
+
if (t.length > 0 && !t.includes(e.length))
|
|
12
|
+
throw new Error("Uint8Array expected of length " + t + ", got length=" + e.length);
|
|
13
|
+
}
|
|
14
|
+
function f(e) {
|
|
15
|
+
if (typeof e != "function" || typeof e.create != "function")
|
|
16
|
+
throw new Error("Hash should be wrapped by utils.wrapConstructor");
|
|
17
|
+
n(e.outputLen), n(e.blockLen);
|
|
18
|
+
}
|
|
19
|
+
function s(e, t = !0) {
|
|
20
|
+
if (e.destroyed)
|
|
21
|
+
throw new Error("Hash instance has been destroyed");
|
|
22
|
+
if (t && e.finished)
|
|
23
|
+
throw new Error("Hash#digest() has already been called");
|
|
24
|
+
}
|
|
25
|
+
function u(e, t) {
|
|
26
|
+
i(e);
|
|
27
|
+
const r = t.outputLen;
|
|
28
|
+
if (e.length < r)
|
|
29
|
+
throw new Error("digestInto() expects output buffer of length at least " + r);
|
|
32
30
|
}
|
|
33
31
|
export {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
32
|
+
i as abytes,
|
|
33
|
+
s as aexists,
|
|
34
|
+
f as ahash,
|
|
35
|
+
n as anumber,
|
|
36
|
+
u as aoutput
|
|
37
37
|
};
|
package/dist/index62.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./index65.cjs"),f=require("./index61.cjs");/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */function p(t){return new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4))}function a(t){return new DataView(t.buffer,t.byteOffset,t.byteLength)}function l(t,e){return t<<32-e|t>>>e}const b=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function i(t){return t<<24&4278190080|t<<8&16711680|t>>>8&65280|t>>>24&255}function w(t){for(let e=0;e<t.length;e++)t[e]=i(t[e])}function y(t){if(typeof t!="string")throw new Error("utf8ToBytes expected string, got "+typeof t);return new Uint8Array(new TextEncoder().encode(t))}function s(t){return typeof t=="string"&&(t=y(t)),f.abytes(t),t}function g(...t){let e=0;for(let n=0;n<t.length;n++){const u=t[n];f.abytes(u),e+=u.length}const r=new Uint8Array(e);for(let n=0,u=0;n<t.length;n++){const c=t[n];r.set(c,u),u+=c.length}return r}class m{clone(){return this._cloneInto()}}function B(t){const e=n=>t().update(s(n)).digest(),r=t();return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=()=>t(),e}function d(t=32){if(o.crypto&&typeof o.crypto.getRandomValues=="function")return o.crypto.getRandomValues(new Uint8Array(t));if(o.crypto&&typeof o.crypto.randomBytes=="function")return o.crypto.randomBytes(t);throw new Error("crypto.getRandomValues must be defined")}exports.Hash=m;exports.byteSwap=i;exports.byteSwap32=w;exports.concatBytes=g;exports.createView=a;exports.isLE=b;exports.randomBytes=d;exports.rotr=l;exports.toBytes=s;exports.u32=p;exports.utf8ToBytes=y;exports.wrapConstructor=B;
|
package/dist/index62.js
CHANGED
|
@@ -1,11 +1,72 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { crypto as o } from "./index65.js";
|
|
2
|
+
import { abytes as i } from "./index61.js";
|
|
3
|
+
/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
4
|
+
function g(t) {
|
|
5
|
+
return new Uint32Array(t.buffer, t.byteOffset, Math.floor(t.byteLength / 4));
|
|
6
|
+
}
|
|
7
|
+
function m(t) {
|
|
8
|
+
return new DataView(t.buffer, t.byteOffset, t.byteLength);
|
|
9
|
+
}
|
|
10
|
+
function w(t, e) {
|
|
11
|
+
return t << 32 - e | t >>> e;
|
|
12
|
+
}
|
|
13
|
+
const b = new Uint8Array(new Uint32Array([287454020]).buffer)[0] === 68;
|
|
14
|
+
function c(t) {
|
|
15
|
+
return t << 24 & 4278190080 | t << 8 & 16711680 | t >>> 8 & 65280 | t >>> 24 & 255;
|
|
16
|
+
}
|
|
17
|
+
function a(t) {
|
|
18
|
+
for (let e = 0; e < t.length; e++)
|
|
19
|
+
t[e] = c(t[e]);
|
|
20
|
+
}
|
|
21
|
+
function s(t) {
|
|
22
|
+
if (typeof t != "string")
|
|
23
|
+
throw new Error("utf8ToBytes expected string, got " + typeof t);
|
|
24
|
+
return new Uint8Array(new TextEncoder().encode(t));
|
|
25
|
+
}
|
|
26
|
+
function y(t) {
|
|
27
|
+
return typeof t == "string" && (t = s(t)), i(t), t;
|
|
28
|
+
}
|
|
29
|
+
function x(...t) {
|
|
30
|
+
let e = 0;
|
|
31
|
+
for (let n = 0; n < t.length; n++) {
|
|
32
|
+
const r = t[n];
|
|
33
|
+
i(r), e += r.length;
|
|
34
|
+
}
|
|
35
|
+
const f = new Uint8Array(e);
|
|
36
|
+
for (let n = 0, r = 0; n < t.length; n++) {
|
|
37
|
+
const u = t[n];
|
|
38
|
+
f.set(u, r), r += u.length;
|
|
39
|
+
}
|
|
40
|
+
return f;
|
|
41
|
+
}
|
|
42
|
+
class h {
|
|
43
|
+
// Safe version that clones internal state
|
|
44
|
+
clone() {
|
|
45
|
+
return this._cloneInto();
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
function B(t) {
|
|
49
|
+
const e = (n) => t().update(y(n)).digest(), f = t();
|
|
50
|
+
return e.outputLen = f.outputLen, e.blockLen = f.blockLen, e.create = () => t(), e;
|
|
51
|
+
}
|
|
52
|
+
function d(t = 32) {
|
|
53
|
+
if (o && typeof o.getRandomValues == "function")
|
|
54
|
+
return o.getRandomValues(new Uint8Array(t));
|
|
55
|
+
if (o && typeof o.randomBytes == "function")
|
|
56
|
+
return o.randomBytes(t);
|
|
57
|
+
throw new Error("crypto.getRandomValues must be defined");
|
|
8
58
|
}
|
|
9
59
|
export {
|
|
10
|
-
|
|
60
|
+
h as Hash,
|
|
61
|
+
c as byteSwap,
|
|
62
|
+
a as byteSwap32,
|
|
63
|
+
x as concatBytes,
|
|
64
|
+
m as createView,
|
|
65
|
+
b as isLE,
|
|
66
|
+
d as randomBytes,
|
|
67
|
+
w as rotr,
|
|
68
|
+
y as toBytes,
|
|
69
|
+
g as u32,
|
|
70
|
+
s as utf8ToBytes,
|
|
71
|
+
B as wrapConstructor
|
|
11
72
|
};
|
package/dist/index63.cjs
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
2
|
-
`);super(b,e.cause?{cause:e.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.details=r,this.docsPath=n,this.metaMessages=e.metaMessages,this.name=e.name??this.name,this.shortMessage=t,this.version=l.version}walk(t){return d(this,t)}}function d(s,t){return t!=null&&t(s)?s:s&&typeof s=="object"&&"cause"in s&&s.cause!==void 0?d(s.cause,t):t?null:s}exports.BaseError=u;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const H=require("./index64.cjs"),s=require("./index62.cjs"),S=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),b=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),f=new Uint32Array(64);class g extends H.HashMD{constructor(){super(64,32,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}get(){const{A:d,B:o,C:x,D:e,E:a,F:i,G:c,H:r}=this;return[d,o,x,e,a,i,c,r]}set(d,o,x,e,a,i,c,r){this.A=d|0,this.B=o|0,this.C=x|0,this.D=e|0,this.E=a|0,this.F=i|0,this.G=c|0,this.H=r|0}process(d,o){for(let t=0;t<16;t++,o+=4)f[t]=d.getUint32(o,!1);for(let t=16;t<64;t++){const A=f[t-15],n=f[t-2],C=s.rotr(A,7)^s.rotr(A,18)^A>>>3,u=s.rotr(n,17)^s.rotr(n,19)^n>>>10;f[t]=u+f[t-7]+C+f[t-16]|0}let{A:x,B:e,C:a,D:i,E:c,F:r,G:h,H:l}=this;for(let t=0;t<64;t++){const A=s.rotr(c,6)^s.rotr(c,11)^s.rotr(c,25),n=l+A+H.Chi(c,r,h)+S[t]+f[t]|0,u=(s.rotr(x,2)^s.rotr(x,13)^s.rotr(x,22))+H.Maj(x,e,a)|0;l=h,h=r,r=c,c=i+n|0,i=a,a=e,e=x,x=n+u|0}x=x+this.A|0,e=e+this.B|0,a=a+this.C|0,i=i+this.D|0,c=c+this.E|0,r=r+this.F|0,h=h+this.G|0,l=l+this.H|0,this.set(x,e,a,i,c,r,h,l)}roundClean(){f.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const y=s.wrapConstructor(()=>new g);exports.SHA256=g;exports.sha256=y;
|