@coinbase/cdp-core 0.0.47 → 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.
Files changed (229) hide show
  1. package/dist/esm/index.native12.js +4 -4
  2. package/dist/esm/index.native17.js +1 -1
  3. package/dist/esm/index.native18.js +33 -24
  4. package/dist/esm/index.native2.js +8 -6
  5. package/dist/esm/index.native22.js +1 -1
  6. package/dist/esm/index.native3.js +2 -2
  7. package/dist/esm/index.native32.js +940 -149
  8. package/dist/esm/index.native33.js +2 -48
  9. package/dist/esm/index.native34.js +43 -244
  10. package/dist/esm/index.native35.js +27 -55
  11. package/dist/esm/index.native36.js +149 -940
  12. package/dist/esm/index.native37.js +48 -2
  13. package/dist/esm/index.native38.js +244 -43
  14. package/dist/esm/index.native39.js +55 -27
  15. package/dist/esm/index.native4.js +4 -2
  16. package/dist/esm/index.native5.js +19 -17
  17. package/dist/esm/index.native6.js +10 -8
  18. package/dist/esm/index.web100.js +2 -7
  19. package/dist/esm/index.web101.js +17 -17
  20. package/dist/esm/index.web102.js +20 -10
  21. package/dist/esm/index.web103.js +80 -20
  22. package/dist/esm/index.web104.js +99 -89
  23. package/dist/esm/index.web105.js +32 -20
  24. package/dist/esm/index.web106.js +7 -118
  25. package/dist/esm/index.web107.js +10 -79
  26. package/dist/esm/index.web108.js +79 -10
  27. package/dist/esm/index.web109.js +18 -5
  28. package/dist/esm/index.web110.js +28 -18
  29. package/dist/esm/index.web111.js +6 -26
  30. package/dist/esm/index.web112.js +9 -6
  31. package/dist/esm/index.web113.js +13 -11
  32. package/dist/esm/index.web114.js +8 -11
  33. package/dist/esm/index.web115.js +14 -7
  34. package/dist/esm/index.web116.js +80 -16
  35. package/dist/esm/index.web117.js +5 -81
  36. package/dist/esm/index.web119.js +4 -4
  37. package/dist/esm/index.web120.js +5 -5
  38. package/dist/esm/index.web16.js +1 -1
  39. package/dist/esm/index.web17.js +33 -24
  40. package/dist/esm/index.web2.js +10 -8
  41. package/dist/esm/index.web21.js +1 -1
  42. package/dist/esm/index.web25.js +13 -13
  43. package/dist/esm/index.web27.js +3 -3
  44. package/dist/esm/index.web3.js +4 -2
  45. package/dist/esm/index.web30.js +2 -2
  46. package/dist/esm/index.web34.js +2 -2
  47. package/dist/esm/index.web35.js +16 -950
  48. package/dist/esm/index.web36.js +23 -2
  49. package/dist/esm/index.web37.js +50 -49
  50. package/dist/esm/index.web38.js +950 -27
  51. package/dist/esm/index.web39.js +2 -17
  52. package/dist/esm/index.web4.js +12 -12
  53. package/dist/esm/index.web40.js +48 -21
  54. package/dist/esm/index.web41.js +27 -50
  55. package/dist/esm/index.web44.js +54 -8
  56. package/dist/esm/index.web45.js +9 -16
  57. package/dist/esm/index.web46.js +2 -46
  58. package/dist/esm/index.web47.js +45 -14
  59. package/dist/esm/index.web48.js +12 -54
  60. package/dist/esm/index.web49.js +8 -6
  61. package/dist/esm/index.web5.js +4 -2
  62. package/dist/esm/index.web50.js +16 -20
  63. package/dist/esm/index.web51.js +45 -11
  64. package/dist/esm/index.web52.js +13 -3
  65. package/dist/esm/index.web53.js +55 -3
  66. package/dist/esm/index.web54.js +6 -34
  67. package/dist/esm/index.web55.js +19 -10
  68. package/dist/esm/index.web56.js +11 -4
  69. package/dist/esm/index.web57.js +3 -28
  70. package/dist/esm/index.web58.js +3 -6
  71. package/dist/esm/index.web59.js +34 -24
  72. package/dist/esm/index.web60.js +12 -16
  73. package/dist/esm/index.web61.js +4 -54
  74. package/dist/esm/index.web62.js +25 -20
  75. package/dist/esm/index.web63.js +6 -11
  76. package/dist/esm/index.web64.js +23 -26
  77. package/dist/esm/index.web65.js +16 -42
  78. package/dist/esm/index.web66.js +52 -53
  79. package/dist/esm/index.web67.js +23 -127
  80. package/dist/esm/index.web68.js +11 -12
  81. package/dist/esm/index.web69.js +27 -104
  82. package/dist/esm/index.web70.js +42 -6
  83. package/dist/esm/index.web71.js +56 -3
  84. package/dist/esm/index.web72.js +127 -14
  85. package/dist/esm/index.web73.js +9 -39
  86. package/dist/esm/index.web74.js +100 -74
  87. package/dist/esm/index.web75.js +7 -2
  88. package/dist/esm/index.web76.js +3 -2
  89. package/dist/esm/index.web77.js +14 -12
  90. package/dist/esm/index.web78.js +34 -29
  91. package/dist/esm/index.web79.js +77 -5
  92. package/dist/esm/index.web80.js +2 -35
  93. package/dist/esm/index.web81.js +2 -9
  94. package/dist/esm/index.web82.js +11 -9
  95. package/dist/esm/index.web83.js +37 -11
  96. package/dist/esm/index.web84.js +6 -13
  97. package/dist/esm/index.web85.js +33 -17
  98. package/dist/esm/index.web86.js +8 -5
  99. package/dist/esm/index.web87.js +11 -5
  100. package/dist/esm/index.web88.js +11 -10
  101. package/dist/esm/index.web89.js +13 -54
  102. package/dist/esm/index.web90.js +18 -10
  103. package/dist/esm/index.web91.js +6 -2
  104. package/dist/esm/index.web92.js +4 -44
  105. package/dist/esm/index.web93.js +10 -13
  106. package/dist/esm/index.web94.js +21 -2
  107. package/dist/esm/index.web95.js +10 -21
  108. package/dist/esm/index.web96.js +19 -19
  109. package/dist/esm/index.web97.js +94 -80
  110. package/dist/esm/index.web98.js +20 -103
  111. package/dist/esm/index.web99.js +115 -30
  112. package/dist/native/index.native12.js +4 -4
  113. package/dist/native/index.native17.js +1 -1
  114. package/dist/native/index.native18.js +33 -24
  115. package/dist/native/index.native2.js +8 -6
  116. package/dist/native/index.native22.js +1 -1
  117. package/dist/native/index.native3.js +2 -2
  118. package/dist/native/index.native32.js +940 -149
  119. package/dist/native/index.native33.js +2 -48
  120. package/dist/native/index.native34.js +43 -244
  121. package/dist/native/index.native35.js +27 -55
  122. package/dist/native/index.native36.js +149 -940
  123. package/dist/native/index.native37.js +48 -2
  124. package/dist/native/index.native38.js +244 -43
  125. package/dist/native/index.native39.js +55 -27
  126. package/dist/native/index.native4.js +4 -2
  127. package/dist/native/index.native5.js +19 -17
  128. package/dist/native/index.native6.js +10 -8
  129. package/dist/native-types/platform/types.d.ts +3 -3
  130. package/dist/native-types/types.d.ts +5 -7
  131. package/dist/types/platform/types.d.ts +3 -3
  132. package/dist/types/types.d.ts +5 -7
  133. package/dist/web/index.web100.js +2 -7
  134. package/dist/web/index.web101.js +17 -17
  135. package/dist/web/index.web102.js +20 -10
  136. package/dist/web/index.web103.js +80 -20
  137. package/dist/web/index.web104.js +99 -89
  138. package/dist/web/index.web105.js +32 -20
  139. package/dist/web/index.web106.js +7 -118
  140. package/dist/web/index.web107.js +10 -79
  141. package/dist/web/index.web108.js +79 -10
  142. package/dist/web/index.web109.js +18 -5
  143. package/dist/web/index.web110.js +28 -18
  144. package/dist/web/index.web111.js +6 -26
  145. package/dist/web/index.web112.js +9 -6
  146. package/dist/web/index.web113.js +13 -11
  147. package/dist/web/index.web114.js +8 -11
  148. package/dist/web/index.web115.js +14 -7
  149. package/dist/web/index.web116.js +80 -16
  150. package/dist/web/index.web117.js +5 -81
  151. package/dist/web/index.web119.js +4 -4
  152. package/dist/web/index.web120.js +5 -5
  153. package/dist/web/index.web16.js +1 -1
  154. package/dist/web/index.web17.js +33 -24
  155. package/dist/web/index.web2.js +10 -8
  156. package/dist/web/index.web21.js +1 -1
  157. package/dist/web/index.web25.js +13 -13
  158. package/dist/web/index.web27.js +3 -3
  159. package/dist/web/index.web3.js +4 -2
  160. package/dist/web/index.web30.js +2 -2
  161. package/dist/web/index.web34.js +2 -2
  162. package/dist/web/index.web35.js +16 -950
  163. package/dist/web/index.web36.js +23 -2
  164. package/dist/web/index.web37.js +50 -49
  165. package/dist/web/index.web38.js +950 -27
  166. package/dist/web/index.web39.js +2 -17
  167. package/dist/web/index.web4.js +12 -12
  168. package/dist/web/index.web40.js +48 -21
  169. package/dist/web/index.web41.js +27 -50
  170. package/dist/web/index.web44.js +54 -8
  171. package/dist/web/index.web45.js +9 -16
  172. package/dist/web/index.web46.js +2 -46
  173. package/dist/web/index.web47.js +45 -14
  174. package/dist/web/index.web48.js +12 -54
  175. package/dist/web/index.web49.js +8 -6
  176. package/dist/web/index.web5.js +4 -2
  177. package/dist/web/index.web50.js +16 -20
  178. package/dist/web/index.web51.js +45 -11
  179. package/dist/web/index.web52.js +13 -3
  180. package/dist/web/index.web53.js +55 -3
  181. package/dist/web/index.web54.js +6 -34
  182. package/dist/web/index.web55.js +19 -10
  183. package/dist/web/index.web56.js +11 -4
  184. package/dist/web/index.web57.js +3 -28
  185. package/dist/web/index.web58.js +3 -6
  186. package/dist/web/index.web59.js +34 -24
  187. package/dist/web/index.web60.js +12 -16
  188. package/dist/web/index.web61.js +4 -54
  189. package/dist/web/index.web62.js +25 -20
  190. package/dist/web/index.web63.js +6 -11
  191. package/dist/web/index.web64.js +23 -26
  192. package/dist/web/index.web65.js +16 -42
  193. package/dist/web/index.web66.js +52 -53
  194. package/dist/web/index.web67.js +23 -127
  195. package/dist/web/index.web68.js +11 -12
  196. package/dist/web/index.web69.js +27 -104
  197. package/dist/web/index.web70.js +42 -6
  198. package/dist/web/index.web71.js +56 -3
  199. package/dist/web/index.web72.js +127 -14
  200. package/dist/web/index.web73.js +9 -39
  201. package/dist/web/index.web74.js +100 -74
  202. package/dist/web/index.web75.js +7 -2
  203. package/dist/web/index.web76.js +3 -2
  204. package/dist/web/index.web77.js +14 -12
  205. package/dist/web/index.web78.js +34 -29
  206. package/dist/web/index.web79.js +77 -5
  207. package/dist/web/index.web80.js +2 -35
  208. package/dist/web/index.web81.js +2 -9
  209. package/dist/web/index.web82.js +11 -9
  210. package/dist/web/index.web83.js +37 -11
  211. package/dist/web/index.web84.js +6 -13
  212. package/dist/web/index.web85.js +33 -17
  213. package/dist/web/index.web86.js +8 -5
  214. package/dist/web/index.web87.js +11 -5
  215. package/dist/web/index.web88.js +11 -10
  216. package/dist/web/index.web89.js +13 -54
  217. package/dist/web/index.web90.js +18 -10
  218. package/dist/web/index.web91.js +6 -2
  219. package/dist/web/index.web92.js +4 -44
  220. package/dist/web/index.web93.js +10 -13
  221. package/dist/web/index.web94.js +21 -2
  222. package/dist/web/index.web95.js +10 -21
  223. package/dist/web/index.web96.js +19 -19
  224. package/dist/web/index.web97.js +94 -80
  225. package/dist/web/index.web98.js +20 -103
  226. package/dist/web/index.web99.js +115 -30
  227. package/dist/web-types/platform/types.d.ts +3 -3
  228. package/dist/web-types/types.d.ts +5 -7
  229. package/package.json +2 -2
@@ -1,13 +1,15 @@
1
- import { hexToBytes as b } from "./index.web48.js";
2
- import { bytesToHex as y } from "./index.web46.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)));
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
- h as blobsToProofs
14
+ d as InvalidAddressError
13
15
  };
@@ -1,14 +1,40 @@
1
- import { commitmentToVersionedHash as i } from "./index.web100.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 { 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
- r as commitmentsToVersionedHashes
36
+ t as BlobSizeTooLargeError,
37
+ d as EmptyBlobError,
38
+ l as InvalidVersionedHashSizeError,
39
+ c as InvalidVersionedHashVersionError
14
40
  };
@@ -1,16 +1,9 @@
1
- import { blobsToCommitments as f } from "./index.web81.js";
2
- import { blobsToProofs as l } from "./index.web82.js";
3
- import { toBlobs as p } from "./index.web99.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 { 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
- k as toBlobSidecars
8
+ o as InvalidChainIdError
16
9
  };
@@ -1,21 +1,37 @@
1
- import { InvalidAddressError as s } from "./index.web77.js";
2
- import { InvalidStorageKeySizeError as l } from "./index.web73.js";
3
- import { isAddress as f } from "./index.web51.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]);
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
- a as serializeAccessList
35
+ n as FeeCapTooHighError,
36
+ h as TipAboveFeeCapError
21
37
  };
@@ -1,8 +1,11 @@
1
- import { gweiUnits as i } from "./index.web87.js";
2
- import { formatUnits as o } from "./index.web88.js";
3
- function f(r, t = "wei") {
4
- return o(r, i[t]);
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
- f as formatGwei
10
+ y as blobsToCommitments
8
11
  };
@@ -1,7 +1,13 @@
1
- const e = {
2
- ether: -9,
3
- wei: 9
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
- e as gweiUnits
12
+ h as blobsToProofs
7
13
  };
@@ -1,13 +1,14 @@
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}` : ""}`;
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
- a as formatUnits
13
+ r as commitmentsToVersionedHashes
13
14
  };
@@ -1,57 +1,16 @@
1
- import { encode as d } from "./index.web101.js";
2
- import y from "./index.web102.js";
3
- import b from "./index.web103.js";
4
- import { JWSInvalid as r } from "./index.web40.js";
5
- import { encoder as s, concat as u, decoder as h } from "./index.web90.js";
6
- import g from "./index.web104.js";
7
- import H from "./index.web105.js";
8
- import P from "./index.web106.js";
9
- class x {
10
- #r;
11
- #e;
12
- #t;
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
- x as FlattenedSign
15
+ k as toBlobSidecars
57
16
  };
@@ -1,13 +1,21 @@
1
- const d = new TextEncoder(), s = new TextDecoder();
2
- function f(...n) {
3
- const c = n.reduce((e, { length: r }) => e + r, 0), t = new Uint8Array(c);
4
- let o = 0;
5
- for (const e of n)
6
- t.set(e, o), o += e.length;
7
- return t;
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
- f as concat,
11
- s as decoder,
12
- d as encoder
20
+ a as serializeAccessList
13
21
  };
@@ -1,4 +1,8 @@
1
- const o = (e) => Math.floor(e.getTime() / 1e3);
1
+ import { gweiUnits as i } from "./index.web92.js";
2
+ import { formatUnits as o } from "./index.web93.js";
3
+ function f(r, t = "wei") {
4
+ return o(r, i[t]);
5
+ }
2
6
  export {
3
- o as default
7
+ f as formatGwei
4
8
  };
@@ -1,47 +1,7 @@
1
- const o = /^(\+|\-)? ?(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)(?: (ago|from now))?$/i, t = (c) => {
2
- const s = o.exec(c);
3
- if (!s || s[4] && s[1])
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
- t as default
6
+ e as gweiUnits
47
7
  };
@@ -1,16 +1,13 @@
1
- function o(t) {
2
- return typeof t == "object" && t !== null;
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
- r as default
12
+ a as formatUnits
16
13
  };
@@ -1,4 +1,23 @@
1
- const o = "2.33.0";
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
- o as version
21
+ i as decode,
22
+ p as encode
4
23
  };
@@ -1,23 +1,12 @@
1
- import { BaseError as o } from "./index.web66.js";
2
- class i extends o {
3
- constructor({ offset: e }) {
4
- super(`Offset \`${e}\` cannot be negative.`, {
5
- name: "NegativeOffsetError"
6
- });
7
- }
8
- }
9
- class n extends o {
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
- i as NegativeOffsetError,
21
- n as PositionOutOfBoundsError,
22
- c as RecursiveReadLimitExceededError
11
+ y as default
23
12
  };
@@ -1,22 +1,22 @@
1
- const o = /* @__PURE__ */ BigInt(4294967295), i = /* @__PURE__ */ BigInt(32);
2
- function s(t, r = !1) {
3
- return r ? { h: Number(t & o), l: Number(t >> i & o) } : { h: Number(t >> i & o) | 0, l: Number(t & o) | 0 };
4
- }
5
- function h(t, r = !1) {
6
- const n = t.length;
7
- let l = new Uint32Array(n), c = new Uint32Array(n);
8
- for (let e = 0; e < n; e++) {
9
- const { h: u, l: f } = s(t[e], r);
10
- [l[e], c[e]] = [u, f];
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 [l, c];
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
- s as fromBig,
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
  };