@coinbase/cdp-core 0.0.8 → 0.0.10

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.
Files changed (95) hide show
  1. package/dist/esm/index100.js +7 -14
  2. package/dist/esm/index101.js +16 -80
  3. package/dist/esm/index102.js +72 -70
  4. package/dist/esm/index103.js +81 -0
  5. package/dist/esm/index13.js +18 -172
  6. package/dist/esm/index14.js +169 -157
  7. package/dist/esm/index15.js +157 -45
  8. package/dist/esm/index16.js +44 -142
  9. package/dist/esm/index17.js +144 -54
  10. package/dist/esm/index18.js +56 -41
  11. package/dist/esm/index19.js +40 -16
  12. package/dist/esm/index2.js +72 -68
  13. package/dist/esm/index20.js +16 -4
  14. package/dist/esm/index21.js +5 -5
  15. package/dist/esm/index22.js +5 -9
  16. package/dist/esm/index23.js +8 -17
  17. package/dist/esm/index24.js +16 -44
  18. package/dist/esm/index25.js +45 -13
  19. package/dist/esm/index26.js +13 -55
  20. package/dist/esm/index27.js +55 -6
  21. package/dist/esm/index28.js +6 -21
  22. package/dist/esm/index29.js +21 -11
  23. package/dist/esm/index3.js +4 -4
  24. package/dist/esm/index30.js +11 -3
  25. package/dist/esm/index31.js +3 -3
  26. package/dist/esm/index32.js +3 -34
  27. package/dist/esm/index33.js +32 -10
  28. package/dist/esm/index34.js +12 -4
  29. package/dist/esm/index35.js +4 -28
  30. package/dist/esm/index36.js +28 -6
  31. package/dist/esm/index37.js +6 -24
  32. package/dist/esm/index38.js +24 -16
  33. package/dist/esm/index39.js +16 -54
  34. package/dist/esm/index40.js +53 -22
  35. package/dist/esm/index41.js +23 -11
  36. package/dist/esm/index42.js +10 -26
  37. package/dist/esm/index43.js +26 -41
  38. package/dist/esm/index44.js +41 -54
  39. package/dist/esm/index45.js +54 -126
  40. package/dist/esm/index46.js +126 -11
  41. package/dist/esm/index47.js +9 -101
  42. package/dist/esm/index48.js +104 -6
  43. package/dist/esm/index49.js +7 -3
  44. package/dist/esm/index5.js +4 -4
  45. package/dist/esm/index50.js +3 -15
  46. package/dist/esm/index51.js +14 -42
  47. package/dist/esm/index52.js +38 -74
  48. package/dist/esm/index53.js +79 -2
  49. package/dist/esm/index54.js +2 -2
  50. package/dist/esm/index55.js +2 -13
  51. package/dist/esm/index56.js +8 -33
  52. package/dist/esm/index57.js +36 -5
  53. package/dist/esm/index58.js +5 -33
  54. package/dist/esm/index59.js +34 -8
  55. package/dist/esm/index60.js +8 -10
  56. package/dist/esm/index61.js +10 -11
  57. package/dist/esm/index62.js +11 -13
  58. package/dist/esm/index63.js +13 -18
  59. package/dist/esm/index64.js +18 -5
  60. package/dist/esm/index65.js +6 -5
  61. package/dist/esm/index66.js +5 -11
  62. package/dist/esm/index67.js +10 -16
  63. package/dist/esm/index68.js +15 -21
  64. package/dist/esm/index69.js +21 -49
  65. package/dist/esm/index70.js +51 -2
  66. package/dist/esm/index71.js +2 -21
  67. package/dist/esm/index72.js +18 -17
  68. package/dist/esm/index73.js +20 -80
  69. package/dist/esm/index74.js +79 -103
  70. package/dist/esm/index75.js +101 -30
  71. package/dist/esm/index76.js +32 -6
  72. package/dist/esm/index77.js +7 -10
  73. package/dist/esm/index78.js +10 -55
  74. package/dist/esm/index79.js +54 -10
  75. package/dist/esm/index80.js +11 -2
  76. package/dist/esm/index81.js +2 -45
  77. package/dist/esm/index82.js +44 -13
  78. package/dist/esm/index83.js +13 -78
  79. package/dist/esm/index84.js +79 -5
  80. package/dist/esm/index85.js +5 -13
  81. package/dist/esm/index86.js +12 -35
  82. package/dist/esm/index87.js +35 -41
  83. package/dist/esm/index88.js +40 -19
  84. package/dist/esm/index89.js +21 -10
  85. package/dist/esm/index90.js +9 -19
  86. package/dist/esm/index91.js +15 -89
  87. package/dist/esm/index92.js +92 -19
  88. package/dist/esm/index93.js +18 -115
  89. package/dist/esm/index94.js +118 -18
  90. package/dist/esm/index95.js +18 -28
  91. package/dist/esm/index96.js +26 -6
  92. package/dist/esm/index97.js +6 -9
  93. package/dist/esm/index98.js +11 -13
  94. package/dist/esm/index99.js +11 -8
  95. package/package.json +3 -3
@@ -1,9 +1,9 @@
1
1
  import { logOutEndUser as c, refreshAccessToken as o, registerTemporaryWalletSecret as u } from "@coinbase/cdp-api-client";
2
- import { SignJWT as S } from "./index18.js";
2
+ import { SignJWT as S } from "./index19.js";
3
3
  import { toAuthState as w } from "./index6.js";
4
- import { createKeyPair as f } from "./index19.js";
5
- import { generateRandomId as n } from "./index20.js";
6
- import { hash as d } from "./index21.js";
4
+ import { createKeyPair as f } from "./index20.js";
5
+ import { generateRandomId as n } from "./index21.js";
6
+ import { hash as d } from "./index22.js";
7
7
  import { sortKeys as y } from "./index12.js";
8
8
  const h = 60 * 1e3;
9
9
  class E {
@@ -1,17 +1,5 @@
1
- import { InvalidSerializableTransactionError as f } from "./index51.js";
2
- function d(e) {
3
- if (e.type)
4
- return e.type;
5
- if (typeof e.authorizationList < "u")
6
- return "eip7702";
7
- if (typeof e.blobs < "u" || typeof e.blobVersionedHashes < "u" || typeof e.maxFeePerBlobGas < "u" || typeof e.sidecars < "u")
8
- return "eip4844";
9
- if (typeof e.maxFeePerGas < "u" || typeof e.maxPriorityFeePerGas < "u")
10
- return "eip1559";
11
- if (typeof e.gasPrice < "u")
12
- return typeof e.accessList < "u" ? "eip2930" : "legacy";
13
- throw new f({ transaction: e });
14
- }
1
+ import { sha256 as s } from "./index75.js";
2
+ const o = s;
15
3
  export {
16
- d as getTransactionType
4
+ o as sha256
17
5
  };
@@ -1,45 +1,17 @@
1
- import { BaseError as t } from "./index44.js";
2
- function i(n) {
3
- const r = Object.entries(n).map(([a, e]) => e === void 0 || e === !1 ? null : [a, e]).filter(Boolean), o = r.reduce((a, [e]) => Math.max(a, e.length), 0);
4
- return r.map(([a, e]) => ` ${`${a}:`.padEnd(o + 1)} ${e}`).join(`
5
- `);
6
- }
7
- class c extends t {
8
- constructor({ v: r }) {
9
- super(`Invalid \`v\` value "${r}". Expected 27 or 28.`, {
10
- name: "InvalidLegacyVError"
11
- });
12
- }
13
- }
14
- class d extends t {
15
- constructor({ transaction: r }) {
16
- super("Cannot infer a transaction type from provided transaction.", {
17
- metaMessages: [
18
- "Provided Transaction:",
19
- "{",
20
- i(r),
21
- "}",
22
- "",
23
- "To infer the type, either provide:",
24
- "- a `type` to the Transaction, or",
25
- "- an EIP-1559 Transaction with `maxFeePerGas`, or",
26
- "- an EIP-2930 Transaction with `gasPrice` & `accessList`, or",
27
- "- an EIP-4844 Transaction with `blobs`, `blobVersionedHashes`, `sidecars`, or",
28
- "- an EIP-7702 Transaction with `authorizationList`, or",
29
- "- a Legacy Transaction with `gasPrice`"
30
- ],
31
- name: "InvalidSerializableTransactionError"
32
- });
33
- }
34
- }
35
- class l extends t {
36
- constructor({ storageKey: r }) {
37
- super(`Size for storage key "${r}" is invalid. Expected 32 bytes. Got ${Math.floor((r.length - 2) / 2)} bytes.`, { name: "InvalidStorageKeySizeError" });
38
- }
1
+ import { InvalidSerializableTransactionError as f } from "./index52.js";
2
+ function d(e) {
3
+ if (e.type)
4
+ return e.type;
5
+ if (typeof e.authorizationList < "u")
6
+ return "eip7702";
7
+ if (typeof e.blobs < "u" || typeof e.blobVersionedHashes < "u" || typeof e.maxFeePerBlobGas < "u" || typeof e.sidecars < "u")
8
+ return "eip4844";
9
+ if (typeof e.maxFeePerGas < "u" || typeof e.maxPriorityFeePerGas < "u")
10
+ return "eip1559";
11
+ if (typeof e.gasPrice < "u")
12
+ return typeof e.accessList < "u" ? "eip2930" : "legacy";
13
+ throw new f({ transaction: e });
39
14
  }
40
15
  export {
41
- c as InvalidLegacyVError,
42
- d as InvalidSerializableTransactionError,
43
- l as InvalidStorageKeySizeError,
44
- i as prettyPrint
16
+ d as getTransactionType
45
17
  };
@@ -1,81 +1,45 @@
1
- import { versionedHashVersionKzg as c } from "./index53.js";
2
- import { maxUint256 as m } from "./index54.js";
3
- import { InvalidAddressError as s } from "./index55.js";
4
- import { BaseError as h } from "./index44.js";
5
- import { EmptyBlobError as P, InvalidVersionedHashSizeError as p, InvalidVersionedHashVersionError as x } from "./index56.js";
6
- import { InvalidChainIdError as n } from "./index57.js";
7
- import { FeeCapTooHighError as w, TipAboveFeeCapError as E } from "./index58.js";
8
- import { isAddress as f } from "./index29.js";
9
- import { size as F } from "./index34.js";
10
- import { slice as I } from "./index35.js";
11
- import { hexToNumber as G } from "./index40.js";
12
- function C(t) {
13
- const { authorizationList: e } = t;
14
- if (e)
15
- for (const o of e) {
16
- const { chainId: r } = o, i = o.address;
17
- if (!f(i))
18
- throw new s({ address: i });
19
- if (r < 0)
20
- throw new n({ chainId: r });
21
- }
22
- d(t);
1
+ import { BaseError as t } from "./index45.js";
2
+ function i(n) {
3
+ const r = Object.entries(n).map(([a, e]) => e === void 0 || e === !1 ? null : [a, e]).filter(Boolean), o = r.reduce((a, [e]) => Math.max(a, e.length), 0);
4
+ return r.map(([a, e]) => ` ${`${a}:`.padEnd(o + 1)} ${e}`).join(`
5
+ `);
23
6
  }
24
- function L(t) {
25
- const { blobVersionedHashes: e } = t;
26
- if (e) {
27
- if (e.length === 0)
28
- throw new P();
29
- for (const o of e) {
30
- const r = F(o), i = G(I(o, 0, 1));
31
- if (r !== 32)
32
- throw new p({ hash: o, size: r });
33
- if (i !== c)
34
- throw new x({
35
- hash: o,
36
- version: i
37
- });
38
- }
7
+ class c extends t {
8
+ constructor({ v: r }) {
9
+ super(`Invalid \`v\` value "${r}". Expected 27 or 28.`, {
10
+ name: "InvalidLegacyVError"
11
+ });
39
12
  }
40
- d(t);
41
13
  }
42
- function d(t) {
43
- const { chainId: e, maxPriorityFeePerGas: o, maxFeePerGas: r, to: i } = t;
44
- if (e <= 0)
45
- throw new n({ chainId: e });
46
- if (i && !f(i))
47
- throw new s({ address: i });
48
- if (r && r > m)
49
- throw new w({ maxFeePerGas: r });
50
- if (o && r && o > r)
51
- throw new E({ maxFeePerGas: r, maxPriorityFeePerGas: o });
52
- }
53
- function B(t) {
54
- const { chainId: e, maxPriorityFeePerGas: o, gasPrice: r, maxFeePerGas: i, to: a } = t;
55
- if (e <= 0)
56
- throw new n({ chainId: e });
57
- if (a && !f(a))
58
- throw new s({ address: a });
59
- if (o || i)
60
- throw new h("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid EIP-2930 Transaction attribute.");
61
- if (r && r > m)
62
- throw new w({ maxFeePerGas: r });
14
+ class d extends t {
15
+ constructor({ transaction: r }) {
16
+ super("Cannot infer a transaction type from provided transaction.", {
17
+ metaMessages: [
18
+ "Provided Transaction:",
19
+ "{",
20
+ i(r),
21
+ "}",
22
+ "",
23
+ "To infer the type, either provide:",
24
+ "- a `type` to the Transaction, or",
25
+ "- an EIP-1559 Transaction with `maxFeePerGas`, or",
26
+ "- an EIP-2930 Transaction with `gasPrice` & `accessList`, or",
27
+ "- an EIP-4844 Transaction with `blobs`, `blobVersionedHashes`, `sidecars`, or",
28
+ "- an EIP-7702 Transaction with `authorizationList`, or",
29
+ "- a Legacy Transaction with `gasPrice`"
30
+ ],
31
+ name: "InvalidSerializableTransactionError"
32
+ });
33
+ }
63
34
  }
64
- function K(t) {
65
- const { chainId: e, maxPriorityFeePerGas: o, gasPrice: r, maxFeePerGas: i, to: a } = t;
66
- if (a && !f(a))
67
- throw new s({ address: a });
68
- if (typeof e < "u" && e <= 0)
69
- throw new n({ chainId: e });
70
- if (o || i)
71
- throw new h("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid Legacy Transaction attribute.");
72
- if (r && r > m)
73
- throw new w({ maxFeePerGas: r });
35
+ class l extends t {
36
+ constructor({ storageKey: r }) {
37
+ super(`Size for storage key "${r}" is invalid. Expected 32 bytes. Got ${Math.floor((r.length - 2) / 2)} bytes.`, { name: "InvalidStorageKeySizeError" });
38
+ }
74
39
  }
75
40
  export {
76
- d as assertTransactionEIP1559,
77
- B as assertTransactionEIP2930,
78
- L as assertTransactionEIP4844,
79
- C as assertTransactionEIP7702,
80
- K as assertTransactionLegacy
41
+ c as InvalidLegacyVError,
42
+ d as InvalidSerializableTransactionError,
43
+ l as InvalidStorageKeySizeError,
44
+ i as prettyPrint
81
45
  };
@@ -1,4 +1,81 @@
1
- const e = 1;
1
+ import { versionedHashVersionKzg as c } from "./index54.js";
2
+ import { maxUint256 as m } from "./index55.js";
3
+ import { InvalidAddressError as s } from "./index56.js";
4
+ import { BaseError as h } from "./index45.js";
5
+ import { EmptyBlobError as P, InvalidVersionedHashSizeError as p, InvalidVersionedHashVersionError as x } from "./index57.js";
6
+ import { InvalidChainIdError as n } from "./index58.js";
7
+ import { FeeCapTooHighError as w, TipAboveFeeCapError as E } from "./index59.js";
8
+ import { isAddress as f } from "./index30.js";
9
+ import { size as F } from "./index35.js";
10
+ import { slice as I } from "./index36.js";
11
+ import { hexToNumber as G } from "./index41.js";
12
+ function C(t) {
13
+ const { authorizationList: e } = t;
14
+ if (e)
15
+ for (const o of e) {
16
+ const { chainId: r } = o, i = o.address;
17
+ if (!f(i))
18
+ throw new s({ address: i });
19
+ if (r < 0)
20
+ throw new n({ chainId: r });
21
+ }
22
+ d(t);
23
+ }
24
+ function L(t) {
25
+ const { blobVersionedHashes: e } = t;
26
+ if (e) {
27
+ if (e.length === 0)
28
+ throw new P();
29
+ for (const o of e) {
30
+ const r = F(o), i = G(I(o, 0, 1));
31
+ if (r !== 32)
32
+ throw new p({ hash: o, size: r });
33
+ if (i !== c)
34
+ throw new x({
35
+ hash: o,
36
+ version: i
37
+ });
38
+ }
39
+ }
40
+ d(t);
41
+ }
42
+ function d(t) {
43
+ const { chainId: e, maxPriorityFeePerGas: o, maxFeePerGas: r, to: i } = t;
44
+ if (e <= 0)
45
+ throw new n({ chainId: e });
46
+ if (i && !f(i))
47
+ throw new s({ address: i });
48
+ if (r && r > m)
49
+ throw new w({ maxFeePerGas: r });
50
+ if (o && r && o > r)
51
+ throw new E({ maxFeePerGas: r, maxPriorityFeePerGas: o });
52
+ }
53
+ function B(t) {
54
+ const { chainId: e, maxPriorityFeePerGas: o, gasPrice: r, maxFeePerGas: i, to: a } = t;
55
+ if (e <= 0)
56
+ throw new n({ chainId: e });
57
+ if (a && !f(a))
58
+ throw new s({ address: a });
59
+ if (o || i)
60
+ throw new h("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid EIP-2930 Transaction attribute.");
61
+ if (r && r > m)
62
+ throw new w({ maxFeePerGas: r });
63
+ }
64
+ function K(t) {
65
+ const { chainId: e, maxPriorityFeePerGas: o, gasPrice: r, maxFeePerGas: i, to: a } = t;
66
+ if (a && !f(a))
67
+ throw new s({ address: a });
68
+ if (typeof e < "u" && e <= 0)
69
+ throw new n({ chainId: e });
70
+ if (o || i)
71
+ throw new h("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid Legacy Transaction attribute.");
72
+ if (r && r > m)
73
+ throw new w({ maxFeePerGas: r });
74
+ }
2
75
  export {
3
- e as versionedHashVersionKzg
76
+ d as assertTransactionEIP1559,
77
+ B as assertTransactionEIP2930,
78
+ L as assertTransactionEIP4844,
79
+ C as assertTransactionEIP7702,
80
+ K as assertTransactionLegacy
4
81
  };
@@ -1,4 +1,4 @@
1
- const n = 2n ** 256n - 1n;
1
+ const e = 1;
2
2
  export {
3
- n as maxUint256
3
+ e as versionedHashVersionKzg
4
4
  };
@@ -1,15 +1,4 @@
1
- import { BaseError as r } from "./index44.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
- });
11
- }
12
- }
1
+ const n = 2n ** 256n - 1n;
13
2
  export {
14
- d as InvalidAddressError
3
+ n as maxUint256
15
4
  };
@@ -1,40 +1,15 @@
1
- import { versionedHashVersionKzg as a } from "./index53.js";
2
- import { BaseError as s } from "./index44.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.`, {
1
+ import { BaseError as r } from "./index45.js";
2
+ class d extends r {
3
+ constructor({ address: s }) {
4
+ super(`Address "${s}" is invalid.`, {
27
5
  metaMessages: [
28
- `Expected: ${a}`,
29
- `Received: ${r}`
6
+ "- Address must be a hex value of 20 bytes (40 hex characters).",
7
+ "- Address must match its checksum counterpart."
30
8
  ],
31
- name: "InvalidVersionedHashVersionError"
9
+ name: "InvalidAddressError"
32
10
  });
33
11
  }
34
12
  }
35
13
  export {
36
- t as BlobSizeTooLargeError,
37
- d as EmptyBlobError,
38
- l as InvalidVersionedHashSizeError,
39
- c as InvalidVersionedHashVersionError
14
+ d as InvalidAddressError
40
15
  };
@@ -1,9 +1,40 @@
1
- import { BaseError as i } from "./index44.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" });
1
+ import { versionedHashVersionKzg as a } from "./index54.js";
2
+ import { BaseError as s } from "./index45.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
+ });
5
33
  }
6
34
  }
7
35
  export {
8
- o as InvalidChainIdError
36
+ t as BlobSizeTooLargeError,
37
+ d as EmptyBlobError,
38
+ l as InvalidVersionedHashSizeError,
39
+ c as InvalidVersionedHashVersionError
9
40
  };
@@ -1,37 +1,9 @@
1
- import { formatGwei as a } from "./index64.js";
2
- import { BaseError as o } from "./index44.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
- });
1
+ import { BaseError as i } from "./index45.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" });
9
5
  }
10
6
  }
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
- });
34
7
  export {
35
- n as FeeCapTooHighError,
36
- h as TipAboveFeeCapError
8
+ o as InvalidChainIdError
37
9
  };
@@ -1,11 +1,37 @@
1
- import { hexToBytes as i } from "./index26.js";
2
- import { bytesToHex as f } from "./index24.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));
1
+ import { formatGwei as a } from "./index65.js";
2
+ import { BaseError as o } from "./index45.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
+ });
9
+ }
8
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
+ });
9
34
  export {
10
- y as blobsToCommitments
35
+ n as FeeCapTooHighError,
36
+ h as TipAboveFeeCapError
11
37
  };
@@ -1,13 +1,11 @@
1
- import { hexToBytes as b } from "./index26.js";
2
- import { bytesToHex as y } from "./index24.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));
1
+ import { hexToBytes as i } from "./index27.js";
2
+ import { bytesToHex as f } from "./index25.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));
10
8
  }
11
9
  export {
12
- h as blobsToProofs
10
+ y as blobsToCommitments
13
11
  };
@@ -1,14 +1,13 @@
1
- import { commitmentToVersionedHash as i } from "./index76.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;
1
+ import { hexToBytes as b } from "./index27.js";
2
+ import { bytesToHex as y } from "./index25.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));
11
10
  }
12
11
  export {
13
- r as commitmentsToVersionedHashes
12
+ h as blobsToProofs
14
13
  };
@@ -1,16 +1,14 @@
1
- import { blobsToCommitments as f } from "./index59.js";
2
- import { blobsToProofs as l } from "./index60.js";
3
- import { toBlobs as p } from "./index75.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;
1
+ import { commitmentToVersionedHash as i } from "./index77.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;
13
11
  }
14
12
  export {
15
- k as toBlobSidecars
13
+ r as commitmentsToVersionedHashes
16
14
  };
@@ -1,21 +1,16 @@
1
- import { InvalidAddressError as s } from "./index55.js";
2
- import { InvalidStorageKeySizeError as l } from "./index51.js";
3
- import { isAddress as f } from "./index29.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;
1
+ import { blobsToCommitments as f } from "./index60.js";
2
+ import { blobsToProofs as l } from "./index61.js";
3
+ import { toBlobs as p } from "./index76.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;
18
13
  }
19
14
  export {
20
- a as serializeAccessList
15
+ k as toBlobSidecars
21
16
  };