@gardenfi/utils 2.1.2-beta.6 → 2.1.2-beta.8
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 +5 -5
- package/dist/index101.cjs +2 -1
- package/dist/index101.js +3 -11
- package/dist/index102.cjs +1 -1
- package/dist/index102.js +16 -18
- package/dist/index103.cjs +1 -1
- package/dist/index103.js +643 -6
- package/dist/index104.cjs +1 -1
- package/dist/index104.js +173 -5
- package/dist/index18.cjs +1 -1
- package/dist/index18.js +2 -2
- package/dist/index19.cjs +1 -1
- package/dist/index19.js +9 -9
- package/dist/index20.cjs +1 -1
- package/dist/index20.js +1 -1
- package/dist/index21.cjs +1 -1
- package/dist/index21.js +3 -3
- package/dist/index22.cjs +1 -1
- package/dist/index22.js +1 -1
- package/dist/index23.cjs +2 -1
- package/dist/index23.js +49 -40
- package/dist/index24.cjs +1 -1
- package/dist/index24.js +24 -45
- package/dist/index25.cjs +1 -1
- package/dist/index25.js +41 -25
- package/dist/index26.cjs +1 -1
- package/dist/index26.js +45 -6
- package/dist/index27.cjs +1 -1
- package/dist/index27.js +24 -12
- package/dist/index28.cjs +1 -1
- package/dist/index28.js +6 -15
- package/dist/index29.cjs +1 -1
- package/dist/index29.js +13 -5
- package/dist/index30.cjs +1 -1
- package/dist/index30.js +14 -12
- package/dist/index31.cjs +1 -1
- package/dist/index31.js +5 -10
- package/dist/index32.cjs +1 -1
- package/dist/index32.js +13 -12
- package/dist/index33.cjs +1 -1
- package/dist/index33.js +10 -11
- package/dist/index34.cjs +1 -1
- package/dist/index34.js +12 -13
- package/dist/index35.cjs +1 -1
- package/dist/index35.js +11 -23
- package/dist/index36.cjs +1 -1
- package/dist/index36.js +13 -55
- package/dist/index37.cjs +1 -1
- package/dist/index37.js +23 -16
- package/dist/index38.cjs +1 -1
- package/dist/index38.js +55 -5
- package/dist/index39.cjs +1 -1
- package/dist/index39.js +16 -8
- package/dist/index40.cjs +1 -1
- package/dist/index40.js +5 -171
- package/dist/index41.cjs +1 -1
- package/dist/index41.js +8 -103
- package/dist/index42.cjs +1 -1
- package/dist/index42.js +170 -20
- package/dist/index43.cjs +1 -2
- package/dist/index43.js +97 -44
- package/dist/index44.cjs +1 -1
- package/dist/index44.js +21 -24
- package/dist/index45.cjs +1 -1
- package/dist/index45.js +10 -38
- package/dist/index46.cjs +1 -1
- package/dist/index46.js +32 -32
- package/dist/index47.cjs +1 -1
- package/dist/index47.js +6 -69
- package/dist/index48.cjs +2 -1
- package/dist/index48.js +57 -110
- package/dist/index49.cjs +1 -1
- package/dist/index49.js +2 -68
- package/dist/index50.cjs +1 -1
- package/dist/index50.js +7 -2
- package/dist/index51.cjs +1 -1
- package/dist/index51.js +4 -16
- package/dist/index52.cjs +1 -1
- package/dist/index52.js +10 -222
- package/dist/index53.cjs +1 -1
- package/dist/index53.js +7 -231
- package/dist/index54.cjs +5 -1
- package/dist/index54.js +53 -9
- package/dist/index55.cjs +2 -1
- package/dist/index55.js +30 -30
- package/dist/index56.cjs +1 -2
- package/dist/index56.js +5 -59
- package/dist/index57.cjs +1 -1
- package/dist/index57.js +2 -22
- package/dist/index58.cjs +1 -1
- package/dist/index58.js +18 -101
- package/dist/index59.cjs +1 -1
- package/dist/index59.js +8 -3
- package/dist/index60.cjs +1 -1
- package/dist/index60.js +9 -16
- package/dist/index61.cjs +1 -1
- package/dist/index61.js +11 -8
- package/dist/index62.cjs +1 -1
- package/dist/index62.js +6 -10
- package/dist/index63.cjs +1 -1
- package/dist/index63.js +13 -11
- package/dist/index64.cjs +1 -1
- package/dist/index64.js +31 -12
- package/dist/index65.cjs +1 -1
- package/dist/index65.js +14 -18
- package/dist/index66.cjs +1 -1
- package/dist/index66.js +64 -6
- package/dist/index67.cjs +1 -1
- package/dist/index67.js +25 -40
- package/dist/index68.cjs +1 -1
- package/dist/index68.js +3 -79
- package/dist/index69.cjs +1 -1
- package/dist/index69.js +3 -14
- package/dist/index70.cjs +1 -1
- package/dist/index70.js +8 -18
- package/dist/index71.cjs +1 -1
- package/dist/index71.js +191 -8
- package/dist/index72.cjs +1 -1
- package/dist/index72.js +17 -3
- package/dist/index73.cjs +1 -1
- package/dist/index73.js +41 -192
- package/dist/index74.cjs +1 -1
- package/dist/index74.js +32 -62
- package/dist/index75.cjs +1 -1
- package/dist/index75.js +70 -2
- package/dist/index76.cjs +1 -1
- package/dist/index76.js +111 -5
- package/dist/index77.cjs +1 -1
- package/dist/index77.js +67 -11
- package/dist/index78.cjs +1 -1
- package/dist/index78.js +2 -8
- package/dist/index79.cjs +1 -5
- package/dist/index79.js +15 -55
- package/dist/index80.cjs +1 -1
- package/dist/index80.js +224 -2
- package/dist/index81.cjs +1 -2
- package/dist/index81.js +228 -31
- package/dist/index82.cjs +1 -1
- package/dist/index82.js +42 -5
- package/dist/index83.cjs +1 -1
- package/dist/index83.js +104 -6
- package/dist/index84.cjs +1 -1
- package/dist/index84.js +16 -31
- package/dist/index85.cjs +1 -1
- package/dist/index85.js +75 -24
- package/dist/index86.cjs +1 -1
- package/dist/index86.js +19 -3
- package/dist/index87.cjs +1 -1
- package/dist/index87.js +8 -11
- package/dist/index88.cjs +1 -1
- package/dist/index88.js +11 -19
- package/dist/index89.cjs +1 -1
- package/dist/index89.js +19 -8
- package/dist/index90.cjs +1 -1
- package/dist/index90.js +10 -16
- package/dist/index91.cjs +1 -1
- package/dist/index91.js +33 -638
- package/dist/index92.cjs +1 -1
- package/dist/index92.js +2 -173
- package/dist/index93.cjs +1 -1
- package/dist/index93.js +5 -13
- package/dist/index94.cjs +1 -1
- package/dist/index94.js +10 -127
- package/dist/index95.cjs +1 -2
- package/dist/index95.js +128 -3
- package/dist/index96.cjs +1 -1
- package/dist/index96.js +7 -2
- package/dist/index97.cjs +1 -1
- package/dist/index97.js +2 -2
- package/dist/index98.cjs +1 -1
- package/dist/index98.js +2 -2
- package/dist/index99.cjs +1 -1
- package/dist/index99.js +17 -35
- package/package.json +1 -1
package/dist/index54.js
CHANGED
|
@@ -1,15 +1,59 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { size as i } from "./index51.js";
|
|
2
|
+
import { BaseError as n } from "./index48.js";
|
|
3
|
+
class c extends n {
|
|
4
|
+
constructor({ expectedLength: e, givenLength: r, type: s }) {
|
|
5
|
+
super([
|
|
6
|
+
`ABI encoding array length mismatch for type ${s}.`,
|
|
7
|
+
`Expected length: ${e}`,
|
|
8
|
+
`Given length: ${r}`
|
|
9
|
+
].join(`
|
|
10
|
+
`), { name: "AbiEncodingArrayLengthMismatchError" });
|
|
5
11
|
}
|
|
6
12
|
}
|
|
7
|
-
class
|
|
8
|
-
constructor({
|
|
9
|
-
super(`Size
|
|
13
|
+
class d extends n {
|
|
14
|
+
constructor({ expectedSize: e, value: r }) {
|
|
15
|
+
super(`Size of bytes "${r}" (bytes${i(r)}) does not match expected size (bytes${e}).`, { name: "AbiEncodingBytesSizeMismatchError" });
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
class m extends n {
|
|
19
|
+
constructor({ expectedLength: e, givenLength: r }) {
|
|
20
|
+
super([
|
|
21
|
+
"ABI encoding params/values length mismatch.",
|
|
22
|
+
`Expected length (params): ${e}`,
|
|
23
|
+
`Given length (values): ${r}`
|
|
24
|
+
].join(`
|
|
25
|
+
`), { name: "AbiEncodingLengthMismatchError" });
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
class E extends n {
|
|
29
|
+
constructor({ expectedSize: e, givenSize: r }) {
|
|
30
|
+
super(`Expected bytes${e}, got bytes${r}.`, {
|
|
31
|
+
name: "BytesSizeMismatchError"
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
class g extends n {
|
|
36
|
+
constructor(e, { docsPath: r }) {
|
|
37
|
+
super([
|
|
38
|
+
`Type "${e}" is not a valid encoding type.`,
|
|
39
|
+
"Please provide a valid ABI type."
|
|
40
|
+
].join(`
|
|
41
|
+
`), { docsPath: r, name: "InvalidAbiEncodingType" });
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
class l extends n {
|
|
45
|
+
constructor(e) {
|
|
46
|
+
super([`Value "${e}" is not a valid array.`].join(`
|
|
47
|
+
`), {
|
|
48
|
+
name: "InvalidArrayError"
|
|
49
|
+
});
|
|
10
50
|
}
|
|
11
51
|
}
|
|
12
52
|
export {
|
|
13
|
-
|
|
14
|
-
|
|
53
|
+
c as AbiEncodingArrayLengthMismatchError,
|
|
54
|
+
d as AbiEncodingBytesSizeMismatchError,
|
|
55
|
+
m as AbiEncodingLengthMismatchError,
|
|
56
|
+
E as BytesSizeMismatchError,
|
|
57
|
+
g as InvalidAbiEncodingTypeError,
|
|
58
|
+
l as InvalidArrayError
|
|
15
59
|
};
|
package/dist/index55.cjs
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./index56.cjs"),t=require("./index48.cjs");class i extends t.BaseError{constructor({cause:r,maxFeePerGas:e}={}){super(`The fee cap (\`maxFeePerGas\`${e?` = ${a.formatGwei(e)} gwei`:""}) cannot be higher than the maximum allowed value (2^256-1).`,{cause:r,name:"FeeCapTooHighError"})}}Object.defineProperty(i,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas higher than 2\^256-1|fee cap higher than 2\^256-1/});class n extends t.BaseError{constructor({cause:r,maxPriorityFeePerGas:e,maxFeePerGas:o}={}){super([`The provided tip (\`maxPriorityFeePerGas\`${e?` = ${a.formatGwei(e)} gwei`:""}) cannot be higher than the fee cap (\`maxFeePerGas\`${o?` = ${a.formatGwei(o)} gwei`:""}).`].join(`
|
|
2
|
+
`),{cause:r,name:"TipAboveFeeCapError"})}}Object.defineProperty(n,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max priority fee per gas higher than max fee per gas|tip higher than fee cap/});exports.FeeCapTooHighError=i;exports.TipAboveFeeCapError=n;
|
package/dist/index55.js
CHANGED
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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"
|
|
1
|
+
import { formatGwei as a } from "./index56.js";
|
|
2
|
+
import { BaseError as o } from "./index48.js";
|
|
3
|
+
class n extends o {
|
|
4
|
+
constructor({ cause: r, maxFeePerGas: e } = {}) {
|
|
5
|
+
super(`The fee cap (\`maxFeePerGas\`${e ? ` = ${a(e)} gwei` : ""}) cannot be higher than the maximum allowed value (2^256-1).`, {
|
|
6
|
+
cause: r,
|
|
7
|
+
name: "FeeCapTooHighError"
|
|
14
8
|
});
|
|
15
|
-
|
|
9
|
+
}
|
|
16
10
|
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
11
|
+
Object.defineProperty(n, "nodeMessage", {
|
|
12
|
+
enumerable: !0,
|
|
13
|
+
configurable: !0,
|
|
14
|
+
writable: !0,
|
|
15
|
+
value: /max fee per gas higher than 2\^256-1|fee cap higher than 2\^256-1/
|
|
16
|
+
});
|
|
17
|
+
class h extends o {
|
|
18
|
+
constructor({ cause: r, maxPriorityFeePerGas: e, maxFeePerGas: t } = {}) {
|
|
19
|
+
super([
|
|
20
|
+
`The provided tip (\`maxPriorityFeePerGas\`${e ? ` = ${a(e)} gwei` : ""}) cannot be higher than the fee cap (\`maxFeePerGas\`${t ? ` = ${a(t)} gwei` : ""}).`
|
|
21
|
+
].join(`
|
|
22
|
+
`), {
|
|
23
|
+
cause: r,
|
|
24
|
+
name: "TipAboveFeeCapError"
|
|
25
25
|
});
|
|
26
|
-
const e = new Uint8Array(t);
|
|
27
|
-
for (let a = 0; a < t; a++) {
|
|
28
|
-
const o = r === "right";
|
|
29
|
-
e[o ? a : t - a - 1] = n[o ? a : n.length - a - 1];
|
|
30
26
|
}
|
|
31
|
-
return e;
|
|
32
27
|
}
|
|
28
|
+
Object.defineProperty(h, "nodeMessage", {
|
|
29
|
+
enumerable: !0,
|
|
30
|
+
configurable: !0,
|
|
31
|
+
writable: !0,
|
|
32
|
+
value: /max priority fee per gas higher than max fee per gas|tip higher than fee cap/
|
|
33
|
+
});
|
|
33
34
|
export {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
p as padHex
|
|
35
|
+
n as FeeCapTooHighError,
|
|
36
|
+
h as TipAboveFeeCapError
|
|
37
37
|
};
|
package/dist/index56.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 i=require("./index93.cjs"),r=require("./index94.cjs");function n(t,e="wei"){return r.formatUnits(t,i.gweiUnits[e])}exports.formatGwei=n;
|
package/dist/index56.js
CHANGED
|
@@ -1,62 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
};
|
|
6
|
-
class r extends Error {
|
|
7
|
-
constructor(t, e = {}) {
|
|
8
|
-
var o;
|
|
9
|
-
const u = (() => {
|
|
10
|
-
var c;
|
|
11
|
-
return e.cause instanceof r ? e.cause.details : (c = e.cause) != null && c.message ? e.cause.message : e.details;
|
|
12
|
-
})(), a = e.cause instanceof r && e.cause.docsPath || e.docsPath, n = (o = i.getDocsUrl) == null ? void 0 : o.call(i, { ...e, docsPath: a }), b = [
|
|
13
|
-
t || "An error occurred.",
|
|
14
|
-
"",
|
|
15
|
-
...e.metaMessages ? [...e.metaMessages, ""] : [],
|
|
16
|
-
...n ? [`Docs: ${n}`] : [],
|
|
17
|
-
...u ? [`Details: ${u}`] : [],
|
|
18
|
-
...i.version ? [`Version: ${i.version}`] : []
|
|
19
|
-
].join(`
|
|
20
|
-
`);
|
|
21
|
-
super(b, e.cause ? { cause: e.cause } : void 0), Object.defineProperty(this, "details", {
|
|
22
|
-
enumerable: !0,
|
|
23
|
-
configurable: !0,
|
|
24
|
-
writable: !0,
|
|
25
|
-
value: void 0
|
|
26
|
-
}), Object.defineProperty(this, "docsPath", {
|
|
27
|
-
enumerable: !0,
|
|
28
|
-
configurable: !0,
|
|
29
|
-
writable: !0,
|
|
30
|
-
value: void 0
|
|
31
|
-
}), Object.defineProperty(this, "metaMessages", {
|
|
32
|
-
enumerable: !0,
|
|
33
|
-
configurable: !0,
|
|
34
|
-
writable: !0,
|
|
35
|
-
value: void 0
|
|
36
|
-
}), Object.defineProperty(this, "shortMessage", {
|
|
37
|
-
enumerable: !0,
|
|
38
|
-
configurable: !0,
|
|
39
|
-
writable: !0,
|
|
40
|
-
value: void 0
|
|
41
|
-
}), Object.defineProperty(this, "version", {
|
|
42
|
-
enumerable: !0,
|
|
43
|
-
configurable: !0,
|
|
44
|
-
writable: !0,
|
|
45
|
-
value: void 0
|
|
46
|
-
}), Object.defineProperty(this, "name", {
|
|
47
|
-
enumerable: !0,
|
|
48
|
-
configurable: !0,
|
|
49
|
-
writable: !0,
|
|
50
|
-
value: "BaseError"
|
|
51
|
-
}), this.details = u, this.docsPath = a, this.metaMessages = e.metaMessages, this.name = e.name ?? this.name, this.shortMessage = t, this.version = l;
|
|
52
|
-
}
|
|
53
|
-
walk(t) {
|
|
54
|
-
return d(this, t);
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
function d(s, t) {
|
|
58
|
-
return t != null && t(s) ? s : s && typeof s == "object" && "cause" in s && s.cause !== void 0 ? d(s.cause, t) : t ? null : s;
|
|
1
|
+
import { gweiUnits as i } from "./index93.js";
|
|
2
|
+
import { formatUnits as o } from "./index94.js";
|
|
3
|
+
function f(r, t = "wei") {
|
|
4
|
+
return o(r, i[t]);
|
|
59
5
|
}
|
|
60
6
|
export {
|
|
61
|
-
|
|
7
|
+
f as formatGwei
|
|
62
8
|
};
|
package/dist/index57.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=(e,n,i)=>JSON.stringify(e,(o,t)=>typeof t=="bigint"?t.toString():t,i);exports.stringify=r;
|
package/dist/index57.js
CHANGED
|
@@ -1,24 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
constructor(e) {
|
|
3
|
-
super(), Object.defineProperty(this, "maxSize", {
|
|
4
|
-
enumerable: !0,
|
|
5
|
-
configurable: !0,
|
|
6
|
-
writable: !0,
|
|
7
|
-
value: void 0
|
|
8
|
-
}), this.maxSize = e;
|
|
9
|
-
}
|
|
10
|
-
get(e) {
|
|
11
|
-
const t = super.get(e);
|
|
12
|
-
return super.has(e) && t !== void 0 && (this.delete(e), super.set(e, t)), t;
|
|
13
|
-
}
|
|
14
|
-
set(e, t) {
|
|
15
|
-
if (super.set(e, t), this.maxSize && this.size > this.maxSize) {
|
|
16
|
-
const s = this.keys().next().value;
|
|
17
|
-
s && this.delete(s);
|
|
18
|
-
}
|
|
19
|
-
return this;
|
|
20
|
-
}
|
|
21
|
-
}
|
|
1
|
+
const g = (r, n, i) => JSON.stringify(r, (e, t) => typeof t == "bigint" ? t.toString() : t, i);
|
|
22
2
|
export {
|
|
23
|
-
|
|
3
|
+
g as stringify
|
|
24
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"});class i extends Map{constructor(e){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=e}get(e){const t=super.get(e);return super.has(e)&&t!==void 0&&(this.delete(e),super.set(e,t)),t}set(e,t){if(super.set(e,t),this.maxSize&&this.size>this.maxSize){const s=this.keys().next().value;s&&this.delete(s)}return this}}exports.LruMap=i;
|
package/dist/index58.js
CHANGED
|
@@ -1,107 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
s
|
|
18
|
-
for (let i = 0; i < 10; i += 2) {
|
|
19
|
-
const h = (i + 8) % 10, l = (i + 2) % 10, u = s[l], c = s[l + 1], _ = O(u, c, 1) ^ s[h], g = w(u, c, 1) ^ s[h + 1];
|
|
20
|
-
for (let a = 0; a < 50; a += 10)
|
|
21
|
-
e[i + a] ^= _, e[i + a + 1] ^= g;
|
|
22
|
-
}
|
|
23
|
-
let o = e[2], r = e[3];
|
|
24
|
-
for (let i = 0; i < 24; i++) {
|
|
25
|
-
const h = L[i], l = O(o, r, h), u = w(o, r, h), c = y[i];
|
|
26
|
-
o = e[c], r = e[c + 1], e[c] = l, e[c + 1] = u;
|
|
27
|
-
}
|
|
28
|
-
for (let i = 0; i < 50; i += 10) {
|
|
29
|
-
for (let h = 0; h < 10; h++)
|
|
30
|
-
s[h] = e[i + h];
|
|
31
|
-
for (let h = 0; h < 10; h++)
|
|
32
|
-
e[i + h] ^= ~s[(h + 2) % 10] & s[(h + 4) % 10];
|
|
33
|
-
}
|
|
34
|
-
e[0] ^= v[n], e[1] ^= z[n];
|
|
35
|
-
}
|
|
36
|
-
s.fill(0);
|
|
37
|
-
}
|
|
38
|
-
class p extends E {
|
|
39
|
-
// NOTE: we accept arguments in bytes instead of bits here.
|
|
40
|
-
constructor(t, s, n, o = !1, r = 24) {
|
|
41
|
-
if (super(), this.blockLen = t, this.suffix = s, this.outputLen = n, this.enableXOF = o, this.rounds = r, this.pos = 0, this.posOut = 0, this.finished = !1, this.destroyed = !1, d(n), 0 >= this.blockLen || this.blockLen >= 200)
|
|
42
|
-
throw new Error("Sha3 supports only keccak-f1600 function");
|
|
43
|
-
this.state = new Uint8Array(200), this.state32 = U(this.state);
|
|
44
|
-
}
|
|
45
|
-
keccak() {
|
|
46
|
-
x || I(this.state32), D(this.state32, this.rounds), x || I(this.state32), this.posOut = 0, this.pos = 0;
|
|
47
|
-
}
|
|
48
|
-
update(t) {
|
|
49
|
-
k(this);
|
|
50
|
-
const { blockLen: s, state: n } = this;
|
|
51
|
-
t = P(t);
|
|
52
|
-
const o = t.length;
|
|
53
|
-
for (let r = 0; r < o; ) {
|
|
54
|
-
const i = Math.min(s - this.pos, o - r);
|
|
55
|
-
for (let h = 0; h < i; h++)
|
|
56
|
-
n[this.pos++] ^= t[r++];
|
|
57
|
-
this.pos === s && this.keccak();
|
|
1
|
+
class r extends Map {
|
|
2
|
+
constructor(e) {
|
|
3
|
+
super(), Object.defineProperty(this, "maxSize", {
|
|
4
|
+
enumerable: !0,
|
|
5
|
+
configurable: !0,
|
|
6
|
+
writable: !0,
|
|
7
|
+
value: void 0
|
|
8
|
+
}), this.maxSize = e;
|
|
9
|
+
}
|
|
10
|
+
get(e) {
|
|
11
|
+
const t = super.get(e);
|
|
12
|
+
return super.has(e) && t !== void 0 && (this.delete(e), super.set(e, t)), t;
|
|
13
|
+
}
|
|
14
|
+
set(e, t) {
|
|
15
|
+
if (super.set(e, t), this.maxSize && this.size > this.maxSize) {
|
|
16
|
+
const s = this.keys().next().value;
|
|
17
|
+
s && this.delete(s);
|
|
58
18
|
}
|
|
59
19
|
return this;
|
|
60
20
|
}
|
|
61
|
-
finish() {
|
|
62
|
-
if (this.finished)
|
|
63
|
-
return;
|
|
64
|
-
this.finished = !0;
|
|
65
|
-
const { state: t, suffix: s, pos: n, blockLen: o } = this;
|
|
66
|
-
t[n] ^= s, s & 128 && n === o - 1 && this.keccak(), t[o - 1] ^= 128, this.keccak();
|
|
67
|
-
}
|
|
68
|
-
writeInto(t) {
|
|
69
|
-
k(this, !1), B(t), this.finish();
|
|
70
|
-
const s = this.state, { blockLen: n } = this;
|
|
71
|
-
for (let o = 0, r = t.length; o < r; ) {
|
|
72
|
-
this.posOut >= n && this.keccak();
|
|
73
|
-
const i = Math.min(n - this.posOut, r - o);
|
|
74
|
-
t.set(s.subarray(this.posOut, this.posOut + i), o), this.posOut += i, o += i;
|
|
75
|
-
}
|
|
76
|
-
return t;
|
|
77
|
-
}
|
|
78
|
-
xofInto(t) {
|
|
79
|
-
if (!this.enableXOF)
|
|
80
|
-
throw new Error("XOF is not possible for this instance");
|
|
81
|
-
return this.writeInto(t);
|
|
82
|
-
}
|
|
83
|
-
xof(t) {
|
|
84
|
-
return d(t), this.xofInto(new Uint8Array(t));
|
|
85
|
-
}
|
|
86
|
-
digestInto(t) {
|
|
87
|
-
if (A(t, this), this.finished)
|
|
88
|
-
throw new Error("digest() was already called");
|
|
89
|
-
return this.writeInto(t), this.destroy(), t;
|
|
90
|
-
}
|
|
91
|
-
digest() {
|
|
92
|
-
return this.digestInto(new Uint8Array(this.outputLen));
|
|
93
|
-
}
|
|
94
|
-
destroy() {
|
|
95
|
-
this.destroyed = !0, this.state.fill(0);
|
|
96
|
-
}
|
|
97
|
-
_cloneInto(t) {
|
|
98
|
-
const { blockLen: s, suffix: n, outputLen: o, rounds: r, enableXOF: i } = this;
|
|
99
|
-
return t || (t = new p(s, n, o, i, r)), t.state32.set(this.state32), t.pos = this.pos, t.posOut = this.posOut, t.finished = this.finished, t.rounds = r, t.suffix = n, t.outputLen = o, t.enableXOF = i, t.destroyed = this.destroyed, t;
|
|
100
|
-
}
|
|
101
21
|
}
|
|
102
|
-
const G = (e, t, s) => X(() => new p(t, e, s)), Q = /* @__PURE__ */ G(1, 136, 256 / 8);
|
|
103
22
|
export {
|
|
104
|
-
|
|
105
|
-
D as keccakP,
|
|
106
|
-
Q as keccak_256
|
|
23
|
+
r as LruMap
|
|
107
24
|
};
|
package/dist/index59.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 i=require("./index38.cjs"),l=require("./index26.cjs");function c(o){const{kzg:s}=o,n=o.to??(typeof o.blobs[0]=="string"?"hex":"bytes"),e=typeof o.blobs[0]=="string"?o.blobs.map(t=>i.hexToBytes(t)):o.blobs,b=[];for(const t of e)b.push(Uint8Array.from(s.blobToKzgCommitment(t)));return n==="bytes"?b:b.map(t=>l.bytesToHex(t))}exports.blobsToCommitments=c;
|
package/dist/index59.js
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { hexToBytes as i } from "./index38.js";
|
|
2
|
+
import { bytesToHex as f } from "./index26.js";
|
|
3
|
+
function y(o) {
|
|
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
|
+
for (const t of m)
|
|
6
|
+
b.push(Uint8Array.from(s.blobToKzgCommitment(t)));
|
|
7
|
+
return n === "bytes" ? b : b.map((t) => f(t));
|
|
3
8
|
}
|
|
4
9
|
export {
|
|
5
|
-
|
|
10
|
+
y as blobsToCommitments
|
|
6
11
|
};
|
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 b=require("./index38.cjs"),y=require("./index26.cjs");function f(t){const{kzg:c}=t,e=t.to??(typeof t.blobs[0]=="string"?"hex":"bytes"),n=typeof t.blobs[0]=="string"?t.blobs.map(o=>b.hexToBytes(o)):t.blobs,i=typeof t.commitments[0]=="string"?t.commitments.map(o=>b.hexToBytes(o)):t.commitments,s=[];for(let o=0;o<n.length;o++){const l=n[o],m=i[o];s.push(Uint8Array.from(c.computeBlobKzgProof(l,m)))}return e==="bytes"?s:s.map(o=>y.bytesToHex(o))}exports.blobsToProofs=f;
|
package/dist/index60.js
CHANGED
|
@@ -1,20 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
function
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const { chainId: n, nonce: e, ...s } = o, a = o.address;
|
|
9
|
-
t.push([
|
|
10
|
-
n ? i(n) : "0x",
|
|
11
|
-
a,
|
|
12
|
-
e ? i(e) : "0x",
|
|
13
|
-
...c({}, s)
|
|
14
|
-
]);
|
|
1
|
+
import { hexToBytes as b } from "./index38.js";
|
|
2
|
+
import { bytesToHex as y } from "./index26.js";
|
|
3
|
+
function h(t) {
|
|
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
|
+
for (let o = 0; o < s.length; o++) {
|
|
6
|
+
const f = s[o], l = i[o];
|
|
7
|
+
n.push(Uint8Array.from(m.computeBlobKzgProof(f, l)));
|
|
15
8
|
}
|
|
16
|
-
return
|
|
9
|
+
return c === "bytes" ? n : n.map((o) => y(o));
|
|
17
10
|
}
|
|
18
11
|
export {
|
|
19
|
-
|
|
12
|
+
h as blobsToProofs
|
|
20
13
|
};
|
package/dist/index61.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index62.cjs");function c(o){const{commitments:e,version:s}=o,n=o.to??(typeof e[0]=="string"?"hex":"bytes"),t=[];for(const m of e)t.push(i.commitmentToVersionedHash({commitment:m,to:n,version:s}));return t}exports.commitmentsToVersionedHashes=c;
|
package/dist/index61.js
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { commitmentToVersionedHash as i } from "./index62.js";
|
|
2
|
+
function r(o) {
|
|
3
|
+
const { commitments: t, version: n } = o, e = o.to ?? (typeof t[0] == "string" ? "hex" : "bytes"), s = [];
|
|
4
|
+
for (const m of t)
|
|
5
|
+
s.push(i({
|
|
6
|
+
commitment: m,
|
|
7
|
+
to: e,
|
|
8
|
+
version: n
|
|
9
|
+
}));
|
|
10
|
+
return s;
|
|
8
11
|
}
|
|
9
12
|
export {
|
|
10
|
-
|
|
13
|
+
r as commitmentsToVersionedHashes
|
|
11
14
|
};
|
package/dist/index62.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 i=require("./index26.cjs"),r=require("./index96.cjs");function c(t){const{commitment:o,version:s=1}=t,n=t.to??(typeof o=="string"?"hex":"bytes"),e=r.sha256(o);return e.set([s],0),n==="bytes"?e:i.bytesToHex(e)}exports.commitmentToVersionedHash=c;
|
package/dist/index62.js
CHANGED
|
@@ -1,13 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
function
|
|
4
|
-
const {
|
|
5
|
-
|
|
6
|
-
const f = s[o], l = i[o];
|
|
7
|
-
n.push(Uint8Array.from(m.computeBlobKzgProof(f, l)));
|
|
8
|
-
}
|
|
9
|
-
return c === "bytes" ? n : n.map((o) => y(o));
|
|
1
|
+
import { bytesToHex as i } from "./index26.js";
|
|
2
|
+
import { sha256 as m } from "./index96.js";
|
|
3
|
+
function f(t) {
|
|
4
|
+
const { commitment: e, version: s = 1 } = t, n = t.to ?? (typeof e == "string" ? "hex" : "bytes"), o = m(e);
|
|
5
|
+
return o.set([s], 0), n === "bytes" ? o : i(o);
|
|
10
6
|
}
|
|
11
7
|
export {
|
|
12
|
-
|
|
8
|
+
f as commitmentToVersionedHash
|
|
13
9
|
};
|
package/dist/index63.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 r=require("./index59.cjs"),m=require("./index60.cjs"),u=require("./index64.cjs");function f(t){const{data:i,kzg:n,to:b}=t,s=t.blobs??u.toBlobs({data:i,to:b}),e=t.commitments??r.blobsToCommitments({blobs:s,kzg:n,to:b}),l=t.proofs??m.blobsToProofs({blobs:s,commitments:e,kzg:n,to:b}),c=[];for(let o=0;o<s.length;o++)c.push({blob:s[o],commitment:e[o],proof:l[o]});return c}exports.toBlobSidecars=f;
|
package/dist/index63.js
CHANGED
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import { blobsToCommitments as f } from "./index59.js";
|
|
2
|
+
import { blobsToProofs as l } from "./index60.js";
|
|
3
|
+
import { toBlobs as p } from "./index64.js";
|
|
4
|
+
function k(t) {
|
|
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
|
+
for (let o = 0; o < s.length; o++)
|
|
7
|
+
c.push({
|
|
8
|
+
blob: s[o],
|
|
9
|
+
commitment: b[o],
|
|
10
|
+
proof: r[o]
|
|
11
|
+
});
|
|
12
|
+
return c;
|
|
11
13
|
}
|
|
12
14
|
export {
|
|
13
|
-
|
|
15
|
+
k as toBlobSidecars
|
|
14
16
|
};
|
package/dist/index64.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("./index100.cjs"),y=require("./index98.cjs"),u=require("./index95.cjs"),B=require("./index51.cjs"),h=require("./index38.cjs"),d=require("./index26.cjs");function f(t){const a=t.to??(typeof t.data=="string"?"hex":"bytes"),n=typeof t.data=="string"?h.hexToBytes(t.data):t.data,s=B.size(n);if(!s)throw new y.EmptyBlobError;if(s>o.maxBytesPerTransaction)throw new y.BlobSizeTooLargeError({maxSize:o.maxBytesPerTransaction,size:s});const r=[];let b=!0,i=0;for(;b;){const e=u.createCursor(new Uint8Array(o.bytesPerBlob));let l=0;for(;l<o.fieldElementsPerBlob;){const c=n.slice(i,i+(o.bytesPerFieldElement-1));if(e.pushByte(0),e.pushBytes(c),c.length<31){e.pushByte(128),b=!1;break}l++,i+=31}r.push(e)}return a==="bytes"?r.map(e=>e.bytes):r.map(e=>d.bytesToHex(e.bytes))}exports.toBlobs=f;
|
package/dist/index64.js
CHANGED
|
@@ -1,16 +1,35 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import { maxBytesPerTransaction as y, bytesPerBlob as a, fieldElementsPerBlob as f, bytesPerFieldElement as p } from "./index100.js";
|
|
2
|
+
import { EmptyBlobError as c, BlobSizeTooLargeError as h } from "./index98.js";
|
|
3
|
+
import { createCursor as B } from "./index95.js";
|
|
4
|
+
import { size as u } from "./index51.js";
|
|
5
|
+
import { hexToBytes as x } from "./index38.js";
|
|
6
|
+
import { bytesToHex as d } from "./index26.js";
|
|
7
|
+
function S(e) {
|
|
8
|
+
const m = e.to ?? (typeof e.data == "string" ? "hex" : "bytes"), i = typeof e.data == "string" ? x(e.data) : e.data, o = u(i);
|
|
9
|
+
if (!o)
|
|
10
|
+
throw new c();
|
|
11
|
+
if (o > y)
|
|
12
|
+
throw new h({
|
|
13
|
+
maxSize: y,
|
|
14
|
+
size: o
|
|
11
15
|
});
|
|
12
|
-
|
|
16
|
+
const s = [];
|
|
17
|
+
let n = !0, r = 0;
|
|
18
|
+
for (; n; ) {
|
|
19
|
+
const t = B(new Uint8Array(a));
|
|
20
|
+
let l = 0;
|
|
21
|
+
for (; l < f; ) {
|
|
22
|
+
const b = i.slice(r, r + (p - 1));
|
|
23
|
+
if (t.pushByte(0), t.pushBytes(b), b.length < 31) {
|
|
24
|
+
t.pushByte(128), n = !1;
|
|
25
|
+
break;
|
|
26
|
+
}
|
|
27
|
+
l++, r += 31;
|
|
28
|
+
}
|
|
29
|
+
s.push(t);
|
|
30
|
+
}
|
|
31
|
+
return m === "bytes" ? s.map((t) => t.bytes) : s.map((t) => d(t.bytes));
|
|
13
32
|
}
|
|
14
33
|
export {
|
|
15
|
-
|
|
34
|
+
S as toBlobs
|
|
16
35
|
};
|
package/dist/index65.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index23.cjs");function f(e){if(e.type)return e.type;if(typeof e.authorizationList<"u")return"eip7702";if(typeof e.blobs<"u"||typeof e.blobVersionedHashes<"u"||typeof e.maxFeePerBlobGas<"u"||typeof e.sidecars<"u")return"eip4844";if(typeof e.maxFeePerGas<"u"||typeof e.maxPriorityFeePerGas<"u")return"eip1559";if(typeof e.gasPrice<"u")return typeof e.accessList<"u"?"eip2930":"legacy";throw new i.InvalidSerializableTransactionError({transaction:e})}exports.getTransactionType=f;
|