@coinbase/cdp-hooks 0.0.94 → 0.0.96

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 (293) hide show
  1. package/dist/esm/index100.js +27 -44
  2. package/dist/esm/index101.js +44 -86
  3. package/dist/esm/index102.js +66 -37
  4. package/dist/esm/index103.js +40 -8
  5. package/dist/esm/index104.js +75 -6
  6. package/dist/esm/index105.js +31 -16
  7. package/dist/esm/index106.js +6 -8
  8. package/dist/esm/index107.js +16 -13
  9. package/dist/esm/index108.js +8 -7
  10. package/dist/esm/index109.js +13 -9
  11. package/dist/esm/index110.js +7 -16
  12. package/dist/esm/index111.js +9 -46
  13. package/dist/esm/index112.js +16 -13
  14. package/dist/esm/index113.js +11 -15
  15. package/dist/esm/index114.js +46 -13
  16. package/dist/esm/index115.js +13 -6
  17. package/dist/esm/index116.js +15 -34
  18. package/dist/esm/index117.js +13 -9
  19. package/dist/esm/index118.js +5 -7
  20. package/dist/esm/index119.js +35 -25
  21. package/dist/esm/index120.js +9 -10
  22. package/dist/esm/index121.js +7 -13
  23. package/dist/esm/index122.js +28 -11
  24. package/dist/esm/index123.js +10 -116
  25. package/dist/esm/index124.js +13 -32
  26. package/dist/esm/index125.js +11 -79
  27. package/dist/esm/index126.js +113 -170
  28. package/dist/esm/index127.js +26 -37
  29. package/dist/esm/index128.js +80 -6
  30. package/dist/esm/index129.js +177 -13
  31. package/dist/esm/index130.js +44 -13
  32. package/dist/esm/index131.js +6 -99
  33. package/dist/esm/index132.js +153 -71
  34. package/dist/esm/index133.js +14 -87
  35. package/dist/esm/index134.js +14 -148
  36. package/dist/esm/index135.js +93 -130
  37. package/dist/esm/index136.js +65 -61
  38. package/dist/esm/index137.js +87 -23
  39. package/dist/esm/index138.js +145 -102
  40. package/dist/esm/index139.js +136 -6
  41. package/dist/esm/index140.js +65 -128
  42. package/dist/esm/index141.js +24 -276
  43. package/dist/esm/index142.js +159 -3
  44. package/dist/esm/index143.js +7 -4
  45. package/dist/esm/index144.js +12 -9
  46. package/dist/esm/index145.js +20 -2
  47. package/dist/esm/index146.js +136 -2
  48. package/dist/esm/index147.js +79 -3
  49. package/dist/esm/index148.js +6 -323
  50. package/dist/esm/index149.js +28 -13
  51. package/dist/esm/index150.js +89 -4
  52. package/dist/esm/index151.js +351 -56
  53. package/dist/esm/index152.js +3 -2
  54. package/dist/esm/index153.js +5 -8
  55. package/dist/esm/index154.js +2 -215
  56. package/dist/esm/index155.js +3 -32
  57. package/dist/esm/index156.js +9 -22
  58. package/dist/esm/index157.js +326 -5
  59. package/dist/esm/index158.js +11 -71
  60. package/dist/esm/index159.js +4 -5
  61. package/dist/esm/index160.js +55 -5
  62. package/dist/esm/index161.js +10 -33
  63. package/dist/esm/index162.js +2 -76
  64. package/dist/esm/index163.js +8 -3
  65. package/dist/esm/index164.js +22 -15
  66. package/dist/esm/index165.js +193 -430
  67. package/dist/esm/index166.js +32 -31
  68. package/dist/esm/index167.js +20 -25
  69. package/dist/esm/index168.js +5 -33
  70. package/dist/esm/index169.js +72 -33
  71. package/dist/esm/index170.js +5 -193
  72. package/dist/esm/index171.js +5 -8
  73. package/dist/esm/index172.js +36 -2
  74. package/dist/esm/index173.js +115 -8
  75. package/dist/esm/index174.js +3 -19
  76. package/dist/esm/index175.js +13 -22
  77. package/dist/esm/index176.js +26 -8
  78. package/dist/esm/index177.js +29 -51
  79. package/dist/esm/index178.js +32 -43
  80. package/dist/esm/index179.js +23 -8
  81. package/dist/esm/index180.js +8 -7
  82. package/dist/esm/index181.js +193 -16
  83. package/dist/esm/index182.js +2 -19
  84. package/dist/esm/index183.js +468 -25
  85. package/dist/esm/index184.js +27 -16
  86. package/dist/esm/index185.js +159 -53
  87. package/dist/esm/index186.js +21 -11
  88. package/dist/esm/index187.js +124 -157
  89. package/dist/esm/index188.js +37 -20
  90. package/dist/esm/index189.js +6 -127
  91. package/dist/esm/index190.js +24 -35
  92. package/dist/esm/index191.js +55 -6
  93. package/dist/esm/index192.js +42 -24
  94. package/dist/esm/index193.js +12 -12
  95. package/dist/esm/index194.js +2 -2
  96. package/dist/esm/index195.js +57 -48
  97. package/dist/esm/index196.js +21 -3
  98. package/dist/esm/index197.js +3 -21
  99. package/dist/esm/index198.js +4 -4
  100. package/dist/esm/index199.js +3 -3
  101. package/dist/esm/index2.js +2 -2
  102. package/dist/esm/index200.js +2 -2
  103. package/dist/esm/index201.js +16 -32
  104. package/dist/esm/index202.js +35 -3
  105. package/dist/esm/index203.js +3 -19
  106. package/dist/esm/index204.js +18 -27
  107. package/dist/esm/index205.js +25 -33
  108. package/dist/esm/index206.js +35 -7
  109. package/dist/esm/index207.js +8 -25
  110. package/dist/esm/index208.js +7 -28
  111. package/dist/esm/index209.js +24 -63
  112. package/dist/esm/index210.js +28 -9
  113. package/dist/esm/index211.js +3 -33
  114. package/dist/esm/index212.js +79 -27
  115. package/dist/esm/index213.js +9 -24
  116. package/dist/esm/index214.js +12 -3
  117. package/dist/esm/index215.js +21 -14
  118. package/dist/esm/index216.js +8 -103
  119. package/dist/esm/index217.js +9 -63
  120. package/dist/esm/index218.js +11 -5
  121. package/dist/esm/index219.js +6 -6
  122. package/dist/esm/index220.js +6 -27
  123. package/dist/esm/index221.js +13 -38
  124. package/dist/esm/index222.js +32 -13
  125. package/dist/esm/index223.js +5 -43
  126. package/dist/esm/index224.js +37 -5
  127. package/dist/esm/index225.js +110 -11
  128. package/dist/esm/index226.js +48 -19
  129. package/dist/esm/index227.js +30 -76
  130. package/dist/esm/index228.js +18 -2
  131. package/dist/esm/index229.js +17 -35
  132. package/dist/esm/index230.js +40 -108
  133. package/dist/esm/index231.js +40 -46
  134. package/dist/esm/index232.js +8 -32
  135. package/dist/esm/index233.js +7 -8
  136. package/dist/esm/index234.js +16 -6
  137. package/dist/esm/index235.js +22 -6
  138. package/dist/esm/index236.js +24 -11
  139. package/dist/esm/index237.js +16 -10
  140. package/dist/esm/index238.js +54 -13
  141. package/dist/esm/index239.js +27 -32
  142. package/dist/esm/index240.js +25 -5
  143. package/dist/esm/index241.js +104 -8
  144. package/dist/esm/index242.js +3 -20
  145. package/dist/esm/index243.js +5 -31
  146. package/dist/esm/index244.js +31 -20
  147. package/dist/esm/index245.js +20 -3
  148. package/dist/esm/index246.js +3 -17
  149. package/dist/esm/index247.js +17 -10
  150. package/dist/esm/index248.js +5 -21
  151. package/dist/esm/index249.js +8 -22
  152. package/dist/esm/index250.js +103 -5
  153. package/dist/esm/index251.js +64 -5
  154. package/dist/esm/index252.js +5 -8
  155. package/dist/esm/index253.js +6 -104
  156. package/dist/esm/index254.js +28 -3
  157. package/dist/esm/index255.js +33 -18
  158. package/dist/esm/index256.js +13 -171
  159. package/dist/esm/index257.js +16 -17
  160. package/dist/esm/index258.js +79 -10
  161. package/dist/esm/index259.js +2 -39
  162. package/dist/esm/index260.js +15 -2
  163. package/dist/esm/index261.js +18 -69
  164. package/dist/esm/index262.js +170 -33
  165. package/dist/esm/index263.js +16 -13
  166. package/dist/esm/index264.js +10 -40
  167. package/dist/esm/index265.js +10 -2
  168. package/dist/esm/index266.js +38 -4
  169. package/dist/esm/index267.js +2 -11
  170. package/dist/esm/index268.js +69 -19
  171. package/dist/esm/index269.js +34 -7
  172. package/dist/esm/index270.js +13 -10
  173. package/dist/esm/index271.js +40 -66
  174. package/dist/esm/index272.js +2 -66
  175. package/dist/esm/index273.js +4 -185
  176. package/dist/esm/index274.js +8 -20
  177. package/dist/esm/index275.js +17 -40
  178. package/dist/esm/index276.js +7 -76
  179. package/dist/esm/index277.js +10 -39
  180. package/dist/esm/index278.js +72 -16
  181. package/dist/esm/index279.js +64 -12
  182. package/dist/esm/index280.js +187 -7
  183. package/dist/esm/index281.js +22 -6
  184. package/dist/esm/index282.js +42 -36
  185. package/dist/esm/index283.js +25 -15
  186. package/dist/esm/index284.js +90 -8
  187. package/dist/esm/index285.js +40 -12
  188. package/dist/esm/index286.js +16 -9
  189. package/dist/esm/index287.js +12 -15
  190. package/dist/esm/index288.js +7 -22
  191. package/dist/esm/index289.js +6 -30
  192. package/dist/esm/index290.js +37 -2
  193. package/dist/esm/index291.js +15 -13
  194. package/dist/esm/index292.js +8 -12
  195. package/dist/esm/index293.js +8 -47
  196. package/dist/esm/index294.js +16 -9
  197. package/dist/esm/index295.js +21 -12
  198. package/dist/esm/index296.js +30 -14
  199. package/dist/esm/index297.js +2 -9
  200. package/dist/esm/index298.js +13 -15
  201. package/dist/esm/index299.js +12 -24
  202. package/dist/esm/index3.js +1 -1
  203. package/dist/esm/index300.js +46 -10
  204. package/dist/esm/index301.js +9 -24
  205. package/dist/esm/index302.js +13 -51
  206. package/dist/esm/index303.js +13 -17
  207. package/dist/esm/index304.js +13 -13
  208. package/dist/esm/index305.js +8 -11
  209. package/dist/esm/index306.js +15 -103
  210. package/dist/esm/index307.js +24 -5
  211. package/dist/esm/index308.js +21 -220
  212. package/dist/esm/index309.js +31 -6
  213. package/dist/esm/index310.js +10 -7
  214. package/dist/esm/index311.js +49 -24
  215. package/dist/esm/index312.js +35 -17
  216. package/dist/esm/index313.js +18 -146
  217. package/dist/esm/index314.js +14 -12
  218. package/dist/esm/index315.js +12 -36
  219. package/dist/esm/index316.js +13 -42
  220. package/dist/esm/index317.js +20 -2
  221. package/dist/esm/index318.js +108 -69
  222. package/dist/esm/index319.js +103 -3
  223. package/dist/esm/index320.js +6 -136
  224. package/dist/esm/index321.js +7 -156
  225. package/dist/esm/index322.js +26 -9
  226. package/dist/esm/index323.js +15 -16
  227. package/dist/esm/index324.js +208 -108
  228. package/dist/esm/index325.js +12 -134
  229. package/dist/esm/index326.js +35 -78
  230. package/dist/esm/index327.js +42 -2
  231. package/dist/esm/index328.js +2 -698
  232. package/dist/esm/index329.js +67 -137
  233. package/dist/esm/index330.js +3 -42
  234. package/dist/esm/index331.js +127 -191
  235. package/dist/esm/index332.js +174 -3
  236. package/dist/esm/index333.js +9 -65
  237. package/dist/esm/index334.js +16 -4
  238. package/dist/esm/index335.js +128 -35
  239. package/dist/esm/index336.js +193 -7
  240. package/dist/esm/index337.js +2 -63
  241. package/dist/esm/index338.js +72 -71
  242. package/dist/esm/index339.js +15 -4
  243. package/dist/esm/index340.js +85 -189
  244. package/dist/esm/index341.js +144 -44
  245. package/dist/esm/index342.js +41 -43
  246. package/dist/esm/index343.js +655 -4
  247. package/dist/esm/index344.js +206 -5
  248. package/dist/esm/index345.js +177 -2
  249. package/dist/esm/index346.js +3 -21
  250. package/dist/esm/index347.js +43 -0
  251. package/dist/esm/index348.js +7 -0
  252. package/dist/esm/index349.js +10 -0
  253. package/dist/esm/index350.js +65 -0
  254. package/dist/esm/index351.js +80 -0
  255. package/dist/esm/index352.js +122 -0
  256. package/dist/esm/index353.js +345 -0
  257. package/dist/esm/index354.js +163 -0
  258. package/dist/esm/index355.js +7 -0
  259. package/dist/esm/index356.js +7 -0
  260. package/dist/esm/index357.js +55 -0
  261. package/dist/esm/index358.js +7 -0
  262. package/dist/esm/index359.js +4 -0
  263. package/dist/esm/index360.js +24 -0
  264. package/dist/esm/index71.js +26 -17
  265. package/dist/esm/index73.js +2 -2
  266. package/dist/esm/index74.js +12 -40
  267. package/dist/esm/index75.js +49 -58
  268. package/dist/esm/index76.js +13 -43
  269. package/dist/esm/index77.js +28 -5
  270. package/dist/esm/index78.js +30 -48
  271. package/dist/esm/index79.js +29 -32
  272. package/dist/esm/index80.js +56 -4
  273. package/dist/esm/index81.js +54 -10
  274. package/dist/esm/index82.js +57 -67
  275. package/dist/esm/index83.js +5 -10
  276. package/dist/esm/index84.js +47 -28
  277. package/dist/esm/index85.js +33 -69
  278. package/dist/esm/index86.js +3 -19
  279. package/dist/esm/index87.js +9 -110
  280. package/dist/esm/index88.js +118 -60
  281. package/dist/esm/index89.js +57 -20
  282. package/dist/esm/index90.js +22 -38
  283. package/dist/esm/index91.js +33 -34
  284. package/dist/esm/index92.js +38 -55
  285. package/dist/esm/index93.js +55 -160
  286. package/dist/esm/index94.js +162 -33
  287. package/dist/esm/index95.js +39 -9
  288. package/dist/esm/index96.js +8 -30
  289. package/dist/esm/index97.js +21 -26
  290. package/dist/esm/index98.js +35 -8
  291. package/dist/esm/index99.js +8 -28
  292. package/dist/types/index.d.ts +1 -3
  293. package/package.json +4 -4
@@ -1,35 +1,11 @@
1
- import { batchGatewayAbi as o } from "./index141.js";
2
- import { solidityError as l } from "./index155.js";
3
- import { decodeFunctionData as f } from "./index198.js";
4
- import { encodeErrorResult as n } from "./index204.js";
5
- import { encodeFunctionResult as p } from "./index208.js";
6
- const d = "x-batch-gateway:true";
7
- async function g(t) {
8
- const { data: i, ccipRequest: c } = t, { args: [u] } = f({ abi: o, data: i }), e = [], s = [];
9
- return await Promise.all(u.map(async (r, a) => {
10
- try {
11
- s[a] = r.urls.includes(d) ? await g({ data: r.data, ccipRequest: c }) : await c(r), e[a] = !1;
12
- } catch (m) {
13
- e[a] = !0, s[a] = h(m);
14
- }
15
- })), p({
16
- abi: o,
17
- functionName: "query",
18
- result: [e, s]
19
- });
20
- }
21
- function h(t) {
22
- return t.name === "HttpRequestError" && t.status ? n({
23
- abi: o,
24
- errorName: "HttpError",
25
- args: [t.status, t.shortMessage]
26
- }) : n({
27
- abi: [l],
28
- errorName: "Error",
29
- args: ["shortMessage" in t ? t.shortMessage : t.message]
30
- });
1
+ import { stringToBytes as t } from "./index191.js";
2
+ import { bytesToHex as e } from "./index192.js";
3
+ import { keccak256 as i } from "./index207.js";
4
+ import { encodedLabelToLabelhash as n } from "./index233.js";
5
+ function c(r) {
6
+ const o = new Uint8Array(32).fill(0);
7
+ return r ? n(r) || i(t(r)) : e(o);
31
8
  }
32
9
  export {
33
- g as localBatchGatewayRequest,
34
- d as localBatchGatewayUrl
10
+ c as labelhash
35
11
  };
@@ -1,11 +1,10 @@
1
- import { hexToBytes as i } from "./index177.js";
2
- import { bytesToHex as f } from "./index178.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 { isHex as e } from "./index211.js";
2
+ function t(n) {
3
+ if (n.length !== 66 || n.indexOf("[") !== 0 || n.indexOf("]") !== 65)
4
+ return null;
5
+ const r = `0x${n.slice(1, 65)}`;
6
+ return e(r) ? r : null;
8
7
  }
9
8
  export {
10
- y as blobsToCommitments
9
+ t as encodedLabelToLabelhash
11
10
  };
@@ -1,9 +1,19 @@
1
- import { bytesToHex as i } from "./index178.js";
2
- import { sha256 as m } from "./index235.js";
3
- function f(t) {
4
- const { commitment: e, version: s = 1 } = t, n = t.to ?? (typeof e == "string" ? "hex" : "bytes"), o = m(e);
5
- return o.set([s], 0), n === "bytes" ? o : i(o);
1
+ import { concat as a } from "./index201.js";
2
+ import { toBytes as m, stringToBytes as c } from "./index191.js";
3
+ import { bytesToHex as n } from "./index192.js";
4
+ import { keccak256 as i } from "./index207.js";
5
+ import { encodedLabelToLabelhash as f } from "./index233.js";
6
+ function u(r) {
7
+ let t = new Uint8Array(32).fill(0);
8
+ if (!r)
9
+ return n(t);
10
+ const e = r.split(".");
11
+ for (let o = e.length - 1; o >= 0; o -= 1) {
12
+ const s = f(e[o]), l = s ? m(s) : i(c(e[o]), "bytes");
13
+ t = i(a([t, l]), "bytes");
14
+ }
15
+ return n(t);
6
16
  }
7
17
  export {
8
- f as commitmentToVersionedHash
18
+ u as namehash
9
19
  };
@@ -1,9 +1,25 @@
1
- import { sha256 as o } from "./index254.js";
2
- import { isHex as s } from "./index214.js";
3
- import { toBytes as r } from "./index177.js";
4
- function p(t, i) {
5
- return o(s(t, { strict: !1 }) ? r(t) : t);
1
+ import { AbiDecodingZeroDataError as m } from "./index157.js";
2
+ import { BaseError as C } from "./index160.js";
3
+ import { RawContractError as l, ContractFunctionZeroDataError as w, ContractFunctionRevertedError as g, ContractFunctionExecutionError as D } from "./index165.js";
4
+ import { RpcRequestError as I } from "./index147.js";
5
+ import { InternalRpcError as v, InvalidInputRpcError as x } from "./index183.js";
6
+ const F = 3;
7
+ function Z(r, { abi: e, address: E, args: d, docsPath: u, functionName: o, sender: f }) {
8
+ const a = r instanceof l ? r : r instanceof C ? r.walk((R) => "data" in R) || r.walk() : {}, { code: c, data: t, details: n, message: s, shortMessage: i } = a, p = r instanceof m ? new w({ functionName: o }) : [F, v.code].includes(c) && (t || n || s || i) || c === x.code && n === "execution reverted" && t ? new g({
9
+ abi: e,
10
+ data: typeof t == "object" ? t.data : t,
11
+ functionName: o,
12
+ message: a instanceof I ? n : i ?? s
13
+ }) : r;
14
+ return new D(p, {
15
+ abi: e,
16
+ args: d,
17
+ contractAddress: E,
18
+ docsPath: u,
19
+ functionName: o,
20
+ sender: f
21
+ });
6
22
  }
7
23
  export {
8
- p as sha256
24
+ Z as getContractError
9
25
  };
@@ -1,14 +1,27 @@
1
- import { commitmentToVersionedHash as i } from "./index234.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 { defineFormatter as s } from "./index237.js";
2
+ import { formatTransaction as t } from "./index238.js";
3
+ function a(e, f) {
4
+ const i = (e.transactions ?? []).map((n) => typeof n == "string" ? n : t(n));
5
+ return {
6
+ ...e,
7
+ baseFeePerGas: e.baseFeePerGas ? BigInt(e.baseFeePerGas) : null,
8
+ blobGasUsed: e.blobGasUsed ? BigInt(e.blobGasUsed) : void 0,
9
+ difficulty: e.difficulty ? BigInt(e.difficulty) : void 0,
10
+ excessBlobGas: e.excessBlobGas ? BigInt(e.excessBlobGas) : void 0,
11
+ gasLimit: e.gasLimit ? BigInt(e.gasLimit) : void 0,
12
+ gasUsed: e.gasUsed ? BigInt(e.gasUsed) : void 0,
13
+ hash: e.hash ? e.hash : null,
14
+ logsBloom: e.logsBloom ? e.logsBloom : null,
15
+ nonce: e.nonce ? e.nonce : null,
16
+ number: e.number ? BigInt(e.number) : null,
17
+ size: e.size ? BigInt(e.size) : void 0,
18
+ timestamp: e.timestamp ? BigInt(e.timestamp) : void 0,
19
+ transactions: i,
20
+ totalDifficulty: e.totalDifficulty ? BigInt(e.totalDifficulty) : null
21
+ };
11
22
  }
23
+ const m = /* @__PURE__ */ s("block", a);
12
24
  export {
13
- r as commitmentsToVersionedHashes
25
+ m as defineBlock,
26
+ a as formatBlock
14
27
  };
@@ -1,13 +1,19 @@
1
- import { hexToBytes as b } from "./index177.js";
2
- import { bytesToHex as y } from "./index178.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
+ function i(f, n) {
2
+ return ({ exclude: t, format: m }) => ({
3
+ exclude: t,
4
+ format: (r, o) => {
5
+ const e = n(r, o);
6
+ if (t)
7
+ for (const a of t)
8
+ delete e[a];
9
+ return {
10
+ ...e,
11
+ ...m(r, o)
12
+ };
13
+ },
14
+ type: f
15
+ });
10
16
  }
11
17
  export {
12
- h as blobsToProofs
18
+ i as defineFormatter
13
19
  };
@@ -1,16 +1,57 @@
1
- import { blobsToCommitments as f } from "./index233.js";
2
- import { blobsToProofs as l } from "./index237.js";
3
- import { toBlobs as p } from "./index239.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 { hexToNumber as r } from "./index230.js";
2
+ import { defineFormatter as u } from "./index237.js";
3
+ const l = {
4
+ "0x0": "legacy",
5
+ "0x1": "eip2930",
6
+ "0x2": "eip1559",
7
+ "0x3": "eip4844",
8
+ "0x4": "eip7702"
9
+ };
10
+ function m(e, i) {
11
+ const d = {
12
+ ...e,
13
+ blockHash: e.blockHash ? e.blockHash : null,
14
+ blockNumber: e.blockNumber ? BigInt(e.blockNumber) : null,
15
+ chainId: e.chainId ? r(e.chainId) : void 0,
16
+ gas: e.gas ? BigInt(e.gas) : void 0,
17
+ gasPrice: e.gasPrice ? BigInt(e.gasPrice) : void 0,
18
+ maxFeePerBlobGas: e.maxFeePerBlobGas ? BigInt(e.maxFeePerBlobGas) : void 0,
19
+ maxFeePerGas: e.maxFeePerGas ? BigInt(e.maxFeePerGas) : void 0,
20
+ maxPriorityFeePerGas: e.maxPriorityFeePerGas ? BigInt(e.maxPriorityFeePerGas) : void 0,
21
+ nonce: e.nonce ? r(e.nonce) : void 0,
22
+ to: e.to ? e.to : null,
23
+ transactionIndex: e.transactionIndex ? Number(e.transactionIndex) : null,
24
+ type: e.type ? l[e.type] : void 0,
25
+ typeHex: e.type ? e.type : void 0,
26
+ value: e.value ? BigInt(e.value) : void 0,
27
+ v: e.v ? BigInt(e.v) : void 0
28
+ };
29
+ return e.authorizationList && (d.authorizationList = f(e.authorizationList)), d.yParity = (() => {
30
+ if (e.yParity)
31
+ return Number(e.yParity);
32
+ if (typeof d.v == "bigint") {
33
+ if (d.v === 0n || d.v === 27n)
34
+ return 0;
35
+ if (d.v === 1n || d.v === 28n)
36
+ return 1;
37
+ if (d.v >= 35n)
38
+ return d.v % 2n === 0n ? 1 : 0;
39
+ }
40
+ })(), d.type === "legacy" && (delete d.accessList, delete d.maxFeePerBlobGas, delete d.maxFeePerGas, delete d.maxPriorityFeePerGas, delete d.yParity), d.type === "eip2930" && (delete d.maxFeePerBlobGas, delete d.maxFeePerGas, delete d.maxPriorityFeePerGas), d.type === "eip1559" && delete d.maxFeePerBlobGas, d;
41
+ }
42
+ const x = /* @__PURE__ */ u("transaction", m);
43
+ function f(e) {
44
+ return e.map((i) => ({
45
+ address: i.address,
46
+ chainId: Number(i.chainId),
47
+ nonce: Number(i.nonce),
48
+ r: i.r,
49
+ s: i.s,
50
+ yParity: Number(i.yParity)
51
+ }));
13
52
  }
14
53
  export {
15
- k as toBlobSidecars
54
+ x as defineTransaction,
55
+ m as formatTransaction,
56
+ l as transactionType
16
57
  };
@@ -1,35 +1,30 @@
1
- import { maxBytesPerTransaction as y, fieldElementsPerBlob as a, bytesPerFieldElement as f, bytesPerBlob as p } from "./index240.js";
2
- import { EmptyBlobError as c, BlobSizeTooLargeError as h } from "./index229.js";
3
- import { createCursor as B } from "./index189.js";
4
- import { size as u } from "./index150.js";
5
- import { hexToBytes as x } from "./index177.js";
6
- import { bytesToHex as d } from "./index178.js";
7
- function S(e) {
8
- const m = e.to ?? (typeof e.data == "string" ? "hex" : "bytes"), i = typeof e.data == "string" ? x(e.data) : e.data, o = u(i);
9
- if (!o)
10
- throw new c();
11
- if (o > y)
12
- throw new h({
13
- maxSize: y,
14
- size: o
15
- });
16
- const s = [];
17
- let n = !0, r = 0;
18
- for (; n; ) {
19
- const t = B(new Uint8Array(p));
20
- let l = 0;
21
- for (; l < a; ) {
22
- const b = i.slice(r, r + (f - 1));
23
- if (t.pushByte(0), t.pushBytes(b), b.length < 31) {
24
- t.pushByte(128), n = !1;
25
- break;
26
- }
27
- l++, r += 31;
28
- }
29
- s.push(t);
30
- }
31
- return m === "bytes" ? s.map((t) => t.bytes) : s.map((t) => d(t.bytes));
1
+ import { hexToNumber as d } from "./index230.js";
2
+ import { defineFormatter as b } from "./index237.js";
3
+ import { formatLog as m } from "./index214.js";
4
+ import { transactionType as o } from "./index238.js";
5
+ const f = {
6
+ "0x0": "reverted",
7
+ "0x1": "success"
8
+ };
9
+ function r(l, e) {
10
+ const s = {
11
+ ...l,
12
+ blockNumber: l.blockNumber ? BigInt(l.blockNumber) : null,
13
+ contractAddress: l.contractAddress ? l.contractAddress : null,
14
+ cumulativeGasUsed: l.cumulativeGasUsed ? BigInt(l.cumulativeGasUsed) : null,
15
+ effectiveGasPrice: l.effectiveGasPrice ? BigInt(l.effectiveGasPrice) : null,
16
+ gasUsed: l.gasUsed ? BigInt(l.gasUsed) : null,
17
+ logs: l.logs ? l.logs.map((u) => m(u)) : null,
18
+ to: l.to ? l.to : null,
19
+ transactionIndex: l.transactionIndex ? d(l.transactionIndex) : null,
20
+ status: l.status ? f[l.status] : null,
21
+ type: l.type ? o[l.type] || l.type : null
22
+ };
23
+ return l.blobGasPrice && (s.blobGasPrice = BigInt(l.blobGasPrice)), l.blobGasUsed && (s.blobGasUsed = BigInt(l.blobGasUsed)), s;
32
24
  }
25
+ const v = /* @__PURE__ */ b("transactionReceipt", r);
33
26
  export {
34
- S as toBlobs
27
+ v as defineTransactionReceipt,
28
+ r as formatTransactionReceipt,
29
+ f as receiptStatuses
35
30
  };
@@ -1,7 +1,27 @@
1
- const e = 32, s = 4096, t = 131072, l = 761855;
1
+ import { bytesToHex as o, numberToHex as i } from "./index192.js";
2
+ const a = {
3
+ legacy: "0x0",
4
+ eip2930: "0x1",
5
+ eip1559: "0x2",
6
+ eip4844: "0x3",
7
+ eip7702: "0x4"
8
+ };
9
+ function c(e, n) {
10
+ const f = {};
11
+ return typeof e.authorizationList < "u" && (f.authorizationList = y(e.authorizationList)), typeof e.accessList < "u" && (f.accessList = e.accessList), typeof e.blobVersionedHashes < "u" && (f.blobVersionedHashes = e.blobVersionedHashes), typeof e.blobs < "u" && (typeof e.blobs[0] != "string" ? f.blobs = e.blobs.map((d) => o(d)) : f.blobs = e.blobs), typeof e.data < "u" && (f.data = e.data), e.account && (f.from = e.account.address), typeof e.from < "u" && (f.from = e.from), typeof e.gas < "u" && (f.gas = i(e.gas)), typeof e.gasPrice < "u" && (f.gasPrice = i(e.gasPrice)), typeof e.maxFeePerBlobGas < "u" && (f.maxFeePerBlobGas = i(e.maxFeePerBlobGas)), typeof e.maxFeePerGas < "u" && (f.maxFeePerGas = i(e.maxFeePerGas)), typeof e.maxPriorityFeePerGas < "u" && (f.maxPriorityFeePerGas = i(e.maxPriorityFeePerGas)), typeof e.nonce < "u" && (f.nonce = i(e.nonce)), typeof e.to < "u" && (f.to = e.to), typeof e.type < "u" && (f.type = a[e.type]), typeof e.value < "u" && (f.value = i(e.value)), f;
12
+ }
13
+ function y(e) {
14
+ return e.map((n) => ({
15
+ address: n.address,
16
+ r: n.r ? i(BigInt(n.r)) : n.r,
17
+ s: n.s ? i(BigInt(n.s)) : n.s,
18
+ chainId: i(n.chainId),
19
+ nonce: i(n.nonce),
20
+ ...typeof n.yParity < "u" ? { yParity: i(n.yParity) } : {},
21
+ ...typeof n.v < "u" && typeof n.yParity > "u" ? { v: i(n.v) } : {}
22
+ }));
23
+ }
2
24
  export {
3
- t as bytesPerBlob,
4
- e as bytesPerFieldElement,
5
- s as fieldElementsPerBlob,
6
- l as maxBytesPerTransaction
25
+ c as formatTransactionRequest,
26
+ a as rpcTransactionType
7
27
  };
@@ -1,11 +1,107 @@
1
- function n(e) {
2
- return {
3
- formatters: void 0,
4
- fees: void 0,
5
- serializers: void 0,
6
- ...e
7
- };
1
+ import { split as L, rotlBH as T, rotlSH as S, rotlBL as m, rotlSL as F } from "./index317.js";
2
+ import { createHasher as X, Hash as E, anumber as d, u32 as U, swap32IfBE as I, aexists as x, toBytes as P, abytes as k, aoutput as M, clean as y } from "./index318.js";
3
+ const R = BigInt(0), f = BigInt(1), j = BigInt(2), q = BigInt(7), v = BigInt(256), z = BigInt(113), _ = [], g = [], B = [];
4
+ for (let n = 0, t = f, s = 1, i = 0; n < 24; n++) {
5
+ [s, i] = [i, (2 * s + 3 * i) % 5], _.push(2 * (5 * i + s)), g.push((n + 1) * (n + 2) / 2 % 64);
6
+ let o = R;
7
+ for (let r = 0; r < 7; r++)
8
+ t = (t << f ^ (t >> q) * z) % v, t & j && (o ^= f << (f << /* @__PURE__ */ BigInt(r)) - f);
9
+ B.push(o);
8
10
  }
11
+ const A = L(B, !0), C = A[0], D = A[1], O = (n, t, s) => s > 32 ? T(n, t, s) : S(n, t, s), w = (n, t, s) => s > 32 ? m(n, t, s) : F(n, t, s);
12
+ function G(n, t = 24) {
13
+ const s = new Uint32Array(10);
14
+ for (let i = 24 - t; i < 24; i++) {
15
+ for (let e = 0; e < 10; e++)
16
+ s[e] = n[e] ^ n[e + 10] ^ n[e + 20] ^ n[e + 30] ^ n[e + 40];
17
+ for (let e = 0; e < 10; e += 2) {
18
+ const h = (e + 8) % 10, l = (e + 2) % 10, u = s[l], c = s[l + 1], b = O(u, c, 1) ^ s[h], H = w(u, c, 1) ^ s[h + 1];
19
+ for (let a = 0; a < 50; a += 10)
20
+ n[e + a] ^= b, n[e + a + 1] ^= H;
21
+ }
22
+ let o = n[2], r = n[3];
23
+ for (let e = 0; e < 24; e++) {
24
+ const h = g[e], l = O(o, r, h), u = w(o, r, h), c = _[e];
25
+ o = n[c], r = n[c + 1], n[c] = l, n[c + 1] = u;
26
+ }
27
+ for (let e = 0; e < 50; e += 10) {
28
+ for (let h = 0; h < 10; h++)
29
+ s[h] = n[e + h];
30
+ for (let h = 0; h < 10; h++)
31
+ n[e + h] ^= ~s[(h + 2) % 10] & s[(h + 4) % 10];
32
+ }
33
+ n[0] ^= C[i], n[1] ^= D[i];
34
+ }
35
+ y(s);
36
+ }
37
+ class p extends E {
38
+ // NOTE: we accept arguments in bytes instead of bits here.
39
+ constructor(t, s, i, o = !1, r = 24) {
40
+ if (super(), this.pos = 0, this.posOut = 0, this.finished = !1, this.destroyed = !1, this.enableXOF = !1, this.blockLen = t, this.suffix = s, this.outputLen = i, this.enableXOF = o, this.rounds = r, d(i), !(0 < t && t < 200))
41
+ throw new Error("only keccak-f1600 function is supported");
42
+ this.state = new Uint8Array(200), this.state32 = U(this.state);
43
+ }
44
+ clone() {
45
+ return this._cloneInto();
46
+ }
47
+ keccak() {
48
+ I(this.state32), G(this.state32, this.rounds), I(this.state32), this.posOut = 0, this.pos = 0;
49
+ }
50
+ update(t) {
51
+ x(this), t = P(t), k(t);
52
+ const { blockLen: s, state: i } = this, o = t.length;
53
+ for (let r = 0; r < o; ) {
54
+ const e = Math.min(s - this.pos, o - r);
55
+ for (let h = 0; h < e; h++)
56
+ i[this.pos++] ^= t[r++];
57
+ this.pos === s && this.keccak();
58
+ }
59
+ return this;
60
+ }
61
+ finish() {
62
+ if (this.finished)
63
+ return;
64
+ this.finished = !0;
65
+ const { state: t, suffix: s, pos: i, blockLen: o } = this;
66
+ t[i] ^= s, (s & 128) !== 0 && i === o - 1 && this.keccak(), t[o - 1] ^= 128, this.keccak();
67
+ }
68
+ writeInto(t) {
69
+ x(this, !1), k(t), this.finish();
70
+ const s = this.state, { blockLen: i } = this;
71
+ for (let o = 0, r = t.length; o < r; ) {
72
+ this.posOut >= i && this.keccak();
73
+ const e = Math.min(i - this.posOut, r - o);
74
+ t.set(s.subarray(this.posOut, this.posOut + e), o), this.posOut += e, o += e;
75
+ }
76
+ return t;
77
+ }
78
+ xofInto(t) {
79
+ if (!this.enableXOF)
80
+ throw new Error("XOF is not possible for this instance");
81
+ return this.writeInto(t);
82
+ }
83
+ xof(t) {
84
+ return d(t), this.xofInto(new Uint8Array(t));
85
+ }
86
+ digestInto(t) {
87
+ if (M(t, this), this.finished)
88
+ throw new Error("digest() was already called");
89
+ return this.writeInto(t), this.destroy(), t;
90
+ }
91
+ digest() {
92
+ return this.digestInto(new Uint8Array(this.outputLen));
93
+ }
94
+ destroy() {
95
+ this.destroyed = !0, y(this.state);
96
+ }
97
+ _cloneInto(t) {
98
+ const { blockLen: s, suffix: i, outputLen: o, rounds: r, enableXOF: e } = this;
99
+ return t || (t = new p(s, i, o, e, r)), t.state32.set(this.state32), t.pos = this.pos, t.posOut = this.posOut, t.finished = this.finished, t.rounds = r, t.suffix = i, t.outputLen = o, t.enableXOF = e, t.destroyed = this.destroyed, t;
100
+ }
101
+ }
102
+ const J = (n, t, s) => X(() => new p(t, n, s)), Q = J(1, 136, 256 / 8);
9
103
  export {
10
- n as defineChain
104
+ p as Keccak,
105
+ G as keccakP,
106
+ Q as keccak_256
11
107
  };
@@ -1,22 +1,5 @@
1
- import { ChainDoesNotSupportContract as e } from "./index166.js";
2
- function a({ blockNumber: o, chain: r, contract: c }) {
3
- const t = r?.contracts?.[c];
4
- if (!t)
5
- throw new e({
6
- chain: r,
7
- contract: { name: c }
8
- });
9
- if (o && t.blockCreated && t.blockCreated > o)
10
- throw new e({
11
- blockNumber: o,
12
- chain: r,
13
- contract: {
14
- name: c,
15
- blockCreated: t.blockCreated
16
- }
17
- });
18
- return t.address;
19
- }
1
+ import { sha256 as s } from "./index319.js";
2
+ const o = s;
20
3
  export {
21
- a as getChainContractAddress
4
+ o as sha256
22
5
  };
@@ -1,34 +1,8 @@
1
- const i = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Map();
2
- function p(o) {
3
- const a = (s, t) => ({
4
- clear: () => t.delete(s),
5
- get: () => t.get(s),
6
- set: (r) => t.set(s, r)
7
- }), n = a(o, i), e = a(o, c);
8
- return {
9
- clear: () => {
10
- n.clear(), e.clear();
11
- },
12
- promise: n,
13
- response: e
14
- };
15
- }
16
- async function l(o, { cacheKey: a, cacheTime: n = Number.POSITIVE_INFINITY }) {
17
- const e = p(a), s = e.response.get();
18
- if (s && n > 0 && (/* @__PURE__ */ new Date()).getTime() - s.created.getTime() < n)
19
- return s.data;
20
- let t = e.promise.get();
21
- t || (t = o(), e.promise.set(t));
22
- try {
23
- const r = await t;
24
- return e.response.set({ created: /* @__PURE__ */ new Date(), data: r }), r;
25
- } finally {
26
- e.promise.clear();
27
- }
1
+ import { hashSignature as t } from "./index320.js";
2
+ import { toSignature as o } from "./index321.js";
3
+ function a(r) {
4
+ return t(o(r));
28
5
  }
29
6
  export {
30
- p as getCache,
31
- i as promiseCache,
32
- c as responseCache,
33
- l as withCache
7
+ a as toSignatureHash
34
8
  };
@@ -1,23 +1,34 @@
1
- import { wait as w } from "./index245.js";
2
- function p(n, { delay: e = 100, retryCount: o = 2, shouldRetry: c = () => !0 } = {}) {
3
- return new Promise((s, y) => {
4
- const a = async ({ count: r = 0 } = {}) => {
5
- const f = async ({ error: t }) => {
6
- const i = typeof e == "function" ? e({ count: r, error: t }) : e;
7
- i && await w(i), a({ count: r + 1 });
8
- };
9
- try {
10
- const t = await n();
11
- s(t);
12
- } catch (t) {
13
- if (r < o && await c({ count: r, error: t }))
14
- return f({ error: t });
15
- y(t);
16
- }
17
- };
18
- a();
19
- });
1
+ const i = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Map();
2
+ function p(o) {
3
+ const a = (s, t) => ({
4
+ clear: () => t.delete(s),
5
+ get: () => t.get(s),
6
+ set: (r) => t.set(s, r)
7
+ }), n = a(o, i), e = a(o, c);
8
+ return {
9
+ clear: () => {
10
+ n.clear(), e.clear();
11
+ },
12
+ promise: n,
13
+ response: e
14
+ };
15
+ }
16
+ async function l(o, { cacheKey: a, cacheTime: n = Number.POSITIVE_INFINITY }) {
17
+ const e = p(a), s = e.response.get();
18
+ if (s && n > 0 && Date.now() - s.created.getTime() < n)
19
+ return s.data;
20
+ let t = e.promise.get();
21
+ t || (t = o(), e.promise.set(t));
22
+ try {
23
+ const r = await t;
24
+ return e.response.set({ created: /* @__PURE__ */ new Date(), data: r }), r;
25
+ } finally {
26
+ e.promise.clear();
27
+ }
20
28
  }
21
29
  export {
22
- p as withRetry
30
+ p as getCache,
31
+ i as promiseCache,
32
+ c as responseCache,
33
+ l as withCache
23
34
  };
@@ -1,6 +1,23 @@
1
- async function n(e) {
2
- return new Promise((t) => setTimeout(t, e));
1
+ import { wait as w } from "./index246.js";
2
+ function p(n, { delay: e = 100, retryCount: o = 2, shouldRetry: c = () => !0 } = {}) {
3
+ return new Promise((s, y) => {
4
+ const a = async ({ count: r = 0 } = {}) => {
5
+ const f = async ({ error: t }) => {
6
+ const i = typeof e == "function" ? e({ count: r, error: t }) : e;
7
+ i && await w(i), a({ count: r + 1 });
8
+ };
9
+ try {
10
+ const t = await n();
11
+ s(t);
12
+ } catch (t) {
13
+ if (r < o && await c({ count: r, error: t }))
14
+ return f({ error: t });
15
+ y(t);
16
+ }
17
+ };
18
+ a();
19
+ });
3
20
  }
4
21
  export {
5
- n as wait
22
+ p as withRetry
6
23
  };
@@ -1,20 +1,6 @@
1
- function u(n, { errorInstance: i = new Error("timed out"), timeout: t, signal: l }) {
2
- return new Promise((a, o) => {
3
- (async () => {
4
- let e;
5
- try {
6
- const r = new AbortController();
7
- t > 0 && (e = setTimeout(() => {
8
- l && r.abort();
9
- }, t)), a(await n({ signal: r?.signal || null }));
10
- } catch (r) {
11
- r?.name === "AbortError" && o(i), o(r);
12
- } finally {
13
- clearTimeout(e);
14
- }
15
- })();
16
- });
1
+ async function n(e) {
2
+ return new Promise((t) => setTimeout(t, e));
17
3
  }
18
4
  export {
19
- u as withTimeout
5
+ n as wait
20
6
  };