@coinbase/cdp-core 0.0.48 → 0.0.49
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/esm/index.native102.js +19 -77
- package/dist/esm/index.native103.js +9 -9
- package/dist/esm/index.native104.js +19 -20
- package/dist/esm/index.native105.js +93 -9
- package/dist/esm/index.native106.js +19 -18
- package/dist/esm/index.native107.js +105 -81
- package/dist/esm/index.native108.js +9 -20
- package/dist/esm/index.native109.js +73 -112
- package/dist/esm/index.native111.js +18 -13
- package/dist/esm/index.native112.js +27 -35
- package/dist/esm/index.native113.js +7 -41
- package/dist/esm/index.native114.js +11 -18
- package/dist/esm/index.native115.js +13 -28
- package/dist/esm/index.native116.js +10 -8
- package/dist/esm/index.native117.js +17 -11
- package/dist/esm/index.native118.js +80 -12
- package/dist/esm/index.native119.js +13 -10
- package/dist/esm/index.native12.js +4 -4
- package/dist/esm/index.native120.js +36 -17
- package/dist/esm/index.native121.js +40 -79
- package/dist/esm/index.native17.js +1 -1
- package/dist/esm/index.native18.js +33 -24
- package/dist/esm/index.native2.js +8 -6
- package/dist/esm/index.native22.js +1 -1
- package/dist/esm/index.native3.js +2 -2
- package/dist/esm/index.native32.js +940 -149
- package/dist/esm/index.native33.js +2 -48
- package/dist/esm/index.native34.js +43 -244
- package/dist/esm/index.native35.js +27 -55
- package/dist/esm/index.native36.js +149 -940
- package/dist/esm/index.native37.js +48 -2
- package/dist/esm/index.native38.js +244 -43
- package/dist/esm/index.native39.js +55 -27
- package/dist/esm/index.native4.js +4 -2
- package/dist/esm/index.native5.js +19 -17
- package/dist/esm/index.native6.js +10 -8
- package/dist/esm/index.native90.js +6 -6
- package/dist/esm/index.native99.js +1 -1
- package/dist/esm/index.web100.js +2 -7
- package/dist/esm/index.web101.js +17 -17
- package/dist/esm/index.web102.js +20 -10
- package/dist/esm/index.web103.js +80 -20
- package/dist/esm/index.web104.js +99 -89
- package/dist/esm/index.web105.js +32 -20
- package/dist/esm/index.web106.js +7 -118
- package/dist/esm/index.web107.js +10 -79
- package/dist/esm/index.web108.js +79 -10
- package/dist/esm/index.web109.js +18 -5
- package/dist/esm/index.web110.js +28 -18
- package/dist/esm/index.web111.js +6 -26
- package/dist/esm/index.web112.js +9 -6
- package/dist/esm/index.web113.js +13 -11
- package/dist/esm/index.web114.js +8 -11
- package/dist/esm/index.web115.js +14 -7
- package/dist/esm/index.web116.js +80 -16
- package/dist/esm/index.web117.js +5 -81
- package/dist/esm/index.web119.js +4 -4
- package/dist/esm/index.web120.js +5 -5
- package/dist/esm/index.web16.js +1 -1
- package/dist/esm/index.web17.js +33 -24
- package/dist/esm/index.web2.js +10 -8
- package/dist/esm/index.web21.js +1 -1
- package/dist/esm/index.web25.js +13 -13
- package/dist/esm/index.web27.js +3 -3
- package/dist/esm/index.web3.js +4 -2
- package/dist/esm/index.web30.js +2 -2
- package/dist/esm/index.web34.js +2 -2
- package/dist/esm/index.web35.js +16 -950
- package/dist/esm/index.web36.js +23 -2
- package/dist/esm/index.web37.js +50 -49
- package/dist/esm/index.web38.js +950 -27
- package/dist/esm/index.web39.js +2 -17
- package/dist/esm/index.web4.js +12 -12
- package/dist/esm/index.web40.js +48 -21
- package/dist/esm/index.web41.js +27 -50
- package/dist/esm/index.web44.js +54 -8
- package/dist/esm/index.web45.js +9 -16
- package/dist/esm/index.web46.js +2 -46
- package/dist/esm/index.web47.js +45 -14
- package/dist/esm/index.web48.js +12 -54
- package/dist/esm/index.web49.js +8 -6
- package/dist/esm/index.web5.js +4 -2
- package/dist/esm/index.web50.js +16 -20
- package/dist/esm/index.web51.js +45 -11
- package/dist/esm/index.web52.js +13 -3
- package/dist/esm/index.web53.js +55 -3
- package/dist/esm/index.web54.js +6 -34
- package/dist/esm/index.web55.js +19 -10
- package/dist/esm/index.web56.js +11 -4
- package/dist/esm/index.web57.js +3 -28
- package/dist/esm/index.web58.js +3 -6
- package/dist/esm/index.web59.js +34 -24
- package/dist/esm/index.web60.js +12 -16
- package/dist/esm/index.web61.js +4 -54
- package/dist/esm/index.web62.js +25 -20
- package/dist/esm/index.web63.js +6 -11
- package/dist/esm/index.web64.js +23 -26
- package/dist/esm/index.web65.js +16 -42
- package/dist/esm/index.web66.js +52 -53
- package/dist/esm/index.web67.js +23 -127
- package/dist/esm/index.web68.js +11 -12
- package/dist/esm/index.web69.js +27 -104
- package/dist/esm/index.web70.js +42 -6
- package/dist/esm/index.web71.js +56 -3
- package/dist/esm/index.web72.js +127 -14
- package/dist/esm/index.web73.js +9 -39
- package/dist/esm/index.web74.js +100 -74
- package/dist/esm/index.web75.js +7 -2
- package/dist/esm/index.web76.js +3 -2
- package/dist/esm/index.web77.js +14 -12
- package/dist/esm/index.web78.js +34 -29
- package/dist/esm/index.web79.js +77 -5
- package/dist/esm/index.web80.js +2 -35
- package/dist/esm/index.web81.js +2 -9
- package/dist/esm/index.web82.js +11 -9
- package/dist/esm/index.web83.js +37 -11
- package/dist/esm/index.web84.js +6 -13
- package/dist/esm/index.web85.js +33 -17
- package/dist/esm/index.web86.js +8 -5
- package/dist/esm/index.web87.js +11 -5
- package/dist/esm/index.web88.js +11 -10
- package/dist/esm/index.web89.js +13 -54
- package/dist/esm/index.web90.js +18 -10
- package/dist/esm/index.web91.js +6 -2
- package/dist/esm/index.web92.js +4 -44
- package/dist/esm/index.web93.js +10 -13
- package/dist/esm/index.web94.js +21 -2
- package/dist/esm/index.web95.js +10 -21
- package/dist/esm/index.web96.js +19 -19
- package/dist/esm/index.web97.js +94 -80
- package/dist/esm/index.web98.js +20 -103
- package/dist/esm/index.web99.js +115 -30
- package/dist/native/index.native102.js +19 -77
- package/dist/native/index.native103.js +9 -9
- package/dist/native/index.native104.js +19 -20
- package/dist/native/index.native105.js +93 -9
- package/dist/native/index.native106.js +19 -18
- package/dist/native/index.native107.js +105 -81
- package/dist/native/index.native108.js +9 -20
- package/dist/native/index.native109.js +73 -112
- package/dist/native/index.native111.js +18 -13
- package/dist/native/index.native112.js +27 -35
- package/dist/native/index.native113.js +7 -41
- package/dist/native/index.native114.js +11 -18
- package/dist/native/index.native115.js +13 -28
- package/dist/native/index.native116.js +10 -8
- package/dist/native/index.native117.js +17 -11
- package/dist/native/index.native118.js +80 -12
- package/dist/native/index.native119.js +13 -10
- package/dist/native/index.native12.js +4 -4
- package/dist/native/index.native120.js +36 -17
- package/dist/native/index.native121.js +40 -79
- package/dist/native/index.native17.js +1 -1
- package/dist/native/index.native18.js +33 -24
- package/dist/native/index.native2.js +8 -6
- package/dist/native/index.native22.js +1 -1
- package/dist/native/index.native3.js +2 -2
- package/dist/native/index.native32.js +940 -149
- package/dist/native/index.native33.js +2 -48
- package/dist/native/index.native34.js +43 -244
- package/dist/native/index.native35.js +27 -55
- package/dist/native/index.native36.js +149 -940
- package/dist/native/index.native37.js +48 -2
- package/dist/native/index.native38.js +244 -43
- package/dist/native/index.native39.js +55 -27
- package/dist/native/index.native4.js +4 -2
- package/dist/native/index.native5.js +19 -17
- package/dist/native/index.native6.js +10 -8
- package/dist/native/index.native90.js +6 -6
- package/dist/native/index.native99.js +1 -1
- package/dist/native-types/platform/types.d.ts +3 -3
- package/dist/native-types/types.d.ts +5 -7
- package/dist/types/platform/types.d.ts +3 -3
- package/dist/types/types.d.ts +5 -7
- package/dist/web/index.web100.js +2 -7
- package/dist/web/index.web101.js +17 -17
- package/dist/web/index.web102.js +20 -10
- package/dist/web/index.web103.js +80 -20
- package/dist/web/index.web104.js +99 -89
- package/dist/web/index.web105.js +32 -20
- package/dist/web/index.web106.js +7 -118
- package/dist/web/index.web107.js +10 -79
- package/dist/web/index.web108.js +79 -10
- package/dist/web/index.web109.js +18 -5
- package/dist/web/index.web110.js +28 -18
- package/dist/web/index.web111.js +6 -26
- package/dist/web/index.web112.js +9 -6
- package/dist/web/index.web113.js +13 -11
- package/dist/web/index.web114.js +8 -11
- package/dist/web/index.web115.js +14 -7
- package/dist/web/index.web116.js +80 -16
- package/dist/web/index.web117.js +5 -81
- package/dist/web/index.web119.js +4 -4
- package/dist/web/index.web120.js +5 -5
- package/dist/web/index.web16.js +1 -1
- package/dist/web/index.web17.js +33 -24
- package/dist/web/index.web2.js +10 -8
- package/dist/web/index.web21.js +1 -1
- package/dist/web/index.web25.js +13 -13
- package/dist/web/index.web27.js +3 -3
- package/dist/web/index.web3.js +4 -2
- package/dist/web/index.web30.js +2 -2
- package/dist/web/index.web34.js +2 -2
- package/dist/web/index.web35.js +16 -950
- package/dist/web/index.web36.js +23 -2
- package/dist/web/index.web37.js +50 -49
- package/dist/web/index.web38.js +950 -27
- package/dist/web/index.web39.js +2 -17
- package/dist/web/index.web4.js +12 -12
- package/dist/web/index.web40.js +48 -21
- package/dist/web/index.web41.js +27 -50
- package/dist/web/index.web44.js +54 -8
- package/dist/web/index.web45.js +9 -16
- package/dist/web/index.web46.js +2 -46
- package/dist/web/index.web47.js +45 -14
- package/dist/web/index.web48.js +12 -54
- package/dist/web/index.web49.js +8 -6
- package/dist/web/index.web5.js +4 -2
- package/dist/web/index.web50.js +16 -20
- package/dist/web/index.web51.js +45 -11
- package/dist/web/index.web52.js +13 -3
- package/dist/web/index.web53.js +55 -3
- package/dist/web/index.web54.js +6 -34
- package/dist/web/index.web55.js +19 -10
- package/dist/web/index.web56.js +11 -4
- package/dist/web/index.web57.js +3 -28
- package/dist/web/index.web58.js +3 -6
- package/dist/web/index.web59.js +34 -24
- package/dist/web/index.web60.js +12 -16
- package/dist/web/index.web61.js +4 -54
- package/dist/web/index.web62.js +25 -20
- package/dist/web/index.web63.js +6 -11
- package/dist/web/index.web64.js +23 -26
- package/dist/web/index.web65.js +16 -42
- package/dist/web/index.web66.js +52 -53
- package/dist/web/index.web67.js +23 -127
- package/dist/web/index.web68.js +11 -12
- package/dist/web/index.web69.js +27 -104
- package/dist/web/index.web70.js +42 -6
- package/dist/web/index.web71.js +56 -3
- package/dist/web/index.web72.js +127 -14
- package/dist/web/index.web73.js +9 -39
- package/dist/web/index.web74.js +100 -74
- package/dist/web/index.web75.js +7 -2
- package/dist/web/index.web76.js +3 -2
- package/dist/web/index.web77.js +14 -12
- package/dist/web/index.web78.js +34 -29
- package/dist/web/index.web79.js +77 -5
- package/dist/web/index.web80.js +2 -35
- package/dist/web/index.web81.js +2 -9
- package/dist/web/index.web82.js +11 -9
- package/dist/web/index.web83.js +37 -11
- package/dist/web/index.web84.js +6 -13
- package/dist/web/index.web85.js +33 -17
- package/dist/web/index.web86.js +8 -5
- package/dist/web/index.web87.js +11 -5
- package/dist/web/index.web88.js +11 -10
- package/dist/web/index.web89.js +13 -54
- package/dist/web/index.web90.js +18 -10
- package/dist/web/index.web91.js +6 -2
- package/dist/web/index.web92.js +4 -44
- package/dist/web/index.web93.js +10 -13
- package/dist/web/index.web94.js +21 -2
- package/dist/web/index.web95.js +10 -21
- package/dist/web/index.web96.js +19 -19
- package/dist/web/index.web97.js +94 -80
- package/dist/web/index.web98.js +20 -103
- package/dist/web/index.web99.js +115 -30
- package/dist/web-types/platform/types.d.ts +3 -3
- package/dist/web-types/types.d.ts +5 -7
- package/package.json +2 -2
package/dist/web/index.web82.js
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { BaseError as r } from "./index.web71.js";
|
|
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
|
+
});
|
|
8
11
|
}
|
|
9
|
-
return c === "bytes" ? n : n.map((o) => y(o));
|
|
10
12
|
}
|
|
11
13
|
export {
|
|
12
|
-
|
|
14
|
+
d as InvalidAddressError
|
|
13
15
|
};
|
package/dist/web/index.web83.js
CHANGED
|
@@ -1,14 +1,40 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import { versionedHashVersionKzg as a } from "./index.web80.js";
|
|
2
|
+
import { BaseError as s } from "./index.web71.js";
|
|
3
|
+
class t extends s {
|
|
4
|
+
constructor({ maxSize: e, size: r }) {
|
|
5
|
+
super("Blob size is too large.", {
|
|
6
|
+
metaMessages: [`Max: ${e} bytes`, `Given: ${r} bytes`],
|
|
7
|
+
name: "BlobSizeTooLargeError"
|
|
8
|
+
});
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
class d extends s {
|
|
12
|
+
constructor() {
|
|
13
|
+
super("Blob data must not be empty.", { name: "EmptyBlobError" });
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
class l extends s {
|
|
17
|
+
constructor({ hash: e, size: r }) {
|
|
18
|
+
super(`Versioned hash "${e}" size is invalid.`, {
|
|
19
|
+
metaMessages: ["Expected: 32", `Received: ${r}`],
|
|
20
|
+
name: "InvalidVersionedHashSizeError"
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
class c extends s {
|
|
25
|
+
constructor({ hash: e, version: r }) {
|
|
26
|
+
super(`Versioned hash "${e}" version is invalid.`, {
|
|
27
|
+
metaMessages: [
|
|
28
|
+
`Expected: ${a}`,
|
|
29
|
+
`Received: ${r}`
|
|
30
|
+
],
|
|
31
|
+
name: "InvalidVersionedHashVersionError"
|
|
32
|
+
});
|
|
33
|
+
}
|
|
11
34
|
}
|
|
12
35
|
export {
|
|
13
|
-
|
|
36
|
+
t as BlobSizeTooLargeError,
|
|
37
|
+
d as EmptyBlobError,
|
|
38
|
+
l as InvalidVersionedHashSizeError,
|
|
39
|
+
c as InvalidVersionedHashVersionError
|
|
14
40
|
};
|
package/dist/web/index.web84.js
CHANGED
|
@@ -1,16 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
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;
|
|
1
|
+
import { BaseError as i } from "./index.web71.js";
|
|
2
|
+
class o extends i {
|
|
3
|
+
constructor({ chainId: r }) {
|
|
4
|
+
super(typeof r == "number" ? `Chain ID "${r}" is invalid.` : "Chain ID is invalid.", { name: "InvalidChainIdError" });
|
|
5
|
+
}
|
|
13
6
|
}
|
|
14
7
|
export {
|
|
15
|
-
|
|
8
|
+
o as InvalidChainIdError
|
|
16
9
|
};
|
package/dist/web/index.web85.js
CHANGED
|
@@ -1,21 +1,37 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const { address: i, storageKeys: e } = r[o];
|
|
10
|
-
for (let t = 0; t < e.length; t++)
|
|
11
|
-
if (e[t].length - 2 !== 64)
|
|
12
|
-
throw new l({ storageKey: e[t] });
|
|
13
|
-
if (!f(i, { strict: !1 }))
|
|
14
|
-
throw new s({ address: i });
|
|
15
|
-
n.push([i, e]);
|
|
1
|
+
import { formatGwei as a } from "./index.web91.js";
|
|
2
|
+
import { BaseError as o } from "./index.web71.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"
|
|
8
|
+
});
|
|
16
9
|
}
|
|
17
|
-
return n;
|
|
18
10
|
}
|
|
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
|
+
});
|
|
26
|
+
}
|
|
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
|
+
});
|
|
19
34
|
export {
|
|
20
|
-
|
|
35
|
+
n as FeeCapTooHighError,
|
|
36
|
+
h as TipAboveFeeCapError
|
|
21
37
|
};
|
package/dist/web/index.web86.js
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
function
|
|
4
|
-
|
|
1
|
+
import { hexToBytes as i } from "./index.web53.js";
|
|
2
|
+
import { bytesToHex as f } from "./index.web51.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));
|
|
5
8
|
}
|
|
6
9
|
export {
|
|
7
|
-
|
|
10
|
+
y as blobsToCommitments
|
|
8
11
|
};
|
package/dist/web/index.web87.js
CHANGED
|
@@ -1,7 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
1
|
+
import { hexToBytes as b } from "./index.web53.js";
|
|
2
|
+
import { bytesToHex as y } from "./index.web51.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)));
|
|
8
|
+
}
|
|
9
|
+
return c === "bytes" ? n : n.map((o) => y(o));
|
|
10
|
+
}
|
|
5
11
|
export {
|
|
6
|
-
|
|
12
|
+
h as blobsToProofs
|
|
7
13
|
};
|
package/dist/web/index.web88.js
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import { commitmentToVersionedHash as i } from "./index.web106.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;
|
|
10
11
|
}
|
|
11
12
|
export {
|
|
12
|
-
|
|
13
|
+
r as commitmentsToVersionedHashes
|
|
13
14
|
};
|
package/dist/web/index.web89.js
CHANGED
|
@@ -1,57 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
constructor(e) {
|
|
14
|
-
if (!(e instanceof Uint8Array))
|
|
15
|
-
throw new TypeError("payload must be an instance of Uint8Array");
|
|
16
|
-
this.#r = e;
|
|
17
|
-
}
|
|
18
|
-
setProtectedHeader(e) {
|
|
19
|
-
if (this.#e)
|
|
20
|
-
throw new TypeError("setProtectedHeader can only be called once");
|
|
21
|
-
return this.#e = e, this;
|
|
22
|
-
}
|
|
23
|
-
setUnprotectedHeader(e) {
|
|
24
|
-
if (this.#t)
|
|
25
|
-
throw new TypeError("setUnprotectedHeader can only be called once");
|
|
26
|
-
return this.#t = e, this;
|
|
27
|
-
}
|
|
28
|
-
async sign(e, l) {
|
|
29
|
-
if (!this.#e && !this.#t)
|
|
30
|
-
throw new r("either setProtectedHeader or setUnprotectedHeader must be called before #sign()");
|
|
31
|
-
if (!b(this.#e, this.#t))
|
|
32
|
-
throw new r("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");
|
|
33
|
-
const c = {
|
|
34
|
-
...this.#e,
|
|
35
|
-
...this.#t
|
|
36
|
-
}, p = H(r, /* @__PURE__ */ new Map([["b64", !0]]), l?.crit, this.#e, c);
|
|
37
|
-
let o = !0;
|
|
38
|
-
if (p.has("b64") && (o = this.#e.b64, typeof o != "boolean"))
|
|
39
|
-
throw new r('The "b64" (base64url-encode payload) Header Parameter must be a boolean');
|
|
40
|
-
const { alg: t } = c;
|
|
41
|
-
if (typeof t != "string" || !t)
|
|
42
|
-
throw new r('JWS "alg" (Algorithm) Header Parameter missing or invalid');
|
|
43
|
-
g(t, e, "sign");
|
|
44
|
-
let i = this.#r;
|
|
45
|
-
o && (i = s.encode(d(i)));
|
|
46
|
-
let n;
|
|
47
|
-
this.#e ? n = s.encode(d(JSON.stringify(this.#e))) : n = s.encode("");
|
|
48
|
-
const f = u(n, s.encode("."), i), m = await P(e, t), w = await y(t, m, f), a = {
|
|
49
|
-
signature: d(w),
|
|
50
|
-
payload: ""
|
|
51
|
-
};
|
|
52
|
-
return o && (a.payload = h.decode(i)), this.#t && (a.header = this.#t), this.#e && (a.protected = h.decode(n)), a;
|
|
53
|
-
}
|
|
1
|
+
import { blobsToCommitments as f } from "./index.web86.js";
|
|
2
|
+
import { blobsToProofs as l } from "./index.web87.js";
|
|
3
|
+
import { toBlobs as p } from "./index.web105.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;
|
|
54
13
|
}
|
|
55
14
|
export {
|
|
56
|
-
|
|
15
|
+
k as toBlobSidecars
|
|
57
16
|
};
|
package/dist/web/index.web90.js
CHANGED
|
@@ -1,13 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { InvalidAddressError as s } from "./index.web82.js";
|
|
2
|
+
import { InvalidStorageKeySizeError as l } from "./index.web78.js";
|
|
3
|
+
import { isAddress as f } from "./index.web56.js";
|
|
4
|
+
function a(r) {
|
|
5
|
+
if (!r || r.length === 0)
|
|
6
|
+
return [];
|
|
7
|
+
const n = [];
|
|
8
|
+
for (let o = 0; o < r.length; o++) {
|
|
9
|
+
const { address: i, storageKeys: e } = r[o];
|
|
10
|
+
for (let t = 0; t < e.length; t++)
|
|
11
|
+
if (e[t].length - 2 !== 64)
|
|
12
|
+
throw new l({ storageKey: e[t] });
|
|
13
|
+
if (!f(i, { strict: !1 }))
|
|
14
|
+
throw new s({ address: i });
|
|
15
|
+
n.push([i, e]);
|
|
16
|
+
}
|
|
17
|
+
return n;
|
|
8
18
|
}
|
|
9
19
|
export {
|
|
10
|
-
|
|
11
|
-
s as decoder,
|
|
12
|
-
d as encoder
|
|
20
|
+
a as serializeAccessList
|
|
13
21
|
};
|
package/dist/web/index.web91.js
CHANGED
package/dist/web/index.web92.js
CHANGED
|
@@ -1,47 +1,7 @@
|
|
|
1
|
-
const
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
throw new TypeError("Invalid time period format");
|
|
5
|
-
const a = parseFloat(s[2]), r = s[3].toLowerCase();
|
|
6
|
-
let e;
|
|
7
|
-
switch (r) {
|
|
8
|
-
case "sec":
|
|
9
|
-
case "secs":
|
|
10
|
-
case "second":
|
|
11
|
-
case "seconds":
|
|
12
|
-
case "s":
|
|
13
|
-
e = Math.round(a);
|
|
14
|
-
break;
|
|
15
|
-
case "minute":
|
|
16
|
-
case "minutes":
|
|
17
|
-
case "min":
|
|
18
|
-
case "mins":
|
|
19
|
-
case "m":
|
|
20
|
-
e = Math.round(a * 60);
|
|
21
|
-
break;
|
|
22
|
-
case "hour":
|
|
23
|
-
case "hours":
|
|
24
|
-
case "hr":
|
|
25
|
-
case "hrs":
|
|
26
|
-
case "h":
|
|
27
|
-
e = Math.round(a * 3600);
|
|
28
|
-
break;
|
|
29
|
-
case "day":
|
|
30
|
-
case "days":
|
|
31
|
-
case "d":
|
|
32
|
-
e = Math.round(a * 86400);
|
|
33
|
-
break;
|
|
34
|
-
case "week":
|
|
35
|
-
case "weeks":
|
|
36
|
-
case "w":
|
|
37
|
-
e = Math.round(a * 604800);
|
|
38
|
-
break;
|
|
39
|
-
default:
|
|
40
|
-
e = Math.round(a * 31557600);
|
|
41
|
-
break;
|
|
42
|
-
}
|
|
43
|
-
return s[1] === "-" || s[4] === "ago" ? -e : e;
|
|
1
|
+
const e = {
|
|
2
|
+
ether: -9,
|
|
3
|
+
wei: 9
|
|
44
4
|
};
|
|
45
5
|
export {
|
|
46
|
-
|
|
6
|
+
e as gweiUnits
|
|
47
7
|
};
|
package/dist/web/index.web93.js
CHANGED
|
@@ -1,16 +1,13 @@
|
|
|
1
|
-
function
|
|
2
|
-
|
|
1
|
+
function a(r, n) {
|
|
2
|
+
let t = r.toString();
|
|
3
|
+
const i = t.startsWith("-");
|
|
4
|
+
i && (t = t.slice(1)), t = t.padStart(n, "0");
|
|
5
|
+
let [l, e] = [
|
|
6
|
+
t.slice(0, t.length - n),
|
|
7
|
+
t.slice(t.length - n)
|
|
8
|
+
];
|
|
9
|
+
return e = e.replace(/(0+)$/, ""), `${i ? "-" : ""}${l || "0"}${e ? `.${e}` : ""}`;
|
|
3
10
|
}
|
|
4
|
-
const r = (t) => {
|
|
5
|
-
if (!o(t) || Object.prototype.toString.call(t) !== "[object Object]")
|
|
6
|
-
return !1;
|
|
7
|
-
if (Object.getPrototypeOf(t) === null)
|
|
8
|
-
return !0;
|
|
9
|
-
let e = t;
|
|
10
|
-
for (; Object.getPrototypeOf(e) !== null; )
|
|
11
|
-
e = Object.getPrototypeOf(e);
|
|
12
|
-
return Object.getPrototypeOf(t) === e;
|
|
13
|
-
};
|
|
14
11
|
export {
|
|
15
|
-
|
|
12
|
+
a as formatUnits
|
|
16
13
|
};
|
package/dist/web/index.web94.js
CHANGED
|
@@ -1,4 +1,23 @@
|
|
|
1
|
-
|
|
1
|
+
import { encoder as t, decoder as o } from "./index.web45.js";
|
|
2
|
+
import { encodeBase64 as c, decodeBase64 as a } from "./index.web109.js";
|
|
3
|
+
function i(r) {
|
|
4
|
+
if (Uint8Array.fromBase64)
|
|
5
|
+
return Uint8Array.fromBase64(typeof r == "string" ? r : o.decode(r), {
|
|
6
|
+
alphabet: "base64url"
|
|
7
|
+
});
|
|
8
|
+
let e = r;
|
|
9
|
+
e instanceof Uint8Array && (e = o.decode(e)), e = e.replace(/-/g, "+").replace(/_/g, "/").replace(/\s/g, "");
|
|
10
|
+
try {
|
|
11
|
+
return a(e);
|
|
12
|
+
} catch {
|
|
13
|
+
throw new TypeError("The input to be decoded is not correctly encoded.");
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
function p(r) {
|
|
17
|
+
let e = r;
|
|
18
|
+
return typeof e == "string" && (e = t.encode(e)), Uint8Array.prototype.toBase64 ? e.toBase64({ alphabet: "base64url", omitPadding: !0 }) : c(e).replace(/=/g, "").replace(/\+/g, "-").replace(/\//g, "_");
|
|
19
|
+
}
|
|
2
20
|
export {
|
|
3
|
-
|
|
21
|
+
i as decode,
|
|
22
|
+
p as encode
|
|
4
23
|
};
|
package/dist/web/index.web95.js
CHANGED
|
@@ -1,23 +1,12 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
constructor({ length: e, position: r }) {
|
|
11
|
-
super(`Position \`${r}\` is out of bounds (\`0 < position < ${e}\`).`, { name: "PositionOutOfBoundsError" });
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
class c extends o {
|
|
15
|
-
constructor({ count: e, limit: r }) {
|
|
16
|
-
super(`Recursive read limit of \`${r}\` exceeded (recursive read count: \`${e}\`).`, { name: "RecursiveReadLimitExceededError" });
|
|
17
|
-
}
|
|
18
|
-
}
|
|
1
|
+
import n from "./index.web110.js";
|
|
2
|
+
import s from "./index.web111.js";
|
|
3
|
+
import a from "./index.web112.js";
|
|
4
|
+
const y = async (t, o, e) => {
|
|
5
|
+
const r = await a(t, o, "sign");
|
|
6
|
+
s(t, r);
|
|
7
|
+
const i = await crypto.subtle.sign(n(t, r.algorithm), r, e);
|
|
8
|
+
return new Uint8Array(i);
|
|
9
|
+
};
|
|
19
10
|
export {
|
|
20
|
-
|
|
21
|
-
n as PositionOutOfBoundsError,
|
|
22
|
-
c as RecursiveReadLimitExceededError
|
|
11
|
+
y as default
|
|
23
12
|
};
|
package/dist/web/index.web96.js
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
const
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
const a = (...o) => {
|
|
2
|
+
const t = o.filter(Boolean);
|
|
3
|
+
if (t.length === 0 || t.length === 1)
|
|
4
|
+
return !0;
|
|
5
|
+
let e;
|
|
6
|
+
for (const s of t) {
|
|
7
|
+
const r = Object.keys(s);
|
|
8
|
+
if (!e || e.size === 0) {
|
|
9
|
+
e = new Set(r);
|
|
10
|
+
continue;
|
|
11
|
+
}
|
|
12
|
+
for (const n of r) {
|
|
13
|
+
if (e.has(n))
|
|
14
|
+
return !1;
|
|
15
|
+
e.add(n);
|
|
16
|
+
}
|
|
11
17
|
}
|
|
12
|
-
return
|
|
13
|
-
}
|
|
14
|
-
const m = (t, r, n) => t << n | r >>> 32 - n, A = (t, r, n) => r << n | t >>> 32 - n, B = (t, r, n) => r << n - 32 | t >>> 64 - n, a = (t, r, n) => t << n - 32 | r >>> 64 - n;
|
|
18
|
+
return !0;
|
|
19
|
+
};
|
|
15
20
|
export {
|
|
16
|
-
|
|
17
|
-
B as rotlBH,
|
|
18
|
-
a as rotlBL,
|
|
19
|
-
m as rotlSH,
|
|
20
|
-
A as rotlSL,
|
|
21
|
-
h as split
|
|
21
|
+
a as default
|
|
22
22
|
};
|