@coinbase/cdp-hooks 0.0.18 → 0.0.19

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 (270) hide show
  1. package/dist/esm/index.js +21 -18
  2. package/dist/esm/index10.js +6 -0
  3. package/dist/esm/index100.js +196 -0
  4. package/dist/esm/index101.js +11 -0
  5. package/dist/esm/index102.js +4 -0
  6. package/dist/esm/index103.js +15 -0
  7. package/dist/esm/index104.js +21 -0
  8. package/dist/esm/index105.js +30 -0
  9. package/dist/esm/index106.js +11 -0
  10. package/dist/esm/index107.js +58 -0
  11. package/dist/esm/index108.js +48 -0
  12. package/dist/esm/index109.js +11 -0
  13. package/dist/esm/index11.js +12 -0
  14. package/dist/esm/index110.js +10 -0
  15. package/dist/esm/index111.js +19 -0
  16. package/dist/esm/index112.js +21 -0
  17. package/dist/esm/index113.js +27 -0
  18. package/dist/esm/index114.js +19 -0
  19. package/dist/esm/index115.js +57 -0
  20. package/dist/esm/index116.js +14 -0
  21. package/dist/esm/index117.js +163 -0
  22. package/dist/esm/index118.js +24 -0
  23. package/dist/esm/index119.js +130 -0
  24. package/dist/esm/index12.js +71 -0
  25. package/dist/esm/index120.js +41 -0
  26. package/dist/esm/index121.js +9 -0
  27. package/dist/esm/index122.js +30 -0
  28. package/dist/esm/index123.js +194 -0
  29. package/dist/esm/index124.js +6 -0
  30. package/dist/esm/index125.js +67 -0
  31. package/dist/esm/index126.js +5 -0
  32. package/dist/esm/index127.js +23 -0
  33. package/dist/esm/index128.js +19 -0
  34. package/dist/esm/index129.js +26 -0
  35. package/dist/esm/index13.js +12 -0
  36. package/dist/esm/index130.js +14 -0
  37. package/dist/esm/index131.js +37 -0
  38. package/dist/esm/index132.js +5 -0
  39. package/dist/esm/index133.js +21 -0
  40. package/dist/esm/index134.js +30 -0
  41. package/dist/esm/index135.js +38 -0
  42. package/dist/esm/index136.js +10 -0
  43. package/dist/esm/index137.js +28 -0
  44. package/dist/esm/index138.js +31 -0
  45. package/dist/esm/index139.js +67 -0
  46. package/dist/esm/index14.js +31 -0
  47. package/dist/esm/index140.js +12 -0
  48. package/dist/esm/index141.js +36 -0
  49. package/dist/esm/index142.js +30 -0
  50. package/dist/esm/index143.js +27 -0
  51. package/dist/esm/index144.js +6 -0
  52. package/dist/esm/index145.js +17 -0
  53. package/dist/esm/index146.js +106 -0
  54. package/dist/esm/index147.js +67 -0
  55. package/dist/esm/index148.js +8 -0
  56. package/dist/esm/index149.js +9 -0
  57. package/dist/esm/index15.js +73 -0
  58. package/dist/esm/index150.js +30 -0
  59. package/dist/esm/index151.js +42 -0
  60. package/dist/esm/index152.js +16 -0
  61. package/dist/esm/index153.js +45 -0
  62. package/dist/esm/index154.js +8 -0
  63. package/dist/esm/index155.js +14 -0
  64. package/dist/esm/index156.js +22 -0
  65. package/dist/esm/index157.js +81 -0
  66. package/dist/esm/index158.js +4 -0
  67. package/dist/esm/index159.js +40 -0
  68. package/dist/esm/index16.js +22 -0
  69. package/dist/esm/index160.js +113 -0
  70. package/dist/esm/index161.js +51 -0
  71. package/dist/esm/index162.js +35 -0
  72. package/dist/esm/index163.js +11 -0
  73. package/dist/esm/index164.js +9 -0
  74. package/dist/esm/index165.js +9 -0
  75. package/dist/esm/index166.js +14 -0
  76. package/dist/esm/index167.js +13 -0
  77. package/dist/esm/index168.js +16 -0
  78. package/dist/esm/index169.js +35 -0
  79. package/dist/esm/index17.js +113 -0
  80. package/dist/esm/index170.js +7 -0
  81. package/dist/esm/index171.js +11 -0
  82. package/dist/esm/index172.js +22 -0
  83. package/dist/esm/index173.js +34 -0
  84. package/dist/esm/index174.js +23 -0
  85. package/dist/esm/index175.js +6 -0
  86. package/dist/esm/index176.js +20 -0
  87. package/dist/esm/index177.js +13 -0
  88. package/dist/esm/index178.js +24 -0
  89. package/dist/esm/index179.js +25 -0
  90. package/dist/esm/index18.js +63 -0
  91. package/dist/esm/index180.js +8 -0
  92. package/dist/esm/index181.js +8 -0
  93. package/dist/esm/index182.js +11 -0
  94. package/dist/esm/index183.js +107 -0
  95. package/dist/esm/index184.js +5 -0
  96. package/dist/esm/index185.js +21 -0
  97. package/dist/esm/index186.js +174 -0
  98. package/dist/esm/index187.js +20 -0
  99. package/dist/esm/index188.js +12 -0
  100. package/dist/esm/index189.js +43 -0
  101. package/dist/esm/index19.js +27 -0
  102. package/dist/esm/index190.js +4 -0
  103. package/dist/esm/index191.js +7 -0
  104. package/dist/esm/index192.js +13 -0
  105. package/dist/esm/index193.js +22 -0
  106. package/dist/esm/index194.js +10 -0
  107. package/dist/esm/index195.js +14 -0
  108. package/dist/esm/index196.js +69 -0
  109. package/dist/esm/index197.js +68 -0
  110. package/dist/esm/index198.js +188 -0
  111. package/dist/esm/index199.js +25 -0
  112. package/dist/esm/index20.js +43 -0
  113. package/dist/esm/index200.js +45 -0
  114. package/dist/esm/index201.js +79 -0
  115. package/dist/esm/index202.js +43 -0
  116. package/dist/esm/index203.js +19 -0
  117. package/dist/esm/index204.js +16 -0
  118. package/dist/esm/index205.js +10 -0
  119. package/dist/esm/index206.js +9 -0
  120. package/dist/esm/index207.js +39 -0
  121. package/dist/esm/index208.js +18 -0
  122. package/dist/esm/index209.js +11 -0
  123. package/dist/esm/index21.js +40 -0
  124. package/dist/esm/index210.js +15 -0
  125. package/dist/esm/index211.js +12 -0
  126. package/dist/esm/index212.js +19 -0
  127. package/dist/esm/index213.js +25 -0
  128. package/dist/esm/index214.js +33 -0
  129. package/dist/esm/index215.js +4 -0
  130. package/dist/esm/index216.js +16 -0
  131. package/dist/esm/index217.js +15 -0
  132. package/dist/esm/index218.js +50 -0
  133. package/dist/esm/index219.js +12 -0
  134. package/dist/esm/index22.js +61 -0
  135. package/dist/esm/index220.js +16 -0
  136. package/dist/esm/index221.js +17 -0
  137. package/dist/esm/index222.js +11 -0
  138. package/dist/esm/index223.js +18 -0
  139. package/dist/esm/index224.js +27 -0
  140. package/dist/esm/index225.js +14 -0
  141. package/dist/esm/index226.js +27 -0
  142. package/dist/esm/index227.js +54 -0
  143. package/dist/esm/index228.js +20 -0
  144. package/dist/esm/index229.js +17 -0
  145. package/dist/esm/index23.js +166 -0
  146. package/dist/esm/index230.js +14 -0
  147. package/dist/esm/index231.js +106 -0
  148. package/dist/esm/index232.js +9 -0
  149. package/dist/esm/index233.js +227 -0
  150. package/dist/esm/index234.js +9 -0
  151. package/dist/esm/index235.js +9 -0
  152. package/dist/esm/index236.js +29 -0
  153. package/dist/esm/index237.js +22 -0
  154. package/dist/esm/index238.js +149 -0
  155. package/dist/esm/index239.js +15 -0
  156. package/dist/esm/index24.js +42 -0
  157. package/dist/esm/index240.js +38 -0
  158. package/dist/esm/index241.js +44 -0
  159. package/dist/esm/index242.js +71 -0
  160. package/dist/esm/index243.js +6 -0
  161. package/dist/esm/index244.js +158 -0
  162. package/dist/esm/index245.js +12 -0
  163. package/dist/esm/index246.js +139 -0
  164. package/dist/esm/index247.js +19 -0
  165. package/dist/esm/index248.js +116 -0
  166. package/dist/esm/index249.js +137 -0
  167. package/dist/esm/index25.js +12 -0
  168. package/dist/esm/index250.js +81 -0
  169. package/dist/esm/index251.js +4 -0
  170. package/dist/esm/index252.js +701 -0
  171. package/dist/esm/index253.js +142 -0
  172. package/dist/esm/index254.js +45 -0
  173. package/dist/esm/index255.js +204 -0
  174. package/dist/esm/index256.js +68 -0
  175. package/dist/esm/index257.js +7 -0
  176. package/dist/esm/index258.js +43 -0
  177. package/dist/esm/index259.js +10 -0
  178. package/dist/esm/index26.js +34 -0
  179. package/dist/esm/index260.js +65 -0
  180. package/dist/esm/index261.js +80 -0
  181. package/dist/esm/index262.js +6 -0
  182. package/dist/esm/index263.js +197 -0
  183. package/dist/esm/index264.js +66 -0
  184. package/dist/esm/index265.js +47 -0
  185. package/dist/esm/index266.js +7 -0
  186. package/dist/esm/index267.js +7 -0
  187. package/dist/esm/index268.js +4 -0
  188. package/dist/esm/index269.js +24 -0
  189. package/dist/esm/index27.js +39 -0
  190. package/dist/esm/index28.js +12 -0
  191. package/dist/esm/index29.js +32 -0
  192. package/dist/esm/index3.js +65 -36
  193. package/dist/esm/index30.js +49 -0
  194. package/dist/esm/index31.js +91 -0
  195. package/dist/esm/index32.js +43 -0
  196. package/dist/esm/index33.js +11 -0
  197. package/dist/esm/index34.js +9 -0
  198. package/dist/esm/index35.js +19 -0
  199. package/dist/esm/index36.js +11 -0
  200. package/dist/esm/index37.js +16 -0
  201. package/dist/esm/index38.js +10 -0
  202. package/dist/esm/index39.js +12 -0
  203. package/dist/esm/index4.js +20 -0
  204. package/dist/esm/index40.js +19 -0
  205. package/dist/esm/index41.js +49 -0
  206. package/dist/esm/index42.js +16 -0
  207. package/dist/esm/index43.js +19 -0
  208. package/dist/esm/index44.js +16 -0
  209. package/dist/esm/index45.js +9 -0
  210. package/dist/esm/index46.js +38 -0
  211. package/dist/esm/index47.js +12 -0
  212. package/dist/esm/index48.js +11 -0
  213. package/dist/esm/index49.js +28 -0
  214. package/dist/esm/index5.js +14 -0
  215. package/dist/esm/index50.js +13 -0
  216. package/dist/esm/index51.js +17 -0
  217. package/dist/esm/index52.js +14 -0
  218. package/dist/esm/index53.js +119 -0
  219. package/dist/esm/index54.js +36 -0
  220. package/dist/esm/index55.js +82 -0
  221. package/dist/esm/index56.js +180 -0
  222. package/dist/esm/index57.js +47 -0
  223. package/dist/esm/index58.js +9 -0
  224. package/dist/esm/index59.js +16 -0
  225. package/dist/esm/index6.js +56 -0
  226. package/dist/esm/index60.js +16 -0
  227. package/dist/esm/index61.js +102 -0
  228. package/dist/esm/index62.js +75 -0
  229. package/dist/esm/index63.js +90 -0
  230. package/dist/esm/index64.js +151 -0
  231. package/dist/esm/index65.js +139 -0
  232. package/dist/esm/index66.js +71 -0
  233. package/dist/esm/index67.js +26 -0
  234. package/dist/esm/index68.js +108 -0
  235. package/dist/esm/index69.js +9 -0
  236. package/dist/esm/index7.js +60 -0
  237. package/dist/esm/index70.js +134 -0
  238. package/dist/esm/index71.js +278 -0
  239. package/dist/esm/index72.js +5 -0
  240. package/dist/esm/index73.js +6 -0
  241. package/dist/esm/index74.js +11 -0
  242. package/dist/esm/index75.js +4 -0
  243. package/dist/esm/index76.js +4 -0
  244. package/dist/esm/index77.js +5 -0
  245. package/dist/esm/index78.js +329 -0
  246. package/dist/esm/index79.js +16 -0
  247. package/dist/esm/index8.js +58 -0
  248. package/dist/esm/index80.js +7 -0
  249. package/dist/esm/index81.js +58 -0
  250. package/dist/esm/index82.js +4 -0
  251. package/dist/esm/index83.js +10 -0
  252. package/dist/esm/index84.js +217 -0
  253. package/dist/esm/index85.js +34 -0
  254. package/dist/esm/index86.js +24 -0
  255. package/dist/esm/index87.js +8 -0
  256. package/dist/esm/index88.js +76 -0
  257. package/dist/esm/index89.js +8 -0
  258. package/dist/esm/index9.js +35 -0
  259. package/dist/esm/index90.js +8 -0
  260. package/dist/esm/index91.js +38 -0
  261. package/dist/esm/index92.js +78 -0
  262. package/dist/esm/index93.js +5 -0
  263. package/dist/esm/index94.js +26 -0
  264. package/dist/esm/index95.js +454 -0
  265. package/dist/esm/index96.js +33 -0
  266. package/dist/esm/index97.js +29 -0
  267. package/dist/esm/index98.js +36 -0
  268. package/dist/esm/index99.js +37 -0
  269. package/dist/types/index.d.ts +39 -3
  270. package/package.json +3 -3
@@ -0,0 +1,106 @@
1
+ import { HashMD as D, SHA256_IV as b, Chi as g, Maj as p } from "./index250.js";
2
+ import { createHasher as u, clean as C, rotr as i } from "./index238.js";
3
+ const B = /* @__PURE__ */ Uint32Array.from([
4
+ 1116352408,
5
+ 1899447441,
6
+ 3049323471,
7
+ 3921009573,
8
+ 961987163,
9
+ 1508970993,
10
+ 2453635748,
11
+ 2870763221,
12
+ 3624381080,
13
+ 310598401,
14
+ 607225278,
15
+ 1426881987,
16
+ 1925078388,
17
+ 2162078206,
18
+ 2614888103,
19
+ 3248222580,
20
+ 3835390401,
21
+ 4022224774,
22
+ 264347078,
23
+ 604807628,
24
+ 770255983,
25
+ 1249150122,
26
+ 1555081692,
27
+ 1996064986,
28
+ 2554220882,
29
+ 2821834349,
30
+ 2952996808,
31
+ 3210313671,
32
+ 3336571891,
33
+ 3584528711,
34
+ 113926993,
35
+ 338241895,
36
+ 666307205,
37
+ 773529912,
38
+ 1294757372,
39
+ 1396182291,
40
+ 1695183700,
41
+ 1986661051,
42
+ 2177026350,
43
+ 2456956037,
44
+ 2730485921,
45
+ 2820302411,
46
+ 3259730800,
47
+ 3345764771,
48
+ 3516065817,
49
+ 3600352804,
50
+ 4094571909,
51
+ 275423344,
52
+ 430227734,
53
+ 506948616,
54
+ 659060556,
55
+ 883997877,
56
+ 958139571,
57
+ 1322822218,
58
+ 1537002063,
59
+ 1747873779,
60
+ 1955562222,
61
+ 2024104815,
62
+ 2227730452,
63
+ 2361852424,
64
+ 2428436474,
65
+ 2756734187,
66
+ 3204031479,
67
+ 3329325298
68
+ ]), h = /* @__PURE__ */ new Uint32Array(64);
69
+ class E extends D {
70
+ constructor(o = 32) {
71
+ super(64, o, 8, !1), this.A = b[0] | 0, this.B = b[1] | 0, this.C = b[2] | 0, this.D = b[3] | 0, this.E = b[4] | 0, this.F = b[5] | 0, this.G = b[6] | 0, this.H = b[7] | 0;
72
+ }
73
+ get() {
74
+ const { A: o, B: r, C: t, D: s, E: a, F: f, G: c, H: e } = this;
75
+ return [o, r, t, s, a, f, c, e];
76
+ }
77
+ // prettier-ignore
78
+ set(o, r, t, s, a, f, c, e) {
79
+ this.A = o | 0, this.B = r | 0, this.C = t | 0, this.D = s | 0, this.E = a | 0, this.F = f | 0, this.G = c | 0, this.H = e | 0;
80
+ }
81
+ process(o, r) {
82
+ for (let x = 0; x < 16; x++, r += 4)
83
+ h[x] = o.getUint32(r, !1);
84
+ for (let x = 16; x < 64; x++) {
85
+ const H = h[x - 15], d = h[x - 2], m = i(H, 7) ^ i(H, 18) ^ H >>> 3, l = i(d, 17) ^ i(d, 19) ^ d >>> 10;
86
+ h[x] = l + h[x - 7] + m + h[x - 16] | 0;
87
+ }
88
+ let { A: t, B: s, C: a, D: f, E: c, F: e, G: n, H: A } = this;
89
+ for (let x = 0; x < 64; x++) {
90
+ const H = i(c, 6) ^ i(c, 11) ^ i(c, 25), d = A + H + g(c, e, n) + B[x] + h[x] | 0, l = (i(t, 2) ^ i(t, 13) ^ i(t, 22)) + p(t, s, a) | 0;
91
+ A = n, n = e, e = c, c = f + d | 0, f = a, a = s, s = t, t = d + l | 0;
92
+ }
93
+ t = t + this.A | 0, s = s + this.B | 0, a = a + this.C | 0, f = f + this.D | 0, c = c + this.E | 0, e = e + this.F | 0, n = n + this.G | 0, A = A + this.H | 0, this.set(t, s, a, f, c, e, n, A);
94
+ }
95
+ roundClean() {
96
+ C(h);
97
+ }
98
+ destroy() {
99
+ this.set(0, 0, 0, 0, 0, 0, 0, 0), C(this.buffer);
100
+ }
101
+ }
102
+ const y = /* @__PURE__ */ u(() => new E());
103
+ export {
104
+ E as SHA256,
105
+ y as sha256
106
+ };
@@ -0,0 +1,9 @@
1
+ import { weierstrass as s } from "./index252.js";
2
+ /*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
3
+ function c(e, t) {
4
+ const r = (o) => s({ ...e, hash: o });
5
+ return { ...r(t), create: r };
6
+ }
7
+ export {
8
+ c as createCurve
9
+ };
@@ -0,0 +1,227 @@
1
+ import { numberToBytesLE as y, numberToBytesBE as I, bitMask as Z, bytesToNumberLE as S, bytesToNumberBE as _, _validateObject as j } from "./index253.js";
2
+ import { anumber as z } from "./index238.js";
3
+ /*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
4
+ const g = BigInt(0), d = BigInt(1), q = /* @__PURE__ */ BigInt(2), V = /* @__PURE__ */ BigInt(3), x = /* @__PURE__ */ BigInt(4), T = /* @__PURE__ */ BigInt(5), L = /* @__PURE__ */ BigInt(8);
5
+ function h(t, n) {
6
+ const o = t % n;
7
+ return o >= g ? o : n + o;
8
+ }
9
+ function O(t, n, o) {
10
+ let r = t;
11
+ for (; n-- > g; )
12
+ r *= r, r %= o;
13
+ return r;
14
+ }
15
+ function B(t, n) {
16
+ if (t === g)
17
+ throw new Error("invert: expected non-zero number");
18
+ if (n <= g)
19
+ throw new Error("invert: expected positive modulus, got " + n);
20
+ let o = h(t, n), r = n, s = g, f = d;
21
+ for (; o !== g; ) {
22
+ const u = r / o, i = r % o, w = s - f * u;
23
+ r = o, o = i, s = f, f = w;
24
+ }
25
+ if (r !== d)
26
+ throw new Error("invert: does not exist");
27
+ return h(s, n);
28
+ }
29
+ function M(t, n) {
30
+ const o = (t.ORDER + d) / x, r = t.pow(n, o);
31
+ if (!t.eql(t.sqr(r), n))
32
+ throw new Error("Cannot find square root");
33
+ return r;
34
+ }
35
+ function H(t, n) {
36
+ const o = (t.ORDER - T) / L, r = t.mul(n, q), s = t.pow(r, o), f = t.mul(n, s), c = t.mul(t.mul(f, q), s), u = t.mul(f, t.sub(c, t.ONE));
37
+ if (!t.eql(t.sqr(u), n))
38
+ throw new Error("Cannot find square root");
39
+ return u;
40
+ }
41
+ function K(t) {
42
+ if (t < BigInt(3))
43
+ throw new Error("sqrt is not defined for small field");
44
+ let n = t - d, o = 0;
45
+ for (; n % q === g; )
46
+ n /= q, o++;
47
+ let r = q;
48
+ const s = U(t);
49
+ for (; N(s, r) === 1; )
50
+ if (r++ > 1e3)
51
+ throw new Error("Cannot find square root: probably non-prime P");
52
+ if (o === 1)
53
+ return M;
54
+ let f = s.pow(r, n);
55
+ const c = (n + d) / q;
56
+ return function(i, w) {
57
+ if (i.is0(w))
58
+ return w;
59
+ if (N(i, w) !== 1)
60
+ throw new Error("Cannot find square root");
61
+ let e = o, l = i.mul(i.ONE, f), a = i.pow(w, n), b = i.pow(w, c);
62
+ for (; !i.eql(a, i.ONE); ) {
63
+ if (i.is0(a))
64
+ return i.ZERO;
65
+ let m = 1, E = i.sqr(a);
66
+ for (; !i.eql(E, i.ONE); )
67
+ if (m++, E = i.sqr(E), m === e)
68
+ throw new Error("Cannot find square root");
69
+ const C = d << BigInt(e - m - 1), v = i.pow(l, C);
70
+ e = m, l = i.sqr(v), a = i.mul(a, l), b = i.mul(b, v);
71
+ }
72
+ return b;
73
+ };
74
+ }
75
+ function Q(t) {
76
+ return t % x === V ? M : t % L === T ? H : K(t);
77
+ }
78
+ const Y = [
79
+ "create",
80
+ "isValid",
81
+ "is0",
82
+ "neg",
83
+ "inv",
84
+ "sqrt",
85
+ "sqr",
86
+ "eql",
87
+ "add",
88
+ "sub",
89
+ "mul",
90
+ "pow",
91
+ "div",
92
+ "addN",
93
+ "subN",
94
+ "mulN",
95
+ "sqrN"
96
+ ];
97
+ function P(t) {
98
+ const n = {
99
+ ORDER: "bigint",
100
+ MASK: "bigint",
101
+ BYTES: "number",
102
+ BITS: "number"
103
+ }, o = Y.reduce((r, s) => (r[s] = "function", r), n);
104
+ return j(t, o), t;
105
+ }
106
+ function k(t, n, o) {
107
+ if (o < g)
108
+ throw new Error("invalid exponent, negatives unsupported");
109
+ if (o === g)
110
+ return t.ONE;
111
+ if (o === d)
112
+ return n;
113
+ let r = t.ONE, s = n;
114
+ for (; o > g; )
115
+ o & d && (r = t.mul(r, s)), s = t.sqr(s), o >>= d;
116
+ return r;
117
+ }
118
+ function G(t, n, o = !1) {
119
+ const r = new Array(n.length).fill(o ? t.ZERO : void 0), s = n.reduce((c, u, i) => t.is0(u) ? c : (r[i] = c, t.mul(c, u)), t.ONE), f = t.inv(s);
120
+ return n.reduceRight((c, u, i) => t.is0(u) ? c : (r[i] = t.mul(c, r[i]), t.mul(c, u)), f), r;
121
+ }
122
+ function N(t, n) {
123
+ const o = (t.ORDER - d) / q, r = t.pow(n, o), s = t.eql(r, t.ONE), f = t.eql(r, t.ZERO), c = t.eql(r, t.neg(t.ONE));
124
+ if (!s && !f && !c)
125
+ throw new Error("invalid Legendre symbol result");
126
+ return s ? 1 : f ? 0 : -1;
127
+ }
128
+ function J(t, n) {
129
+ n !== void 0 && z(n);
130
+ const o = n !== void 0 ? n : t.toString(2).length, r = Math.ceil(o / 8);
131
+ return { nBitLength: o, nByteLength: r };
132
+ }
133
+ function U(t, n, o = !1, r = {}) {
134
+ if (t <= g)
135
+ throw new Error("invalid field: expected ORDER > 0, got " + t);
136
+ let s, f;
137
+ if (typeof n == "object" && n != null) {
138
+ if (r.sqrt || o)
139
+ throw new Error("cannot specify opts in two arguments");
140
+ const e = n;
141
+ e.BITS && (s = e.BITS), e.sqrt && (f = e.sqrt), typeof e.isLE == "boolean" && (o = e.isLE);
142
+ } else
143
+ typeof n == "number" && (s = n), r.sqrt && (f = r.sqrt);
144
+ const { nBitLength: c, nByteLength: u } = J(t, s);
145
+ if (u > 2048)
146
+ throw new Error("invalid field: expected ORDER of <= 2048 bytes");
147
+ let i;
148
+ const w = Object.freeze({
149
+ ORDER: t,
150
+ isLE: o,
151
+ BITS: c,
152
+ BYTES: u,
153
+ MASK: Z(c),
154
+ ZERO: g,
155
+ ONE: d,
156
+ create: (e) => h(e, t),
157
+ isValid: (e) => {
158
+ if (typeof e != "bigint")
159
+ throw new Error("invalid field element: expected bigint, got " + typeof e);
160
+ return g <= e && e < t;
161
+ },
162
+ is0: (e) => e === g,
163
+ // is valid and invertible
164
+ isValidNot0: (e) => !w.is0(e) && w.isValid(e),
165
+ isOdd: (e) => (e & d) === d,
166
+ neg: (e) => h(-e, t),
167
+ eql: (e, l) => e === l,
168
+ sqr: (e) => h(e * e, t),
169
+ add: (e, l) => h(e + l, t),
170
+ sub: (e, l) => h(e - l, t),
171
+ mul: (e, l) => h(e * l, t),
172
+ pow: (e, l) => k(w, e, l),
173
+ div: (e, l) => h(e * B(l, t), t),
174
+ // Same as above, but doesn't normalize
175
+ sqrN: (e) => e * e,
176
+ addN: (e, l) => e + l,
177
+ subN: (e, l) => e - l,
178
+ mulN: (e, l) => e * l,
179
+ inv: (e) => B(e, t),
180
+ sqrt: f || ((e) => (i || (i = Q(t)), i(w, e))),
181
+ toBytes: (e) => o ? y(e, u) : I(e, u),
182
+ fromBytes: (e) => {
183
+ if (e.length !== u)
184
+ throw new Error("Field.fromBytes: expected " + u + " bytes, got " + e.length);
185
+ return o ? S(e) : _(e);
186
+ },
187
+ // TODO: we don't need it here, move out to separate fn
188
+ invertBatch: (e) => G(w, e),
189
+ // We can't move this out because Fp6, Fp12 implement it
190
+ // and it's unclear what to return in there.
191
+ cmov: (e, l, a) => a ? l : e
192
+ });
193
+ return Object.freeze(w);
194
+ }
195
+ function A(t) {
196
+ if (typeof t != "bigint")
197
+ throw new Error("field order must be bigint");
198
+ const n = t.toString(2).length;
199
+ return Math.ceil(n / 8);
200
+ }
201
+ function W(t) {
202
+ const n = A(t);
203
+ return n + Math.ceil(n / 2);
204
+ }
205
+ function D(t, n, o = !1) {
206
+ const r = t.length, s = A(n), f = W(n);
207
+ if (r < 16 || r < f || r > 1024)
208
+ throw new Error("expected " + f + "-1024 bytes of input, got " + r);
209
+ const c = o ? S(t) : _(t), u = h(c, n - d) + d;
210
+ return o ? y(u, s) : I(u, s);
211
+ }
212
+ export {
213
+ U as Field,
214
+ G as FpInvertBatch,
215
+ N as FpLegendre,
216
+ k as FpPow,
217
+ Q as FpSqrt,
218
+ A as getFieldBytesLength,
219
+ W as getMinHashLength,
220
+ B as invert,
221
+ D as mapHashToField,
222
+ h as mod,
223
+ J as nLength,
224
+ O as pow2,
225
+ K as tonelliShanks,
226
+ P as validateField
227
+ };
@@ -0,0 +1,9 @@
1
+ import { toBytes as o } from "./index107.js";
2
+ import { keccak256 as r } from "./index109.js";
3
+ const e = (t) => r(o(t));
4
+ function c(t) {
5
+ return e(t);
6
+ }
7
+ export {
8
+ c as hashSignature
9
+ };
@@ -0,0 +1,9 @@
1
+ import { normalizeSignature as o } from "./index236.js";
2
+ import { formatAbiItem as n } from "./index191.js";
3
+ const m = (r) => {
4
+ const t = typeof r == "string" ? r : n(r);
5
+ return o(t);
6
+ };
7
+ export {
8
+ m as toSignature
9
+ };
@@ -0,0 +1,29 @@
1
+ import { BaseError as u } from "./index81.js";
2
+ function a(r) {
3
+ let l = !0, i = "", f = 0, t = "", o = !1;
4
+ for (let n = 0; n < r.length; n++) {
5
+ const e = r[n];
6
+ if (["(", ")", ","].includes(e) && (l = !0), e === "(" && f++, e === ")" && f--, !!l) {
7
+ if (f === 0) {
8
+ if (e === " " && ["event", "function", ""].includes(t))
9
+ t = "";
10
+ else if (t += e, e === ")") {
11
+ o = !0;
12
+ break;
13
+ }
14
+ continue;
15
+ }
16
+ if (e === " ") {
17
+ r[n - 1] !== "," && i !== "," && i !== ",(" && (i = "", l = !1);
18
+ continue;
19
+ }
20
+ t += e, i += e;
21
+ }
22
+ }
23
+ if (!o)
24
+ throw new u("Unable to normalize signature.");
25
+ return t;
26
+ }
27
+ export {
28
+ a as normalizeSignature
29
+ };
@@ -0,0 +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];
11
+ }
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;
15
+ 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
22
+ };
@@ -0,0 +1,149 @@
1
+ import { crypto as u } from "./index251.js";
2
+ /*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */
3
+ function w(t) {
4
+ return t instanceof Uint8Array || ArrayBuffer.isView(t) && t.constructor.name === "Uint8Array";
5
+ }
6
+ function l(t) {
7
+ if (!Number.isSafeInteger(t) || t < 0)
8
+ throw new Error("positive integer expected, got " + t);
9
+ }
10
+ function c(t, ...e) {
11
+ if (!w(t))
12
+ throw new Error("Uint8Array expected");
13
+ if (e.length > 0 && !e.includes(t.length))
14
+ throw new Error("Uint8Array expected of length " + e + ", got length=" + t.length);
15
+ }
16
+ function U(t) {
17
+ if (typeof t != "function" || typeof t.create != "function")
18
+ throw new Error("Hash should be wrapped by utils.createHasher");
19
+ l(t.outputLen), l(t.blockLen);
20
+ }
21
+ function B(t, e = !0) {
22
+ if (t.destroyed)
23
+ throw new Error("Hash instance has been destroyed");
24
+ if (e && t.finished)
25
+ throw new Error("Hash#digest() has already been called");
26
+ }
27
+ function H(t, e) {
28
+ c(t);
29
+ const n = e.outputLen;
30
+ if (t.length < n)
31
+ throw new Error("digestInto() expects output buffer of length at least " + n);
32
+ }
33
+ function L(t) {
34
+ return new Uint32Array(t.buffer, t.byteOffset, Math.floor(t.byteLength / 4));
35
+ }
36
+ function V(...t) {
37
+ for (let e = 0; e < t.length; e++)
38
+ t[e].fill(0);
39
+ }
40
+ function _(t) {
41
+ return new DataView(t.buffer, t.byteOffset, t.byteLength);
42
+ }
43
+ function S(t, e) {
44
+ return t << 32 - e | t >>> e;
45
+ }
46
+ const d = new Uint8Array(new Uint32Array([287454020]).buffer)[0] === 68;
47
+ function h(t) {
48
+ return t << 24 & 4278190080 | t << 8 & 16711680 | t >>> 8 & 65280 | t >>> 24 & 255;
49
+ }
50
+ function x(t) {
51
+ for (let e = 0; e < t.length; e++)
52
+ t[e] = h(t[e]);
53
+ return t;
54
+ }
55
+ const T = d ? (t) => t : x, p = /* @ts-ignore */ typeof Uint8Array.from([]).toHex == "function" && typeof Uint8Array.fromHex == "function", A = /* @__PURE__ */ Array.from({ length: 256 }, (t, e) => e.toString(16).padStart(2, "0"));
56
+ function k(t) {
57
+ if (c(t), p)
58
+ return t.toHex();
59
+ let e = "";
60
+ for (let n = 0; n < t.length; n++)
61
+ e += A[t[n]];
62
+ return e;
63
+ }
64
+ const f = { _0: 48, _9: 57, A: 65, F: 70, a: 97, f: 102 };
65
+ function y(t) {
66
+ if (t >= f._0 && t <= f._9)
67
+ return t - f._0;
68
+ if (t >= f.A && t <= f.F)
69
+ return t - (f.A - 10);
70
+ if (t >= f.a && t <= f.f)
71
+ return t - (f.a - 10);
72
+ }
73
+ function I(t) {
74
+ if (typeof t != "string")
75
+ throw new Error("hex string expected, got " + typeof t);
76
+ if (p)
77
+ return Uint8Array.fromHex(t);
78
+ const e = t.length, n = e / 2;
79
+ if (e % 2)
80
+ throw new Error("hex string expected, got unpadded hex of length " + e);
81
+ const r = new Uint8Array(n);
82
+ for (let o = 0, i = 0; o < n; o++, i += 2) {
83
+ const s = y(t.charCodeAt(i)), a = y(t.charCodeAt(i + 1));
84
+ if (s === void 0 || a === void 0) {
85
+ const g = t[i] + t[i + 1];
86
+ throw new Error('hex string expected, got non-hex character "' + g + '" at index ' + i);
87
+ }
88
+ r[o] = s * 16 + a;
89
+ }
90
+ return r;
91
+ }
92
+ function m(t) {
93
+ if (typeof t != "string")
94
+ throw new Error("string expected");
95
+ return new Uint8Array(new TextEncoder().encode(t));
96
+ }
97
+ function b(t) {
98
+ return typeof t == "string" && (t = m(t)), c(t), t;
99
+ }
100
+ function R(...t) {
101
+ let e = 0;
102
+ for (let r = 0; r < t.length; r++) {
103
+ const o = t[r];
104
+ c(o), e += o.length;
105
+ }
106
+ const n = new Uint8Array(e);
107
+ for (let r = 0, o = 0; r < t.length; r++) {
108
+ const i = t[r];
109
+ n.set(i, o), o += i.length;
110
+ }
111
+ return n;
112
+ }
113
+ class F {
114
+ }
115
+ function O(t) {
116
+ const e = (r) => t().update(b(r)).digest(), n = t();
117
+ return e.outputLen = n.outputLen, e.blockLen = n.blockLen, e.create = () => t(), e;
118
+ }
119
+ function v(t = 32) {
120
+ if (u && typeof u.getRandomValues == "function")
121
+ return u.getRandomValues(new Uint8Array(t));
122
+ if (u && typeof u.randomBytes == "function")
123
+ return Uint8Array.from(u.randomBytes(t));
124
+ throw new Error("crypto.getRandomValues must be defined");
125
+ }
126
+ export {
127
+ F as Hash,
128
+ c as abytes,
129
+ B as aexists,
130
+ U as ahash,
131
+ l as anumber,
132
+ H as aoutput,
133
+ h as byteSwap,
134
+ x as byteSwap32,
135
+ k as bytesToHex,
136
+ V as clean,
137
+ R as concatBytes,
138
+ O as createHasher,
139
+ _ as createView,
140
+ I as hexToBytes,
141
+ w as isBytes,
142
+ d as isLE,
143
+ v as randomBytes,
144
+ S as rotr,
145
+ T as swap32IfBE,
146
+ b as toBytes,
147
+ L as u32,
148
+ m as utf8ToBytes
149
+ };
@@ -0,0 +1,15 @@
1
+ const s = {
2
+ gasPriceOracle: { address: "0x420000000000000000000000000000000000000F" },
3
+ l1Block: { address: "0x4200000000000000000000000000000000000015" },
4
+ l2CrossDomainMessenger: {
5
+ address: "0x4200000000000000000000000000000000000007"
6
+ },
7
+ l2Erc721Bridge: { address: "0x4200000000000000000000000000000000000014" },
8
+ l2StandardBridge: { address: "0x4200000000000000000000000000000000000010" },
9
+ l2ToL1MessagePasser: {
10
+ address: "0x4200000000000000000000000000000000000016"
11
+ }
12
+ };
13
+ export {
14
+ s as contracts
15
+ };
@@ -0,0 +1,42 @@
1
+ import { parseAccount as P } from "./index10.js";
2
+ import { numberToHex as y } from "./index108.js";
3
+ import { getCallError as F } from "./index216.js";
4
+ import { extract as L } from "./index217.js";
5
+ import { formatTransactionRequest as A } from "./index143.js";
6
+ import { assertRequest as G } from "./index156.js";
7
+ async function _(t, e) {
8
+ const { account: o = t.account, blockNumber: r, blockTag: m = "latest", blobs: i, data: u, gas: f, gasPrice: b, maxFeePerBlobGas: p, maxFeePerGas: d, maxPriorityFeePerGas: h, to: l, value: x, ...g } = e, a = o ? P(o) : void 0;
9
+ try {
10
+ G(e);
11
+ const k = (typeof r == "bigint" ? y(r) : void 0) || m, c = t.chain?.formatters?.transactionRequest?.format, q = (c || A)({
12
+ // Pick out extra data that might exist on the chain's transaction request type.
13
+ ...L(g, { format: c }),
14
+ from: a?.address,
15
+ blobs: i,
16
+ data: u,
17
+ gas: f,
18
+ gasPrice: b,
19
+ maxFeePerBlobGas: p,
20
+ maxFeePerGas: d,
21
+ maxPriorityFeePerGas: h,
22
+ to: l,
23
+ value: x
24
+ }), n = await t.request({
25
+ method: "eth_createAccessList",
26
+ params: [q, k]
27
+ });
28
+ return {
29
+ accessList: n.accessList,
30
+ gasUsed: BigInt(n.gasUsed)
31
+ };
32
+ } catch (s) {
33
+ throw F(s, {
34
+ ...e,
35
+ account: a,
36
+ chain: t.chain
37
+ });
38
+ }
39
+ }
40
+ export {
41
+ _ as createAccessList
42
+ };
@@ -0,0 +1,38 @@
1
+ import { hexToBigInt as n } from "./index141.js";
2
+ import { defineBlock as r } from "./index113.js";
3
+ import { defineTransaction as s, formatTransaction as m } from "./index115.js";
4
+ import { defineTransactionReceipt as l } from "./index142.js";
5
+ const p = {
6
+ block: /* @__PURE__ */ r({
7
+ format(e) {
8
+ return {
9
+ transactions: e.transactions?.map((t) => {
10
+ if (typeof t == "string")
11
+ return t;
12
+ const i = m(t);
13
+ return i.typeHex === "0x7e" && (i.isSystemTx = t.isSystemTx, i.mint = t.mint ? n(t.mint) : void 0, i.sourceHash = t.sourceHash, i.type = "deposit"), i;
14
+ }),
15
+ stateRoot: e.stateRoot
16
+ };
17
+ }
18
+ }),
19
+ transaction: /* @__PURE__ */ s({
20
+ format(e) {
21
+ const o = {};
22
+ return e.type === "0x7e" && (o.isSystemTx = e.isSystemTx, o.mint = e.mint ? n(e.mint) : void 0, o.sourceHash = e.sourceHash, o.type = "deposit"), o;
23
+ }
24
+ }),
25
+ transactionReceipt: /* @__PURE__ */ l({
26
+ format(e) {
27
+ return {
28
+ l1GasPrice: e.l1GasPrice ? n(e.l1GasPrice) : null,
29
+ l1GasUsed: e.l1GasUsed ? n(e.l1GasUsed) : null,
30
+ l1Fee: e.l1Fee ? n(e.l1Fee) : null,
31
+ l1FeeScalar: e.l1FeeScalar ? Number(e.l1FeeScalar) : null
32
+ };
33
+ }
34
+ })
35
+ };
36
+ export {
37
+ p as formatters
38
+ };